[antlr-interest] Re: 2.7.2a4 ANTLR/C# - build ok, panic shutdown
Terence Parr
parrt at jguru.com
Wed Dec 4 21:57:29 PST 2002
On Wednesday, December 4, 2002, at 03:08 PM, slightlynew wrote:
> What I wasn't able to get working in Antlr 2.7.2a6 was that third
> parameter that Terence added to the AST constructor syntax: #
> [FOO, "Foo", "FooNode"] (or something like that!) I couldn't get
> that to work either with Java or C# (having ported Terence's changes
> to the C# action.g). Antlr rejects the third parameter with a syntax
> error saying "unexpected ','". Is there something else one needs to
> do, to get Antlr to use the new action.g?
Hmm...the latest version should have that. I could have sworn I tested
that. I updated this java/action.g rule:
protected
AST_CONSTRUCTOR!
: '[' (WS)? x:AST_CTOR_ELEMENT (WS)?
(',' (WS)? y:AST_CTOR_ELEMENT (WS)? )?
(',' (WS)? z:AST_CTOR_ELEMENT (WS)? )? ']'
{
String args = x.getText();
if ( y!=null ) {
args += ","+y.getText();
}
if ( z!=null ) {
args += ","+z.getText();
}
$setText(generator.getASTCreateString(null,args));
}
;
To allow the 3rd arg. Hmm....
Ter
--
Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org
Lecturer in Comp. Sci., University of San Francisco
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list