Interface ISemanticNode
- All Known Subinterfaces:
IVariable
- All Known Implementing Classes:
AllVariable
,Arithmetic
,Condition
,Constant
,Conversion
,DimensionChange
,ErrorNode
,ExpressionList
,FieldVariable
,FunctionCall
,InstanceOf
,Inversion
,ListArithmetic
,ListCondition
,LocalVariable
,LogicalConnective
,NamedVariable
,Not
,Predicate
,Root
,Select
,SemanticNodeBase
,TemplateCall
,TypeOf
,Unknown
,Variable
public interface ISemanticNode
Base interface for all nodes in the semantic tree.
- Since:
- 6.0
- Author:
- O. Kerpershoek
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessage
(Severity severity, ErrorMessage message) This method adds a message to the semantic node.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.This method returns an array containing the child nodes.This method returns the data type of the node.This method returns the domain of values that may be returned by the expression.getMessages
(Severity severity, boolean includeChildMessages) This method returns an array of messages that were detected while parsing the node.This method returns the position information of the node.getType()
This method returns the type information of the node.boolean
hasMessage
(Severity severity, ErrorCode errorCode, boolean includeChildMessages) This method detects whether a specific message is found within the semantic node.boolean
This method returns a boolean indicating if the type of this node is derived.boolean
This method returns a boolean indicating if the expression will result in multiple values.void
visit
(ISemanticNodeVisitor visitor) This method allows a type safe visitation of the node.
-
Method Details
-
getPosition
Position getPosition()This method returns the position information of the node.- Returns:
- The position information of the node.
-
isMultivalue
boolean isMultivalue()This method returns a boolean indicating if the expression will result in multiple values.- Returns:
- a boolean indicating if the expression will result in multiple values.
-
getDataType
DataType getDataType()This method returns the data type of the node.- Returns:
- the data type of the node.
-
getDomain
Domain getDomain()This method returns the domain of values that may be returned by the expression.- Returns:
- the domain of values that may be returned by the expression.
-
isDerivedType
boolean isDerivedType()This method returns a boolean indicating if the type of this node is derived. A derived type is usually the result of an operation where the result type may be ambiguous. For instance the multiplication of a number with a percentage, may result in either a number or a percentage. Usually the most specific type is chosen (percentage in the previous example). Nodes representing constants or variables will often return false as a result of this method.- Returns:
- a boolean indicating if the type of this node is derived.
-
getType
Type getType()This method returns the type information of the node. The type information is a combination of the data type, the domain and the multivalue indicator.- Returns:
- The type information of the node.
-
getMessages
This method returns an array of messages that were detected while parsing the node. If the severity parameter is null, all messages will be returned regardless of their severity. When a severity is specified, only the messages matching the severity will be returned. The boolean argument may be used to indicate if only the messages of this node should be returned, or also the messages of any child nodes.- Parameters:
severity
- The severity may be used to request only the messages matching the specified severity.includeChildMessages
- Boolean indicating if child messages should also be returned.- Returns:
- Array of messages that were detected during the parse phase for this node.
-
hasMessage
This method detects whether a specific message is found within the semantic node. The boolean argument may be used to indicate if only the messages of this node should be checked, or also the messages of any child nodes. The severity parameter may be used to specify if only messages matching that severity should be searched. When the severity parameter is null, all messages regardless of severity will be searched.- Parameters:
severity
- The severity of the error (optional).includeChildMessages
- Boolean indicating if child messages should also be checked.errorCode
- The error code for which to search.- Returns:
- A boolean indicating the error was found in the node.
-
addMessage
This method adds a message to the semantic node.- Parameters:
severity
- The severity of the message.message
- The message that should be added.
-
getChildNodes
ISemanticNode[] getChildNodes()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
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
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.
-