Fixed Tests. Doppelte TypeAssumptions beseitigt

This commit is contained in:
JanUlrich 2014-04-14 18:05:24 +02:00
parent 61e9c953c9
commit f0ef3017b9
25 changed files with 331 additions and 177 deletions

View File

@ -1330,7 +1330,6 @@ primitivetype :BOOLEAN
$$=$1; $$=$1;
} }
referencetype :classorinterfacetype referencetype :classorinterfacetype
{ {
org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->referenctype: " + $1); org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->referenctype: " + $1);

View File

@ -42,6 +42,7 @@ import org.apache.log4j.xml.DOMConfigurator;
import com.sun.corba.se.spi.orbutil.fsm.Guard.Result; import com.sun.corba.se.spi.orbutil.fsm.Guard.Result;
import com.sun.org.apache.xerces.internal.impl.xs.identity.Field; import com.sun.org.apache.xerces.internal.impl.xs.identity.Field;
import typinferenz.FunNInterface;
import typinferenz.ResultSet; import typinferenz.ResultSet;
// ino.end // ino.end
import typinferenz.assumptions.TypeAssumptions; import typinferenz.assumptions.TypeAssumptions;
@ -521,7 +522,7 @@ public class MyCompiler implements MyCompilerAPI
inferencelog.info("# TypeReconstruction-Algorithmus - START #"); inferencelog.info("# TypeReconstruction-Algorithmus - START #");
inferencelog.info("##########################################\n"); inferencelog.info("##########################################\n");
TypeAssumptions globalAssumptions = m_AbstractSyntaxTree.elementAt(0).makeBasicAssumptions(); TypeAssumptions globalAssumptions = makeFunNAssumptions();
Vector<TypeinferenceResultSet> result = new Vector<TypeinferenceResultSet>(); Vector<TypeinferenceResultSet> result = new Vector<TypeinferenceResultSet>();
for(SourceFile srcFile : m_AbstractSyntaxTree){ for(SourceFile srcFile : m_AbstractSyntaxTree){
result.addAll(srcFile.typeReconstruction(globalAssumptions)); result.addAll(srcFile.typeReconstruction(globalAssumptions));
@ -536,7 +537,24 @@ public class MyCompiler implements MyCompilerAPI
} }
// ino.end // ino.end
/**
* Erstellt die FunN-Assumptions
* Fun0-FunN (momentan für N = 6)
* @return
*/
private TypeAssumptions makeFunNAssumptions(){
TypeAssumptions ret = new TypeAssumptions();
//Basic Assumptions für die FunN Interfaces:
//TODO: Hier mehr als Fun1-Fun5 implementieren
for(int i = 0; i<6; i++){
FunNInterface funN = new FunNInterface(i);
ret.add(funN.getPublicFieldAssumptions());
}
return ret;
}
/** /**
* Author: J<EFBFBD>rg B<EFBFBD>uerle<br/> * Author: J<EFBFBD>rg B<EFBFBD>uerle<br/>

View File

@ -1281,7 +1281,7 @@ public class SourceFile
*/ */
// ino.end // ino.end
// ino.method.makeBasicAssumptions.21418.definition // ino.method.makeBasicAssumptions.21418.definition
public TypeAssumptions makeBasicAssumptions() private TypeAssumptions makeBasicAssumptions()
// ino.end // ino.end
// ino.method.makeBasicAssumptions.21418.body // ino.method.makeBasicAssumptions.21418.body
{ {

View File

@ -844,7 +844,7 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface
//assumptions.setThisV(thisAssumption); //assumptions.setThisV(thisAssumption);
for(Field field : this.getFields()){ for(Field field : this.getFields()){
assumptions.add(field.createTypeAssumptions(this)); if(!field.isPublic())assumptions.add(field.createTypeAssumptions(this));
} }
//Eine Assumption für den Standardkonstruktor: //Eine Assumption für den Standardkonstruktor:
@ -1267,10 +1267,10 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface
* @return * @return
*/ */
public TypeAssumptions getPublicFieldAssumptions() { public TypeAssumptions getPublicFieldAssumptions() {
TypeAssumptions ret = this.getPrivateFieldAssumptions(); TypeAssumptions ret = new TypeAssumptions();//this.getPrivateFieldAssumptions();
ret.addClassAssumption(new ClassAssumption(this)); ret.addClassAssumption(new ClassAssumption(this));
for(Field f : this.getFields()){ for(Field f : this.getFields()){
ret.add(f.createTypeAssumptions(this)); if(f.isPublic())ret.add(f.createTypeAssumptions(this));
} }
return ret; return ret;
} }
@ -1314,6 +1314,7 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface
this.addField(standardKonstruktor); this.addField(standardKonstruktor);
} }
//TODO: Umwandlung zu RefTypes funktioniert noch nicht richtig. (siehe LambdaTest2)
//Als RefType geparste Generische Variablen umwandeln: //Als RefType geparste Generische Variablen umwandeln:
this.wandleRefTypeAttributes2GenericAttributes(); this.wandleRefTypeAttributes2GenericAttributes();
} }

View File

@ -27,6 +27,7 @@ public class ClassHelper
*/ */
// ino.end // ino.end
// ino.method.findGenericType.23209.definition // ino.method.findGenericType.23209.definition
@Deprecated
public static GenericTypeVar findGenericType(Type type, Vector<Type> paralist, Vector<GenericTypeVar> methodParaList) public static GenericTypeVar findGenericType(Type type, Vector<Type> paralist, Vector<GenericTypeVar> methodParaList)
// ino.end // ino.end
// ino.method.findGenericType.23209.body // ino.method.findGenericType.23209.body

View File

@ -6,6 +6,7 @@ import mycompiler.SyntaxTreeNode;
import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.ClassFile;
import mycompiler.myexception.JVMCodeException; import mycompiler.myexception.JVMCodeException;
import mycompiler.mytype.GenericTypeVar; import mycompiler.mytype.GenericTypeVar;
import mycompiler.mytype.RefType;
import mycompiler.mytype.Type; import mycompiler.mytype.Type;
import mycompiler.mytype.TypePlaceholder; import mycompiler.mytype.TypePlaceholder;
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent; import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
@ -114,9 +115,15 @@ public abstract class Field extends SyntaxTreeNode implements TypeInsertable, Ty
public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist){ public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist){
// Zuerst Returntype untersuchen // Zuerst Returntype untersuchen
Type type=getType(); Type type=getType();
GenericTypeVar pendantReturnType=ClassHelper.findGenericType(type, paralist,new Vector<GenericTypeVar>()); Type pendantReturnType = null;
if(type instanceof RefType)pendantReturnType = ((RefType)type).findGenericType(paralist, new Vector<GenericTypeVar>());//GenericTypeVar pendantReturnType=ClassHelper.findGenericType(type, paralist,new Vector<GenericTypeVar>());
if(pendantReturnType!=null){ //Wenn generisch, dann modifizieren if(pendantReturnType!=null){ //Wenn generisch, dann modifizieren
setType(pendantReturnType); setType(pendantReturnType);
} }
} }
public boolean isPublic() {
//TODO: momentan ist jedes Feld public!
return true;
}
} }

View File

