Exam 3: Compiler Construction and Parsing Algorithms
Exam 1: Formal Languages and Automata Theory: Part A25 Questions
Exam 2: Formal Languages and Automata Theory: Part B25 Questions
Exam 3: Compiler Construction and Parsing Algorithms24 Questions
Exam 4: Compilation and Programming Languages22 Questions
Select questions type
Consider the following grammar:
S ? FR
R ? S | ?
F ? id
In the predictive parser table, M, of the grammar the entries M[S, id] and M[R, $]respectively.
(Multiple Choice)
4.9/5
(41)
Consider the following expression grammar. The seman-tic rules for expressioncalculation are stated next to each grammar production.
E ? number E.val = number. val
| E '+' E E(1).val = E(2).val + E(3).val
| E '×' E E(1).val = E(2).val × E(3).val
The above grammar and the semantic rules are fed to a yacc tool (which is an LALR (1)parser generator) for parsing and evaluating arithmetic expressions. Which one of thefollowing is true about the action of yacc for the given grammar?
(Multiple Choice)
4.8/5
(31)
A canonical set of items is given below
S --> L. > R
Q --> R.
On input symbol < the set has
(Multiple Choice)
4.9/5
(44)
Showing 21 - 24 of 24
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)