Ada grammar

cw at mh3bc1.UUCP cw at mh3bc1.UUCP
Thu Dec 15 11:58:04 AEST 1983


David Norris has recently supplied a YACC version of an Ada grammar
to net.sources.  He claimed that the grammar is LALR(1).  It should
be noted that the grammar is not even LR(1).  He did note the
correct place where the problem occurs.  YACC will handle the problem
area by chosing to shift; Norris claims that this is a correct
resolution.  I have not tested the claim.

I also have not tested to see if the grammar in fact covers the
real Ada grammar.  This is a general problem with fast grammars for
Ada; to get them to be LALR(1) or LR(1), you actually have to
write a grammar for a little larger language.  Sometimes
you make a mistake and cut off a bit of Ada.  I have also not
checked to see if this grammar is appropriate for all of ANSI
1983 Ada.

We can, however, thank Norris for providing one more example
of a grammar that we can use to understand nice solutions to
Ada parsing problems.

Charles Wetherell
-- 
Charles Wetherell
MH 3C-327 x-3099
eagle!cw



More information about the Comp.sources.unix mailing list