[antlr-interest] Trying to add a new "empty" target lang

Erik Erlandson eje at redhat.com
Sat Mar 24 15:20:26 PDT 2012


I'm trying to add a new antlr target language, and I've been attempting
to follow along with this wiki:

http://www.antlr.org/wiki/display/ANTLR3/How+to+build+an+ANTLR+code
+generation+target

The directions talk about starting with Java.stg and removing the guts
of all the templates to create xyz.stg.

Which of these do I need to add my xyz/xyz.stg file to:

        $ find -name "Java.stg" -print
        ./tool/src/main/resources/org/antlr/codegen/templates/Java/Java.stg
        ./tool/target/classes/org/antlr/codegen/templates/Java/Java.stg

My attempts to make it work by creating an "empty" xyz/xyz.stg file
(that is, not empty, but the innards of all templates are empty) are not
working, and I'm getting this failure:

        $ java org.antlr.Tool G0.g
        error(10):  internal error: G0.g :
        java.lang.IllegalArgumentException: No such group file:
        org/antlr/codegen/templates/cpp/cpp.stg
        org.stringtemplate.v4.STGroupFile.<init>(STGroupFile.java:69)
        org.stringtemplate.v4.STGroupFile.<init>(STGroupFile.java:48)
        org.antlr.codegen.CodeGenerator.loadTemplates(CodeGenerator.java:186)
        org.antlr.codegen.CodeGenerator.genRecognizer(CodeGenerator.java:283)
        org.antlr.Tool.generateRecognizer(Tool.java:655)
        org.antlr.Tool.process(Tool.java:468)
        org.antlr.Tool.main(Tool.java:93)
 
I also attempted to rebuild the antlr repo, using:
        $ mvn -N install
        $ mvn -Dmaven.test.skip=true package assembly:assembly

However that is meeting with this failure:
        [ERROR] Failed to execute goal
        org.antlr:antlr3-maven-plugin:3.4:antlr (default) on project
        gunit: Execution default of goal
        org.antlr:antlr3-maven-plugin:3.4:antlr failed: No such group
        file: org/antlr/tool/templates/messages/formats/antlr.stg ->
        [Help 1]
        
Hopefully I'm just missing something obvious.





More information about the antlr-interest mailing list