Package ch.tocco.nice2.conditionals.api.tree
package ch.tocco.nice2.conditionals.api.tree
An API for tree-based conditionals. The classes in this package typically represent
the AST of a conditional
expression. It's currently used by both the
ch.tocco.nice2.persist.query.PersistQL
query language and the
ch.tocco.nice2.security.spi.PolicyCompiler
ACL policy compiler.
Tree Processing
This API also contains a builtin facility for tree processing, which also allows to completely rewrite the whole tree. The entry point into this processing facility is theprocess()
method and the
NodeVisitor
class.
The Cursor
is used to both
control how the tree is being visited, including skipping or re-visiting nodes or
trees, and to add/remove/replace nodes or trees.
**TODO:** More on processing?
Annotations
Another important concept of this API areannotations
. Annotations are heavily used
during analysis of the AST to keep track of various additional data and aspects. These
annotations are usually very specific to the language. A path or identifier e.g. may be
with the object it references, the type of a resolved value etc.
Other Utilities
This API further provides facilities for error reporting and keeping track of the source code. See the classesProblem
,
ProblemSink
and
ProblemFormatter
for more information.-
ClassDescriptionNode that can be extended to integrate custom nodes and behaviour into the tree.