|
3.4 Error HandlingThe only errors appropriately handled by a lexical analyzer are those which misuse a sequence of characters. Errors such as using a reserved word as an identifier are syntax errors to be found by the parser. One way to handle errors is to define error tokens. For example, if the language does not contain a ".", a regular expression can be defined using one and the associated action would be to report an error. Anticipating such user errors has met with limited success. Send questions and comments to: Karen Lemone |