How to create an antlr grammar for given bnf notation?

760 views
Skip to first unread message

divya.div...@gmail.com

unread,
Jan 27, 2013, 2:23:41 AM1/27/13
to antlr-di...@googlegroups.com
I am noew to antlr and have no idea about the grammar syntax/rule etc.
Though i have a salesforce SOQL BNF notation/rule syntax for which i want,the antlr to generate a grammar.Please let me know how do i proceed?

Juancarlo Añez

unread,
Jan 29, 2013, 8:59:53 AM1/29/13
to antlr-di...@googlegroups.com
You write an ANTLR grammar for the BNF notation, and use it to translate BNF grammars to ANTLR grammars.

See attached a grammar I created for one BNF variation. It produces an AST that is in turn used by a small program to generate an ANTLR grammar through a depth-first visit to the tree.

Cheers,


On Sun, Jan 27, 2013 at 2:53 AM, <divya.div...@gmail.com> wrote:
I am noew to antlr and have no idea about the grammar syntax/rule etc.
Though i have a salesforce SOQL BNF notation/rule syntax for which i want,the antlr to generate a grammar.Please let me know how do i proceed?



--
Juancarlo Añez
tel:+58(414)901-2021
skype:juancarloanez
EBNF.g
Reply all
Reply to author
Forward
0 new messages