Class ForEachStatementTransformer
- java.lang.Object
-
- gw.internal.gosu.ir.transform.AbstractElementTransformer<T>
-
- gw.internal.gosu.ir.transform.statement.AbstractStatementTransformer<ForEachStatement>
-
- gw.internal.gosu.ir.transform.statement.ForEachStatementTransformer
-
public class ForEachStatementTransformer extends AbstractStatementTransformer<ForEachStatement>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classForEachStatementTransformer.ArrayIterator(package private) static classForEachStatementTransformer.NumberIterator(package private) static classForEachStatementTransformer.StringIterator
-
Field Summary
-
Fields inherited from class gw.internal.gosu.ir.transform.AbstractElementTransformer
CAPTURED_VAR_PREFIX, CTX_SYMBOL, CTX_SYMBOL_SUFFIX, CUSTOM_RUNTIMES, EMPTY_CLASS_ARRAY, ENHANCEMENT_THIS_REF, ENHANCEMENT_TYPE_PARAM_PREFIX, ENUM_PARAM_PREFIX, OBJECT_TYPE, OUTER_ACCESS, TYPE_PARAM_PREFIX
-
-
Constructor Summary
Constructors Modifier Constructor Description privateForEachStatementTransformer(TopLevelTransformationContext cc, ForEachStatement stmt)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IRStatementcompile(TopLevelTransformationContext cc, ForEachStatement stmt)protected IRStatementcompile_impl()private static booleanisArrayIteration(IType iterationType)private voidmakeArrayLoop(TopLevelTransformationContext cc, IRExpression rootExpression, IRForEachStatement forLoop, Symbol identifier)private IRExpressionmakeInt(IRExpression rootExpression)private voidmakeIntLoop(TopLevelTransformationContext cc, IRExpression rootExpression, IRForEachStatement forLoop, Symbol identifier)static java.util.IteratormakeIterator(java.lang.Object obj, boolean bStructuralIterable)private voidmakeIteratorLoop(TopLevelTransformationContext cc, IRExpression rootExpression, IRForEachStatement forLoop, Symbol identifier, Symbol iteratorIdentifier)static IRForEachStatementmakeLoop(TopLevelTransformationContext cc, IRExpression rootExpression, IType type, Symbol identifier, Symbol indexSymbol)Helper for creating iterative loops.private IRForEachStatementmakeLoopImpl(TopLevelTransformationContext cc, IRExpression rootExpression, IType type, Symbol identifier, Symbol indexSymbol, Symbol iteratorIdentifier)-
Methods inherited from class gw.internal.gosu.ir.transform.statement.AbstractStatementTransformer
_stmt, compile, visitStatementLineNumber, visitStatementLineNumber
-
Methods inherited from class gw.internal.gosu.ir.transform.AbstractElementTransformer
_cc, assignStructuralTypeOwner, avoidVerifyError, booleanLiteral, boxValue, boxValue, boxValueToType, buildAddition, buildArithmetic, buildArrayLength, buildArrayLoad, buildArrayLoad, buildArrayStore, buildAssignment, buildCast, buildComposite, buildComposite, buildEquals, buildFieldGet, buildFieldSet, buildGreaterThan, buildIf, buildIfElse, buildInitializedArray, buildMethodCall, buildMethodCall, buildMethodCall, buildNegation, buildNewExpression, buildNewExpression, buildNewExpression, buildNotEquals, buildNullCheckTernary, buildReturn, buildSubtraction, buildTernary, buildThrow, callMethod, callMethod, callMethod, callMethod, callMethod, callSpecialMethod, callSpecialMethod, callSpecialMethod, callStaticMethod, castResultingTypeIfNecessary, charLiteral, checkCast, checkCast, checkCast, classLiteral, classLiteral, classLiteral, clearCustomRuntimes, collectArgsIntoObjArray, convertBoxedNullToPrimitive, convertNullToPrimitive, convertOperandToBig, convertOperandToPrimitive, convertOperandToRational, exprList, fastStringCoercion, findComparableParamType, findDimensionType, getActualPropertyInfo, getCapturedSymbolParameterName, getClassInfos, getConcreteType, getConstructorParamTypes, getCustomRuntime, getDeclaredField, getDeclaredFieldImpl, getDeclaredMethod, getDeclaredMethod, getDefaultConstIns, getDescriptor, getDescriptor, getDescriptor, getDescriptor, getEnclosingDFS, getField, getField_new, getGosuClass, getInstanceField, getIRTypes, getIRTypes, getModifiers, getParsedElement, getRuntimeEnclosingType, getStaticField, getTypes, getTypeVarParamName, getTypeVarsForDFS, handleCustomExpressionRuntime, handleNamedArgs, identifier, initLocalVar, initLocalVarWithDefault, initMultiArray, inStaticContext, isBigType, isBoxedIntType, isBytecodeType, isBytecodeType, isCheckedArithmeticEnabled, isCompilingEnhancement, isEnhancementType, isEvalProgram, isExecuteMethod, isHandledByCustomCoercion, isIntType, isMemberOnEnclosingType, isMemberOnEnhancementOfEnclosingType, isNonBigBoxedNumberType, isNonStaticInnerClass, isNumberType, isPrimitiveNumberType, isProgram, isProgramOrEnclosedInProgram, makeAnnotationInfos, makeArrayViaTypeInfo, makeEmptyArrayViaTypeInfo, makeIRSymbol, maybeUnwrapMetaType, newArray, nullCheckVar, nullLiteral, numberConvert, numberConvert, numericLiteral, pushArrayOfDefValueExpr, pushArrayOfString, pushArrayOfTypes, pushCapturedSymbols, pushConstant, pushEnumSuperConstructorArguments, pushExternalSymbolsMap, pushLazyType, pushLazyType, pushNull, pushOuter, pushOuter, pushOuter, pushParamTypes, pushRuntimeTypeOfTypeVar, pushString, pushThis, pushThisOrOuter, pushType, pushType, pushTypeParametersForConstructor, requiresExternalSymbolCapture, requiresImplicitEnhancementArg, requiresImplicitEnhancementArg, setCc, setField, setField, setInstanceField, setStaticField, stringLiteral, unboxValueFromType, unboxValueToType, unboxValueToType, valueOf
-
-
-
-
Constructor Detail
-
ForEachStatementTransformer
private ForEachStatementTransformer(TopLevelTransformationContext cc, ForEachStatement stmt)
-
-
Method Detail
-
compile
public static IRStatement compile(TopLevelTransformationContext cc, ForEachStatement stmt)
-
compile_impl
protected IRStatement compile_impl()
- Specified by:
compile_implin classAbstractStatementTransformer<ForEachStatement>
-
makeLoop
public static IRForEachStatement makeLoop(TopLevelTransformationContext cc, IRExpression rootExpression, IType type, Symbol identifier, Symbol indexSymbol)
Helper for creating iterative loops. Note that after calling this method, you should compile and call gw.internal.gosu.ir.nodes.statement.IRForEachStatement#setBody(gw.internal.gosu.ir.nodes.IRStatement) on the IRForEachStatement. Since the body often depends on symbols introduced in the loop, you must usually compile it after the loop has been created. Thus it cannot be an argument to this function.
-
makeLoopImpl
private IRForEachStatement makeLoopImpl(TopLevelTransformationContext cc, IRExpression rootExpression, IType type, Symbol identifier, Symbol indexSymbol, Symbol iteratorIdentifier)
-
makeIteratorLoop
private void makeIteratorLoop(TopLevelTransformationContext cc, IRExpression rootExpression, IRForEachStatement forLoop, Symbol identifier, Symbol iteratorIdentifier)
-
makeArrayLoop
private void makeArrayLoop(TopLevelTransformationContext cc, IRExpression rootExpression, IRForEachStatement forLoop, Symbol identifier)
-
makeIntLoop
private void makeIntLoop(TopLevelTransformationContext cc, IRExpression rootExpression, IRForEachStatement forLoop, Symbol identifier)
-
makeInt
private IRExpression makeInt(IRExpression rootExpression)
-
isArrayIteration
private static boolean isArrayIteration(IType iterationType)
-
makeIterator
public static java.util.Iterator makeIterator(java.lang.Object obj, boolean bStructuralIterable)
-
-