Exercício 07.25

Apresente uma derivação à extrema esquerda (DEE) da sentença A := B * (C * (A + B)) sobre a gramática a seguir (Sebesta, 2000).

G = ({atr, exp, ter, fat, id}, {A, B, C, :=, +, *, (, )}, P, atr)
P = {< atr >  ->  < id > := < exp >
     < exp >  ->  < exp > + < ter >  |  < ter >
     < ter >  ->  < ter > * < fat >  |  < fat >
     < fat >  ->  ( < exp > )  |  < id >
     < id >   ->  A  |  B  |  C }

Resposta

< atr >
< id > := < exp >
A := < exp >
A := < ter >
A := < ter > * < fat >
A := < fat > * < fat >
A := < id > * < fat >
A := B * < fat >
A := B * ( < exp > )
A := B * ( < ter > )
A := B * ( < ter > * < fat > )
A := B * ( < fat > * < fat > )
A := B * ( < id > * < fat > )
A := B * ( C * < fat > )
A := B * ( C * ( < exp > ) )
A := B * ( C * ( < exp > + < ter > ) )
A := B * ( C * ( < ter > + < ter > ) )
A := B * ( C * ( < fat > + < ter > ) )
A := B * ( C * ( < id > + < ter > ) )
A := B * ( C * ( A + < ter > ) )
A := B * ( C * ( A + < fat > ) )
A := B * ( C * ( A + < id > ) )
A := B * ( C * ( A + B ) )


Recomendamos

Revista Segurança Digital Revista FOSSGIS Brasil Um Sábado Qualquer