Question: Consider the following grammar for a declaration list: decl list decl list decl ; | decl ; decl id : type type
Consider the following grammar for a declaration list:
decl list → decl list decl ; | decl ;
decl → id : type
type → int | real | char
→ array const .. const of type
→ record decl list end
Construct the CFSM for this grammar. Use it to trace out a parse (as in Figure 2.30) for the following input program:
foo : record
a : char;
b : array 1 .. 2 of real;
end;
Step by Step Solution
3.29 Rating (155 Votes )
There are 3 Steps involved in it
The following CFSM is written in the st... View full answer
Get step-by-step solutions from verified subject matter experts
