[antlr-interest] parser not throwing exception
Dilip Easwaran
dilipe at coreobjects.com
Sun Aug 13 02:25:22 PDT 2006
Hi All:
I am using antlr version 2.7.5.
I have for my requirements a calculation utility as part of which i have defined a function "len": Basically, returns the length of an alphanumeric input
len returns [ String result = "" ] throws Exception :
LENKEYWORD
(
LPAREN
(
result = statement
)
RPAREN
(
{ result = ""+result.length(); }
)
);
for Iput : len("Hello!"
the result is : line 1:10: expecting RPAREN, found 'null' .
But it is logging this error to the stderr and not throwing it. I cant override reportError method in LLkParser to throw an exception.
how do i go about doing this?
Regards,
Dilip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060813/1181bf66/attachment.html
More information about the antlr-interest
mailing list