LR Parser Flashcards
LR Parser
input is scanned left-to-right and a rightmost derivation is constructed
SLR
simple LR
LALR
look ahead LR
What is the most general grammar?
LR
What is the most specific grammar?
SLR
LR parsers to time and space __________ in the size of input
linear
Which is more powerful, LR or LL?
LR
Which is more natural, LR or LL?
LR
Disadvantages of LR grammar?
harder to write parser, larger table size, more difficult error repair
What does the stack represent in a bottom up parser?
summary of input already seen
shift operation
shif the next input token from the input to the top of the stack
reduce operation
pop N symbols on stack that match a RHS of production and push non-term
What type of derivation is constructed for LR?
reverse rightmost derivation
reduction
each step of building the parse tree (add a new nonterm as parent of subtree)
What actions can an LR parser perform?
shift, reduce, accept, reject