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

1 Expert Approved Answer
Step: 1 Unlock

The following CFSM is written in the st... View full answer

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 Programming Language Pragmatics Questions!