@ -503,7 +503,9 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable
{ {
// Zuerst Returntype untersuchen // Zuerst Returntype untersuchen
Type returnType=getType(); Type returnType=getType();
GenericTypeVar pendantReturnType=ClassHelper.findGenericType(returnType, paralist,genericMethodParameters); Type pendantReturnType = null;
if(returnType instanceof RefType)pendantReturnType = ((RefType)returnType).findGenericType(paralist, new Vector<GenericTypeVar>());
//GenericTypeVar pendantReturnType=ClassHelper.findGenericType(returnType, paralist,genericMethodParameters);
if(pendantReturnType!=null){ //Wenn generisch, dann modifizieren if(pendantReturnType!=null){ //Wenn generisch, dann modifizieren
setReturnType(pendantReturnType); setReturnType(pendantReturnType);
} }
@ -513,7 +515,9 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable
FormalParameter fp=parameterlist.formalparameter.get(par); FormalParameter fp=parameterlist.formalparameter.get(par);
Type fpType=fp.getType(); Type fpType=fp.getType();
// Nur wenn es sich um ein RefType-Field handelt // Nur wenn es sich um ein RefType-Field handelt
GenericTypeVar pendantPara=ClassHelper.findGenericType(fpType,paralist,genericMethodParameters); Type pendantPara = null;
if(fpType instanceof RefType)pendantPara = ((RefType)fpType).findGenericType(paralist, new Vector<GenericTypeVar>());
//GenericTypeVar pendantPara=ClassHelper.findGenericType(fpType,paralist,genericMethodParameters);
if(pendantPara!=null){ //Wenn generisch, dann modifizieren if(pendantPara!=null){ //Wenn generisch, dann modifizieren
fp.setType(pendantPara); fp.setType(pendantPara);
} }
@ -537,7 +541,9 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable
public ConstraintsSet TYPE(TypeAssumptions ass) { public ConstraintsSet TYPE(TypeAssumptions ass) {
if((this.returntype instanceof RefType))this.returntype = ass.getTypeFor((RefType)this.returntype); if((this.returntype instanceof RefType) &&
!(this.returntype instanceof mycompiler.mytype.Void))//Sonderfall der Methode: Ihr Typ darf Void definiert werden.
this.returntype = ass.getTypeFor((RefType)this.returntype);
ConstraintsSet ret = new ConstraintsSet(); ConstraintsSet ret = new ConstraintsSet();
TypeAssumptions localAss = new TypeAssumptions(); TypeAssumptions localAss = new TypeAssumptions();
localAss.add(ass); //Die globalen Assumptions anhängen localAss.add(ass); //Die globalen Assumptions anhängen

View File

@ -1972,7 +1972,7 @@ case 150:
} }
break; break;
case 151: case 151:
// line 1335 "./../src/mycompiler/myparser/JavaParser.jay" // line 1334 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->referenctype: " + ((UsedId)yyVals[0+yyTop])); org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->referenctype: " + ((UsedId)yyVals[0+yyTop]));
RefType RT = new RefType(((UsedId)yyVals[0+yyTop]).getOffset()); RefType RT = new RefType(((UsedId)yyVals[0+yyTop]).getOffset());
@ -1992,25 +1992,25 @@ case 151:
} }
break; break;
case 152: case 152:
// line 1355 "./../src/mycompiler/myparser/JavaParser.jay" // line 1354 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((DeclId)yyVals[0+yyTop]); yyVal=((DeclId)yyVals[0+yyTop]);
} }
break; break;
case 153: case 153:
// line 1376 "./../src/mycompiler/myparser/JavaParser.jay" // line 1375 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((LocalVarDecl)yyVals[0+yyTop]); yyVal=((LocalVarDecl)yyVals[0+yyTop]);
} }
break; break;
case 154: case 154:
// line 1380 "./../src/mycompiler/myparser/JavaParser.jay" // line 1379 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Statement)yyVals[0+yyTop]); yyVal=((Statement)yyVals[0+yyTop]);
} }
break; break;
case 155: case 155:
// line 1385 "./../src/mycompiler/myparser/JavaParser.jay" // line 1384 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
FormalParameter FP = new FormalParameter(((DeclId)yyVals[0+yyTop])); FormalParameter FP = new FormalParameter(((DeclId)yyVals[0+yyTop]));
FP.setType(((Type)yyVals[-1+yyTop])); FP.setType(((Type)yyVals[-1+yyTop]));
@ -2019,7 +2019,7 @@ case 155:
} }
break; break;
case 156: case 156:
// line 1410 "./../src/mycompiler/myparser/JavaParser.jay" // line 1409 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
org.apache.log4j.Logger.getLogger("parser").debug("\nFunktionsdeklaration mit typlosen Parametern: " + ((DeclId)yyVals[0+yyTop]).name); org.apache.log4j.Logger.getLogger("parser").debug("\nFunktionsdeklaration mit typlosen Parametern: " + ((DeclId)yyVals[0+yyTop]).name);
@ -2039,7 +2039,7 @@ case 156:
} }
break; break;
case 157: case 157:
// line 1429 "./../src/mycompiler/myparser/JavaParser.jay" // line 1428 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
ArgumentList AL = new ArgumentList(); ArgumentList AL = new ArgumentList();
AL.expr.addElement(((Expr)yyVals[0+yyTop])); AL.expr.addElement(((Expr)yyVals[0+yyTop]));
@ -2047,20 +2047,20 @@ case 157:
} }
break; break;
case 158: case 158:
// line 1435 "./../src/mycompiler/myparser/JavaParser.jay" // line 1434 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
((ArgumentList)yyVals[-2+yyTop]).expr.addElement(((Expr)yyVals[0+yyTop])); ((ArgumentList)yyVals[-2+yyTop]).expr.addElement(((Expr)yyVals[0+yyTop]));
yyVal=((ArgumentList)yyVals[-2+yyTop]); yyVal=((ArgumentList)yyVals[-2+yyTop]);
} }
break; break;
case 159: case 159:
// line 1441 "./../src/mycompiler/myparser/JavaParser.jay" // line 1440 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((BaseType)yyVals[0+yyTop]); yyVal=((BaseType)yyVals[0+yyTop]);
} }
break; break;
case 160: case 160:
// line 1446 "./../src/mycompiler/myparser/JavaParser.jay" // line 1445 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
DeclId DI = new DeclId(); DeclId DI = new DeclId();
/* #JB# 10.04.2005 */ /* #JB# 10.04.2005 */
@ -2073,61 +2073,61 @@ case 160:
} }
break; break;
case 161: case 161:
// line 1458 "./../src/mycompiler/myparser/JavaParser.jay" // line 1457 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 162: case 162:
// line 1463 "./../src/mycompiler/myparser/JavaParser.jay" // line 1462 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((LocalVarDecl)yyVals[-1+yyTop]); yyVal=((LocalVarDecl)yyVals[-1+yyTop]);
} }
break; break;
case 163: case 163:
// line 1468 "./../src/mycompiler/myparser/JavaParser.jay" // line 1467 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Statement)yyVals[0+yyTop]); yyVal=((Statement)yyVals[0+yyTop]);
} }
break; break;
case 164: case 164:
// line 1472 "./../src/mycompiler/myparser/JavaParser.jay" // line 1471 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((IfStmt)yyVals[0+yyTop]); yyVal=((IfStmt)yyVals[0+yyTop]);
} }
break; break;
case 165: case 165:
// line 1476 "./../src/mycompiler/myparser/JavaParser.jay" // line 1475 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((IfStmt)yyVals[0+yyTop]); yyVal=((IfStmt)yyVals[0+yyTop]);
} }
break; break;
case 166: case 166:
// line 1480 "./../src/mycompiler/myparser/JavaParser.jay" // line 1479 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((WhileStmt)yyVals[0+yyTop]); yyVal=((WhileStmt)yyVals[0+yyTop]);
} }
break; break;
case 167: case 167:
// line 1484 "./../src/mycompiler/myparser/JavaParser.jay" // line 1483 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((ForStmt)yyVals[0+yyTop]); yyVal=((ForStmt)yyVals[0+yyTop]);
} }
break; break;
case 168: case 168:
// line 1489 "./../src/mycompiler/myparser/JavaParser.jay" // line 1488 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 169: case 169:
// line 1493 "./../src/mycompiler/myparser/JavaParser.jay" // line 1492 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((NewClass)yyVals[0+yyTop]); yyVal=((NewClass)yyVals[0+yyTop]);
} }
break; break;
case 170: case 170:
// line 1498 "./../src/mycompiler/myparser/JavaParser.jay" // line 1497 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
IntegerType IT = new IntegerType(); IntegerType IT = new IntegerType();
/* #JB# 05.04.2005 */ /* #JB# 05.04.2005 */
@ -2138,7 +2138,7 @@ case 170:
} }
break; break;
case 171: case 171:
// line 1507 "./../src/mycompiler/myparser/JavaParser.jay" // line 1506 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
CharacterType CT = new CharacterType(); CharacterType CT = new CharacterType();
/* #JB# 05.04.2005 */ /* #JB# 05.04.2005 */
@ -2149,7 +2149,7 @@ case 171:
} }
break; break;
case 172: case 172:
// line 1517 "./../src/mycompiler/myparser/JavaParser.jay" // line 1516 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
org.apache.log4j.Logger.getLogger("parser").debug("P -> Lokale Variable angelegt!"); 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()); LocalVarDecl LVD = new LocalVarDecl(((Type)yyVals[-1+yyTop]).getOffset(),((Type)yyVals[-1+yyTop]).getVariableLength());
@ -2159,7 +2159,7 @@ case 172:
} }
break; break;
case 173: case 173:
// line 1528 "./../src/mycompiler/myparser/JavaParser.jay" // line 1527 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
org.apache.log4j.Logger.getLogger("parser").debug("P -> Lokale Variable angelegt!"); 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()); LocalVarDecl LVD = new LocalVarDecl(((FieldDeclaration)yyVals[0+yyTop]).getOffset(),((FieldDeclaration)yyVals[0+yyTop]).getVariableLength());
@ -2169,31 +2169,31 @@ case 173:
} }
break; break;
case 174: case 174:
// line 1538 "./../src/mycompiler/myparser/JavaParser.jay" // line 1537 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Block)yyVals[0+yyTop]); yyVal=((Block)yyVals[0+yyTop]);
} }
break; break;
case 175: case 175:
// line 1542 "./../src/mycompiler/myparser/JavaParser.jay" // line 1541 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((EmptyStmt)yyVals[0+yyTop]); yyVal=((EmptyStmt)yyVals[0+yyTop]);
} }
break; break;
case 176: case 176:
// line 1546 "./../src/mycompiler/myparser/JavaParser.jay" // line 1545 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((ExprStmt)yyVals[0+yyTop]); yyVal=((ExprStmt)yyVals[0+yyTop]);
} }
break; break;
case 177: case 177:
// line 1550 "./../src/mycompiler/myparser/JavaParser.jay" // line 1549 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Return)yyVals[0+yyTop]); yyVal=((Return)yyVals[0+yyTop]);
} }
break; break;
case 178: case 178:
// line 1555 "./../src/mycompiler/myparser/JavaParser.jay" // line 1554 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
IfStmt Ifst = new IfStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); IfStmt Ifst = new IfStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
Ifst.set_Expr(((Expr)yyVals[-2+yyTop])); Ifst.set_Expr(((Expr)yyVals[-2+yyTop]));
@ -2202,7 +2202,7 @@ case 178:
} }
break; break;
case 179: case 179:
// line 1563 "./../src/mycompiler/myparser/JavaParser.jay" // line 1562 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
IfStmt IfstElst = new IfStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); IfStmt IfstElst = new IfStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength());
IfstElst.set_Expr(((Expr)yyVals[-4+yyTop])); IfstElst.set_Expr(((Expr)yyVals[-4+yyTop]));
@ -2212,7 +2212,7 @@ case 179:
} }
break; break;
case 180: case 180:
// line 1572 "./../src/mycompiler/myparser/JavaParser.jay" // line 1571 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
WhileStmt Whlst = new WhileStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); WhileStmt Whlst = new WhileStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
Whlst.set_Expr(((Expr)yyVals[-2+yyTop])); Whlst.set_Expr(((Expr)yyVals[-2+yyTop]));
@ -2221,7 +2221,7 @@ case 180:
} }
break; break;
case 181: case 181:
// line 1583 "./../src/mycompiler/myparser/JavaParser.jay" // line 1582 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
ForStmt Fst = new ForStmt(((Expr)yyVals[-6+yyTop]).getOffset(),((Expr)yyVals[-6+yyTop]).getVariableLength()); ForStmt Fst = new ForStmt(((Expr)yyVals[-6+yyTop]).getOffset(),((Expr)yyVals[-6+yyTop]).getVariableLength());
Fst.set_head_Initializer(((Expr)yyVals[-6+yyTop])); Fst.set_head_Initializer(((Expr)yyVals[-6+yyTop]));
@ -2234,7 +2234,7 @@ case 181:
} }
break; break;
case 182: case 182:
// line 1595 "./../src/mycompiler/myparser/JavaParser.jay" // line 1594 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
ForStmt Fst = new ForStmt(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength()); ForStmt Fst = new ForStmt(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength());
Fst.set_head_Initializer(((Expr)yyVals[-5+yyTop])); Fst.set_head_Initializer(((Expr)yyVals[-5+yyTop]));
@ -2246,7 +2246,7 @@ case 182:
} }
break; break;
case 183: case 183:
// line 1606 "./../src/mycompiler/myparser/JavaParser.jay" // line 1605 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
ForStmt Fst = new ForStmt(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength()); ForStmt Fst = new ForStmt(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength());
Fst.set_head_Initializer(((Expr)yyVals[-5+yyTop])); Fst.set_head_Initializer(((Expr)yyVals[-5+yyTop]));
@ -2258,7 +2258,7 @@ case 183:
} }
break; break;
case 184: case 184:
// line 1617 "./../src/mycompiler/myparser/JavaParser.jay" // line 1616 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
ForStmt Fst = new ForStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); ForStmt Fst = new ForStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength());
Fst.set_head_Condition(((Expr)yyVals[-4+yyTop])); Fst.set_head_Condition(((Expr)yyVals[-4+yyTop]));
@ -2270,7 +2270,7 @@ case 184:
} }
break; break;
case 185: case 185:
// line 1628 "./../src/mycompiler/myparser/JavaParser.jay" // line 1627 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
ForStmt Fst = new ForStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); ForStmt Fst = new ForStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength());
Fst.set_head_Initializer(((Expr)yyVals[-4+yyTop])); Fst.set_head_Initializer(((Expr)yyVals[-4+yyTop]));
@ -2281,7 +2281,7 @@ case 185:
} }
break; break;
case 186: case 186:
// line 1638 "./../src/mycompiler/myparser/JavaParser.jay" // line 1637 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
ForStmt Fst = new ForStmt(((Expr)yyVals[-3+yyTop]).getOffset(),((Expr)yyVals[-3+yyTop]).getVariableLength()); ForStmt Fst = new ForStmt(((Expr)yyVals[-3+yyTop]).getOffset(),((Expr)yyVals[-3+yyTop]).getVariableLength());
Fst.set_head_Condition(((Expr)yyVals[-3+yyTop])); Fst.set_head_Condition(((Expr)yyVals[-3+yyTop]));
@ -2292,7 +2292,7 @@ case 186:
} }
break; break;
case 187: case 187:
// line 1648 "./../src/mycompiler/myparser/JavaParser.jay" // line 1647 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
ForStmt Fst = new ForStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); ForStmt Fst = new ForStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
Fst.set_head_Loop_expr(((Expr)yyVals[-2+yyTop])); Fst.set_head_Loop_expr(((Expr)yyVals[-2+yyTop]));
@ -2303,7 +2303,7 @@ case 187:
} }
break; break;
case 188: case 188:
// line 1658 "./../src/mycompiler/myparser/JavaParser.jay" // line 1657 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
ForStmt Fst = new ForStmt(((Statement)yyVals[0+yyTop]).getOffset(),((Statement)yyVals[0+yyTop]).getVariableLength()); ForStmt Fst = new ForStmt(((Statement)yyVals[0+yyTop]).getOffset(),((Statement)yyVals[0+yyTop]).getVariableLength());
Fst.set_body_Loop_block(((Statement)yyVals[0+yyTop])); Fst.set_body_Loop_block(((Statement)yyVals[0+yyTop]));
@ -2313,40 +2313,40 @@ case 188:
} }
break; break;
case 189: case 189:
// line 1667 "./../src/mycompiler/myparser/JavaParser.jay" // line 1666 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
org.apache.log4j.Logger.getLogger("parser").debug("conditionalexpression"); org.apache.log4j.Logger.getLogger("parser").debug("conditionalexpression");
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 190: case 190:
// line 1672 "./../src/mycompiler/myparser/JavaParser.jay" // line 1671 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Assign)yyVals[0+yyTop]); yyVal=((Assign)yyVals[0+yyTop]);
} }
break; break;
case 191: case 191:
// line 1678 "./../src/mycompiler/myparser/JavaParser.jay" // line 1677 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
EmptyStmt Empst = new EmptyStmt(); EmptyStmt Empst = new EmptyStmt();
yyVal=Empst; yyVal=Empst;
} }
break; break;
case 192: case 192:
// line 1684 "./../src/mycompiler/myparser/JavaParser.jay" // line 1683 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[-1+yyTop]); yyVal=((Expr)yyVals[-1+yyTop]);
} }
break; break;
case 193: case 193:
// line 1689 "./../src/mycompiler/myparser/JavaParser.jay" // line 1688 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Return ret = new Return(-1,-1); Return ret = new Return(-1,-1);
yyVal= ret; yyVal= ret;
} }
break; break;
case 194: case 194:
// line 1694 "./../src/mycompiler/myparser/JavaParser.jay" // line 1693 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Return retexp = new Return(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength()); Return retexp = new Return(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength());
retexp.set_ReturnExpr(((Expr)yyVals[-1+yyTop])); retexp.set_ReturnExpr(((Expr)yyVals[-1+yyTop]));
@ -2354,31 +2354,31 @@ case 194:
} }
break; break;
case 195: case 195:
// line 1701 "./../src/mycompiler/myparser/JavaParser.jay" // line 1700 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Statement)yyVals[0+yyTop]); yyVal=((Statement)yyVals[0+yyTop]);
} }
break; break;
case 196: case 196:
// line 1705 "./../src/mycompiler/myparser/JavaParser.jay" // line 1704 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((IfStmt)yyVals[0+yyTop]); yyVal=((IfStmt)yyVals[0+yyTop]);
} }
break; break;
case 197: case 197:
// line 1709 "./../src/mycompiler/myparser/JavaParser.jay" // line 1708 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((WhileStmt)yyVals[0+yyTop]); yyVal=((WhileStmt)yyVals[0+yyTop]);
} }
break; break;
case 198: case 198:
// line 1714 "./../src/mycompiler/myparser/JavaParser.jay" // line 1713 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 199: case 199:
// line 1720 "./../src/mycompiler/myparser/JavaParser.jay" // line 1719 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
org.apache.log4j.Logger.getLogger("parser").debug("\nParser --> Zuweisung1!\n"); org.apache.log4j.Logger.getLogger("parser").debug("\nParser --> Zuweisung1!\n");
Assign Ass = new Assign(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); Assign Ass = new Assign(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength());
@ -2405,7 +2405,7 @@ case 199:
} }
break; break;
case 200: case 200:
// line 1745 "./../src/mycompiler/myparser/JavaParser.jay" // line 1744 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Assign Ass =new Assign(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); 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()); LocalOrFieldVar LOFV = new LocalOrFieldVar(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength());
@ -2429,43 +2429,43 @@ case 200:
} }
break; break;
case 201: case 201:
// line 1768 "./../src/mycompiler/myparser/JavaParser.jay" // line 1767 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Assign)yyVals[0+yyTop]); yyVal=((Assign)yyVals[0+yyTop]);
} }
break; break;
case 202: case 202:
// line 1772 "./../src/mycompiler/myparser/JavaParser.jay" // line 1771 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 203: case 203:
// line 1776 "./../src/mycompiler/myparser/JavaParser.jay" // line 1775 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 204: case 204:
// line 1780 "./../src/mycompiler/myparser/JavaParser.jay" // line 1779 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 205: case 205:
// line 1784 "./../src/mycompiler/myparser/JavaParser.jay" // line 1783 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 206: case 206:
// line 1788 "./../src/mycompiler/myparser/JavaParser.jay" // line 1787 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((MethodCall)yyVals[0+yyTop]); yyVal=((MethodCall)yyVals[0+yyTop]);
} }
break; break;
case 207: case 207:
// line 1799 "./../src/mycompiler/myparser/JavaParser.jay" // line 1798 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
IfStmt IfElno = new IfStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); IfStmt IfElno = new IfStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength());
IfElno.set_Expr(((Expr)yyVals[-4+yyTop])); IfElno.set_Expr(((Expr)yyVals[-4+yyTop]));
@ -2475,7 +2475,7 @@ case 207:
} }
break; break;
case 208: case 208:
// line 1808 "./../src/mycompiler/myparser/JavaParser.jay" // line 1807 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
WhileStmt Whstno = new WhileStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); WhileStmt Whstno = new WhileStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
Whstno.set_Expr(((Expr)yyVals[-2+yyTop])); Whstno.set_Expr(((Expr)yyVals[-2+yyTop]));
@ -2484,13 +2484,13 @@ case 208:
} }
break; break;
case 209: case 209:
// line 1816 "./../src/mycompiler/myparser/JavaParser.jay" // line 1815 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 210: case 210:
// line 1820 "./../src/mycompiler/myparser/JavaParser.jay" // line 1819 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Binary LogOr = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); 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()); OrOp OrO = new OrOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
@ -2502,19 +2502,19 @@ case 210:
} }
break; break;
case 211: case 211:
// line 1833 "./../src/mycompiler/myparser/JavaParser.jay" // line 1832 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=null; yyVal=null;
} }
break; break;
case 212: case 212:
// line 1838 "./../src/mycompiler/myparser/JavaParser.jay" // line 1837 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Block)yyVals[0+yyTop]); yyVal=((Block)yyVals[0+yyTop]);
} }
break; break;
case 213: case 213:
// line 1842 "./../src/mycompiler/myparser/JavaParser.jay" // line 1841 "./../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.*/ /*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";}|*/ /*Bsp.: Aus der Expression |var=="hallo"| wird: |{return var=="hallo";}|*/
@ -2525,19 +2525,19 @@ case 213:
} }
break; break;
case 214: case 214:
// line 1852 "./../src/mycompiler/myparser/JavaParser.jay" // line 1851 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=null; yyVal=null;
} }
break; break;
case 215: case 215:
// line 1856 "./../src/mycompiler/myparser/JavaParser.jay" // line 1855 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((ParameterList)yyVals[-1+yyTop]); yyVal=((ParameterList)yyVals[-1+yyTop]);
} }
break; break;
case 216: case 216:
// line 1861 "./../src/mycompiler/myparser/JavaParser.jay" // line 1860 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
LambdaExpression lambda = new LambdaExpression(/*((ParameSterList)$2).getOffset(),((ParameterList)$2).getVariableLength()*/0,0); LambdaExpression lambda = new LambdaExpression(/*((ParameSterList)$2).getOffset(),((ParameterList)$2).getVariableLength()*/0,0);
if(((ParameterList)yyVals[-2+yyTop])!=null)lambda.setParameterList(((ParameterList)yyVals[-2+yyTop])); if(((ParameterList)yyVals[-2+yyTop])!=null)lambda.setParameterList(((ParameterList)yyVals[-2+yyTop]));
@ -2546,54 +2546,54 @@ case 216:
} }
break; break;
case 217: case 217:
// line 1880 "./../src/mycompiler/myparser/JavaParser.jay" // line 1879 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((UsedId)yyVals[0+yyTop]); yyVal=((UsedId)yyVals[0+yyTop]);
} }
break; break;
case 218: case 218:
// line 1885 "./../src/mycompiler/myparser/JavaParser.jay" // line 1884 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=null; yyVal=null;
} }
break; break;
case 219: case 219:
// line 1889 "./../src/mycompiler/myparser/JavaParser.jay" // line 1888 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
TimesOp TEO = new TimesOp(-1,-1); TimesOp TEO = new TimesOp(-1,-1);
yyVal=TEO; yyVal=TEO;
} }
break; break;
case 220: case 220:
// line 1894 "./../src/mycompiler/myparser/JavaParser.jay" // line 1893 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
DivideOp DEO = new DivideOp(-1,-1); DivideOp DEO = new DivideOp(-1,-1);
yyVal=DEO; yyVal=DEO;
} }
break; break;
case 221: case 221:
// line 1899 "./../src/mycompiler/myparser/JavaParser.jay" // line 1898 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
ModuloOp MEO = new ModuloOp(-1,-1); ModuloOp MEO = new ModuloOp(-1,-1);
yyVal=MEO; yyVal=MEO;
} }
break; break;
case 222: case 222:
// line 1904 "./../src/mycompiler/myparser/JavaParser.jay" // line 1903 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
PlusOp PEO = new PlusOp(-1,-1); PlusOp PEO = new PlusOp(-1,-1);
yyVal=PEO; yyVal=PEO;
} }
break; break;
case 223: case 223:
// line 1909 "./../src/mycompiler/myparser/JavaParser.jay" // line 1908 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
MinusOp MEO = new MinusOp(-1,-1); MinusOp MEO = new MinusOp(-1,-1);
yyVal=MEO; yyVal=MEO;
} }
break; break;
case 224: case 224:
// line 1921 "./../src/mycompiler/myparser/JavaParser.jay" // line 1920 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
PreIncExpr PRINC = new PreIncExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); PreIncExpr PRINC = new PreIncExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength());
PRINC.set_Expr(((Expr)yyVals[0+yyTop])); PRINC.set_Expr(((Expr)yyVals[0+yyTop]));
@ -2601,7 +2601,7 @@ case 224:
} }
break; break;
case 225: case 225:
// line 1928 "./../src/mycompiler/myparser/JavaParser.jay" // line 1927 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
PreDecExpr PRDEC = new PreDecExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); PreDecExpr PRDEC = new PreDecExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength());
PRDEC.set_Expr(((Expr)yyVals[0+yyTop])); PRDEC.set_Expr(((Expr)yyVals[0+yyTop]));
@ -2609,7 +2609,7 @@ case 225:
} }
break; break;
case 226: case 226:
// line 1935 "./../src/mycompiler/myparser/JavaParser.jay" // line 1934 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
PostIncExpr PIE = new PostIncExpr(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength()); PostIncExpr PIE = new PostIncExpr(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength());
PIE.set_Expr(((Expr)yyVals[-1+yyTop])); PIE.set_Expr(((Expr)yyVals[-1+yyTop]));
@ -2617,7 +2617,7 @@ case 226:
} }
break; break;
case 227: case 227:
// line 1942 "./../src/mycompiler/myparser/JavaParser.jay" // line 1941 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
PostDecExpr PDE = new PostDecExpr(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength()); PostDecExpr PDE = new PostDecExpr(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength());
PDE.set_Expr(((Expr)yyVals[-1+yyTop])); PDE.set_Expr(((Expr)yyVals[-1+yyTop]));
@ -2625,7 +2625,7 @@ case 227:
} }
break; break;
case 228: case 228:
// line 1950 "./../src/mycompiler/myparser/JavaParser.jay" // line 1949 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
org.apache.log4j.Logger.getLogger("parser").debug("M1"); org.apache.log4j.Logger.getLogger("parser").debug("M1");
MethodCall MC = new MethodCall(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); MethodCall MC = new MethodCall(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength());
@ -2657,7 +2657,7 @@ case 228:
} }
break; break;
case 229: case 229:
// line 1980 "./../src/mycompiler/myparser/JavaParser.jay" // line 1979 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
org.apache.log4j.Logger.getLogger("parser").debug("M2"); org.apache.log4j.Logger.getLogger("parser").debug("M2");
MethodCall MCarg = new MethodCall(((UsedId)yyVals[-3+yyTop]).getOffset(),((UsedId)yyVals[-3+yyTop]).getVariableLength()); MethodCall MCarg = new MethodCall(((UsedId)yyVals[-3+yyTop]).getOffset(),((UsedId)yyVals[-3+yyTop]).getVariableLength());
@ -2690,7 +2690,7 @@ case 229:
} }
break; break;
case 230: case 230:
// line 2011 "./../src/mycompiler/myparser/JavaParser.jay" // line 2010 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
org.apache.log4j.Logger.getLogger("parser").debug("M3"); org.apache.log4j.Logger.getLogger("parser").debug("M3");
MethodCall MCpr = new MethodCall(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); MethodCall MCpr = new MethodCall(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength());
@ -2711,7 +2711,7 @@ case 230:
} }
break; break;
case 231: case 231:
// line 2030 "./../src/mycompiler/myparser/JavaParser.jay" // line 2029 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
org.apache.log4j.Logger.getLogger("parser").debug("M4"); org.apache.log4j.Logger.getLogger("parser").debug("M4");
MethodCall MCPA = new MethodCall(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength()); MethodCall MCPA = new MethodCall(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength());
@ -2733,7 +2733,7 @@ case 231:
} }
break; break;
case 232: case 232:
// line 2053 "./../src/mycompiler/myparser/JavaParser.jay" // line 2052 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
NewClass NC = new NewClass(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); NewClass NC = new NewClass(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength());
NC.set_UsedId(((UsedId)yyVals[-2+yyTop])); NC.set_UsedId(((UsedId)yyVals[-2+yyTop]));
@ -2743,7 +2743,7 @@ case 232:
} }
break; break;
case 233: case 233:
// line 2061 "./../src/mycompiler/myparser/JavaParser.jay" // line 2060 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
NewClass NCarg = new NewClass(((UsedId)yyVals[-3+yyTop]).getOffset(),((UsedId)yyVals[-3+yyTop]).getVariableLength()); NewClass NCarg = new NewClass(((UsedId)yyVals[-3+yyTop]).getOffset(),((UsedId)yyVals[-3+yyTop]).getVariableLength());
NCarg.set_UsedId(((UsedId)yyVals[-3+yyTop])); NCarg.set_UsedId(((UsedId)yyVals[-3+yyTop]));
@ -2754,13 +2754,13 @@ case 233:
} }
break; break;
case 234: case 234:
// line 2071 "./../src/mycompiler/myparser/JavaParser.jay" // line 2070 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 235: case 235:
// line 2075 "./../src/mycompiler/myparser/JavaParser.jay" // line 2074 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Binary And = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); 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()); AndOp AndO = new AndOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
@ -2772,19 +2772,19 @@ case 235:
} }
break; break;
case 236: case 236:
// line 2091 "./../src/mycompiler/myparser/JavaParser.jay" // line 2090 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 237: case 237:
// line 2095 "./../src/mycompiler/myparser/JavaParser.jay" // line 2094 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 238: case 238:
// line 2099 "./../src/mycompiler/myparser/JavaParser.jay" // line 2098 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
PositivExpr POSEX=new PositivExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); PositivExpr POSEX=new PositivExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength());
UnaryPlus UP= new UnaryPlus(); UnaryPlus UP= new UnaryPlus();
@ -2794,7 +2794,7 @@ case 238:
} }
break; break;
case 239: case 239:
// line 2107 "./../src/mycompiler/myparser/JavaParser.jay" // line 2106 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
NegativeExpr NEGEX=new NegativeExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); NegativeExpr NEGEX=new NegativeExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength());
UnaryMinus UM=new UnaryMinus(); UnaryMinus UM=new UnaryMinus();
@ -2804,19 +2804,19 @@ case 239:
} }
break; break;
case 240: case 240:
// line 2115 "./../src/mycompiler/myparser/JavaParser.jay" // line 2114 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 241: case 241:
// line 2120 "./../src/mycompiler/myparser/JavaParser.jay" // line 2119 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 242: case 242:
// line 2124 "./../src/mycompiler/myparser/JavaParser.jay" // line 2123 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
if (((UsedId)yyVals[0+yyTop]).get_Name().size() > 1) { if (((UsedId)yyVals[0+yyTop]).get_Name().size() > 1) {
@ -2836,37 +2836,37 @@ case 242:
} }
break; break;
case 243: case 243:
// line 2142 "./../src/mycompiler/myparser/JavaParser.jay" // line 2141 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 244: case 244:
// line 2146 "./../src/mycompiler/myparser/JavaParser.jay" // line 2145 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 245: case 245:
// line 2151 "./../src/mycompiler/myparser/JavaParser.jay" // line 2150 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 246: case 246:
// line 2156 "./../src/mycompiler/myparser/JavaParser.jay" // line 2155 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 248: case 248:
// line 2162 "./../src/mycompiler/myparser/JavaParser.jay" // line 2161 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Literal)yyVals[0+yyTop]); yyVal=((Literal)yyVals[0+yyTop]);
} }
break; break;
case 249: case 249:
// line 2166 "./../src/mycompiler/myparser/JavaParser.jay" // line 2165 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
This T = new This(((Token)yyVals[0+yyTop]).getOffset(),((Token)yyVals[0+yyTop]).getLexem().length()); This T = new This(((Token)yyVals[0+yyTop]).getOffset(),((Token)yyVals[0+yyTop]).getLexem().length());
UsedId UT = new UsedId(((Token)yyVals[0+yyTop]).getOffset()); UsedId UT = new UsedId(((Token)yyVals[0+yyTop]).getOffset());
@ -2876,23 +2876,23 @@ case 249:
} }
break; break;
case 250: case 250:
// line 2187 "./../src/mycompiler/myparser/JavaParser.jay" // line 2186 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((MethodCall)yyVals[0+yyTop]); yyVal=((MethodCall)yyVals[0+yyTop]);
} }
break; break;
case 251: case 251:
// line 2191 "./../src/mycompiler/myparser/JavaParser.jay" // line 2190 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 252: case 252:
// line 2196 "./../src/mycompiler/myparser/JavaParser.jay" // line 2195 "./../src/mycompiler/myparser/JavaParser.jay"
{yyVal=((Expr)yyVals[0+yyTop]);} {yyVal=((Expr)yyVals[0+yyTop]);}
break; break;
case 253: case 253:
// line 2198 "./../src/mycompiler/myparser/JavaParser.jay" // line 2197 "./../src/mycompiler/myparser/JavaParser.jay"
{NotExpr NE=new NotExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); {NotExpr NE=new NotExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength());
UnaryNot UN=new UnaryNot(); UnaryNot UN=new UnaryNot();
NE.set_UnaryNot(UN); NE.set_UnaryNot(UN);
@ -2901,36 +2901,36 @@ case 253:
} }
break; break;
case 254: case 254:
// line 2204 "./../src/mycompiler/myparser/JavaParser.jay" // line 2203 "./../src/mycompiler/myparser/JavaParser.jay"
{yyVal=((CastExpr)yyVals[0+yyTop]);} {yyVal=((CastExpr)yyVals[0+yyTop]);}
break; break;
case 255: case 255:
// line 2206 "./../src/mycompiler/myparser/JavaParser.jay" // line 2205 "./../src/mycompiler/myparser/JavaParser.jay"
{yyVal=((Expr)yyVals[0+yyTop]);} {yyVal=((Expr)yyVals[0+yyTop]);}
break; break;
case 257: case 257:
// line 2211 "./../src/mycompiler/myparser/JavaParser.jay" // line 2210 "./../src/mycompiler/myparser/JavaParser.jay"
{IntLiteral IL = new IntLiteral(); {IntLiteral IL = new IntLiteral();
IL.set_Int(((Token)yyVals[0+yyTop]).String2Int()); IL.set_Int(((Token)yyVals[0+yyTop]).String2Int());
yyVal = IL; yyVal = IL;
} }
break; break;
case 258: case 258:
// line 2216 "./../src/mycompiler/myparser/JavaParser.jay" // line 2215 "./../src/mycompiler/myparser/JavaParser.jay"
{BoolLiteral BL = new BoolLiteral(); {BoolLiteral BL = new BoolLiteral();
BL.set_Bool(((Token)yyVals[0+yyTop]).String2Bool()); BL.set_Bool(((Token)yyVals[0+yyTop]).String2Bool());
yyVal = BL; yyVal = BL;
} }
break; break;
case 259: case 259:
// line 2220 "./../src/mycompiler/myparser/JavaParser.jay" // line 2219 "./../src/mycompiler/myparser/JavaParser.jay"
{CharLiteral CL = new CharLiteral(); {CharLiteral CL = new CharLiteral();
CL.set_Char(((Token)yyVals[0+yyTop]).CharInString()); CL.set_Char(((Token)yyVals[0+yyTop]).CharInString());
yyVal=CL; yyVal=CL;
} }
break; break;
case 260: case 260:
// line 2225 "./../src/mycompiler/myparser/JavaParser.jay" // line 2224 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
StringLiteral ST = new StringLiteral(); StringLiteral ST = new StringLiteral();
ST.set_String(((Token)yyVals[0+yyTop]).get_String()); ST.set_String(((Token)yyVals[0+yyTop]).get_String());
@ -2938,14 +2938,14 @@ case 260:
} }
break; break;
case 261: case 261:
// line 2230 "./../src/mycompiler/myparser/JavaParser.jay" // line 2229 "./../src/mycompiler/myparser/JavaParser.jay"
{ LongLiteral LL = new LongLiteral(); { LongLiteral LL = new LongLiteral();
LL.set_Long(((Token)yyVals[0+yyTop]).String2Long()); LL.set_Long(((Token)yyVals[0+yyTop]).String2Long());
yyVal = LL; yyVal = LL;
} }
break; break;
case 262: case 262:
// line 2234 "./../src/mycompiler/myparser/JavaParser.jay" // line 2233 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
FloatLiteral FL = new FloatLiteral(); FloatLiteral FL = new FloatLiteral();
FL.set_Float(((Token)yyVals[0+yyTop]).String2Float()); FL.set_Float(((Token)yyVals[0+yyTop]).String2Float());
@ -2953,7 +2953,7 @@ case 262:
} }
break; break;
case 263: case 263:
// line 2239 "./../src/mycompiler/myparser/JavaParser.jay" // line 2238 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
DoubleLiteral DL = new DoubleLiteral(); DoubleLiteral DL = new DoubleLiteral();
DL.set_Double(((Token)yyVals[0+yyTop]).String2Double()); DL.set_Double(((Token)yyVals[0+yyTop]).String2Double());
@ -2961,14 +2961,14 @@ case 263:
} }
break; break;
case 264: case 264:
// line 2245 "./../src/mycompiler/myparser/JavaParser.jay" // line 2244 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Null NN = new Null(); Null NN = new Null();
yyVal=NN; yyVal=NN;
} }
break; break;
case 265: case 265:
// line 2251 "./../src/mycompiler/myparser/JavaParser.jay" // line 2250 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
CastExpr CaEx=new CastExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); CastExpr CaEx=new CastExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength());
CaEx.set_Type(((BaseType)yyVals[-2+yyTop])); CaEx.set_Type(((BaseType)yyVals[-2+yyTop]));
@ -2977,24 +2977,24 @@ case 265:
} }
break; break;
case 266: case 266:
// line 2260 "./../src/mycompiler/myparser/JavaParser.jay" // line 2259 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 267: case 267:
// line 2264 "./../src/mycompiler/myparser/JavaParser.jay" // line 2263 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
} }
break; break;
case 268: case 268:
// line 2268 "./../src/mycompiler/myparser/JavaParser.jay" // line 2267 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 269: case 269:
// line 2272 "./../src/mycompiler/myparser/JavaParser.jay" // line 2271 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Binary EQ = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); 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()); EqualOp EO = new EqualOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
@ -3006,7 +3006,7 @@ case 269:
} }
break; break;
case 270: case 270:
// line 2282 "./../src/mycompiler/myparser/JavaParser.jay" // line 2281 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Binary NEQ = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); 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()); NotEqualOp NEO = new NotEqualOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
@ -3018,13 +3018,13 @@ case 270:
} }
break; break;
case 271: case 271:
// line 2293 "./../src/mycompiler/myparser/JavaParser.jay" // line 2292 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 272: case 272:
// line 2297 "./../src/mycompiler/myparser/JavaParser.jay" // line 2296 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Binary LO = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); 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()); LessOp LOO = new LessOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
@ -3036,7 +3036,7 @@ case 272:
} }
break; break;
case 273: case 273:
// line 2307 "./../src/mycompiler/myparser/JavaParser.jay" // line 2306 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Binary GO = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); 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()); GreaterOp GOO = new GreaterOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
@ -3048,7 +3048,7 @@ case 273:
} }
break; break;
case 274: case 274:
// line 2317 "./../src/mycompiler/myparser/JavaParser.jay" // line 2316 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Binary LE = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); 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()); LessEquOp LEO = new LessEquOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
@ -3060,7 +3060,7 @@ case 274:
} }
break; break;
case 275: case 275:
// line 2327 "./../src/mycompiler/myparser/JavaParser.jay" // line 2326 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Binary GE = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); 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()); GreaterEquOp GEO = new GreaterEquOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
@ -3072,7 +3072,7 @@ case 275:
} }
break; break;
case 276: case 276:
// line 2337 "./../src/mycompiler/myparser/JavaParser.jay" // line 2336 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
InstanceOf ISO=new InstanceOf(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); InstanceOf ISO=new InstanceOf(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
ISO.set_Expr(((Expr)yyVals[-2+yyTop])); ISO.set_Expr(((Expr)yyVals[-2+yyTop]));
@ -3081,19 +3081,19 @@ case 276:
} }
break; break;
case 277: case 277:
// line 2345 "./../src/mycompiler/myparser/JavaParser.jay" // line 2344 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 278: case 278:
// line 2350 "./../src/mycompiler/myparser/JavaParser.jay" // line 2349 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 279: case 279:
// line 2354 "./../src/mycompiler/myparser/JavaParser.jay" // line 2353 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Binary AD = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); 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()); PlusOp PO = new PlusOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
@ -3105,7 +3105,7 @@ case 279:
} }
break; break;
case 280: case 280:
// line 2364 "./../src/mycompiler/myparser/JavaParser.jay" // line 2363 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Binary MI = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); 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()); MinusOp MO = new MinusOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
@ -3117,13 +3117,13 @@ case 280:
} }
break; break;
case 281: case 281:
// line 2375 "./../src/mycompiler/myparser/JavaParser.jay" // line 2374 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
yyVal=((Expr)yyVals[0+yyTop]); yyVal=((Expr)yyVals[0+yyTop]);
} }
break; break;
case 282: case 282:
// line 2379 "./../src/mycompiler/myparser/JavaParser.jay" // line 2378 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Binary ML = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); 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()); TimesOp TO = new TimesOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
@ -3135,7 +3135,7 @@ case 282:
} }
break; break;
case 283: case 283:
// line 2389 "./../src/mycompiler/myparser/JavaParser.jay" // line 2388 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Binary DV = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); 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()); DivideOp DO = new DivideOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());
@ -3147,7 +3147,7 @@ case 283:
} }
break; break;
case 284: case 284:
// line 2399 "./../src/mycompiler/myparser/JavaParser.jay" // line 2398 "./../src/mycompiler/myparser/JavaParser.jay"
{ {
Binary MD = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); 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()); ModuloOp MO = new ModuloOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength());

