[antlr-interest] Function Call,
Ric Klaren
ric.klaren at gmail.com
Wed Jun 29 15:08:23 PDT 2005
Craig Main wrote:
> Hi,
>
> I am *still* struggling.
> What am I missing here?
>
> I have tried the following rule.
> #(METHOD_CALL( #(ELIST (expression)*))) {log.Info("Method Call");}
>
> I also tried to match just
> #(ELIST ( expression )* ) {log.Info("ELIST");}
>
> It also doesn't match. The log output is never produced.
>
> It still doesn't match.
> The output is as follows.
>
> rules.g:33:60: warning:Rule 'expression' returns a value
> RuleLexer.cs(108,12): warning CS0219: The variable '_token' is assigned but
> its value is never used
>
> Tree Printout, trying to match TEMP = 4 + func[10+1,2];
So the input uses '[' and ']' as function argument grouping?
> value : (ID LPAREN) => function
> | literal
> ;
Is your LPAREN a '(' or a '[' ? I suspect that the treeparser entered
the literal rule in stead of the function one.
In case of doubt generate the treeparser with the -traceTreeParser and
meditate on the output of that. This makes it really hard to see where
the parser takes a wrong turn... The various tracing options to antlr
for the generated lexers/parsers/treeparsers are some of your best friends.
Cheers,
Ric
More information about the antlr-interest
mailing list