1

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

Razie
  • 141
  • 1
  • 7

1 Answers1

3

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

Community
  • 1
  • 1
Julian
  • 1,524
  • 19
  • 25