Package com.strobel.expressions
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.RewriteAction
private List
<Expression> private boolean
private final Expression[]
private int
private StackSpiller.Stack
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
add
(Expression node) (package private) void
add
(ExpressionList expressions) (package private) void
addArguments
(IArgumentProvider expressions) (package private) boolean
private void
(package private) StackSpiller.Result
Finish
(Expression expr) (package private) Expression
get
(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
-