Summer 2018 CS320 Midterm

代做CS320留学生作业、代写Multiple Choice作业、代做C/C++编程作业、C/C++语言作业代写
Summer 2018 CS320 Midterm 4
Section A – Multiple Choice & True/False ( 6pts )

1)Which form of grammar checking do we perform during compilation/interpretation?
a.Context Free Grammar
b.Parsed Grammar Checking
c.Tokenization
d.Infix to Postfix
2)Which mechanism do we use to create OOP in Lua?
a.Dictionaries.
b.Aggregation.
c.Metatables.
d.Metalogic.
3)Which kind of parsing can take a very long time for a computer?
a.Bottom Up Parsing.
b.Shift Reduce Parsing.
c.Left Right Parsing.
d.Top Down Parsing.
Section B – Short Answer (25 words or less for each) ( 15pts )
1)Why do we perform Grammar checking on expressions in programming languages?

2)What does left and right recursion refer to when considering CFGs?

3)Which OOP mechanisms does Lua lack by default? (Without implementing a Metafunction)


4)Briefly describe what the Left and Right mean in Left-Right parsing?

5)How do we overcome potential ambiguity of parsing in bottom up parsers?

Section C – True/False ( 10pts/2pts each )
1)Given the following grammar, which of the following sentences are valid?
Rule 1) E -> 1E1
Rule 2) E -> 0EE
Rule 3) E -> E1
Rule 4) E -> eps

I.101001 TRUE FALSE
II.110111 TRUE FALSE
III.010011 TRUE FALSE

IV.0101 TRUE FALSE
V.110 TRUE FALSE
VI.001 TRUE FALSE

http://www.6daixie.com/contents/13/2338.html
Section D – Program ( 10 pts )

Given the following Lua code, write the equivalent C++ code.
1)function F(a)
local b = a / 3
return a + b
end

因为专业,所以值得信赖。如有需要,请加QQ99515681 或邮箱:[email protected] 

微信:codinghelp

猜你喜欢

转载自www.cnblogs.com/javaeeeee/p/10088812.html
今日推荐