so in both scope and @init actions you can't do \r?
Ter
On Oct 14, 2008, at 9:56 AM, Sam Harwell wrote:

> Both problems are solved when the file was resaved with \n line  
> endings. Previously they were inconsistent (probably a mix of \r\n  
> and \n endings.
>
> Sam
>
> From: [EMAIL PROTECTED] [mailto:antlr-dev- 
> [EMAIL PROTECTED] On Behalf Of Sam Harwell
> Sent: Tuesday, October 14, 2008 11:52 AM
> To: ANTLR-dev Dev
> Subject: [antlr-dev] Bugs in dynamic attribute scope
>
> I know these were working at some point in the recent past, but I  
> just rebuilt the grammar and found they don’t compile.
>
> The following causes 2 compile errors:
>
> rule_name
> scope
> {
>         //int _is_float;
>
>         // index of the first token that is not part of this seq
>         // note that this means you need a >= instead of > in the  
> CanMatch____ semantic predicates'
>         // check for whether a token can belong in this sequence.
>         int _last_specifier;
> }
> @init
> {
>         $rule_name::_last_specifier = -1;
> }
>
> Here are the two errors:
>
> 1.       The grammar itself won’t compile; the antlr tool returns
> error 141: unknown dynamically-scoped attribute for scope rule_name:  
> _last_specifier
> 2.       If you move int _last_specifier; above the line starting  
> with // index, then the grammar compiles, but you find the following  
> line in the generated code, causing it to not compile:
> protected internal //int _is_float;
>
> Sam
> _______________________________________________
> antlr-dev mailing list
> [email protected]
> http://www.antlr.org:8080/mailman/listinfo/antlr-dev

_______________________________________________
antlr-dev mailing list
[email protected]
http://www.antlr.org:8080/mailman/listinfo/antlr-dev

Reply via email to