2

How can I use these BNF grammars which are in GOLD meta-syntax (RegExp + BNF) with TinyPG? I'm new to BNF so approximately what sort of conversion will I have to do to convert BNF to EBNF?

I believe it should be pretty simple since TinyPG needs RegExp + EBNF in comparison to the GOLD grammars which are RegExp + BNF.

Also, is there any TinyPG source code for any language available, just to see what sort of conversion I would have to do?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607
  • What is TinyPG? Is it http://www.codeproject.com/KB/recipes/TinyPG.aspx? –  Oct 30 '09 at 18:09

1 Answers1

1

EBNF is not entirely backwards compatible with BNF, however the differences are actually slight, you should be familiar with the document at

http://www.cs.cmu.edu/~pattis/misc/ebnf.pdf

Primarily you have to handle the special characters <>|:= (enclosed in double quotes).

You could just use the GOLD meta-syntax engine to output your parser if it can be in one of the supported languages - instead of using TinyPG...

It begs the question - What language will your parser be in when you are implementing it?

caving
  • 172
  • 1
  • 7