diff --git a/bin/mycompiler/myparser/JavaParser.jay b/bin/mycompiler/myparser/JavaParser.jay index dd364964..042059fd 100755 --- a/bin/mycompiler/myparser/JavaParser.jay +++ b/bin/mycompiler/myparser/JavaParser.jay @@ -299,7 +299,7 @@ public Vector testPair = new Vector(); %type typedeclarations %type boundedMethodParameter; %type boundedClassParameter; -%type boundedclassidentifierlist //Vector +%type boundedclassidentifierlist //Vector %type boundedMethodParameters; // Vector %type boundedClassParameters; // ParaList %type packagedeclaration @@ -1048,7 +1048,7 @@ boundedMethodParameter : IDENTIFIER } | IDENTIFIER EXTENDS boundedclassidentifierlist { - BoundedGenericTypeVar gtv=new BoundedGenericTypeVar($1.getLexem(),$3,$1.getOffset()); + BoundedGenericTypeVar gtv=new BoundedGenericTypeVar($1.getLexem(), $3, $1.getOffset() ,$3.getEndOffset()); //gtv.setBounds($3); $$=gtv; } @@ -1058,12 +1058,13 @@ boundedclassidentifierlist : referencetype Vector vec=new Vector(); vec.addElement($1); containedTypes.addElement($1); - $$=vec; + $$=new BoundedClassIdentifierList(vec, $1.getOffset()+$1.getName().length()); } | boundedclassidentifierlist '&' referencetype { $1.addElement($3); - containedTypes.addElement($3); + $1.addOffsetOff($3); + containedTypes.addElement($3); $$=$1; } // returns Vector diff --git a/src/mycompiler/myclass/Class.java b/src/mycompiler/myclass/Class.java index 7f2e3334..e589045c 100755 --- a/src/mycompiler/myclass/Class.java +++ b/src/mycompiler/myclass/Class.java @@ -1400,7 +1400,7 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit public int getGenericVarDeclarationOffset(){ // Falls Generische Parameterliste vorhanden, hier Wert der Liste zurückgegebn if(this.genericClassParameters != null){ - return this.genericClassParameters.getOffsetOfLastElement(); + return this.genericClassParameters.getEndOffset(); }else{ return this.offset; } diff --git a/src/mycompiler/myclass/Field.java b/src/mycompiler/myclass/Field.java index b6a497f4..e612966b 100644 --- a/src/mycompiler/myclass/Field.java +++ b/src/mycompiler/myclass/Field.java @@ -149,7 +149,7 @@ public abstract class Field extends SyntaxTreeNode implements TypeInsertable, Ty public int getGenericVarDeclarationOffset(){ // Falls Generische Parameterliste vorhanden, hier Wert der Liste zurückgegebn if(this.genericParameters != null){ - return this.genericParameters.getOffsetOfLastElement(); + return this.genericParameters.getEndOffset(); }else{ return this.offset; } diff --git a/src/mycompiler/myclass/GenericDeclarationList.java b/src/mycompiler/myclass/GenericDeclarationList.java index e6d748f6..bd9f58f4 100644 --- a/src/mycompiler/myclass/GenericDeclarationList.java +++ b/src/mycompiler/myclass/GenericDeclarationList.java @@ -16,12 +16,12 @@ public class GenericDeclarationList extends Vector{ private int offsetOfLastElement; - public GenericDeclarationList(Vector values, int offset) { + public GenericDeclarationList(Vector values, int endOffset) { this.addAll(values); - this.offsetOfLastElement = offset; + this.offsetOfLastElement = endOffset; } - public int getOffsetOfLastElement(){ + public int getEndOffset(){ return offsetOfLastElement; } } diff --git a/src/mycompiler/myparser/BoundedClassIdentifierList.java b/src/mycompiler/myparser/BoundedClassIdentifierList.java new file mode 100644 index 00000000..da4a48cd --- /dev/null +++ b/src/mycompiler/myparser/BoundedClassIdentifierList.java @@ -0,0 +1,25 @@ +package mycompiler.myparser; + +import java.util.Vector; + +import mycompiler.mytype.RefType; +import mycompiler.mytype.Type; + +public class BoundedClassIdentifierList extends Vector{ + + private int endOffset; + private Vector list; + + public BoundedClassIdentifierList(Vector list, int endOffset){ + this.endOffset = endOffset; + this.addAll(list); + } + + public int getEndOffset() { + return endOffset; + } + + public void addOffsetOff(RefType refType) { + this.endOffset = refType.getOffset() + refType.getName().length(); + } +} diff --git a/src/mycompiler/myparser/GenericVarDeclarationList.java b/src/mycompiler/myparser/GenericVarDeclarationList.java index db7bd1f8..fc9f6727 100644 --- a/src/mycompiler/myparser/GenericVarDeclarationList.java +++ b/src/mycompiler/myparser/GenericVarDeclarationList.java @@ -16,7 +16,7 @@ public class GenericVarDeclarationList { public int getEndOffset() { int ret; if(elements.isEmpty())throw new DebugException("Es wurde eine GenericVarDeclarationList ohne Elemente geparst"); - ret = elements.lastElement().getOffset() + elements.lastElement().getName().length(); + ret = elements.lastElement().getEndOffset(); return ret; } diff --git a/src/mycompiler/myparser/JavaParser.java b/src/mycompiler/myparser/JavaParser.java index 318d287f..43b2946e 100644 --- a/src/mycompiler/myparser/JavaParser.java +++ b/src/mycompiler/myparser/JavaParser.java @@ -1612,7 +1612,7 @@ case 107: case 108: // line 1050 "./../src/mycompiler/myparser/JavaParser.jay" { - BoundedGenericTypeVar gtv=new BoundedGenericTypeVar(((Token)yyVals[-2+yyTop]).getLexem(),((Vector)yyVals[0+yyTop]),((Token)yyVals[-2+yyTop]).getOffset()); + BoundedGenericTypeVar gtv=new BoundedGenericTypeVar(((Token)yyVals[-2+yyTop]).getLexem(), ((BoundedClassIdentifierList)yyVals[0+yyTop]), ((Token)yyVals[-2+yyTop]).getOffset() ,((BoundedClassIdentifierList)yyVals[0+yyTop]).getEndOffset()); /*gtv.setBounds($3);*/ yyVal=gtv; } @@ -1623,19 +1623,20 @@ case 109: Vector vec=new Vector(); vec.addElement(((RefType)yyVals[0+yyTop])); containedTypes.addElement(((RefType)yyVals[0+yyTop])); - yyVal=vec; + yyVal=new BoundedClassIdentifierList(vec, ((RefType)yyVals[0+yyTop]).getOffset()+((RefType)yyVals[0+yyTop]).getName().length()); } break; case 110: // line 1064 "./../src/mycompiler/myparser/JavaParser.jay" { - ((Vector)yyVals[-2+yyTop]).addElement(((RefType)yyVals[0+yyTop])); - containedTypes.addElement(((RefType)yyVals[0+yyTop])); - yyVal=((Vector)yyVals[-2+yyTop]); + ((BoundedClassIdentifierList)yyVals[-2+yyTop]).addElement(((RefType)yyVals[0+yyTop])); + ((BoundedClassIdentifierList)yyVals[-2+yyTop]).addOffsetOff(((RefType)yyVals[0+yyTop])); + containedTypes.addElement(((RefType)yyVals[0+yyTop])); + yyVal=((BoundedClassIdentifierList)yyVals[-2+yyTop]); } break; case 111: - // line 1071 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1072 "./../src/mycompiler/myparser/JavaParser.jay" { GenericVarDeclarationList vec=new GenericVarDeclarationList(); vec.addElement(((GenericTypeVar)yyVals[0+yyTop])); @@ -1643,14 +1644,14 @@ case 111: } break; case 112: - // line 1077 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1078 "./../src/mycompiler/myparser/JavaParser.jay" { ((GenericVarDeclarationList)yyVals[-2+yyTop]).addElement(((GenericTypeVar)yyVals[0+yyTop])); yyVal=((GenericVarDeclarationList)yyVals[-2+yyTop]); } break; case 113: - // line 1085 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1086 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).setType(((Type)yyVals[-1+yyTop])); ((Method)yyVals[0+yyTop]).setGenericParameter(((GenericDeclarationList)yyVals[-2+yyTop])); @@ -1658,14 +1659,14 @@ case 113: } break; case 114: - // line 1091 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1092 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).setType(((Type)yyVals[-1+yyTop])); yyVal=((Method)yyVals[0+yyTop]); } break; case 115: - // line 1096 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1097 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); ((Method)yyVals[0+yyTop]).setType(((Type)yyVals[-1+yyTop])); @@ -1673,7 +1674,7 @@ case 115: } break; case 116: - // line 1102 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1103 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); ((Method)yyVals[0+yyTop]).setGenericParameter(((GenericDeclarationList)yyVals[-2+yyTop])); @@ -1682,7 +1683,7 @@ case 116: } break; case 117: - // line 1109 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1110 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); @@ -1690,7 +1691,7 @@ case 117: } break; case 118: - // line 1115 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1116 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).setGenericParameter(((GenericDeclarationList)yyVals[-3+yyTop])); ((Method)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); @@ -1699,7 +1700,7 @@ case 118: } break; case 119: - // line 1122 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1123 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); ((Method)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); @@ -1708,7 +1709,7 @@ case 119: } break; case 120: - // line 1129 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1130 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-4+yyTop])); ((Method)yyVals[-1+yyTop]).setGenericParameter(((GenericDeclarationList)yyVals[-3+yyTop])); @@ -1718,7 +1719,7 @@ case 120: } break; case 121: - // line 1137 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1138 "./../src/mycompiler/myparser/JavaParser.jay" { Void Voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); ((Method)yyVals[0+yyTop]).setType(Voit); @@ -1726,7 +1727,7 @@ case 121: } break; case 122: - // line 1143 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1144 "./../src/mycompiler/myparser/JavaParser.jay" { Void voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); @@ -1735,7 +1736,7 @@ case 122: } break; case 123: - // line 1150 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1151 "./../src/mycompiler/myparser/JavaParser.jay" { Void voyt = new Void(((Token)yyVals[-2+yyTop]).getOffset()); ((Method)yyVals[-1+yyTop]).setType(voyt); @@ -1744,7 +1745,7 @@ case 123: } break; case 124: - // line 1157 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1158 "./../src/mycompiler/myparser/JavaParser.jay" { Void voyd = new Void(((Token)yyVals[-2+yyTop]).getOffset()); ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); @@ -1754,7 +1755,7 @@ case 124: } break; case 125: - // line 1165 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1166 "./../src/mycompiler/myparser/JavaParser.jay" { Void Voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); ((Method)yyVals[0+yyTop]).setType(Voit); @@ -1763,7 +1764,7 @@ case 125: } break; case 126: - // line 1172 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1173 "./../src/mycompiler/myparser/JavaParser.jay" { Void voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); @@ -1773,7 +1774,7 @@ case 126: } break; case 127: - // line 1180 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1181 "./../src/mycompiler/myparser/JavaParser.jay" { Void voyt = new Void(((Token)yyVals[-2+yyTop]).getOffset()); ((Method)yyVals[-1+yyTop]).setType(voyt); @@ -1783,7 +1784,7 @@ case 127: } break; case 128: - // line 1188 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1189 "./../src/mycompiler/myparser/JavaParser.jay" { Void voyd = new Void(((Token)yyVals[-2+yyTop]).getOffset()); ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-4+yyTop])); @@ -1794,14 +1795,14 @@ case 128: } break; case 129: - // line 1198 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1199 "./../src/mycompiler/myparser/JavaParser.jay" { /*auskommentiert von Andreas Stadelmeier (a10023) $1.setType(TypePlaceholder.fresh()); */ yyVal=((Method)yyVals[0+yyTop]); } break; case 130: - // line 1203 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1204 "./../src/mycompiler/myparser/JavaParser.jay" { /*auskommentiert von Andreas Stadelmeier (a10023) $4.setType(TypePlaceholder.fresh());*/ ((Method)yyVals[0+yyTop]).setGenericParameter(((GenericDeclarationList)yyVals[-1+yyTop])); @@ -1809,7 +1810,7 @@ case 130: } break; case 131: - // line 1210 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1211 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-1+yyTop])); /*auskommentiert von Andreas Stadelmeier (a10023) $2.setType(TypePlaceholder.fresh());*/ @@ -1817,7 +1818,7 @@ case 131: } break; case 132: - // line 1216 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1217 "./../src/mycompiler/myparser/JavaParser.jay" { /*auskommentiert von Andreas Stadelmeier (a10023) $1.setType(TypePlaceholder.fresh());*/ ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); @@ -1825,7 +1826,7 @@ case 132: } break; case 133: - // line 1222 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1223 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); /*auskommentiert von Andreas Stadelmeier (a10023) $2.setType(TypePlaceholder.fresh());*/ @@ -1834,31 +1835,31 @@ case 133: } break; case 134: - // line 1231 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1232 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((BaseType)yyVals[0+yyTop]); } break; case 135: - // line 1235 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1236 "./../src/mycompiler/myparser/JavaParser.jay" { ((BaseType)yyVals[-2+yyTop]).setArray(true); } break; case 136: - // line 1239 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1240 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((RefType)yyVals[0+yyTop]); } break; case 137: - // line 1243 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1244 "./../src/mycompiler/myparser/JavaParser.jay" { ((RefType)yyVals[-2+yyTop]).setArray(true); } break; case 138: - // line 1247 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1248 "./../src/mycompiler/myparser/JavaParser.jay" { FieldDeclaration IVD = new FieldDeclaration(((DeclId)yyVals[0+yyTop]).getOffset()); IVD.getDeclIdVector().addElement( ((DeclId)yyVals[0+yyTop]) ); @@ -1867,20 +1868,20 @@ case 138: } break; case 139: - // line 1254 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1255 "./../src/mycompiler/myparser/JavaParser.jay" { ((FieldDeclaration)yyVals[-2+yyTop]).getDeclIdVector().addElement(((DeclId)yyVals[0+yyTop])); yyVal=((FieldDeclaration)yyVals[-2+yyTop]); } break; case 140: - // line 1260 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1261 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Block)yyVals[0+yyTop]); } break; case 141: - // line 1265 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1266 "./../src/mycompiler/myparser/JavaParser.jay" { Block Blstat = new Block(); Blstat.set_Statement(((Statement)yyVals[0+yyTop])); @@ -1888,14 +1889,14 @@ case 141: } break; case 142: - // line 1272 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1273 "./../src/mycompiler/myparser/JavaParser.jay" { ((Block)yyVals[-1+yyTop]).set_Statement(((Statement)yyVals[0+yyTop])); yyVal=((Block)yyVals[-1+yyTop]); } break; case 143: - // line 1278 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1279 "./../src/mycompiler/myparser/JavaParser.jay" { ParameterList PL = new ParameterList(); PL.set_AddParameter(((FormalParameter)yyVals[0+yyTop])); @@ -1903,21 +1904,21 @@ case 143: } break; case 144: - // line 1284 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1285 "./../src/mycompiler/myparser/JavaParser.jay" { ((ParameterList)yyVals[-2+yyTop]).set_AddParameter(((FormalParameter)yyVals[0+yyTop])); yyVal = ((ParameterList)yyVals[-2+yyTop]); } break; case 145: - // line 1290 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1291 "./../src/mycompiler/myparser/JavaParser.jay" { This THCON = new This(((Token)yyVals[-3+yyTop]).getOffset(),((Token)yyVals[-3+yyTop]).getLexem().length()); yyVal=THCON; } break; case 146: - // line 1295 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1296 "./../src/mycompiler/myparser/JavaParser.jay" { This THCONargl = new This(((Token)yyVals[-4+yyTop]).getOffset(),((Token)yyVals[-4+yyTop]).getLexem().length()); THCONargl.set_ArgumentList(((ArgumentList)yyVals[-2+yyTop])); @@ -1925,7 +1926,7 @@ case 146: } break; case 147: - // line 1304 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1305 "./../src/mycompiler/myparser/JavaParser.jay" { RefType RT = new RefType(-1); RT.set_UsedId(((UsedId)yyVals[0+yyTop])); @@ -1934,7 +1935,7 @@ case 147: } break; case 148: - // line 1311 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1312 "./../src/mycompiler/myparser/JavaParser.jay" { ((RefType)yyVals[-2+yyTop]).set_UsedId(((UsedId)yyVals[0+yyTop])); ((RefType)yyVals[-2+yyTop]).setName(((RefType)yyVals[-2+yyTop]).get_UsedId().get_Name_1Element()); @@ -1942,7 +1943,7 @@ case 148: } break; case 149: - // line 1318 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1319 "./../src/mycompiler/myparser/JavaParser.jay" { Method met = new Method(((Token)yyVals[-2+yyTop]).getOffset()); /* #JB# 10.04.2005 */ @@ -1957,7 +1958,7 @@ case 149: } break; case 150: - // line 1331 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1332 "./../src/mycompiler/myparser/JavaParser.jay" { Method met_para = new Method(((Token)yyVals[-3+yyTop]).getOffset()); /* #JB# 10.04.2005 */ @@ -1973,7 +1974,7 @@ case 150: } break; case 151: - // line 1346 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1347 "./../src/mycompiler/myparser/JavaParser.jay" { BooleanType BT = new BooleanType(); /* #JB# 05.04.2005 */ @@ -1984,13 +1985,13 @@ case 151: } break; case 152: - // line 1355 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1356 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((BaseType)yyVals[0+yyTop]); } break; case 153: - // line 1360 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1361 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->referenctype: " + ((UsedId)yyVals[0+yyTop])); RefType RT = new RefType(((UsedId)yyVals[0+yyTop]).getOffset()); @@ -2010,25 +2011,25 @@ case 153: } break; case 154: - // line 1380 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1381 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((DeclId)yyVals[0+yyTop]); } break; case 155: - // line 1401 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1402 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((LocalVarDecl)yyVals[0+yyTop]); } break; case 156: - // line 1405 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1406 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Statement)yyVals[0+yyTop]); } break; case 157: - // line 1410 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1411 "./../src/mycompiler/myparser/JavaParser.jay" { FormalParameter FP = new FormalParameter(((DeclId)yyVals[0+yyTop])); FP.setType(((Type)yyVals[-1+yyTop])); @@ -2037,7 +2038,7 @@ case 157: } break; case 158: - // line 1435 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1436 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("\nFunktionsdeklaration mit typlosen Parametern: " + ((DeclId)yyVals[0+yyTop]).name); @@ -2057,7 +2058,7 @@ case 158: } break; case 159: - // line 1454 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1455 "./../src/mycompiler/myparser/JavaParser.jay" { ArgumentList AL = new ArgumentList(); AL.expr.addElement(((Expr)yyVals[0+yyTop])); @@ -2065,20 +2066,20 @@ case 159: } break; case 160: - // line 1460 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1461 "./../src/mycompiler/myparser/JavaParser.jay" { ((ArgumentList)yyVals[-2+yyTop]).expr.addElement(((Expr)yyVals[0+yyTop])); yyVal=((ArgumentList)yyVals[-2+yyTop]); } break; case 161: - // line 1466 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1467 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((BaseType)yyVals[0+yyTop]); } break; case 162: - // line 1471 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1472 "./../src/mycompiler/myparser/JavaParser.jay" { DeclId DI = new DeclId(); /* #JB# 10.04.2005 */ @@ -2091,61 +2092,61 @@ case 162: } break; case 163: - // line 1483 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1484 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 164: - // line 1488 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1489 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((LocalVarDecl)yyVals[-1+yyTop]); } break; case 165: - // line 1493 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1494 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Statement)yyVals[0+yyTop]); } break; case 166: - // line 1497 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1498 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((IfStmt)yyVals[0+yyTop]); } break; case 167: - // line 1501 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1502 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((IfStmt)yyVals[0+yyTop]); } break; case 168: - // line 1505 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1506 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((WhileStmt)yyVals[0+yyTop]); } break; case 169: - // line 1509 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1510 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((ForStmt)yyVals[0+yyTop]); } break; case 170: - // line 1514 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1515 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 171: - // line 1518 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1519 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((NewClass)yyVals[0+yyTop]); } break; case 172: - // line 1523 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1524 "./../src/mycompiler/myparser/JavaParser.jay" { IntegerType IT = new IntegerType(); /* #JB# 05.04.2005 */ @@ -2156,7 +2157,7 @@ case 172: } break; case 173: - // line 1532 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1533 "./../src/mycompiler/myparser/JavaParser.jay" { CharacterType CT = new CharacterType(); /* #JB# 05.04.2005 */ @@ -2167,7 +2168,7 @@ case 173: } break; case 174: - // line 1542 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1543 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("P -> Lokale Variable angelegt!"); LocalVarDecl LVD = new LocalVarDecl(((Type)yyVals[-1+yyTop]).getOffset(),((Type)yyVals[-1+yyTop]).getVariableLength()); @@ -2177,7 +2178,7 @@ case 174: } break; case 175: - // line 1553 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1554 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("P -> Lokale Variable angelegt!"); LocalVarDecl LVD = new LocalVarDecl(((FieldDeclaration)yyVals[0+yyTop]).getOffset(),((FieldDeclaration)yyVals[0+yyTop]).getVariableLength()); @@ -2187,31 +2188,31 @@ case 175: } break; case 176: - // line 1563 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1564 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Block)yyVals[0+yyTop]); } break; case 177: - // line 1567 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1568 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((EmptyStmt)yyVals[0+yyTop]); } break; case 178: - // line 1571 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1572 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((ExprStmt)yyVals[0+yyTop]); } break; case 179: - // line 1575 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1576 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Return)yyVals[0+yyTop]); } break; case 180: - // line 1580 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1581 "./../src/mycompiler/myparser/JavaParser.jay" { IfStmt Ifst = new IfStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); Ifst.set_Expr(((Expr)yyVals[-2+yyTop])); @@ -2220,7 +2221,7 @@ case 180: } break; case 181: - // line 1588 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1589 "./../src/mycompiler/myparser/JavaParser.jay" { IfStmt IfstElst = new IfStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); IfstElst.set_Expr(((Expr)yyVals[-4+yyTop])); @@ -2230,7 +2231,7 @@ case 181: } break; case 182: - // line 1597 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1598 "./../src/mycompiler/myparser/JavaParser.jay" { WhileStmt Whlst = new WhileStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); Whlst.set_Expr(((Expr)yyVals[-2+yyTop])); @@ -2239,7 +2240,7 @@ case 182: } break; case 183: - // line 1608 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1609 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-6+yyTop]).getOffset(),((Expr)yyVals[-6+yyTop]).getVariableLength()); Fst.set_head_Initializer(((Expr)yyVals[-6+yyTop])); @@ -2252,7 +2253,7 @@ case 183: } break; case 184: - // line 1620 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1621 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength()); Fst.set_head_Initializer(((Expr)yyVals[-5+yyTop])); @@ -2264,7 +2265,7 @@ case 184: } break; case 185: - // line 1631 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1632 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength()); Fst.set_head_Initializer(((Expr)yyVals[-5+yyTop])); @@ -2276,7 +2277,7 @@ case 185: } break; case 186: - // line 1642 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1643 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); Fst.set_head_Condition(((Expr)yyVals[-4+yyTop])); @@ -2288,7 +2289,7 @@ case 186: } break; case 187: - // line 1653 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1654 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); Fst.set_head_Initializer(((Expr)yyVals[-4+yyTop])); @@ -2299,7 +2300,7 @@ case 187: } break; case 188: - // line 1663 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1664 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-3+yyTop]).getOffset(),((Expr)yyVals[-3+yyTop]).getVariableLength()); Fst.set_head_Condition(((Expr)yyVals[-3+yyTop])); @@ -2310,7 +2311,7 @@ case 188: } break; case 189: - // line 1673 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1674 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); Fst.set_head_Loop_expr(((Expr)yyVals[-2+yyTop])); @@ -2321,7 +2322,7 @@ case 189: } break; case 190: - // line 1683 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1684 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Statement)yyVals[0+yyTop]).getOffset(),((Statement)yyVals[0+yyTop]).getVariableLength()); Fst.set_body_Loop_block(((Statement)yyVals[0+yyTop])); @@ -2331,40 +2332,40 @@ case 190: } break; case 191: - // line 1692 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1693 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("conditionalexpression"); yyVal=((Expr)yyVals[0+yyTop]); } break; case 192: - // line 1697 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1698 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Assign)yyVals[0+yyTop]); } break; case 193: - // line 1703 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1704 "./../src/mycompiler/myparser/JavaParser.jay" { EmptyStmt Empst = new EmptyStmt(); yyVal=Empst; } break; case 194: - // line 1709 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1710 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[-1+yyTop]); } break; case 195: - // line 1714 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1715 "./../src/mycompiler/myparser/JavaParser.jay" { Return ret = new Return(-1,-1); yyVal= ret; } break; case 196: - // line 1719 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1720 "./../src/mycompiler/myparser/JavaParser.jay" { Return retexp = new Return(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength()); retexp.set_ReturnExpr(((Expr)yyVals[-1+yyTop])); @@ -2372,31 +2373,31 @@ case 196: } break; case 197: - // line 1726 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1727 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Statement)yyVals[0+yyTop]); } break; case 198: - // line 1730 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1731 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((IfStmt)yyVals[0+yyTop]); } break; case 199: - // line 1734 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1735 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((WhileStmt)yyVals[0+yyTop]); } break; case 200: - // line 1739 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1740 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 201: - // line 1745 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1746 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("\nParser --> Zuweisung1!\n"); Assign Ass = new Assign(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); @@ -2423,7 +2424,7 @@ case 201: } break; case 202: - // line 1770 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1771 "./../src/mycompiler/myparser/JavaParser.jay" { Assign Ass =new Assign(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); LocalOrFieldVar LOFV = new LocalOrFieldVar(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); @@ -2447,43 +2448,43 @@ case 202: } break; case 203: - // line 1793 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1794 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Assign)yyVals[0+yyTop]); } break; case 204: - // line 1797 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1798 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 205: - // line 1801 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1802 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 206: - // line 1805 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1806 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 207: - // line 1809 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1810 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 208: - // line 1813 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1814 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((MethodCall)yyVals[0+yyTop]); } break; case 209: - // line 1824 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1825 "./../src/mycompiler/myparser/JavaParser.jay" { IfStmt IfElno = new IfStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); IfElno.set_Expr(((Expr)yyVals[-4+yyTop])); @@ -2493,7 +2494,7 @@ case 209: } break; case 210: - // line 1833 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1834 "./../src/mycompiler/myparser/JavaParser.jay" { WhileStmt Whstno = new WhileStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); Whstno.set_Expr(((Expr)yyVals[-2+yyTop])); @@ -2502,13 +2503,13 @@ case 210: } break; case 211: - // line 1841 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1842 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 212: - // line 1845 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1846 "./../src/mycompiler/myparser/JavaParser.jay" { Binary LogOr = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); OrOp OrO = new OrOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -2520,19 +2521,19 @@ case 212: } break; case 213: - // line 1858 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1859 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=null; } break; case 214: - // line 1863 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1864 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Block)yyVals[0+yyTop]); } break; case 215: - // line 1867 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1868 "./../src/mycompiler/myparser/JavaParser.jay" { /*Lambdabody kann auch nur aus einer Expression bestehen. In diesem Fall wird ein Block erstellt, welcher als einziges Statement ein return statment mit der expression hat.*/ /*Bsp.: Aus der Expression |var=="hallo"| wird: |{return var=="hallo";}|*/ @@ -2543,19 +2544,19 @@ case 215: } break; case 216: - // line 1877 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1878 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=null; } break; case 217: - // line 1881 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1882 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((ParameterList)yyVals[-1+yyTop]); } break; case 218: - // line 1886 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1887 "./../src/mycompiler/myparser/JavaParser.jay" { LambdaExpression lambda = new LambdaExpression(/*((ParameSterList)$2).getOffset(),((ParameterList)$2).getVariableLength()*/0,0); if(((ParameterList)yyVals[-2+yyTop])!=null)lambda.setParameterList(((ParameterList)yyVals[-2+yyTop])); @@ -2564,54 +2565,54 @@ case 218: } break; case 219: - // line 1905 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1906 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((UsedId)yyVals[0+yyTop]); } break; case 220: - // line 1910 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1911 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=null; } break; case 221: - // line 1914 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1915 "./../src/mycompiler/myparser/JavaParser.jay" { TimesOp TEO = new TimesOp(-1,-1); yyVal=TEO; } break; case 222: - // line 1919 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1920 "./../src/mycompiler/myparser/JavaParser.jay" { DivideOp DEO = new DivideOp(-1,-1); yyVal=DEO; } break; case 223: - // line 1924 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1925 "./../src/mycompiler/myparser/JavaParser.jay" { ModuloOp MEO = new ModuloOp(-1,-1); yyVal=MEO; } break; case 224: - // line 1929 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1930 "./../src/mycompiler/myparser/JavaParser.jay" { PlusOp PEO = new PlusOp(-1,-1); yyVal=PEO; } break; case 225: - // line 1934 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1935 "./../src/mycompiler/myparser/JavaParser.jay" { MinusOp MEO = new MinusOp(-1,-1); yyVal=MEO; } break; case 226: - // line 1946 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1947 "./../src/mycompiler/myparser/JavaParser.jay" { PreIncExpr PRINC = new PreIncExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); PRINC.set_Expr(((Expr)yyVals[0+yyTop])); @@ -2619,7 +2620,7 @@ case 226: } break; case 227: - // line 1953 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1954 "./../src/mycompiler/myparser/JavaParser.jay" { PreDecExpr PRDEC = new PreDecExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); PRDEC.set_Expr(((Expr)yyVals[0+yyTop])); @@ -2627,7 +2628,7 @@ case 227: } break; case 228: - // line 1960 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1961 "./../src/mycompiler/myparser/JavaParser.jay" { PostIncExpr PIE = new PostIncExpr(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength()); PIE.set_Expr(((Expr)yyVals[-1+yyTop])); @@ -2635,7 +2636,7 @@ case 228: } break; case 229: - // line 1967 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1968 "./../src/mycompiler/myparser/JavaParser.jay" { PostDecExpr PDE = new PostDecExpr(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength()); PDE.set_Expr(((Expr)yyVals[-1+yyTop])); @@ -2643,7 +2644,7 @@ case 229: } break; case 230: - // line 1975 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1976 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("M1"); MethodCall MC = new MethodCall(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); @@ -2675,7 +2676,7 @@ case 230: } break; case 231: - // line 2005 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2006 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("M2"); MethodCall MCarg = new MethodCall(((UsedId)yyVals[-3+yyTop]).getOffset(),((UsedId)yyVals[-3+yyTop]).getVariableLength()); @@ -2708,7 +2709,7 @@ case 231: } break; case 232: - // line 2036 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2037 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("M3"); MethodCall MCpr = new MethodCall(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); @@ -2729,7 +2730,7 @@ case 232: } break; case 233: - // line 2055 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2056 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("M4"); MethodCall MCPA = new MethodCall(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength()); @@ -2751,7 +2752,7 @@ case 233: } break; case 234: - // line 2078 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2079 "./../src/mycompiler/myparser/JavaParser.jay" { NewClass NC = new NewClass(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); NC.set_UsedId(((UsedId)yyVals[-2+yyTop])); @@ -2761,7 +2762,7 @@ case 234: } break; case 235: - // line 2086 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2087 "./../src/mycompiler/myparser/JavaParser.jay" { NewClass NCarg = new NewClass(((UsedId)yyVals[-3+yyTop]).getOffset(),((UsedId)yyVals[-3+yyTop]).getVariableLength()); NCarg.set_UsedId(((UsedId)yyVals[-3+yyTop])); @@ -2772,13 +2773,13 @@ case 235: } break; case 236: - // line 2096 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2097 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 237: - // line 2100 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2101 "./../src/mycompiler/myparser/JavaParser.jay" { Binary And = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); AndOp AndO = new AndOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -2790,19 +2791,19 @@ case 237: } break; case 238: - // line 2116 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2117 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 239: - // line 2120 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2121 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 240: - // line 2124 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2125 "./../src/mycompiler/myparser/JavaParser.jay" { PositivExpr POSEX=new PositivExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); UnaryPlus UP= new UnaryPlus(); @@ -2812,7 +2813,7 @@ case 240: } break; case 241: - // line 2132 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2133 "./../src/mycompiler/myparser/JavaParser.jay" { NegativeExpr NEGEX=new NegativeExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); UnaryMinus UM=new UnaryMinus(); @@ -2822,19 +2823,19 @@ case 241: } break; case 242: - // line 2140 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2141 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 243: - // line 2145 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2146 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 244: - // line 2149 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2150 "./../src/mycompiler/myparser/JavaParser.jay" { if (((UsedId)yyVals[0+yyTop]).get_Name().size() > 1) { @@ -2854,37 +2855,37 @@ case 244: } break; case 245: - // line 2167 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2168 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 246: - // line 2171 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2172 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 247: - // line 2176 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2177 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 248: - // line 2181 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2182 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 250: - // line 2187 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2188 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Literal)yyVals[0+yyTop]); } break; case 251: - // line 2191 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2192 "./../src/mycompiler/myparser/JavaParser.jay" { This T = new This(((Token)yyVals[0+yyTop]).getOffset(),((Token)yyVals[0+yyTop]).getLexem().length()); UsedId UT = new UsedId(((Token)yyVals[0+yyTop]).getOffset()); @@ -2894,23 +2895,23 @@ case 251: } break; case 252: - // line 2212 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2213 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((MethodCall)yyVals[0+yyTop]); } break; case 253: - // line 2216 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2217 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 254: - // line 2221 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2222 "./../src/mycompiler/myparser/JavaParser.jay" {yyVal=((Expr)yyVals[0+yyTop]);} break; case 255: - // line 2223 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2224 "./../src/mycompiler/myparser/JavaParser.jay" {NotExpr NE=new NotExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); UnaryNot UN=new UnaryNot(); NE.set_UnaryNot(UN); @@ -2919,36 +2920,36 @@ case 255: } break; case 256: - // line 2229 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2230 "./../src/mycompiler/myparser/JavaParser.jay" {yyVal=((CastExpr)yyVals[0+yyTop]);} break; case 257: - // line 2231 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2232 "./../src/mycompiler/myparser/JavaParser.jay" {yyVal=((Expr)yyVals[0+yyTop]);} break; case 259: - // line 2236 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2237 "./../src/mycompiler/myparser/JavaParser.jay" {IntLiteral IL = new IntLiteral(); IL.set_Int(((Token)yyVals[0+yyTop]).String2Int()); yyVal = IL; } break; case 260: - // line 2241 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2242 "./../src/mycompiler/myparser/JavaParser.jay" {BoolLiteral BL = new BoolLiteral(); BL.set_Bool(((Token)yyVals[0+yyTop]).String2Bool()); yyVal = BL; } break; case 261: - // line 2245 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2246 "./../src/mycompiler/myparser/JavaParser.jay" {CharLiteral CL = new CharLiteral(); CL.set_Char(((Token)yyVals[0+yyTop]).CharInString()); yyVal=CL; } break; case 262: - // line 2250 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2251 "./../src/mycompiler/myparser/JavaParser.jay" { StringLiteral ST = new StringLiteral(); ST.set_String(((Token)yyVals[0+yyTop]).get_String()); @@ -2956,14 +2957,14 @@ case 262: } break; case 263: - // line 2255 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2256 "./../src/mycompiler/myparser/JavaParser.jay" { LongLiteral LL = new LongLiteral(); LL.set_Long(((Token)yyVals[0+yyTop]).String2Long()); yyVal = LL; } break; case 264: - // line 2259 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2260 "./../src/mycompiler/myparser/JavaParser.jay" { FloatLiteral FL = new FloatLiteral(); FL.set_Float(((Token)yyVals[0+yyTop]).String2Float()); @@ -2971,7 +2972,7 @@ case 264: } break; case 265: - // line 2264 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2265 "./../src/mycompiler/myparser/JavaParser.jay" { DoubleLiteral DL = new DoubleLiteral(); DL.set_Double(((Token)yyVals[0+yyTop]).String2Double()); @@ -2979,14 +2980,14 @@ case 265: } break; case 266: - // line 2270 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2271 "./../src/mycompiler/myparser/JavaParser.jay" { Null NN = new Null(); yyVal=NN; } break; case 267: - // line 2276 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2277 "./../src/mycompiler/myparser/JavaParser.jay" { CastExpr CaEx=new CastExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); CaEx.set_Type(((BaseType)yyVals[-2+yyTop])); @@ -2995,24 +2996,24 @@ case 267: } break; case 268: - // line 2285 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2286 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 269: - // line 2289 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2290 "./../src/mycompiler/myparser/JavaParser.jay" { } break; case 270: - // line 2293 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2294 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 271: - // line 2297 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2298 "./../src/mycompiler/myparser/JavaParser.jay" { Binary EQ = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); EqualOp EO = new EqualOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3024,7 +3025,7 @@ case 271: } break; case 272: - // line 2307 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2308 "./../src/mycompiler/myparser/JavaParser.jay" { Binary NEQ = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); NotEqualOp NEO = new NotEqualOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3036,13 +3037,13 @@ case 272: } break; case 273: - // line 2318 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2319 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 274: - // line 2322 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2323 "./../src/mycompiler/myparser/JavaParser.jay" { Binary LO = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); LessOp LOO = new LessOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3054,7 +3055,7 @@ case 274: } break; case 275: - // line 2332 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2333 "./../src/mycompiler/myparser/JavaParser.jay" { Binary GO = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); GreaterOp GOO = new GreaterOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3066,7 +3067,7 @@ case 275: } break; case 276: - // line 2342 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2343 "./../src/mycompiler/myparser/JavaParser.jay" { Binary LE = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); LessEquOp LEO = new LessEquOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3078,7 +3079,7 @@ case 276: } break; case 277: - // line 2352 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2353 "./../src/mycompiler/myparser/JavaParser.jay" { Binary GE = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); GreaterEquOp GEO = new GreaterEquOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3090,7 +3091,7 @@ case 277: } break; case 278: - // line 2362 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2363 "./../src/mycompiler/myparser/JavaParser.jay" { InstanceOf ISO=new InstanceOf(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); ISO.set_Expr(((Expr)yyVals[-2+yyTop])); @@ -3099,19 +3100,19 @@ case 278: } break; case 279: - // line 2370 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2371 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 280: - // line 2375 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2376 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 281: - // line 2379 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2380 "./../src/mycompiler/myparser/JavaParser.jay" { Binary AD = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); PlusOp PO = new PlusOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3123,7 +3124,7 @@ case 281: } break; case 282: - // line 2389 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2390 "./../src/mycompiler/myparser/JavaParser.jay" { Binary MI = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); MinusOp MO = new MinusOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3135,13 +3136,13 @@ case 282: } break; case 283: - // line 2400 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2401 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 284: - // line 2404 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2405 "./../src/mycompiler/myparser/JavaParser.jay" { Binary ML = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); TimesOp TO = new TimesOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3153,7 +3154,7 @@ case 284: } break; case 285: - // line 2414 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2415 "./../src/mycompiler/myparser/JavaParser.jay" { Binary DV = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); DivideOp DO = new DivideOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3165,7 +3166,7 @@ case 285: } break; case 286: - // line 2424 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2425 "./../src/mycompiler/myparser/JavaParser.jay" { Binary MD = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); ModuloOp MO = new ModuloOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3176,7 +3177,7 @@ case 286: yyVal =MD; } break; - // line 3180 "-" + // line 3181 "-" } yyTop -= yyLen[yyN]; yyState = yyStates[yyTop]; diff --git a/src/mycompiler/myparser/JavaParser.jay b/src/mycompiler/myparser/JavaParser.jay index dd364964..042059fd 100755 --- a/src/mycompiler/myparser/JavaParser.jay +++ b/src/mycompiler/myparser/JavaParser.jay @@ -299,7 +299,7 @@ public Vector testPair = new Vector(); %type typedeclarations %type boundedMethodParameter; %type boundedClassParameter; -%type boundedclassidentifierlist //Vector +%type boundedclassidentifierlist //Vector %type boundedMethodParameters; // Vector %type boundedClassParameters; // ParaList %type packagedeclaration @@ -1048,7 +1048,7 @@ boundedMethodParameter : IDENTIFIER } | IDENTIFIER EXTENDS boundedclassidentifierlist { - BoundedGenericTypeVar gtv=new BoundedGenericTypeVar($1.getLexem(),$3,$1.getOffset()); + BoundedGenericTypeVar gtv=new BoundedGenericTypeVar($1.getLexem(), $3, $1.getOffset() ,$3.getEndOffset()); //gtv.setBounds($3); $$=gtv; } @@ -1058,12 +1058,13 @@ boundedclassidentifierlist : referencetype Vector vec=new Vector(); vec.addElement($1); containedTypes.addElement($1); - $$=vec; + $$=new BoundedClassIdentifierList(vec, $1.getOffset()+$1.getName().length()); } | boundedclassidentifierlist '&' referencetype { $1.addElement($3); - containedTypes.addElement($3); + $1.addOffsetOff($3); + containedTypes.addElement($3); $$=$1; } // returns Vector diff --git a/src/mycompiler/mytype/BoundedGenericTypeVar.java b/src/mycompiler/mytype/BoundedGenericTypeVar.java index 8c4ce540..fee474b7 100755 --- a/src/mycompiler/mytype/BoundedGenericTypeVar.java +++ b/src/mycompiler/mytype/BoundedGenericTypeVar.java @@ -38,9 +38,11 @@ public class BoundedGenericTypeVar extends GenericTypeVar // ino.attribute.bounds.26468.declaration Vector bounds=new Vector(); // ino.end + private int endOffset; + /* // ino.method.BoundedGenericTypeVar.26471.definition - public BoundedGenericTypeVar(String s, int offset, Vector t) + public BoundedGenericTypeVar(String s, int offset, Vector t, int endOffset) // ino.end // ino.method.BoundedGenericTypeVar.26471.body { @@ -48,9 +50,10 @@ public class BoundedGenericTypeVar extends GenericTypeVar throw new NotImplementedException(); } // ino.end - + */ + // ino.method.BoundedGenericTypeVar.29409.definition - public BoundedGenericTypeVar(String s, Vector bounds, int offset) + public BoundedGenericTypeVar(String s, Vector bounds, int offset, int endOffset) // ino.end // ino.method.BoundedGenericTypeVar.29409.body { @@ -60,9 +63,15 @@ public class BoundedGenericTypeVar extends GenericTypeVar } //this.genericTypeVar = new RefType(s,offset); this.bounds = bounds; + this.endOffset = endOffset; } // ino.end + @Override + public int getEndOffset(){ + return this.endOffset; + } + // ino.method.getBounds.26474.definition public Vector getBounds() // ino.end @@ -102,7 +111,7 @@ public class BoundedGenericTypeVar extends GenericTypeVar // ino.end // ino.method.clone.26483.body { - return new BoundedGenericTypeVar(this.getName(), this.getBounds(), getOffset()); + return new BoundedGenericTypeVar(this.getName(), this.getBounds(), getOffset(), this.getEndOffset()); } // ino.end diff --git a/src/mycompiler/mytype/GenericTypeVar.java b/src/mycompiler/mytype/GenericTypeVar.java index 0d3ab9a8..efb5b9e3 100755 --- a/src/mycompiler/mytype/GenericTypeVar.java +++ b/src/mycompiler/mytype/GenericTypeVar.java @@ -214,6 +214,10 @@ public class GenericTypeVar extends Type ConstraintsSet ret = new ConstraintsSet(); return ret; } + + public int getEndOffset() { + return this.getOffset() + this.name.length(); + } } // ino.end diff --git a/src/typinferenz/typedeployment/GenericTypeInsertPoint.java b/src/typinferenz/typedeployment/GenericTypeInsertPoint.java index 43a2eea4..c86f306a 100644 --- a/src/typinferenz/typedeployment/GenericTypeInsertPoint.java +++ b/src/typinferenz/typedeployment/GenericTypeInsertPoint.java @@ -162,6 +162,11 @@ public class GenericTypeInsertPoint extends SourcePatchPoint { public int getInsertLength() { return this.getTypeInsertString().length(); } + + @Override + public String toString(){ + return "GVIP: "+this.getTypeInsertString(); + } } /** @@ -183,11 +188,6 @@ class GenericVarPatch { if(!this.genericVarExtendDeclarations.contains(toAdd))this.genericVarExtendDeclarations.add(toAdd); } - public void addTPH(TypePlaceholder tph){ - GenericVarDeclarationPatch toAdd = new GenericVarDeclarationPatch(tph); - if(!this.genericVarDeclarations.contains(toAdd))this.genericVarDeclarations.add(toAdd); - } - public String getInsertString(ResultSet rs){ String ret = ""; Iterator it1 = this.genericVarDeclarations.iterator(); @@ -207,6 +207,8 @@ class GenericVarPatch { } public void add(TypePlaceholder tph) { + GenericVarDeclarationPatch toAdd = new GenericVarDeclarationPatch(tph); + if(!this.genericVarDeclarations.contains(toAdd))this.genericVarDeclarations.add(toAdd); } } diff --git a/src/typinferenz/typedeployment/TypeInsertPoint.java b/src/typinferenz/typedeployment/TypeInsertPoint.java index c26959c5..58d3c2c7 100644 --- a/src/typinferenz/typedeployment/TypeInsertPoint.java +++ b/src/typinferenz/typedeployment/TypeInsertPoint.java @@ -124,5 +124,10 @@ public class TypeInsertPoint extends SourcePatchPoint { private TypeInsertable getTIP() { return this.point; } + + @Override + public String toString(){ + return "TIP: "+this.type; + } } diff --git a/src/typinferenz/typedeployment/TypeInsertSet.java b/src/typinferenz/typedeployment/TypeInsertSet.java index 0596ea50..1e926ecb 100644 --- a/src/typinferenz/typedeployment/TypeInsertSet.java +++ b/src/typinferenz/typedeployment/TypeInsertSet.java @@ -5,6 +5,8 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Vector; +import org.apache.log4j.Logger; + import typinferenz.JavaCodeResult; import typinferenz.ResultSet; import typinferenz.TypeInsertable; @@ -33,7 +35,9 @@ import mycompiler.mytype.TypePlaceholder; * */ public class TypeInsertSet { - + //Logger: + protected Logger typinferenzLog = Logger.getLogger("Typeinference"); + public Vector points = new Vector(); private Vector genericTypeInsertPoints = new Vector(); private ResultSet resultSet; @@ -87,12 +91,13 @@ public class TypeInsertSet { if(! tip.getInsertNode().seesType(pair.TA2)){ for(TypePlaceholder tph : pair.getTypePlaceholder()){ if(! pairsDeclareTPH(pairs, tph)){ - gPatch.addTPH(tph); + gPatch.add(tph); } } } } GenericTypeInsertPoint gip = new GenericTypeInsertPoint(tip.getGenericTypeVarInsertNode(), gPatch, resultSet); + typinferenzLog.debug("Erstellter GenericTypeInsertPoint: "+gip); tpj.add(tip); tpj.add(gip); } diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest14.jav b/test/plugindevelopment/TypeInsertTests/LambdaTest14.jav new file mode 100644 index 00000000..3e4edfed --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest14.jav @@ -0,0 +1,5 @@ +class Matrix{ + op(B m){ + return (f) -> f.apply(m,this); + } +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest14.java b/test/plugindevelopment/TypeInsertTests/LambdaTest14.java new file mode 100644 index 00000000..8cbadd0d --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest14.java @@ -0,0 +1,16 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class LambdaTest14 { + private static final String TEST_FILE = "LambdaTest14.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + //mustContain.add("A a"); + MultipleTypesInsertTester.testSingleInsert(this.TEST_FILE, mustContain); + } +}