External use of OutputModelFactory, @ModelElement, etc. in code generation from ANTLR parseTree

63 Views Asked by At

I'm looking at how best to use StringTemplate for code generation for a compiler using ANTLR as the parser. I decided to look to the ANTLR source for inspiration on how to leverage StringTemplate. Since this code is part of the ANTLR tool, rather than the runtime, is it considered "fair game" for usage in my own code? (I realize that would require using either the "complete" jar at runtime, or both the runtime jar as well as the tool jar).

Or, should I considered it "off limits" and implement my own solution modeled after it?

2

There are 2 best solutions below

1
On

If you're referring to the license, the ANTLR 4 Tool uses the same 3-clause BSD license throughout as the ANTLR 4 Runtime does.

1
On

Well, the code generator is pretty stable so you can pretty much assume those suckers will stick around but the code gen is internal so might change on you.