Está en la página 1de 1

TALLER ESTRUCTURA DE LENGUAJES

GENERACION DE CODIGO
Agregar las instrucciones correspondientes para construir el rbol de una expresin. Usar las
funciones haznodo y hazhoja. Adems realizar las anotaciones del atributo cdigo. Eliminar
recursin izquierda y generar las anotaciones para el atributo cdigo.
S = id = L
L = L and L
L = L or L
L=(L)
L=R
L = TRUE
L = FALSE
R=E<E
R = E <= E
R=E>E
R = E >= E
R = E <> E
E=E+E
E=E*E
E=(E)
E = id
E = numero
Usando la gramatica anterior y construir el rbol para
X = (a <= b) and (y + 10 > a)
X = true or (y <> 20)
X = (x and y) or (b >19)
X = ( ( (a + 6*(y + z)) z)*(a + 5))<=6
Representar en notacin polaca, cdigo de tres o cuatro direcciones, segn sea el caso, y realizar
el GDA para
1.
2.
3.
4.
5.
6.
7.
8.

Y=(a+a*(bc))+(bc)*d
i = i + 10
x = x + (y * 10 + z)*x
b+c*d
x=a+b+c*d
z = (a * b) + (c * d)
z + 5 * (z + 5)
( (a + 6*(y + z)) z)*(a + 5))

También podría gustarte