TMtxExpression.OnPreprocessor Property

TOnPreprocessor OnPreprocessor { get; set; }

The preprocessor event is called after the preprocessor has already applied any substitions and patched the parsed expression.

Returns: TOnPreprocessor

Remarks:

All modifications must be made to the Expr list parameter. This is the list of lexems forming the expression. For example abc(2 + 3) is formed with 'abc', '(', '2', '+', '3', ')'. The parser already assigns the type of lexeme to each entry. May that be a variable, a constant or a function.

This preprocessor allows you to easily parse individual expression elements further in to form understandable to the compiler. An example of the preprocessor purpose is the ability to pass spreadsheet cells or ranges to the expression parser. This expressions could be of type: A2:B3, A3, A2:B3 and so on. You can replace these expression with custom function specifications like:

spreadsheet('A',2,'B',3);

which could be hard for the user to write. The "spradsheet" function itself however still has to be declared and implemented.