[comp.compilers] LL

sunder@viewlogic.com (Sunder Singhani) (01/31/91)

	I am looking for an LL(1) grammar for ADA. An EBNF/BNF grammar
	would be OK.
--
	My address : ssinghani@viewlogic.com
		     Sunder Singhani
		     Viewlogic Systems Inc.
[People have asked for machine-readable Ada grammars before, but when I
looked through the archives I didn't find any answers. -John]
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.

mcl@tko.vtt.fi (Matthew Clegg) (02/01/91)

In article <1991Jan30.192303.5219@viewlogic.com> sunder@viewlogic.com (Sunder Singhani) writes:
>
>	I am looking for an LL(1) grammar for ADA. An EBNF/BNF grammar
>	would be OK.

I picked up the following two messages from comp.languages.ada a month
or two ago.  They mention machine-readable grammars, but unfortunately
they are not advertised as being LL(1) or EBNF/BNF.  I hope this
information will be of some help anyways.

---------------------------------------------------------------------------

Reply-To: mfeldman@seas.gwu.edu (Michael Feldman)

The NASA PrettyPrinter, on Simtel20 in the ASR, contains an Ada LR parser,
which it needs to pretty-print a program. It also builds a tree of the
input program, which it can manipulate to add e.g. certain kinds of
comments. I have a YACC specification for Ada, which I will be glad to
e-mail you if you wish. The nice thing about the one inside Pretty is
that it's written in Ada and, since you have the source, you can make the
"back end" do whatever you like. This product is not bad, was developed
for NASA, and seems to be fairly decent Ada. It's in the public domain.

---------------------------------------------------------------------------

Reply-To: joevl@mojsys.uucp (Joe Vlietstra)

A yacc compatible grammar for Ada was developed by Herman Fischer
at Litton Data Systems, Van Nuys, CA.
An updated version of this grammar is available in the SIMTEL20 Ada
Software Repository (ftp wsmr-simtel20.army.mil).
The grammar is found in PD2:<ADA.EXTERNAL-TOOLS>GRAM2.SRC
It is approximately 80K.

If you want a yacc parser written in Ada, consider the ayacc parser
developed by the Arcadia project at Univ Calif at Irvine.
ayacc is not available via ftp -- it is bundled with a bunch of
other tools from the Arcadia project.  It isn't free, but you can't
complain about $75.00 for a mag-tape full of software.
Contact Arcadia project at arcadia-software@isc.uci.edu.

---------------------------------------------------------------------------

Matthew Clegg
Technical Research Center of Finland, in Oulu
mcl@tko.vtt.fi
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.

mikee@uunet.uu.net (03/08/91)

   I'm looking for an LL(k) parser generator, preferably one which
produces language-independent output.  Something like the LLGen 
program described in Fischer & LeBlanc, "Crafting a Compiler" would
be ideal.  Any suggestions?
[There's llama in Holub's book, but it generates C code wrapped around its
tables.  You can get source and modify it. -John]
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.

jos@and.nl (J. Horsmeier) (06/17/91)

Hi there, 

anyone out there having (knowing of) a LL(1) grammar for `C'. ANSI or K&R or
both would be fine. 

I'm just interested in the syntax, no semantics embedded in the syntax of the
grammar (e.g. operator precedence). This would greatly reduce the complexity
of the syntax (I think). I'm currently working on a low profile project:
Reference document generation, given `C' source files. 

The thing is supposed to generate `frames' of reference manuals. We are
working with a home brew LL(1) parser generator, including a lex look alike
NFA->DFA regular expression scanner. For several reasons (interpretation
versus compilation, incremental parser building etc.), we do not want to use
lex/yacc.  Ambiguities (shift/reduce, non factored rules etc.) are okay, the
generator can deal with them ...

thanx in advance,


Jos

J.A. Horsmeier AND Software B.V.        phone : +31 10 4367100
               Westersingel 106/108     fax   : +31 10 4367110
               3015 LD  Rotterdam NL    e-mail: jos@and.nl
[I know of several yacc grammars, but no LL(1) grammar other than the one
implicitly in the Ritchie C compiler. -John]
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.

mauney@eos.ncsu.edu (Dr. Jon Mauney) (06/18/91)

I have an LL(1) grammar for C.  It is in the format accepted by my parser
generator (as described in Fischer and LeBlanc "Crafting a Compiler" It
should be easy to convert to any other format.

I don't use this grammar much, so I can't claim it's perfect.  It does
have one place where I deliberately punted: the grammar will accept any
expression as a statement label.  The problem is a common-prefix between
labels and expressions, and I was not willing to factor it up through 13
levels of operator precedence.  If you collapse the expression grammar to
1 level of precedence, it should be easy to factor labels. 

I'd be happy to mail it to you.  Just send me a reply so I know I've got
your address correct.
--
Jon Mauney,  parsing partisan
Computer Science Dept.
N.C. State University
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.