ExpressionFactory

This utility class provides methods to ease the building and usage of IExpression without parsing.

Functions

Link copied to clipboard
Given a single literal (either variable or constant), builds the corresponding expression.
Link copied to clipboard
Given a number, builds a numeric expression.
open fun buildExpression(s: HashString): IExpression
Given a single literal (either variable or constant), builds the corresponding expression.
Link copied to clipboard
open fun buildLiteralNode(s: HashString): ITreeNode<out Any>
Given a single literal (either variable or constant), builds the corresponding ITreeNode.
Link copied to clipboard
open fun wrap(n: Double): IExpression
Given a double, creates a NumTreeNode and wraps it into a ListTreeNode.
open fun wrap(node: ITreeNode<out Any>): IExpression
Given a node, wraps it into a ListTreeNode.
open fun wrap(nodes: Iterable<ITreeNode<out Any>>): IExpression
Wraps a collection of ITreeNode into a new List IExpression.
open fun wrap(s: HashString): IExpression
Given a HashString, creates the corresponding ITreeNode and wraps it into a ListTreeNode.