I am getting ANTLR3 error 100 over the grammar below on ANTLR works 1.5. However, when I compile this on eclipse Luna, it compiles successfully:
datatype returns [Type type=null]
@after{
$type=$t.type;
}
:
t=datatype_item -> ^(DATATYPE datatype_item)
;
This is a small portion of a grammar and I am getting loads of errors similar to this. I have DATAType defined as imaginary token and there are no multiline or document comments in the grammar. Error details are as:
[15:43:08] error(100): SQL.g:897:25: syntax error: antlr: NoViableAltException(96@[])
[15:43:08] error(100): SQL.g:897:27: syntax error: antlr: NoViableAltException(94@[])
[15:43:08] error(100): SQL.g:897:27: syntax error: antlr: MissingTokenException(inserted [@-1,0:0='<missing SEMI>',<82>,897:26] at DATATYPE)
[15:43:08] error(100): SQL.g:897:37: syntax error: antlr: MissingTokenException(inserted [@-1,0:0='<missing COLON>',<22>,897:36] at datatype_item)
[15:43:08] error(100): SQL.g:897:50: syntax error: antlr: NoViableAltException(78@[])
Can anyone help me over this.
Solved my problem by adding options at the top and made my parser grammar just grammar.