From 6858092ef1c4b5926f936fc60c5882e5be7e1c5b Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Mon, 8 Sep 2014 15:12:47 +0200 Subject: [PATCH] =?UTF-8?q?Einf=C3=BChrung=20von=20ConstraintType?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/de/dhbwstuttgart/core/MyCompiler.java | 2 +- src/de/dhbwstuttgart/parser/JavaLexer.lex | 2 +- src/de/dhbwstuttgart/parser/JavaParser.java | 691 ++++++++---------- src/de/dhbwstuttgart/parser/JavaParser.jay | 114 +-- src/de/dhbwstuttgart/syntaxtree/Class.java | 1 - .../syntaxtree/FieldDeclaration.java | 7 +- src/de/dhbwstuttgart/syntaxtree/Method.java | 6 +- .../dhbwstuttgart/syntaxtree/SourceFile.java | 18 +- .../syntaxtree/SyntaxTreeNode.java | 5 +- .../dhbwstuttgart/syntaxtree/misc/UsedId.java | 2 +- .../syntaxtree/operator/AddOp.java | 7 +- .../syntaxtree/operator/AndOp.java | 3 + .../syntaxtree/operator/DivideOp.java | 3 +- .../syntaxtree/operator/EqualOp.java | 5 +- .../syntaxtree/operator/GreaterEquOp.java | 1 + .../syntaxtree/operator/LogOp.java | 7 +- .../syntaxtree/operator/MulOp.java | 7 +- .../syntaxtree/operator/NotEqualOp.java | 2 +- .../syntaxtree/operator/Operator.java | 13 +- .../syntaxtree/operator/RelOp.java | 7 +- .../syntaxtree/statement/Assign.java | 6 +- .../syntaxtree/statement/Binary.java | 15 +- .../syntaxtree/statement/Block.java | 7 +- .../syntaxtree/statement/BoolLiteral.java | 4 +- .../syntaxtree/statement/DoubleLiteral.java | 2 +- .../syntaxtree/statement/ExprStmt.java | 3 +- .../syntaxtree/statement/ForStmt.java | 3 +- .../syntaxtree/statement/IfStmt.java | 9 +- .../syntaxtree/statement/InstVar.java | 7 +- .../syntaxtree/statement/IntLiteral.java | 2 +- .../statement/LambdaExpression.java | 2 +- .../syntaxtree/statement/LocalVarDecl.java | 6 +- .../syntaxtree/statement/NegativeExpr.java | 4 +- .../syntaxtree/statement/NewClass.java | 4 +- .../syntaxtree/statement/NotExpr.java | 5 +- .../syntaxtree/statement/PostDecExpr.java | 4 +- .../syntaxtree/statement/PostIncExpr.java | 3 +- .../syntaxtree/statement/PreDecExpr.java | 3 +- .../syntaxtree/statement/PreIncExpr.java | 3 +- .../syntaxtree/statement/Return.java | 2 +- .../syntaxtree/statement/Statement.java | 2 +- .../syntaxtree/statement/StringLiteral.java | 3 +- .../syntaxtree/statement/UnaryExpr.java | 4 +- .../syntaxtree/statement/WhileStmt.java | 6 +- .../syntaxtree/type/BaseType.java | 6 +- .../type/BoundedGenericTypeVar.java | 5 +- .../syntaxtree/type/GenericTypeVar.java | 5 + .../syntaxtree/type/RefType.java | 15 +- .../dhbwstuttgart/syntaxtree/type/Type.java | 16 +- .../dhbwstuttgart/syntaxtree/type/Void.java | 6 +- .../typeinference/ConstraintPair.java | 15 + .../typeinference/ConstraintType.java | 22 + .../typeinference/ConstraintsSet.java | 2 - .../typeinference/FunNInterface.java | 18 +- .../typeinference/OderConstraint.java | 13 +- .../typeinference/Overloading.java | 9 +- .../type => typeinference}/Pair.java | 9 +- .../typeinference/ResultSet.java | 1 - .../typeinference/SingleConstraint.java | 23 +- .../typeinference/TypeinferenceResultSet.java | 1 - .../typeinference/UndConstraint.java | 3 +- .../assumptions/TypeAssumptions.java | 13 +- .../exceptions/TypeinferenceException.java | 3 +- .../GenericTypeInsertPoint.java | 2 +- .../typedeployment/TypeInsertSet.java | 2 +- .../typeinference/unify/CSubstitution.java | 3 +- .../typeinference/unify/CSubstitutionSet.java | 2 +- .../typeinference/unify/FC_TTO.java | 6 +- .../typeinference/unify/MUB.java | 2 +- .../typeinference/unify/Unify.java | 4 +- .../typeReconstructionTest/TrMakeFCTest.java | 2 +- .../TrSubUnifyTest.java | 4 +- .../typeReconstructionTest/TrUnifyTest.java | 4 +- test/plugindevelopment/TRMEqualTest.java | 4 +- test/plugindevelopment/TypeInsertTester.java | 1 - .../TypeInsertTests/OverloadingInMethod.jav | 10 + .../TypeInsertTests/OverloadingInMethod.java | 19 + tools/AntParserBuilderWindows.xml | 2 +- tools/RunJay.sh | 2 +- 79 files changed, 628 insertions(+), 638 deletions(-) create mode 100644 src/de/dhbwstuttgart/typeinference/ConstraintPair.java create mode 100644 src/de/dhbwstuttgart/typeinference/ConstraintType.java rename src/de/dhbwstuttgart/{syntaxtree/type => typeinference}/Pair.java (96%) create mode 100644 test/plugindevelopment/TypeInsertTests/OverloadingInMethod.jav create mode 100644 test/plugindevelopment/TypeInsertTests/OverloadingInMethod.java diff --git a/src/de/dhbwstuttgart/core/MyCompiler.java b/src/de/dhbwstuttgart/core/MyCompiler.java index 2eb043b03..dd384b93e 100755 --- a/src/de/dhbwstuttgart/core/MyCompiler.java +++ b/src/de/dhbwstuttgart/core/MyCompiler.java @@ -37,11 +37,11 @@ import de.dhbwstuttgart.syntaxtree.misc.UsedId; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; import de.dhbwstuttgart.syntaxtree.type.IMatchable; import de.dhbwstuttgart.syntaxtree.type.ITypeContainer; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; import de.dhbwstuttgart.typeinference.FunNInterface; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; diff --git a/src/de/dhbwstuttgart/parser/JavaLexer.lex b/src/de/dhbwstuttgart/parser/JavaLexer.lex index cae5b2ce4..60f3806ed 100755 --- a/src/de/dhbwstuttgart/parser/JavaLexer.lex +++ b/src/de/dhbwstuttgart/parser/JavaLexer.lex @@ -7,7 +7,7 @@ ********************************************/ // user code: -package mycompiler.myparser; +package de.dhbwstuttgart.parser; %% diff --git a/src/de/dhbwstuttgart/parser/JavaParser.java b/src/de/dhbwstuttgart/parser/JavaParser.java index 188af6022..82e4457c3 100644 --- a/src/de/dhbwstuttgart/parser/JavaParser.java +++ b/src/de/dhbwstuttgart/parser/JavaParser.java @@ -1,6 +1,6 @@ // created by jay 0.7 (c) 1998 Axel.Schreiner@informatik.uni-osnabrueck.de - // line 2 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" /* Backup von JavaParser.jay 10.April 17 Uhr @@ -8,104 +8,23 @@ Backup von JavaParser.jay 10.April 17 Uhr package de.dhbwstuttgart.parser; -import java.util.Vector; - import de.dhbwstuttgart.core.AClassOrInterface; import de.dhbwstuttgart.syntaxtree.Class; -import de.dhbwstuttgart.syntaxtree.ClassBody; -import de.dhbwstuttgart.syntaxtree.Constant; -import de.dhbwstuttgart.syntaxtree.Constructor; -import de.dhbwstuttgart.syntaxtree.ExceptionList; -import de.dhbwstuttgart.syntaxtree.Field; -import de.dhbwstuttgart.syntaxtree.FieldDeclaration; -import de.dhbwstuttgart.syntaxtree.FormalParameter; -import de.dhbwstuttgart.syntaxtree.GenericDeclarationList; import de.dhbwstuttgart.syntaxtree.ImportDeclarations; import de.dhbwstuttgart.syntaxtree.Interface; -import de.dhbwstuttgart.syntaxtree.InterfaceBody; -import de.dhbwstuttgart.syntaxtree.Method; -import de.dhbwstuttgart.syntaxtree.ParameterList; import de.dhbwstuttgart.syntaxtree.SourceFile; -import de.dhbwstuttgart.syntaxtree.misc.DeclId; import de.dhbwstuttgart.syntaxtree.misc.UsedId; -import de.dhbwstuttgart.syntaxtree.modifier.Abstract; -import de.dhbwstuttgart.syntaxtree.modifier.Final; -import de.dhbwstuttgart.syntaxtree.modifier.Modifier; -import de.dhbwstuttgart.syntaxtree.modifier.Modifiers; -import de.dhbwstuttgart.syntaxtree.modifier.Private; -import de.dhbwstuttgart.syntaxtree.modifier.Protected; -import de.dhbwstuttgart.syntaxtree.modifier.Public; -import de.dhbwstuttgart.syntaxtree.modifier.Static; -import de.dhbwstuttgart.syntaxtree.operator.AndOp; -import de.dhbwstuttgart.syntaxtree.operator.DivideOp; -import de.dhbwstuttgart.syntaxtree.operator.EqualOp; -import de.dhbwstuttgart.syntaxtree.operator.GreaterEquOp; -import de.dhbwstuttgart.syntaxtree.operator.GreaterOp; -import de.dhbwstuttgart.syntaxtree.operator.LessEquOp; -import de.dhbwstuttgart.syntaxtree.operator.LessOp; -import de.dhbwstuttgart.syntaxtree.operator.MinusOp; -import de.dhbwstuttgart.syntaxtree.operator.ModuloOp; -import de.dhbwstuttgart.syntaxtree.operator.NotEqualOp; -import de.dhbwstuttgart.syntaxtree.operator.Operator; -import de.dhbwstuttgart.syntaxtree.operator.OrOp; -import de.dhbwstuttgart.syntaxtree.operator.PlusOp; -import de.dhbwstuttgart.syntaxtree.operator.TimesOp; -import de.dhbwstuttgart.syntaxtree.statement.ArgumentList; -import de.dhbwstuttgart.syntaxtree.statement.Assign; -import de.dhbwstuttgart.syntaxtree.statement.Binary; -import de.dhbwstuttgart.syntaxtree.statement.Block; -import de.dhbwstuttgart.syntaxtree.statement.BoolLiteral; -import de.dhbwstuttgart.syntaxtree.statement.CastExpr; -import de.dhbwstuttgart.syntaxtree.statement.CharLiteral; -import de.dhbwstuttgart.syntaxtree.statement.DoubleLiteral; -import de.dhbwstuttgart.syntaxtree.statement.EmptyStmt; -import de.dhbwstuttgart.syntaxtree.statement.Expr; -import de.dhbwstuttgart.syntaxtree.statement.ExprStmt; -import de.dhbwstuttgart.syntaxtree.statement.FloatLiteral; -import de.dhbwstuttgart.syntaxtree.statement.ForStmt; -import de.dhbwstuttgart.syntaxtree.statement.IfStmt; -import de.dhbwstuttgart.syntaxtree.statement.InstVar; -import de.dhbwstuttgart.syntaxtree.statement.InstanceOf; -import de.dhbwstuttgart.syntaxtree.statement.IntLiteral; -import de.dhbwstuttgart.syntaxtree.statement.LambdaExpression; -import de.dhbwstuttgart.syntaxtree.statement.Literal; -import de.dhbwstuttgart.syntaxtree.statement.LocalOrFieldVar; -import de.dhbwstuttgart.syntaxtree.statement.LocalVarDecl; -import de.dhbwstuttgart.syntaxtree.statement.LongLiteral; -import de.dhbwstuttgart.syntaxtree.statement.MethodCall; -import de.dhbwstuttgart.syntaxtree.statement.NegativeExpr; -import de.dhbwstuttgart.syntaxtree.statement.NewClass; -import de.dhbwstuttgart.syntaxtree.statement.NotExpr; -import de.dhbwstuttgart.syntaxtree.statement.Null; -import de.dhbwstuttgart.syntaxtree.statement.PositivExpr; -import de.dhbwstuttgart.syntaxtree.statement.PostDecExpr; -import de.dhbwstuttgart.syntaxtree.statement.PostIncExpr; -import de.dhbwstuttgart.syntaxtree.statement.PreDecExpr; -import de.dhbwstuttgart.syntaxtree.statement.PreIncExpr; -import de.dhbwstuttgart.syntaxtree.statement.Receiver; -import de.dhbwstuttgart.syntaxtree.statement.Return; -import de.dhbwstuttgart.syntaxtree.statement.Statement; -import de.dhbwstuttgart.syntaxtree.statement.StringLiteral; -import de.dhbwstuttgart.syntaxtree.statement.This; -import de.dhbwstuttgart.syntaxtree.statement.UnaryMinus; -import de.dhbwstuttgart.syntaxtree.statement.UnaryNot; -import de.dhbwstuttgart.syntaxtree.statement.UnaryPlus; -import de.dhbwstuttgart.syntaxtree.statement.WhileStmt; -import de.dhbwstuttgart.syntaxtree.type.BaseType; -import de.dhbwstuttgart.syntaxtree.type.BooleanType; -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.CharacterType; -import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.IntegerType; -import de.dhbwstuttgart.syntaxtree.type.Pair; -import de.dhbwstuttgart.syntaxtree.type.ParaList; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.syntaxtree.type.Type; -import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; import de.dhbwstuttgart.syntaxtree.type.Void; -import de.dhbwstuttgart.syntaxtree.type.WildcardType; +import de.dhbwstuttgart.*; +import de.dhbwstuttgart.syntaxtree.*; +import de.dhbwstuttgart.syntaxtree.misc.*; +import de.dhbwstuttgart.syntaxtree.modifier.*; +import de.dhbwstuttgart.syntaxtree.operator.*; +import de.dhbwstuttgart.syntaxtree.type.*; +import de.dhbwstuttgart.syntaxtree.statement.*; +import java.util.Vector; public class JavaParser{ public Vector path = new Vector(); @@ -129,7 +48,7 @@ void initUsedIdsToCheck() { //LUAR 07-05-29 Anfang für Wildcard Test public Vector testPair = new Vector(); //LUAR 07-05-29 Ende - // line 132 "-" + // line 52 "-" // %token constants //{ //ergaenzt PL 23.01.01 wieder entfernt 21.12.01 public static final int ABSTRACT = 257; @@ -763,20 +682,20 @@ public Vector testPair = new Vector(); yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]); switch (yyN) { case 1: - // line 327 "./../src/mycompiler/myparser/JavaParser.jay" + // line 247 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((SourceFile)yyVals[0+yyTop]); } break; case 2: - // line 331 "./../src/mycompiler/myparser/JavaParser.jay" + // line 251 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((SourceFile)yyVals[0+yyTop]).addImports(((ImportDeclarations)yyVals[-1+yyTop])); yyVal=((SourceFile)yyVals[0+yyTop]); } break; case 3: - // line 336 "./../src/mycompiler/myparser/JavaParser.jay" + // line 256 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Package*/ ((SourceFile)yyVals[0+yyTop]).setPackageName(((UsedId)yyVals[-2+yyTop])); @@ -785,7 +704,7 @@ case 3: } break; case 4: - // line 343 "./../src/mycompiler/myparser/JavaParser.jay" + // line 263 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Package*/ ((SourceFile)yyVals[0+yyTop]).setPackageName(((UsedId)yyVals[-1+yyTop])); @@ -793,21 +712,21 @@ case 4: } break; case 5: - // line 349 "./../src/mycompiler/myparser/JavaParser.jay" + // line 269 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { this.testPair.add(new Pair(((Type)yyVals[-2+yyTop]),((Type)yyVals[-1+yyTop]))); yyVal=((SourceFile)yyVals[0+yyTop]); } break; case 6: - // line 355 "./../src/mycompiler/myparser/JavaParser.jay" + // line 275 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Package*/ yyVal = ((UsedId)yyVals[-1+yyTop]); } break; case 7: - // line 361 "./../src/mycompiler/myparser/JavaParser.jay" + // line 281 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ImportDeclarations declarations=new ImportDeclarations(); declarations.addElement(((UsedId)yyVals[0+yyTop])); @@ -815,20 +734,20 @@ case 7: } break; case 8: - // line 367 "./../src/mycompiler/myparser/JavaParser.jay" + // line 287 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((ImportDeclarations)yyVals[-1+yyTop]).addElement(((UsedId)yyVals[0+yyTop])); yyVal=((ImportDeclarations)yyVals[-1+yyTop]); } break; case 9: - // line 373 "./../src/mycompiler/myparser/JavaParser.jay" + // line 293 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((UsedId)yyVals[-1+yyTop]); } break; case 10: - // line 378 "./../src/mycompiler/myparser/JavaParser.jay" + // line 298 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { SourceFile Scfile = new SourceFile(); Scfile.addElement(((AClassOrInterface)yyVals[0+yyTop])); @@ -836,39 +755,39 @@ case 10: } break; case 11: - // line 384 "./../src/mycompiler/myparser/JavaParser.jay" + // line 304 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((SourceFile)yyVals[-1+yyTop]).addElement(((AClassOrInterface)yyVals[0+yyTop])); yyVal=((SourceFile)yyVals[-1+yyTop]); } break; case 12: - // line 390 "./../src/mycompiler/myparser/JavaParser.jay" + // line 310 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((UsedId)yyVals[0+yyTop]); } break; case 13: - // line 394 "./../src/mycompiler/myparser/JavaParser.jay" + // line 314 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((UsedId)yyVals[0+yyTop]); } break; case 14: - // line 399 "./../src/mycompiler/myparser/JavaParser.jay" + // line 319 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Class)yyVals[0+yyTop]); } break; case 15: - // line 403 "./../src/mycompiler/myparser/JavaParser.jay" + // line 323 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Interface*/ yyVal=((Interface)yyVals[0+yyTop]); } break; case 16: - // line 410 "./../src/mycompiler/myparser/JavaParser.jay" + // line 330 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((UsedId)yyVals[-2+yyTop]).set_Name(((Token)yyVals[0+yyTop]).getLexem()); ((UsedId)yyVals[-2+yyTop]).setOffset(((UsedId)yyVals[-2+yyTop]).getOffset()); @@ -876,7 +795,7 @@ case 16: } break; case 17: - // line 417 "./../src/mycompiler/myparser/JavaParser.jay" + // line 337 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((UsedId)yyVals[-2+yyTop]).set_Name(((Token)yyVals[0+yyTop]).getLexem()); ((UsedId)yyVals[-2+yyTop]).setOffset(((UsedId)yyVals[-2+yyTop]).getOffset()); @@ -884,7 +803,7 @@ case 17: } break; case 18: - // line 423 "./../src/mycompiler/myparser/JavaParser.jay" + // line 343 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((UsedId)yyVals[-2+yyTop]).set_Name("*"); ((UsedId)yyVals[-2+yyTop]).setOffset(((UsedId)yyVals[-2+yyTop]).getOffset()); @@ -892,7 +811,7 @@ case 18: } break; case 19: - // line 431 "./../src/mycompiler/myparser/JavaParser.jay" + // line 351 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { UsedId UI = new UsedId(((Token)yyVals[0+yyTop]).getOffset()); UI.set_Name( ((Token)yyVals[0+yyTop]).getLexem() ); @@ -901,7 +820,7 @@ case 19: } break; case 20: - // line 439 "./../src/mycompiler/myparser/JavaParser.jay" + // line 359 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Um das hier uebersichtlicher zu halten,*/ /* gibt es einen allumfassenden Konstruktor fuer Class*/ @@ -920,7 +839,7 @@ case 20: } break; case 21: - // line 456 "./../src/mycompiler/myparser/JavaParser.jay" + // line 376 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = new Class(((ClassAndParameter)yyVals[-1+yyTop]).getName(), ((Modifiers)yyVals[-3+yyTop]), ((ClassBody)yyVals[0+yyTop]), containedTypes,usedIdsToCheck, null, null, ((ClassAndParameter)yyVals[-1+yyTop]).getParaVector(), ((Token)yyVals[-2+yyTop]).getOffset()); this.initContainedTypes(); @@ -928,7 +847,7 @@ case 21: } break; case 22: - // line 462 "./../src/mycompiler/myparser/JavaParser.jay" + // line 382 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = new Class(((ClassAndParameter)yyVals[-2+yyTop]).getName(), null, ((ClassBody)yyVals[0+yyTop]), containedTypes,usedIdsToCheck, ((UsedId)yyVals[-1+yyTop]), null, ((ClassAndParameter)yyVals[-2+yyTop]).getParaVector(), ((Token)yyVals[-3+yyTop]).getOffset()); this.initContainedTypes(); @@ -936,7 +855,7 @@ case 22: } break; case 23: - // line 468 "./../src/mycompiler/myparser/JavaParser.jay" + // line 388 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = new Class(((ClassAndParameter)yyVals[-2+yyTop]).getName(), ((Modifiers)yyVals[-4+yyTop]), ((ClassBody)yyVals[0+yyTop]), containedTypes, usedIdsToCheck, ((UsedId)yyVals[-1+yyTop]), null, ((ClassAndParameter)yyVals[-2+yyTop]).getParaVector(), ((Token)yyVals[-3+yyTop]).getOffset()); this.initContainedTypes(); @@ -944,7 +863,7 @@ case 23: } break; case 24: - // line 475 "./../src/mycompiler/myparser/JavaParser.jay" + // line 395 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = new Class(((ClassAndParameter)yyVals[-2+yyTop]).getName(), null, ((ClassBody)yyVals[0+yyTop]), containedTypes, usedIdsToCheck, null, ((InterfaceList)yyVals[-1+yyTop]).getVector(), ((ClassAndParameter)yyVals[-2+yyTop]).getParaVector(), ((Token)yyVals[-3+yyTop]).getOffset()); this.initContainedTypes(); @@ -952,7 +871,7 @@ case 24: } break; case 25: - // line 481 "./../src/mycompiler/myparser/JavaParser.jay" + // line 401 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = new Class(((ClassAndParameter)yyVals[-2+yyTop]).getName(), ((Modifiers)yyVals[-4+yyTop]), ((ClassBody)yyVals[0+yyTop]), containedTypes, usedIdsToCheck, null, ((InterfaceList)yyVals[-1+yyTop]).getVector(), ((ClassAndParameter)yyVals[-2+yyTop]).getParaVector(), ((Token)yyVals[-3+yyTop]).getOffset()); this.initContainedTypes(); @@ -960,7 +879,7 @@ case 25: } break; case 26: - // line 487 "./../src/mycompiler/myparser/JavaParser.jay" + // line 407 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = new Class(((ClassAndParameter)yyVals[-3+yyTop]).getName(), null, ((ClassBody)yyVals[0+yyTop]), containedTypes,usedIdsToCheck, ((UsedId)yyVals[-2+yyTop]), ((InterfaceList)yyVals[-1+yyTop]).getVector(), ((ClassAndParameter)yyVals[-3+yyTop]).getParaVector(), ((Token)yyVals[-4+yyTop]).getOffset()); this.initContainedTypes(); @@ -968,7 +887,7 @@ case 26: } break; case 27: - // line 493 "./../src/mycompiler/myparser/JavaParser.jay" + // line 413 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = new Class(((ClassAndParameter)yyVals[-3+yyTop]).getName(), ((Modifiers)yyVals[-5+yyTop]), ((ClassBody)yyVals[0+yyTop]), containedTypes, usedIdsToCheck, ((UsedId)yyVals[-2+yyTop]), ((InterfaceList)yyVals[-1+yyTop]).getVector(), ((ClassAndParameter)yyVals[-3+yyTop]).getParaVector(), ((Token)yyVals[-4+yyTop]).getOffset()); this.initContainedTypes(); @@ -976,7 +895,7 @@ case 27: } break; case 28: - // line 500 "./../src/mycompiler/myparser/JavaParser.jay" + // line 420 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* HOTI*/ /* Verbindet den Namen eines Interfaces mit einer optionalen Parameterliste*/ @@ -984,13 +903,13 @@ case 28: } break; case 29: - // line 506 "./../src/mycompiler/myparser/JavaParser.jay" + // line 426 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = new InterfaceAndParameter(((Token)yyVals[-3+yyTop]).getLexem(), ((ParaList)yyVals[-1+yyTop])); } break; case 30: - // line 511 "./../src/mycompiler/myparser/JavaParser.jay" + // line 431 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Hilfskonstrukt, um die Grammatik ueberschaubar zu halten*/ /* Verbindet den Namen einer Klasse mit einer optionalen Parameterliste*/ @@ -998,13 +917,13 @@ case 30: } break; case 31: - // line 517 "./../src/mycompiler/myparser/JavaParser.jay" + // line 437 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = new ClassAndParameter(((Token)yyVals[-3+yyTop]).getLexem(), ((ParaList)yyVals[-1+yyTop])); } break; case 32: - // line 522 "./../src/mycompiler/myparser/JavaParser.jay" + // line 442 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Interface*/ Interface ic = new Interface(((InterfaceAndParameter)yyVals[-1+yyTop]).getName(), ((Token)yyVals[-2+yyTop]).getOffset()); @@ -1016,7 +935,7 @@ case 32: } break; case 33: - // line 532 "./../src/mycompiler/myparser/JavaParser.jay" + // line 452 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Interface ic = new Interface(((InterfaceAndParameter)yyVals[-1+yyTop]).getName(), ((Modifiers)yyVals[-3+yyTop]), ((Token)yyVals[-2+yyTop]).getOffset()); ic.setInterfaceBody(((InterfaceBody)yyVals[0+yyTop])); @@ -1027,7 +946,7 @@ case 33: } break; case 34: - // line 541 "./../src/mycompiler/myparser/JavaParser.jay" + // line 461 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Interface ic = new Interface(((InterfaceAndParameter)yyVals[-2+yyTop]).getName(), ((Token)yyVals[-3+yyTop]).getOffset()); ic.setParaList(((InterfaceAndParameter)yyVals[-2+yyTop]).getParaVector()); @@ -1039,7 +958,7 @@ case 34: } break; case 35: - // line 551 "./../src/mycompiler/myparser/JavaParser.jay" + // line 471 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Interface ic = new Interface(((InterfaceAndParameter)yyVals[-2+yyTop]).getName(), ((Modifiers)yyVals[-4+yyTop]), ((Token)yyVals[-3+yyTop]).getOffset()); ic.setParaList(((InterfaceAndParameter)yyVals[-2+yyTop]).getParaVector()); @@ -1051,12 +970,12 @@ case 35: } break; case 36: - // line 562 "./../src/mycompiler/myparser/JavaParser.jay" + // line 482 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ParaList pl = new ParaList(); /* #JB# 05.04.2005 */ /* ########################################################### */ - pl.getParalist().addElement(new GenericTypeVar(((Token)yyVals[0+yyTop]).getLexem(), ((Token)yyVals[0+yyTop]).getOffset())); + pl.getParalist().addElement(new GenericTypeVar(((Token)yyVals[0+yyTop]).getLexem(),null, ((Token)yyVals[0+yyTop]).getOffset())); /*pl.getParalist().addElement( new TypePlaceholder($1.getLexem()) );*/ /* ########################################################### */ org.apache.log4j.Logger.getLogger("parser").debug( "IDENTIFIER --> Paralist f�r " + ((Token)yyVals[0+yyTop]).getLexem() + " TV"); @@ -1064,7 +983,7 @@ case 36: } break; case 37: - // line 573 "./../src/mycompiler/myparser/JavaParser.jay" + // line 493 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ParaList pl = new ParaList(); RefType t = new RefType( ((Token)yyVals[-3+yyTop]).getLexem(),((Token)yyVals[-3+yyTop]).getOffset() ); @@ -1075,7 +994,7 @@ case 37: } break; case 38: - // line 582 "./../src/mycompiler/myparser/JavaParser.jay" + // line 502 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ParaList pl = new ParaList(); pl.getParalist().addElement(((WildcardType)yyVals[0+yyTop])); @@ -1083,12 +1002,12 @@ case 38: } break; case 39: - // line 588 "./../src/mycompiler/myparser/JavaParser.jay" + // line 508 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* #JB# 05.04.2005 */ /* ########################################################### */ - ((ParaList)yyVals[-2+yyTop]).getParalist().addElement(new GenericTypeVar(((Token)yyVals[0+yyTop]).getLexem(),((Token)yyVals[0+yyTop]).getOffset())); + ((ParaList)yyVals[-2+yyTop]).getParalist().addElement(new GenericTypeVar(((Token)yyVals[0+yyTop]).getLexem(), null,((Token)yyVals[0+yyTop]).getOffset())); /*$1.getParalist().addElement(new TypePlaceholder($3.getLexem()));*/ /* ########################################################### */ org.apache.log4j.Logger.getLogger("parser").debug( "paralist ',' IDENTIFIER --> Paralist f�r " + ((Token)yyVals[0+yyTop]).getLexem() + ": TV"); @@ -1097,7 +1016,7 @@ case 39: } break; case 40: - // line 601 "./../src/mycompiler/myparser/JavaParser.jay" + // line 521 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { RefType t = new RefType( ((Token)yyVals[-3+yyTop]).getLexem() ,((Token)yyVals[-3+yyTop]).getOffset() ); t.set_ParaList( ((ParaList)yyVals[-1+yyTop]).get_ParaList() ); @@ -1107,14 +1026,14 @@ case 40: } break; case 41: - // line 609 "./../src/mycompiler/myparser/JavaParser.jay" + // line 529 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((ParaList)yyVals[-2+yyTop]).getParalist().addElement(((WildcardType)yyVals[0+yyTop])); yyVal=((ParaList)yyVals[-2+yyTop]); } break; case 42: - // line 615 "./../src/mycompiler/myparser/JavaParser.jay" + // line 535 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /*Luar 29.11.06 Offset auf -1, da keine Angabe vorhanden*/ WildcardType wc = new WildcardType(-1); @@ -1122,34 +1041,34 @@ case 42: } break; case 43: - // line 621 "./../src/mycompiler/myparser/JavaParser.jay" + // line 541 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ExtendsWildcardType ewc = new ExtendsWildcardType(((Token)yyVals[-1+yyTop]).getOffset(),((RefType)yyVals[0+yyTop])); yyVal = ewc; } break; case 44: - // line 626 "./../src/mycompiler/myparser/JavaParser.jay" + // line 546 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { SuperWildcardType swc = new SuperWildcardType(((Token)yyVals[-1+yyTop]).getOffset(),((RefType)yyVals[0+yyTop])); yyVal = swc; } break; case 45: - // line 632 "./../src/mycompiler/myparser/JavaParser.jay" + // line 552 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ClassBody CB = new ClassBody(); yyVal = CB; } break; case 46: - // line 638 "./../src/mycompiler/myparser/JavaParser.jay" + // line 558 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = ((ClassBody)yyVals[-1+yyTop]); } break; case 47: - // line 643 "./../src/mycompiler/myparser/JavaParser.jay" + // line 563 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Modifiers Mod = new Modifiers(); Mod.addModifier(((Modifier)yyVals[0+yyTop])); @@ -1157,20 +1076,20 @@ case 47: } break; case 48: - // line 649 "./../src/mycompiler/myparser/JavaParser.jay" + // line 569 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Modifiers)yyVals[-1+yyTop]).addModifier(((Modifier)yyVals[0+yyTop])); yyVal = ((Modifiers)yyVals[-1+yyTop]); } break; case 49: - // line 655 "./../src/mycompiler/myparser/JavaParser.jay" + // line 575 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = ((UsedId)yyVals[0+yyTop]); } break; case 50: - // line 660 "./../src/mycompiler/myparser/JavaParser.jay" + // line 580 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Interface*/ InterfaceList il = new InterfaceList(); @@ -1179,27 +1098,27 @@ case 50: } break; case 51: - // line 667 "./../src/mycompiler/myparser/JavaParser.jay" + // line 587 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((InterfaceList)yyVals[-2+yyTop]).addInterface(((UsedId)yyVals[0+yyTop])); yyVal = ((InterfaceList)yyVals[-2+yyTop]); } break; case 52: - // line 673 "./../src/mycompiler/myparser/JavaParser.jay" + // line 593 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Interface*/ yyVal = new InterfaceBody(); } break; case 53: - // line 678 "./../src/mycompiler/myparser/JavaParser.jay" + // line 598 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = ((InterfaceBody)yyVals[-1+yyTop]); } break; case 54: - // line 685 "./../src/mycompiler/myparser/JavaParser.jay" + // line 605 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Interface*/ InterfaceList il = new InterfaceList(); @@ -1208,14 +1127,14 @@ case 54: } break; case 55: - // line 692 "./../src/mycompiler/myparser/JavaParser.jay" + // line 612 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((InterfaceList)yyVals[-2+yyTop]).addInterface(((UsedId)yyVals[0+yyTop])); yyVal = ((InterfaceList)yyVals[-2+yyTop]); } break; case 56: - // line 699 "./../src/mycompiler/myparser/JavaParser.jay" + // line 619 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ClassBody CB = new ClassBody(); CB.addField( ((Field)yyVals[0+yyTop]) ); @@ -1223,55 +1142,55 @@ case 56: } break; case 57: - // line 705 "./../src/mycompiler/myparser/JavaParser.jay" + // line 625 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((ClassBody)yyVals[-1+yyTop]).addField(((Field)yyVals[0+yyTop])); yyVal = ((ClassBody)yyVals[-1+yyTop]); } break; case 58: - // line 712 "./../src/mycompiler/myparser/JavaParser.jay" + // line 632 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Public Pub = new Public(); yyVal=Pub; } break; case 59: - // line 717 "./../src/mycompiler/myparser/JavaParser.jay" + // line 637 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Protected Pro = new Protected(); yyVal=Pro; } break; case 60: - // line 722 "./../src/mycompiler/myparser/JavaParser.jay" + // line 642 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Private Pri = new Private(); yyVal=Pri; } break; case 61: - // line 727 "./../src/mycompiler/myparser/JavaParser.jay" + // line 647 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Static Sta = new Static(); yyVal=Sta; } break; case 62: - // line 732 "./../src/mycompiler/myparser/JavaParser.jay" + // line 652 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Abstract Abs = new Abstract(); yyVal=Abs; } break; case 63: - // line 737 "./../src/mycompiler/myparser/JavaParser.jay" + // line 657 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Final fin = new Final(); yyVal = fin; } break; case 64: - // line 743 "./../src/mycompiler/myparser/JavaParser.jay" + // line 663 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /*PL 05-07-30 eingefuegt containedTypes ANFANG*/ RefType RT = new RefType(-1); @@ -1286,7 +1205,7 @@ case 64: } break; case 65: - // line 758 "./../src/mycompiler/myparser/JavaParser.jay" + // line 678 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Interface*/ InterfaceBody ib = new InterfaceBody(); @@ -1295,39 +1214,39 @@ case 65: } break; case 66: - // line 765 "./../src/mycompiler/myparser/JavaParser.jay" + // line 685 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((InterfaceBody)yyVals[-1+yyTop]).addElement(((Field)yyVals[0+yyTop])); yyVal = ((InterfaceBody)yyVals[-1+yyTop]); } break; case 67: - // line 771 "./../src/mycompiler/myparser/JavaParser.jay" + // line 691 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Interfaces*/ yyVal = ((UsedId)yyVals[0+yyTop]); } break; case 68: - // line 777 "./../src/mycompiler/myparser/JavaParser.jay" + // line 697 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Field)yyVals[0+yyTop]); } break; case 69: - // line 782 "./../src/mycompiler/myparser/JavaParser.jay" + // line 702 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Method)yyVals[0+yyTop]); } break; case 70: - // line 786 "./../src/mycompiler/myparser/JavaParser.jay" + // line 706 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Field)yyVals[0+yyTop]); } break; case 71: - // line 792 "./../src/mycompiler/myparser/JavaParser.jay" + // line 712 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { if (((Vector)yyVals[0+yyTop]) != null) { /*$1.set_ParaList($2.get_ParaList());*/ @@ -1339,7 +1258,7 @@ case 71: } break; case 72: - // line 803 "./../src/mycompiler/myparser/JavaParser.jay" + // line 723 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Vector tl = new Vector(); tl.add(((Type)yyVals[0+yyTop])); @@ -1347,21 +1266,21 @@ case 72: } break; case 73: - // line 809 "./../src/mycompiler/myparser/JavaParser.jay" + // line 729 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Vector)yyVals[-2+yyTop]).add(((Type)yyVals[0+yyTop])); yyVal=((Vector)yyVals[-2+yyTop]); } break; case 74: - // line 814 "./../src/mycompiler/myparser/JavaParser.jay" + // line 734 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Vector)yyVals[-2+yyTop]).add(((WildcardType)yyVals[0+yyTop])); yyVal=((Vector)yyVals[-2+yyTop]); } break; case 75: - // line 819 "./../src/mycompiler/myparser/JavaParser.jay" + // line 739 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Vector tl = new Vector(); tl.add(((WildcardType)yyVals[0+yyTop])); @@ -1369,42 +1288,42 @@ case 75: } break; case 76: - // line 827 "./../src/mycompiler/myparser/JavaParser.jay" + // line 747 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = null; } break; case 77: - // line 829 "./../src/mycompiler/myparser/JavaParser.jay" + // line 749 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = ((Vector)yyVals[-1+yyTop]); } break; case 78: - // line 834 "./../src/mycompiler/myparser/JavaParser.jay" + // line 754 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Interfaces, Spezialform Konstantendef.*/ yyVal = ((Constant)yyVals[0+yyTop]); } break; case 79: - // line 839 "./../src/mycompiler/myparser/JavaParser.jay" + // line 759 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = ((Method)yyVals[0+yyTop]); } break; case 80: - // line 844 "./../src/mycompiler/myparser/JavaParser.jay" + // line 764 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Field)yyVals[0+yyTop]); } break; case 81: - // line 848 "./../src/mycompiler/myparser/JavaParser.jay" + // line 768 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Method)yyVals[0+yyTop]); } break; case 82: - // line 853 "./../src/mycompiler/myparser/JavaParser.jay" + // line 773 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Method STAT = new Method(((Token)yyVals[-1+yyTop]).getOffset()); DeclId DST = new DeclId(); @@ -1419,14 +1338,14 @@ case 82: } break; case 83: - // line 867 "./../src/mycompiler/myparser/JavaParser.jay" + // line 787 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Constructor)yyVals[-1+yyTop]).set_Block(((Block)yyVals[0+yyTop])); yyVal = ((Constructor)yyVals[-1+yyTop]); } break; case 84: - // line 872 "./../src/mycompiler/myparser/JavaParser.jay" + // line 792 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Constructor)yyVals[-1+yyTop]).set_Block(((Block)yyVals[0+yyTop])); ((Constructor)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); @@ -1434,7 +1353,7 @@ case 84: } break; case 85: - // line 879 "./../src/mycompiler/myparser/JavaParser.jay" + // line 799 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Interface*/ Constant c = new Constant(((Token)yyVals[-3+yyTop]).getLexem(), ((Modifiers)yyVals[-5+yyTop])); @@ -1444,14 +1363,14 @@ case 85: } break; case 86: - // line 888 "./../src/mycompiler/myparser/JavaParser.jay" + // line 808 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /* SCJU: Interface*/ yyVal = ((Method)yyVals[-1+yyTop]); } break; case 87: - // line 913 "./../src/mycompiler/myparser/JavaParser.jay" + // line 833 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { FieldDeclaration ret = new FieldDeclaration(((DeclId)yyVals[-2+yyTop]).getOffset()); ret.set_DeclId(((DeclId)yyVals[-2+yyTop])); @@ -1460,7 +1379,7 @@ case 87: } break; case 88: - // line 920 "./../src/mycompiler/myparser/JavaParser.jay" + // line 840 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { FieldDeclaration ret = new FieldDeclaration(((DeclId)yyVals[0+yyTop]).getOffset()); ret.set_DeclId(((DeclId)yyVals[0+yyTop])); @@ -1468,27 +1387,27 @@ case 88: } break; case 89: - // line 927 "./../src/mycompiler/myparser/JavaParser.jay" + // line 847 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { GenericDeclarationList ret = new GenericDeclarationList(((GenericVarDeclarationList)yyVals[-1+yyTop]).getElements(),((GenericVarDeclarationList)yyVals[-1+yyTop]).getEndOffset()); yyVal = ret; } break; case 90: - // line 934 "./../src/mycompiler/myparser/JavaParser.jay" + // line 854 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((FieldDeclaration)yyVals[-1+yyTop]); } break; case 91: - // line 938 "./../src/mycompiler/myparser/JavaParser.jay" + // line 858 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((FieldDeclaration)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); yyVal=((FieldDeclaration)yyVals[-1+yyTop]); } break; case 92: - // line 943 "./../src/mycompiler/myparser/JavaParser.jay" + // line 863 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" {/*angefügt von Andreas Stadelmeier*/ ((FieldDeclaration)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); ((FieldDeclaration)yyVals[-1+yyTop]).setGenericParameter(((GenericDeclarationList)yyVals[-3+yyTop])); @@ -1496,13 +1415,13 @@ case 92: } break; case 93: - // line 950 "./../src/mycompiler/myparser/JavaParser.jay" + // line 870 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((FieldDeclaration)yyVals[-1+yyTop]); } break; case 94: - // line 955 "./../src/mycompiler/myparser/JavaParser.jay" + // line 875 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->fielddeclaration ...: type " + ((Type)yyVals[-2+yyTop])); ((FieldDeclaration)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); @@ -1510,7 +1429,7 @@ case 94: } break; case 95: - // line 962 "./../src/mycompiler/myparser/JavaParser.jay" + // line 882 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((FieldDeclaration)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); for(int i=0;i<(((FieldDeclaration)yyVals[-1+yyTop]).getDeclIdVector().size());i++) @@ -1521,27 +1440,27 @@ case 95: } break; case 96: - // line 972 "./../src/mycompiler/myparser/JavaParser.jay" + // line 892 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).set_Block(((Block)yyVals[0+yyTop])); yyVal=((Method)yyVals[-1+yyTop]); } break; case 97: - // line 979 "./../src/mycompiler/myparser/JavaParser.jay" + // line 899 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Block Bl = new Block(); yyVal=Bl; } break; case 98: - // line 985 "./../src/mycompiler/myparser/JavaParser.jay" + // line 905 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Block)yyVals[-1+yyTop]); } break; case 99: - // line 990 "./../src/mycompiler/myparser/JavaParser.jay" + // line 910 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Constructor CON = new Constructor(null); /*TODO: Der Parser kann sowieso nicht zwischen einem Konstruktor und einer Methode unterscheiden. Das hier kann wegfallen...*/ DeclId DIDCon = new DeclId(); @@ -1551,7 +1470,7 @@ case 99: } break; case 100: - // line 998 "./../src/mycompiler/myparser/JavaParser.jay" + // line 918 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Constructor CONpara = new Constructor(null); DeclId DIconpara = new DeclId(); @@ -1562,14 +1481,14 @@ case 100: } break; case 101: - // line 1008 "./../src/mycompiler/myparser/JavaParser.jay" + // line 928 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Block CBL = new Block(); yyVal=CBL; } break; case 102: - // line 1013 "./../src/mycompiler/myparser/JavaParser.jay" + // line 933 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Block CBLexpl = new Block(); CBLexpl.set_Statement(((Statement)yyVals[-1+yyTop])); @@ -1577,13 +1496,13 @@ case 102: } break; case 103: - // line 1019 "./../src/mycompiler/myparser/JavaParser.jay" + // line 939 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Block)yyVals[-1+yyTop]); } break; case 104: - // line 1023 "./../src/mycompiler/myparser/JavaParser.jay" + // line 943 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Block CBes = new Block(); CBes.set_Statement(((Statement)yyVals[-2+yyTop])); @@ -1595,7 +1514,7 @@ case 104: } break; case 105: - // line 1034 "./../src/mycompiler/myparser/JavaParser.jay" + // line 954 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ExceptionList EL = new ExceptionList(); EL.set_addElem(((RefType)yyVals[0+yyTop])); @@ -1603,13 +1522,13 @@ case 105: } break; case 106: - // line 1041 "./../src/mycompiler/myparser/JavaParser.jay" + // line 961 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal = ((GenericTypeVar)yyVals[0+yyTop]); } break; case 107: - // line 1046 "./../src/mycompiler/myparser/JavaParser.jay" + // line 966 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ParaList p = new ParaList(); p.add_ParaList(((GenericTypeVar)yyVals[0+yyTop])); @@ -1617,28 +1536,28 @@ case 107: } break; case 108: - // line 1052 "./../src/mycompiler/myparser/JavaParser.jay" + // line 972 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((ParaList)yyVals[-2+yyTop]).add_ParaList(((GenericTypeVar)yyVals[0+yyTop])); yyVal=((ParaList)yyVals[-2+yyTop]); } break; case 109: - // line 1059 "./../src/mycompiler/myparser/JavaParser.jay" + // line 979 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { - yyVal=new GenericTypeVar(((Token)yyVals[0+yyTop]).getLexem(),((Token)yyVals[0+yyTop]).getOffset()); + yyVal=new GenericTypeVar(((Token)yyVals[0+yyTop]).getLexem(),null,((Token)yyVals[0+yyTop]).getOffset()); } break; case 110: - // line 1063 "./../src/mycompiler/myparser/JavaParser.jay" + // line 983 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { - BoundedGenericTypeVar gtv=new BoundedGenericTypeVar(((Token)yyVals[-2+yyTop]).getLexem(), ((BoundedClassIdentifierList)yyVals[0+yyTop]), ((Token)yyVals[-2+yyTop]).getOffset() ,((BoundedClassIdentifierList)yyVals[0+yyTop]).getEndOffset()); + BoundedGenericTypeVar gtv=new BoundedGenericTypeVar(((Token)yyVals[-2+yyTop]).getLexem(), ((BoundedClassIdentifierList)yyVals[0+yyTop]),null, ((Token)yyVals[-2+yyTop]).getOffset() ,((BoundedClassIdentifierList)yyVals[0+yyTop]).getEndOffset()); /*gtv.setBounds($3);*/ yyVal=gtv; } break; case 111: - // line 1070 "./../src/mycompiler/myparser/JavaParser.jay" + // line 990 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Vector vec=new Vector(); vec.addElement(((RefType)yyVals[0+yyTop])); @@ -1647,7 +1566,7 @@ case 111: } break; case 112: - // line 1077 "./../src/mycompiler/myparser/JavaParser.jay" + // line 997 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((BoundedClassIdentifierList)yyVals[-2+yyTop]).addElement(((RefType)yyVals[0+yyTop])); ((BoundedClassIdentifierList)yyVals[-2+yyTop]).addOffsetOff(((RefType)yyVals[0+yyTop])); @@ -1656,7 +1575,7 @@ case 112: } break; case 113: - // line 1085 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1005 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { GenericVarDeclarationList vec=new GenericVarDeclarationList(); vec.addElement(((GenericTypeVar)yyVals[0+yyTop])); @@ -1664,14 +1583,14 @@ case 113: } break; case 114: - // line 1091 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1011 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((GenericVarDeclarationList)yyVals[-2+yyTop]).addElement(((GenericTypeVar)yyVals[0+yyTop])); yyVal=((GenericVarDeclarationList)yyVals[-2+yyTop]); } break; case 115: - // line 1099 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1019 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).setType(((Type)yyVals[-1+yyTop])); ((Method)yyVals[0+yyTop]).setGenericParameter(((GenericDeclarationList)yyVals[-2+yyTop])); @@ -1679,14 +1598,14 @@ case 115: } break; case 116: - // line 1105 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1025 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).setType(((Type)yyVals[-1+yyTop])); yyVal=((Method)yyVals[0+yyTop]); } break; case 117: - // line 1110 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1030 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); ((Method)yyVals[0+yyTop]).setType(((Type)yyVals[-1+yyTop])); @@ -1694,7 +1613,7 @@ case 117: } break; case 118: - // line 1116 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1036 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); ((Method)yyVals[0+yyTop]).setGenericParameter(((GenericDeclarationList)yyVals[-2+yyTop])); @@ -1703,7 +1622,7 @@ case 118: } break; case 119: - // line 1123 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1043 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); @@ -1711,7 +1630,7 @@ case 119: } break; case 120: - // line 1129 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1049 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).setGenericParameter(((GenericDeclarationList)yyVals[-3+yyTop])); ((Method)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); @@ -1720,7 +1639,7 @@ case 120: } break; case 121: - // line 1136 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1056 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); ((Method)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); @@ -1729,7 +1648,7 @@ case 121: } break; case 122: - // line 1143 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1063 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-4+yyTop])); ((Method)yyVals[-1+yyTop]).setGenericParameter(((GenericDeclarationList)yyVals[-3+yyTop])); @@ -1739,7 +1658,7 @@ case 122: } break; case 123: - // line 1151 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1071 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Void Voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); ((Method)yyVals[0+yyTop]).setType(Voit); @@ -1747,7 +1666,7 @@ case 123: } break; case 124: - // line 1157 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1077 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Void voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); @@ -1756,7 +1675,7 @@ case 124: } break; case 125: - // line 1164 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1084 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Void voyt = new Void(((Token)yyVals[-2+yyTop]).getOffset()); ((Method)yyVals[-1+yyTop]).setType(voyt); @@ -1765,7 +1684,7 @@ case 125: } break; case 126: - // line 1171 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1091 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Void voyd = new Void(((Token)yyVals[-2+yyTop]).getOffset()); ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); @@ -1775,7 +1694,7 @@ case 126: } break; case 127: - // line 1179 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1099 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Void Voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); ((Method)yyVals[0+yyTop]).setType(Voit); @@ -1784,7 +1703,7 @@ case 127: } break; case 128: - // line 1186 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1106 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Void voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); @@ -1794,7 +1713,7 @@ case 128: } break; case 129: - // line 1194 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1114 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Void voyt = new Void(((Token)yyVals[-2+yyTop]).getOffset()); ((Method)yyVals[-1+yyTop]).setType(voyt); @@ -1804,7 +1723,7 @@ case 129: } break; case 130: - // line 1202 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1122 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Void voyd = new Void(((Token)yyVals[-2+yyTop]).getOffset()); ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-4+yyTop])); @@ -1815,14 +1734,14 @@ case 130: } break; case 131: - // line 1212 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1132 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /*auskommentiert von Andreas Stadelmeier (a10023) $1.setType(TypePlaceholder.fresh()); */ yyVal=((Method)yyVals[0+yyTop]); } break; case 132: - // line 1217 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1137 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /*auskommentiert von Andreas Stadelmeier (a10023) $4.setType(TypePlaceholder.fresh());*/ ((Method)yyVals[0+yyTop]).setGenericParameter(((GenericDeclarationList)yyVals[-1+yyTop])); @@ -1830,7 +1749,7 @@ case 132: } break; case 133: - // line 1224 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1144 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-1+yyTop])); /*auskommentiert von Andreas Stadelmeier (a10023) $2.setType(TypePlaceholder.fresh());*/ @@ -1838,7 +1757,7 @@ case 133: } break; case 134: - // line 1230 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1150 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { /*auskommentiert von Andreas Stadelmeier (a10023) $1.setType(TypePlaceholder.fresh());*/ ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); @@ -1846,7 +1765,7 @@ case 134: } break; case 135: - // line 1236 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1156 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); /*auskommentiert von Andreas Stadelmeier (a10023) $2.setType(TypePlaceholder.fresh());*/ @@ -1855,31 +1774,31 @@ case 135: } break; case 136: - // line 1245 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1165 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((BaseType)yyVals[0+yyTop]); } break; case 137: - // line 1249 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1169 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((BaseType)yyVals[-2+yyTop]).setArray(true); } break; case 138: - // line 1253 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1173 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((RefType)yyVals[0+yyTop]); } break; case 139: - // line 1257 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1177 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((RefType)yyVals[-2+yyTop]).setArray(true); } break; case 140: - // line 1261 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1181 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { FieldDeclaration IVD = new FieldDeclaration(((DeclId)yyVals[0+yyTop]).getOffset()); IVD.getDeclIdVector().addElement( ((DeclId)yyVals[0+yyTop]) ); @@ -1888,20 +1807,20 @@ case 140: } break; case 141: - // line 1268 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1188 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((FieldDeclaration)yyVals[-2+yyTop]).getDeclIdVector().addElement(((DeclId)yyVals[0+yyTop])); yyVal=((FieldDeclaration)yyVals[-2+yyTop]); } break; case 142: - // line 1274 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1194 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Block)yyVals[0+yyTop]); } break; case 143: - // line 1279 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1199 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Block Blstat = new Block(); Blstat.set_Statement(((Statement)yyVals[0+yyTop])); @@ -1909,14 +1828,14 @@ case 143: } break; case 144: - // line 1286 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1206 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((Block)yyVals[-1+yyTop]).set_Statement(((Statement)yyVals[0+yyTop])); yyVal=((Block)yyVals[-1+yyTop]); } break; case 145: - // line 1292 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1212 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ParameterList PL = new ParameterList(); PL.set_AddParameter(((FormalParameter)yyVals[0+yyTop])); @@ -1924,21 +1843,21 @@ case 145: } break; case 146: - // line 1298 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1218 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((ParameterList)yyVals[-2+yyTop]).set_AddParameter(((FormalParameter)yyVals[0+yyTop])); yyVal = ((ParameterList)yyVals[-2+yyTop]); } break; case 147: - // line 1304 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1224 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { This THCON = new This(((Token)yyVals[-3+yyTop]).getOffset(),((Token)yyVals[-3+yyTop]).getLexem().length()); yyVal=THCON; } break; case 148: - // line 1309 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1229 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { This THCONargl = new This(((Token)yyVals[-4+yyTop]).getOffset(),((Token)yyVals[-4+yyTop]).getLexem().length()); THCONargl.set_ArgumentList(((ArgumentList)yyVals[-2+yyTop])); @@ -1946,7 +1865,7 @@ case 148: } break; case 149: - // line 1318 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1238 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { RefType RT = new RefType(-1); RT.set_UsedId(((UsedId)yyVals[0+yyTop])); @@ -1955,7 +1874,7 @@ case 149: } break; case 150: - // line 1325 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1245 "./../src/de/dhbwstuttgart/parser/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()); @@ -1963,7 +1882,7 @@ case 150: } break; case 151: - // line 1332 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1252 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Method met = new Method(((Token)yyVals[-2+yyTop]).getOffset()); /* #JB# 10.04.2005 */ @@ -1978,7 +1897,7 @@ case 151: } break; case 152: - // line 1345 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1265 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Method met_para = new Method(((Token)yyVals[-3+yyTop]).getOffset()); /* #JB# 10.04.2005 */ @@ -1994,7 +1913,7 @@ case 152: } break; case 153: - // line 1360 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1280 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { BooleanType BT = new BooleanType(); /* #JB# 05.04.2005 */ @@ -2005,13 +1924,13 @@ case 153: } break; case 154: - // line 1369 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1289 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((BaseType)yyVals[0+yyTop]); } break; case 155: - // line 1374 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1294 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { if (((Vector)yyVals[0+yyTop]) != null) { /*$1.set_ParaList($2.get_ParaList());*/ @@ -2023,7 +1942,7 @@ case 155: RefType RT = new RefType(uid.getOffset()); RT.set_ParaList(uid.get_RealParaList()); - RT.setName(uid.getQualifiedName().toString()); + RT.setName(uid.getQualifiedName()); /*PL 05-07-30 eingefuegt containedTypes ANFANG*/ @@ -2034,7 +1953,7 @@ case 155: } break; case 156: - // line 1396 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1316 "./../src/de/dhbwstuttgart/parser/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()); @@ -2043,7 +1962,7 @@ case 156: /*RT.set_UsedId($1); */ /*RT.setName(RT.get_UsedId().get_Name_1Element());*/ RT.set_ParaList(((UsedId)yyVals[0+yyTop]).get_RealParaList()); - RT.setName(((UsedId)yyVals[0+yyTop]).getQualifiedName().toString()); + RT.setName(((UsedId)yyVals[0+yyTop]).getQualifiedName()); /*PL 05-07-30 eingefuegt containedTypes ANFANG*/ @@ -2054,25 +1973,25 @@ case 156: } break; case 157: - // line 1418 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1338 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((DeclId)yyVals[0+yyTop]); } break; case 158: - // line 1439 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1359 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((LocalVarDecl)yyVals[0+yyTop]); } break; case 159: - // line 1443 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1363 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Statement)yyVals[0+yyTop]); } break; case 160: - // line 1448 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1368 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { FormalParameter FP = new FormalParameter(((DeclId)yyVals[0+yyTop])); FP.setType(((Type)yyVals[-1+yyTop])); @@ -2081,7 +2000,7 @@ case 160: } break; case 161: - // line 1473 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1393 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("\nFunktionsdeklaration mit typlosen Parametern: " + ((DeclId)yyVals[0+yyTop]).name); @@ -2101,7 +2020,7 @@ case 161: } break; case 162: - // line 1492 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1412 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ArgumentList AL = new ArgumentList(); AL.expr.addElement(((Expr)yyVals[0+yyTop])); @@ -2109,20 +2028,20 @@ case 162: } break; case 163: - // line 1498 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1418 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ((ArgumentList)yyVals[-2+yyTop]).expr.addElement(((Expr)yyVals[0+yyTop])); yyVal=((ArgumentList)yyVals[-2+yyTop]); } break; case 164: - // line 1504 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1424 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((BaseType)yyVals[0+yyTop]); } break; case 165: - // line 1509 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1429 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { DeclId DI = new DeclId(); /* #JB# 10.04.2005 */ @@ -2135,61 +2054,61 @@ case 165: } break; case 166: - // line 1521 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1441 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 167: - // line 1526 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1446 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((LocalVarDecl)yyVals[-1+yyTop]); } break; case 168: - // line 1531 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1451 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Statement)yyVals[0+yyTop]); } break; case 169: - // line 1535 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1455 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((IfStmt)yyVals[0+yyTop]); } break; case 170: - // line 1539 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1459 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((IfStmt)yyVals[0+yyTop]); } break; case 171: - // line 1543 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1463 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((WhileStmt)yyVals[0+yyTop]); } break; case 172: - // line 1547 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1467 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((ForStmt)yyVals[0+yyTop]); } break; case 173: - // line 1552 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1472 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 174: - // line 1556 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1476 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((NewClass)yyVals[0+yyTop]); } break; case 175: - // line 1561 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1481 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { IntegerType IT = new IntegerType(); /* #JB# 05.04.2005 */ @@ -2200,7 +2119,7 @@ case 175: } break; case 176: - // line 1570 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1490 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { CharacterType CT = new CharacterType(); /* #JB# 05.04.2005 */ @@ -2211,7 +2130,7 @@ case 176: } break; case 177: - // line 1580 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1500 "./../src/de/dhbwstuttgart/parser/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()); @@ -2221,7 +2140,7 @@ case 177: } break; case 178: - // line 1591 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1511 "./../src/de/dhbwstuttgart/parser/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()); @@ -2231,31 +2150,31 @@ case 178: } break; case 179: - // line 1601 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1521 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Block)yyVals[0+yyTop]); } break; case 180: - // line 1605 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1525 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((EmptyStmt)yyVals[0+yyTop]); } break; case 181: - // line 1609 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1529 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((ExprStmt)yyVals[0+yyTop]); } break; case 182: - // line 1613 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1533 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Return)yyVals[0+yyTop]); } break; case 183: - // line 1618 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1538 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { IfStmt Ifst = new IfStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); Ifst.set_Expr(((Expr)yyVals[-2+yyTop])); @@ -2264,7 +2183,7 @@ case 183: } break; case 184: - // line 1626 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1546 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { IfStmt IfstElst = new IfStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); IfstElst.set_Expr(((Expr)yyVals[-4+yyTop])); @@ -2274,7 +2193,7 @@ case 184: } break; case 185: - // line 1635 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1555 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { WhileStmt Whlst = new WhileStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); Whlst.set_Expr(((Expr)yyVals[-2+yyTop])); @@ -2283,7 +2202,7 @@ case 185: } break; case 186: - // line 1646 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1566 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-6+yyTop]).getOffset(),((Expr)yyVals[-6+yyTop]).getVariableLength()); Fst.set_head_Initializer(((Expr)yyVals[-6+yyTop])); @@ -2296,7 +2215,7 @@ case 186: } break; case 187: - // line 1658 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1578 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength()); Fst.set_head_Initializer(((Expr)yyVals[-5+yyTop])); @@ -2308,7 +2227,7 @@ case 187: } break; case 188: - // line 1669 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1589 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength()); Fst.set_head_Initializer(((Expr)yyVals[-5+yyTop])); @@ -2320,7 +2239,7 @@ case 188: } break; case 189: - // line 1680 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1600 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); Fst.set_head_Condition(((Expr)yyVals[-4+yyTop])); @@ -2332,7 +2251,7 @@ case 189: } break; case 190: - // line 1691 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1611 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); Fst.set_head_Initializer(((Expr)yyVals[-4+yyTop])); @@ -2343,7 +2262,7 @@ case 190: } break; case 191: - // line 1701 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1621 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-3+yyTop]).getOffset(),((Expr)yyVals[-3+yyTop]).getVariableLength()); Fst.set_head_Condition(((Expr)yyVals[-3+yyTop])); @@ -2354,7 +2273,7 @@ case 191: } break; case 192: - // line 1711 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1631 "./../src/de/dhbwstuttgart/parser/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])); @@ -2365,7 +2284,7 @@ case 192: } break; case 193: - // line 1721 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1641 "./../src/de/dhbwstuttgart/parser/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])); @@ -2375,40 +2294,40 @@ case 193: } break; case 194: - // line 1730 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1650 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("conditionalexpression"); yyVal=((Expr)yyVals[0+yyTop]); } break; case 195: - // line 1735 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1655 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Assign)yyVals[0+yyTop]); } break; case 196: - // line 1741 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1661 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { EmptyStmt Empst = new EmptyStmt(); yyVal=Empst; } break; case 197: - // line 1747 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1667 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[-1+yyTop]); } break; case 198: - // line 1752 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1672 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Return ret = new Return(-1,-1); yyVal= ret; } break; case 199: - // line 1757 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1677 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Return retexp = new Return(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength()); retexp.set_ReturnExpr(((Expr)yyVals[-1+yyTop])); @@ -2416,31 +2335,31 @@ case 199: } break; case 200: - // line 1764 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1684 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Statement)yyVals[0+yyTop]); } break; case 201: - // line 1768 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1688 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((IfStmt)yyVals[0+yyTop]); } break; case 202: - // line 1772 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1692 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((WhileStmt)yyVals[0+yyTop]); } break; case 203: - // line 1777 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1697 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 204: - // line 1783 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1703 "./../src/de/dhbwstuttgart/parser/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()); @@ -2467,7 +2386,7 @@ case 204: } break; case 205: - // line 1808 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1728 "./../src/de/dhbwstuttgart/parser/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()); @@ -2491,43 +2410,43 @@ case 205: } break; case 206: - // line 1831 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1751 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Assign)yyVals[0+yyTop]); } break; case 207: - // line 1835 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1755 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 208: - // line 1839 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1759 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 209: - // line 1843 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1763 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 210: - // line 1847 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1767 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 211: - // line 1851 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1771 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((MethodCall)yyVals[0+yyTop]); } break; case 212: - // line 1862 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1782 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { IfStmt IfElno = new IfStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); IfElno.set_Expr(((Expr)yyVals[-4+yyTop])); @@ -2537,7 +2456,7 @@ case 212: } break; case 213: - // line 1871 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1791 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { WhileStmt Whstno = new WhileStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); Whstno.set_Expr(((Expr)yyVals[-2+yyTop])); @@ -2546,13 +2465,13 @@ case 213: } break; case 214: - // line 1879 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1799 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 215: - // line 1883 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1803 "./../src/de/dhbwstuttgart/parser/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()); @@ -2564,19 +2483,19 @@ case 215: } break; case 216: - // line 1896 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1816 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=null; } break; case 217: - // line 1901 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1821 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Block)yyVals[0+yyTop]); } break; case 218: - // line 1905 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1825 "./../src/de/dhbwstuttgart/parser/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";}|*/ @@ -2587,19 +2506,19 @@ case 218: } break; case 219: - // line 1915 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1835 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=null; } break; case 220: - // line 1919 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1839 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((ParameterList)yyVals[-1+yyTop]); } break; case 221: - // line 1924 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1844 "./../src/de/dhbwstuttgart/parser/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])); @@ -2608,54 +2527,54 @@ case 221: } break; case 222: - // line 1943 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1863 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((UsedId)yyVals[0+yyTop]); } break; case 223: - // line 1948 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1868 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=null; } break; case 224: - // line 1952 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1872 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { TimesOp TEO = new TimesOp(-1,-1); yyVal=TEO; } break; case 225: - // line 1957 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1877 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { DivideOp DEO = new DivideOp(-1,-1); yyVal=DEO; } break; case 226: - // line 1962 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1882 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { ModuloOp MEO = new ModuloOp(-1,-1); yyVal=MEO; } break; case 227: - // line 1967 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1887 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { PlusOp PEO = new PlusOp(-1,-1); yyVal=PEO; } break; case 228: - // line 1972 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1892 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { MinusOp MEO = new MinusOp(-1,-1); yyVal=MEO; } break; case 229: - // line 1984 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1904 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { PreIncExpr PRINC = new PreIncExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); PRINC.set_Expr(((Expr)yyVals[0+yyTop])); @@ -2663,7 +2582,7 @@ case 229: } break; case 230: - // line 1991 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1911 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { PreDecExpr PRDEC = new PreDecExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); PRDEC.set_Expr(((Expr)yyVals[0+yyTop])); @@ -2671,7 +2590,7 @@ case 230: } break; case 231: - // line 1998 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1918 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { PostIncExpr PIE = new PostIncExpr(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength()); PIE.set_Expr(((Expr)yyVals[-1+yyTop])); @@ -2679,7 +2598,7 @@ case 231: } break; case 232: - // line 2005 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1925 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { PostDecExpr PDE = new PostDecExpr(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength()); PDE.set_Expr(((Expr)yyVals[-1+yyTop])); @@ -2687,7 +2606,7 @@ case 232: } break; case 233: - // line 2013 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1933 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("M1"); MethodCall MC = new MethodCall(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); @@ -2719,7 +2638,7 @@ case 233: } break; case 234: - // line 2043 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1963 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("M2"); MethodCall MCarg = new MethodCall(((UsedId)yyVals[-3+yyTop]).getOffset(),((UsedId)yyVals[-3+yyTop]).getVariableLength()); @@ -2752,7 +2671,7 @@ case 234: } break; case 235: - // line 2074 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1994 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("M3"); MethodCall MCpr = new MethodCall(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); @@ -2773,7 +2692,7 @@ case 235: } break; case 236: - // line 2093 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2013 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("M4"); MethodCall MCPA = new MethodCall(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength()); @@ -2795,7 +2714,7 @@ case 236: } break; case 237: - // line 2116 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2036 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { NewClass NC = new NewClass(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); NC.set_UsedId(((UsedId)yyVals[-2+yyTop])); @@ -2805,7 +2724,7 @@ case 237: } break; case 238: - // line 2124 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2044 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { NewClass NCarg = new NewClass(((UsedId)yyVals[-3+yyTop]).getOffset(),((UsedId)yyVals[-3+yyTop]).getVariableLength()); NCarg.set_UsedId(((UsedId)yyVals[-3+yyTop])); @@ -2816,13 +2735,13 @@ case 238: } break; case 239: - // line 2134 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2054 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 240: - // line 2138 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2058 "./../src/de/dhbwstuttgart/parser/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()); @@ -2834,19 +2753,19 @@ case 240: } break; case 241: - // line 2154 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2074 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 242: - // line 2158 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2078 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 243: - // line 2162 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2082 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { PositivExpr POSEX=new PositivExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); UnaryPlus UP= new UnaryPlus(); @@ -2856,7 +2775,7 @@ case 243: } break; case 244: - // line 2170 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2090 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { NegativeExpr NEGEX=new NegativeExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); UnaryMinus UM=new UnaryMinus(); @@ -2866,19 +2785,19 @@ case 244: } break; case 245: - // line 2178 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2098 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 246: - // line 2183 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2103 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 247: - // line 2187 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2107 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { if (((UsedId)yyVals[0+yyTop]).get_Name().size() > 1) { @@ -2898,37 +2817,37 @@ case 247: } break; case 248: - // line 2205 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2125 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 249: - // line 2209 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2129 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 250: - // line 2214 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2134 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 251: - // line 2219 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2139 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 253: - // line 2225 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2145 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Literal)yyVals[0+yyTop]); } break; case 254: - // line 2229 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2149 "./../src/de/dhbwstuttgart/parser/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()); @@ -2938,23 +2857,23 @@ case 254: } break; case 255: - // line 2250 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2170 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((MethodCall)yyVals[0+yyTop]); } break; case 256: - // line 2254 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2174 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 257: - // line 2259 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2179 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" {yyVal=((Expr)yyVals[0+yyTop]);} break; case 258: - // line 2261 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2181 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" {NotExpr NE=new NotExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); UnaryNot UN=new UnaryNot(); NE.set_UnaryNot(UN); @@ -2963,36 +2882,36 @@ case 258: } break; case 259: - // line 2267 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2187 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" {yyVal=((CastExpr)yyVals[0+yyTop]);} break; case 260: - // line 2269 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2189 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" {yyVal=((Expr)yyVals[0+yyTop]);} break; case 262: - // line 2274 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2194 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" {IntLiteral IL = new IntLiteral(); IL.set_Int(((Token)yyVals[0+yyTop]).String2Int()); yyVal = IL; } break; case 263: - // line 2279 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2199 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" {BoolLiteral BL = new BoolLiteral(); BL.set_Bool(((Token)yyVals[0+yyTop]).String2Bool()); yyVal = BL; } break; case 264: - // line 2283 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2203 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" {CharLiteral CL = new CharLiteral(); CL.set_Char(((Token)yyVals[0+yyTop]).CharInString()); yyVal=CL; } break; case 265: - // line 2288 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2208 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { StringLiteral ST = new StringLiteral(); ST.set_String(((Token)yyVals[0+yyTop]).get_String()); @@ -3000,14 +2919,14 @@ case 265: } break; case 266: - // line 2293 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2213 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { LongLiteral LL = new LongLiteral(); LL.set_Long(((Token)yyVals[0+yyTop]).String2Long()); yyVal = LL; } break; case 267: - // line 2297 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2217 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { FloatLiteral FL = new FloatLiteral(); FL.set_Float(((Token)yyVals[0+yyTop]).String2Float()); @@ -3015,7 +2934,7 @@ case 267: } break; case 268: - // line 2302 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2222 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { DoubleLiteral DL = new DoubleLiteral(); DL.set_Double(((Token)yyVals[0+yyTop]).String2Double()); @@ -3023,14 +2942,14 @@ case 268: } break; case 269: - // line 2308 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2228 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { Null NN = new Null(); yyVal=NN; } break; case 270: - // line 2314 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2234 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { CastExpr CaEx=new CastExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); CaEx.set_Type(((BaseType)yyVals[-2+yyTop])); @@ -3039,24 +2958,24 @@ case 270: } break; case 271: - // line 2323 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2243 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 272: - // line 2327 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2247 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { } break; case 273: - // line 2331 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2251 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 274: - // line 2335 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2255 "./../src/de/dhbwstuttgart/parser/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()); @@ -3068,7 +2987,7 @@ case 274: } break; case 275: - // line 2345 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2265 "./../src/de/dhbwstuttgart/parser/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()); @@ -3080,13 +2999,13 @@ case 275: } break; case 276: - // line 2356 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2276 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 277: - // line 2360 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2280 "./../src/de/dhbwstuttgart/parser/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()); @@ -3098,7 +3017,7 @@ case 277: } break; case 278: - // line 2370 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2290 "./../src/de/dhbwstuttgart/parser/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()); @@ -3110,7 +3029,7 @@ case 278: } break; case 279: - // line 2380 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2300 "./../src/de/dhbwstuttgart/parser/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()); @@ -3122,7 +3041,7 @@ case 279: } break; case 280: - // line 2390 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2310 "./../src/de/dhbwstuttgart/parser/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()); @@ -3134,7 +3053,7 @@ case 280: } break; case 281: - // line 2400 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2320 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { InstanceOf ISO=new InstanceOf(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); ISO.set_Expr(((Expr)yyVals[-2+yyTop])); @@ -3143,19 +3062,19 @@ case 281: } break; case 282: - // line 2408 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2328 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 283: - // line 2413 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2333 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 284: - // line 2417 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2337 "./../src/de/dhbwstuttgart/parser/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()); @@ -3167,7 +3086,7 @@ case 284: } break; case 285: - // line 2427 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2347 "./../src/de/dhbwstuttgart/parser/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()); @@ -3179,13 +3098,13 @@ case 285: } break; case 286: - // line 2438 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2358 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 287: - // line 2442 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2362 "./../src/de/dhbwstuttgart/parser/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()); @@ -3197,7 +3116,7 @@ case 287: } break; case 288: - // line 2452 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2372 "./../src/de/dhbwstuttgart/parser/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()); @@ -3209,7 +3128,7 @@ case 288: } break; case 289: - // line 2462 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2382 "./../src/de/dhbwstuttgart/parser/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()); @@ -3220,7 +3139,7 @@ case 289: yyVal =MD; } break; - // line 3223 "-" + // line 3143 "-" } yyTop -= yyLen[yyN]; yyState = yyStates[yyTop]; diff --git a/src/de/dhbwstuttgart/parser/JavaParser.jay b/src/de/dhbwstuttgart/parser/JavaParser.jay index 703c75050..f4490d4fc 100755 --- a/src/de/dhbwstuttgart/parser/JavaParser.jay +++ b/src/de/dhbwstuttgart/parser/JavaParser.jay @@ -4,105 +4,25 @@ Backup von JavaParser.jay 10.April 17 Uhr */ -package mycompiler.myparser; +package de.dhbwstuttgart.parser; -import mycompiler.myclass.FieldDeclaration; -import mycompiler.myclass.GenericDeclarationList; -import mycompiler.myclass.Field; +import de.dhbwstuttgart.core.AClassOrInterface; +import de.dhbwstuttgart.syntaxtree.Class; +import de.dhbwstuttgart.syntaxtree.ImportDeclarations; +import de.dhbwstuttgart.syntaxtree.Interface; +import de.dhbwstuttgart.syntaxtree.SourceFile; +import de.dhbwstuttgart.syntaxtree.misc.UsedId; +import de.dhbwstuttgart.typeinference.Pair; +import de.dhbwstuttgart.syntaxtree.type.Type; +import de.dhbwstuttgart.syntaxtree.type.Void; +import de.dhbwstuttgart.*; +import de.dhbwstuttgart.syntaxtree.*; +import de.dhbwstuttgart.syntaxtree.misc.*; +import de.dhbwstuttgart.syntaxtree.modifier.*; +import de.dhbwstuttgart.syntaxtree.operator.*; +import de.dhbwstuttgart.syntaxtree.type.*; +import de.dhbwstuttgart.syntaxtree.statement.*; import java.util.Vector; -import mycompiler.SourceFile; -import mycompiler.AClassOrInterface; -import mycompiler.myclass.Class; -import mycompiler.myclass.ClassBody; -import mycompiler.myclass.Constructor; -import mycompiler.myclass.Constant; -import mycompiler.myclass.ImportDeclarations; -import mycompiler.myclass.DeclId; -import mycompiler.myclass.ExceptionList; -import mycompiler.myclass.FormalParameter; -import mycompiler.myclass.Method; -import mycompiler.myclass.ParameterList; -import mycompiler.myclass.UsedId; -import mycompiler.myinterface.Interface; -import mycompiler.myinterface.InterfaceBody; -import mycompiler.mymodifier.Abstract; -import mycompiler.mymodifier.Final; -import mycompiler.mymodifier.Modifier; -import mycompiler.mymodifier.Modifiers; -import mycompiler.mymodifier.Private; -import mycompiler.mymodifier.Protected; -import mycompiler.mymodifier.Public; -import mycompiler.mymodifier.Static; -import mycompiler.myoperator.AndOp; -import mycompiler.myoperator.DivideOp; -import mycompiler.myoperator.EqualOp; -import mycompiler.myoperator.GreaterEquOp; -import mycompiler.myoperator.GreaterOp; -import mycompiler.myoperator.LessEquOp; -import mycompiler.myoperator.LessOp; -import mycompiler.myoperator.MinusOp; -import mycompiler.myoperator.ModuloOp; -import mycompiler.myoperator.NotEqualOp; -import mycompiler.myoperator.Operator; -import mycompiler.myoperator.OrOp; -import mycompiler.myoperator.PlusOp; -import mycompiler.myoperator.TimesOp; -import mycompiler.mystatement.ArgumentList; -import mycompiler.mystatement.Assign; -import mycompiler.mystatement.Binary; -import mycompiler.mystatement.Block; -import mycompiler.mystatement.BoolLiteral; -import mycompiler.mystatement.FloatLiteral; -import mycompiler.mystatement.DoubleLiteral; -import mycompiler.mystatement.LongLiteral; -import mycompiler.mystatement.CastExpr; -import mycompiler.mystatement.CharLiteral; -import mycompiler.mystatement.EmptyStmt; -import mycompiler.mystatement.Expr; -import mycompiler.mystatement.ExprStmt; -import mycompiler.mystatement.IfStmt; -import mycompiler.mystatement.InstanceOf; -import mycompiler.mystatement.IntLiteral; -import mycompiler.mystatement.Literal; -import mycompiler.mystatement.InstVar; -import mycompiler.mystatement.LocalOrFieldVar; -import mycompiler.mystatement.LocalVarDecl; -import mycompiler.mystatement.MethodCall; -import mycompiler.mystatement.NegativeExpr; -import mycompiler.mystatement.NewClass; -import mycompiler.mystatement.NotExpr; -import mycompiler.mystatement.Null; -import mycompiler.mystatement.PositivExpr; -import mycompiler.mystatement.PostDecExpr; -import mycompiler.mystatement.PostIncExpr; -import mycompiler.mystatement.PreDecExpr; -import mycompiler.mystatement.PreIncExpr; -import mycompiler.mystatement.Receiver; -import mycompiler.mystatement.Return; -import mycompiler.mystatement.Statement; -import mycompiler.mystatement.StringLiteral; -import mycompiler.mystatement.This; -import mycompiler.mystatement.UnaryMinus; -import mycompiler.mystatement.UnaryNot; -import mycompiler.mystatement.UnaryPlus; -import mycompiler.mystatement.WhileStmt; -import mycompiler.mystatement.ForStmt; -import mycompiler.mystatement.LambdaExpression; -import mycompiler.mytype.BaseType; -import mycompiler.mytype.BooleanType; -import mycompiler.mytype.CharacterType; -import mycompiler.mytype.GenericTypeVar; -import mycompiler.mytype.BoundedGenericTypeVar; -import mycompiler.mytype.IntegerType; -import mycompiler.mytype.ParaList; -import mycompiler.mytype.RefType; -import mycompiler.mytype.Type; -import mycompiler.mytype.TypePlaceholder; -import mycompiler.mytype.Void; -import mycompiler.mytype.WildcardType; -import mycompiler.mytype.ExtendsWildcardType; -import mycompiler.mytype.SuperWildcardType; -import mycompiler.mytype.Pair; public class JavaParser{ public Vector path = new Vector(); diff --git a/src/de/dhbwstuttgart/syntaxtree/Class.java b/src/de/dhbwstuttgart/syntaxtree/Class.java index 9a7b8ffc1..d8a66302c 100755 --- a/src/de/dhbwstuttgart/syntaxtree/Class.java +++ b/src/de/dhbwstuttgart/syntaxtree/Class.java @@ -20,7 +20,6 @@ import de.dhbwstuttgart.syntaxtree.statement.Block; import de.dhbwstuttgart.syntaxtree.statement.Expr; import de.dhbwstuttgart.syntaxtree.statement.Statement; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; import de.dhbwstuttgart.syntaxtree.type.Type; diff --git a/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java b/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java index 087689c90..4f2e5a4d5 100644 --- a/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java +++ b/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java @@ -10,6 +10,7 @@ import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.typeinference.ConstraintType; import de.dhbwstuttgart.typeinference.ConstraintsSet; import de.dhbwstuttgart.typeinference.JavaCodeResult; import de.dhbwstuttgart.typeinference.OderConstraint; @@ -136,7 +137,7 @@ public class FieldDeclaration extends Field{ */ //TypeCheck, falls es sich um einen RefType handelt: - this.getType().checkType(localAssumptions, this); + ConstraintType thisType = this.getType().TYPE(localAssumptions, this); /* if(this.getType()!=null && (this.getType() instanceof RefType)){ Type replaceType = null; @@ -146,13 +147,13 @@ public class FieldDeclaration extends Field{ } */ - SingleConstraint c1 = new SingleConstraint(this.getType(), this.getType()); + SingleConstraint c1 = new SingleConstraint(thisType, thisType); ret.add(c1); //Damit die TypVariable des Felds in den Constraints auftaucht if(this.wert!=null){ //Falls bei der Deklaration ein Wert zugewiesen wird, verhält sich das Constraintserzeugen wie bei dem Assign-Statement: ret.add(this.wert.TYPEExpr(localAssumptions)); - ret.add(new SingleConstraint(this.wert.getType(), this.getType())); + ret.add(new SingleConstraint(this.wert.getType().TYPE(localAssumptions,this), thisType)); } return ret; } diff --git a/src/de/dhbwstuttgart/syntaxtree/Method.java b/src/de/dhbwstuttgart/syntaxtree/Method.java index a1044daf8..777b8be4b 100755 --- a/src/de/dhbwstuttgart/syntaxtree/Method.java +++ b/src/de/dhbwstuttgart/syntaxtree/Method.java @@ -527,7 +527,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable } //TypeCheck, falls es sich um einen RefType handelt: - this.returntype = this.returntype.checkType(localAss, this); + this.returntype = this.returntype.TYPE(localAss, this).getType(); /* if(this.returntype!=null && (this.returntype instanceof RefType)&& !(this.returntype instanceof mycompiler.mytype.Void)){//Sonderfall der Methode: Ihr Typ darf Void definiert werden. @@ -540,7 +540,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable //Die Parameter zu den Assumptions hinzufügen: if(this.parameterlist!=null)for(FormalParameter param : this.parameterlist){ - param.setType(param.getType().checkType(localAss, this)); + param.setType(param.getType().TYPE(localAss, this).getType()); /* if(param.getType() instanceof RefType) { @@ -556,7 +556,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable } ret.add(this.block.TYPEStmt(localAss)); //eine Verknüpfung mit der Type Assumption aus dem Assumption Set und dem ermittelten Typ der Methode: - ret.add(new SingleConstraint(this.block.getType(), this.returntype)); + ret.add(new SingleConstraint(this.block.getType().TYPE(localAss, this), this.returntype.TYPE(localAss, this))); return ret; } diff --git a/src/de/dhbwstuttgart/syntaxtree/SourceFile.java b/src/de/dhbwstuttgart/syntaxtree/SourceFile.java index c2fb4b18c..69ede18c2 100755 --- a/src/de/dhbwstuttgart/syntaxtree/SourceFile.java +++ b/src/de/dhbwstuttgart/syntaxtree/SourceFile.java @@ -26,7 +26,6 @@ import de.dhbwstuttgart.syntaxtree.modifier.Modifiers; import de.dhbwstuttgart.syntaxtree.modifier.Public; import de.dhbwstuttgart.syntaxtree.type.BooleanType; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; @@ -35,6 +34,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet; import de.dhbwstuttgart.typeinference.FunN; import de.dhbwstuttgart.typeinference.FunNInterface; import de.dhbwstuttgart.typeinference.FunNMethod; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.UndConstraint; @@ -1631,5 +1631,21 @@ public class SourceFile //this.filename = filename; } + + + @Override + public int getOffset() { + // TODO Auto-generated method stub + return 0; + } + + + + @Override + public int getVariableLength() { + // TODO Auto-generated method stub + return 0; + } + } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java b/src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java index 15c8a373a..7e621eebe 100644 --- a/src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java +++ b/src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java @@ -2,10 +2,11 @@ package de.dhbwstuttgart.syntaxtree; import java.util.Vector; +import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.TypeInsertable; import de.dhbwstuttgart.typeinference.exceptions.DebugException; @@ -14,7 +15,7 @@ import de.dhbwstuttgart.typeinference.typedeployment.GenericTypeInsertPoint; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertPoint; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; -public abstract class SyntaxTreeNode{ +public abstract class SyntaxTreeNode implements IItemWithOffset{ protected SyntaxTreeNode parent; diff --git a/src/de/dhbwstuttgart/syntaxtree/misc/UsedId.java b/src/de/dhbwstuttgart/syntaxtree/misc/UsedId.java index 78b68fb4d..4670605de 100755 --- a/src/de/dhbwstuttgart/syntaxtree/misc/UsedId.java +++ b/src/de/dhbwstuttgart/syntaxtree/misc/UsedId.java @@ -312,7 +312,7 @@ public class UsedId implements IItemWithOffset // ino.end public JavaCodeResult printJavaCode(ResultSet resultSet) { - if(this.name.size()>1)throw new TypeinferenceException("Es kann maximal nur eine Superklasse pro Klasse geben", this); + if(this.name.size()>1)throw new TypeinferenceException("Es kann maximal nur eine Superklasse pro Klasse geben", null); JavaCodeResult ret = new JavaCodeResult(this.getQualifiedName().toString()); if(this.paralist != null){ ret.attach( "<" ); diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/AddOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/AddOp.java index 5dae26d7a..2769dd909 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/AddOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/AddOp.java @@ -14,10 +14,11 @@ import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.statement.Binary; import de.dhbwstuttgart.syntaxtree.statement.Expr; import de.dhbwstuttgart.syntaxtree.type.IntegerType; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; +import de.dhbwstuttgart.typeinference.ConstraintType; import de.dhbwstuttgart.typeinference.ConstraintsSet; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.SingleConstraint; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; import de.dhbwstuttgart.typeinference.exceptions.DebugException; @@ -59,8 +60,8 @@ public abstract class AddOp extends Operator } @Override - public HashMap getReturnTypes(TypeAssumptions ass) { - HashMap ret = new HashMap(); + public HashMap getReturnTypes(TypeAssumptions ass) { + HashMap ret = new HashMap(); ret.put(ass.getTypeFor(new RefType("java.lang.Integer",-1), this), ass.getTypeFor(new RefType("java.lang.Integer",-1),this)); ret.put(ass.getTypeFor(new RefType("java.lang.Double",-1), this), ass.getTypeFor(new RefType("java.lang.Double",-1),this)); ret.put(ass.getTypeFor(new RefType("java.lang.Float",-1), this), ass.getTypeFor(new RefType("java.lang.Float",-1),this)); diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/AndOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/AndOp.java index 85081d7a4..9afe711cf 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/AndOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/AndOp.java @@ -1,6 +1,9 @@ // ino.module.AndOp.8595.package package de.dhbwstuttgart.syntaxtree.operator; +import java.util.Vector; + +import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.statement.Expr; import de.dhbwstuttgart.syntaxtree.type.BooleanType; import de.dhbwstuttgart.syntaxtree.type.IntegerType; diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/DivideOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/DivideOp.java index c09b2b6b4..e5ebac5e8 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/DivideOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/DivideOp.java @@ -8,6 +8,7 @@ import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; +import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.statement.Binary; import de.dhbwstuttgart.syntaxtree.statement.Expr; @@ -41,7 +42,7 @@ public class DivideOp extends MulOp code.add_code(JVMCode.ndiv(expr1.getTypeName())); } // ino.end - + } diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/EqualOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/EqualOp.java index c8f58be3f..99198400f 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/EqualOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/EqualOp.java @@ -10,11 +10,12 @@ import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; +import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.statement.Binary; import de.dhbwstuttgart.syntaxtree.statement.Expr; import de.dhbwstuttgart.syntaxtree.statement.Null; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.unify.Unify; @@ -75,6 +76,8 @@ public class EqualOp extends RelOp else code.add_code(JVMCode.if_ncmpeq(type)); } // ino.end + + } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/GreaterEquOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/GreaterEquOp.java index 2027d865c..1577b463a 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/GreaterEquOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/GreaterEquOp.java @@ -8,6 +8,7 @@ import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; +import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.statement.Binary; import de.dhbwstuttgart.syntaxtree.statement.Expr; diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/LogOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/LogOp.java index 33472b5b6..511cc9b79 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/LogOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/LogOp.java @@ -18,10 +18,11 @@ import de.dhbwstuttgart.syntaxtree.statement.NotExpr; import de.dhbwstuttgart.syntaxtree.statement.Null; import de.dhbwstuttgart.syntaxtree.statement.Statement; import de.dhbwstuttgart.syntaxtree.type.BooleanType; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; +import de.dhbwstuttgart.typeinference.ConstraintType; import de.dhbwstuttgart.typeinference.ConstraintsSet; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.SingleConstraint; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; import de.dhbwstuttgart.typeinference.exceptions.DebugException; @@ -229,8 +230,8 @@ public abstract class LogOp extends Operator } @Override - public HashMap getReturnTypes(TypeAssumptions ass) { - HashMap ret = new HashMap(); + public HashMap getReturnTypes(TypeAssumptions ass) { + HashMap ret = new HashMap<>(); ret.put(ass.getTypeFor(new RefType("java.lang.Boolean",-1), this), ass.getTypeFor(new RefType("java.lang.Boolean",-1), this)); return ret; diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/MulOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/MulOp.java index 47c8d887a..f28819ade 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/MulOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/MulOp.java @@ -10,9 +10,10 @@ import java.util.Vector; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.syntaxtree.statement.Binary; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; +import de.dhbwstuttgart.typeinference.ConstraintType; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; import de.dhbwstuttgart.typeinference.exceptions.DebugException; import de.dhbwstuttgart.typeinference.unify.Unify; @@ -40,8 +41,8 @@ public abstract class MulOp extends Operator } @Override - public HashMap getReturnTypes(TypeAssumptions ass) { - HashMap ret = new HashMap(); + public HashMap getReturnTypes(TypeAssumptions ass) { + HashMap ret = new HashMap<>(); ret.put(ass.getTypeFor(new RefType("java.lang.Integer",-1), this), ass.getTypeFor(new RefType("java.lang.Integer",-1), this)); ret.put(ass.getTypeFor(new RefType("java.lang.Double",-1), this), ass.getTypeFor(new RefType("java.lang.Double",-1), this)); ret.put(ass.getTypeFor(new RefType("java.lang.Float",-1), this), ass.getTypeFor(new RefType("java.lang.Float",-1), this)); diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/NotEqualOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/NotEqualOp.java index 91b229247..c95f341a0 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/NotEqualOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/NotEqualOp.java @@ -13,8 +13,8 @@ import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.statement.Binary; import de.dhbwstuttgart.syntaxtree.statement.Expr; import de.dhbwstuttgart.syntaxtree.statement.Null; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.unify.Unify; // ino.class.NotEqualOp.24241.declaration diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/Operator.java b/src/de/dhbwstuttgart/syntaxtree/operator/Operator.java index 29304f017..5f8aef61b 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/Operator.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/Operator.java @@ -13,14 +13,16 @@ import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; +import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.statement.Binary; import de.dhbwstuttgart.syntaxtree.statement.Expr; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.typeinference.ConstraintType; import de.dhbwstuttgart.typeinference.ConstraintsSet; import de.dhbwstuttgart.typeinference.OderConstraint; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.SingleConstraint; import de.dhbwstuttgart.typeinference.UndConstraint; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; @@ -30,7 +32,7 @@ import de.dhbwstuttgart.typeinference.unify.Unify; // ino.class.Operator.24257.declaration -public abstract class Operator implements IItemWithOffset +public abstract class Operator extends SyntaxTreeNode // ino.end // ino.class.Operator.24257.body { @@ -120,7 +122,12 @@ public abstract class Operator implements IItemWithOffset * @param ass * @return */ - public abstract HashMap getReturnTypes(TypeAssumptions ass); + public abstract HashMap getReturnTypes(TypeAssumptions ass); + + @Override + public Vector getChildren() { + return new Vector<>(); + } } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/RelOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/RelOp.java index ec22a5e2b..0c75a3592 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/RelOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/RelOp.java @@ -13,9 +13,10 @@ import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.statement.Binary; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; +import de.dhbwstuttgart.typeinference.ConstraintType; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; import de.dhbwstuttgart.typeinference.exceptions.DebugException; import de.dhbwstuttgart.typeinference.unify.Unify; @@ -51,8 +52,8 @@ public abstract class RelOp extends Operator } @Override - public HashMap getReturnTypes(TypeAssumptions ass) { - HashMap ret = new HashMap(); + public HashMap getReturnTypes(TypeAssumptions ass) { + HashMap ret = new HashMap<>(); ret.put(ass.getTypeFor(new RefType("java.lang.Boolean",-1), this), ass.getTypeFor(new RefType("java.lang.Integer",-1), this)); ret.put(ass.getTypeFor(new RefType("java.lang.Boolean",-1), this), ass.getTypeFor(new RefType("java.lang.Double",-1), this)); ret.put(ass.getTypeFor(new RefType("java.lang.Boolean",-1), this), ass.getTypeFor(new RefType("java.lang.Float",-1), this)); diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java b/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java index 941734b31..e10cded54 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java @@ -20,13 +20,13 @@ import de.dhbwstuttgart.parser.JavaClassName; import de.dhbwstuttgart.syntaxtree.Class; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; import de.dhbwstuttgart.syntaxtree.type.Void; import de.dhbwstuttgart.typeinference.ConstraintsSet; import de.dhbwstuttgart.typeinference.FreshTypeVariable; import de.dhbwstuttgart.typeinference.JavaCodeResult; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.SingleConstraint; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; @@ -189,8 +189,8 @@ public class Assign extends Expr ret.add(expr2.TYPEExpr(assumptions)); //this.setTypeVariable( TypePlaceholder.fresh(this)); this.setType(TypePlaceholder.fresh(this)); - ret.add(new SingleConstraint(expr2.getType(), expr1.getType())); //expr2.type <. expr1.type - ret.add(new SingleConstraint(expr1.getType(), this.getType())); + ret.add(new SingleConstraint(expr2.getType().TYPE(assumptions, this), expr1.getType().TYPE(assumptions, this))); //expr2.type <. expr1.type + ret.add(new SingleConstraint(expr1.getType().TYPE(assumptions, this), this.getType().TYPE(assumptions, this))); return ret; } diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Binary.java b/src/de/dhbwstuttgart/syntaxtree/statement/Binary.java index 53f8886db..3e4785efd 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Binary.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Binary.java @@ -7,8 +7,8 @@ import java.util.HashMap; import java.util.Hashtable; import java.util.Vector; - import org.apache.log4j.Logger; + import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.bytecode.JVMCode; @@ -24,13 +24,14 @@ import de.dhbwstuttgart.syntaxtree.operator.MulOp; import de.dhbwstuttgart.syntaxtree.operator.Operator; import de.dhbwstuttgart.syntaxtree.operator.RelOp; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.typeinference.ConstraintType; import de.dhbwstuttgart.typeinference.ConstraintsSet; import de.dhbwstuttgart.typeinference.JavaCodeResult; import de.dhbwstuttgart.typeinference.OderConstraint; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.SingleConstraint; import de.dhbwstuttgart.typeinference.UndConstraint; @@ -259,12 +260,12 @@ public class Binary extends BinaryExpr */ if(this.getType()==null)this.set_Type(TypePlaceholder.fresh(this)); OderConstraint oderCons = new OderConstraint(); - HashMap rMap = this.op.getReturnTypes(assumptions); - for(Type rT : rMap.keySet()){ + HashMap rMap = this.op.getReturnTypes(assumptions); + for(ConstraintType rT : rMap.keySet()){ UndConstraint c = new UndConstraint(); - c.addConstraint(this.getType(),rT); - c.addConstraint(this.expr1.getType(), rMap.get(rT)); - c.addConstraint(this.expr2.getType(), rMap.get(rT)); + c.addConstraint(this.getType().TYPE(assumptions, this),rT); + c.addConstraint(this.expr1.getType().TYPE(assumptions, this), rMap.get(rT)); + c.addConstraint(this.expr2.getType().TYPE(assumptions, this), rMap.get(rT)); oderCons.addConstraint(c); } ret.add(oderCons); diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Block.java b/src/de/dhbwstuttgart/syntaxtree/statement/Block.java index 0a5796aeb..5ae6bba8e 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Block.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Block.java @@ -7,8 +7,8 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; - import org.apache.log4j.Logger; + import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.myexception.CTypeReconstructionException; @@ -21,6 +21,7 @@ import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; import de.dhbwstuttgart.syntaxtree.type.Void; +import de.dhbwstuttgart.typeinference.ConstraintType; import de.dhbwstuttgart.typeinference.ConstraintsSet; import de.dhbwstuttgart.typeinference.FreshTypeVariable; import de.dhbwstuttgart.typeinference.JavaCodeResult; @@ -192,8 +193,8 @@ public class Block extends Statement } else { TypePlaceholder tph = TypePlaceholder.fresh(this); - ret.add(new SingleConstraint(this.getType(), tph)); - ret.add(new SingleConstraint(stmt.getType(), tph)); + ret.add(new SingleConstraint(this.getType().TYPE(assumptions, this), new ConstraintType(tph))); + ret.add(new SingleConstraint(stmt.getType().TYPE(assumptions, this), new ConstraintType(tph))); this.setType(tph); } } diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/BoolLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/BoolLiteral.java index b1b39e808..39c4b6fa4 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/BoolLiteral.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/BoolLiteral.java @@ -126,12 +126,10 @@ public class BoolLiteral extends Literal @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { - this.type = assumptions.getTypeFor(new RefType("java.lang.Boolean",-1), this); + this.type = assumptions.getTypeFor(new RefType("java.lang.Boolean",-1), this).getType(); return new ConstraintsSet(); } - - @Override public JavaCodeResult printJavaCode(ResultSet resultSet) { if(Bool)return new JavaCodeResult("true"); diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/DoubleLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/DoubleLiteral.java index 903ee739f..97fc74067 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/DoubleLiteral.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/DoubleLiteral.java @@ -164,7 +164,7 @@ public class DoubleLiteral extends Literal @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { - this.setType(assumptions.getTypeFor(new RefType("Double",this.getOffset()), this)); + this.setType(assumptions.getTypeFor(new RefType("Double",this.getOffset()), this).getType()); return new ConstraintsSet(); } diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ExprStmt.java b/src/de/dhbwstuttgart/syntaxtree/statement/ExprStmt.java index 370af3480..14451efd0 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/ExprStmt.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/ExprStmt.java @@ -7,10 +7,11 @@ import java.util.Iterator; import java.util.Vector; import org.apache.log4j.Logger; + import de.dhbwstuttgart.core.MyCompiler; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.unify.Unify; // ino.class.ExprStmt.25265.declaration diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java b/src/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java index bd78a1fdb..3f02f4012 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java @@ -5,7 +5,6 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; - import org.apache.log4j.Logger; import de.dhbwstuttgart.bytecode.ClassFile; @@ -21,11 +20,11 @@ import de.dhbwstuttgart.syntaxtree.operator.LogOp; import de.dhbwstuttgart.syntaxtree.operator.Operator; import de.dhbwstuttgart.syntaxtree.operator.RelOp; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.typeinference.ConstraintsSet; import de.dhbwstuttgart.typeinference.JavaCodeResult; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; import de.dhbwstuttgart.typeinference.unify.Unify; diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java b/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java index 0cae62ade..fe0a14362 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java @@ -8,6 +8,7 @@ import java.util.Iterator; import java.util.Vector; import org.apache.log4j.Logger; + import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.bytecode.JVMCode; @@ -22,7 +23,6 @@ import de.dhbwstuttgart.syntaxtree.operator.Operator; import de.dhbwstuttgart.syntaxtree.operator.RelOp; import de.dhbwstuttgart.syntaxtree.type.BooleanType; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; @@ -30,6 +30,7 @@ import de.dhbwstuttgart.syntaxtree.type.Void; import de.dhbwstuttgart.typeinference.ConstraintsSet; import de.dhbwstuttgart.typeinference.FreshTypeVariable; import de.dhbwstuttgart.typeinference.JavaCodeResult; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.SingleConstraint; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; @@ -256,10 +257,10 @@ public class IfStmt extends Statement ret.add(this.then_block.TYPEStmt(assumptions)); if(else_block!=null){ ret.add(this.else_block.TYPEStmt(assumptions)); - if(!(else_block.getType() instanceof Void))ret.add(new SingleConstraint(else_block.getType(),this.getType())); + if(!(else_block.getType() instanceof Void))ret.add(new SingleConstraint(else_block.getType().TYPE(assumptions, this),this.getType().TYPE(assumptions, this))); } - ret.add(new SingleConstraint(expr.getType(),assumptions.getTypeFor(new RefType("Boolean",0), this))); //(expressionDesIfStmt)<.boolean - if(!(then_block.getType() instanceof Void))ret.add(new SingleConstraint(then_block.getType(),this.getType())); + ret.add(new SingleConstraint(expr.getType().TYPE(assumptions, this),assumptions.getTypeFor(new RefType("Boolean",0), this))); //(expressionDesIfStmt)<.boolean + if(!(then_block.getType() instanceof Void))ret.add(new SingleConstraint(then_block.getType().TYPE(assumptions, this),this.getType().TYPE(assumptions, this))); if(then_block.getType() instanceof Void && (else_block == null || else_block.getType() instanceof Void))this.setType(new Void(this.getOffset())); return ret; diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/InstVar.java b/src/de/dhbwstuttgart/syntaxtree/statement/InstVar.java index f149e94e9..c78108bac 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/InstVar.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/InstVar.java @@ -6,6 +6,7 @@ import java.util.Enumeration; import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; + import org.apache.log4j.Logger; import de.dhbwstuttgart.bytecode.ClassFile; @@ -17,7 +18,6 @@ import de.dhbwstuttgart.syntaxtree.Class; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.misc.UsedId; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; @@ -25,6 +25,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet; import de.dhbwstuttgart.typeinference.FreshTypeVariable; import de.dhbwstuttgart.typeinference.JavaCodeResult; import de.dhbwstuttgart.typeinference.OderConstraint; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.UndConstraint; @@ -211,8 +212,8 @@ public class InstVar extends Expr OderConstraint oderConstraint = new OderConstraint(); for(FieldAssumption fa : assumptions.getFieldVars(this.get_Name())){ UndConstraint undConstraint = new UndConstraint(); - undConstraint.addConstraint(fa.getAssumedType(),this.getType()); - undConstraint.addConstraint(this.expr.getType(),fa.getParentClass().getType()); + undConstraint.addConstraint(fa.getAssumedType().TYPE(assumptions, this),this.getType().TYPE(assumptions, this)); + undConstraint.addConstraint(this.expr.getType().TYPE(assumptions, this),fa.getParentClass().getType().TYPE(assumptions, this)); oderConstraint.addConstraint(undConstraint); } ret.add(oderConstraint); diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/IntLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/IntLiteral.java index f90970c48..c06c6d679 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/IntLiteral.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/IntLiteral.java @@ -161,7 +161,7 @@ public class IntLiteral extends Literal public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { ConstraintsSet ret = new ConstraintsSet(); //this.setType(new IntegerType()); - this.set_Type(assumptions.getTypeFor(new RefType("java.lang.Integer",-1), this)); + this.set_Type(assumptions.getTypeFor(new RefType("java.lang.Integer",-1), this).getType()); return ret; } diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java b/src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java index 64891b302..b65fad8ef 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java @@ -149,7 +149,7 @@ public class LambdaExpression extends Expr{ this.setType(TypePlaceholder.fresh(this)); //ArgumentAssumptions + assumptions ergeben die Assumptions für die Statements innerhalb des Lambda-Bodys: ret.add(method_body.TYPEStmt(ArgumentAssumptions.add(assumptions))); //Es gibt die LambdaExpression nur mit einem Block als Method Body, nicht mit einer einzelnen Expression - ret.add(new SingleConstraint(new FunN(method_body.getType(), paramTypes),this.getType())); + ret.add(new SingleConstraint(new FunN(method_body.getType(), paramTypes).TYPE(assumptions, this),this.getType().TYPE(assumptions, this))); return ret; } diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java b/src/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java index 946812366..048cab24a 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java @@ -379,13 +379,11 @@ public class LocalVarDecl extends Statement implements TypeInsertable ConstraintsSet ret = new ConstraintsSet(); if((this.getType() instanceof RefType)){ Type replaceType = null; - replaceType = assumptions.getTypeFor((RefType)this.getType(), this); - if(replaceType == null) - throw new TypeinferenceException("Der Typ "+this.getType().getName()+" ist nicht korrekt",this); + replaceType = assumptions.getTypeFor((RefType)this.getType(), this).getType(); this.setType(replaceType); } assumptions.addAssumption(new LocalVarAssumption(this, this.getType())); //Bevor der Typ auf Void gesetzt wird. - ret.add(new SingleConstraint(this.getType(), this.getType())); + ret.add(new SingleConstraint(this.getType().TYPE(assumptions, this), this.getType().TYPE(assumptions, this))); //assumptions.remove(null); // falls Variable mit diesem Namen bereits vorhanden. this.setReturnType(new Void(0)); //Return typ einer Variablendeklaration ist Void return ret; diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/NegativeExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/NegativeExpr.java index 6d9aa6f46..c83cfe5a0 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/NegativeExpr.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/NegativeExpr.java @@ -6,8 +6,8 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; - import org.apache.log4j.Logger; + import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.myexception.CTypeReconstructionException; @@ -17,12 +17,12 @@ import de.dhbwstuttgart.myexception.SCStatementException; import de.dhbwstuttgart.syntaxtree.Class; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.Void; import de.dhbwstuttgart.typeinference.ConstraintsSet; import de.dhbwstuttgart.typeinference.JavaCodeResult; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet; diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/NewClass.java b/src/de/dhbwstuttgart/syntaxtree/statement/NewClass.java index 9e562ef0e..4269bc312 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/NewClass.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/NewClass.java @@ -219,13 +219,13 @@ public class NewClass extends Expr for(int i=0; i parameterList = new Vector<>(); + Vector parameterList = new Vector<>(); + Vector parameterList2 = new Vector<>(); if(this.parameter!=null)for(Type param : this.parameter){ - parameterList.add(param.checkType(ass, parent)); + ConstraintType ct = param.TYPE(ass, parent); + parameterList.add(ct); + parameterList2.add(ct.getType()); } - this.parameter = parameterList; - Type t = super.checkType(ass,parent); + this.parameter = parameterList2; + ConstraintType t = super.TYPE(ass,parent); return t; } diff --git a/src/de/dhbwstuttgart/syntaxtree/type/Type.java b/src/de/dhbwstuttgart/syntaxtree/type/Type.java index 8fab0c18b..b4ff52908 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/Type.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/Type.java @@ -5,11 +5,13 @@ package de.dhbwstuttgart.syntaxtree.type; import java.util.ArrayList; import java.util.Vector; +import sun.reflect.generics.reflectiveObjects.NotImplementedException; import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.parser.JavaClassName; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.misc.UsedId; +import de.dhbwstuttgart.typeinference.ConstraintType; import de.dhbwstuttgart.typeinference.JavaCodeResult; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; @@ -285,9 +287,17 @@ public class Type extends SyntaxTreeNode implements IItemWithOffset * Prüft ob der Typ in den Assumptions ass vorhanden ist. * Dabei kann eine neue Instanz eines Typs entstehen, welche von der Methode zurückgegeben wird. * @param ass - Die Assumptions für den jeweiligen Kontext in dem sich der Typ befindet. - */ - public Type checkType(TypeAssumptions ass, IItemWithOffset parent){ - Type t = ass.getTypeFor(this, this); + + public ConstraintType checkType(TypeAssumptions ass, SyntaxTreeNode parent){ + ConstraintType t = ass.getTypeFor(this, this); + if(t==null) + throw new TypeinferenceException("Der Typ "+this.getName()+" ist nicht korrekt", parent); + return t; + } + */ + //TODO: checkType wird nicht mehr gebraucht. TYPE übernimmt dessen Aufgabe. Es muss nur sichergestellt werden, dass jeder Typ in den Constraints landet, dadurch wird für jeden Typ die Methode TYPE aufgerufen. + public ConstraintType TYPE(TypeAssumptions ass, SyntaxTreeNode parent){ + ConstraintType t = ass.getTypeFor(this, this); if(t==null) throw new TypeinferenceException("Der Typ "+this.getName()+" ist nicht korrekt", parent); return t; diff --git a/src/de/dhbwstuttgart/syntaxtree/type/Void.java b/src/de/dhbwstuttgart/syntaxtree/type/Void.java index 4a07a13a5..54d732771 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/Void.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/Void.java @@ -3,6 +3,8 @@ package de.dhbwstuttgart.syntaxtree.type; import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.syntaxtree.Method; +import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; +import de.dhbwstuttgart.typeinference.ConstraintType; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException; @@ -69,8 +71,8 @@ public class Void extends RefType // ino.end @Override - public Type checkType(TypeAssumptions ass, IItemWithOffset parent){ - return this; + public ConstraintType TYPE(TypeAssumptions ass, SyntaxTreeNode parent){ + return new ConstraintType(this); } } // ino.end diff --git a/src/de/dhbwstuttgart/typeinference/ConstraintPair.java b/src/de/dhbwstuttgart/typeinference/ConstraintPair.java new file mode 100644 index 000000000..f49151395 --- /dev/null +++ b/src/de/dhbwstuttgart/typeinference/ConstraintPair.java @@ -0,0 +1,15 @@ +package de.dhbwstuttgart.typeinference; + +public class ConstraintPair { + + private Pair p; + + public ConstraintPair(ConstraintType t1, ConstraintType t2){ + p = new Pair(t1.getType(), t2.getType()); + } + + public Pair getPair(){ + return p; + } + +} diff --git a/src/de/dhbwstuttgart/typeinference/ConstraintType.java b/src/de/dhbwstuttgart/typeinference/ConstraintType.java new file mode 100644 index 000000000..f4ff991aa --- /dev/null +++ b/src/de/dhbwstuttgart/typeinference/ConstraintType.java @@ -0,0 +1,22 @@ +package de.dhbwstuttgart.typeinference; + +import de.dhbwstuttgart.syntaxtree.type.*; + +public class ConstraintType{ + + private Type t; + + public ConstraintType(TypePlaceholder t){ + this.t = t; + } + public ConstraintType(GenericTypeVar t){ + this.t = t; + } + public ConstraintType(RefType t){ + this.t = t; + } + public Type getType() { + return t; + } + +} diff --git a/src/de/dhbwstuttgart/typeinference/ConstraintsSet.java b/src/de/dhbwstuttgart/typeinference/ConstraintsSet.java index d07ab2c0f..889cf0a6e 100755 --- a/src/de/dhbwstuttgart/typeinference/ConstraintsSet.java +++ b/src/de/dhbwstuttgart/typeinference/ConstraintsSet.java @@ -3,8 +3,6 @@ package de.dhbwstuttgart.typeinference; import java.util.Iterator; import java.util.Vector; -import de.dhbwstuttgart.syntaxtree.type.Pair; - public class ConstraintsSet implements Iterable{ private Vector constraintsSet; diff --git a/src/de/dhbwstuttgart/typeinference/FunNInterface.java b/src/de/dhbwstuttgart/typeinference/FunNInterface.java index ac64a8a33..c41c228c5 100644 --- a/src/de/dhbwstuttgart/typeinference/FunNInterface.java +++ b/src/de/dhbwstuttgart/typeinference/FunNInterface.java @@ -2,6 +2,7 @@ package de.dhbwstuttgart.typeinference; import java.util.Vector; +import de.dhbwstuttgart.parser.JavaClassName; import de.dhbwstuttgart.syntaxtree.Class; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; import de.dhbwstuttgart.syntaxtree.type.Type; @@ -18,17 +19,27 @@ import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; public class FunNInterface extends Class{ //TODO: Diese Klasse sollte eigentlich von Interface erben //TODO: getType muss einen Typ mit der ParameterListe zurückliefern. + + + private Vector gtvparalist; + /** * Ein FunN-Interface enthält nur eine Methode (namens apply). Ist also ein Funktionales Interface. * @param N - Die Anzahl der Parameter der apply-Methode. Beispiel N = 1 ergibt R apply(T1 par1); */ public FunNInterface(int N) { super("Fun"+N, 0); - Vector paralist = new Vector(); - paralist.add(new GenericTypeVar("R",this, 0)); + GenericTypeVar gtv; + Vector paralist = new Vector<>(); + gtv = new GenericTypeVar("R",this, 0); + this.gtvparalist = new Vector(); + paralist.add(gtv); + this.gtvparalist.add(gtv); //paralist.add(TypePlaceholder.fresh()); for(int i = 1; i<=N;i++){ - paralist.add(new GenericTypeVar("T"+i,this, 0)); + gtv=new GenericTypeVar("T"+i,this, 0); + paralist.add(gtv); + this.gtvparalist.add(gtv); //paralist.add(TypePlaceholder.fresh()); } this.set_ParaList(paralist); @@ -43,6 +54,7 @@ public class FunNInterface extends Class{ TypeAssumptions ret = new TypeAssumptions(); ret.addAssumption(new MethodAssumption(this.getApplyFunction(), this)); ret.addClassAssumption(new ClassAssumption(this)); + for(GenericTypeVar gtv : this.gtvparalist)ret.addGenericVarAssumption(gtv); return ret; } diff --git a/src/de/dhbwstuttgart/typeinference/OderConstraint.java b/src/de/dhbwstuttgart/typeinference/OderConstraint.java index 92aa327ac..62eb2096e 100755 --- a/src/de/dhbwstuttgart/typeinference/OderConstraint.java +++ b/src/de/dhbwstuttgart/typeinference/OderConstraint.java @@ -2,7 +2,6 @@ package de.dhbwstuttgart.typeinference; import java.util.Vector; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; @@ -15,9 +14,9 @@ public class OderConstraint{ * @param p1 * @param p2 */ - public OderConstraint(Type p1, Type p2){ + public OderConstraint(ConstraintType p1, ConstraintType p2){ if(p1 == null || p2 == null)throw new NullPointerException(); - Pair constraintPair = new Pair(p1,p2); + ConstraintPair constraintPair = new ConstraintPair(p1,p2); oderConstraintPairs = new Vector(); this.addConstraint(constraintPair); } @@ -44,16 +43,16 @@ public class OderConstraint{ * @param p1 * @param p2 */ - public void addConstraint(Type p1, Type p2){ - addConstraint(new Pair(p1,p2)); + public void addConstraint(ConstraintType p1, ConstraintType p2){ + addConstraint(new ConstraintPair(p1,p2)); } /** * Falls die Type des toAdd-Pairs nicht vom Typ RefType bzw. TypePlaceholder sind, so werden sie in einen RefType umgewandelt. * @param toAdd */ - public void addConstraint(Pair toAdd){ - oderConstraintPairs.add(new SingleConstraint(toAdd.TA1, toAdd.TA2)); + public void addConstraint(ConstraintPair toAdd){ + oderConstraintPairs.add(new SingleConstraint(toAdd)); } @Override diff --git a/src/de/dhbwstuttgart/typeinference/Overloading.java b/src/de/dhbwstuttgart/typeinference/Overloading.java index b2d7dfae6..3db305e90 100755 --- a/src/de/dhbwstuttgart/typeinference/Overloading.java +++ b/src/de/dhbwstuttgart/typeinference/Overloading.java @@ -2,6 +2,7 @@ package de.dhbwstuttgart.typeinference; import java.util.Vector; +import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.statement.Expr; import de.dhbwstuttgart.syntaxtree.statement.MethodCall; import de.dhbwstuttgart.syntaxtree.type.RefType; @@ -65,12 +66,14 @@ public class Overloading{ if(!(this.type instanceof TypePlaceholder) && !this.type.equals(methodAssumption.getAssumedType()))break; UndConstraint methodConstraint = new UndConstraint(); //Ein Constraint für den ReturnType der Methode... - methodConstraint.addConstraint(methodAssumption.getAssumedType(), type); + methodConstraint.addConstraint(methodAssumption.getAssumedType().TYPE(assumptions, methodCall), type.TYPE(assumptions, methodCall)); //Ein Constraint für die Parameter der Methode... for(int i=0; i parameterAssumptions = new Vector(); @@ -83,7 +86,7 @@ public class Overloading{ //ret.add(new Constraint(methodCall.get_Receiver().get_Expr().getTypeVariable(), new RefType(assumption.getClassName(), null, 0))); if(methodCall.get_Receiver() != null && methodCall.get_Receiver().get_Expr() != null) //TODO: FunN-MethodAssumption darf keine Klasse (Class) als ParentClass besitzen. Denn der Typ der Klasse steht noch nicht fest (bisher ist es immer "FunN"). - methodConstraint.addConstraint(methodCall.get_Receiver().get_Expr().getType(), methodAssumption.getParentClassType()); + methodConstraint.addConstraint(methodCall.get_Receiver().get_Expr().getType().TYPE(assumptions, methodCall), methodAssumption.getParentClassType().TYPE(assumptions, methodCall)); //ret.add(new Constraint(methodCall.get_Receiver().get_Expr().getTypeVariable(), new RefType(assumption.getClassName(), parameterAssumptions, 0))); //return ret; //Bereits nach der ersten Assumption abbrechen... diff --git a/src/de/dhbwstuttgart/syntaxtree/type/Pair.java b/src/de/dhbwstuttgart/typeinference/Pair.java similarity index 96% rename from src/de/dhbwstuttgart/syntaxtree/type/Pair.java rename to src/de/dhbwstuttgart/typeinference/Pair.java index 81f84404f..e76fdba21 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/Pair.java +++ b/src/de/dhbwstuttgart/typeinference/Pair.java @@ -1,5 +1,5 @@ // ino.module.Pair.8673.package -package de.dhbwstuttgart.syntaxtree.type; +package de.dhbwstuttgart.typeinference; // ino.end // ino.module.Pair.8673.import import java.util.Hashtable; @@ -7,7 +7,14 @@ import java.util.Vector; // ino.end + import de.dhbwstuttgart.parser.JavaClassName; +import de.dhbwstuttgart.syntaxtree.type.FreshWildcardType; +import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; +import de.dhbwstuttgart.syntaxtree.type.RefType; +import de.dhbwstuttgart.syntaxtree.type.Type; +import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.syntaxtree.type.WildcardType; diff --git a/src/de/dhbwstuttgart/typeinference/ResultSet.java b/src/de/dhbwstuttgart/typeinference/ResultSet.java index 0a124ca23..e86335f02 100755 --- a/src/de/dhbwstuttgart/typeinference/ResultSet.java +++ b/src/de/dhbwstuttgart/typeinference/ResultSet.java @@ -3,7 +3,6 @@ package de.dhbwstuttgart.typeinference; import java.util.Iterator; import java.util.Vector; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; diff --git a/src/de/dhbwstuttgart/typeinference/SingleConstraint.java b/src/de/dhbwstuttgart/typeinference/SingleConstraint.java index 59062d299..2ab2e624d 100755 --- a/src/de/dhbwstuttgart/typeinference/SingleConstraint.java +++ b/src/de/dhbwstuttgart/typeinference/SingleConstraint.java @@ -3,7 +3,6 @@ package de.dhbwstuttgart.typeinference; import java.util.Vector; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; @@ -25,12 +24,16 @@ public class SingleConstraint extends UndConstraint{ private Pair constraintPair; //entspricht θ condition θ' //private R condition; //entspricht der condition (R) - public SingleConstraint(Type p1, Type p2){ + public SingleConstraint(ConstraintType p1, ConstraintType p2){ //super(p1,p2); - Pair constraintPair = new Pair(p1,p2);//super.getConstraintPairs().firstElement(); + ConstraintPair constraintPair = new ConstraintPair(p1,p2);//super.getConstraintPairs().firstElement(); this.addConstraint(constraintPair); } + public SingleConstraint(ConstraintPair toAdd) { + this.addConstraint(toAdd); + } + public Pair getPair(){ return constraintPair; } @@ -42,11 +45,11 @@ public class SingleConstraint extends UndConstraint{ return ret; } - public void addConstraint(Pair toAdd){ + public void addConstraint(ConstraintPair toAdd){ if(constraintPair != null)throw new DebugException("Ein Constraint darf nur aus einem ConstraintPair bestehen. Das hinzufügen von "+ toAdd + " ist nicht möglich."); - Type p1 = toAdd.TA1; - Type p2 = toAdd.TA2; + Type p1 = toAdd.getPair().TA1; + Type p2 = toAdd.getPair().TA2; if(p1==null || p2 == null)throw new NullPointerException(); @@ -58,15 +61,15 @@ public class SingleConstraint extends UndConstraint{ //if((p2 instanceof GenericTypeVar))p2 = ((GenericTypeVar)p2).getTypePlaceHolder();//throw new DebugException("GenericTypeVar sind in den Constraints nicht erlaubt");// // BaseTypes werden in RefTypes umgewandelt. Constraints dürfen nur RefTypes oder TypePlaceholder enthalten, da sonst der Unify-Algorithmus nicht funktioniert. - if(!(p1 instanceof RefType) && !(p1 instanceof TypePlaceholder) && !(p1 instanceof GenericTypeVar))p1 = new RefType(p1); - if(!(p2 instanceof RefType) && !(p2 instanceof TypePlaceholder) && !(p2 instanceof GenericTypeVar))p2 = new RefType(p2); + //if(!(p1 instanceof RefType) && !(p1 instanceof TypePlaceholder) && !(p1 instanceof GenericTypeVar))p1 = new RefType(p1); + //if(!(p2 instanceof RefType) && !(p2 instanceof TypePlaceholder) && !(p2 instanceof GenericTypeVar))p2 = new RefType(p2); //if(!(TypePlaceholder.class.isInstance(p1)) || !(RefType.class.isInstance(p1)) || !(TypePlaceholder.class.isInstance(p2)) || !(RefType.class.isInstance(p2))) //{//Wenn die beiden übergebenen Typen weder RefTypes noch TypePlaceholder sind: // throw new TypinferenzException("Ein Constraint darf nur aus TypePlaceholdern und Reftypes bestehen"); //} - if(!(p1 instanceof RefType) && !(p1 instanceof TypePlaceholder))throw new DebugException("Fehler: "+p2+" kann nicht in TPH oder RefType umgewandelt werden"); - if(!(p2 instanceof RefType) && !(p2 instanceof TypePlaceholder))throw new DebugException("Fehler: "+p2+" kann nicht in TPH oder RefType umgewandelt werden"); + //if(!(p1 instanceof RefType) && !(p1 instanceof TypePlaceholder))throw new DebugException("Fehler: "+p2+" kann nicht in TPH oder RefType umgewandelt werden"); + //if(!(p2 instanceof RefType) && !(p2 instanceof TypePlaceholder))throw new DebugException("Fehler: "+p2+" kann nicht in TPH oder RefType umgewandelt werden"); constraintPair = new Pair(p1,p2); } diff --git a/src/de/dhbwstuttgart/typeinference/TypeinferenceResultSet.java b/src/de/dhbwstuttgart/typeinference/TypeinferenceResultSet.java index fe0e79ea3..45096fdce 100755 --- a/src/de/dhbwstuttgart/typeinference/TypeinferenceResultSet.java +++ b/src/de/dhbwstuttgart/typeinference/TypeinferenceResultSet.java @@ -8,7 +8,6 @@ import java.util.Iterator; import java.util.Vector; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; diff --git a/src/de/dhbwstuttgart/typeinference/UndConstraint.java b/src/de/dhbwstuttgart/typeinference/UndConstraint.java index 96a0f2173..b8f6b9ccb 100755 --- a/src/de/dhbwstuttgart/typeinference/UndConstraint.java +++ b/src/de/dhbwstuttgart/typeinference/UndConstraint.java @@ -2,7 +2,6 @@ package de.dhbwstuttgart.typeinference; import java.util.Vector; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.Type; /** @@ -12,7 +11,7 @@ import de.dhbwstuttgart.syntaxtree.type.Type; */ public class UndConstraint extends OderConstraint { - public UndConstraint(Type p1, Type p2) { + public UndConstraint(ConstraintType p1, ConstraintType p2) { super(p1, p2); } diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java b/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java index c2f4382ab..0a67ec5fc 100755 --- a/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java +++ b/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java @@ -6,10 +6,12 @@ import java.util.Vector; import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.parser.JavaClassName; import de.dhbwstuttgart.syntaxtree.Class; +import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.typeinference.ConstraintType; import de.dhbwstuttgart.typeinference.FunN; import de.dhbwstuttgart.typeinference.FunNInterface; import de.dhbwstuttgart.typeinference.FunNMethod; @@ -288,10 +290,10 @@ public class TypeAssumptions { * @param t * @return null, falls der Typ nicht vorhanden ist. */ - public Type getTypeFor(Type t, IItemWithOffset inNode){ + public ConstraintType getTypeFor(Type t, SyntaxTreeNode inNode){ if(t instanceof TypePlaceholder) - return t; //Handelt es sich um einen TypePlaceholder kann dieser nicht in den Assumptions vorkommen. + return new ConstraintType((TypePlaceholder)t); //Handelt es sich um einen TypePlaceholder kann dieser nicht in den Assumptions vorkommen. //Alle bekannten Klassen nach diesem Typ durchsuchen: JavaClassName typName = t.getName(); @@ -303,7 +305,7 @@ public class TypeAssumptions { RefType tr = (RefType)t; RefType ret = ass.getAssumedClass().getType(); //Dadurch erhält der RefType den vollen Namen (bsp. java.lang.Integer) ret.set_ParaList(tr.get_ParaList()); - return ret; + return new ConstraintType(ret); } } //Auch die generischen Variablen durchsuchen: @@ -312,12 +314,11 @@ public class TypeAssumptions { if(ass.getIdentifier().equals(t.getName())){ if(! ass.getAssumedType().getParentClass().getName().equals(this.thisClassName)){ //Ist die Generische Variable nicht aus dieser Klasse, so muss sie zu einem TPH umgewandelt werden: - + return new ConstraintType(ass.getAssumedType().getTypePlaceHolder()); } - return ass.getAssumedType(); + return new ConstraintType(ass.getAssumedType()); } } - //return null; throw new TypeinferenceException("Der Typ "+t.getName()+" ist nicht korrekt",inNode); } diff --git a/src/de/dhbwstuttgart/typeinference/exceptions/TypeinferenceException.java b/src/de/dhbwstuttgart/typeinference/exceptions/TypeinferenceException.java index 7a72266ca..69db2739b 100755 --- a/src/de/dhbwstuttgart/typeinference/exceptions/TypeinferenceException.java +++ b/src/de/dhbwstuttgart/typeinference/exceptions/TypeinferenceException.java @@ -1,6 +1,7 @@ package de.dhbwstuttgart.typeinference.exceptions; import de.dhbwstuttgart.core.IItemWithOffset; +import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; /** * Eine RuntimeException, welche bei einem Fehler während des Typinferenzalgorithmus ausgelöst wird. @@ -17,7 +18,7 @@ public class TypeinferenceException extends RuntimeException { private int offset; private String message; - public TypeinferenceException(String message, IItemWithOffset problemSource) + public TypeinferenceException(String message, SyntaxTreeNode problemSource) { super(message); this.message=message; diff --git a/src/de/dhbwstuttgart/typeinference/typedeployment/GenericTypeInsertPoint.java b/src/de/dhbwstuttgart/typeinference/typedeployment/GenericTypeInsertPoint.java index 36fef5048..15db16923 100644 --- a/src/de/dhbwstuttgart/typeinference/typedeployment/GenericTypeInsertPoint.java +++ b/src/de/dhbwstuttgart/typeinference/typedeployment/GenericTypeInsertPoint.java @@ -6,12 +6,12 @@ import java.util.Vector; import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; import de.dhbwstuttgart.typeinference.GenericTypeInsertable; import de.dhbwstuttgart.typeinference.JavaCodeResult; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.TypeInsertable; import de.dhbwstuttgart.typeinference.exceptions.DebugException; diff --git a/src/de/dhbwstuttgart/typeinference/typedeployment/TypeInsertSet.java b/src/de/dhbwstuttgart/typeinference/typedeployment/TypeInsertSet.java index ba32076d4..671a560d1 100644 --- a/src/de/dhbwstuttgart/typeinference/typedeployment/TypeInsertSet.java +++ b/src/de/dhbwstuttgart/typeinference/typedeployment/TypeInsertSet.java @@ -10,10 +10,10 @@ import org.apache.log4j.Logger; import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; import de.dhbwstuttgart.typeinference.JavaCodeResult; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.TypeInsertable; diff --git a/src/de/dhbwstuttgart/typeinference/unify/CSubstitution.java b/src/de/dhbwstuttgart/typeinference/unify/CSubstitution.java index f0cca4e8b..05cac78ec 100755 --- a/src/de/dhbwstuttgart/typeinference/unify/CSubstitution.java +++ b/src/de/dhbwstuttgart/typeinference/unify/CSubstitution.java @@ -16,12 +16,13 @@ import org.apache.log4j.Logger; + import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.typeinference.Pair; // ino.class.CSubstitution.27003.description type=javadoc /** diff --git a/src/de/dhbwstuttgart/typeinference/unify/CSubstitutionSet.java b/src/de/dhbwstuttgart/typeinference/unify/CSubstitutionSet.java index 889d080bb..5a96aeac4 100755 --- a/src/de/dhbwstuttgart/typeinference/unify/CSubstitutionSet.java +++ b/src/de/dhbwstuttgart/typeinference/unify/CSubstitutionSet.java @@ -7,8 +7,8 @@ import java.util.Iterator; import java.util.Vector; import de.dhbwstuttgart.myexception.CTypeReconstructionException; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.Type; +import de.dhbwstuttgart.typeinference.Pair; // ino.class.CSubstitutionSet.27471.description type=javadoc /** diff --git a/src/de/dhbwstuttgart/typeinference/unify/FC_TTO.java b/src/de/dhbwstuttgart/typeinference/unify/FC_TTO.java index 4adfb430f..b1e8fe696 100755 --- a/src/de/dhbwstuttgart/typeinference/unify/FC_TTO.java +++ b/src/de/dhbwstuttgart/typeinference/unify/FC_TTO.java @@ -6,7 +6,7 @@ package de.dhbwstuttgart.typeinference.unify; import java.util.Vector; import de.dhbwstuttgart.syntaxtree.Class; -import de.dhbwstuttgart.syntaxtree.type.Pair; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; // ino.class.FC_TTO.28013.description type=javadoc @@ -74,8 +74,8 @@ public class FC_TTO public void generateFullyNamedTypes(TypeAssumptions ass) { for(Pair p : this.FC){ - p.TA1 = ass.getTypeFor(p.TA1, null); - p.TA2 = ass.getTypeFor(p.TA2, null); + p.TA1 = ass.getTypeFor(p.TA1, null).getType(); + p.TA2 = ass.getTypeFor(p.TA2, null).getType(); } } } diff --git a/src/de/dhbwstuttgart/typeinference/unify/MUB.java b/src/de/dhbwstuttgart/typeinference/unify/MUB.java index 7fd2213f7..30539ea9e 100755 --- a/src/de/dhbwstuttgart/typeinference/unify/MUB.java +++ b/src/de/dhbwstuttgart/typeinference/unify/MUB.java @@ -5,8 +5,8 @@ package de.dhbwstuttgart.typeinference.unify; // ino.module.MUB.8720.import import java.util.Vector; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.Type; +import de.dhbwstuttgart.typeinference.Pair; // ino.class.MUB.28031.declaration public class MUB diff --git a/src/de/dhbwstuttgart/typeinference/unify/Unify.java b/src/de/dhbwstuttgart/typeinference/unify/Unify.java index 6ac564135..36b0c158c 100755 --- a/src/de/dhbwstuttgart/typeinference/unify/Unify.java +++ b/src/de/dhbwstuttgart/typeinference/unify/Unify.java @@ -24,13 +24,13 @@ import de.dhbwstuttgart.syntaxtree.type.FreshSuperWildcardType; import de.dhbwstuttgart.syntaxtree.type.FreshWildcardType; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; import de.dhbwstuttgart.syntaxtree.type.IMatchable; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; import de.dhbwstuttgart.syntaxtree.type.WildcardType; -import de.dhbwstuttgart.syntaxtree.type.Pair.PairOperator; +import de.dhbwstuttgart.typeinference.Pair; +import de.dhbwstuttgart.typeinference.Pair.PairOperator; // ino.end diff --git a/test/mycompiler/test/unittest/typeReconstructionTest/TrMakeFCTest.java b/test/mycompiler/test/unittest/typeReconstructionTest/TrMakeFCTest.java index adc2c858e..2863bf1c3 100755 --- a/test/mycompiler/test/unittest/typeReconstructionTest/TrMakeFCTest.java +++ b/test/mycompiler/test/unittest/typeReconstructionTest/TrMakeFCTest.java @@ -14,9 +14,9 @@ import de.dhbwstuttgart.syntaxtree.SourceFile; import de.dhbwstuttgart.syntaxtree.misc.UsedId; import de.dhbwstuttgart.syntaxtree.modifier.Modifiers; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.unify.FC_TTO; public class TrMakeFCTest extends TestCase{ diff --git a/test/mycompiler/test/unittest/typeReconstructionTest/TrSubUnifyTest.java b/test/mycompiler/test/unittest/typeReconstructionTest/TrSubUnifyTest.java index 850ac75d1..537464c61 100755 --- a/test/mycompiler/test/unittest/typeReconstructionTest/TrSubUnifyTest.java +++ b/test/mycompiler/test/unittest/typeReconstructionTest/TrSubUnifyTest.java @@ -19,12 +19,12 @@ import de.dhbwstuttgart.syntaxtree.misc.UsedId; import de.dhbwstuttgart.syntaxtree.modifier.Modifiers; import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -import de.dhbwstuttgart.syntaxtree.type.Pair.PairOperator; +import de.dhbwstuttgart.typeinference.Pair; +import de.dhbwstuttgart.typeinference.Pair.PairOperator; import de.dhbwstuttgart.typeinference.unify.FC_TTO; import de.dhbwstuttgart.typeinference.unify.Unify; diff --git a/test/mycompiler/test/unittest/typeReconstructionTest/TrUnifyTest.java b/test/mycompiler/test/unittest/typeReconstructionTest/TrUnifyTest.java index 93a78a82d..757655097 100755 --- a/test/mycompiler/test/unittest/typeReconstructionTest/TrUnifyTest.java +++ b/test/mycompiler/test/unittest/typeReconstructionTest/TrUnifyTest.java @@ -16,12 +16,12 @@ import de.dhbwstuttgart.syntaxtree.SourceFile; import de.dhbwstuttgart.syntaxtree.misc.UsedId; import de.dhbwstuttgart.syntaxtree.modifier.Modifiers; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -import de.dhbwstuttgart.syntaxtree.type.Pair.PairOperator; +import de.dhbwstuttgart.typeinference.Pair; +import de.dhbwstuttgart.typeinference.Pair.PairOperator; import de.dhbwstuttgart.typeinference.unify.FC_TTO; import de.dhbwstuttgart.typeinference.unify.Unify; diff --git a/test/plugindevelopment/TRMEqualTest.java b/test/plugindevelopment/TRMEqualTest.java index 1c6699115..a9a2549a8 100644 --- a/test/plugindevelopment/TRMEqualTest.java +++ b/test/plugindevelopment/TRMEqualTest.java @@ -13,14 +13,14 @@ import de.dhbwstuttgart.core.MyCompiler; import de.dhbwstuttgart.core.MyCompilerAPI; import de.dhbwstuttgart.parser.JavaParser.yyException; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; -import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -import de.dhbwstuttgart.syntaxtree.type.Pair.PairOperator; +import de.dhbwstuttgart.typeinference.Pair; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.TypeInsertable; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; +import de.dhbwstuttgart.typeinference.Pair.PairOperator; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertPoint; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import junit.framework.TestCase; diff --git a/test/plugindevelopment/TypeInsertTester.java b/test/plugindevelopment/TypeInsertTester.java index 34c35bf62..aba7e5b85 100644 --- a/test/plugindevelopment/TypeInsertTester.java +++ b/test/plugindevelopment/TypeInsertTester.java @@ -24,7 +24,6 @@ import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertPoint; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import junit.framework.TestCase; -import mycompiler.mytest.LambdaTest; public class TypeInsertTester{ diff --git a/test/plugindevelopment/TypeInsertTests/OverloadingInMethod.jav b/test/plugindevelopment/TypeInsertTests/OverloadingInMethod.jav new file mode 100644 index 000000000..e66e1a7c7 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/OverloadingInMethod.jav @@ -0,0 +1,10 @@ +class OverloadingInMethod{ + + m () { + op; + op = (m) -> (f) -> f.apply(m); + return op; + } + +} + diff --git a/test/plugindevelopment/TypeInsertTests/OverloadingInMethod.java b/test/plugindevelopment/TypeInsertTests/OverloadingInMethod.java new file mode 100644 index 000000000..6a7a97f55 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/OverloadingInMethod.java @@ -0,0 +1,19 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class OverloadingInMethod { + + private static final String TEST_FILE = "OverloadingInMethod.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + + //mustContain.add("Fun0>> op"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/tools/AntParserBuilderWindows.xml b/tools/AntParserBuilderWindows.xml index 6556cbb21..e867e27c4 100755 --- a/tools/AntParserBuilderWindows.xml +++ b/tools/AntParserBuilderWindows.xml @@ -1,7 +1,7 @@ - + diff --git a/tools/RunJay.sh b/tools/RunJay.sh index cb9db24ec..26ce50790 100755 --- a/tools/RunJay.sh +++ b/tools/RunJay.sh @@ -1 +1 @@ -./../tools/jay -v ./../src/mycompiler/myparser/JavaParser.jay < skeleton > ./../src/mycompiler/myparser/JavaParser.java \ No newline at end of file +./../tools/jay -v ./../src/de/dhbwstuttgart/parser/JavaParser.jay < skeleton > ./../src/de/dhbwstuttgart/parser/JavaParser.java