[stringtemplate-interest] C# updates for ANTLR 3.4, StringTemplate 4.0.4
Sam Harwell
sharwell at pixelminegames.com
Mon Aug 1 07:39:05 PDT 2011
I missed that the methods in TreeFilter and TreeRewriter have different
signatures. I believe they should either both be protected or both be public
- which is it (are they supposed to be called directly by external code)?
For now, you can change the following two rules in CSharp3.stg from this:
ruleWrapperBottomup() ::= <<
<if(TREE_PARSER && filterMode)>
public override IAstRuleReturnScope Bottomup() { return bottomup(); }
<endif>
>>
ruleWrapperTopdown() ::= <<
<if(TREE_PARSER && filterMode)>
public override IAstRuleReturnScope Topdown() { return topdown(); }
<endif>
>>
To this:
ruleWrapperBottomup() ::= <<
<if(TREE_PARSER && filterMode)>
<if(buildAST)>public override IAstRuleReturnScope<else>protected override
void<endif> Bottomup() { return bottomup(); }
<endif>
>>
ruleWrapperTopdown() ::= <<
<if(TREE_PARSER && filterMode)>
<if(buildAST)>public override IAstRuleReturnScope<else>protected override
void<endif> Topdown() { return topdown(); }
<endif>
>>
Sam
From: Kevin Carroll [mailto:kcarroll at signmgmt.com]
Sent: Monday, August 01, 2011 9:12 AM
To: Sam Harwell; antlr-interest at antlr.org; stringtemplate-interest
Subject: RE: [stringtemplate-interest] C# updates for ANTLR 3.4,
StringTemplate 4.0.4
Sam,
Apparently, the TreeFilter class defines Topdown() and Bottomup() as
protected void, but the overrides are defined as public IAstRuleReturnScope.
When building my parsers using the new release, I get the following errors
(sorry, text-only folks):
Thanks,
Kevin
From: stringtemplate-interest-bounces at antlr.org
[mailto:stringtemplate-interest-bounces at antlr.org] On Behalf Of Sam Harwell
Sent: Saturday, July 30, 2011 3:57 PM
To: antlr-interest at antlr.org; stringtemplate-interest
Subject: [stringtemplate-interest] C# updates for ANTLR 3.4, StringTemplate
4.0.4
Hello everyone,
I just finished updating the C# ports of ANTLR and StringTemplate for the
recent releases of ANTLR 3.4 and StringTemplate 4.0.4. This is a significant
update for the C# port, and includes the following in addition to the
updates found in the corresponding Java versions.
. The CSharp2 target has been updated to use the same runtime
assembly as the CSharp3 target (Antlr3.Runtime.dll).
. Tree grammars with "filter=true" now automatically generate the
required overridden implementations of TreeFilter.Topdown and/or
TreeFilter.Bottomup.
. Improved support for delegate grammars in the build process (set
their Build Action to AntlrAbstractGrammar and Custom Tool to
MSBuild:Compile).
. Improved Tool performance.
The documentation and downloads can be found at the following page:
http://www.antlr.org/wiki/display/ANTLR3/Antlr3CSharpReleases
Also, if you end up using (and liking) my Visual Studio 2010 extensions, I
appreciate the reviews on the Visual Studio Gallery. :)
Thank you,
Sam Harwell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20110801/18d45f0c/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 38133 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20110801/18d45f0c/attachment-0001.png
More information about the stringtemplate-interest
mailing list