diff --git a/bin/mycompiler/myparser/JavaParser.jay b/bin/mycompiler/myparser/JavaParser.jay index 992ac242a..68dbc5433 100755 --- a/bin/mycompiler/myparser/JavaParser.jay +++ b/bin/mycompiler/myparser/JavaParser.jay @@ -6,9 +6,9 @@ Backup von JavaParser.jay 10.April 17 Uhr package mycompiler.myparser; - +import mycompiler.myclass.FieldDeclaration; +import mycompiler.myclass.Field; import java.util.Vector; -import mycompiler.myclass.FieldInitialization; import mycompiler.SourceFile; import mycompiler.AClassOrInterface; import mycompiler.myclass.Class; @@ -18,7 +18,6 @@ import mycompiler.myclass.Constant; import mycompiler.myclass.ImportDeclarations; import mycompiler.myclass.DeclId; import mycompiler.myclass.ExceptionList; -import mycompiler.myclass.FieldDecl; import mycompiler.myclass.FormalParameter; import mycompiler.myclass.InstVarDecl; import mycompiler.myclass.Method; @@ -207,21 +206,21 @@ public Vector testPair = new Vector(); %type interfacedeclaration %type interfacebody %type interfacememberdeclarations -%type interfacememberdeclaration +%type interfacememberdeclaration %type abstractmethoddeclaration %type classbody %type classidentifier %type interfaceidentifier %type constantdeclaration -%type fielddeclaration +%type fielddeclaration %type methodheader %type methoddeclaration %type methoddeclarator %type classbodydeclarations -%type classbodydeclaration -%type classmemberdeclaration +%type classbodydeclaration +%type classmemberdeclaration %type variabledeclarators -%type fielddeclarator; +%type fielddeclarator; %type variabledeclarator %type variabledeclaratorid %type simplename @@ -309,7 +308,7 @@ public Vector testPair = new Vector(); %type argumentlist %type methodinvocation %type typedeclaration -%type constructordeclaration +%type constructordeclaration %type constructordeclarator %type constructorbody %type explicitconstructorinvocation @@ -871,7 +870,7 @@ Dieses Problem ist bei Feldern nicht der Fall. */ fielddeclarator : variabledeclarator '=' expression { - FieldInitialization ret = new FieldInitialization(); + FieldDeclaration ret = new FieldDeclaration(); ret.set_DeclId($1); ret.setWert($3); $$=ret; diff --git a/src/mycompiler/MyCompiler.java b/src/mycompiler/MyCompiler.java index 74777a752..5f266c90a 100755 --- a/src/mycompiler/MyCompiler.java +++ b/src/mycompiler/MyCompiler.java @@ -41,8 +41,11 @@ import mycompiler.mytypereconstruction.TypeinferenceResultSet; import org.apache.log4j.Logger; import org.apache.log4j.xml.DOMConfigurator; +import com.sun.org.apache.xerces.internal.impl.xs.identity.Field; + import typinferenz.TypinferenzException; // ino.end +import typinferenz.assumptions.TypeAssumptions; @@ -297,8 +300,8 @@ public class MyCompiler implements MyCompilerAPI { Class tempKlasse = null; ClassBody tempKlassBody = null; - Vector tempVectorFieldDecl; - FieldDecl tempFieldDecl = null; + Vector tempVectorFieldDecl; + mycompiler.myclass.Field tempFieldDecl = null; String strKlasse; for( int i = 0; i < srcFile.KlassenVektor.size(); i++ ) @@ -320,13 +323,13 @@ public class MyCompiler implements MyCompilerAPI parserlog.debug( "------------------------------------"); // Schleife �ber alle fielddeclarations - tempVectorFieldDecl = tempKlassBody.get_FieldDeclVector(); + tempVectorFieldDecl = tempKlassBody.getFields(); for( int k = 0; k < tempVectorFieldDecl.size(); k++ ) { tempFieldDecl = tempVectorFieldDecl.elementAt(k); if( tempFieldDecl instanceof Constructor ) { - parserlog.debug("T->Konstruktor: " + ((DeclId)tempFieldDecl.get_Name().elementAt(0)).get_Name() + " - ReturnType: " + tempFieldDecl.getTypeName()); + //parserlog.debug("T->Konstruktor: " + ((DeclId)tempFieldDecl.get_Name().elementAt(0)).get_Name() + " - ReturnType: " + tempFieldDecl.getTypeName()); // pr�fen, ob Construktorname == Klassenname - falls nein: Construktor in Methode umwandeln !!! String strConstName = ((DeclId)tempFieldDecl.get_Name().elementAt(0)).get_Name(); // Konstruktorname @@ -359,12 +362,9 @@ public class MyCompiler implements MyCompilerAPI } if( tempFieldDecl instanceof Method && !(tempFieldDecl instanceof Constructor) ) { - parserlog.debug("T->Methode: " + ((DeclId)tempFieldDecl.get_Name().elementAt(0)).get_Name() + " - ReturnType: " + tempFieldDecl.getTypeName()); - } - if( tempFieldDecl instanceof InstVarDecl ) - { - parserlog.debug("T->Instanzv.: " + ((DeclId)tempFieldDecl.get_Name().elementAt(0)).get_Name() + " - ReturnType: " + tempFieldDecl.getTypeName()); + //parserlog.debug("T->Methode: " + ((DeclId)tempFieldDecl.get_Name().elementAt(0)).get_Name() + " - ReturnType: " + tempFieldDecl.getTypeName()); } + } // Debugg-Infos @@ -549,8 +549,10 @@ public class MyCompiler implements MyCompilerAPI inferencelog.info("##########################################"); inferencelog.info("# TypeReconstruction-Algorithmus - START #"); inferencelog.info("##########################################\n"); - - Vector result = m_AbstractSyntaxTree.typeReconstruction(); + + TypeAssumptions globalAssumptions = m_AbstractSyntaxTree.makeBasicAssumptions(); + + Vector result = m_AbstractSyntaxTree.typeReconstruction(globalAssumptions); inferencelog.info("#########################################"); inferencelog.info("# TypeReconstruction-Algorithmus - ENDE #"); diff --git a/src/mycompiler/SourceFile.java b/src/mycompiler/SourceFile.java index fdb245f3f..6001aaba7 100755 --- a/src/mycompiler/SourceFile.java +++ b/src/mycompiler/SourceFile.java @@ -40,6 +40,9 @@ import org.apache.log4j.Logger; import sun.reflect.generics.reflectiveObjects.NotImplementedException; import sun.reflect.generics.reflectiveObjects.TypeVariableImpl; +import typinferenz.ConstraintsSet; +import typinferenz.FunN; +import typinferenz.UndConstraint; import typinferenz.assumptions.TypeAssumptions; @@ -599,6 +602,15 @@ public class SourceFile } // ino.end + public TypeAssumptions getPublicFieldAssumptions(){ + TypeAssumptions publicAssumptions = new TypeAssumptions(); + //Alle PublicAssumptions der in dieser SourceFile enthaltenen Klassen sammeln: + for(Class klasse : KlassenVektor){ + publicAssumptions.add(klasse.getPublicFieldAssumptions()); + } + return publicAssumptions; + } + ///////////////////////////////////////////////////////////////////////// // TypeReconstructionAlgorithmus ///////////////////////////////////////////////////////////////////////// @@ -614,12 +626,105 @@ public class SourceFile */ // ino.end // ino.method.typeReconstruction.21406.definition - public Vector typeReconstruction() + public Vector typeReconstruction(TypeAssumptions globalAssumptions) throws CTypeReconstructionException // ino.end // ino.method.typeReconstruction.21406.body { + Vector ret = new Vector(); + + //Logger initialisieren: + Logger typinferenzLog = Logger.getLogger("Typeinference"); + + //FiniteClosure generieren: + FC_TTO finiteClosure = this.makeFC(); + + //Alle Constraints der in dieser SourceFile enthaltenen Klassen sammeln: + for(Class klasse : KlassenVektor){ + ConstraintsSet oderConstraints = klasse.typeReconstruction(finiteClosure, globalAssumptions); + + //Die Constraints in Pair's umwandeln (Karthesisches Produkt bilden): + Vector> xConstraints = new Vector>();// = oderConstraints.getConstraints(); + for(Vector uC:oderConstraints.getConstraints()){ //mit dem getConstraints-Aufruf wird das Karthesische Produkt erzeugt. + Vector cons = new Vector(); + for(UndConstraint undCons:uC){ + cons.addAll(undCons.getConstraintPairs()); + } + xConstraints.add(cons); + } + typinferenzLog.debug("Karthesisches Produkt der Constraints: "+xConstraints); + + ////////////////////////////// + // Unifizierung der Constraints: + ////////////////////////////// + for(Vector constraints : xConstraints){ + //Alle durch das Karthesische Produkt entstandenen Möglichkeiten durchgehen: + Vector> result = new Vector>(); + + //Alle FunN-Typen werden per clone-methode in RefTypes verwandelt. (Die clone Methode in FunN darf nicht überschrieben werden. + for(Pair p : constraints){ + if(p.TA1 instanceof FunN){ + p.TA1 = p.TA1.clone(); + } + if(p.TA2 instanceof FunN){ + p.TA2 = p.TA2.clone(); + } + } + + //Erst die Unifizierung erstellen: + Vector> unifyResult = Unify.unify(constraints, finiteClosure); + //Dann den Ergebnissen anfügen + result.addAll(unifyResult); + + // Debugoutput:Vector> + typinferenzLog.debug("Unifiziertes Ergebnis: "+result); + + /* + // Prüfe ob eindeutige Lösung: + if(result.size()>1 && !Unify.hasSolvedForm(result.elementAt(0))){ + + typinferenzLog.debug("Keine eindeutige Lösung!"); + + }else if(result.size()>1){ + + //Replace TPH: + for(Pair res : result.elementAt(0)){ + if(res.OperatorEqual()){ + if(res.TA1 instanceof TypePlaceholder)((TypePlaceholder)res.TA1).fireReplaceTypeEvent(new CReplaceTypeEvent(res.TA1, res.TA2)); + } + } + } + */ + //typinferenzLog.debug(); + //typinferenzLog.debug(supportData.getFiniteClosure()); + //typinferenzLog.debug("Typinformationen: \n"+this.getTypeInformation(this.getMethodList(), fieldInitializers)); + + typinferenzLog.debug("\nJavaFiles:\n"); + + //typinferenzLog.debug(this.printJavaCode(new ResultSet(new Vector()))); + + + //Der Unifikationsalgorithmus kann wiederum auch mehrere Lösungen errechnen, diese werden im folgenden durchlaufen: + for(Vector resultSet : result){ + //Add Result set as a new ReconstructionResult to ret: + TypeinferenceResultSet reconstructionResult = new TypeinferenceResultSet(klasse); + reconstructionResult.setConstraints(constraints); + reconstructionResult.setUnifiedConstraints(resultSet); + ret.add(reconstructionResult); + + //ResultSet res = new ResultSet(resultSet); + typinferenzLog.debug("JavaFile für ResultSet "+reconstructionResult+"\n"); + typinferenzLog.debug(klasse.printJavaCode(reconstructionResult)); + + } + + } + + + } + return ret; + /* // HOTI: Nur zur Info.Ich habe den Loglevel auf Info geschaltet, damit // in der GUI (Eclipse-Plugin) die Console nicht zugemüllt wird. // Wers braucht kanns natürlich ausschalten @@ -739,10 +844,11 @@ public class SourceFile Class cl = class_it.next(); CSupportData supportData = new CSupportData(finiteClosure, A, cl.getName(), cl.get_ParaList()); inferencelog.info("Rufe " + cl.getName() + ".TRProg()..."); - A.addAll(cl.TRProg(supportData, publicFieldsAssumptions)); + A.addAll(cl.typeReconstruction(supportData, publicFieldsAssumptions)); } return A; + */ } // ino.end @@ -1102,7 +1208,7 @@ public class SourceFile */ // ino.end // ino.method.makeBasicAssumptions.21418.definition - private TypeAssumptions makeBasicAssumptions() + public TypeAssumptions makeBasicAssumptions() // ino.end // ino.method.makeBasicAssumptions.21418.body { diff --git a/src/mycompiler/SyntaxTreeNode.java b/src/mycompiler/SyntaxTreeNode.java new file mode 100644 index 000000000..635ceafd4 --- /dev/null +++ b/src/mycompiler/SyntaxTreeNode.java @@ -0,0 +1,5 @@ +package mycompiler; + +public interface SyntaxTreeNode { + +} diff --git a/src/mycompiler/myclass/Class.java b/src/mycompiler/myclass/Class.java index 0930e2e37..6a7295c4e 100755 --- a/src/mycompiler/myclass/Class.java +++ b/src/mycompiler/myclass/Class.java @@ -10,6 +10,7 @@ import java.util.Iterator; import java.util.Vector; import mycompiler.AClassOrInterface; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.myexception.CTypeReconstructionException; import mycompiler.myexception.JVMCodeException; @@ -42,6 +43,7 @@ import mycompiler.mytypereconstruction.typeassumption.CMethodTypeAssumption; import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption; import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption; import mycompiler.mytypereconstruction.typeassumptionkey.CMethodKey; +import mycompiler.mytypereconstruction.unify.FC_TTO; import mycompiler.mytypereconstruction.unify.Unify; import mycompiler.SourceFile; @@ -49,6 +51,8 @@ import org.apache.log4j.Logger; // ino.end + + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; @@ -62,7 +66,7 @@ import typinferenz.assumptions.TypeAssumptions; // ino.class.Class.23010.declaration -public class Class extends AClassOrInterface +public class Class extends AClassOrInterface implements SyntaxTreeNode // ino.end // ino.class.Class.23010.body { @@ -196,110 +200,6 @@ public class Class extends AClassOrInterface } // ino.end - // ino.method.para_check.23059.definition - public void para_check(Vector classlist, boolean ext) - throws SCClassException - // ino.end - // ino.method.para_check.23059.body - { - //pr�ft, ob jeder Key in der parahash-Tabelle auch im Vector paralist steht bzw. umgekehrt. - - parahash = body.init_parahashtable(paralist,ext); - // Para_check erstellt Hashtabelle der Klasse this.get_classname + parahash.toString()+paralist.toString()); - - for(Enumeration el = paralist.elements(); el.hasMoreElements();) - { - Type typ = (Type)el.nextElement(); - if(!parahash.contains(typ.getName())) - { - parserlog.error(""); - parserlog.error("Fehler: unbekannter Parameter: "+ typ.getName()); - - SCExcept neu=new SCExcept(); - neu.set_error("Fehler: unbekannter Parameter: "+ typ.getName()); - neu.set_statement("Class"); - SCClassException except = new SCClassException(); - Vector v = new Vector(); - v.add(neu); - except.addException(v); - except.addClassname(getName()); - throw except; - } - } - - if(superclassid != null) - { - String superclassname; - Vector superclass = superclassid.get_Name(); - - // superclass darf nur ein Element haben, da es in Java keine Mehrfachvererbung gibt! - for(Enumeration el = superclass.elements();el.hasMoreElements();) - { - superclassname = (String) el.nextElement(); - // Alle Klassen in der Klassenliste (enth�lt alle definierten Klassen) durchgehen - for ( Enumeration e2 = classlist.elements(); e2.hasMoreElements(); ) - { - Class basis =e2.nextElement(); - // Klasse im Vektor == Superklasse - if( basis.getName().equals(superclassname) ) - { - if( basis.paralist != null && superclassid!=null && superclassid.get_ParaList()!=null) - { - // System/.out.println( "Basis: " + basis.get_ParaList() ); - // if( basis.get_ParaList().size() > 0 ) System/.out.println( "0: " + ((TypePlaceholder)basis.get_ParaList().elementAt(0)).get_Type() ); - // if( basis.get_ParaList().size() > 1 ) System/.out.println( "1: " + ((TypePlaceholder)basis.get_ParaList().elementAt(1)).get_Type() ); - // otth: geaender auf vParaOrg - if(basis.paralist.size() != this.superclassid.get_ParaList().size()) - { - SCExcept neu = new SCExcept(); - neu.set_error("Parameterlisten von Basis und Child unterscheiden sich in der L�nge!"); - neu.set_classname(getName()); - neu.set_statement("Class"); - SCClassException except = new SCClassException(); - Vector v = new Vector(); - v.add(neu); - except.addException(v); - except.addClassname(getName()); - // Exceptions werfen aufgrund vom eingestellten - // Debug-Level??? - // if( MyCompiler.DebugLevel != MyCompiler.UNIFICATION_INFO) - // throw except; - parserlog.debug("Parameterlistenl�ngenpr�fung von Basis- u. Superkl. tempor�r ausgeschalten! - otth"); - } - } - } - } - } - - try - { - parahash = body.complete_parahashtable(classlist, superclassid,parahash, ext); - } - catch(SCClassBodyException ex){ - SCClassException except = new SCClassException(); - except.addException(ex.get_exlist()); - except.addClassname(getName()); - throw except; - } - - paralist = complete_paralist(ext); //Parameterliste wird um die Eintr�ge der Basisklasse erg�nzt - // vParaOrg wird hier nicht veraendert - } - - else - { - // typinferenzLog.debug("\tkeine Vererbung gefunden!"); - } - - /* - if(ext) - { - string_rec("++ ParaCheck Globale Parameterliste: ",paralist);typinferenzLog.debug(); - string_rec("++ ParaCheck Globale ParaHashtabelle: ", parahash);typinferenzLog.debug(); - } - */ - } - // ino.end // ino.method.complete_paralist.23062.definition public Vector complete_paralist(boolean ext) @@ -320,31 +220,6 @@ public class Class extends AClassOrInterface } // ino.end - // ino.method.sc_check_for_extended_classes.23068.definition - public void sc_check_for_extended_classes(Vector classlist, Hashtable childhash,boolean ext) - // ino.end - // ino.method.sc_check_for_extended_classes.23068.body - { - // Der Semantik-Check f�r Basis-Klassen - Aufgabe: In der mit �bergegeben Hashtable childhash sollen - // die geerbten Funktionen und Methoden mit ihren zugeh�rigen Typen eingetragen werden - - String strSuperKlassenName = null; - - // otth: Hat diese Klasse wieder eine Supperklasse? - if( superclassid != null) - { - Vector superclass = superclassid.get_Name(); - for(Enumeration el = superclass.elements();el.hasMoreElements();) //superclass darf nur ein Element haben!!! - { - strSuperKlassenName = (String) el.nextElement(); - } - } - - // otth: Hashtabelle f�r Superklasse erestellen - body.sc_init_hashtable_for_extended_classes(classlist, strSuperKlassenName, childhash, paralist, parahash, body.kill, ext); - } - // ino.end - // ino.method.codegen.23071.definition @@ -421,16 +296,7 @@ public class Class extends AClassOrInterface } // ino.end - // ino.method.is_member.23083.definition - public String is_member(String var) - // ino.end - // ino.method.is_member.23083.body - { - Hashtable h; - h=body.get_hash(); - return (String)h.get(var); - } - // ino.end + // ino.method.get_Superclass_Name.23086.definition public String get_Superclass_Name() @@ -632,7 +498,7 @@ public class Class extends AClassOrInterface */ // ino.end // ino.method.TRProg.23110.definition - public Vector TRProg(CSupportData supportData, TypeAssumptions globalAssumptions) + public ConstraintsSet typeReconstruction(FC_TTO supportData, TypeAssumptions globalAssumptions) throws CTypeReconstructionException // ino.end // ino.method.TRProg.23110.body @@ -666,84 +532,9 @@ public class Class extends AClassOrInterface ConstraintsSet oderConstraints = this.TYPE(this.getMethodList(), fieldInitializers, assumptions); typinferenzLog.debug("Erstellte Constraints: "+oderConstraints); - //Die Constraints in Pair's umwandeln: - Vector> xConstraints = new Vector>();// = oderConstraints.getConstraints(); - for(Vector uC:oderConstraints.getConstraints()){ //mit dem getConstraints-Aufruf wird das Karthesische Produkt erzeugt. - Vector cons = new Vector(); - for(UndConstraint undCons:uC){ - cons.addAll(undCons.getConstraintPairs()); - } - xConstraints.add(cons); - } - typinferenzLog.debug("Karthesisches Produkt der Constraints: "+xConstraints); + return oderConstraints; - ////////////////////////////// - // Unifizierung der Constraints: - ////////////////////////////// - Vector ret = new Vector(); //Generiere das Result-Set - for(Vector constraints : xConstraints){ - //Alle durch das Karthesische Produkt entstandenen Möglichkeiten durchgehen: - Vector> result = new Vector>(); - - //Alle FunN-Typen werden per clone-methode in RefTypes verwandelt. (Die clone Methode in FunN darf nicht überschrieben werden. - for(Pair p : constraints){ - if(p.TA1 instanceof FunN){ - p.TA1 = p.TA1.clone(); - } - if(p.TA2 instanceof FunN){ - p.TA2 = p.TA2.clone(); - } - } - - //Erst die Unifizierung erstellen: - Vector> unifyResult = Unify.unify(constraints, supportData.getFiniteClosure()); - //Dann den Ergebnissen anfügen - result.addAll(unifyResult); - // Debugoutput:Vector> - typinferenzLog.debug("Unifiziertes Ergebnis: "+result); - - /* - // Prüfe ob eindeutige Lösung: - if(result.size()>1 && !Unify.hasSolvedForm(result.elementAt(0))){ - - typinferenzLog.debug("Keine eindeutige Lösung!"); - - }else if(result.size()>1){ - - //Replace TPH: - for(Pair res : result.elementAt(0)){ - if(res.OperatorEqual()){ - if(res.TA1 instanceof TypePlaceholder)((TypePlaceholder)res.TA1).fireReplaceTypeEvent(new CReplaceTypeEvent(res.TA1, res.TA2)); - } - } - } - */ - //typinferenzLog.debug(); - //typinferenzLog.debug(supportData.getFiniteClosure()); - typinferenzLog.debug("Typinformationen: \n"+this.getTypeInformation(this.getMethodList(), fieldInitializers)); - - typinferenzLog.debug("\nJavaFiles:\n"); - - //typinferenzLog.debug(this.printJavaCode(new ResultSet(new Vector()))); - - - //Der Unifikationsalgorithmus kann wiederum auch mehrere Lösungen errechnen, diese werden im folgenden durchlaufen: - for(Vector resultSet : result){ - //Add Result set as a new ReconstructionResult to ret: - TypeinferenceResultSet reconstructionResult = new TypeinferenceResultSet(this); - reconstructionResult.setConstraints(constraints); - reconstructionResult.setUnifiedConstraints(resultSet); - ret.add(reconstructionResult); - - //ResultSet res = new ResultSet(resultSet); - typinferenzLog.debug("JavaFile für ResultSet "+reconstructionResult+"\n"); - typinferenzLog.debug(this.printJavaCode(reconstructionResult)); - - } - - } - return ret; /* CReconstructionTupleSet retTupleSet = this.TRStart(methodList, V, V_fields_methods, supportData); inferencelog.debug("Bin aus TRStart() zur�ck in TRProg()."); @@ -795,6 +586,8 @@ public class Class extends AClassOrInterface * @return Eine Liste mit allen Methoden dieser Klasse */ private Vector getMethodList() { + //TODO: Diese Methode ersetzen: Nach dem Parsen muss es ein Parser-Postprocessing geben. Anschließend sind alle Felder und Methoden der Klasse bekannt + if(this.methodList != null) return this.methodList; //TODO: Unnötige Berechnungen im folgenden Code rauskürzen: ////////////////////////////// @@ -812,25 +605,15 @@ public class Class extends AClassOrInterface // ge�ndert: hoth 06.04.2006 ////////////////////////////// - for(FieldDecl field : body.get_FieldDeclVector()) + for(Field field : body.getFields()) { ////////////////////////////// // Attribut: ////////////////////////////// - if(field instanceof InstVarDecl){ - InstVarDecl instVar = (InstVarDecl)field; - ////////////////////////////// - // Alle Variablendeklarationen (int a, b, c) durchgehen: - ////////////////////////////// - for(int i=0; i()); // Typannahme bauen... - V_fields_methods.add(assum); // ...und hinzuf�gen. - } - } + } - for(FieldDecl field : body.get_FieldDeclVector()) + for(Field field : body.getFields()) { ////////////////////////////// // Methode: @@ -921,7 +704,7 @@ public class Class extends AClassOrInterface //CLocalVarTypeAssumption thisAssumption = new CLocalVarTypeAssumption(this.name, name, 0, 0, name, "this", new RefType(name,0), 0, 0, null); //assumptions.setThisV(thisAssumption); - for(FieldDecl field : body.get_FieldDeclVector()){ + for(Field field : body.getFields()){ assumptions.add(field.createTypeAssumptions(this)); } @@ -1041,7 +824,7 @@ public class Class extends AClassOrInterface if(body==null) return; - Vector fieldsAndMethods=body.get_FieldDeclVector(); + Vector fieldsAndMethods=body.getFields(); // Alle Methoden und Instanzvariablen durchgehen for(int i=0;i fielddecl = new Vector(); - // ino.end - // ino.attribute.hash.23149.declaration - private Hashtable hash = new Hashtable(); // otth: Speichert folgende Paare: --> - // ino.end - // ino.attribute.paraclasshash.23152.declaration - private Hashtable paraclasshash = new Hashtable(); + private Vectorfielddecl = new Vector(); // ino.end // ino.attribute.kill.23155.declaration public Hashtable kill = new Hashtable(); @@ -43,244 +37,7 @@ public class ClassBody protected static Logger parserlog = Logger.getLogger("parser"); // ino.end - // ino.method.sc_init_hashtable.23161.definition - public void sc_init_hashtable( Vector KlassenVektor, String strSuperKlassenName, String classname, boolean ext ) - throws SCClassBodyException - // ino.end - // ino.method.sc_init_hashtable.23161.body - { - // Methoden und Vardeclarationen werden in die Hashtabelle eingefuegt - // KlassenVektor: Vektor mit allen Klassen im Sourcefile - // strSuperKlassenName: Name der Superklasse, Klasse ohne Vererbung <--> strSuperKlassenName = null - SCClassBodyException ex = null; - - // otth: Vektor mit den Felddeklarationen durchgehen und Hashtabelle f�r Felddeklarationen aufbauen - for( Enumeration el = fielddecl.elements(); el.hasMoreElements(); ) - { - FieldDecl field = el.nextElement(); // Felddeklaration, also Instanzvariable oder Mehtode - Vector v = field.get_Name(); // verschiedene DeclId's, f�r int a, b, c z.B 3 - DeclId hilf; - Method init; - String name; // enth�lt den Namen des Identifiers, also ein Instanzvariablenname oder ein Methodennamen - - // otth: bei Funktionen: Parameterliste erstellen! - if( field instanceof Method ) - { - init=(Method) field; - init.sc_init_parameterlist(ext); - } - - // otth: Vektor einer Felddeklaration mit ver. DeclIds durchgehen - - // otth: hier wird z.B. folgende Liste durchlaufen: a, b, c bei int a, b, c; - for ( Enumeration el1 = v.elements(); el1.hasMoreElements(); ) - { - hilf = (DeclId)el1.nextElement(); - name = hilf.get_Name(); - - // otth: pr�fen, ob Identifier bereits vorhanden ??? - if( hash.containsKey( name ) ) - { - parserlog.error("SEMANTIK-CHECK-Fehler: '" + name + "' ist bereits definiert!\n"); - //FIXME Throw Exception or Error instead of simple exit the program - System.exit(1); - - /* otth: Wenn dieser Code vorhanden ist, wird ... int a; int a; akkzeptiert! - String typedervar; - typedervar = (String)hash.get(name); - if ( !typedervar.equals(field.get_Type()) ) - // otth: abstrakte Methode, z.B. von InstVarDecl gibt den Typ zur�ck - { - SCExcept neu=new SCExcept(); - neu.set_error("Es kann nicht noch eine Variable mit dem Namen "+name+" angelegt werden."); - neu.set_statement("ClassBody"); - if(ex==null) - { - System.out.println("neue classbodyexception anlegen"); - ex=new SCClassBodyException(); - } - ex.addException(neu); - if(ext) - System.out.println("Exception wurde angelegt!"); - continue; - } - */ - } - - // otth: Aufnahme in die Hash-Tabelle! - // otth: Typen pr�fen, field.get_Type() z.B. = int oder void, bei null --> Konstruktor - if( field.getTypeName() == null ) - hash.put(name,"__CONSTRUCTOR__"); - else - hash.put(name, field.getTypeName()); // Name & Typ, z.B. "a" --> "int" - } // Ende: Schleife �ber alle Feldvariablendeklarationen - } - - // otth: Klassenname in Hash-Tabelle einfuegen - hash.put("###_classname", classname); - - // otth: Ist Klasse eine Subklasse? - if( strSuperKlassenName != null ) // 'strSuperKlassenName' = �bergebener Parameter von 'Class' - { - Class tempKlasse; - String strTempKlassenName; - hash.put( "###_class_is_extended", "yes" ); - - // otth: Basisklasse wird im Vektor aller Klassen 'KlassenVektor` gesucht! - - // �nderung von otth: Falls Klasse nicht gefunden wurde --> Superklasse ist undefiniert --> Fehler! - boolean bSuperKlasseGefunden = false; - - for ( Enumeration el2 = KlassenVektor.elements(); el2.hasMoreElements(); ) - { - tempKlasse = el2.nextElement(); - strTempKlassenName = tempKlasse.getName(); - if( strTempKlassenName.equals( strSuperKlassenName ) ) - { - // otth: Die Hashtabelle wird um die Attribute / Methoden der Superklasse(n) ergaenzt - // otth: Funktion 'ClassBody.sc_init_hashtable_for_extended_classes' wird (indirekt) aufgerufen - bSuperKlasseGefunden = true; - tempKlasse.sc_check_for_extended_classes( KlassenVektor, hash, ext ); - } - } - - - // otth: Superklasse mu� existieren - if ( !bSuperKlasseGefunden ) - { - parserlog.error("SEMANTIK-CHECK-Fehler [otth]: Symbol '" + strSuperKlassenName + "' kann nicht aufgel�st werden (Location: class " + classname + ").\n" ); - System.exit( 1 ); - } - - } - - // Fehler erkennen und werfen!!! - if( ex != null ) - { - parserlog.error("SEMANTIK-CHECK-Fehler: Fehler beim Aufbau der Hash-Tabelle!"); - throw ex; - } - - // Ersetzen von vordefinierten Parametern bei der Vererbung - if( this.kill.size() > 0 ) - { - for(Enumeration e1=this.kill.elements(),e2=this.kill.keys();e1.hasMoreElements();){ - Type value = (Type)e1.nextElement(), key=(Type)e2.nextElement(); - for(Enumeration e3=hash.elements(),e4=hash.keys();e3.hasMoreElements();){ - String v = (String)e3.nextElement(),k=(String)e4.nextElement(); - if(v.equals(key.getName())){ - parserlog.debug(v+ " wird durch "+value.getName()+" ersetzt"); - hash.put(k,value.getName()); - } - } - } - } - - parserlog.debug( "SC --> '" + classname + "' --> Hashtabelle (ClassBody.hash):\n" + hash); - } - // ino.end - - // ino.method.sc_init_hashtable_for_extended_classes.23164.definition - public void sc_init_hashtable_for_extended_classes( Vector classlist, String strSuperKlassenName, Hashtable childhash,Vector paralist, Hashtable parahash,Hashtable kill, boolean ext ) - // ino.end - // ino.method.sc_init_hashtable_for_extended_classes.23164.body - { - // Hier werden in die �bergegebene Hashtable die Attribute und Methoden ergaenzt, die vererbt werden. - // otth: Struktur �hnlich wie in 'sc_init_hashtable' - - for( Enumeration el = fielddecl.elements(); el.hasMoreElements(); ) - { - FieldDecl field = el.nextElement(); - Vector v = field.get_Name(); - DeclId hilf; - String name; - - // Hashtabelle erg�nzen - for ( Enumeration el1 = v.elements(); el1.hasMoreElements(); ) - { - hilf=(DeclId)el1.nextElement(); - name=hilf.get_Name(); - if(field.getTypeName()==null) - childhash.put(name,"__Constructor__"); //Name & Typ - else - { - //string_rec("paralist: ", paralist);System.out.println(); - childhash.put(name, field.getTypeName()); - } - } - } - - // Sollte die Basis-Klasse zus�tzlich erben muss folgendes getan werden: - if( strSuperKlassenName != null ) - { - Class hilfe; - String hilfsstr; - for ( Enumeration el2=classlist.elements(); el2.hasMoreElements(); ) - { - hilfe=el2.nextElement(); - hilfsstr=hilfe.getName(); - if( hilfsstr.equals( strSuperKlassenName ) ) - hilfe.sc_check_for_extended_classes(classlist,childhash,ext); - } - } - } - // ino.end - - // ino.method.init_parahashtable.23170.defdescription type=line - // - // ***NEU***************************************************************************** - // - // ino.end - // ino.method.init_parahashtable.23170.definition - public Hashtable init_parahashtable(Vector paralist,boolean ext) - // ino.end - // ino.method.init_parahashtable.23170.body - { - //hier wird die Hashtabelle erzeugt, die s�mtliche zuordnungen der parametrisierbaren Variablen enth�lt. - Hashtable parahash = new Hashtable(); - FieldDecl decl; - - for(Enumeration e = fielddecl.elements(); e.hasMoreElements();) - { - //Auslesen aller Fielddecl's - decl = e.nextElement(); - - for(Enumeration el = decl.get_Name().elements(); el.hasMoreElements();) - { //Auslesen der Vectoren der Fielddecl's - String key, value; - key = ((DeclId)el.nextElement()).get_Name(); - value = decl.getTypeName(); - if ( value == null ) value = "###CONSTRUCTOR###"; // otth: eingef�gt, sonst NULLPOINTEREXCEPTION - parahash.put(key, value); - } - } - - // entfernt ung�ltige Eintr�ge in der ParaHashtabelle - for(Enumeration e = parahash.elements(), ee=parahash.keys(); e.hasMoreElements();) - { - String para = (String)e.nextElement(); - String key = (String)ee.nextElement(); - Enumeration e1 = paralist.elements(); - do - { - if(e1.hasMoreElements()) - { - String typ = ((Type)e1.nextElement()).getName(); - if(para.equals(typ)) - { - break; - } - } - if(!e1.hasMoreElements()) - { - parahash.remove(key); - } - } - while(e1.hasMoreElements()); - } - return parahash; - } - // ino.end // ino.method.complete_parahashtable.23173.defdescription type=block /* public void set_paratype(Vector classlist, UsedId superclass, Vector @@ -311,122 +68,6 @@ Paratyp gesetzt."); } */ // ino.end - // ino.method.complete_parahashtable.23173.definition - public Hashtable complete_parahashtable(Vector classlist,UsedId superclassid,Hashtable childhash,boolean ext) - throws SCClassBodyException - // ino.end - // ino.method.complete_parahashtable.23173.body - { - // vervolltaendigt die ParaHashtabelle bei Vererbung - Hashtable parahash = new Hashtable(); - String superhilf,superclass = (String)superclassid.get_Name_1Element(); - Class supercl; - if(ext) - parserlog.debug("++ Para_check hat Vererbung gefunden!"); - - for(Enumeration e=classlist.elements();e.hasMoreElements();) - { - supercl = e.nextElement(); - superhilf = supercl.getName(); - - if(superhilf.equals(superclass)) - { - parahash = (Hashtable) supercl.get_ParaHash().clone(); - - // otth: Pruefung: Ist ein Parameter, der keine TypePlaceholder ist - // (also RefType mit [=Typkonstruktor] oder ohne Parameter eine bereits definierte Klasse und - // stimmt die Anzahl der Parameter eines Typkonstruktors mit der zugeh�rigen Klassendefinition �berein? - - // folgende Funktion bricht ab, falls Parameter fehlerhaft - istParameterOK( superclassid.get_ParaList(), classlist ); - // end otth; - - - if(ext){ - parserlog.debug(string_rec("++ PC\tParaHash der Basisklasse: ", parahash)); - parserlog.debug(string_rec("++ PC\tParaList der Basisklasse: ", supercl.get_ParaList())); - parserlog.debug(string_rec("++ PC\tParaList der cb - klasse: ", superclassid.get_ParaList())); - parserlog.debug(string_rec("++ PC\tchildhash : ", childhash)); - } - - // falls bei Vererbung ein Parameter bereits festgelegt ist, so wird er hier aus dem ParaList-Vector entfernt - Vector rm = new Vector(); /* container f�r zu entfendende Typen */ - - for( Enumeration e2=classlist.elements(); e2.hasMoreElements(); ) - { - Class c = e2.nextElement(); - for(Enumeration e1=superclassid.get_ParaList().elements();e1.hasMoreElements();) - { - Type t=(Type)e1.nextElement(); - - if(c.getName().equals(t.getName())) - { - int i = superclassid.get_ParaList().indexOf(t); - - // refe ... - if ( t instanceof RefType ) - { - if( ((RefType)t).get_ParaList() != null) - { - if( ((RefType)t).get_ParaList().size()>0) - { - /* auf existenz der Parameter pr�fen */ - for(Enumeration e11 = ((RefType)t).get_ParaList().elements();e11.hasMoreElements();) - { - Type ty = (Type)e11.nextElement(); - try - { - is_declared(ty,classlist); - } - catch(SCClassBodyException ex) - { - // otth: auskommentiert, den Parameter muessen nicht unbedingt bereits definierte Klassen sein - // throw ex; - } - } - } - } - } - - rm.add(t); - Type removetype = (Type)supercl.get_ParaList().elementAt(i); - - kill.put(removetype,t); - - for(Enumeration e3=parahash.keys(),e4=parahash.elements();e3.hasMoreElements();) - { - String key = (String)e3.nextElement(); - String ele = (String)e4.nextElement(); - if(ele.equals(removetype.getName())) - { - parahash.remove(key); - } - } - } - } - } - if(rm.size()>0) - { - for(Enumeration e4 = rm.elements();e4.hasMoreElements();) - { - Type t=(Type)e4.nextElement(); - superclassid.get_ParaList().remove(t); - parserlog.debug(string_rec("Typ \""+t.getName()+"\" aus ParaList entfernt! ", superclassid.get_ParaList())); - } - } - } - } - - for(Enumeration e=childhash.keys();e.hasMoreElements();){ - String key = (String)e.nextElement(); - parahash.put(key,(String)childhash.get(key)); - } - return parahash; - } - // ino.end - - - // ino.method.codegen.23176.definition public void codegen(ClassFile classfile, Vector paralist) throws JVMCodeException @@ -435,11 +76,13 @@ Paratyp gesetzt."); } { for(int i=0 ; i < fielddecl.size() ; i++) { - if(this.fielddecl.elementAt(i) instanceof InstVarDecl) + /* + * if(this.fielddecl.elementAt(i) instanceof InstVarDecl) { ((InstVarDecl)this.fielddecl.elementAt(i)).codegen(classfile, paralist); } else + */ { this.fielddecl.elementAt(i).codegen(classfile, paralist); } @@ -449,17 +92,8 @@ Paratyp gesetzt."); } - // ino.method.get_hash.23179.definition - public Hashtable get_hash() - // ino.end - // ino.method.get_hash.23179.body - { - return hash; - } - // ino.end - // ino.method.get_FieldDeclVector.23182.definition - public Vector get_FieldDeclVector() + public Vector getFields() // ino.end // ino.method.get_FieldDeclVector.23182.body { @@ -468,7 +102,7 @@ Paratyp gesetzt."); } // ino.end // ino.method.set_FieldDecl.23185.definition - public void set_FieldDecl(FieldDecl i) + public void set_FieldDecl(Field i) // ino.end // ino.method.set_FieldDecl.23185.body { @@ -747,7 +381,7 @@ public void istParameterOK( Vector Parameter, Vector KlassenVektor ) public JavaCodeResult printJavaCode(ResultSet resultSet) { JavaCodeResult ret = new JavaCodeResult("{\n"); - for(FieldDecl field : this.fielddecl)ret.attach( field.printJavaCode(resultSet) ).attach( "\n" ); + for(Field field : this.fielddecl)ret.attach( field.printJavaCode(resultSet) ).attach( "\n" ); return ret.attach("}\n"); } diff --git a/src/mycompiler/myclass/Constant.java b/src/mycompiler/myclass/Constant.java index cd2c6a1bf..f43a60c2c 100755 --- a/src/mycompiler/myclass/Constant.java +++ b/src/mycompiler/myclass/Constant.java @@ -31,7 +31,7 @@ import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent; // ino.end // ino.class.Constant.23212.declaration -public class Constant extends FieldDecl +public class Constant extends Method // ino.end // ino.class.Constant.23212.body { diff --git a/src/mycompiler/myclass/Field.java b/src/mycompiler/myclass/Field.java new file mode 100644 index 000000000..7bbe9d4e7 --- /dev/null +++ b/src/mycompiler/myclass/Field.java @@ -0,0 +1,88 @@ +package mycompiler.myclass; + +import java.util.Vector; + +import mycompiler.mybytecode.ClassFile; +import mycompiler.myexception.JVMCodeException; +import mycompiler.mytype.Type; +import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent; +import typinferenz.JavaCodeResult; +import typinferenz.ResultSet; +import typinferenz.Typable; +import typinferenz.TypeInsertable; +import typinferenz.assumptions.TypeAssumptions; + +public abstract class Field implements TypeInsertable, Typable{ + // ino.attribute.declid.23370.declaration + protected Vector declid = new Vector(); // Vector, da 'int a, b, c, ...' auch eingeparst werden muss + + private Type typ; + + @Override + public void setTypeVariable(Type typ) { + this.typ = typ; + } + @Override + public Type getTypeVariable() { + return typ; + } + + // ino.method.codegen.23376.declaration + public abstract void codegen(ClassFile classfile, Vector paralist) + throws JVMCodeException; + // ino.end + + + + // ino.method.set_DeclId.23379.definition + public void set_DeclId(DeclId did) + // ino.end + // ino.method.set_DeclId.23379.body + { + this.declid.addElement(did); + } + // ino.end + + + + // ino.method.get_Name.23382.definition + public Vector get_Name() + // ino.end + // ino.method.get_Name.23382.body + { + return declid; + } + // ino.end + + // ino.method.getDeclIdVector.23385.definition + public Vector getDeclIdVector() + // ino.end + // ino.method.getDeclIdVector.23385.body + { + // otth: ganzer Vektor zur�ckgeben, um ihn zu kopieren (vgl. MyCompiler - Konstruktor in Methode umwandeln) + return declid; + } + // ino.end + + // ino.method.setDeclIdVector.23388.definition + public void setDeclIdVector( Vector vDeclId ) + // ino.end + // ino.method.setDeclIdVector.23388.body + { + // otth: kompletter Vektor setzen, um ihn zu kopieren (vgl. MyCompiler - Konstruktor in Methode umwandeln) + declid = vDeclId; + } + // ino.end + + + + + public abstract JavaCodeResult printJavaCode(ResultSet resultSet); + + /** + * Diese Methode generiert die Assumptions für dieses Feld der Klasse classmember + * @param classmember + * @return + */ + public abstract TypeAssumptions createTypeAssumptions(Class classmember); +} diff --git a/src/mycompiler/myclass/FieldDecl.java b/src/mycompiler/myclass/FieldDecl.java index cadd1d7a5..cbc1c278f 100755 --- a/src/mycompiler/myclass/FieldDecl.java +++ b/src/mycompiler/myclass/FieldDecl.java @@ -16,6 +16,7 @@ import mycompiler.mystatement.Expr; import mycompiler.mytypereconstruction.set.CTypeAssumptionSet; import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption; +@Deprecated // ino.class.FieldDecl.23367.declaration public abstract class FieldDecl implements TypeInsertable // ino.end diff --git a/src/mycompiler/myclass/FieldDeclaration.java b/src/mycompiler/myclass/FieldDeclaration.java new file mode 100644 index 000000000..4ffdd63e9 --- /dev/null +++ b/src/mycompiler/myclass/FieldDeclaration.java @@ -0,0 +1,62 @@ +package mycompiler.myclass; + +import java.util.Vector; + +import typinferenz.JavaCodeResult; +import typinferenz.ResultSet; +import typinferenz.assumptions.TypeAssumptions; +import mycompiler.mybytecode.ClassFile; +import mycompiler.myexception.JVMCodeException; +import mycompiler.mystatement.Expr; +import mycompiler.mytype.Type; +import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent; + +public class FieldDeclaration extends Field{ + + private Expr wert; + //private Type type; + + public void setWert(Expr initialExpression){ + this.wert = initialExpression; + } + public Expr getWert(){ + return this.wert; + } + + public String getName(){ + return this.get_Name().elementAt(0).name; + } + + + @Override + public void replaceType(CReplaceTypeEvent e) { + // TODO Auto-generated method stub + } + + @Override + public int getTypeLineNumber() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void codegen(ClassFile classfile, Vector paralist) + throws JVMCodeException { + // TODO Auto-generated method stub + + } + + @Override + public JavaCodeResult printJavaCode(ResultSet resultSet) { + // TODO Auto-generated method stub + return null; + } + + @Override + public TypeAssumptions createTypeAssumptions(Class classmember) { + // TODO Auto-generated method stub + return null; + } + + +} diff --git a/src/mycompiler/myclass/FieldInitialization.java b/src/mycompiler/myclass/FieldInitialization.java index b6d611576..dfc98e368 100755 --- a/src/mycompiler/myclass/FieldInitialization.java +++ b/src/mycompiler/myclass/FieldInitialization.java @@ -12,6 +12,7 @@ import mycompiler.mytype.Type; import mycompiler.mytype.TypePlaceholder; import mycompiler.mytypereconstruction.typeassumption.CInstVarTypeAssumption; +@Deprecated public class FieldInitialization extends InstVarDecl { diff --git a/src/mycompiler/myclass/Method.java b/src/mycompiler/myclass/Method.java index 1bf3714f3..c4c88e5db 100755 --- a/src/mycompiler/myclass/Method.java +++ b/src/mycompiler/myclass/Method.java @@ -42,7 +42,7 @@ import typinferenz.assumptions.TypeAssumptions; // ino.class.Method.23482.declaration -public class Method extends FieldDecl implements ITypeReplacementListener, IItemWithOffset, TypeInsertable +public class Method extends Field implements ITypeReplacementListener, IItemWithOffset, TypeInsertable // ino.end // ino.class.Method.23482.body { diff --git a/src/mycompiler/myinterface/InterfaceBody.java b/src/mycompiler/myinterface/InterfaceBody.java index 9ea8321d1..54d904eaa 100755 --- a/src/mycompiler/myinterface/InterfaceBody.java +++ b/src/mycompiler/myinterface/InterfaceBody.java @@ -4,6 +4,9 @@ package mycompiler.myinterface; // ino.module.InterfaceBody.8583.import import java.util.Vector; + +import mycompiler.myclass.Field; + import mycompiler.mybytecode.ClassFile; import mycompiler.myclass.Constant; import mycompiler.myclass.FieldDecl; @@ -52,7 +55,7 @@ public class InterfaceBody */ // ino.end // ino.method.addElement.23996.definition - public void addElement(FieldDecl fd) + public void addElement(Field fd) // ino.end // ino.method.addElement.23996.body { diff --git a/src/mycompiler/myparser/JavaParser.java b/src/mycompiler/myparser/JavaParser.java index 798fc6b43..eeee109c6 100644 --- a/src/mycompiler/myparser/JavaParser.java +++ b/src/mycompiler/myparser/JavaParser.java @@ -8,9 +8,9 @@ Backup von JavaParser.jay 10.April 17 Uhr package mycompiler.myparser; - +import mycompiler.myclass.FieldDeclaration; +import mycompiler.myclass.Field; import java.util.Vector; -import mycompiler.myclass.FieldInitialization; import mycompiler.SourceFile; import mycompiler.AClassOrInterface; import mycompiler.myclass.Class; @@ -20,7 +20,6 @@ import mycompiler.myclass.Constant; import mycompiler.myclass.ImportDeclarations; import mycompiler.myclass.DeclId; import mycompiler.myclass.ExceptionList; -import mycompiler.myclass.FieldDecl; import mycompiler.myclass.FormalParameter; import mycompiler.myclass.InstVarDecl; import mycompiler.myclass.Method; @@ -129,7 +128,7 @@ void initUsedIdsToCheck() { //LUAR 07-05-29 Anfang für Wildcard Test public Vector testPair = new Vector(); //LUAR 07-05-29 Ende - // line 133 "-" + // line 132 "-" // %token constants //{ //ergaenzt PL 23.01.01 wieder entfernt 21.12.01 public static final int ABSTRACT = 257; @@ -747,20 +746,20 @@ public Vector testPair = new Vector(); yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]); switch (yyN) { case 1: - // line 324 "./../src/mycompiler/myparser/JavaParser.jay" + // line 323 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((SourceFile)yyVals[0+yyTop]); } break; case 2: - // line 352 "./../src/mycompiler/myparser/JavaParser.jay" + // line 351 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Package*/ yyVal = ((UsedId)yyVals[-1+yyTop]); } break; case 3: - // line 358 "./../src/mycompiler/myparser/JavaParser.jay" + // line 357 "./../src/mycompiler/myparser/JavaParser.jay" { ImportDeclarations declarations=new ImportDeclarations(); declarations.addElement(((UsedId)yyVals[0+yyTop])); @@ -768,20 +767,20 @@ case 3: } break; case 4: - // line 364 "./../src/mycompiler/myparser/JavaParser.jay" + // line 363 "./../src/mycompiler/myparser/JavaParser.jay" { ((ImportDeclarations)yyVals[-1+yyTop]).addElement(((UsedId)yyVals[0+yyTop])); yyVal=((ImportDeclarations)yyVals[-1+yyTop]); } break; case 5: - // line 370 "./../src/mycompiler/myparser/JavaParser.jay" + // line 369 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((UsedId)yyVals[-1+yyTop]); } break; case 6: - // line 375 "./../src/mycompiler/myparser/JavaParser.jay" + // line 374 "./../src/mycompiler/myparser/JavaParser.jay" { SourceFile Scfile = new SourceFile(); Scfile.addElement(((AClassOrInterface)yyVals[0+yyTop])); @@ -789,32 +788,32 @@ case 6: } break; case 7: - // line 381 "./../src/mycompiler/myparser/JavaParser.jay" + // line 380 "./../src/mycompiler/myparser/JavaParser.jay" { ((SourceFile)yyVals[-1+yyTop]).addElement(((AClassOrInterface)yyVals[0+yyTop])); yyVal=((SourceFile)yyVals[-1+yyTop]); } break; case 8: - // line 387 "./../src/mycompiler/myparser/JavaParser.jay" + // line 386 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((UsedId)yyVals[0+yyTop]); } break; case 9: - // line 391 "./../src/mycompiler/myparser/JavaParser.jay" + // line 390 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((UsedId)yyVals[0+yyTop]); } break; case 10: - // line 396 "./../src/mycompiler/myparser/JavaParser.jay" + // line 395 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Class)yyVals[0+yyTop]); } break; case 11: - // line 407 "./../src/mycompiler/myparser/JavaParser.jay" + // line 406 "./../src/mycompiler/myparser/JavaParser.jay" { ((UsedId)yyVals[-2+yyTop]).set_Name(((Token)yyVals[0+yyTop]).getLexem()); ((UsedId)yyVals[-2+yyTop]).setOffset(((UsedId)yyVals[-2+yyTop]).getOffset()); @@ -822,7 +821,7 @@ case 11: } break; case 12: - // line 414 "./../src/mycompiler/myparser/JavaParser.jay" + // line 413 "./../src/mycompiler/myparser/JavaParser.jay" { ((UsedId)yyVals[-2+yyTop]).set_Name(((Token)yyVals[0+yyTop]).getLexem()); ((UsedId)yyVals[-2+yyTop]).setOffset(((UsedId)yyVals[-2+yyTop]).getOffset()); @@ -830,7 +829,7 @@ case 12: } break; case 13: - // line 420 "./../src/mycompiler/myparser/JavaParser.jay" + // line 419 "./../src/mycompiler/myparser/JavaParser.jay" { ((UsedId)yyVals[-2+yyTop]).set_Name("*"); ((UsedId)yyVals[-2+yyTop]).setOffset(((UsedId)yyVals[-2+yyTop]).getOffset()); @@ -838,7 +837,7 @@ case 13: } break; case 14: - // line 428 "./../src/mycompiler/myparser/JavaParser.jay" + // line 427 "./../src/mycompiler/myparser/JavaParser.jay" { UsedId UI = new UsedId(((Token)yyVals[0+yyTop]).getOffset()); UI.set_Name( ((Token)yyVals[0+yyTop]).getLexem() ); @@ -847,7 +846,7 @@ case 14: } break; case 15: - // line 436 "./../src/mycompiler/myparser/JavaParser.jay" + // line 435 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Um das hier uebersichtlicher zu halten,*/ /* gibt es einen allumfassenden Konstruktor fuer Class*/ @@ -866,7 +865,7 @@ case 15: } break; case 16: - // line 453 "./../src/mycompiler/myparser/JavaParser.jay" + // line 452 "./../src/mycompiler/myparser/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()); this.initContainedTypes(); @@ -874,7 +873,7 @@ case 16: } break; case 17: - // line 459 "./../src/mycompiler/myparser/JavaParser.jay" + // line 458 "./../src/mycompiler/myparser/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()); this.initContainedTypes(); @@ -882,7 +881,7 @@ case 17: } break; case 18: - // line 465 "./../src/mycompiler/myparser/JavaParser.jay" + // line 464 "./../src/mycompiler/myparser/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()); this.initContainedTypes(); @@ -890,7 +889,7 @@ case 18: } break; case 19: - // line 472 "./../src/mycompiler/myparser/JavaParser.jay" + // line 471 "./../src/mycompiler/myparser/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()); this.initContainedTypes(); @@ -898,7 +897,7 @@ case 19: } break; case 20: - // line 478 "./../src/mycompiler/myparser/JavaParser.jay" + // line 477 "./../src/mycompiler/myparser/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()); this.initContainedTypes(); @@ -906,7 +905,7 @@ case 20: } break; case 21: - // line 484 "./../src/mycompiler/myparser/JavaParser.jay" + // line 483 "./../src/mycompiler/myparser/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()); this.initContainedTypes(); @@ -914,7 +913,7 @@ case 21: } break; case 22: - // line 490 "./../src/mycompiler/myparser/JavaParser.jay" + // line 489 "./../src/mycompiler/myparser/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()); this.initContainedTypes(); @@ -922,7 +921,7 @@ case 22: } break; case 23: - // line 497 "./../src/mycompiler/myparser/JavaParser.jay" + // line 496 "./../src/mycompiler/myparser/JavaParser.jay" { /* HOTI*/ /* Verbindet den Namen eines Interfaces mit einer optionalen Parameterliste*/ @@ -930,13 +929,13 @@ case 23: } break; case 24: - // line 503 "./../src/mycompiler/myparser/JavaParser.jay" + // line 502 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = new InterfaceAndParameter(((Token)yyVals[-3+yyTop]).getLexem(), ((ParaList)yyVals[-1+yyTop])); } break; case 25: - // line 508 "./../src/mycompiler/myparser/JavaParser.jay" + // line 507 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Hilfskonstrukt, um die Grammatik ueberschaubar zu halten*/ /* Verbindet den Namen einer Klasse mit einer optionalen Parameterliste*/ @@ -944,13 +943,13 @@ case 25: } break; case 26: - // line 514 "./../src/mycompiler/myparser/JavaParser.jay" + // line 513 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = new ClassAndParameter(((Token)yyVals[-3+yyTop]).getLexem(), ((ParaList)yyVals[-1+yyTop])); } break; case 27: - // line 519 "./../src/mycompiler/myparser/JavaParser.jay" + // line 518 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ Interface ic = new Interface(((InterfaceAndParameter)yyVals[-1+yyTop]).getName()); @@ -962,7 +961,7 @@ case 27: } break; case 28: - // line 529 "./../src/mycompiler/myparser/JavaParser.jay" + // line 528 "./../src/mycompiler/myparser/JavaParser.jay" { Interface ic = new Interface(((InterfaceAndParameter)yyVals[-1+yyTop]).getName(), ((Modifiers)yyVals[-3+yyTop])); ic.setInterfaceBody(((InterfaceBody)yyVals[0+yyTop])); @@ -973,7 +972,7 @@ case 28: } break; case 29: - // line 538 "./../src/mycompiler/myparser/JavaParser.jay" + // line 537 "./../src/mycompiler/myparser/JavaParser.jay" { Interface ic = new Interface(((InterfaceAndParameter)yyVals[-2+yyTop]).getName()); ic.setParaList(((InterfaceAndParameter)yyVals[-2+yyTop]).getParaVector()); @@ -985,7 +984,7 @@ case 29: } break; case 30: - // line 548 "./../src/mycompiler/myparser/JavaParser.jay" + // line 547 "./../src/mycompiler/myparser/JavaParser.jay" { Interface ic = new Interface(((InterfaceAndParameter)yyVals[-2+yyTop]).getName(), ((Modifiers)yyVals[-4+yyTop])); ic.setParaList(((InterfaceAndParameter)yyVals[-2+yyTop]).getParaVector()); @@ -997,7 +996,7 @@ case 30: } break; case 31: - // line 559 "./../src/mycompiler/myparser/JavaParser.jay" + // line 558 "./../src/mycompiler/myparser/JavaParser.jay" { ParaList pl = new ParaList(); /* #JB# 05.04.2005 */ @@ -1010,7 +1009,7 @@ case 31: } break; case 32: - // line 570 "./../src/mycompiler/myparser/JavaParser.jay" + // line 569 "./../src/mycompiler/myparser/JavaParser.jay" { ParaList pl = new ParaList(); RefType t = new RefType( ((Token)yyVals[-3+yyTop]).getLexem(),((Token)yyVals[-3+yyTop]).getOffset() ); @@ -1021,7 +1020,7 @@ case 32: } break; case 33: - // line 579 "./../src/mycompiler/myparser/JavaParser.jay" + // line 578 "./../src/mycompiler/myparser/JavaParser.jay" { ParaList pl = new ParaList(); pl.getParalist().addElement(((WildcardType)yyVals[0+yyTop])); @@ -1029,7 +1028,7 @@ case 33: } break; case 34: - // line 585 "./../src/mycompiler/myparser/JavaParser.jay" + // line 584 "./../src/mycompiler/myparser/JavaParser.jay" { /* #JB# 05.04.2005 */ @@ -1043,7 +1042,7 @@ case 34: } break; case 35: - // line 598 "./../src/mycompiler/myparser/JavaParser.jay" + // line 597 "./../src/mycompiler/myparser/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() ); @@ -1053,14 +1052,14 @@ case 35: } break; case 36: - // line 606 "./../src/mycompiler/myparser/JavaParser.jay" + // line 605 "./../src/mycompiler/myparser/JavaParser.jay" { ((ParaList)yyVals[-2+yyTop]).getParalist().addElement(((WildcardType)yyVals[0+yyTop])); yyVal=((ParaList)yyVals[-2+yyTop]); } break; case 37: - // line 612 "./../src/mycompiler/myparser/JavaParser.jay" + // line 611 "./../src/mycompiler/myparser/JavaParser.jay" { /*Luar 29.11.06 Offset auf -1, da keine Angabe vorhanden*/ WildcardType wc = new WildcardType(-1); @@ -1068,34 +1067,34 @@ case 37: } break; case 38: - // line 618 "./../src/mycompiler/myparser/JavaParser.jay" + // line 617 "./../src/mycompiler/myparser/JavaParser.jay" { ExtendsWildcardType ewc = new ExtendsWildcardType(((Token)yyVals[-1+yyTop]).getOffset(),((RefType)yyVals[0+yyTop])); yyVal = ewc; } break; case 39: - // line 623 "./../src/mycompiler/myparser/JavaParser.jay" + // line 622 "./../src/mycompiler/myparser/JavaParser.jay" { SuperWildcardType swc = new SuperWildcardType(((Token)yyVals[-1+yyTop]).getOffset(),((RefType)yyVals[0+yyTop])); yyVal = swc; } break; case 40: - // line 629 "./../src/mycompiler/myparser/JavaParser.jay" + // line 628 "./../src/mycompiler/myparser/JavaParser.jay" { ClassBody CB = new ClassBody(); yyVal = CB; } break; case 41: - // line 635 "./../src/mycompiler/myparser/JavaParser.jay" + // line 634 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = ((ClassBody)yyVals[-1+yyTop]); } break; case 42: - // line 640 "./../src/mycompiler/myparser/JavaParser.jay" + // line 639 "./../src/mycompiler/myparser/JavaParser.jay" { Modifiers Mod = new Modifiers(); Mod.addModifier(((Modifier)yyVals[0+yyTop])); @@ -1103,20 +1102,20 @@ case 42: } break; case 43: - // line 646 "./../src/mycompiler/myparser/JavaParser.jay" + // line 645 "./../src/mycompiler/myparser/JavaParser.jay" { ((Modifiers)yyVals[-1+yyTop]).addModifier(((Modifier)yyVals[0+yyTop])); yyVal = ((Modifiers)yyVals[-1+yyTop]); } break; case 44: - // line 652 "./../src/mycompiler/myparser/JavaParser.jay" + // line 651 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = ((UsedId)yyVals[0+yyTop]); } break; case 45: - // line 657 "./../src/mycompiler/myparser/JavaParser.jay" + // line 656 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ InterfaceList il = new InterfaceList(); @@ -1125,27 +1124,27 @@ case 45: } break; case 46: - // line 664 "./../src/mycompiler/myparser/JavaParser.jay" + // line 663 "./../src/mycompiler/myparser/JavaParser.jay" { ((InterfaceList)yyVals[-2+yyTop]).addInterface(((UsedId)yyVals[0+yyTop])); yyVal = ((InterfaceList)yyVals[-2+yyTop]); } break; case 47: - // line 670 "./../src/mycompiler/myparser/JavaParser.jay" + // line 669 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ yyVal = new InterfaceBody(); } break; case 48: - // line 675 "./../src/mycompiler/myparser/JavaParser.jay" + // line 674 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = ((InterfaceBody)yyVals[-1+yyTop]); } break; case 49: - // line 682 "./../src/mycompiler/myparser/JavaParser.jay" + // line 681 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ InterfaceList il = new InterfaceList(); @@ -1154,70 +1153,70 @@ case 49: } break; case 50: - // line 689 "./../src/mycompiler/myparser/JavaParser.jay" + // line 688 "./../src/mycompiler/myparser/JavaParser.jay" { ((InterfaceList)yyVals[-2+yyTop]).addInterface(((UsedId)yyVals[0+yyTop])); yyVal = ((InterfaceList)yyVals[-2+yyTop]); } break; case 51: - // line 696 "./../src/mycompiler/myparser/JavaParser.jay" + // line 695 "./../src/mycompiler/myparser/JavaParser.jay" { ClassBody CB = new ClassBody(); - CB.set_FieldDecl( ((FieldDecl)yyVals[0+yyTop]) ); + CB.set_FieldDecl( ((Field)yyVals[0+yyTop]) ); yyVal=CB; } break; case 52: - // line 702 "./../src/mycompiler/myparser/JavaParser.jay" + // line 701 "./../src/mycompiler/myparser/JavaParser.jay" { - ((ClassBody)yyVals[-1+yyTop]).set_FieldDecl(((FieldDecl)yyVals[0+yyTop])); + ((ClassBody)yyVals[-1+yyTop]).set_FieldDecl(((Field)yyVals[0+yyTop])); yyVal = ((ClassBody)yyVals[-1+yyTop]); } break; case 53: - // line 709 "./../src/mycompiler/myparser/JavaParser.jay" + // line 708 "./../src/mycompiler/myparser/JavaParser.jay" { Public Pub = new Public(); yyVal=Pub; } break; case 54: - // line 714 "./../src/mycompiler/myparser/JavaParser.jay" + // line 713 "./../src/mycompiler/myparser/JavaParser.jay" { Protected Pro = new Protected(); yyVal=Pro; } break; case 55: - // line 719 "./../src/mycompiler/myparser/JavaParser.jay" + // line 718 "./../src/mycompiler/myparser/JavaParser.jay" { Private Pri = new Private(); yyVal=Pri; } break; case 56: - // line 724 "./../src/mycompiler/myparser/JavaParser.jay" + // line 723 "./../src/mycompiler/myparser/JavaParser.jay" { Static Sta = new Static(); yyVal=Sta; } break; case 57: - // line 729 "./../src/mycompiler/myparser/JavaParser.jay" + // line 728 "./../src/mycompiler/myparser/JavaParser.jay" { Abstract Abs = new Abstract(); yyVal=Abs; } break; case 58: - // line 734 "./../src/mycompiler/myparser/JavaParser.jay" + // line 733 "./../src/mycompiler/myparser/JavaParser.jay" { Final fin = new Final(); yyVal = fin; } break; case 59: - // line 740 "./../src/mycompiler/myparser/JavaParser.jay" + // line 739 "./../src/mycompiler/myparser/JavaParser.jay" { /*PL 05-07-30 eingefuegt containedTypes ANFANG*/ RefType RT = new RefType(-1); @@ -1232,48 +1231,48 @@ case 59: } break; case 60: - // line 755 "./../src/mycompiler/myparser/JavaParser.jay" + // line 754 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ InterfaceBody ib = new InterfaceBody(); - ib.addElement(((FieldDecl)yyVals[0+yyTop])); + ib.addElement(((Field)yyVals[0+yyTop])); yyVal = ib; } break; case 61: - // line 762 "./../src/mycompiler/myparser/JavaParser.jay" + // line 761 "./../src/mycompiler/myparser/JavaParser.jay" { - ((InterfaceBody)yyVals[-1+yyTop]).addElement(((FieldDecl)yyVals[0+yyTop])); + ((InterfaceBody)yyVals[-1+yyTop]).addElement(((Field)yyVals[0+yyTop])); yyVal = ((InterfaceBody)yyVals[-1+yyTop]); } break; case 62: - // line 768 "./../src/mycompiler/myparser/JavaParser.jay" + // line 767 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interfaces*/ yyVal = ((UsedId)yyVals[0+yyTop]); } break; case 63: - // line 774 "./../src/mycompiler/myparser/JavaParser.jay" + // line 773 "./../src/mycompiler/myparser/JavaParser.jay" { - yyVal=((FieldDecl)yyVals[0+yyTop]); + yyVal=((Field)yyVals[0+yyTop]); } break; case 64: - // line 779 "./../src/mycompiler/myparser/JavaParser.jay" + // line 778 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Method)yyVals[0+yyTop]); } break; case 65: - // line 783 "./../src/mycompiler/myparser/JavaParser.jay" + // line 782 "./../src/mycompiler/myparser/JavaParser.jay" { - yyVal=((FieldDecl)yyVals[0+yyTop]); + yyVal=((Field)yyVals[0+yyTop]); } break; case 66: - // line 788 "./../src/mycompiler/myparser/JavaParser.jay" + // line 787 "./../src/mycompiler/myparser/JavaParser.jay" { if (((ParaList)yyVals[0+yyTop]) != null) { ((UsedId)yyVals[-1+yyTop]).set_ParaList(((ParaList)yyVals[0+yyTop]).get_ParaList()); @@ -1285,42 +1284,42 @@ case 66: } break; case 67: - // line 799 "./../src/mycompiler/myparser/JavaParser.jay" + // line 798 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = null; } break; case 68: - // line 801 "./../src/mycompiler/myparser/JavaParser.jay" + // line 800 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = ((ParaList)yyVals[-1+yyTop]); } break; case 69: - // line 806 "./../src/mycompiler/myparser/JavaParser.jay" + // line 805 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interfaces, Spezialform Konstantendef.*/ yyVal = ((Constant)yyVals[0+yyTop]); } break; case 70: - // line 811 "./../src/mycompiler/myparser/JavaParser.jay" + // line 810 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = ((Method)yyVals[0+yyTop]); } break; case 71: - // line 816 "./../src/mycompiler/myparser/JavaParser.jay" + // line 815 "./../src/mycompiler/myparser/JavaParser.jay" { - yyVal=((FieldDecl)yyVals[0+yyTop]); + yyVal=((Field)yyVals[0+yyTop]); } break; case 72: - // line 820 "./../src/mycompiler/myparser/JavaParser.jay" + // line 819 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Method)yyVals[0+yyTop]); } break; case 73: - // line 825 "./../src/mycompiler/myparser/JavaParser.jay" + // line 824 "./../src/mycompiler/myparser/JavaParser.jay" { Method STAT = new Method(); DeclId DST = new DeclId(); @@ -1335,14 +1334,14 @@ case 73: } break; case 74: - // line 839 "./../src/mycompiler/myparser/JavaParser.jay" + // line 838 "./../src/mycompiler/myparser/JavaParser.jay" { ((Constructor)yyVals[-1+yyTop]).set_Block(((Block)yyVals[0+yyTop])); yyVal = ((Constructor)yyVals[-1+yyTop]); } break; case 75: - // line 844 "./../src/mycompiler/myparser/JavaParser.jay" + // line 843 "./../src/mycompiler/myparser/JavaParser.jay" { ((Constructor)yyVals[-1+yyTop]).set_Block(((Block)yyVals[0+yyTop])); ((Constructor)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); @@ -1350,7 +1349,7 @@ case 75: } break; case 76: - // line 851 "./../src/mycompiler/myparser/JavaParser.jay" + // line 850 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ Constant c = new Constant(((Token)yyVals[-3+yyTop]).getLexem(), ((Modifiers)yyVals[-5+yyTop])); @@ -1360,42 +1359,42 @@ case 76: } break; case 77: - // line 860 "./../src/mycompiler/myparser/JavaParser.jay" + // line 859 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ yyVal = ((Method)yyVals[-1+yyTop]); } break; case 78: - // line 873 "./../src/mycompiler/myparser/JavaParser.jay" + // line 872 "./../src/mycompiler/myparser/JavaParser.jay" { - FieldInitialization ret = new FieldInitialization(); + FieldDeclaration ret = new FieldDeclaration(); ret.set_DeclId(((DeclId)yyVals[-2+yyTop])); ret.setWert(((Expr)yyVals[0+yyTop])); yyVal=ret; } break; case 79: - // line 881 "./../src/mycompiler/myparser/JavaParser.jay" + // line 880 "./../src/mycompiler/myparser/JavaParser.jay" { - yyVal=((FieldInitialization)yyVals[-1+yyTop]); + yyVal=((FieldDeclaration)yyVals[-1+yyTop]); } break; case 80: - // line 885 "./../src/mycompiler/myparser/JavaParser.jay" + // line 884 "./../src/mycompiler/myparser/JavaParser.jay" { - ((FieldInitialization)yyVals[0+yyTop]).setType(((Type)yyVals[-1+yyTop])); - yyVal=((FieldInitialization)yyVals[0+yyTop]); + ((FieldDeclaration)yyVals[0+yyTop]).setTypeVariable(((Type)yyVals[-1+yyTop])); + yyVal=((FieldDeclaration)yyVals[0+yyTop]); } break; case 81: - // line 891 "./../src/mycompiler/myparser/JavaParser.jay" + // line 890 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((InstVarDecl)yyVals[-1+yyTop]); } break; case 82: - // line 896 "./../src/mycompiler/myparser/JavaParser.jay" + // line 895 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->fielddeclaration ...: type " + ((Type)yyVals[-2+yyTop])); ((InstVarDecl)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); @@ -1403,7 +1402,7 @@ case 82: } break; case 83: - // line 903 "./../src/mycompiler/myparser/JavaParser.jay" + // line 902 "./../src/mycompiler/myparser/JavaParser.jay" { ((InstVarDecl)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); for(int i=0;i<(((InstVarDecl)yyVals[-1+yyTop]).getDeclIdVector().size());i++) @@ -1414,27 +1413,27 @@ case 83: } break; case 84: - // line 913 "./../src/mycompiler/myparser/JavaParser.jay" + // line 912 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).set_Block(((Block)yyVals[0+yyTop])); yyVal=((Method)yyVals[-1+yyTop]); } break; case 85: - // line 920 "./../src/mycompiler/myparser/JavaParser.jay" + // line 919 "./../src/mycompiler/myparser/JavaParser.jay" { Block Bl = new Block(); yyVal=Bl; } break; case 86: - // line 926 "./../src/mycompiler/myparser/JavaParser.jay" + // line 925 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Block)yyVals[-1+yyTop]); } break; case 87: - // line 931 "./../src/mycompiler/myparser/JavaParser.jay" + // line 930 "./../src/mycompiler/myparser/JavaParser.jay" { Constructor CON = new Constructor(); DeclId DIDCon = new DeclId(); @@ -1444,7 +1443,7 @@ case 87: } break; case 88: - // line 939 "./../src/mycompiler/myparser/JavaParser.jay" + // line 938 "./../src/mycompiler/myparser/JavaParser.jay" { Constructor CONpara = new Constructor(); DeclId DIconpara = new DeclId(); @@ -1455,14 +1454,14 @@ case 88: } break; case 89: - // line 949 "./../src/mycompiler/myparser/JavaParser.jay" + // line 948 "./../src/mycompiler/myparser/JavaParser.jay" { Block CBL = new Block(); yyVal=CBL; } break; case 90: - // line 954 "./../src/mycompiler/myparser/JavaParser.jay" + // line 953 "./../src/mycompiler/myparser/JavaParser.jay" { Block CBLexpl = new Block(); CBLexpl.set_Statement(((Statement)yyVals[-1+yyTop])); @@ -1470,13 +1469,13 @@ case 90: } break; case 91: - // line 960 "./../src/mycompiler/myparser/JavaParser.jay" + // line 959 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Block)yyVals[-1+yyTop]); } break; case 92: - // line 964 "./../src/mycompiler/myparser/JavaParser.jay" + // line 963 "./../src/mycompiler/myparser/JavaParser.jay" { Block CBes = new Block(); CBes.set_Statement(((Statement)yyVals[-2+yyTop])); @@ -1488,7 +1487,7 @@ case 92: } break; case 93: - // line 975 "./../src/mycompiler/myparser/JavaParser.jay" + // line 974 "./../src/mycompiler/myparser/JavaParser.jay" { ExceptionList EL = new ExceptionList(); EL.set_addElem(((RefType)yyVals[0+yyTop])); @@ -1496,13 +1495,13 @@ case 93: } break; case 94: - // line 982 "./../src/mycompiler/myparser/JavaParser.jay" + // line 981 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = ((GenericTypeVar)yyVals[0+yyTop]); } break; case 95: - // line 987 "./../src/mycompiler/myparser/JavaParser.jay" + // line 986 "./../src/mycompiler/myparser/JavaParser.jay" { ParaList p = new ParaList(); p.add_ParaList(((GenericTypeVar)yyVals[0+yyTop])); @@ -1510,20 +1509,20 @@ case 95: } break; case 96: - // line 993 "./../src/mycompiler/myparser/JavaParser.jay" + // line 992 "./../src/mycompiler/myparser/JavaParser.jay" { ((ParaList)yyVals[-2+yyTop]).add_ParaList(((GenericTypeVar)yyVals[0+yyTop])); yyVal=((ParaList)yyVals[-2+yyTop]); } break; case 97: - // line 1000 "./../src/mycompiler/myparser/JavaParser.jay" + // line 999 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=new GenericTypeVar(((Token)yyVals[0+yyTop]).getLexem(),((Token)yyVals[0+yyTop]).getOffset()); } break; case 98: - // line 1004 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1003 "./../src/mycompiler/myparser/JavaParser.jay" { BoundedGenericTypeVar gtv=new BoundedGenericTypeVar(((Token)yyVals[-2+yyTop]).getLexem(),((Token)yyVals[-2+yyTop]).getOffset()); gtv.setBounds(((Vector)yyVals[0+yyTop])); @@ -1531,7 +1530,7 @@ case 98: } break; case 99: - // line 1011 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1010 "./../src/mycompiler/myparser/JavaParser.jay" { Vector vec=new Vector(); vec.addElement(((RefType)yyVals[0+yyTop])); @@ -1540,7 +1539,7 @@ case 99: } break; case 100: - // line 1018 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1017 "./../src/mycompiler/myparser/JavaParser.jay" { ((Vector)yyVals[-2+yyTop]).addElement(((RefType)yyVals[0+yyTop])); containedTypes.addElement(((RefType)yyVals[0+yyTop])); @@ -1548,7 +1547,7 @@ case 100: } break; case 101: - // line 1025 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1024 "./../src/mycompiler/myparser/JavaParser.jay" { Vector vec=new Vector(); vec.addElement(((GenericTypeVar)yyVals[0+yyTop])); @@ -1556,14 +1555,14 @@ case 101: } break; case 102: - // line 1031 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1030 "./../src/mycompiler/myparser/JavaParser.jay" { ((Vector)yyVals[-2+yyTop]).addElement(((GenericTypeVar)yyVals[0+yyTop])); yyVal=((Vector)yyVals[-2+yyTop]); } break; case 103: - // line 1039 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1038 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).setReturnType(((Type)yyVals[-1+yyTop])); ((Method)yyVals[0+yyTop]).setGenericMethodParameters(((Vector)yyVals[-3+yyTop])); @@ -1571,14 +1570,14 @@ case 103: } break; case 104: - // line 1045 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1044 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).setReturnType(((Type)yyVals[-1+yyTop])); yyVal=((Method)yyVals[0+yyTop]); } break; case 105: - // line 1050 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1049 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); ((Method)yyVals[0+yyTop]).setReturnType(((Type)yyVals[-1+yyTop])); @@ -1586,7 +1585,7 @@ case 105: } break; case 106: - // line 1056 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1055 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-5+yyTop])); ((Method)yyVals[0+yyTop]).setGenericMethodParameters(((Vector)yyVals[-3+yyTop])); @@ -1595,7 +1594,7 @@ case 106: } break; case 107: - // line 1063 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1062 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).setReturnType(((Type)yyVals[-2+yyTop])); ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); @@ -1603,7 +1602,7 @@ case 107: } break; case 108: - // line 1069 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1068 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).setGenericMethodParameters(((Vector)yyVals[-4+yyTop])); ((Method)yyVals[-1+yyTop]).setReturnType(((Type)yyVals[-2+yyTop])); @@ -1612,7 +1611,7 @@ case 108: } break; case 109: - // line 1076 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1075 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); ((Method)yyVals[-1+yyTop]).setReturnType(((Type)yyVals[-2+yyTop])); @@ -1621,7 +1620,7 @@ case 109: } break; case 110: - // line 1083 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1082 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-6+yyTop])); ((Method)yyVals[-1+yyTop]).setGenericMethodParameters(((Vector)yyVals[-4+yyTop])); @@ -1631,7 +1630,7 @@ case 110: } break; case 111: - // line 1091 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1090 "./../src/mycompiler/myparser/JavaParser.jay" { Void Voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); ((Method)yyVals[0+yyTop]).setReturnType(Voit); @@ -1639,7 +1638,7 @@ case 111: } break; case 112: - // line 1097 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1096 "./../src/mycompiler/myparser/JavaParser.jay" { Void voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); @@ -1648,7 +1647,7 @@ case 112: } break; case 113: - // line 1104 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1103 "./../src/mycompiler/myparser/JavaParser.jay" { Void voyt = new Void(((Token)yyVals[-2+yyTop]).getOffset()); ((Method)yyVals[-1+yyTop]).setReturnType(voyt); @@ -1657,7 +1656,7 @@ case 113: } break; case 114: - // line 1111 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1110 "./../src/mycompiler/myparser/JavaParser.jay" { Void voyd = new Void(((Token)yyVals[-2+yyTop]).getOffset()); ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); @@ -1667,7 +1666,7 @@ case 114: } break; case 115: - // line 1119 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1118 "./../src/mycompiler/myparser/JavaParser.jay" { Void Voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); ((Method)yyVals[0+yyTop]).setReturnType(Voit); @@ -1676,7 +1675,7 @@ case 115: } break; case 116: - // line 1126 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1125 "./../src/mycompiler/myparser/JavaParser.jay" { Void voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-5+yyTop])); @@ -1686,7 +1685,7 @@ case 116: } break; case 117: - // line 1134 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1133 "./../src/mycompiler/myparser/JavaParser.jay" { Void voyt = new Void(((Token)yyVals[-2+yyTop]).getOffset()); ((Method)yyVals[-1+yyTop]).setReturnType(voyt); @@ -1696,7 +1695,7 @@ case 117: } break; case 118: - // line 1142 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1141 "./../src/mycompiler/myparser/JavaParser.jay" { Void voyd = new Void(((Token)yyVals[-2+yyTop]).getOffset()); ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-6+yyTop])); @@ -1707,14 +1706,14 @@ case 118: } break; case 119: - // line 1152 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1151 "./../src/mycompiler/myparser/JavaParser.jay" { /*auskommentiert von Andreas Stadelmeier (a10023) $1.setReturnType(TypePlaceholder.fresh()); */ yyVal=((Method)yyVals[0+yyTop]); } break; case 120: - // line 1157 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1156 "./../src/mycompiler/myparser/JavaParser.jay" { /*auskommentiert von Andreas Stadelmeier (a10023) $4.setReturnType(TypePlaceholder.fresh());*/ ((Method)yyVals[0+yyTop]).setGenericMethodParameters(((Vector)yyVals[-2+yyTop])); @@ -1722,7 +1721,7 @@ case 120: } break; case 121: - // line 1164 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1163 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-1+yyTop])); /*auskommentiert von Andreas Stadelmeier (a10023) $2.setReturnType(TypePlaceholder.fresh());*/ @@ -1730,7 +1729,7 @@ case 121: } break; case 122: - // line 1170 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1169 "./../src/mycompiler/myparser/JavaParser.jay" { /*auskommentiert von Andreas Stadelmeier (a10023) $1.setReturnType(TypePlaceholder.fresh());*/ ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); @@ -1738,7 +1737,7 @@ case 122: } break; case 123: - // line 1176 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1175 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); /*auskommentiert von Andreas Stadelmeier (a10023) $2.setReturnType(TypePlaceholder.fresh());*/ @@ -1747,31 +1746,31 @@ case 123: } break; case 124: - // line 1185 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1184 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((BaseType)yyVals[0+yyTop]); } break; case 125: - // line 1189 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1188 "./../src/mycompiler/myparser/JavaParser.jay" { ((BaseType)yyVals[-2+yyTop]).setArray(true); } break; case 126: - // line 1193 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1192 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((RefType)yyVals[0+yyTop]); } break; case 127: - // line 1197 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1196 "./../src/mycompiler/myparser/JavaParser.jay" { ((RefType)yyVals[-2+yyTop]).setArray(true); } break; case 128: - // line 1201 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1200 "./../src/mycompiler/myparser/JavaParser.jay" { InstVarDecl IVD = new InstVarDecl(); IVD.getDeclIdVector().addElement( ((DeclId)yyVals[0+yyTop]) ); @@ -1779,20 +1778,20 @@ case 128: } break; case 129: - // line 1207 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1206 "./../src/mycompiler/myparser/JavaParser.jay" { ((InstVarDecl)yyVals[-2+yyTop]).getDeclIdVector().addElement(((DeclId)yyVals[0+yyTop])); yyVal=((InstVarDecl)yyVals[-2+yyTop]); } break; case 130: - // line 1213 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1212 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Block)yyVals[0+yyTop]); } break; case 131: - // line 1218 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1217 "./../src/mycompiler/myparser/JavaParser.jay" { Block Blstat = new Block(); Blstat.set_Statement(((Statement)yyVals[0+yyTop])); @@ -1800,14 +1799,14 @@ case 131: } break; case 132: - // line 1225 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1224 "./../src/mycompiler/myparser/JavaParser.jay" { ((Block)yyVals[-1+yyTop]).set_Statement(((Statement)yyVals[0+yyTop])); yyVal=((Block)yyVals[-1+yyTop]); } break; case 133: - // line 1231 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1230 "./../src/mycompiler/myparser/JavaParser.jay" { ParameterList PL = new ParameterList(); PL.set_AddParameter(((FormalParameter)yyVals[0+yyTop])); @@ -1815,21 +1814,21 @@ case 133: } break; case 134: - // line 1237 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1236 "./../src/mycompiler/myparser/JavaParser.jay" { ((ParameterList)yyVals[-2+yyTop]).set_AddParameter(((FormalParameter)yyVals[0+yyTop])); yyVal = ((ParameterList)yyVals[-2+yyTop]); } break; case 135: - // line 1243 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1242 "./../src/mycompiler/myparser/JavaParser.jay" { This THCON = new This(((Token)yyVals[-3+yyTop]).getOffset(),((Token)yyVals[-3+yyTop]).getLexem().length()); yyVal=THCON; } break; case 136: - // line 1248 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1247 "./../src/mycompiler/myparser/JavaParser.jay" { This THCONargl = new This(((Token)yyVals[-4+yyTop]).getOffset(),((Token)yyVals[-4+yyTop]).getLexem().length()); THCONargl.set_ArgumentList(((ArgumentList)yyVals[-2+yyTop])); @@ -1837,7 +1836,7 @@ case 136: } break; case 137: - // line 1257 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1256 "./../src/mycompiler/myparser/JavaParser.jay" { RefType RT = new RefType(-1); RT.set_UsedId(((UsedId)yyVals[0+yyTop])); @@ -1846,7 +1845,7 @@ case 137: } break; case 138: - // line 1264 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1263 "./../src/mycompiler/myparser/JavaParser.jay" { ((RefType)yyVals[-2+yyTop]).set_UsedId(((UsedId)yyVals[0+yyTop])); ((RefType)yyVals[-2+yyTop]).setName(((RefType)yyVals[-2+yyTop]).get_UsedId().get_Name_1Element()); @@ -1854,7 +1853,7 @@ case 138: } break; case 139: - // line 1271 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1270 "./../src/mycompiler/myparser/JavaParser.jay" { Method met = new Method(); /* #JB# 10.04.2005 */ @@ -1869,7 +1868,7 @@ case 139: } break; case 140: - // line 1284 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1283 "./../src/mycompiler/myparser/JavaParser.jay" { Method met_para = new Method(); /* #JB# 10.04.2005 */ @@ -1885,7 +1884,7 @@ case 140: } break; case 141: - // line 1299 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1298 "./../src/mycompiler/myparser/JavaParser.jay" { BooleanType BT = new BooleanType(); /* #JB# 05.04.2005 */ @@ -1896,13 +1895,13 @@ case 141: } break; case 142: - // line 1308 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1307 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((BaseType)yyVals[0+yyTop]); } break; case 143: - // line 1314 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1313 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->referenctype: " + ((UsedId)yyVals[0+yyTop])); RefType RT = new RefType(((UsedId)yyVals[0+yyTop]).getOffset()); @@ -1922,25 +1921,25 @@ case 143: } break; case 144: - // line 1334 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1333 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((DeclId)yyVals[0+yyTop]); } break; case 145: - // line 1355 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1354 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((LocalVarDecl)yyVals[0+yyTop]); } break; case 146: - // line 1359 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1358 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Statement)yyVals[0+yyTop]); } break; case 147: - // line 1364 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1363 "./../src/mycompiler/myparser/JavaParser.jay" { FormalParameter FP = new FormalParameter(); FP.setType(((Type)yyVals[-1+yyTop])); @@ -1949,7 +1948,7 @@ case 147: } break; case 148: - // line 1389 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1388 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("\nFunktionsdeklaration mit typlosen Parametern: " + ((DeclId)yyVals[0+yyTop]).name); @@ -1960,7 +1959,7 @@ case 148: /*Type T = TypePlaceholder.fresh(); //auskommentiert von Andreas Stadelmeier*/ /* Type T = new TypePlaceholder(""); /* otth: Name wird automatisch berechnet * /*/ /* ###########################################################*/ - //org.apache.log4j.Logger.getLogger("parser").debug("\n--> berechneter Name: " + T.getName()); + /*org.apache.log4j.Logger.getLogger("parser").debug("\n--> berechneter Name: " + T.getName());*/ /*auskommentiert von Andreas Stadelmeier (a10023) FP.setType( T );*/ FP.set_DeclId(((DeclId)yyVals[0+yyTop])); @@ -1969,7 +1968,7 @@ case 148: } break; case 149: - // line 1408 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1407 "./../src/mycompiler/myparser/JavaParser.jay" { ArgumentList AL = new ArgumentList(); AL.expr.addElement(((Expr)yyVals[0+yyTop])); @@ -1977,20 +1976,20 @@ case 149: } break; case 150: - // line 1414 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1413 "./../src/mycompiler/myparser/JavaParser.jay" { ((ArgumentList)yyVals[-2+yyTop]).expr.addElement(((Expr)yyVals[0+yyTop])); yyVal=((ArgumentList)yyVals[-2+yyTop]); } break; case 151: - // line 1420 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1419 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((BaseType)yyVals[0+yyTop]); } break; case 152: - // line 1425 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1424 "./../src/mycompiler/myparser/JavaParser.jay" { DeclId DI = new DeclId(); /* #JB# 10.04.2005 */ @@ -2003,61 +2002,61 @@ case 152: } break; case 153: - // line 1437 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1436 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 154: - // line 1442 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1441 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((LocalVarDecl)yyVals[-1+yyTop]); } break; case 155: - // line 1447 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1446 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Statement)yyVals[0+yyTop]); } break; case 156: - // line 1451 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1450 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((IfStmt)yyVals[0+yyTop]); } break; case 157: - // line 1455 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1454 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((IfStmt)yyVals[0+yyTop]); } break; case 158: - // line 1459 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1458 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((WhileStmt)yyVals[0+yyTop]); } break; case 159: - // line 1463 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1462 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((ForStmt)yyVals[0+yyTop]); } break; case 160: - // line 1468 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1467 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 161: - // line 1472 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1471 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((NewClass)yyVals[0+yyTop]); } break; case 162: - // line 1477 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1476 "./../src/mycompiler/myparser/JavaParser.jay" { IntegerType IT = new IntegerType(); /* #JB# 05.04.2005 */ @@ -2068,7 +2067,7 @@ case 162: } break; case 163: - // line 1486 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1485 "./../src/mycompiler/myparser/JavaParser.jay" { CharacterType CT = new CharacterType(); /* #JB# 05.04.2005 */ @@ -2079,7 +2078,7 @@ case 163: } break; case 164: - // line 1496 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1495 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("P -> Lokale Variable angelegt!"); LocalVarDecl LVD = new LocalVarDecl(((Type)yyVals[-1+yyTop]).getOffset(),((Type)yyVals[-1+yyTop]).getVariableLength()); @@ -2089,7 +2088,7 @@ case 164: } break; case 165: - // line 1507 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1506 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("P -> Lokale Variable angelegt!"); LocalVarDecl LVD = new LocalVarDecl(((InstVarDecl)yyVals[0+yyTop]).getOffset(),((InstVarDecl)yyVals[0+yyTop]).getVariableLength()); @@ -2099,31 +2098,31 @@ case 165: } break; case 166: - // line 1517 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1516 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Block)yyVals[0+yyTop]); } break; case 167: - // line 1521 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1520 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((EmptyStmt)yyVals[0+yyTop]); } break; case 168: - // line 1525 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1524 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((ExprStmt)yyVals[0+yyTop]); } break; case 169: - // line 1529 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1528 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Return)yyVals[0+yyTop]); } break; case 170: - // line 1534 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1533 "./../src/mycompiler/myparser/JavaParser.jay" { IfStmt Ifst = new IfStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); Ifst.set_Expr(((Expr)yyVals[-2+yyTop])); @@ -2132,7 +2131,7 @@ case 170: } break; case 171: - // line 1542 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1541 "./../src/mycompiler/myparser/JavaParser.jay" { IfStmt IfstElst = new IfStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); IfstElst.set_Expr(((Expr)yyVals[-4+yyTop])); @@ -2142,7 +2141,7 @@ case 171: } break; case 172: - // line 1551 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1550 "./../src/mycompiler/myparser/JavaParser.jay" { WhileStmt Whlst = new WhileStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); Whlst.set_Expr(((Expr)yyVals[-2+yyTop])); @@ -2151,7 +2150,7 @@ case 172: } break; case 173: - // line 1562 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1561 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-6+yyTop]).getOffset(),((Expr)yyVals[-6+yyTop]).getVariableLength()); Fst.set_head_Initializer(((Expr)yyVals[-6+yyTop])); @@ -2164,7 +2163,7 @@ case 173: } break; case 174: - // line 1574 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1573 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength()); Fst.set_head_Initializer(((Expr)yyVals[-5+yyTop])); @@ -2176,7 +2175,7 @@ case 174: } break; case 175: - // line 1585 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1584 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength()); Fst.set_head_Initializer(((Expr)yyVals[-5+yyTop])); @@ -2188,7 +2187,7 @@ case 175: } break; case 176: - // line 1596 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1595 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); Fst.set_head_Condition(((Expr)yyVals[-4+yyTop])); @@ -2200,7 +2199,7 @@ case 176: } break; case 177: - // line 1607 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1606 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); Fst.set_head_Initializer(((Expr)yyVals[-4+yyTop])); @@ -2211,7 +2210,7 @@ case 177: } break; case 178: - // line 1617 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1616 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-3+yyTop]).getOffset(),((Expr)yyVals[-3+yyTop]).getVariableLength()); Fst.set_head_Condition(((Expr)yyVals[-3+yyTop])); @@ -2222,7 +2221,7 @@ case 178: } break; case 179: - // line 1627 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1626 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); Fst.set_head_Loop_expr(((Expr)yyVals[-2+yyTop])); @@ -2233,7 +2232,7 @@ case 179: } break; case 180: - // line 1637 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1636 "./../src/mycompiler/myparser/JavaParser.jay" { ForStmt Fst = new ForStmt(((Statement)yyVals[0+yyTop]).getOffset(),((Statement)yyVals[0+yyTop]).getVariableLength()); Fst.set_body_Loop_block(((Statement)yyVals[0+yyTop])); @@ -2243,40 +2242,40 @@ case 180: } break; case 181: - // line 1646 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1645 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("conditionalexpression"); yyVal=((Expr)yyVals[0+yyTop]); } break; case 182: - // line 1651 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1650 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Assign)yyVals[0+yyTop]); } break; case 183: - // line 1657 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1656 "./../src/mycompiler/myparser/JavaParser.jay" { EmptyStmt Empst = new EmptyStmt(); yyVal=Empst; } break; case 184: - // line 1663 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1662 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[-1+yyTop]); } break; case 185: - // line 1668 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1667 "./../src/mycompiler/myparser/JavaParser.jay" { Return ret = new Return(-1,-1); yyVal= ret; } break; case 186: - // line 1673 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1672 "./../src/mycompiler/myparser/JavaParser.jay" { Return retexp = new Return(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength()); retexp.set_ReturnExpr(((Expr)yyVals[-1+yyTop])); @@ -2284,31 +2283,31 @@ case 186: } break; case 187: - // line 1680 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1679 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Statement)yyVals[0+yyTop]); } break; case 188: - // line 1684 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1683 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((IfStmt)yyVals[0+yyTop]); } break; case 189: - // line 1688 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1687 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((WhileStmt)yyVals[0+yyTop]); } break; case 190: - // line 1693 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1692 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 191: - // line 1699 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1698 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("\nParser --> Zuweisung1!\n"); Assign Ass = new Assign(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); @@ -2335,7 +2334,7 @@ case 191: } break; case 192: - // line 1724 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1723 "./../src/mycompiler/myparser/JavaParser.jay" { Assign Ass =new Assign(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); LocalOrFieldVar LOFV = new LocalOrFieldVar(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); @@ -2359,43 +2358,43 @@ case 192: } break; case 193: - // line 1747 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1746 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Assign)yyVals[0+yyTop]); } break; case 194: - // line 1751 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1750 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 195: - // line 1755 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1754 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 196: - // line 1759 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1758 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 197: - // line 1763 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1762 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 198: - // line 1767 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1766 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((MethodCall)yyVals[0+yyTop]); } break; case 199: - // line 1778 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1777 "./../src/mycompiler/myparser/JavaParser.jay" { IfStmt IfElno = new IfStmt(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); IfElno.set_Expr(((Expr)yyVals[-4+yyTop])); @@ -2405,7 +2404,7 @@ case 199: } break; case 200: - // line 1787 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1786 "./../src/mycompiler/myparser/JavaParser.jay" { WhileStmt Whstno = new WhileStmt(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); Whstno.set_Expr(((Expr)yyVals[-2+yyTop])); @@ -2414,13 +2413,13 @@ case 200: } break; case 201: - // line 1795 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1794 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 202: - // line 1799 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1798 "./../src/mycompiler/myparser/JavaParser.jay" { Binary LogOr = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); OrOp OrO = new OrOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -2432,19 +2431,19 @@ case 202: } break; case 203: - // line 1812 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1811 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=null; } break; case 204: - // line 1817 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1816 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Block)yyVals[0+yyTop]); } break; case 205: - // line 1821 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1820 "./../src/mycompiler/myparser/JavaParser.jay" { /*Lambdabody kann auch nur aus einer Expression bestehen. In diesem Fall wird ein Block erstellt, welcher als einziges Statement ein return statment mit der expression hat.*/ /*Bsp.: Aus der Expression |var=="hallo"| wird: |{return var=="hallo";}|*/ @@ -2455,19 +2454,19 @@ case 205: } break; case 206: - // line 1831 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1830 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=null; } break; case 207: - // line 1835 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1834 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((ParameterList)yyVals[-1+yyTop]); } break; case 208: - // line 1840 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1839 "./../src/mycompiler/myparser/JavaParser.jay" { LambdaExpression lambda = new LambdaExpression(/*((ParameSterList)$2).getOffset(),((ParameterList)$2).getVariableLength()*/0,0); if(((ParameterList)yyVals[-2+yyTop])!=null)lambda.setParameterList(((ParameterList)yyVals[-2+yyTop])); @@ -2476,54 +2475,54 @@ case 208: } break; case 209: - // line 1859 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1858 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((UsedId)yyVals[0+yyTop]); } break; case 210: - // line 1864 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1863 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=null; } break; case 211: - // line 1868 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1867 "./../src/mycompiler/myparser/JavaParser.jay" { TimesOp TEO = new TimesOp(-1,-1); yyVal=TEO; } break; case 212: - // line 1873 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1872 "./../src/mycompiler/myparser/JavaParser.jay" { DivideOp DEO = new DivideOp(-1,-1); yyVal=DEO; } break; case 213: - // line 1878 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1877 "./../src/mycompiler/myparser/JavaParser.jay" { ModuloOp MEO = new ModuloOp(-1,-1); yyVal=MEO; } break; case 214: - // line 1883 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1882 "./../src/mycompiler/myparser/JavaParser.jay" { PlusOp PEO = new PlusOp(-1,-1); yyVal=PEO; } break; case 215: - // line 1888 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1887 "./../src/mycompiler/myparser/JavaParser.jay" { MinusOp MEO = new MinusOp(-1,-1); yyVal=MEO; } break; case 216: - // line 1900 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1899 "./../src/mycompiler/myparser/JavaParser.jay" { PreIncExpr PRINC = new PreIncExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); PRINC.set_Expr(((Expr)yyVals[0+yyTop])); @@ -2531,7 +2530,7 @@ case 216: } break; case 217: - // line 1907 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1906 "./../src/mycompiler/myparser/JavaParser.jay" { PreDecExpr PRDEC = new PreDecExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); PRDEC.set_Expr(((Expr)yyVals[0+yyTop])); @@ -2539,7 +2538,7 @@ case 217: } break; case 218: - // line 1914 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1913 "./../src/mycompiler/myparser/JavaParser.jay" { PostIncExpr PIE = new PostIncExpr(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength()); PIE.set_Expr(((Expr)yyVals[-1+yyTop])); @@ -2547,7 +2546,7 @@ case 218: } break; case 219: - // line 1921 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1920 "./../src/mycompiler/myparser/JavaParser.jay" { PostDecExpr PDE = new PostDecExpr(((Expr)yyVals[-1+yyTop]).getOffset(),((Expr)yyVals[-1+yyTop]).getVariableLength()); PDE.set_Expr(((Expr)yyVals[-1+yyTop])); @@ -2555,7 +2554,7 @@ case 219: } break; case 220: - // line 1929 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1928 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("M1"); MethodCall MC = new MethodCall(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); @@ -2587,7 +2586,7 @@ case 220: } break; case 221: - // line 1959 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1958 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("M2"); MethodCall MCarg = new MethodCall(((UsedId)yyVals[-3+yyTop]).getOffset(),((UsedId)yyVals[-3+yyTop]).getVariableLength()); @@ -2620,7 +2619,7 @@ case 221: } break; case 222: - // line 1990 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1989 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("M3"); MethodCall MCpr = new MethodCall(((Expr)yyVals[-4+yyTop]).getOffset(),((Expr)yyVals[-4+yyTop]).getVariableLength()); @@ -2641,7 +2640,7 @@ case 222: } break; case 223: - // line 2009 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2008 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("M4"); MethodCall MCPA = new MethodCall(((Expr)yyVals[-5+yyTop]).getOffset(),((Expr)yyVals[-5+yyTop]).getVariableLength()); @@ -2663,7 +2662,7 @@ case 223: } break; case 224: - // line 2032 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2031 "./../src/mycompiler/myparser/JavaParser.jay" { NewClass NC = new NewClass(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); NC.set_UsedId(((UsedId)yyVals[-2+yyTop])); @@ -2673,7 +2672,7 @@ case 224: } break; case 225: - // line 2040 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2039 "./../src/mycompiler/myparser/JavaParser.jay" { NewClass NCarg = new NewClass(((UsedId)yyVals[-3+yyTop]).getOffset(),((UsedId)yyVals[-3+yyTop]).getVariableLength()); NCarg.set_UsedId(((UsedId)yyVals[-3+yyTop])); @@ -2684,13 +2683,13 @@ case 225: } break; case 226: - // line 2050 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2049 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 227: - // line 2054 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2053 "./../src/mycompiler/myparser/JavaParser.jay" { Binary And = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); AndOp AndO = new AndOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -2702,19 +2701,19 @@ case 227: } break; case 228: - // line 2070 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2069 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 229: - // line 2074 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2073 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 230: - // line 2078 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2077 "./../src/mycompiler/myparser/JavaParser.jay" { PositivExpr POSEX=new PositivExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); UnaryPlus UP= new UnaryPlus(); @@ -2724,7 +2723,7 @@ case 230: } break; case 231: - // line 2086 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2085 "./../src/mycompiler/myparser/JavaParser.jay" { NegativeExpr NEGEX=new NegativeExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); UnaryMinus UM=new UnaryMinus(); @@ -2734,19 +2733,19 @@ case 231: } break; case 232: - // line 2094 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2093 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 233: - // line 2099 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2098 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 234: - // line 2103 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2102 "./../src/mycompiler/myparser/JavaParser.jay" { if (((UsedId)yyVals[0+yyTop]).get_Name().size() > 1) { @@ -2766,37 +2765,37 @@ case 234: } break; case 235: - // line 2121 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2120 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 236: - // line 2125 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2124 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 237: - // line 2130 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2129 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 238: - // line 2135 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2134 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 240: - // line 2141 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2140 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Literal)yyVals[0+yyTop]); } break; case 241: - // line 2145 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2144 "./../src/mycompiler/myparser/JavaParser.jay" { This T = new This(((Token)yyVals[0+yyTop]).getOffset(),((Token)yyVals[0+yyTop]).getLexem().length()); UsedId UT = new UsedId(((Token)yyVals[0+yyTop]).getOffset()); @@ -2806,23 +2805,23 @@ case 241: } break; case 242: - // line 2166 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2165 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((MethodCall)yyVals[0+yyTop]); } break; case 243: - // line 2170 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2169 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 244: - // line 2175 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2174 "./../src/mycompiler/myparser/JavaParser.jay" {yyVal=((Expr)yyVals[0+yyTop]);} break; case 245: - // line 2177 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2176 "./../src/mycompiler/myparser/JavaParser.jay" {NotExpr NE=new NotExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); UnaryNot UN=new UnaryNot(); NE.set_UnaryNot(UN); @@ -2831,36 +2830,36 @@ case 245: } break; case 246: - // line 2183 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2182 "./../src/mycompiler/myparser/JavaParser.jay" {yyVal=((CastExpr)yyVals[0+yyTop]);} break; case 247: - // line 2185 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2184 "./../src/mycompiler/myparser/JavaParser.jay" {yyVal=((Expr)yyVals[0+yyTop]);} break; case 249: - // line 2190 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2189 "./../src/mycompiler/myparser/JavaParser.jay" {IntLiteral IL = new IntLiteral(); IL.set_Int(((Token)yyVals[0+yyTop]).String2Int()); yyVal = IL; } break; case 250: - // line 2195 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2194 "./../src/mycompiler/myparser/JavaParser.jay" {BoolLiteral BL = new BoolLiteral(); BL.set_Bool(((Token)yyVals[0+yyTop]).String2Bool()); yyVal = BL; } break; case 251: - // line 2199 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2198 "./../src/mycompiler/myparser/JavaParser.jay" {CharLiteral CL = new CharLiteral(); CL.set_Char(((Token)yyVals[0+yyTop]).CharInString()); yyVal=CL; } break; case 252: - // line 2204 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2203 "./../src/mycompiler/myparser/JavaParser.jay" { StringLiteral ST = new StringLiteral(); ST.set_String(((Token)yyVals[0+yyTop]).get_String()); @@ -2868,14 +2867,14 @@ case 252: } break; case 253: - // line 2209 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2208 "./../src/mycompiler/myparser/JavaParser.jay" { LongLiteral LL = new LongLiteral(); LL.set_Long(((Token)yyVals[0+yyTop]).String2Long()); yyVal = LL; } break; case 254: - // line 2213 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2212 "./../src/mycompiler/myparser/JavaParser.jay" { FloatLiteral FL = new FloatLiteral(); FL.set_Float(((Token)yyVals[0+yyTop]).String2Float()); @@ -2883,7 +2882,7 @@ case 254: } break; case 255: - // line 2218 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2217 "./../src/mycompiler/myparser/JavaParser.jay" { DoubleLiteral DL = new DoubleLiteral(); DL.set_Double(((Token)yyVals[0+yyTop]).String2Double()); @@ -2891,14 +2890,14 @@ case 255: } break; case 256: - // line 2224 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2223 "./../src/mycompiler/myparser/JavaParser.jay" { Null NN = new Null(); yyVal=NN; } break; case 257: - // line 2230 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2229 "./../src/mycompiler/myparser/JavaParser.jay" { CastExpr CaEx=new CastExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); CaEx.set_Type(((BaseType)yyVals[-2+yyTop])); @@ -2907,24 +2906,24 @@ case 257: } break; case 258: - // line 2239 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2238 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 259: - // line 2243 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2242 "./../src/mycompiler/myparser/JavaParser.jay" { } break; case 260: - // line 2247 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2246 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 261: - // line 2251 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2250 "./../src/mycompiler/myparser/JavaParser.jay" { Binary EQ = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); EqualOp EO = new EqualOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -2936,7 +2935,7 @@ case 261: } break; case 262: - // line 2261 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2260 "./../src/mycompiler/myparser/JavaParser.jay" { Binary NEQ = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); NotEqualOp NEO = new NotEqualOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -2948,13 +2947,13 @@ case 262: } break; case 263: - // line 2272 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2271 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 264: - // line 2276 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2275 "./../src/mycompiler/myparser/JavaParser.jay" { Binary LO = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); LessOp LOO = new LessOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -2966,7 +2965,7 @@ case 264: } break; case 265: - // line 2286 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2285 "./../src/mycompiler/myparser/JavaParser.jay" { Binary GO = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); GreaterOp GOO = new GreaterOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -2978,7 +2977,7 @@ case 265: } break; case 266: - // line 2296 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2295 "./../src/mycompiler/myparser/JavaParser.jay" { Binary LE = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); LessEquOp LEO = new LessEquOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -2990,7 +2989,7 @@ case 266: } break; case 267: - // line 2306 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2305 "./../src/mycompiler/myparser/JavaParser.jay" { Binary GE = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); GreaterEquOp GEO = new GreaterEquOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3002,7 +3001,7 @@ case 267: } break; case 268: - // line 2316 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2315 "./../src/mycompiler/myparser/JavaParser.jay" { InstanceOf ISO=new InstanceOf(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); ISO.set_Expr(((Expr)yyVals[-2+yyTop])); @@ -3011,19 +3010,19 @@ case 268: } break; case 269: - // line 2324 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2323 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 270: - // line 2329 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2328 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 271: - // line 2333 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2332 "./../src/mycompiler/myparser/JavaParser.jay" { Binary AD = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); PlusOp PO = new PlusOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3035,7 +3034,7 @@ case 271: } break; case 272: - // line 2343 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2342 "./../src/mycompiler/myparser/JavaParser.jay" { Binary MI = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); MinusOp MO = new MinusOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3047,13 +3046,13 @@ case 272: } break; case 273: - // line 2354 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2353 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; case 274: - // line 2358 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2357 "./../src/mycompiler/myparser/JavaParser.jay" { Binary ML = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); TimesOp TO = new TimesOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3065,7 +3064,7 @@ case 274: } break; case 275: - // line 2368 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2367 "./../src/mycompiler/myparser/JavaParser.jay" { Binary DV = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); DivideOp DO = new DivideOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3077,7 +3076,7 @@ case 275: } break; case 276: - // line 2378 "./../src/mycompiler/myparser/JavaParser.jay" + // line 2377 "./../src/mycompiler/myparser/JavaParser.jay" { Binary MD = new Binary(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); ModuloOp MO = new ModuloOp(((Expr)yyVals[-2+yyTop]).getOffset(),((Expr)yyVals[-2+yyTop]).getVariableLength()); @@ -3088,7 +3087,7 @@ case 276: yyVal =MD; } break; - // line 3092 "-" + // line 3091 "-" } yyTop -= yyLen[yyN]; yyState = yyStates[yyTop]; diff --git a/src/mycompiler/myparser/JavaParser.jay b/src/mycompiler/myparser/JavaParser.jay index 992ac242a..68dbc5433 100755 --- a/src/mycompiler/myparser/JavaParser.jay +++ b/src/mycompiler/myparser/JavaParser.jay @@ -6,9 +6,9 @@ Backup von JavaParser.jay 10.April 17 Uhr package mycompiler.myparser; - +import mycompiler.myclass.FieldDeclaration; +import mycompiler.myclass.Field; import java.util.Vector; -import mycompiler.myclass.FieldInitialization; import mycompiler.SourceFile; import mycompiler.AClassOrInterface; import mycompiler.myclass.Class; @@ -18,7 +18,6 @@ import mycompiler.myclass.Constant; import mycompiler.myclass.ImportDeclarations; import mycompiler.myclass.DeclId; import mycompiler.myclass.ExceptionList; -import mycompiler.myclass.FieldDecl; import mycompiler.myclass.FormalParameter; import mycompiler.myclass.InstVarDecl; import mycompiler.myclass.Method; @@ -207,21 +206,21 @@ public Vector testPair = new Vector(); %type interfacedeclaration %type interfacebody %type interfacememberdeclarations -%type interfacememberdeclaration +%type interfacememberdeclaration %type abstractmethoddeclaration %type classbody %type classidentifier %type interfaceidentifier %type constantdeclaration -%type fielddeclaration +%type fielddeclaration %type methodheader %type methoddeclaration %type methoddeclarator %type classbodydeclarations -%type classbodydeclaration -%type classmemberdeclaration +%type classbodydeclaration +%type classmemberdeclaration %type variabledeclarators -%type fielddeclarator; +%type fielddeclarator; %type variabledeclarator %type variabledeclaratorid %type simplename @@ -309,7 +308,7 @@ public Vector testPair = new Vector(); %type argumentlist %type methodinvocation %type typedeclaration -%type constructordeclaration +%type constructordeclaration %type constructordeclarator %type constructorbody %type explicitconstructorinvocation @@ -871,7 +870,7 @@ Dieses Problem ist bei Feldern nicht der Fall. */ fielddeclarator : variabledeclarator '=' expression { - FieldInitialization ret = new FieldInitialization(); + FieldDeclaration ret = new FieldDeclaration(); ret.set_DeclId($1); ret.setWert($3); $$=ret;