 Parsing errors can be identified without the parser having to read the whole input by declaring some rules as errors.For example,

can be declared an error, causing the parser to stop.This means that the lookahead information can also be used to catch errors, as in the following example