Exercício 07.110

Apresente uma derivação à extrema esquerda (DEE) da sentença a = a * (b - c) + (d / e) sobre a gramática a seguir.

G = ({A, B, C, D, E, F, G}, {a, b, c, d, e, =, +, -, *, /, (, )}, P, A)
P = {< A >  ->  < G > = < B >
     < B >  ->  < D > < C >  |  < D >
     < C >  ->  + < D > < C >  |  - < D > < C >  |  + < D >  |  - < D >
     < D >  ->  < F > < E >  |  < F >
     < E >  ->  * < F > < E >  |  / < F > < E >  |  * < F >  |  / < F >
     < F >  ->  ( < B > )  |  < G >
     < G >  ->  a  |  b  |  c  |  d  |  e }

Resposta

< A >
< G > = < B >
a = < B >
a = < D > < C >
a = < F > < E > < C >
a = < G > < E > < C >
a = a < E > < C >
a = a * < F > < C >
a = a * ( < B > ) < C >
a = a * ( < D > < C > ) < C >
a = a * ( < F > < C > ) < C >
a = a * ( < G > < C > ) < C >
a = a * ( b < C > ) < C >
a = a * ( b - < D > ) < C >
a = a * ( b - < F > ) < C >
a = a * ( b - < G > ) < C >
a = a * ( b - c ) < C >
a = a * ( b - c ) + < D >
a = a * ( b - c ) + < F >
a = a * ( b - c ) + ( < B > )
a = a * ( b - c ) + ( < D > )
a = a * ( b - c ) + ( < F > < E > )
a = a * ( b - c ) + ( < G > < E > )
a = a * ( b - c ) + ( d < E > )
a = a * ( b - c ) + ( d / < F > )
a = a * ( b - c ) + ( d / < G > )
a = a * ( b - c ) + ( d / e )
        

Recomendamos

Revista Tema Vida de Suporte Clickarvore