View File

@ -1330,7 +1330,6 @@ primitivetype :BOOLEAN
$$=$1; $$=$1;
} }
referencetype :classorinterfacetype referencetype :classorinterfacetype
{ {
org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->referenctype: " + $1); org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->referenctype: " + $1);

View File

@ -26,6 +26,7 @@ import mycompiler.myexception.JVMCodeException;
import mycompiler.myexception.SCStatementException; import mycompiler.myexception.SCStatementException;
import mycompiler.mytype.DoubleType; import mycompiler.mytype.DoubleType;
import mycompiler.mytype.GenericTypeVar; import mycompiler.mytype.GenericTypeVar;
import mycompiler.mytype.RefType;
import mycompiler.mytype.Type; import mycompiler.mytype.Type;
import mycompiler.mytype.TypePlaceholder; import mycompiler.mytype.TypePlaceholder;
import mycompiler.mytypereconstruction.CSupportData; import mycompiler.mytypereconstruction.CSupportData;
@ -85,7 +86,10 @@ public class LambdaExpression extends Expr{
Block block = this.method_body; Block block = this.method_body;
// Zuerst Returntype untersuchen // Zuerst Returntype untersuchen
Type returnType=getType(); Type returnType=getType();
GenericTypeVar pendantReturnType=ClassHelper.findGenericType(returnType, paralist,genericMethodParameters); Type pendantReturnType = null;
if(returnType instanceof RefType)
pendantReturnType = ((RefType)returnType).findGenericType(paralist, new Vector<GenericTypeVar>());
//GenericTypeVar pendantReturnType=ClassHelper.findGenericType(returnType, paralist,genericMethodParameters);
if(pendantReturnType!=null){ //Wenn generisch, dann modifizieren if(pendantReturnType!=null){ //Wenn generisch, dann modifizieren
setType(pendantReturnType); setType(pendantReturnType);
} }
@ -94,7 +98,10 @@ public class LambdaExpression extends Expr{
for(FormalParameter fp : params){ for(FormalParameter fp : params){
Type fpType=fp.getType(); Type fpType=fp.getType();
// Nur wenn es sich um ein RefType-Field handelt // Nur wenn es sich um ein RefType-Field handelt
GenericTypeVar pendantPara=ClassHelper.findGenericType(fpType,paralist,genericMethodParameters); Type pendantPara = null;
if(fpType instanceof RefType)
pendantPara = ((RefType)fpType).findGenericType(paralist, new Vector<GenericTypeVar>());
//GenericTypeVar pendantPara=ClassHelper.findGenericType(fpType,paralist,genericMethodParameters);
if(pendantPara!=null){ //Wenn generisch, dann modifizieren if(pendantPara!=null){ //Wenn generisch, dann modifizieren
fp.setType(pendantPara); fp.setType(pendantPara);
} }

View File

@ -427,7 +427,10 @@ public class LocalVarDecl extends Statement implements TypeInsertable
Type fpType=getType(); Type fpType=getType();
// Nur wenn es sich um ein RefType-Field handelt // Nur wenn es sich um ein RefType-Field handelt
GenericTypeVar pendantPara=ClassHelper.findGenericType(fpType,paralist,genericMethodParameters); Type pendantPara = null;
if(fpType instanceof RefType)
pendantPara = ((RefType)fpType).findGenericType(paralist, new Vector<GenericTypeVar>());
//GenericTypeVar pendantPara=ClassHelper.findGenericType(fpType,paralist,genericMethodParameters);
if(pendantPara!=null){ //Wenn generisch, dann modifizieren if(pendantPara!=null){ //Wenn generisch, dann modifizieren
setType(pendantPara); setType(pendantPara);
} }

View File

@ -18,6 +18,7 @@ import org.apache.log4j.Logger;
// ino.end // ino.end
import sun.reflect.generics.reflectiveObjects.NotImplementedException; import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import typinferenz.JavaCodeResult; import typinferenz.JavaCodeResult;
import typinferenz.ResultSet; import typinferenz.ResultSet;
@ -209,6 +210,41 @@ public class RefType extends Type implements IMatchable
this.set_ParaList(paralist); this.set_ParaList(paralist);
} }
/**
* HOTI
* Diese Methode sucht in der Klassendefinition nach einen GTV, die
* so heißt wie die im RefType definierte Variable. Wenn sie diese gefunden
* hat, wird sie zurückgeben. Wenn dies nicht der Fall war, schaut sie, falls
* angegeben in den Methodenparametern nach. Findet sie dort auch nichts, liefert
* die Methode <b>null</b>.
* @param type
* @return
*/
public GenericTypeVar findGenericType(Vector<Type> paralist, Vector<GenericTypeVar> methodParaList)
{
for(int i=0;i<paralist.size();i++){
if(paralist.get(i) instanceof GenericTypeVar){
GenericTypeVar gtv=(GenericTypeVar)paralist.get(i);
if(gtv.getName().equals(this.getName())){
return gtv;
}
}
}
if(methodParaList!=null){
for(int i=0;i<methodParaList.size();i++){
GenericTypeVar gtv=methodParaList.elementAt(i);
if(gtv.getName().equals(this.getName())){
return gtv;
}
}
}
//Auch die Parameterliste nach GenericTypeVars durchsuchen:
if(this.get_ParaList() != null)for(Type t : this.get_ParaList()){
if(t instanceof RefType)((RefType)t).findGenericType(paralist, methodParaList);
}
return(null);
}
// ino.method.setName.26655.definition // ino.method.setName.26655.definition
public void setName( String name ) public void setName( String name )
// ino.end // ino.end

