Package nz.org.riskscape.rl.ast
Interface Expression
- All Known Implementing Classes:
BinaryOperation
,BracketedExpression
,Constant
,FunctionCall
,Lambda
,ListDeclaration
,ParameterToken
,PropertyAccess
,SelectAllExpression
,StructDeclaration
public interface Expression
An as yet Unrealized expression AST.
Implementing bits of AST should not consider the underlying source code to be part of the objects identity, only the meaningful bits of the AST. For the most part, this boils down to ignoring whitespace and location the source.
-
Method Summary
Modifier and TypeMethodDescription<T,
R> R accept
(ExpressionVisitor<T, R> visitor, T data) default <T extends Expression>
Optional<T>Functional style instanceof methodtoSource()
-
Method Details
-
toSource
String toSource() -
isA
Functional style instanceof method
-
getBoundary
- Returns:
- a pair of tokens that represent the start and end of this expression, to be used when giving users information about where errors have occurred. If the expression has been rebuilt then the boundary may be empty or it may be from the original expression. Intended for use in problems to trace errors back to their source.
-
accept
-