Difference between revisions of "Bottom-Up Parsing/SLR(1) Exercise 03"

From Wiki**3

< Bottom-Up Parsing
(Problema)
 
Line 2: Line 2:
 
Considere a gramática G seguinte, onde S é o símbolo inicial e '''a''' e '''b''' são símbolos terminais.  
 
Considere a gramática G seguinte, onde S é o símbolo inicial e '''a''' e '''b''' são símbolos terminais.  
  
  S -> A a A b | B b B a
+
  S A a A b | B b B a
  A -> ε
+
  A ε
  B -> ε
+
  B ε
  
 
Demonstre que esta gramática é LL(1), mas não LR(0).
 
Demonstre que esta gramática é LL(1), mas não LR(0).

Latest revision as of 11:34, 2 May 2024

Problema

Considere a gramática G seguinte, onde S é o símbolo inicial e a e b são símbolos terminais.

S → A a A b | B b B a
A → ε
B → ε

Demonstre que esta gramática é LL(1), mas não LR(0).

Solução