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 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 the process() 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.


Another important concept of this API are annotations. 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 classes Problem, ProblemSink and ProblemFormatter for more information.