(→Solution) |
(→Problem) |
||
(One intermediate revision by the same user not shown) | |||
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. | ||
Line 20: | Line 20: | ||
* [[Media:co12-2012060603.pdf|solution (draft)]] | * [[Media:co12-2012060603.pdf|solution (draft)]] | ||
− | [[category: | + | [[category:Compiladores]] |
− | [[category: | + | [[category:Ensino]] |
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}).