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

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -