0
votes

So I have written my grammar in antlr4 syntax. Then I setup codegeneration, and now I can parse source files in my own defined language. This works great!

The next step I took is to create an object model from the expression tree. This is also working well.

However, now I want to generate an expression from my object model.

Can I generate code using the generated language parser objects API? Obviously, I can write methods that hand-generates strings. But I want to use a geenrated API based on the grammar to achieve some level of type safety and to detect errors when I make a grammar change.

I'm using the latest antlr4: antlr 4.7.1.

1

1 Answers

0
votes

There's no generated solution. You have to wire this all up manually.