Consider the following grammar for a declaration list: decl list decl list decl ; | decl

Question:

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;

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: