Package com.strobel.expressions
Class StackSpiller.ChildRewriter
- java.lang.Object
-
- com.strobel.expressions.StackSpiller.ChildRewriter
-
- Enclosing class:
- StackSpiller
private final class StackSpiller.ChildRewriter extends java.lang.ObjectRewrites 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
Fields Modifier and Type Field Description private StackSpiller.RewriteAction_actionprivate java.util.List<Expression>_commaprivate boolean_doneprivate Expression[]_expressionsprivate int_expressionsCountprivate StackSpiller.Stack_stack
-
Constructor Summary
Constructors Constructor Description ChildRewriter(StackSpiller.Stack stack, int count)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidadd(Expression node)(package private) voidadd(ExpressionList expressions)(package private) voidaddArguments(IArgumentProvider expressions)(package private) booleandidRewrite()private voidensureDone()(package private) StackSpiller.ResultFinish(Expression expr)(package private) Expressionget(int index)(package private) ExpressionList<? extends Expression>get(int first, int last)(package private) StackSpiller.RewriteActiongetAction()
-
-
-
Field Detail
-
_expressions
private final Expression[] _expressions
-
_expressionsCount
private int _expressionsCount
-
_comma
private java.util.List<Expression> _comma
-
_action
private StackSpiller.RewriteAction _action
-
_stack
private StackSpiller.Stack _stack
-
_done
private boolean _done
-
-
Constructor Detail
-
ChildRewriter
ChildRewriter(StackSpiller.Stack stack, int count)
-
-
Method Detail
-
add
void add(Expression node)
-
add
void add(ExpressionList expressions)
-
addArguments
void addArguments(IArgumentProvider expressions)
-
ensureDone
private void ensureDone()
-
didRewrite
boolean didRewrite()
-
getAction
StackSpiller.RewriteAction getAction()
-
Finish
StackSpiller.Result Finish(Expression expr)
-
get
Expression get(int index)
-
get
ExpressionList<? extends Expression> get(int first, int last)
-
-