Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions