Question: Consider the following grammar for Pascal variable declarations: var-decl ! var decl-list decl-list ! decl ; decl-list decl-list ! decl decl ! id-list : id

Consider the following grammar for Pascal variable declarations:

var-decl ! var decl-list

decl-list ! decl ; decl-list

decl-list ! decl

decl ! id-list : id

id-list ! id-list , id

id-list ! id

Indicate any problems in this grammar that prevent it from being parsed by a recursive-descent parser

with one token lookahead.

Transform this grammar into a form that can be parsed with a recursive-descent parser with one token

lookahead. Make as few changes to the grammar as possible. Do not use Extended BNF.

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!