What version of ANTLR are you using? Are you using Antlr3.exe or the java
version to generate your grammar?

I just ran the example you mentioned (changing only the options), and the
class statement_return doesn't even exist in the generated code, so
obviously we're using different versions of something.

Sam

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of DJB MASTER
Sent: Sunday, July 10, 2011 3:55 AM
To: [email protected]
Subject: [antlr-interest] ASTLabelType C# Problem

Hi, I'm using the vector math grammar example from the language patterns
book to practise with ASTs. The grammar is this one >
media.pragprog.com/titles/tpdsl/code/IR/Vec/VecMathAST.g.

I'm trying to let ANTLR build my custom nodes rather than CommonToken, so I
set ASTLabelType accordingly...

options
{
  language = CSharp3;
  output = AST;
  ASTLabelType = ASTNode;
}

...but then I get the following compile errors on every rule... E.g, the
statement rule...

'MyParser.statement_return' does not implement interface member
'Antlr.Runtime.IAstRuleReturnScope.Tree'. 

'MyParser.statement_return.Tree' cannot implement
'Antlr.Runtime.IAstRuleReturnScope.Tree' because it does not have the
matching return type of 'object'.

My ASTNode class is fine. I think this is more of a case of ANTLR not
generating the code properly as all the errors are in the parser. Everything
works fine just using CommonTree.

--
View this message in context:
http://antlr.1301665.n2.nabble.com/ASTLabelType-C-Problem-tp6567453p6567453.
html
Sent from the ANTLR mailing list archive at Nabble.com.

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to