Null token in JavaCC
I have a strange problem with the <NULL: "null"> token in my JavaCC parser. In a type expression
String IsNullClause():
{
String res = "";
}
{
<IS> {res += " IS ";}
[<NOT> {res += " NOT ";} ]
<NULL> {res += " NULL ";}
{
return res;
}
}
the parser does not see the NULL token and throws an exception that expects a null. If I change the definition of the token to <NULL: "null_val"> or something else works fine. Is this my mistake or is JavaCC not accepting "null" as the value of the token?
+3