Package gw.internal.gosu.parser
Class ContextInferenceManager
- java.lang.Object
-
- gw.internal.gosu.parser.ContextInferenceManager
-
public class ContextInferenceManager extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classContextInferenceManager.TypeAsContextprivate static classContextInferenceManager.TypeAsEntry
-
Field Summary
Fields Modifier and Type Field Description private Stack<ContextInferenceManager.TypeAsContext>_inferenceStackprivate ContextInferenceManager.TypeAsContext_lastprivate boolean_refCollectionSuspendedprivate static ContextInferenceManager.TypeAsContextEMPTY_CTXprivate static booleanENABLED
-
Constructor Summary
Constructors Constructor Description ContextInferenceManager()
-
Method Summary
-
-
-
Field Detail
-
ENABLED
private static final boolean ENABLED
- See Also:
- Constant Field Values
-
EMPTY_CTX
private static final ContextInferenceManager.TypeAsContext EMPTY_CTX
-
_inferenceStack
private Stack<ContextInferenceManager.TypeAsContext> _inferenceStack
-
_last
private ContextInferenceManager.TypeAsContext _last
-
_refCollectionSuspended
private boolean _refCollectionSuspended
-
-
Method Detail
-
copy
public ContextInferenceManager copy()
-
pushCtx
public void pushCtx()
-
popCtx
public void popCtx(boolean preserveInference)
-
pushLastCtx
public void pushLastCtx()
-
restoreLastCtx
public void restoreLastCtx()
-
clear
public void clear()
-
updateType
public void updateType(Expression expression, IType typeIsType)
-
unwrapParens
private Expression unwrapParens(Expression expression)
-
infer
public IType infer(Expression e)
-
isPossibleToInfer
private boolean isPossibleToInfer(Expression e)
-
cancelInferences
public void cancelInferences(Expression assignmentRoot, Expression rhs)
-
handleLoopCompromisedExpressions
private void handleLoopCompromisedExpressions(ContextInferenceManager.TypeAsEntry typeAsEntry, Expression assignmentRoot)
-
reverifyExpression
private void reverifyExpression(ContextInferenceManager.TypeAsEntry typeAsEntry, Expression assignmentRoot, Expression expression)
-
unwrapImplicitTypeAs
public static IParsedElement unwrapImplicitTypeAs(Expression expression)
-
getUnwrappedExpression
public static Expression getUnwrappedExpression(Expression expression)
If the expression is wrapped in ImplicitTypeAsExpressions, this will will unwrap them back down to the original expression.- Parameters:
expression-- Returns:
-
isStartFor
private boolean isStartFor(Expression possibleStart, Expression expression)
-
findEntry
private ContextInferenceManager.TypeAsEntry findEntry(Expression e)
-
areExpressionsEquivalent
private boolean areExpressionsEquivalent(Expression e1, Expression e2)
-
pushLoopCompromised
public void pushLoopCompromised()
-
popLoopCompromised
public void popLoopCompromised()
-
suspendRefCollection
public void suspendRefCollection()
-
resumeRefCollection
public void resumeRefCollection()
-
-