[antlr-interest] unexpected token: FUNCTIONCALL

Anthony Youngman Anthony.Youngman at ECA-International.com
Fri May 28 04:03:00 PDT 2004


Solved!

I thought I'd just put in the reference to FUNCTIONCALL, and I actually
needed to put in rather more ... I got misled by the error message.

Cheers,
Wol 

-----Original Message-----
From: Anthony Youngman [mailto:Anthony.Youngman at ECA-International.com] 
Sent: 28 May 2004 11:03
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] unexpected token: FUNCTIONCALL

antlr.Tool is blowing up with this in my treeparser ...

The relevant bit of the parser is

// handle functions etc here ...
// if ident is followed by arglist, change it to function
protected functionorident
	: idnt:IDENT {int junk = st.FindSymbol( 2, idnt.getText());} (
arglist { ## = #(#[FUNCTIONCALL,"function-call"], ##); } )? ;

and the treeparser is

	: (slit:STRING_LITERAL) {st.write("PUSHL "+slit.getText());}
	| (nlit:NUMBER_LITERAL) {st.write("PUSHL "+nlit.getText());}
//	| (idnt:IDENT) {st.write("PUSHV "+idnt.getText());}
	| functionorident
	;

functionorident
	: (idnt:IDENT) {st.write("PUSHV "+idnt.getText());}
	| #(FUNCTIONCALL)
	;

It's the last line - "| #(FUNCTIONCALL)" that it's objecting to. When I
don't have it in, my grammar runs but fails with an "unexpected AST
node" - now I'm trying to tell it about it, it won't compile the grammar
:-(

Cheers,
Wol



************************************************************************
****

This transmission is intended for the named recipient only. It may
contain private and confidential information. If this has come to you in
error you must not act on anything disclosed in it, nor must you copy
it, modify it, disseminate it in any way, or show it to anyone. Please
e-mail the sender to inform us of the transmission error or telephone
ECA International immediately and delete the e-mail from your
information system.

Telephone numbers for ECA International offices are: Sydney +61 (0)2
8272 5300, Hong Kong + 852 2121 2388, London +44 (0)20 7351 5000 and New
York +1 212 582 2333.

************************************************************************
****



 
Yahoo! Groups Links



 





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list