Class Expression
java.lang.Object
liquidjava.rj_language.ast.Expression
- Direct Known Subclasses:
AliasInvocation, BinaryExpression, FunctionInvocation, GroupExpression, Ite, LiteralBoolean, LiteralInt, LiteralReal, LiteralString, UnaryExpression, Var
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract <T> Taccept(ExpressionVisitor<T> visitor) voidchangeAlias(Map<String, AliasDTO> alias, Context ctx, spoon.reflect.factory.Factory f) abstract Expressionclone()abstract booleanabstract voidgetStateInvocations(List<String> toAdd, List<String> all) abstract voidgetVariableNames(List<String> toAdd) booleanabstract inthashCode()booleanChecks if this expression produces a boolean type based on its structureabstract booleanbooleanvoidsetChild(int index, Expression element) substitute(Expression from, Expression to) Substitutes the expression first given expression by the secondvoidsubstituteFunction(String functionName, List<Expression> parameters, Expression sub) Substitutes the function call with the given parameter to the expression esubstituteState(Map<String, Expression> subMap, String[] toChange) Returns a simplified string representation of this expression with unqualified names (e.g., com.example.State.open => open Default implementation delegates to toString() Subclasses that contain qualified names should override this methodabstract StringtoString()voidvalidateGhostInvocations(Context ctx, spoon.reflect.factory.Factory f) Validates all ghost function invocations within this expression against the provided context This method supports overloading by iterating through all ghost functions with the matching name If a valid signature is found, no error is thrown If the invocation name exists but no overload matches the argument types, anArgumentMismatchErroris thrown.
-
Constructor Details
-
Expression
public Expression()
-
-
Method Details
-
accept
- Throws:
LJError
-
getVariableNames
-
getStateInvocations
-
isBooleanTrue
public abstract boolean isBooleanTrue() -
hashCode
-
equals
-
clone
-
toString
-
toSimplifiedString
Returns a simplified string representation of this expression with unqualified names (e.g., com.example.State.open => open Default implementation delegates to toString() Subclasses that contain qualified names should override this method- Returns:
- simplified string representation
-
addChild
-
getChildren
-
hasChildren
public boolean hasChildren() -
setChild
-
isLiteral
public boolean isLiteral() -
isBooleanExpression
public boolean isBooleanExpression()Checks if this expression produces a boolean type based on its structure- Returns:
- true if it is a boolean expression, false otherwise
-
substitute
Substitutes the expression first given expression by the second- Parameters:
from-to-- Returns:
-
substituteFunction
Substitutes the function call with the given parameter to the expression e- Parameters:
functionName-parameters-sub-
-
substituteState
-
changeAlias
-
validateGhostInvocations
Validates all ghost function invocations within this expression against the provided context This method supports overloading by iterating through all ghost functions with the matching name If a valid signature is found, no error is thrown If the invocation name exists but no overload matches the argument types, anArgumentMismatchErroris thrown.- Parameters:
ctx-f-- Throws:
LJError
-