[antlr-interest] New article on StringTemplates and Treewalkers
Terence Parr
parrt at cs.usfca.edu
Tue Jan 10 15:04:52 PST 2006
On Jan 10, 2006, at 2:29 PM, shmuel siegel wrote:
> I think that Andy was more bothered by how to translate something like
>
> int func(int x)
> {
> if(x=5)
> return 3;
> }
>
> since even though it looks like java, it is not valid java.
This is a translation analysis issue; once you discover that x=5 is
not a valid construct in the target language your logic must figure
out what construct is valid. When you know what it looks like, then
generate it with print statements or ST..up to you. :)
Ter
More information about the antlr-interest
mailing list