Determine if arithmetic expression is in language described by grammar -
we have following grammar arithmetic questions:
e → e + t | e – t | t
t → t * f | t / f | f
f → ( e ) | | b
i'm trying determine whether (a+b)(a-b) in language described grammar.
i able see (a+b)*(a-b) in language mean (a+b)(a-b) in language? lack of asterisk throwing me off. preceding exercises have asterisks multiplication.
so mean (a+b)(a-b) in language?
no
because. able produce (a+b)(a-b)
4 non-terminals
combination ie tt
, tf
, ft
, ff
, these 4 combinations can not produced given grammar.
Comments
Post a Comment