JCL Help:TExprContext

From Project JEDI Wiki
Jump to navigationJump to search

Class Hierarchy

TExprContext
|
TExprHashContext
|
TExprSetContext


Summary

Finds a symbol corresponding to an identifier.


Pascal

 public TExprContext = class(TObject);


Description

Expressions composed solely of numbers and operators may be evaluated quite easily, but to make an expression evaluator really useful requires that things like named constants, variables and functions be added as well.
To allow a defined set of constants, variables and functions to be used in multiple evaluators (and mixed and matched according to need), the task of handling symbol resolution is devolved to an object known as a context.
Contexts are not required to be flat; indeed, they are expected to be compound objects, which devolve to other, more specialized contexts to do actual resolution.
As an example, consider the way names are resolved in Object Pascal. The set of valid symbols is initially defined by the System unit, and then added to with each unit named in the uses clause. When a method is being compiled, private, protected and public names come into the namespace; they aren't in effect with methods of other classes. In a similar way, contexts can be built up according to requirements.


See Also

TExprHashContext TExprSetContext


About

Unit

JclExprEval


Navigation

Donator

Barry Kelly


Notes

Don't construct instances of TExprContext directly, since it is abstract; instead, construct a concrete descendant.


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page