Menu

[Solved]Consider Following Grammar Expr Term Termtail Termtail Addop Term Termtail Term Factor Fac Q37290021

Consider the following grammar

expr- term term_tail

term_tail -add_op term term_tail |

term – factor factor_tail

factor_tail-mult_op factor factor _tail |

factor -(expr) |id|literal

add_op -+|-

mult_op-*|/

Draw syntax tree for parsing each ofcdf+(a25+84),(a25+84)*cdf,84*cdf+a25,a25+84*cdf,a25*84*cdf.Notethat a25 and cdf are identifiers and 84 is a literal.You are notasked to do the tedious parsing process with stacksnapshots.Instead you only need to draw sysntax trees,but you doneed to do lexical analysis

N.B: I need only lexical analysis for this question

Expert Answer


Answer to Consider the following grammar expr- term term_tail term_tail -add_op term term_tail | term – factor factor_tail factor_… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *