Question

Consider the following BNF grammar that we saw in class:        EXP    ::= EXP + TERM  ...

Consider the following BNF grammar that we saw in class:
       EXP    ::= EXP + TERM   | EXP - TERM    | TERM
       TERM   ::= TERM * FACTOR | TERM / FACTOR | FACTOR
       FACTOR ::= ( EXP ) | DIGIT
       DIGIT ::= 0 | 1 | 2 | 3

   (a) Translate into EBNF.
   (b) Draw syntax diagrams.
   (c) What are the two requirements on a grammar for a predictive parser to be able to make right choice?
   (d) Compute First and Follow sets for each of the non-terminals
   (e) Prove that the grammar satisfy the two requirements defined in (c).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

0 ERNA2- TBRm +ACTOR 心! arr at Cİ) 94 har the Capal,,tlp.to nechet- (It)Vaaale vuna,

Add a comment
Know the answer?
Add Answer to:
Consider the following BNF grammar that we saw in class:        EXP    ::= EXP + TERM  ...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • please provide good explanation. Consider the following grammar for variable and class declarations in Java: <Decl>...

    please provide good explanation. Consider the following grammar for variable and class declarations in Java: <Decl> -> <VarDecl> | <ClassDecl> <VarDecl> -> <Modifiers> <Type> <VarDec> SEM <ClassDecl> -> <Modifiers> CLASS ID LBRACE <DeclList> RBRACE <DeclList> -> <Decl> | <DeclList> <Decl> <VarDec> -> ID | ID ASSIGN <Exp> | <VarDec> COMMA ID | <VarDec> COMMA ID ASSIGN <Exp> Indicate any problems in this grammar that prevent it from being parsed by a recursive-descent parser with one token lookahead. You can simply...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT