Class StackSpiller.ChildRewriter
java.lang.Object
com.strobel.expressions.StackSpiller.ChildRewriter
- Enclosing class:
StackSpiller
Rewrites child expressions, spilling them into temps if needed. The stack
starts in the initial state, and after the first sub-expression is added,
it is change to non-empty. This behavior can be overridden by setting the
stack manually between adds.
When all children have been added, the caller should rewrite the node if
didRewrite() is true. Then, it should call finish() with either the original
expression or the rewritten expression. finish() will call Expression.comma()
if necessary and return a new Result.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StackSpiller.RewriteActionprivate List<Expression> private booleanprivate final Expression[]private intprivate StackSpiller.Stack -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidadd(Expression node) (package private) voidadd(ExpressionList expressions) (package private) voidaddArguments(IArgumentProvider expressions) (package private) booleanprivate void(package private) StackSpiller.ResultFinish(Expression expr) (package private) Expressionget(int index) (package private) ExpressionList<? extends Expression> get(int first, int last) (package private) StackSpiller.RewriteAction
-
Field Details
-
_expressions
-
_expressionsCount
private int _expressionsCount -
_comma
-
_action
-
_stack
-
_done
private boolean _done
-
-
Constructor Details
-
ChildRewriter
ChildRewriter(StackSpiller.Stack stack, int count)
-
-
Method Details
-
add
-
add
-
addArguments
-
ensureDone
private void ensureDone() -
didRewrite
boolean didRewrite() -
getAction
StackSpiller.RewriteAction getAction() -
Finish
-
get
-
get
-