0

I am working on a Delphi version of StringTemplate 4. To do that I need access to all the Java source files. I downloaded the Java source on 19 Nov 2013.

In the file Compiler.java in the folder Compiler is the routine :-

/** Compile full template with respect to a list of formal arguments. */
public CompiledST compile( ...

In this routine is a call to STParser.

Looking in the folder Compiler is the file 'STParser.g'. However there is no file 'STParser.java'. Similar problems exist for the files 'CodeGenerator.g' and 'Group.g'.

Where are the Java versions of those files? How can I obtain them?

1 Answers1

0

Those files are generated by ANTLR 3 during the Maven compilation process. Since ANTLR 3 does not currently have a Delphi target, you'll need to provide one for the both the parser code generation and the associated runtime library.

Sam Harwell
  • 97,721
  • 20
  • 209
  • 280
  • Thank you for that reply. Unfortunately I do not have a Delphi translation of any ANTLR version. If I had 'STParser.java' I could manually translate that file to Delphi. (Same for the other two.) These are the missing link, so to speak, for getting StringTemplate to work in Delphi. Has anyone produced those Java files? Alternatively - do I need to run ANTLR 3 myself so ANTLR 3 will produce 'STParser.java'? I am very close to success. – Peter G Evans Feb 24 '14 at 22:01
  • @PeterGEvans You can download the sources as part of the [Maven source package ST4-4.0.7-sources.jar](http://search.maven.org/#artifactdetails%7Corg.antlr%7CST4%7C4.0.7%7Cjar). I doubt you'll be able to make those files work without a port of the ANTLR 3 runtime though. – Sam Harwell Feb 24 '14 at 22:44
  • Looking into that, it seems that there would be an enormous amount of work to do, unless there was a port of the ANTLR 3 runtime. Thank you for your help. – Peter G Evans Feb 28 '14 at 05:20