Search code examples
javastringtemplate

How to build your own lexical analyzer for StringTemplate?


Hmm, sounds easy enough but after looking at the ones that come with StringTemplate, there is no way this is easy for me the average developer.

Where does one start?

From doing some more digging it seems to accomplish this one would also have to learn the ANTLR tool to create the language file? Is that correct? Or can I just copy one that came with StringTemplate?


Solution

  • StringTemplate was built by the guy who wrote ANTLR, so the two are very closely related. In fact, StringTemplate was built as the code-generation library for ANTLR, so it's almost certainly the right answer.