edu.rice.cs.dynamicjava.symbol.type
Class TypeUpdateVisitor

java.lang.Object
  extended by edu.rice.cs.dynamicjava.symbol.type.TypeVisitorLambda<Type>
      extended by edu.rice.cs.dynamicjava.symbol.type.TypeUpdateVisitor
All Implemented Interfaces:
TypeVisitor<Type>, Lambda<Type,Type>

public abstract class TypeUpdateVisitor
extends TypeVisitorLambda<Type>

A depth-first visitor that makes an updated copy as it visits (by default). The type of the result is generally the same as that of the argument; where automatic recursion on a field of type T occurs, this must be true for T. Where no changes are made to a node, a new copy is not allocated. This visitor implements the visitor interface with methods that first update the children, and then call forCASEOnly(), passing in the values of the updated children. (CASE is replaced by the case name.) Override forCASE or forCASEOnly if you want to transform an AST subtree. There is no automatic delegation to more general cases, because each concrete case has a default implementation.


Constructor Summary
TypeUpdateVisitor()
           
 
Method Summary
 Type forBooleanType(BooleanType that)
          Methods to recur on each child.
 Type forBooleanTypeOnly(BooleanType that)
           
 Type forBottomType(BottomType that)
          Process an instance of BottomType.
 Type forBottomTypeOnly(BottomType that)
           
 Type forByteType(ByteType that)
          Process an instance of ByteType.
 Type forByteTypeOnly(ByteType that)
           
 Type forCharType(CharType that)
          Process an instance of CharType.
 Type forCharTypeOnly(CharType that)
           
 Type forDoubleType(DoubleType that)
          Process an instance of DoubleType.
 Type forDoubleTypeOnly(DoubleType that)
           
 Type forFloatType(FloatType that)
          Process an instance of FloatType.
 Type forFloatTypeOnly(FloatType that)
           
 Type forIntersectionType(IntersectionType that)
          Process an instance of IntersectionType.
 Type forIntersectionTypeOnly(IntersectionType that, java.lang.Iterable<? extends Type> ofTypes_result)
           
 Type forIntType(IntType that)
          Process an instance of IntType.
 Type forIntTypeOnly(IntType that)
           
 Type forLongType(LongType that)
          Process an instance of LongType.
 Type forLongTypeOnly(LongType that)
           
 Type forNullType(NullType that)
          Process an instance of NullType.
 Type forNullTypeOnly(NullType that)
           
 Type forParameterizedClassType(ParameterizedClassType that)
          Process an instance of ParameterizedClassType.
 Type forParameterizedClassTypeOnly(ParameterizedClassType that, java.lang.Iterable<? extends Type> typeArguments_result)
           
 Type forRawClassType(RawClassType that)
          Process an instance of RawClassType.
 Type forRawClassTypeOnly(RawClassType that)
           
 Type forShortType(ShortType that)
          Process an instance of ShortType.
 Type forShortTypeOnly(ShortType that)
           
 Type forSimpleArrayType(SimpleArrayType that)
          Process an instance of SimpleArrayType.
 Type forSimpleArrayTypeOnly(SimpleArrayType that, Type ofType_result)
           
 Type forSimpleClassType(SimpleClassType that)
          Process an instance of SimpleClassType.
 Type forSimpleClassTypeOnly(SimpleClassType that)
           
 Type forTopType(TopType that)
          Process an instance of TopType.
 Type forTopTypeOnly(TopType that)
           
 Type forUnionType(UnionType that)
          Process an instance of UnionType.
 Type forUnionTypeOnly(UnionType that, java.lang.Iterable<? extends Type> ofTypes_result)
           
 Type forVarargArrayType(VarargArrayType that)
          Process an instance of VarargArrayType.
 Type forVarargArrayTypeOnly(VarargArrayType that, Type ofType_result)
           
 Type forVariableType(VariableType that)
          Process an instance of VariableType.
 Type forVariableTypeOnly(VariableType that)
           
 Type forVoidType(VoidType that)
          Process an instance of VoidType.
 Type forVoidTypeOnly(VoidType that)
           
 Type forWildcard(Wildcard that)
          Process an instance of Wildcard.
 Type forWildcardOnly(Wildcard that)
           
 Type recur(Type that)
           
 java.lang.Iterable<? extends Type> recurOnIterableOfWildcardExtendsType(java.lang.Iterable<? extends Type> that)
           
 
