On Sat, May 22, 2010 at 1:33 PM, Sameh W. Zaky <sameh...@gmail.com> wrote:

> Greetings,
>
> I am still an ANTLR beginner..
>
> I run a software where I generate the .g grammar file automatically. So I
> would love to know how to generate the lexer and parser at runtime given
> the
> .g file?
>

When generating lexers/parser on the command line, you'd do something like
this:

java -cp .:antlr-3.2.jar org.antlr.Tool /path/to/your/grammar.g

(the Tool class has a static main method taking a command line parameter!)
So generating them in your own code would look like:

String yourGrammarFile = "/path/to/your/grammar.g";
org.antlr.Tool.main(new String[]{yourGrammarFile});

Kind regards,

Bart.
**

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to