(→Problem) |
(→Problem) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{TOCright}} | {{TOCright}} | ||
− | = Problem = | + | == Problem == |
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 16: | Line 16: | ||
== Solution == | == Solution == | ||
− | [[category: | + | Small bug: state 9 has {$,x} as lookahead set (and not only {x}). |
− | [[category: | + | |
+ | * [[Media:co12-2012060603.pdf|solution (draft)]] | ||
+ | |||
+ | [[category:Compiladores]] | ||
+ | [[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}).