[antlr-interest] throws-spec in ANTLR rules -- does nothing?

Braden McDaniel braden at endoframe.com
Sat Dec 4 23:05:56 PST 2010


On 12/5/10 1:54 AM, Braden McDaniel wrote:
> On 11/13/10 10:02 AM, Joachim Schrod wrote:
>> I'm using ANTLR 3.2 with Java code generation.
>>
>> According to the ANTLR book, p.94, and
>> http://www.antlr.org/wiki/pages/viewpage.action?pageId=1956, a rule
>> may have a «throws-spec». But I didn't find an explanation of that
>> part -- neither in the book nor on the Web site.
>>
>> If I have a rule that starts with
>>
>>    remarks throws DiscardPDFException : ...
>>
>> I would have thought that DiscardPDFException is added to the
>> throws clause of the generated method; but it isn't done so. ANTLR
>> expects that clause without error messages, but also without effects.
>>
>> So my question is:
>> What's the spec for «throws-spec», syntactically and semantically?
> 
> I'm wondering about this, too.  Is "throws" just a placeholder in Antlr 3.2?
> 
> [Poking this because it didn't appear to get a response.]

Okay; so a few minutes after sending this, I found:

> http://www.antlr.org/jira/browse/ANTLR-100

... and I guess the answer to my question is "yes".

-- 
Braden McDaniel <braden at endoframe.com>


More information about the antlr-interest mailing list