View File

@ -2,6 +2,7 @@ package typinferenz;
import java.util.Vector; import java.util.Vector;
import typinferenz.assumptions.ClassAssumption;
import typinferenz.assumptions.MethodAssumption; import typinferenz.assumptions.MethodAssumption;
import typinferenz.assumptions.TypeAssumptions; import typinferenz.assumptions.TypeAssumptions;
import mycompiler.mytype.*; import mycompiler.mytype.*;
@ -40,6 +41,7 @@ public class FunNInterface extends Class{
//return super.getPublicFieldAssumptions(); //return super.getPublicFieldAssumptions();
TypeAssumptions ret = new TypeAssumptions(); TypeAssumptions ret = new TypeAssumptions();
ret.addAssumption(new MethodAssumption(this.getApplyFunction(), this)); ret.addAssumption(new MethodAssumption(this.getApplyFunction(), this));
ret.addClassAssumption(new ClassAssumption(this));
return ret; return ret;
} }

View File

@ -25,4 +25,11 @@ public class ClassAssumption{
public String toString(){ public String toString(){
return this.classType.getName(); return this.classType.getName();
} }
public boolean equals(Object obj){
if(!(obj instanceof ClassAssumption))return false;
ClassAssumption equals = (ClassAssumption)obj;
if(!equals.classType.equals(this.classType))return false;
return true;
}
} }

View File

@ -10,5 +10,12 @@ public class ConstructorAssumption extends MethodAssumption{
super(assumedMethod, parentClass); super(assumedMethod, parentClass);
} }
@Override
public boolean equals(Object obj) {
if(!(obj instanceof ConstructorAssumption))return false;
return super.equals(obj);
}
} }

View File

@ -28,5 +28,14 @@ public class FieldAssumption extends Assumption {
return "FieldAssumption: "+this.field.getType()+" "+this.getIdentifier(); return "FieldAssumption: "+this.field.getType()+" "+this.getIdentifier();
} }
@Override
public boolean equals(Object obj) {
if(!(obj instanceof FieldAssumption))return false;
FieldAssumption equals = (FieldAssumption)obj;
if(!equals.field.equals(this.field))return false;
if(!equals.parentClass.equals(this.parentClass))return false;
return true;
}
} }

View File

@ -16,4 +16,5 @@ public class LocalVarAssumption extends Assumption {
public Type getAssumedType() { public Type getAssumedType() {
return this.localVar.getType(); return this.localVar.getType();
} }
} }

View File

@ -214,11 +214,18 @@ public class TypeAssumptions {
} }
public void addAssumption(Assumption ass){ public void addAssumption(Assumption ass){
if(ass instanceof MethodAssumption)this.methodAssumptions.add((MethodAssumption)ass);//if(!this.methodAssumptions.contains(ass))this.methodAssumptions.add((MethodAssumption)ass); if(ass instanceof ConstructorAssumption){
if(ass instanceof FieldAssumption)this.fieldAssumptions.add((FieldAssumption)ass);//if(!this.fieldAssumptions.contains(ass))this.fieldAssumptions.add((FieldAssumption)ass); if(!this.constructorAssumptions.contains(ass))this.constructorAssumptions.add((ConstructorAssumption)ass);//this.constructorAssumptions.add((ConstructorAssumption)ass);
if(ass instanceof LocalVarAssumption)this.localVarAssumptions.add((LocalVarAssumption)ass);//if(!this.localVarAssumptions.contains(ass))this.localVarAssumptions.add((LocalVarAssumption)ass); return;
}
if(ass instanceof MethodAssumption){
if(!this.methodAssumptions.contains(ass))this.methodAssumptions.add((MethodAssumption)ass);//this.methodAssumptions.add((MethodAssumption)ass);//
return;
}
if(ass instanceof LocalVarAssumption)if(!this.localVarAssumptions.contains(ass))this.localVarAssumptions.add((LocalVarAssumption)ass);//this.localVarAssumptions.add((LocalVarAssumption)ass);//
if(ass instanceof ParameterAssumption)if(!this.parameterAssumptions.contains(ass))this.parameterAssumptions.add((ParameterAssumption)ass);//this.parameterAssumptions.add((ParameterAssumption)ass); if(ass instanceof ParameterAssumption)if(!this.parameterAssumptions.contains(ass))this.parameterAssumptions.add((ParameterAssumption)ass);//this.parameterAssumptions.add((ParameterAssumption)ass);
if(ass instanceof ConstructorAssumption)if(!this.constructorAssumptions.contains(ass))this.constructorAssumptions.add((ConstructorAssumption)ass);//this.constructorAssumptions.add((ConstructorAssumption)ass); if(ass instanceof FieldAssumption)if(!this.fieldAssumptions.contains(ass))this.fieldAssumptions.add((FieldAssumption)ass);//this.fieldAssumptions.add((FieldAssumption)ass);
} }
private void addAllAssumptions(Vector<Assumption> assumptions){ private void addAllAssumptions(Vector<Assumption> assumptions){
@ -309,6 +316,7 @@ public class TypeAssumptions {
* @param classAssumption * @param classAssumption
*/ */
public void addClassAssumption(ClassAssumption classAssumption) { public void addClassAssumption(ClassAssumption classAssumption) {
if(!this.classAssumptions.contains(classAssumption))//throw new TypinferenzException("Die Klasse "+classAssumption.getAssumedClass().getName()+" wurde bereits deklariert");
this.classAssumptions.add(classAssumption); this.classAssumptions.add(classAssumption);
} }

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
class VariableTypeInsertTest{ class VariableTypeInsertTest{
String var; String var;
void methode(String test){ void methode(java.lang.String test){
var = test; var = test;
} }
} }

View File

@ -9,10 +9,10 @@ class FunNInsertTest{
var3 = c; var3 = c;
}; };
o2p = () -> (a, b, c) -> {
var1 = a;
var2 = b;
var3 = c;
};
} }
class Object1{}
class Object2{}
class Object3{}

