[antlr-interest] "throws" clause in v3 Rule Syntax.

Terence Parr parrt at cs.usfca.edu
Thu Jun 14 20:02:34 PDT 2007


Hi Don,

Sorry about that.  Yep, existing bug:

http://www.antlr.org:8888/browse/ANTLR-100

Ter

On Jun 15, 2007, at 5:06 AM, Don Maier wrote:

> 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
>
>



More information about the antlr-interest mailing list