Re: A Simple EBNF Grammar based parser

"Puneet Agarwal" <puneet@daffodilwoods.com>
15 Jul 2002 23:55:55 -0400

          From comp.compilers

Related articles
Re: A Simple EBNF Grammar based parser puneet@daffodilwoods.com (Puneet Agarwal) (2002-07-15)
Re: A Simple EBNF Grammar based parser puneet@daffodilwoods.com (Puneet Agarwal) (2002-07-15)
Re: A Simple EBNF Grammar based parser cfc@world.std.com (Chris F Clark) (2002-07-21)
| List of all articles for this month |
From: "Puneet Agarwal" <puneet@daffodilwoods.com>
Newsgroups: comp.compilers
Date: 15 Jul 2002 23:55:55 -0400
Organization: Daffodil Software
References: <agqaqr$npmh8$1@ID-99266.news.dfncis.de> <sddk7nz6pl5.fsf@shell01.TheWorld.com>
Keywords: parse
Posted-Date: 15 Jul 2002 23:55:54 EDT

Dear Chris,


"Chris F Clark" <cfc@shell01.TheWorld.com> wrote in message
> > I needed to write down a lexer/parser for SQL for an RDBMS
> > project. I explored a few compiler generators in Java including
> > JavaCC but I found them quiet difficult to use.
> . . .
> > Can anybody tell me why JavaCC and other parsers require proprietary
> > Grammar definition formats when it can be done using merely EBNF?
>
> There are parser generators that use EBNF (for many dialects of EBNF,
> and there are at least 4 major dialects if I recall correctly). Did
> you look at ANTLR/PCCTS? It used EBNF last I checked.


Thanks for the information. I came across Antlr but did not explore it
thoroughly. I will go through it again.
>
> Now, as to your claim of handling left-recursion, is your parser
> generator LL-based?
Yes, My parser generator is LL based.
> Does it generate a recursive descent parser?
No, my parser is not a recursive descent parser. Actually, it can be used to
generate Syntax Trees by parsing a given string.
> (Some of the text I clipped, suggests that you do generate a recursvie
> descent parser.) If so, then the chances are your left-recursion
> support doesn't actually work, but in fact loops on certain inputs.
There is no possibility of looping with my parser. We have thoroughly tested
it. It runs quiet well for a complete SQL 99 specifications.


Now, is it that generation of a recursive descent parser is not possible for
a Grammar involving Left Recursion? Is it easy to generate AST's for
grammars with Left Recursion.?


Thanks once again for the help.


- Puneet


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.