Thank you! Another question is that I am doing type checking in my grammar
file, is there a way to display errors like the syntax error instead of
sending them to stderr? I read Terrence Parr's recently posting (
http://www.stringtemplate.org/wiki/display/ANTLR3/Pattern+for+returning+errors+from+ANTLR+in+data+structures,+not+STDERR)
, not sure I understand it. Hope you can help. Thanks.

-- Ching

On Thu, Dec 30, 2010 at 8:21 PM, Nick Vlassopoulos
<[email protected]>wrote:

> Hi Ching,
>
> I am not sure if it is a legitimate statement, but what you probably want
> is the @members and @header keywords that add your code in the
> generated files.
>
> HTH,
>
> Nikos
>
> On Thu, Dec 30, 2010 at 10:53 PM, Ching <[email protected]> wrote:
>
>> Hi,
>>
>> In a Antlr grammar file, I declared a number of variables. Is there a way
>> to
>> initialize these variables, for example, in the default constructor?
>>
>> Is below a legitimate grammar statement?
>>
>> *start:  initialization { var = new XXX();}  compilation_unit EOF*
>>
>> Thanks.
>>
>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> Unsubscribe:
>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>>
>
>

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to