Question 46
What stack operations are used by a Shift-Reduce Bottom-Up parser during parsing?
A shift-reduce parser operates via four primary actions: Shift, Reduce, Accept, and Error.
What stack operations are used by a Shift-Reduce Bottom-Up parser during parsing?
A shift-reduce parser operates via four primary actions: Shift, Reduce, Accept, and Error.
In a parse tree for a context-free grammar, what do the leaf nodes represent?
Parse-tree leaves represent terminal symbols, with \epsilon as a possible leaf in the usual representation. None of A-D states that, so E is correct.
In a parse tree, what do the internal (interior) non-leaf nodes represent?
Interior nodes of a parse tree correspond to non-terminals expanded according to grammar production rules.
Which parsing strategy builds the parse tree starting from the root non-terminal symbol down towards the input terminals?
Top-down parsing starts at the start symbol (root) and expands non-terminals downwards to match input tokens.
Which parsing strategy builds the parse tree starting from the input terminals upwards towards the root start symbol?
Bottom-up parsing starts with input tokens at leaves and reduces substrings upwards until reaching the start symbol.