Methods inherited from class edu.rice.cs.dynamicjava.symbol.type.TypeVisitorLambda
value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeUpdateVisitor

public TypeUpdateVisitor()
Method Detail

forBooleanTypeOnly

public Type forBooleanTypeOnly(BooleanType that)

forCharTypeOnly

public Type forCharTypeOnly(CharType that)

forByteTypeOnly

public Type forByteTypeOnly(ByteType that)

forShortTypeOnly

public Type forShortTypeOnly(ShortType that)

forIntTypeOnly

public Type forIntTypeOnly(IntType that)

forLongTypeOnly

public Type forLongTypeOnly(LongType that)

forFloatTypeOnly

public Type forFloatTypeOnly(FloatType that)

forDoubleTypeOnly

public Type forDoubleTypeOnly(DoubleType that)

forNullTypeOnly

public Type forNullTypeOnly(NullType that)

forSimpleArrayTypeOnly

public Type forSimpleArrayTypeOnly(SimpleArrayType that,
                                   Type ofType_result)

forVarargArrayTypeOnly

public Type forVarargArrayTypeOnly(VarargArrayType that,
                                   Type ofType_result)

forSimpleClassTypeOnly

public Type forSimpleClassTypeOnly(SimpleClassType that)

forRawClassTypeOnly

public Type forRawClassTypeOnly(RawClassType that)

forParameterizedClassTypeOnly

public Type forParameterizedClassTypeOnly(ParameterizedClassType that,
                                          java.lang.Iterable<? extends Type> typeArguments_result)

forIntersectionTypeOnly

public Type forIntersectionTypeOnly(IntersectionType that,
                                    java.lang.Iterable<? extends Type> ofTypes_result)

forUnionTypeOnly

public Type forUnionTypeOnly(UnionType that,
                             java.lang.Iterable<? extends Type> ofTypes_result)

forVariableTypeOnly

public Type forVariableTypeOnly(VariableType that)

forTopTypeOnly

public Type forTopTypeOnly(TopType that)

forBottomTypeOnly

public Type forBottomTypeOnly(BottomType that)

forVoidTypeOnly

public Type forVoidTypeOnly(VoidType that)

forWildcardOnly

public Type forWildcardOnly(Wildcard that)

forBooleanType

public Type forBooleanType(BooleanType that)
Methods to recur on each child.

Specified by:
forBooleanType in interface TypeVisitor<Type>
Specified by:
forBooleanType in class TypeVisitorLambda<Type>

forCharType

public Type forCharType(CharType that)
Description copied from class: TypeVisitorLambda
Process an instance of CharType.

Specified by:
forCharType in interface TypeVisitor<Type>
Specified by:
forCharType in class TypeVisitorLambda<Type>

forByteType

public Type forByteType(ByteType that)
Description copied from class: TypeVisitorLambda
Process an instance of ByteType.

Specified by:
forByteType in interface TypeVisitor<Type>
Specified by:
forByteType in class TypeVisitorLambda<Type>

forShortType

public Type forShortType(ShortType that)
Description copied from class: TypeVisitorLambda
Process an instance of ShortType.

Specified by:
forShortType in interface TypeVisitor<Type>
Specified by:
forShortType in class TypeVisitorLambda<Type>

forIntType

public Type forIntType(IntType that)
Description copied from class: TypeVisitorLambda
Process an instance of IntType.

Specified by:
forIntType in interface TypeVisitor<Type>
Specified by:
forIntType in class TypeVisitorLambda<Type>

forLongType

public Type forLongType(LongType that)
Description copied from class: TypeVisitorLambda
Process an instance of LongType.

Specified by:
forLongType in interface TypeVisitor<Type>
Specified by:
forLongType in class TypeVisitorLambda<Type>

forFloatType

public Type forFloatType(FloatType that)
Description copied from class: TypeVisitorLambda
Process an instance of FloatType.

Specified by:
forFloatType in interface TypeVisitor<Type>
Specified by:
forFloatType in class TypeVisitorLambda<Type>

