antlr / antlr/antlr3

Annoying warnings with CSharp3 target

Open
#152 27 comments 0 reactions 0 assignees View on GitHub
status:wontfix
Dominant language
Java
Stars
253
Forks
178
PR merge metrics
No merged PRs in 30d

Description

Hi,

following our conversations, I've moved to a build where a generic grammar is used to produce language specific grammars, and lexers/parsers are produced programmatically using org.antlr.Tool v 3.5.1.

All is fine except I get annoying warnings when processing grammars for CSharp3 target, such as:
warning(24): template error: context [/outputFile /lexer /lexerRule /lexerRuleLabelDefs] 14:1 no such property or can't access: org.antlr.tool.Rule.charListLabels
Caused by: org.stringtemplate.v4.misc.STNoSuchPropertyException: no such property: org.antlr.tool.Rule.charListLabels
at org.stringtemplate.v4.misc.ObjectModelAdaptor.throwNoSuchProperty(ObjectModelAdaptor.java:106)
at org.stringtemplate.v4.misc.ObjectModelAdaptor.lookupMethod(ObjectModelAdaptor.java:99)
at org.stringtemplate.v4.misc.ObjectModelAdaptor.getProperty(ObjectModelAdaptor.java:67)
at org.stringtemplate.v4.Interpreter.getObjectProperty(Interpreter.java:1158)
at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:210)
at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:145)
at org.stringtemplate.v4.Interpreter.writeObject(Interpreter.java:703)
at org.stringtemplate.v4.Interpreter.writeObjectNoOptions(Interpreter.java:635)
at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:285)
at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:145)
at org.stringtemplate.v4.Interpreter.writeObject(Interpreter.java:703)
at org.stringtemplate.v4.Interpreter.writeIterator(Interpreter.java:733)
at org.stringtemplate.v4.Interpreter.writeObject(Interpreter.java:708)
at org.stringtemplate.v4.Interpreter.writeObjectWithOptions(Interpreter.java:665)
at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:292)
at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:145)
at org.stringtemplate.v4.Interpreter.writeObject(Interpreter.java:703)
at org.stringtemplate.v4.Interpreter.writeObjectNoOptions(Interpreter.java:635)
at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:285)
at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:145)
at org.stringtemplate.v4.ST.write(ST.java:415)
at org.antlr.codegen.CodeGenerator.write(CodeGenerator.java:1296)
at org.antlr.codegen.Target.genRecognizerFile(Target.java:98)
at org.antlr.codegen.CSharp3Target.genRecognizerFile(CSharp3Target.java:109)
at org.antlr.codegen.CodeGenerator.genRecognizer(CodeGenerator.java:459)
at org.antlr.Tool.generateRecognizer(Tool.java:674)
at org.antlr.Tool.process(Tool.java:487)
at presto.generator.ParserProducer.produce(ParserProducer.java:27)
at presto.generator.Application.main(Application.java:36)
Caused by: java.lang.NoSuchFieldException: charListLabels
at java.lang.Class.getField(Class.java:1537)
at org.stringtemplate.v4.misc.ObjectModelAdaptor.lookupMethod(ObjectModelAdaptor.java:88)
... 27 more

warning(24): template error: context [/outputFile /parser /genericParser /rule /returnScope] 1:4 no such property or can't access: null.attributes

Is there something I can do about it ?

Kind regards,

Eric

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the warnings with org.antlr.Tool 3.5.1, then trace the reported path through CodeGenerator.java, Target.java, CSharp3Target.java, and the StringTemplate contexts. Compare the lexerRule and returnScope processing with the generated grammar input. Done means the CSharp3 generation completes without these template-property warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, java
Domain
compilers, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.