Question 36
In YACC / BISON parser generators, what file extension is conventionally used for input parser specification files?
YACC and Bison specification files use the .y extension.
In YACC / BISON parser generators, what file extension is conventionally used for input parser specification files?
YACC and Bison specification files use the .y extension.
What default action does YACC perform when encountering a Shift/Reduce conflict in an ambiguous context-free grammar?
By default, YACC resolves Shift/Reduce conflicts in favor of Shift (which correctly solves the dangling-else ambiguity).
What default action does YACC perform when encountering a Reduce/Reduce conflict?
YACC resolves Reduce/Reduce conflicts by choosing the production listed first (earliest) in the grammar file.
In Panic-Mode Error Recovery for LL(1) parsers, which set of terminal symbols is chosen as synchronizing tokens?
Synchronizing token sets in Panic Mode typically include FOLLOW(A), high-level construct delimiters (semicolons, braces), and FIRST(A) symbols.
If a CFG rule is E -> E + T | T, how can left recursion be eliminated to make it suitable for top-down LL(1) parsing?
Standard left-recursion removal rule: A -> A $\alpha | \beta becomes A -> \beta A'$ and A' -> $\alpha A' | \epsilon$.