[antlr-interest] "throws" clause in v3 Rule Syntax.
Don Maier
dMaier at genome.stanford.edu
Thu Jun 14 12:06:46 PDT 2007
Good day,
There has been some discussion of the "throws" clause in ANTLR v3
dating back to the beginning of April, but I'm not aware of anything
since.
The documented v3 Rule Syntax (http://www.antlr.org/wiki/display/
ANTLR3/ANTLR+v3+printable+documentation) is:
---------------
Rule syntax
/** rule comment */
access-modifier rule-name[«arguments»] returns [«return-values»]
throws name1, name2, ...
options {...}
scope {...}
scope global-scope-name;
@init {...}
@after {...}
: «alternative-1» -> «rewrite-rule-1»
| «alternative-2» -> «rewrite-rule-2»
...
| «alternative-n» -> «rewrite-rule-n»
;
catch [«exception-arg-1»] {...}
catch [«exception-arg-2»] {...}
finally {...}
---------------
It appears to me that:
1) ANTLRWorks 1.0.2 disallows the "throws" clause.
2) ANTLR 3.0 ignores it.
3) The syntactic description above may be interpreted to mean that
the "throws" clause cannot appear without the "returns" clause (and
conversely). That does not appear to be correct -- or, at least,
what we would want.
4) The "throws" clause is *really* important for any *real*
application of ANTLR: Is there any other means of returning
semantic errors found in semantic analysis interspersed with the parse?
Any information about this would be immensely appreciated.
Thank you!
Regards,
Don Maier
Sr. Software Designer/Research
Dept. of Biochemistry
Stanford University School of Medicine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070614/ebb7082f/attachment.html
More information about the antlr-interest
mailing list