Re: Parsers, grammars and BNF

Philip Herron <>
Fri, 13 Nov 2009 16:40:54 +0000

          From comp.compilers

Related articles
Parsers, grammars and BNF (maniac) (2009-11-12)
Re: Parsers, grammars and BNF (Philip Herron) (2009-11-13)
Re: Parsers, grammars and BNF (glen herrmannsfeldt) (2009-11-16)
Re: Parsers, grammars and BNF (Chris F Clark) (2009-11-15)
| List of all articles for this month |

From: Philip Herron <>
Newsgroups: comp.compilers
Date: Fri, 13 Nov 2009 16:40:54 +0000
Organization: Compilers Central
References: 09-11-040
Keywords: parse, design
Posted-Date: 15 Nov 2009 17:45:05 EST

Hey Tom,

2009/11/12 maniac <>:
> Hey everyone,
> I want to write a BNF for a particular language.
> Can anyone recommend a good resource/guide for generating a BNF for a
> language?
> I'm just wondering is there a formula to follow before I start
> examining every possible statement!
> Cheers
> Tom

I wouldn't worry about any particular 'formula', the way i figured out
how to do it was just writing YACC, and reading the dragon book helped
me a lot as well as there was an o'reilley book Lex and Yacc i have it
here somewhere it was probably the most useful out of any it shows you
how to think about the problem easily and well + its very short you
only need to care about the first ~100 pages the rest is one big SQL
implementation which just gets very specific.

Although i prefer having a hand-written parser since you can Taylor it
to be more specific to your implementation, Lex and Yacc are really
helpful when your still prototyping your language, gives you less to
worry about when building it.


Post a followup to this message

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