View File

@ -1,5 +1,5 @@
class LambdaTest{ class LambdaTest<R,S>{
Fun1<Fun1<K, Fun2<LambdaTest, C>>, C> op = (m) -> (f) -> f.apply(this,m); Fun1<Fun1<R, Fun2<R, LambdaTest<R,S>, S>>, S> op = (m) -> (f) -> f.apply(this,m);
} }

View File

@ -11,7 +11,7 @@ public class LambdaTest2 {
@Test @Test
public void run(){ public void run(){
Vector<String> mustContain = new Vector<String>(); Vector<String> mustContain = new Vector<String>();
mustContain.add("C m"); mustContain.add("S m");
MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); MultipleTypesInsertTester.test(this.TEST_FILE, mustContain);
} }

View File

@ -0,0 +1,5 @@
class LambdaTest<A>{
Fun1<A, A> op = (var) -> {return var;};
}

View File

@ -0,0 +1,18 @@
package plugindevelopment.TypeInsertTests;
import java.util.Vector;
import org.junit.Test;
public class LambdaTest5 {
private static final String TEST_FILE = "LambdaTest5.jav";
@Test
public void run(){
Vector<String> mustContain = new Vector<String>();
mustContain.add("A var");
MultipleTypesInsertTester.test(this.TEST_FILE, mustContain);
}
}