Natan wrote:
> Hi,
>
> I have a grammar like this :
>
> tokens {
> ERROR = 'error';
> IF = 'if';
> ELSE = 'else';
> }
>
> ...
>
> variableAssignment
> : variable '=' expression
> ;
>
> variable
> : '$' ID
> ;
>
> errorStatement
> : ERROR STRING
> ;
>
> ...
>
> ID
> : ('a' .. 'z' | 'A' .. 'Z' | '_') ( 'a' .. 'z' | 'A' .. 'Z' |
> '0' .. '9' | '_' )*
> ;
>
>
> As you can see, variables are like in Perl with $ in front of them.
> Everything works fine until I try to call a variable "$error" or "$if".Variable should be a lexer rule. -- David-Sarah Hopwood ⚥ http://davidsarah.livejournal.com
signature.asc
Description: OpenPGP digital signature
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
