Files

17 lines
560 B
Plaintext

Errors and error handling
Step 1. Channel all errors to Lexer.Error.
Step 2.
There should be an error-handling delegate supplied to lexer.
The default error handler is controlled by a boolean
m_ExceptionOnError (false by default):
if true, an exception of type CSToolsException is raised;
if false a message is printed on the console.
The parser can also handle errors using the error symbol, but if so,
the result of the parse is an error symbol with a public field ast
of type SYMBOL, containing any parser tree built by the parser.