(→Problem) |
|||
Line 4: | Line 4: | ||
Consider the following grammar. '''C''' is the start symbold and '''{ w, x, y, z }''' is the set of terminal symbols. | Consider the following grammar. '''C''' is the start symbold and '''{ w, x, y, z }''' is the set of terminal symbols. | ||
− | + | A → y | ε | |
− | + | B → C x | x A | |
− | + | C → D x B | A w | |
− | + | D → w | z | ε | |
# Construa a tabela de análise para um analisador sintáctico ascendente LALR(1) para esta gramática, indicando o conjunto de estados do analisador e os símbolos de antevisão. A gramática é SLR(1)? Justifique. | # Construa a tabela de análise para um analisador sintáctico ascendente LALR(1) para esta gramática, indicando o conjunto de estados do analisador e os símbolos de antevisão. A gramática é SLR(1)? Justifique. |
Contents[hide] |
Consider the following grammar. C is the start symbold and { w, x, y, z } is the set of terminal symbols.
A → y | ε B → C x | x A C → D x B | A w D → w | z | ε
Small bug: state 9 has {$,x} as lookahead set (and not only {x}).