Anoob C I
Anoob C I

Reputation: 171

Generate Java Source Code for Abstract Syntax Tree

I had generated AST of java grammer using Antlr.

I had made some alterations in the AST, Now I need to write the AST as Java File at a particular location.

Could any one suggest me the available ways to do the same.

Thanks in Advance!

Upvotes: 0

Views: 1339

Answers (1)

Ira Baxter
Ira Baxter

Reputation: 95306

There's more to this than "walk the tree and spit text". See this SO answer for how to do prettyprinting

ANTLR has so-called "string templates" which are likely to be of some help here.

Upvotes: 1

Related Questions