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

Reply via email to