I am new to Antlr and I have defined a basic grammar using Antlr 3.
The grammar can be seen below:
grammar data;
@header {
package com.data.language;
}
null : 'null';
data : null | STRING | INTEGER;
STRING : ('a'..'z'|'A'..'Z')+;
INTEGER : '0'..'9'+;
This works perfectly and ANTLRWorks generates the code. However, I would like to use the data keyword within the lexer. For example:
I : data '*' INTEGER;
The problem is that once this is done, I am getting the following Exception:
Error 106: reference to undefined value: data
and I cannot see the data within the graph of ANTLRWorks. I can see only * INTEGER of the I lexer.
Is what I am trying to do, is it possible? How is it possible?