Article View: gnu.gcc.help
Article #42611Re: [WANTED]ANSI C Skeleton Grammar Description for bison
From: Paul D. Smith
Date: Wed, 15 Nov 1995 00:00
Date: Wed, 15 Nov 1995 00:00
41 lines
2561 bytes
2561 bytes
%% bstocks@spd.dsccc.com (Barry Stocks) writes:
bs> I am looking for a template or skeleton ANSI C grammar
bs> description that can be used by GNU bison or GNU byacc.
Byacc isn't a GNU product; byacc is Berkeley yacc. It doesn't come
under the GPL and isn't, AFAIK, distributed by the FSF.
The grammar for C cannot be completely described in an LALR(1) grammar;
it contains areas of ambiguity. I don't believe there exists a simple
ANSI C skeleton for Bison because of this.
If you can, I suggest you forget yacc, Bison, and byacc completely and
try PCCTS (Purdue Compiler Construction ToolSet), a next-generation
compiler generator tool. PCCTS uses EBNF (Enhanced BNF) to describe
syntax, so your knowledge of yacc is still quite useful.
In addition to the nice enhancements to BNF, PCCTS can provide multiple
token lookahead parsers, instead of just 1-token lookahead. It also
merges the lexer and parser (lex and yacc) syntax into one file, rather
than two (although you can still substitute your own lexer if you like)
which makes things cleaner.
And it has very advanced features like better error handling, passing
multiple arguments both up and down the rule stack, etc.
PCCTS is free software, like byacc.
And finally, it has both an ANSI C _and_ a C++ skeleton grammar already
produced for it available at the ftp site. Try these:
ftp://ftp.parr-research.com/pub/pccts/
http://www.mcs.net/~tmoog/pccts.html
-------------------------------------------------------------------------------
Paul D. Smith <psmith@baynetworks.com> Network Management Development
Senior Software Engineer Bay Networks, Inc.
-----------------------------------------------==<http://www.baynetworks.com/>-
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
These are my opinions--Bay Networks takes no responsibility for them.
Technical Details
Message-ID:
<9511151902.AA03857@lemming.engeast>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<48b6kq$ode@sun001.spd.dsccc.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,99c845458a74540c,start X-Google-Attributes: gid11318c,public From: psmith@baynetworks.COM (Paul D. Smith) Subject: Re: [WANTED]ANSI C Skeleton Grammar Description for bison Date: 1995/11/15 Message-ID: <9511151902.AA03857@lemming.engeast> X-Deja-AN: 119446892 distribution: gnu sender: daemon@cis.ohio-state.edu references: <48b6kq$ode@sun001.spd.dsccc.com> organization: GNUs Not Usenet reply-to: psmith@baynetworks.com newsgroups: gnu.gcc.help