Why the generated parser code tolerates illegal expression?

Considering below grammar, the generated parser code tolerates illegal expression like "NotExpression1 ANND NotExpression2", the parser just ignores the part "ANND NotExpression2". The solution is to explicitly declare EOF at the end of constraint definition. i.e. constraint: orexpression EOF;

constraint: orexpression;

orexpression: andexpression ("or"^ andexpression)*;

andexpression:  notexpression ("and"^ notexpression)*;

notexpression:  ("not"^)? equalityExpression;

equalityExpression: relationalExpression ((NOTEQ^ | EQUAL^)  relationalExpression)*;