The following makes the CSharp3 target usable from the Java version of the
tool:

Add the following to AttributeScope.java:

/* Placeholder for compatibility with the CSharp3 target. */
public LinkedHashMap<String, GrammarAST> actions = new LinkedHashMap();

The Java version of the tool does properly track the rule modifiers.
However, when the modifier isn't specified, the 'modifier' field in
Rule.java defaults to null. Due to the early out in
ASTExpr.getObjectProperty, a null value doesn't end up pulling the default
value from the map defined in my template. If you use an empty string in
Grammar.defineRule whenever the modifier argument is null, it corrects the
issue.

Sam

-----Original Message-----
From: Terence Parr [mailto:[email protected]] 
Sent: Monday, November 22, 2010 1:15 PM
To: Sam Harwell
Cc: 'Johannes Luber'; [email protected]
Subject: Re: please remove hasDelegates


> 
> 4. The Java version of the tool doesn't implement actions for 
> attribute scopes. In the C# version, you can have scopes like the
following:
> 
> scope S @scopeinit{$S::value=true;} {boolean value;}

What can I do quickly to help you?


_______________________________________________
antlr-dev mailing list
[email protected]
http://www.antlr.org/mailman/listinfo/antlr-dev

Reply via email to