Class Root
- java.lang.Object
-
- com.aquima.interactions.expressions.semantics.SemanticNodeBase
-
- com.aquima.interactions.expressions.semantics.nodes.Root
-
- All Implemented Interfaces:
ISemanticNode
public class Root extends SemanticNodeBase
This class represents the root of the expression tree.- Since:
- 7.0
- Author:
- O. Kerpershoek
-
-
Constructor Summary
Constructors Constructor Description Root(Position position, ISemanticNode expression, LocalVariable... variables)
Constructs the expression node with a list of local variables.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
collectScopedObjects(ScopedObjects resultSet)
This method may be used to collect the names of the objects that need to be in scope in order to evaluate the expression of this node.ISemanticNode[]
getChildNodes()
This method returns an array containing the child nodes.ISemanticNode
getExpression()
This method returns the main expression parse tree.LocalVariable[]
getVariables()
This method returns an array containing the local variable definitions.void
visit(ISemanticNodeVisitor visitor)
This method allows a type safe visitation of the node.-
Methods inherited from class com.aquima.interactions.expressions.semantics.SemanticNodeBase
addMessage, getDataType, getDomain, getMessages, getPosition, getType, hasMessage, isDerivedType, isMultivalue, setDerived, setDomain, setType, setType, toString
-
-
-
-
Constructor Detail
-
Root
public Root(Position position, ISemanticNode expression, LocalVariable... variables)
Constructs the expression node with a list of local variables.- Parameters:
position
- Position information for the node.expression
- The node containing the expression parse tree.variables
- Array containing local variable definitions.
-
-
Method Detail
-
getExpression
public ISemanticNode getExpression()
This method returns the main expression parse tree.- Returns:
- The main expression parse tree.
-
getVariables
public LocalVariable[] getVariables()
This method returns an array containing the local variable definitions. As local variables are optional, the returned array will usually be empty (but never null).- Returns:
- An array containing the local variable definitions.
-
getChildNodes
public ISemanticNode[] getChildNodes()
Description copied from interface:ISemanticNode
This method returns an array containing the child nodes. The order of the child nodes in the array is not defined, and the array may be empty for nodes that do not have child nodes.- Returns:
- Array containing the child nodes of this node.
-
collectScopedObjects
public void collectScopedObjects(ScopedObjects resultSet)
Description copied from interface:ISemanticNode
This method may be used to collect the names of the objects that need to be in scope in order to evaluate the expression of this node. The object passed to the method will be enriched with the names of the objects that need to be in scope.- Parameters:
resultSet
- The object that should be used to add the names of the objects that need to be in scope to.
-
visit
public void visit(ISemanticNodeVisitor visitor)
Description copied from interface:ISemanticNode
This method allows a type safe visitation of the node. The visit method will not invoke the visitor for any child nodes.- Parameters:
visitor
- The visitor that should be invoked for this node.
-
-