Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ target throws error with simple grammar T.g

Tags:

c++

antlr

I'm trying to target Cpp with a simple grammar T.g outputting to an AST with a tree grammar.

Can't find AST.stg, which doesn't exist in the source code. Same error with both 3.4 and 3.5 rc1.

Thanks for any help.

java -jar ../../../antlr-3.5-rc-1-complete.jar T.g TWalker.g

error(10):  internal error: T.g : java.lang.IllegalArgumentException: No such group file:   
    org/antlr/codegen/templates/Cpp/AST.stg
org.stringtemplate.v4.STGroupFile.<init>(STGroupFile.java:69)
org.stringtemplate.v4.STGroupFile.<init>(STGroupFile.java:48)
org.antlr.codegen.CodeGenerator.loadTemplates(CodeGenerator.java:222)
org.antlr.codegen.CodeGenerator.genRecognizer(CodeGenerator.java:283)
org.antlr.Tool.generateRecognizer(Tool.java:661)
org.antlr.Tool.process(Tool.java:474)
org.antlr.Tool.main(Tool.java:98)
like image 967
Richard Catlin Avatar asked Dec 15 '12 00:12

Richard Catlin


1 Answers

The C++ target does not support AST creation (yet).

See: Unsupported features at https://theantlrguy.atlassian.net/wiki/pages/viewpage.action?pageId=2687101

like image 92
Bart Kiers Avatar answered Oct 01 '22 12:10

Bart Kiers