forDoubleType

public Type forDoubleType(DoubleType that)
Description copied from class: TypeVisitorLambda
Process an instance of DoubleType.

Specified by:
forDoubleType in interface TypeVisitor<Type>
Specified by:
forDoubleType in class TypeVisitorLambda<Type>

forNullType

public Type forNullType(NullType that)
Description copied from class: TypeVisitorLambda
Process an instance of NullType.

Specified by:
forNullType in interface TypeVisitor<Type>
Specified by:
forNullType in class TypeVisitorLambda<Type>

forSimpleArrayType

public Type forSimpleArrayType(SimpleArrayType that)
Description copied from class: TypeVisitorLambda
Process an instance of SimpleArrayType.

Specified by:
forSimpleArrayType in interface TypeVisitor<Type>
Specified by:
forSimpleArrayType in class TypeVisitorLambda<Type>

forVarargArrayType

public Type forVarargArrayType(VarargArrayType that)
Description copied from class: TypeVisitorLambda
Process an instance of VarargArrayType.

Specified by:
forVarargArrayType in interface TypeVisitor<Type>
Specified by:
forVarargArrayType in class TypeVisitorLambda<Type>

forSimpleClassType

public Type forSimpleClassType(SimpleClassType that)
Description copied from class: TypeVisitorLambda
Process an instance of SimpleClassType.

Specified by:
forSimpleClassType in interface TypeVisitor<Type>
Specified by:
forSimpleClassType in class TypeVisitorLambda<Type>

forRawClassType

public Type forRawClassType(RawClassType that)
Description copied from class: TypeVisitorLambda
Process an instance of RawClassType.

Specified by:
forRawClassType in interface TypeVisitor<Type>
Specified by:
forRawClassType in class TypeVisitorLambda<Type>

forParameterizedClassType

public Type forParameterizedClassType(ParameterizedClassType that)
Description copied from class: TypeVisitorLambda
Process an instance of ParameterizedClassType.

Specified by:
forParameterizedClassType in interface TypeVisitor<Type>
Specified by:
forParameterizedClassType in class TypeVisitorLambda<Type>

forIntersectionType

public Type forIntersectionType(IntersectionType that)
Description copied from class: TypeVisitorLambda
Process an instance of IntersectionType.

Specified by:
forIntersectionType in interface TypeVisitor<Type>
Specified by:
forIntersectionType in class TypeVisitorLambda<Type>

forUnionType

public Type forUnionType(UnionType that)
Description copied from class: TypeVisitorLambda
Process an instance of UnionType.

Specified by:
forUnionType in interface TypeVisitor<Type>
Specified by:
forUnionType in class TypeVisitorLambda<Type>

forVariableType

public Type forVariableType(VariableType that)
Description copied from class: TypeVisitorLambda
Process an instance of VariableType.

Specified by:
forVariableType in interface TypeVisitor<Type>
Specified by:
forVariableType in class TypeVisitorLambda<Type>

forTopType

public Type forTopType(TopType that)
Description copied from class: TypeVisitorLambda
Process an instance of TopType.

Specified by:
forTopType in interface TypeVisitor<Type>
Specified by:
forTopType in class TypeVisitorLambda<Type>

forBottomType

public Type forBottomType(BottomType that)
Description copied from class: TypeVisitorLambda
Process an instance of BottomType.

Specified by:
forBottomType in interface TypeVisitor<Type>
Specified by:
forBottomType in class TypeVisitorLambda<Type>

forVoidType

public Type forVoidType(VoidType that)
Description copied from class: TypeVisitorLambda
Process an instance of VoidType.

Specified by:
forVoidType in interface TypeVisitor<Type>
Specified by:
forVoidType in class TypeVisitorLambda<Type>

forWildcard

public Type forWildcard(Wildcard that)
Description copied from class: TypeVisitorLambda
Process an instance of Wildcard.

Specified by:
forWildcard in interface TypeVisitor<Type>
Specified by:
forWildcard in class TypeVisitorLambda<Type>

recur

public Type recur(Type that)

recurOnIterableOfWildcardExtendsType

public java.lang.Iterable<? extends Type> recurOnIterableOfWildcardExtendsType(java.lang.Iterable<? extends Type> that)