Question: COMPILER CONSTRUCTION Given the grammar defined by the following set ofproduction rules in the EBNF module-declaration module . module module-heading declarations compound-stmt module-heading module name

| COMPILER CONSTRUCTION |
Given the grammar defined by the following set ofproduction rules in the EBNF module-declaration module "." module module-heading declarations compound-stmt module-heading module "name" ";" declarations const-decl var-decl task-decl const-decl const (const-item ";" )+ 1 const-item "name" "integer-value" var-decl var (var-item ".") var-item name-list ":" i name-list "name" ("," "name") task-decl task-heading declarations nteger task-heading-> task "name" ";" compund-stmt begin stmt-list end stmt-list ( statement "." ) statement ass-stmt l inout-stmt | stmt l while- ass-stint "name" ":-'' arith-exp arith-exp term (add-sign term) term factor (mul-sign factor ) factor"(" arith-exp")" I name-value name-value "name" "integer-value" add-sign "+" "-" mul-sign "*" | 7" inout-stmt input "(" "name" ")" 1 out "(" name-value if-stmt if bool-exp then statement else-part fi else-part else statement | while-stmt while bool bool-exp name-value relational-oper name-value stmt | compound-stmt | ")" -exp do statement Notes: (1) The tokens in bold letters are reserved words. (2) The words between " are terminals (terminal tokens). Write a recursive descent parser for the above grammar using C programming language, By using CodeBlock
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
