Razie
Razie

Reputation: 137

Using ANTLR to generate lexer/parser as streams

Can I use the ANTLR Java API to generate the lexer/parser as streams and save them somewhere other than some files?

Also, is there a simple example of using the API to generate the required files from a given grammar?

thanks

Upvotes: 1

Views: 300

Answers (1)

Julian
Julian

Reputation: 1732

I am not 100% sure if I understand your question correctly, but you might want to have a look at https://stackoverflow.com/a/38052798/5068458. This is an in-memory compiler for antlr grammars that generates lexer and parser for a given grammar in-memory. You do not have to do it manually. Code examples are provided there.

Best, Julian

Upvotes: 3

Related Questions