I have my doubts that there is some silver bullet way to do this using stringtemplate but I'll take a shot and ask if anyone has any suggestions regardless (I do hope this is still a valid place to ask questions on ST).
I'm writing a little translator that reads in 'lessons' (small fragments of code) in one language and outputs the same lesson in potentially many different languages (views).
The lessons in the original language include statements that essentially ask students to fill in small pieces of information when asked via with "Confirm" statements.
The confirm statements can be translated to corresponding STs in a given target language. However, for reasons of analysis and user feedback---it seems like I need to be able to map the line number of each Confirm statement in the original source, to its 'translated' counterpart in the resulting output...
Once I have a hierarchy of STs built, is there an easy way to retrieve this sort of information---short of calling render(), then manually string-hacking the resulting output? Realize that I'm generating many target languages that could potentially affect the position appearance of the translated confirm statements.
I realize the STs stored are evaluated/rendered lazily, so it seems unlikely that line number information would/could be stored somewhere statically. Is there some sort of method or technique I can use within stringtemplate to retrieve this sort of information, or would otherwise help me build this mapping?