|
1 |
| package edu.rice.cs.dynamicjava.symbol.type; |
|
2 |
| |
|
3 |
| import edu.rice.cs.dynamicjava.symbol.*; |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| @SuppressWarnings("unused") |
|
12 |
| public abstract class TypeAbstractVisitor<RetType> extends TypeVisitorLambda<RetType> { |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| |
|
18 |
0
| public RetType defaultCase(Type that) {
|
|
19 |
0
| throw new IllegalArgumentException("Visitor " + getClass().getName() + " does not support visiting values of type " + that.getClass().getName());
|
|
20 |
| } |
|
21 |
| |
|
22 |
| |
|
23 |
49857
| public RetType forType(Type that) {
|
|
24 |
49857
| return defaultCase(that);
|
|
25 |
| } |
|
26 |
| |
|
27 |
49203
| public RetType forValidType(ValidType that) {
|
|
28 |
49203
| return forType(that);
|
|
29 |
| } |
|
30 |
| |
|
31 |
2530
| public RetType forPrimitiveType(PrimitiveType that) {
|
|
32 |
2530
| return forValidType(that);
|
|
33 |
| } |
|
34 |
| |
|
35 |
1231
| public RetType forBooleanType(BooleanType that) {
|
|
36 |
1231
| return forPrimitiveType(that);
|
|
37 |
| } |
|
38 |
| |
|
39 |
3582
| public RetType forNumericType(NumericType that) {
|
|
40 |
3582
| return forPrimitiveType(that);
|
|
41 |
| } |
|
42 |
| |
|
43 |
3910
| public RetType forIntegralType(IntegralType that) {
|
|
44 |
3910
| return forNumericType(that);
|
|
45 |
| } |
|
46 |
| |
|
47 |
75
| public RetType forCharType(CharType that) {
|
|
48 |
75
| return forIntegralType(that);
|
|
49 |
| } |
|
50 |
| |
|
51 |
3835
| public RetType forIntegerType(IntegerType that) {
|
|
52 |
3835
| return forIntegralType(that);
|
|
53 |
| } |
|
54 |
| |
|
55 |
78
| public RetType forByteType(ByteType that) {
|
|
56 |
78
| return forIntegerType(that);
|
|
57 |
| } |
|
58 |
| |
|
59 |
78
| public RetType forShortType(ShortType that) {
|
|
60 |
78
| return forIntegerType(that);
|
|
61 |
| } |
|
62 |
| |
|
63 |
3660
| public RetType forIntType(IntType that) {
|
|
64 |
3660
| return forIntegerType(that);
|
|
65 |
| } |
|
66 |
| |
|
67 |
26
| public RetType forLongType(LongType that) {
|
|
68 |
26
| return forIntegerType(that);
|
|
69 |
| } |
|
70 |
| |
|
71 |
259
| public RetType forFloatingPointType(FloatingPointType that) {
|
|
72 |
259
| return forNumericType(that);
|
|
73 |
| } |
|
74 |
| |
|
75 |
122
| public RetType forFloatType(FloatType that) {
|
|
76 |
122
| return forFloatingPointType(that);
|
|
77 |
| } |
|
78 |
| |
|
79 |
164
| public RetType forDoubleType(DoubleType that) {
|
|
80 |
164
| return forFloatingPointType(that);
|
|
81 |
| } |
|
82 |
| |
|
83 |
63443
| public RetType forReferenceType(ReferenceType that) {
|
|
84 |
63443
| return forValidType(that);
|
|
85 |
| } |
|
86 |
| |
|
87 |
2064
| public RetType forNullType(NullType that) {
|
|
88 |
2064
| return forReferenceType(that);
|
|
89 |
| } |
|
90 |
| |
|
91 |
326
| public RetType forArrayType(ArrayType that) {
|
|
92 |
326
| return forReferenceType(that);
|
|
93 |
| } |
|
94 |
| |
|
95 |
702
| public RetType forSimpleArrayType(SimpleArrayType that) {
|
|
96 |
702
| return forArrayType(that);
|
|
97 |
| } |
|
98 |
| |
|
99 |
100
| public RetType forVarargArrayType(VarargArrayType that) {
|
|
100 |
100
| return forArrayType(that);
|
|
101 |
| } |
|
102 |
| |
|
103 |
62462
| public RetType forClassType(ClassType that) {
|
|
104 |
62462
| return forReferenceType(that);
|
|
105 |
| } |
|
106 |
| |
|
107 |
55994
| public RetType forSimpleClassType(SimpleClassType that) {
|
|
108 |
55994
| return forClassType(that);
|
|
109 |
| } |
|
110 |
| |
|
111 |
4881
| public RetType forRawClassType(RawClassType that) {
|
|
112 |
4881
| return forClassType(that);
|
|
113 |
| } |
|
114 |
| |
|
115 |
21849
| public RetType forParameterizedClassType(ParameterizedClassType that) {
|
|
116 |
21849
| return forClassType(that);
|
|
117 |
| } |
|
118 |
| |
|
119 |
118
| public RetType forBoundType(BoundType that) {
|
|
120 |
118
| return forValidType(that);
|
|
121 |
| } |
|
122 |
| |
|
123 |
102
| public RetType forIntersectionType(IntersectionType that) {
|
|
124 |
102
| return forBoundType(that);
|
|
125 |
| } |
|
126 |
| |
|
127 |
16
| public RetType forUnionType(UnionType that) {
|
|
128 |
16
| return forBoundType(that);
|
|
129 |
| } |
|
130 |
| |
|
131 |
313
| public RetType forVariableType(VariableType that) {
|
|
132 |
313
| return forValidType(that);
|
|
133 |
| } |
|
134 |
| |
|
135 |
0
| public RetType forTopType(TopType that) {
|
|
136 |
0
| return forValidType(that);
|
|
137 |
| } |
|
138 |
| |
|
139 |
0
| public RetType forBottomType(BottomType that) {
|
|
140 |
0
| return forValidType(that);
|
|
141 |
| } |
|
142 |
| |
|
143 |
654
| public RetType forVoidType(VoidType that) {
|
|
144 |
654
| return forType(that);
|
|
145 |
| } |
|
146 |
| |
|
147 |
0
| public RetType forWildcard(Wildcard that) {
|
|
148 |
0
| return forType(that);
|
|
149 |
| } |
|
150 |
| |
|
151 |
| |
|
152 |
| } |