Práctica: Arbol de Análisis Abstracto

Complete la fase de análisis sintáctico para la gramática de Tutu extendida con sentencias de bloque (vea las reglas 1,2,3 y 11) construyendo el AAA según el lenguaje árbol especificado por una gramática árbol que extienda la dada en la definición 2.9.7. Genere pruebas, usando make test para comprobar el correcto funcionamiento de su analizador sobre las mismas. Utilize el módulo Data::Dumper para volcar las estructuras de datos resultantes.



1 p $ \rightarrow$ b
2 b $ \rightarrow$ ds ss
3 b $ \rightarrow$ ss
4 ds $ \rightarrow$ d ';' ds
5 ds $ \rightarrow$ d ';'
6 d $ \rightarrow$ INT il
7 d $ \rightarrow$ STRING il
8 ss $ \rightarrow$ s ';' ss
9 ss $ \rightarrow$ s
10 s $ \rightarrow$ ID = e
11 s $ \rightarrow$ '{' b '}'
12 s $ \rightarrow$ P e
13 s $ \rightarrow \epsilon$
14 e $ \rightarrow$ e1 '+' t
15 e $ \rightarrow$ e1 '-' t
16 e $ \rightarrow$ t
17 t $ \rightarrow$ t1 '*' f
18 t $ \rightarrow$ t '/' f
19 t $ \rightarrow$ f
20 f $ \rightarrow$ '(' e ')'
21 f $ \rightarrow$ ID
22 f $ \rightarrow$ NUM
23 f $ \rightarrow$ STR
24 il $ \rightarrow$ ID ',' il
25 il $ \rightarrow$ ID


Casiano Rodríguez León
2009-12-09