WeChat:lovexc60
For problems 1 through 10 select the SINGLE (best) answer. Each of these questions is
1. When do undeclared identifiers get detected in MFPL?
2. In the MFPL programming language used for HW #3 and #4, a scope is opened
a. as soon as we start up the interpreter
3. If processing a production A → B { } C D, bison would refer to C as:
a. $1
4. According to the specifications of HW #4, which arg would we flag an error on in the
a. Arg 1
5. According to the specifications of HW #4, which arg would we flag an error on in the
a. Arg 1
6. Based on the way you were supposed to implement HW #4, recursive function
a. TRUE b. FALSE
7. In the MFPL statement below, how many symbol tables should be open at the
(let* ( (x 1)
a. 1
worth 1 point.
a. when recognizing the ident token in the flex specification file
b. when processing the ident in EXPR → ident
c. when processing the ident in ID_LIST → ID_LIST ident for a LAMBDA_EXPR
d. when processing the ident in ID_EXPR_LIST → ID_EXPR_LIST ( ident EXPR )
for a LET_EXPR
(i.e., a symbol table is created):
b. whenever we process a left parenthesis
c. whenever we process a progn expression
d. whenever we process a let* expression
e. all of the above
b. $2
c. $3
d. $4
e. $$
following MFPL expression:
(<= “Ryan the dog” 150) ; she actually only weighs 110 lbs
b. Arg 2
c. Arg 3
d. This is a trick question – there is no error!
following MFPL expression:
(print (print (+ “Hello” “world!”)))
b. Arg 2
c. Arg 3
d. Arg 4
e. This is a trick question – there is no error!
calls are allowed in MFPL.
time that (f x) is parsed?
(f (lambda (a)
(let* ( (y (input))
)
(print (* a y))
)
)
)
)
(f x)
)
b. 2
c. 3
d. none of the above is correct