Question: Enter this grammar into ANTLRWorks. Notes: replace $$ by EOF in the first rule; the character is used in ANTLR strings so youll need to

 Enter this grammar into ANTLRWorks. Notes: replace $$ by EOF in

Enter this grammar into ANTLRWorks. Notes: replace $$ by EOF in the first rule; the character is used in ANTLR strings so youll need to use the escape sequence for it as a token; you can treat a number as well as an identifier as an atom. Be sure to follow ANTLR convention about tokens vs non-terminals.

1. program>stmt list $$ 2. stmt list stmt list stmt 3. stmt-list stmt 4. stmt- id := expr 5. stmt read id 6. stmt- write expr 7, expr term 8. exprexpr add.op term 9. term factor 10. termterm mult op factor 11, factor ( expr 12. factorid 13. factornumber 14. add op + + 15. add-op --+ - 16. mult op* * 17. mult op /

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!