diff --git a/Readme.md b/Readme.md new file mode 100644 index 000000000..641d10f18 --- /dev/null +++ b/Readme.md @@ -0,0 +1,42 @@ +# Typinferenz + +## ResultSet + +* Spezifisch für jedes SourceFile (nicht für jede Klasse) +* mehrere ResultSets pro Klasse +* + +* Enthält: + * constraintPairs + * unifiedConstraints + +## TypeInsertSet +* Stellt die Typeinsetzung für eine der generierten Lösungen dar +* Setzt alle Typen und generischen Variablen ein, welche zu dieser Lösung gehören + +## Ablauf Typinferenz: + +1. Parsen + * (Parser postProcessing) +2. Typinferenz + * Anfangspunkt SourceFile + * löst geparste Typen zu richtigen Typen auf (RefTypes, GenericVar) + * setzt TPHs ein + * bildet Constraints, welche in ResultSet gesammelt werden. ResultSet wird durch Syntaxbaum gereicht. + * Assumptions generieren + * Wird im Syntaxbaum für jeden Knoten ausgeführt und die Assumptions für darunterliegende Knoten gebildet + * +3. Unifizierung + * wird im SourceFile aufgerufen + * unifiziert Constraints aller im SourceFile vorkommenden Klassen + +4. Erstellen von TypeInsertSet + * Durchlaufen des Syntaxbaumes + * Jeder Knoten erstellt TypeInsertSets anhand des ResultSets. + * Bei Knoten, welche Generische Variablen beinhalten können werden GenericTypeInsertPoints erstellt + +5. Einsetzen eines TypeInsertSet (optional) + 1. Auf allen TypeInsertPoints die getUnresolvedTPHs-Methoden aufrufen + 2. Alle Abhängigkeiten dieser + + \ No newline at end of file diff --git a/bin/mycompiler/myparser/JavaParser.jay b/bin/mycompiler/myparser/JavaParser.jay index a2755734b..702414c31 100755 --- a/bin/mycompiler/myparser/JavaParser.jay +++ b/bin/mycompiler/myparser/JavaParser.jay @@ -313,7 +313,8 @@ public Vector testPair = new Vector(); %type explicitconstructorinvocation %type staticinitializer %type castexpression -%type paralist parameter +%type paralist +%type typelist parameter %type wildcardparameter %left ',' %% @@ -322,7 +323,7 @@ compilationunit : typedeclarations { $$=$1; } -/* |importdeclarations typedeclarations + |importdeclarations typedeclarations { $2.addImports($1); $$=$2; @@ -345,7 +346,7 @@ compilationunit : typedeclarations this.testPair.add(new Pair($1,$2)); $$=$3; } - */ + packagedeclaration : PACKAGE name ';' ; { // SCJU: Package @@ -394,12 +395,12 @@ typedeclaration :classdeclaration { $$=$1; } -/* | interfacedeclaration + | interfacedeclaration { // SCJU: Interface $$=$1; } -*/ + qualifiedname : name '.' IDENTIFIER { @@ -785,21 +786,34 @@ classbodydeclaration : classmemberdeclaration classorinterfacetype : simplename parameter { if ($2 != null) { - $1.set_ParaList($2.get_ParaList()); - + //$1.set_ParaList($2.get_ParaList()); + $1.set_ParaList($2);//Änderung von Andreas Stadelmeier. Type statt GenericVarType /* otth: originale (also diese) Parameterliste retten */ - ((UsedId)$1).vParaOrg = new Vector( $2.get_ParaList() ); + //((UsedId)$1).vParaOrg = new Vector( $2.get_ParaList() ); } $$=$1; } +typelist : type + { + Vector tl = new Vector(); + tl.add($1); + $$ = tl; + } + | typelist ',' type + { + $1.add($3); + $$=$1; + } + /* PL 05-07-28 erg�nzt, weil jeder classorinterfacetype auch parametrisiert sein kann */ +//TODO: Das hier ist möglicherweise falsch. Ein Typ hat keine parameterliste, nur eine Liste von RefTypes parameter : { $$ = null; } - | '<'paralist'>' + | '<'typelist'>'//'<'paralist'>'//typelist statt { $$ = $2; } - + interfacememberdeclaration : constantdeclaration { // SCJU: Interfaces, Spezialform Konstantendef. @@ -821,7 +835,7 @@ classmemberdeclaration : fielddeclaration staticinitializer : STATIC block { - Method STAT = new Method(); + Method STAT = new Method($1.getOffset()); DeclId DST = new DeclId(); DST.set_Name($1.getLexem()); STAT.set_DeclId(DST); @@ -867,9 +881,21 @@ Beispiel: var = 2; Bei einer lokalen Variable lässt sich hier nicht ermitteln ob die Variable deklariert werden soll oder bereits deklariert wurde und ihr nur ein Wert zugewiesen werden soll. Dieses Problem ist bei Feldern nicht der Fall. */ -fielddeclarator : variabledeclarator '=' expression +fielddeclarator : + /* + type variabledeclarator '=' expression { - FieldDeclaration ret = new FieldDeclaration(); + FieldDeclaration ret = new FieldDeclaration($2.getOffset()); + ret.setType($1); + ret.set_DeclId($2); + ret.setWert($4); + $$=ret; + } + | + */ + variabledeclarator '=' expression + { + FieldDeclaration ret = new FieldDeclaration($1.getOffset()); ret.set_DeclId($1); ret.setWert($3); $$=ret; @@ -879,11 +905,17 @@ fielddeclaration : fielddeclarator ';' { $$=$1; } - | type fielddeclarator + | type fielddeclarator ';' { $2.setType($1); $$=$2; } + | '<' boundedMethodParameters '>' type fielddeclarator ';' + {//angefügt von Andreas Stadelmeier + $5.setType($4); + $5.setGenericParameter($2); + $$=$5; + } | variabledeclarators ';' { @@ -1000,8 +1032,8 @@ boundedMethodParameter : IDENTIFIER } | IDENTIFIER EXTENDS boundedclassidentifierlist { - BoundedGenericTypeVar gtv=new BoundedGenericTypeVar($1.getLexem(),$1.getOffset()); - gtv.setBounds($3); + BoundedGenericTypeVar gtv=new BoundedGenericTypeVar($1.getLexem(),$3,$1.getOffset()); + //gtv.setBounds($3); $$=gtv; } // returns Vector @@ -1035,45 +1067,45 @@ boundedMethodParameters : boundedMethodParameter // returns Method methodheader :'<' boundedMethodParameters '>' type methoddeclarator { - $5.setReturnType($4); + $5.setType($4); $5.setGenericMethodParameters($2); $$=$5; } | type methoddeclarator { - $2.setReturnType($1); + $2.setType($1); $$=$2; } | modifiers type methoddeclarator { $3.set_Modifiers($1); - $3.setReturnType($2); + $3.setType($2); $$=$3; } | modifiers '<' boundedMethodParameters '>' type methoddeclarator { $6.set_Modifiers($1); $6.setGenericMethodParameters($3); - $6.setReturnType($5); + $6.setType($5); $$=$6; } | type methoddeclarator throws { - $2.setReturnType($1); + $2.setType($1); $2.set_ExceptionList($3); $$=$2; } | '<' boundedMethodParameters '>' type methoddeclarator throws { $5.setGenericMethodParameters($2); - $5.setReturnType($4); + $5.setType($4); $5.set_ExceptionList($6); $$=$5; } | modifiers type methoddeclarator throws { $3.set_Modifiers($1); - $3.setReturnType($2); + $3.setType($2); $3.set_ExceptionList($4); $$=$3; } @@ -1081,27 +1113,27 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator { $6.set_Modifiers($1); $6.setGenericMethodParameters($3); - $6.setReturnType($5); + $6.setType($5); $6.set_ExceptionList($7); $$=$6; } | VOID methoddeclarator { Void Voit = new Void($1.getOffset()); - $2.setReturnType(Voit); + $2.setType(Voit); $$=$2; } | modifiers VOID methoddeclarator { Void voit = new Void($2.getOffset()); $3.set_Modifiers($1); - $3.setReturnType(voit); + $3.setType(voit); $$=$3; } | VOID methoddeclarator throws { Void voyt = new Void($1.getOffset()); - $2.setReturnType(voyt); + $2.setType(voyt); $2.set_ExceptionList($3); $$=$2; } @@ -1109,14 +1141,14 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator { Void voyd = new Void($2.getOffset()); $3.set_Modifiers($1); - $3.setReturnType(voyd); + $3.setType(voyd); $3.set_ExceptionList($4); $$=$3; } | '<' boundedMethodParameters '>' VOID methoddeclarator { Void Voit = new Void($4.getOffset()); - $5.setReturnType(Voit); + $5.setType(Voit); $5.setGenericMethodParameters($2); $$=$5; } @@ -1124,14 +1156,14 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator { Void voit = new Void($5.getOffset()); $6.set_Modifiers($1); - $6.setReturnType(voit); + $6.setType(voit); $6.setGenericMethodParameters($3); $$=$6; } | '<' boundedMethodParameters '>' VOID methoddeclarator throws { Void voyt = new Void($4.getOffset()); - $5.setReturnType(voyt); + $5.setType(voyt); $5.set_ExceptionList($6); $5.setGenericMethodParameters($2); $$=$5; @@ -1140,7 +1172,7 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator { Void voyd = new Void($5.getOffset()); $6.set_Modifiers($1); - $6.setReturnType(voyd); + $6.setType(voyd); $6.set_ExceptionList($7); $6.setGenericMethodParameters($3); $$=$6; @@ -1148,12 +1180,12 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator | methoddeclarator { - //auskommentiert von Andreas Stadelmeier (a10023) $1.setReturnType(TypePlaceholder.fresh()); + //auskommentiert von Andreas Stadelmeier (a10023) $1.setType(TypePlaceholder.fresh()); $$=$1; } | '<' boundedMethodParameters '>' methoddeclarator { - //auskommentiert von Andreas Stadelmeier (a10023) $4.setReturnType(TypePlaceholder.fresh()); + //auskommentiert von Andreas Stadelmeier (a10023) $4.setType(TypePlaceholder.fresh()); $4.setGenericMethodParameters($2); $$=$4; } @@ -1161,19 +1193,19 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator | modifiers methoddeclarator { $2.set_Modifiers($1); - //auskommentiert von Andreas Stadelmeier (a10023) $2.setReturnType(TypePlaceholder.fresh()); + //auskommentiert von Andreas Stadelmeier (a10023) $2.setType(TypePlaceholder.fresh()); $$=$2; } | methoddeclarator throws { - //auskommentiert von Andreas Stadelmeier (a10023) $1.setReturnType(TypePlaceholder.fresh()); + //auskommentiert von Andreas Stadelmeier (a10023) $1.setType(TypePlaceholder.fresh()); $1.set_ExceptionList($2); $$=$1; } | modifiers methoddeclarator throws { $2.set_Modifiers($1); - //auskommentiert von Andreas Stadelmeier (a10023) $2.setReturnType(TypePlaceholder.fresh()); + //auskommentiert von Andreas Stadelmeier (a10023) $2.setType(TypePlaceholder.fresh()); $2.set_ExceptionList($3); $$=$2; } @@ -1197,8 +1229,9 @@ type : primitivetype } variabledeclarators : variabledeclarator { - FieldDeclaration IVD = new FieldDeclaration(); + FieldDeclaration IVD = new FieldDeclaration($1.getOffset()); IVD.getDeclIdVector().addElement( $1 ); + IVD.setOffset($1.getOffset()); $$ = IVD; } | variabledeclarators ',' variabledeclarator @@ -1267,7 +1300,7 @@ classtypelist : classtype methoddeclarator :IDENTIFIER '(' ')' { - Method met = new Method(); + Method met = new Method($1.getOffset()); /* #JB# 10.04.2005 */ /* ########################################################### */ met.setLineNumber($1.getLineNumber()); @@ -1280,7 +1313,7 @@ methoddeclarator :IDENTIFIER '(' ')' } |IDENTIFIER '(' formalparameterlist ')' { - Method met_para = new Method(); + Method met_para = new Method($1.getOffset()); /* #JB# 10.04.2005 */ /* ########################################################### */ met_para.setLineNumber($1.getLineNumber()); @@ -1307,7 +1340,6 @@ primitivetype :BOOLEAN $$=$1; } - referencetype :classorinterfacetype { org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->referenctype: " + $1); @@ -1360,9 +1392,9 @@ blockstatement :localvariabledeclarationstatement formalparameter : type variabledeclaratorid { - FormalParameter FP = new FormalParameter(); + FormalParameter FP = new FormalParameter($2); FP.setType($1); - FP.set_DeclId($2); + //FP.set_DeclId($2); //auskommentiert von Andreas Stadelmeier. DeclId wird nun dem Konstruktor von FormalParameter übergeben. $$=FP; } @@ -1374,9 +1406,9 @@ formalparameter : type variabledeclaratorid Parameterliste setzen $5.set_Paratyp($3.get_ParaList()); - FormalParameter FP = new FormalParameter(); + FormalParameter FP = new FormalParameter($5); FP.setType($1); - FP.set_DeclId($5); + //FP.set_DeclId($5); $$=FP; org.apache.log4j.Logger.getLogger("parser").debug("P->Polymorphes Methodenargument hinzugefuegt: Name = " + $5.get_Name() + " Typ = " + $1.getName()); @@ -1387,7 +1419,7 @@ formalparameter : type variabledeclaratorid { org.apache.log4j.Logger.getLogger("parser").debug("\nFunktionsdeklaration mit typlosen Parametern: " + $1.name); - FormalParameter FP = new FormalParameter(); + FormalParameter FP = new FormalParameter($1); // #JB# 31.03.2005 // ########################################################### @@ -1397,7 +1429,7 @@ formalparameter : type variabledeclaratorid //org.apache.log4j.Logger.getLogger("parser").debug("\n--> berechneter Name: " + T.getName()); //auskommentiert von Andreas Stadelmeier (a10023) FP.setType( T ); - FP.set_DeclId($1); + //FP.set_DeclId($1); $$=FP; } diff --git a/lib/junit-4.0.jar b/lib/junit-4.0.jar new file mode 100755 index 000000000..b20406924 Binary files /dev/null and b/lib/junit-4.0.jar differ diff --git a/lib/log4j-1.2.12.jar b/lib/log4j-1.2.12.jar new file mode 100755 index 000000000..9b5a72008 Binary files /dev/null and b/lib/log4j-1.2.12.jar differ diff --git a/src/mycompiler/MyCompiler.java b/src/mycompiler/MyCompiler.java index 7b566e9ee..cd6c03680 100755 --- a/src/mycompiler/MyCompiler.java +++ b/src/mycompiler/MyCompiler.java @@ -13,11 +13,10 @@ import java.io.Reader; import java.io.StringReader; import java.util.Vector; +import mycompiler.mybytecode.ClassFile; import mycompiler.myclass.Class; import mycompiler.myclass.ClassBody; -import mycompiler.myclass.Constructor_Backup; import mycompiler.myclass.DeclId; -import mycompiler.myclass.FieldDecl; import mycompiler.myclass.FormalParameter; import mycompiler.myclass.ImportDeclarations; import mycompiler.myclass.Method; @@ -43,9 +42,13 @@ import org.apache.log4j.xml.DOMConfigurator; import com.sun.corba.se.spi.orbutil.fsm.Guard.Result; import com.sun.org.apache.xerces.internal.impl.xs.identity.Field; -import typinferenz.TypinferenzException; +import typinferenz.FunNInterface; +import typinferenz.ResultSet; // ino.end import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.DebugException; +import typinferenz.exceptions.ParserError; +import typinferenz.exceptions.TypeinferenceException; @@ -80,15 +83,6 @@ public class MyCompiler implements MyCompilerAPI protected String OutputDir = ""; // ino.end - // ino.attribute.m_Singleton.21277.decldescription type=javadoc - /** - * Die Singleton-Instanz f�r den Compiler - *
Autor: J�rg B�uerle - */ - // ino.end - // ino.attribute.m_Singleton.21277.declaration - private static MyCompiler m_Singleton = null; - // ino.end // ino.attribute.m_AbstractSyntaxTree.21280.decldescription type=javadoc /** @@ -130,10 +124,7 @@ public class MyCompiler implements MyCompilerAPI // ino.end // ino.method.getAPI.21286.body { - if(m_Singleton==null){ - m_Singleton = new MyCompiler(); - } - return m_Singleton; + return new MyCompiler(); } // ino.end @@ -496,14 +487,16 @@ public class MyCompiler implements MyCompilerAPI */ // ino.end // ino.method.parse.21298.definition - public void parse(File file) + public SourceFile parse(File file) throws FileNotFoundException, IOException, JavaParser.yyException // ino.end // ino.method.parse.21298.body { FileReader fr = new FileReader(file); - this.m_AbstractSyntaxTree.add(this.parse2SyntaxTree(file.getName(), fr)); + SourceFile ret = this.parse2SyntaxTree(fr); + this.m_AbstractSyntaxTree.add(ret); fr.close(); + return ret; } // ino.end @@ -530,7 +523,7 @@ public class MyCompiler implements MyCompilerAPI inferencelog.info("# TypeReconstruction-Algorithmus - START #"); inferencelog.info("##########################################\n"); - TypeAssumptions globalAssumptions = m_AbstractSyntaxTree.elementAt(0).makeBasicAssumptions(); + TypeAssumptions globalAssumptions = makeFunNAssumptions(); Vector result = new Vector(); for(SourceFile srcFile : m_AbstractSyntaxTree){ result.addAll(srcFile.typeReconstruction(globalAssumptions)); @@ -545,32 +538,49 @@ public class MyCompiler implements MyCompilerAPI } // ino.end - + /** + * Erstellt die FunN-Assumptions + * Fun0-FunN (momentan für N = 6) + * @return + */ + private TypeAssumptions makeFunNAssumptions(){ + TypeAssumptions ret = new TypeAssumptions(); + + //Basic Assumptions für die FunN Interfaces: + //TODO: Hier mehr als Fun1-Fun5 implementieren + for(int i = 0; i<6; i++){ + FunNInterface funN = new FunNInterface(i); + ret.add(funN.getPublicFieldAssumptions()); + } + + + return ret; + } - // ino.method.codeGeneration.21310.defdescription type=javadoc /** * Author: J�rg B�uerle
* Generiert den Bytecode und das Class-File f�r den Syntaxbaum. * @throws NullPointerException Wenn noch kein abstrakter Syntaxbaum vorhanden * ist. */ - // ino.end - // ino.method.codeGeneration.21310.definition - public void codeGeneration() + @Override + public Vector codeGeneration(ResultSet result) throws NullPointerException, JVMCodeException - // ino.end - // ino.method.codeGeneration.21310.body { if(m_AbstractSyntaxTree==null){ throw new NullPointerException("Es wurde noch kein Abstrakter Syntaxbaum erstellt!"); } codegenlog.info("Beginn der Codegenerierung ..."); - //m_AbstractSyntaxTree.codegen(); + Vector ret = new Vector(); + + for(SourceFile sf : m_AbstractSyntaxTree){ + ret.addAll(sf.codegen(result)); + } codegenlog.info("Codegenerierung beendet!"); + return ret; } - // ino.end // ino.method.main.21313.defdescription type=javadoc /** @@ -747,7 +757,7 @@ public class MyCompiler implements MyCompilerAPI /** * Parst den Inhalt einer Datei zu einem Syntaxbaum. */ - private SourceFile parse2SyntaxTree(String filename, Reader fileContent){ + private SourceFile parse2SyntaxTree(Reader fileContent) throws ParserError{ //StringReader reader = new StringReader(fileContent); ////////////////////////////////////// @@ -763,13 +773,12 @@ public class MyCompiler implements MyCompilerAPI try { srcFile = (SourceFile) parser.yyparse( scanner ); } catch (IOException | yyException e) { - // TODO Auto-generated catch block e.printStackTrace(); + if(e instanceof yyException)throw new ParserError((yyException)e); } ////////////////////////////////////// // Postprocessing: ////////////////////////////////////// - srcFile.setFileName(filename); srcFile.parserPostProcessing(null); //Muss mit null aufgerufen werden. //Fertig: return srcFile; @@ -778,7 +787,7 @@ public class MyCompiler implements MyCompilerAPI /** * Diese Funktion nimmt einen Vector von Dateinamen. Alle diese Dateien werden zu einem SyntaxBaum geparst. */ - public void parse(Vector filenames) { + public void parse(Vector filenames) throws ParserError { for(String filename : filenames){ StringBuffer fileData = new StringBuffer(); @@ -787,7 +796,7 @@ public class MyCompiler implements MyCompilerAPI reader = new BufferedReader( new FileReader(filename)); } catch (FileNotFoundException e) { - throw new TypinferenzException("Die Datei "+ filename+" konnte nicht gelesen werden."); + throw new DebugException("Die Datei "+ filename+" konnte nicht gelesen werden."); } char[] buf = new char[1024]; int numRead=0; @@ -798,13 +807,12 @@ public class MyCompiler implements MyCompilerAPI } reader.close(); } catch (IOException e) { - // TODO Auto-generated catch block e.printStackTrace(); } StringReader srcreader = new StringReader(fileData.toString()); //Den aus der Datei ausgelesenen Quellcode zu einem Syntaxbaum parsen: - this.m_AbstractSyntaxTree.add(parse2SyntaxTree(filename,srcreader)); // Alle Dateien nacheinander hintereinander anhängen... + this.m_AbstractSyntaxTree.add(parse2SyntaxTree(srcreader)); // Alle Dateien nacheinander hintereinander anhängen... } /* @@ -824,7 +832,6 @@ public class MyCompiler implements MyCompilerAPI reader.close(); gesamterSrc += fileData.toString() + "\n"; // Alle Dateien nacheinander hintereinander anhängen... } catch (Exception e) { - // TODO Auto-generated catch block e.printStackTrace(); throw new TypinferenzException("Die übergebenen Dateien konnten nicht zum Parsen eingelesen werden."); } @@ -840,5 +847,12 @@ public class MyCompiler implements MyCompilerAPI */ } + + @Override + public SourceFile parse(String sourceCode) { + SourceFile ret = this.parse2SyntaxTree(new StringReader(sourceCode)); + this.m_AbstractSyntaxTree.add(ret); + return ret; + } } // ino.end diff --git a/src/mycompiler/MyCompilerAPI.java b/src/mycompiler/MyCompilerAPI.java index 2d18b2011..d75cbd4d5 100755 --- a/src/mycompiler/MyCompilerAPI.java +++ b/src/mycompiler/MyCompilerAPI.java @@ -7,6 +7,11 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Vector; + +import typinferenz.ResultSet; +import typinferenz.exceptions.ParserError; +import typinferenz.exceptions.TypeinferenceException; +import mycompiler.mybytecode.ClassFile; import mycompiler.myexception.CTypeReconstructionException; import mycompiler.myexception.JVMCodeException; import mycompiler.myparser.JavaParser; @@ -50,7 +55,7 @@ public interface MyCompilerAPI */ // ino.end // ino.method.parse.21334.declaration - public void parse(File file) + public SourceFile parse(File file) throws FileNotFoundException, IOException, JavaParser.yyException; // ino.end @@ -81,7 +86,7 @@ public interface MyCompilerAPI // ino.end // ino.method.typeReconstruction.21340.declaration public Vector typeReconstruction() - throws NullPointerException, CTypeReconstructionException; + throws NullPointerException, TypeinferenceException; // ino.end // ino.method.codeGeneration.21346.decldescription type=javadoc @@ -94,7 +99,7 @@ public interface MyCompilerAPI */ // ino.end // ino.method.codeGeneration.21346.declaration - public void codeGeneration() + public Vector codeGeneration(ResultSet result) throws NullPointerException, JVMCodeException; // ino.end @@ -122,7 +127,14 @@ public interface MyCompilerAPI * Parst zusammenhängende JavaKlassen in verschiedenen Dateien. * @param filenames - Eine Liste von Quellcodedateien, welche gseparst werden sollen */ - public void parse(Vector filenames); + public void parse(Vector filenames) throws ParserError; + /** + * Parst den SourceCode einer Datei. + * @param sourceCode - SourceCode einer Java-Quellcodedatei + * @return den aus dem sourceCode generierten Syntaxbaum + */ + public SourceFile parse(String sourceCode) throws ParserError; + } // ino.end diff --git a/src/mycompiler/SourceFile.java b/src/mycompiler/SourceFile.java index 2db1dda70..56cf5fabc 100755 --- a/src/mycompiler/SourceFile.java +++ b/src/mycompiler/SourceFile.java @@ -3,13 +3,19 @@ package mycompiler; // ino.end // ino.module.SourceFile.8722.import +import java.util.Collection; import java.util.Enumeration; +import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.mybytecode.ClassFile; import mycompiler.myclass.BasicAssumptionClass; import mycompiler.myclass.Class; +import mycompiler.myclass.Constructor; +import mycompiler.myclass.Field; +import mycompiler.myclass.FieldDeclaration; import mycompiler.myclass.ImportDeclarations; import mycompiler.myclass.UsedId; import mycompiler.myexception.CTypeReconstructionException; @@ -38,13 +44,22 @@ import mycompiler.mytypereconstruction.unify.Unify; import org.apache.log4j.Logger; +import mycompiler.myclass.*; +import mycompiler.*; import sun.reflect.generics.reflectiveObjects.NotImplementedException; import sun.reflect.generics.reflectiveObjects.TypeVariableImpl; import typinferenz.ConstraintsSet; import typinferenz.FunN; -import typinferenz.TypinferenzException; +import typinferenz.FunNInterface; +import typinferenz.FunNMethod; +import typinferenz.ResultSet; import typinferenz.UndConstraint; +import typinferenz.assumptions.ClassAssumption; +import typinferenz.assumptions.MethodAssumption; +import typinferenz.assumptions.ParameterAssumption; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.DebugException; +import typinferenz.exceptions.TypeinferenceException; @@ -123,7 +138,7 @@ public class SourceFile // ino.attribute.InterfaceVektor.21379.declaration public Vector InterfaceVektor = new Vector(); // ino.end - private String filename; + /** * Die SourceFile repräsntiert eine zu einem Syntaxbaum eingelesene Java-Datei. * SourceFile stellt dabei den Wurzelknoten des Syntaxbaumes dar. @@ -215,22 +230,24 @@ public class SourceFile */ // ino.end // ino.method.codegen.21397.definition - public void codegen() + public Vector codegen(ResultSet result) throws JVMCodeException // ino.end // ino.method.codegen.21397.body { + Vector ret = new Vector(); codegenlog.info("Anzahl der Interfaces: " + Integer.toString(InterfaceVektor.size())); for(int i = 0; i < InterfaceVektor.size(); i++) { - InterfaceVektor.elementAt(i).codegen(this); + InterfaceVektor.elementAt(i).codegen(result); } codegenlog.info("Anzahl der Klassen: " + Integer.toString(KlassenVektor.size())); for(int i = 0; i < KlassenVektor.size(); i++) { - KlassenVektor.elementAt(i).codegen(this); + ret.add(KlassenVektor.elementAt(i).codegen(result)); } + return ret; } // ino.end @@ -323,7 +340,7 @@ public class SourceFile while(interfaceIterator.hasNext()){ UsedId superintf=interfaceIterator.next(); String superinterfaceName=superintf.getQualifiedName(); - Pair P=createPairFromClassAndSuperclass(intf.getName(),superinterfaceName,intf. getParaList(), superintf.get_ParaList()); + Pair P=createPairFromClassAndSuperclass(intf.getName(),superinterfaceName,intf.getParaList(), superintf.get_ParaList()); vFC.add( P ); } @@ -645,90 +662,145 @@ public class SourceFile globalAssumptions.add(klasse.getPublicFieldAssumptions()); } + //Assumptions der importierten Klassen sammeln: + TypeAssumptions importAssumptions = this.makeBasicAssumptionsFromJRE(imports); + globalAssumptions.add(importAssumptions); + typinferenzLog.debug("Von JRE erstellte Assumptions: "+importAssumptions); + + ConstraintsSet oderConstraints = new ConstraintsSet(); //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)); - - } - - } - - + oderConstraints.add(klasse.typeReconstruction(finiteClosure, globalAssumptions)); } + //////////////// + //Karthesisches Produkt bilden: + //////////////// + //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: + ////////////////////////////// + boolean unifyFail = true; + 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(); + } + } + + /* + //Alle Generischen Typvariablen in TPH umwandeln: + HashMap gtv2tph = new HashMap(); + for(Pair pair : constraints){ + if(pair.TA1 instanceof GenericTypeVar){ + TypePlaceholder tph = gtv2tph.get(pair.TA1); + if(tph == null){ + tph = TypePlaceholder.fresh(); + gtv2tph.put((GenericTypeVar)pair.TA1, tph); + } + pair.TA1 = tph; + } + if(pair.TA2 instanceof GenericTypeVar){ + TypePlaceholder tph = gtv2tph.get(pair.TA2); + if(tph == null){ + tph = TypePlaceholder.fresh(); + gtv2tph.put((GenericTypeVar)pair.TA2, tph); + } + pair.TA2 = tph; + } + } + */ + //Erst die Unifizierung erstellen: + Vector constraintsClone = (Vector)constraints.clone(); + + //Typen kontrollieren: + for(Pair p : constraintsClone){ + Type t = p.TA1; + //TypeCheck, falls es sich um einen RefType handelt: + if(t!=null && (t instanceof RefType)&& + !(t instanceof mycompiler.mytype.Void)){ + Type replaceType = null; + replaceType = globalAssumptions.getTypeFor((RefType)t); + if(!(replaceType == null))p.TA1 = replaceType; + } + t = p.TA2; + //TypeCheck, falls es sich um einen RefType handelt: + if(t!=null && (t instanceof RefType)&& + !(t instanceof mycompiler.mytype.Void)){ + Type replaceType = null; + replaceType = globalAssumptions.getTypeFor((RefType)t); + if(!(replaceType == null))p.TA2 = replaceType; + } + } + + Vector> unifyResult = Unify.unify(constraintsClone, 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()))); + + + //Für jede Klasse in diesem SourceFile gilt das selbe ResultSet: + for(Class klasse : this.KlassenVektor){ + //Der Unifikationsalgorithmus kann wiederum auch mehrere Lösungen errechnen, diese werden im folgenden durchlaufen: + for(Vector resultSet : result){ + unifyFail = false; //Ein Unifiziertes Ergebnis ist entstanden (es kann auch leer sein, das bedeutet nur, dass die Constraints mindestens in einem Fall Sinn ergaben) + //Add Result set as a new ReconstructionResult to ret: + TypeinferenceResultSet reconstructionResult = new TypeinferenceResultSet(klasse, constraints, new ResultSet(resultSet)); + ret.add(reconstructionResult); + + //ResultSet res = new ResultSet(resultSet); + typinferenzLog.debug("JavaFile für ResultSet "+reconstructionResult+"\n"); + typinferenzLog.debug(klasse.printJavaCode(reconstructionResult)); + + } + } + } + if(unifyFail){ + if(!this.KlassenVektor.isEmpty())throw new TypeinferenceException("Fehler in Typinferierung", this.KlassenVektor.firstElement()); + } return ret; /* // HOTI: Nur zur Info.Ich habe den Loglevel auf Info geschaltet, damit @@ -741,7 +813,7 @@ public class SourceFile TypeAssumptions basics; - basics = this.makeBasicAssumptions(); //TODO: Diese Funktion ändern, dass nur noch TypeAssumptions zurückgegeben werden. Diese sind wichtig, da hier die Standard-Library von Java als Assumptions generiert wird. + basics = this.makeBasicAssumptions(); //A.addElement(basics); //auskommentiert von Andreas Stadelmeier @@ -862,6 +934,7 @@ public class SourceFile * Erstellt die Basic Assumptions (siehe MakeBasicAssumptions) als AssumptionSet * @return */ + @Deprecated //angefügt von Andreas Stadelmeier. Grund: Die Funktion wurde neu als makeBasicAssumptionsFromJRE angelegt private TypeAssumptions getBasicAssumptions() { TypeAssumptions ret = new TypeAssumptions(null); @@ -1006,20 +1079,23 @@ public class SourceFile } // ino.method.makeBasicAssumptionsFromJRE.21409.definition - @Deprecated //angefügt von Andreas Stadelmeier. Grund: Die Funktion wurde neu als getBasicAssumptions angelegt - private TypeinferenceResultSet makeBasicAssumptionsFromJRE(Vector imports) + private TypeAssumptions makeBasicAssumptionsFromJRE(Vector imports) // ino.end // ino.method.makeBasicAssumptionsFromJRE.21409.body { - return null; - /* + //return null; + ///* Vector doneImports=new Vector(); - TypeinferenceResultSet basicAssumptions = new TypeinferenceResultSet(null); - + //TypeinferenceResultSet basicAssumptions = new TypeinferenceResultSet(null); + TypeAssumptions basicAssumptions = new TypeAssumptions(); + Modifiers mod = new Modifiers(); mod.addModifier(new Public()); + //Für Object: + //TODO: toString()-Methode gerät nicht in die BasicAssumptions + imports.add(new UsedId("java.lang.Object",-1)); // Für jede einzelne Klasse while (imports.size()>0) { @@ -1051,11 +1127,13 @@ public class SourceFile jreSpiderRegistry.put(tvs[j].getName(),gtv); } - BasicAssumptionClass myCl = new BasicAssumptionClass(className, mod); - + //BasicAssumptionClass myCl = new BasicAssumptionClass(className, mod); + Class parentClass = new Class(className, mod); + if(typeGenPara.size()>0){ - basicAssumptions.addGenericTypeVars(className, typeGenPara); - myCl.set_ParaList((Vector)typeGenPara); + //auskommentiert von Andreas Stadelmeier: + //basicAssumptions.addGenericTypeVars(className, typeGenPara); + parentClass.set_ParaList((Vector)typeGenPara);//myCl.set_ParaList((Vector)typeGenPara); } @@ -1089,40 +1167,52 @@ public class SourceFile } ui.set_ParaList(supertypeGenPara); ui.vParaOrg=supertypeGenPara; - myCl.set_UsedId(ui); + parentClass.set_UsedId(ui); } } - this.addElement(myCl); - - basicAssumptions.addClassName(className); + //auskommentiert von Andreas Stadelmeier + //this.addElement(myCl); + //basicAssumptions.addClassName(className); for(int j=0;j()); CInstVarTypeAssumption instVar = new CInstVarTypeAssumption(className, fields[j].getName(), new RefType(fields[j].getType().getName(),-1), MyCompiler.NO_LINENUMBER,MyCompiler.NO_LINENUMBER,new Vector()); - basicAssumptions.addFieldOrLocalVarAssumption(instVar); + //basicAssumptions.addFieldOrLocalVarAssumption(instVar); + parentClass.addField(new FieldDeclaration(fields[j].getName(),new RefType(fields[j].getType().getName(),-1))); } } for(int j=0;j(),null); - + //CMethodTypeAssumption method = new CMethodTypeAssumption(new RefType(className, 0), methodName, returnType, pt.length,MyCompiler.NO_LINENUMBER,MyCompiler.NO_LINENUMBER,new Vector(),null); + Method method = mycompiler.myclass.Method.createEmptyMethod(methodName, parentClass); + method.setType(returnType); + ParameterList parameterList = new ParameterList(); for(int k=0;k())); + //method.addParaAssumption(new CParaTypeAssumption(className, methodName, pt.length,0,type.getName(), type, MyCompiler.NO_LINENUMBER,MyCompiler.NO_LINENUMBER,new Vector())); + FormalParameter parameter = new FormalParameter(new DeclId(type.get_Name())); + parameter.setType(type); + parameterList.formalparameter.add(parameter); } - basicAssumptions.addMethodIntersectionType(new CIntersectionType(method)); - } + method.setParameterList(parameterList); + //basicAssumptions.addMethodIntersectionType(new CIntersectionType(method)); + parentClass.addField(method); + + } + } } for(int j=0;j())); } - basicAssumptions.addMethodIntersectionType(new CIntersectionType(constructor)); + //basicAssumptions.addMethodIntersectionType(new CIntersectionType(constructor)); + Method constructorMethod = mycompiler.myclass.Method.createEmptyMethod(methodName, parentClass); + parentClass.addField(new Constructor(constructorMethod)); } } - + + basicAssumptions.add(parentClass.getPublicFieldAssumptions()); + basicAssumptions.addClassAssumption(new ClassAssumption(parentClass)); imports.removeElement(importDecl); doneImports.addElement(importDecl); } - imports.addAll(doneImports); return basicAssumptions; - */ + //*/ } // ino.end @@ -1214,7 +1307,7 @@ public class SourceFile */ // ino.end // ino.method.makeBasicAssumptions.21418.definition - public TypeAssumptions makeBasicAssumptions() + private TypeAssumptions makeBasicAssumptions() // ino.end // ino.method.makeBasicAssumptions.21418.body { @@ -1376,7 +1469,17 @@ public class SourceFile return foo; */ - return new TypeAssumptions(null); //TODO: Diese TypeAssumptions mit basic-Assumptions füllen + TypeAssumptions ret = new TypeAssumptions(); + + //Basic Assumptions für die FunN Interfaces: + //TODO: Hier mehr als Fun1-Fun5 implementieren + for(int i = 0; i<6; i++){ + FunNInterface funN = new FunNInterface(i); + ret.add(funN.getPublicFieldAssumptions()); + } + + + return ret; //TODO: Diese TypeAssumptions mit basic-Assumptions füllen } // ino.end @@ -1507,21 +1610,21 @@ public class SourceFile @Override public void parserPostProcessing(SyntaxTreeNode parent) { - if(parent!=null)throw new TypinferenzException("Eine SourceFile hat keine Elternelement im Syntaxbaum"); - for(SyntaxTreeNode node : this.getChildren())node.parserPostProcessing(this); + if(parent!=null)throw new DebugException("Eine SourceFile hat kein Elternelement im Syntaxbaum"); + super.parserPostProcessing(parent); + //for(SyntaxTreeNode node : this.getChildren())node.parserPostProcessing(this); } @Override public SyntaxTreeNode getParent() { - // TODO Auto-generated method stub return null; } @Override public Vector getChildren() { - Vector ret = super.getChildren(); + Vector ret = new Vector(); for(Class cl : this.KlassenVektor){ ret.add(cl); } @@ -1533,8 +1636,9 @@ public class SourceFile * SourceFile stellt eine geparste Java-Datei dar. Mit dieser Methode wird der Name der eingelesenen Datei gesetzt. * @param filename - Der Name der eingelesenen JavaDatei */ + @Deprecated public void setFileName(String filename) { - this.filename = filename; + //this.filename = filename; } } diff --git a/src/mycompiler/SyntaxTreeNode.java b/src/mycompiler/SyntaxTreeNode.java index 5252ab876..1b5cab308 100644 --- a/src/mycompiler/SyntaxTreeNode.java +++ b/src/mycompiler/SyntaxTreeNode.java @@ -2,10 +2,21 @@ package mycompiler; import java.util.Vector; -import typinferenz.TypinferenzException; +import typinferenz.GenericTypeInsertPoint; +import typinferenz.ResultSet; +import typinferenz.TypeInsertable; +import typinferenz.exceptions.DebugException; +import typinferenz.exceptions.TypeinferenceException; +import typinferenz.typedeployment.TypeInsertPoint; +import typinferenz.typedeployment.TypeInsertSet; import mycompiler.myclass.Class; +import mycompiler.myclass.Generic; +import mycompiler.mytype.GenericTypeVar; +import mycompiler.mytype.Pair; +import mycompiler.mytype.Type; +import mycompiler.mytype.TypePlaceholder; -public abstract class SyntaxTreeNode { +public abstract class SyntaxTreeNode{ protected SyntaxTreeNode parent; @@ -14,6 +25,8 @@ public abstract class SyntaxTreeNode { * Erfüllt folgenden Aufgaben: * 1. Füllt fehlende Typangaben mit TPHs auf. * 2. Verknüpft die Knoten des Syntaxbaums. (setzt Parent) + * 3. Wechselt RefTypes gegebenenfalls mit GenericTypeVars aus. + * 4. Führt einen Teil des Syntaxckecks durch. * */ public void parserPostProcessing(SyntaxTreeNode parent) { @@ -25,14 +38,76 @@ public abstract class SyntaxTreeNode { return this.parent; } - public Vector getChildren(){ - return new Vector(); - } + public abstract Vector getChildren(); public Class getParentClass(){ SyntaxTreeNode parent = this.getParent(); if(parent instanceof Class)return (Class)parent; - if(parent == null)throw new TypinferenzException("Das Wurzelelement eines Syntaxbaumes muss Class sein"); + if(parent == null) + throw new DebugException("Das Wurzelelement eines Syntaxbaumes muss Class sein"); return parent.getParentClass(); } + + /** + * Eine Beschreibung/Name des SyntaxTree-Nodes + * @return + */ + public String getDescription(){ + return this.toString(); + } + + + @Override + public boolean equals(Object object){ + if(!(object instanceof SyntaxTreeNode))return false; + SyntaxTreeNode equal = (SyntaxTreeNode)object; + if(!equal.getDescription().equals(this.getDescription()))return false; + if(this.getParent()!=null) + if(!this.getParent().equals(equal.getParent()))return false; //auch das Elternelement überprüfen. + return true; + } + + /** + * Methode zur Generierung der TypeInsertPoints + * @param insertSet - Generierte InsertPoints werden dem insertSet angefügt + * @param result - Das ResultSet auf dessen Basis die InsertPoints generiert werden + */ + public void addTypeInsertPoints(TypeInsertSet insertSet,ResultSet result) { + for(SyntaxTreeNode node : this.getChildren()){ + node.addTypeInsertPoints(insertSet, result); + } + + TypeInsertPoint tip = null; //Der TypInsertPoint für diesen Knoten + //Fall der Knoten ein TypeInsertable ist, kann direkt der TypeInsertPoint generiert werden. + if(this instanceof TypeInsertable){ + TypeInsertable that = (TypeInsertable)this; + Type t = that.getType(); + if(t instanceof TypePlaceholder){ + tip = that.createTypeInsertPoint((TypePlaceholder) t, result); + insertSet.add(tip);//ret.addAll(((TypePlaceholder)t).getTypeInsertPoints(result)); + } + + //Für den Fall, dass dieser Knoten Generische Variablen halten kann. + if(that instanceof Generic && that.getOffset()>=0){ + //Alle unresolvedTPHs ermitteln und GenericTypeVarInsertPoints bilden: + Vector uTPHs = insertSet.getUnresolvedTPHs(); + /* + for(TypePlaceholder tph : uTPHs){//GenericInsertPoints für diese TPHs bilden: + GenericTypeInsertPoint genericTIP = new GenericTypeInsertPoint(that,tph,result); + insertSet.add(genericTIP); + } + */ + if(uTPHs.size()>0){//Nur wenn es auch unresolvedTPHs gibt: + Vector gPairs = result.getConstraintsFor(uTPHs); + if(gPairs.size()>0){ + GenericTypeInsertPoint genericTIP = new GenericTypeInsertPoint(that,gPairs,result); + insertSet.add(genericTIP); + } + } + } + + } + + + } } diff --git a/src/mycompiler/mybytecode/Attribute.java b/src/mycompiler/mybytecode/Attribute.java index f89b5c8ca..19a21e56d 100755 --- a/src/mycompiler/mybytecode/Attribute.java +++ b/src/mycompiler/mybytecode/Attribute.java @@ -5,12 +5,15 @@ package mycompiler.mybytecode; // ino.module.Attribute.8529.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; + import mycompiler.myexception.JVMCodeException; + import org.apache.log4j.Logger; // ino.end // ino.class.Attribute.21446.declaration -public abstract class Attribute +public abstract class Attribute implements ClassFileMember // ino.end // ino.class.Attribute.21446.body { @@ -44,7 +47,8 @@ public abstract class Attribute // ino.end // ino.method.codegen.21461.declaration - public abstract void codegen(ClassFile classfile, FileOutputStream f) + @Override + public abstract void codegen(ClassFile classfile, OutputStream f) throws JVMCodeException, IOException; // ino.end diff --git a/src/mycompiler/mybytecode/AttributeInfo.java b/src/mycompiler/mybytecode/AttributeInfo.java index 405e75815..0c6eb249a 100755 --- a/src/mycompiler/mybytecode/AttributeInfo.java +++ b/src/mycompiler/mybytecode/AttributeInfo.java @@ -4,8 +4,10 @@ package mycompiler.mybytecode; // ino.module.AttributeInfo.8530.import import java.io.FileOutputStream; +import java.io.OutputStream; import java.lang.reflect.Array; import java.util.Vector; + import mycompiler.myexception.JVMCodeException; // ino.end @@ -70,7 +72,8 @@ public class AttributeInfo extends Attribute // ino.end // ino.method.codegen.21489.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws JVMCodeException, java.io.IOException // ino.end // ino.method.codegen.21489.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Class_info.java b/src/mycompiler/mybytecode/CONSTANT_Class_info.java index b54c6d7f7..76f61b2cd 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Class_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Class_info.java @@ -5,6 +5,7 @@ package mycompiler.mybytecode; // ino.module.CONSTANT_Class_info.8533.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; // ino.end // ino.class.CONSTANT_Class_info.21763.declaration @@ -35,7 +36,8 @@ public class CONSTANT_Class_info extends CPInfo // ino.end // ino.method.codegen.21776.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21776.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Double_info.java b/src/mycompiler/mybytecode/CONSTANT_Double_info.java index a720799e4..18c3523c0 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Double_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Double_info.java @@ -6,6 +6,7 @@ package mycompiler.mybytecode; import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_Double_info.21782.declaration public class CONSTANT_Double_info extends CPInfo @@ -46,7 +47,8 @@ public class CONSTANT_Double_info extends CPInfo // ino.end // ino.method.codegen.21804.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21804.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Fieldref_info.java b/src/mycompiler/mybytecode/CONSTANT_Fieldref_info.java index fca75546d..05dbd5f9c 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Fieldref_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Fieldref_info.java @@ -6,6 +6,7 @@ package mycompiler.mybytecode; import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_Fieldref_info.21810.declaration public class CONSTANT_Fieldref_info extends CPInfo @@ -57,7 +58,8 @@ public class CONSTANT_Fieldref_info extends CPInfo // ino.end // ino.method.codegen.21832.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21832.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Float_info.java b/src/mycompiler/mybytecode/CONSTANT_Float_info.java index 95317a506..7a442fdd4 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Float_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Float_info.java @@ -2,9 +2,9 @@ package mycompiler.mybytecode; // ino.end // ino.module.CONSTANT_Float_info.8536.import -import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_Float_info.21838.declaration public class CONSTANT_Float_info extends CPInfo @@ -29,7 +29,8 @@ public class CONSTANT_Float_info extends CPInfo // ino.end // ino.method.codegen.21851.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21851.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Integer_info.java b/src/mycompiler/mybytecode/CONSTANT_Integer_info.java index 7150cc6eb..c317bfb4f 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Integer_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Integer_info.java @@ -4,6 +4,7 @@ package mycompiler.mybytecode; // ino.module.CONSTANT_Integer_info.8537.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; // ino.end @@ -32,7 +33,8 @@ public class CONSTANT_Integer_info extends CPInfo // ino.end // ino.method.codegen.21870.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21870.body diff --git a/src/mycompiler/mybytecode/CONSTANT_InterfaceMethodref_info.java b/src/mycompiler/mybytecode/CONSTANT_InterfaceMethodref_info.java index c00288e6b..6701db8a8 100755 --- a/src/mycompiler/mybytecode/CONSTANT_InterfaceMethodref_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_InterfaceMethodref_info.java @@ -6,6 +6,7 @@ package mycompiler.mybytecode; import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_InterfaceMethodref_info.21876.declaration public class CONSTANT_InterfaceMethodref_info extends CPInfo @@ -57,7 +58,8 @@ public class CONSTANT_InterfaceMethodref_info extends CPInfo // ino.end // ino.method.codegen.21898.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21898.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Long_info.java b/src/mycompiler/mybytecode/CONSTANT_Long_info.java index 76b2719c4..6aacc7472 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Long_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Long_info.java @@ -5,6 +5,7 @@ package mycompiler.mybytecode; // ino.module.CONSTANT_Long_info.8539.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; // ino.end // ino.class.CONSTANT_Long_info.21904.declaration @@ -57,7 +58,8 @@ public class CONSTANT_Long_info extends CPInfo // ino.end // ino.method.codegen.21926.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21926.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Methodref_info.java b/src/mycompiler/mybytecode/CONSTANT_Methodref_info.java index 692ef0d94..2f9790530 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Methodref_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Methodref_info.java @@ -6,6 +6,7 @@ package mycompiler.mybytecode; import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_Methodref_info.21932.declaration public class CONSTANT_Methodref_info extends CPInfo @@ -57,7 +58,8 @@ public class CONSTANT_Methodref_info extends CPInfo // ino.end // ino.method.codegen.21954.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21954.body diff --git a/src/mycompiler/mybytecode/CONSTANT_NameAndType_info.java b/src/mycompiler/mybytecode/CONSTANT_NameAndType_info.java index 2bd63b58d..d13049be7 100755 --- a/src/mycompiler/mybytecode/CONSTANT_NameAndType_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_NameAndType_info.java @@ -6,6 +6,7 @@ package mycompiler.mybytecode; import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_NameAndType_info.21960.declaration public class CONSTANT_NameAndType_info extends CPInfo @@ -57,7 +58,8 @@ public class CONSTANT_NameAndType_info extends CPInfo // ino.end // ino.method.codegen.21982.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21982.body diff --git a/src/mycompiler/mybytecode/CONSTANT_String_info.java b/src/mycompiler/mybytecode/CONSTANT_String_info.java index 1c36bfac2..b8ffb5980 100755 --- a/src/mycompiler/mybytecode/CONSTANT_String_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_String_info.java @@ -6,6 +6,7 @@ package mycompiler.mybytecode; import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_String_info.21988.declaration public class CONSTANT_String_info extends CPInfo @@ -35,7 +36,8 @@ public class CONSTANT_String_info extends CPInfo // ino.end // ino.method.codegen.22001.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.22001.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Utf8_info.java b/src/mycompiler/mybytecode/CONSTANT_Utf8_info.java index 8425249c9..58a44c2d9 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Utf8_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Utf8_info.java @@ -5,6 +5,7 @@ package mycompiler.mybytecode; // ino.module.CONSTANT_Utf8_info.8543.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; import java.lang.reflect.Array; // ino.end @@ -36,7 +37,8 @@ public class CONSTANT_Utf8_info extends CPInfo // ino.end // ino.method.codegen.22020.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.22020.body diff --git a/src/mycompiler/mybytecode/CPInfo.java b/src/mycompiler/mybytecode/CPInfo.java index de91ff93c..9ee33ba6c 100755 --- a/src/mycompiler/mybytecode/CPInfo.java +++ b/src/mycompiler/mybytecode/CPInfo.java @@ -5,11 +5,13 @@ package mycompiler.mybytecode; // ino.module.CPInfo.8544.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; + import org.apache.log4j.Logger; // ino.end // ino.class.CPInfo.22026.declaration -public abstract class CPInfo +public abstract class CPInfo implements ClassFileMember // ino.end // ino.class.CPInfo.22026.body { @@ -43,7 +45,8 @@ public abstract class CPInfo // ino.end // ino.method.codegen.22041.declaration - public abstract void codegen(ClassFile classfile, FileOutputStream f) + @Override + public abstract void codegen(ClassFile classfile, OutputStream f) throws IOException; // ino.end diff --git a/src/mycompiler/mybytecode/ClassFile.java b/src/mycompiler/mybytecode/ClassFile.java index 90136ede9..619c8aed0 100755 --- a/src/mycompiler/mybytecode/ClassFile.java +++ b/src/mycompiler/mybytecode/ClassFile.java @@ -1,3 +1,7 @@ +//key_vector funktioniert nicht PL 14-03-21 +//muss angeschaut werden + + // ino.module.ClassFile.8531.package package mycompiler.mybytecode; // ino.end @@ -5,8 +9,10 @@ package mycompiler.mybytecode; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; import java.lang.reflect.Array; import java.util.Vector; + import mycompiler.myclass.ParameterList; import mycompiler.myclass.UsedId; import mycompiler.MyCompiler; @@ -16,6 +22,7 @@ import mycompiler.mystatement.Assign; import mycompiler.mystatement.Block; import mycompiler.mytype.Type; import mycompiler.SourceFile; + import org.apache.log4j.Logger; // ino.end @@ -50,10 +57,10 @@ public class ClassFile private static int magic = 0xcafebabe; // ino.end // ino.attribute.minor_version.21501.declaration - private static short minor_version = 0; + public static short minor_version = 0; // ino.end // ino.attribute.major_version.21504.declaration - private static short major_version = 0x31; + public static short major_version = 0x31; // ino.end // ino.attribute.constant_pool.21507.declaration @@ -87,7 +94,7 @@ public class ClassFile private Vector class_block = new Vector(); // ino.end // ino.attribute.class_name.21537.declaration - private String class_name = new String(); + private String class_name = new String("OUTPUT");//DEFAULTWERT PL 14-03-21 eingefuegt // ino.end // ino.attribute.super_class_name.21540.declaration private String super_class_name = new String(); @@ -633,6 +640,11 @@ public class ClassFile // ino.method.set_attributes.21624.body { this.attributes = t; } // ino.end + + public void set_class_name(String cn) { + this.class_name = cn; + } + // ino.method.set_constructor_founded.21627.definition public void set_constructor_founded(boolean t) // ino.end @@ -724,7 +736,8 @@ public class ClassFile codegenlog.info("Generieren der Klasse: " + class_name); // Datei vorbereiten - File file = new File(MyCompiler.getAPI().getOutputDir() + //File file = new File(MyCompiler.getAPI().getOutputDir() + File file = new File ("/Users/pl/forschung/PIZZA+/JVM_Generics/Testfiles/" + class_name + ".class"); FileOutputStream f = new FileOutputStream(file); @@ -794,7 +807,7 @@ public class ClassFile // ino.end // ino.method.writeInt.21669.definition - public void writeInt(FileOutputStream f, int i) + public void writeInt(OutputStream f, int i) throws IOException // ino.end // ino.method.writeInt.21669.body @@ -807,7 +820,7 @@ public class ClassFile // ino.end // ino.method.writeShort.21672.definition - public void writeShort(FileOutputStream f, short i) + public void writeShort(OutputStream f, short i) throws IOException // ino.end // ino.method.writeShort.21672.body @@ -818,7 +831,7 @@ public class ClassFile // ino.end // ino.method.writeByte.21675.definition - public void writeByte(FileOutputStream f, byte i) + public void writeByte(OutputStream f, byte i) throws IOException // ino.end // ino.method.writeByte.21675.body @@ -828,7 +841,7 @@ public class ClassFile // ino.end // ino.method.writeByteArray.21678.definition - public void writeByteArray(FileOutputStream f, byte[] b) + public void writeByteArray(OutputStream f, byte[] b) throws IOException // ino.end // ino.method.writeByteArray.21678.body diff --git a/src/mycompiler/mybytecode/ClassFileMember.java b/src/mycompiler/mybytecode/ClassFileMember.java new file mode 100644 index 000000000..8c54cfb96 --- /dev/null +++ b/src/mycompiler/mybytecode/ClassFileMember.java @@ -0,0 +1,10 @@ +package mycompiler.mybytecode; + +import java.io.IOException; +import java.io.OutputStream; + +import mycompiler.myexception.JVMCodeException; + +public interface ClassFileMember { + public void codegen(ClassFile cf, OutputStream out) throws JVMCodeException, IOException; +} diff --git a/src/mycompiler/mybytecode/CodeAttribute.java b/src/mycompiler/mybytecode/CodeAttribute.java index 71d64a4e9..86997fdc3 100755 --- a/src/mycompiler/mybytecode/CodeAttribute.java +++ b/src/mycompiler/mybytecode/CodeAttribute.java @@ -1,3 +1,8 @@ +//PL 14-03-21: calculate_max_stack() duerfte nicht stimmen +//vorübergehend max_stack und set_max_stack eingeführt +//in codegen "short max_stack = calculate_max_stack();" auskommentiert +//muss wieder einkommentiert werden + // ino.module.CodeAttribute.8532.package package mycompiler.mybytecode; // ino.end @@ -5,8 +10,11 @@ package mycompiler.mybytecode; // ino.module.CodeAttribute.8532.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; import java.lang.reflect.Array; import java.util.Vector; + +import sun.reflect.generics.reflectiveObjects.NotImplementedException; import mycompiler.myexception.JVMCodeException; import mycompiler.mytype.Type; // ino.end @@ -31,7 +39,13 @@ public class CodeAttribute extends Attribute // ino.attribute.local_type_vector.21697.declaration private Vector local_type_vector = new Vector(); // ino.end + + short max_stack; + public CodeAttribute() { + super(); + } + // ino.method.CodeAttribute.21700.definition public CodeAttribute(String class_name, short acc_flags) // ino.end @@ -202,9 +216,11 @@ public class CodeAttribute extends Attribute // ino.end // ino.method.get_attributes_length.21748.body { - int ret = 12; + int ret = 8;//2(max_stack)+2(max_locals)+4(code_length) ret += code_vector.size(); + ret += 2; //exception table length ret += (exception_tables.size() * 8); + ret += 2; //Attribute_count for (int i = 0; i < attributes.size(); i++) ret += attributes.elementAt(i) .get_attributes_length(); @@ -230,6 +246,11 @@ public class CodeAttribute extends Attribute } // ino.end + public void set_max_stack(short ms) { + max_stack = ms; + } + + // ino.method.codegen.21757.definition public void codegen(ClassFile classfile, FileOutputStream f) throws JVMCodeException, IOException @@ -237,7 +258,8 @@ public class CodeAttribute extends Attribute // ino.method.codegen.21757.body { int attributes_length = this.get_attributes_length(); - short max_stack = calculate_max_stack(); + //PL 14-03-21: muss wieder einkommentiert werden + //short max_stack = calculate_max_stack(); classfile.writeShort(f, get_attribute_name_index()); classfile.writeInt(f, attributes_length); classfile.writeShort(f, max_stack); @@ -278,6 +300,7 @@ public class CodeAttribute extends Attribute // ino.end // ino.method.calculate_max_stack.21760.definition + //PL 14-03-21: Diese Methode duerfte nicht stimmen private short calculate_max_stack() throws JVMCodeException // ino.end @@ -1067,5 +1090,11 @@ public class CodeAttribute extends Attribute } // ino.end + @Override + public void codegen(ClassFile classfile, OutputStream f) + throws JVMCodeException, IOException { + throw new NotImplementedException(); + } + } // ino.end diff --git a/src/mycompiler/mybytecode/ExceptionTable.java b/src/mycompiler/mybytecode/ExceptionTable.java index a2545007e..c968ed1a0 100755 --- a/src/mycompiler/mybytecode/ExceptionTable.java +++ b/src/mycompiler/mybytecode/ExceptionTable.java @@ -5,11 +5,13 @@ package mycompiler.mybytecode; // ino.module.ExceptionTable.8545.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; + import org.apache.log4j.Logger; // ino.end // ino.class.ExceptionTable.22047.declaration -public class ExceptionTable +public class ExceptionTable implements ClassFileMember // ino.end // ino.class.ExceptionTable.22047.body { @@ -36,7 +38,8 @@ public class ExceptionTable // ino.end // ino.method.codegen.22065.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.22065.body diff --git a/src/mycompiler/mybytecode/FieldInfo.java b/src/mycompiler/mybytecode/FieldInfo.java index 250e8609b..8f2febd05 100755 --- a/src/mycompiler/mybytecode/FieldInfo.java +++ b/src/mycompiler/mybytecode/FieldInfo.java @@ -5,13 +5,16 @@ package mycompiler.mybytecode; // ino.module.FieldInfo.8546.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; import java.util.Vector; + import mycompiler.myexception.JVMCodeException; + import org.apache.log4j.Logger; // ino.end // ino.class.FieldInfo.22068.declaration -public class FieldInfo +public class FieldInfo implements ClassFileMember // ino.end // ino.class.FieldInfo.22068.body { @@ -177,7 +180,8 @@ public class FieldInfo // ino.end // ino.method.codegen.22137.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException, JVMCodeException // ino.end // ino.method.codegen.22137.body diff --git a/src/mycompiler/mybytecode/Key.java b/src/mycompiler/mybytecode/Key.java index d2c41e4c7..859bb8710 100755 --- a/src/mycompiler/mybytecode/Key.java +++ b/src/mycompiler/mybytecode/Key.java @@ -4,11 +4,13 @@ package mycompiler.mybytecode; // ino.module.Key.8548.import import java.io.FileOutputStream; +import java.io.OutputStream; + import org.apache.log4j.Logger; // ino.end // ino.class.Key.22890.declaration -public class Key +public class Key implements ClassFileMember // ino.end // ino.class.Key.22890.body { @@ -87,7 +89,8 @@ public class Key // ino.end // ino.method.codegen.22920.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) // ino.end // ino.method.codegen.22920.body { diff --git a/src/mycompiler/mybytecode/MethodInfo.java b/src/mycompiler/mybytecode/MethodInfo.java index a0775b684..56eee9b2d 100755 --- a/src/mycompiler/mybytecode/MethodInfo.java +++ b/src/mycompiler/mybytecode/MethodInfo.java @@ -5,13 +5,16 @@ package mycompiler.mybytecode; // ino.module.MethodInfo.8549.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; import java.util.Vector; + import mycompiler.myexception.JVMCodeException; + import org.apache.log4j.Logger; // ino.end // ino.class.MethodInfo.22923.declaration -public class MethodInfo +public class MethodInfo implements ClassFileMember // ino.end // ino.class.MethodInfo.22923.body { @@ -111,7 +114,7 @@ public class MethodInfo // ino.end // ino.method.codegen.22965.definition - public void codegen(ClassFile classfile, FileOutputStream f) + public void codegen(ClassFile classfile, OutputStream f) throws JVMCodeException, IOException // ino.end // ino.method.codegen.22965.body diff --git a/src/mycompiler/mybytecode/SignatureInfo.java b/src/mycompiler/mybytecode/SignatureInfo.java index a428e0486..a7d2e6c10 100755 --- a/src/mycompiler/mybytecode/SignatureInfo.java +++ b/src/mycompiler/mybytecode/SignatureInfo.java @@ -5,7 +5,9 @@ package mycompiler.mybytecode; // ino.module.SignatureInfo.8550.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; import java.util.Vector; + import mycompiler.myclass.ParameterList; import mycompiler.myclass.UsedId; import mycompiler.myexception.JVMCodeException; @@ -13,9 +15,12 @@ import mycompiler.mytype.BoundedGenericTypeVar; import mycompiler.mytype.GenericTypeVar; import mycompiler.mytype.RefType; import mycompiler.mytype.Type; + import org.apache.log4j.Logger; // ino.end +import sun.reflect.generics.reflectiveObjects.NotImplementedException; + // ino.class.SignatureInfo.22968.description type=javadoc /** * Generiert die Attribute eines Fields, einer Methode oder einer Klasse/Interface @@ -43,6 +48,9 @@ public class SignatureInfo extends Attribute // ino.end + public SignatureInfo(short sid) { + signatureID = sid; + } // ino.method.SignatureInfo.22978.defdescription type=javadoc /** * Konstruktor fuer die Signatur einer Klasse bzw. eines Interfaces. @@ -254,6 +262,12 @@ public class SignatureInfo extends Attribute return 2; } // ino.end + + @Override + public void codegen(ClassFile classfile, OutputStream f) + throws JVMCodeException, IOException { + throw new NotImplementedException(); + } } // ino.end diff --git a/src/mycompiler/myclass/Class.java b/src/mycompiler/myclass/Class.java index 90988cf64..4f87df8c5 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.IItemWithOffset; import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.myexception.CTypeReconstructionException; @@ -57,20 +58,29 @@ import org.apache.log4j.Logger; + + + + + + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.OderConstraint; import typinferenz.ResultSet; -import typinferenz.TypinferenzException; +import typinferenz.Typeable; import typinferenz.UndConstraint; import typinferenz.FunN; +import typinferenz.assumptions.ClassAssumption; import typinferenz.assumptions.TypeAssumptions; - +import typinferenz.exceptions.TypeinferenceException; +import typinferenz.typedeployment.TypeInsertPoint; +import typinferenz.*; // ino.class.Class.23010.declaration -public class Class extends SyntaxTreeNode implements AClassOrInterface +public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWithOffset, Generic // ino.end // ino.class.Class.23010.body { @@ -247,14 +257,8 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface */ public void addField(Field i) { - Field tempField = i; - if(i instanceof Method){ - Method method = (Method)i; - if(method.get_Method_Name().equals(this.getName()) ){ - tempField = new Constructor(method); - } - } - fielddecl.addElement(tempField); + + fielddecl.addElement(i); } // ino.method.getUsedIdsToCheck.23050.definition @@ -305,8 +309,14 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface + /** + * Generiert die ClassFile für diese Klasse. + * @param typeinferenceResult - Das ResultSet einer Typinferierung oder null, falls alle Typen eindeutig feststehen. + * @return + * @throws JVMCodeException + */ // ino.method.codegen.23071.definition - public void codegen(SourceFile sf) + public ClassFile codegen(ResultSet typeinferenceResult) throws JVMCodeException // ino.end // ino.method.codegen.23071.body @@ -322,12 +332,15 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface } // Handling der Package - String pkgName = ""; - if (sf.getPackageName() != null) { - pkgName = sf.getPackageName().get_codegen_UsedId() + "/"; - } + //String pkgName = ""; + //if (sf.getPackageName() != null) { + // pkgName = sf.getPackageName().get_codegen_UsedId() + "/"; + //} - classfile.add_class(getName(), pkgName, superClass, getAccessFlags()); + //geändert von Andreas Stadelmeier: pkgName wird nicht mehr aus dem SourceFile ausgelesen: + String packageName = ""; + if(pkgName != null) packageName = pkgName.get_Name_1Element(); + classfile.add_class(getName(), packageName, superClass, getAccessFlags()); // Handling fuer Superinterfaces classfile.addSuperInterfaces(getSuperInterfaces()); @@ -346,9 +359,10 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface classfile.add_method("", "()V", null, null, null, (short)0, this.paralist, false); } - classfile.codegen(); + //classfile.codegen(); codegenlog.info("Compilierung erfolgreich abgeschlossen, "+ getName() + ".class erstellt."); + return classfile; } public void codegen(ClassFile classfile, Vector paralist) @@ -398,7 +412,7 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface * -Rückgabetyp der Methode/Konstruktors ist der Typ der Klasse * -Ein Konstruktor kann nicht aufgerufen werden (nur mit new) */ - if(m.get_Method_Name().equals(""))throw new TypinferenzException(" ist kein gültiger Methodenname"); + if(m.get_Method_Name().equals(""))throw new TypeinferenceException(" ist kein gültiger Methodenname", m); if((m.get_Method_Name().equals(this.getName()))) { Constructor constructor = new Constructor(m); tempFields.add(constructor); //Den Konstruktor anstatt der Methode anfügen @@ -470,7 +484,7 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface // ino.end // ino.method.get_ParaList.23101.definition - public Vector get_ParaList() + public Vector get_ParaList() // ino.end // ino.method.get_ParaList.23101.body { @@ -635,10 +649,17 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface // @author A10023 - Andreas Stadelmeier: ////////////////////////////// //Erzeuge Assumptions: - TypeAssumptions assumptions = this.getTypeAssumptions(); - //-- + TypeAssumptions assumptions = this.getPrivateFieldAssumptions(); + //Globale Assumptions anfügen: assumptions.add(globalAssumptions); + ConstraintsSet oderConstraints = new ConstraintsSet(); + + for(Type gparam : this.paralist){ + if(gparam instanceof GenericTypeVar)oderConstraints.add(((GenericTypeVar)gparam).TYPE(assumptions)); //Constraints für die Generischen Variablen erstellen und diese dem AssumptionsSet hinzufügen + } + + typinferenzLog.debug("Erstellte Assumptions: "+assumptions); /* //Generiere Liste mit Expressions, welche zur Initialisierung von Feldern verwendet werden. Vector fieldInitializers = new Vector(); @@ -653,7 +674,7 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface //ConstraintsSet oderConstraints = this.TYPE(this.getMethodList(), fieldInitializers, assumptions); - ConstraintsSet oderConstraints = new ConstraintsSet(); + for(Field f:this.getFields()){ oderConstraints.add(f.TYPE(assumptions)); } @@ -821,11 +842,11 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface */ /** - * Die Funktion ist erst nach dem Aufruf von getMethodList() nutzbar. - * Ermittelt alle Felder und Methoden der Klasse und Erstellt eine Assumption für diese. + * Ermittelt alle privaten Felder und Methoden der Klasse und Erstellt eine Assumption für diese. + * Bemerkung: Momentan werden noch alle Felder dieser Klasse zurückgegeben. * @return Die erstellten TypeAssumptions */ - private TypeAssumptions getTypeAssumptions() { + private TypeAssumptions getPrivateFieldAssumptions() { if(this.typeAssumptions != null)return this.typeAssumptions; //Das sorgt dafür, dass die Assumptions nur einmalig generiert werden. TypeAssumptions assumptions = new TypeAssumptions(this.getName()); //this.getMethodList(); //Diese Funktion muss zuerst ausgeführt werden. @@ -834,7 +855,7 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface //assumptions.setThisV(thisAssumption); for(Field field : this.getFields()){ - assumptions.add(field.createTypeAssumptions(this)); + if(!field.isPublic())assumptions.add(field.createTypeAssumptions(this)); } //Eine Assumption für den Standardkonstruktor: @@ -844,9 +865,6 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface // assumptions.addMethodAssumption(new RefType(this.getName(),0), "", new RefType(this.getName(),0), new Vector()); //} - - typinferenzLog.debug("Erstellte Assumptions: "+assumptions); - this.typeAssumptions = assumptions; //Diese müssen anschließend nicht wieder generiert werden. return assumptions; } @@ -948,8 +966,10 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.23128.body { - - + for(Field f : this.getFields()){ + f.wandleRefTypeAttributes2GenericAttributes(paralist); + } + /* Vector fieldsAndMethods=this.getFields(); // Alle Methoden und Instanzvariablen durchgehen @@ -960,7 +980,7 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface Method method=(Method)fieldsAndMethods.get(i); method.wandleRefTypeAttributes2GenericAttributes(paralist); }// Ist es eine InstanzVariable? - /* + *//* else if(fieldsAndMethods.get(i) instanceof InstVarDecl){ InstVarDecl instVar=(InstVarDecl)fieldsAndMethods.get(i); Type type=instVar.getType(); @@ -971,8 +991,9 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface instVar.setType(pendant); } } - }*/ - } + } + + }*/ } // ino.end @@ -1162,11 +1183,6 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface JavaCodeResult classBodyCode = new JavaCodeResult(); if(this.modifiers!=null)classBodyCode.attach(this.modifiers.printJavaCode(reconstructionResult.getUnifiedConstraints())).attach(" "); - - if(superclassid == null || superclassid.get_Name().size()<1){ - int superclassidOffset = superclassid == null ? 0 : superclassid.getOffset(); - superclassid = new UsedId("Object", superclassidOffset); - } classBodyCode.attach(this.name + " extends ").attach(superclassid.printJavaCode(reconstructionResult.getUnifiedConstraints())).attach("\n"); @@ -1201,10 +1217,10 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface * Die berechneten Variablen werden anschließend in die this.genericTypeVars eingesetzt. Dabei werden alte genericTypeVars überschrieben. * @param tphs : Alle übriggebliebenen TypePLaceholder */ - public void createGenericTypeVars(Vector tphs){ + private void createGenericTypeVars(Vector tphs){ this.genericClassParameters = new Vector(); for(TypePlaceholder tph : tphs){ - GenericTypeVar toAdd = new GenericTypeVar(tph); + GenericTypeVar toAdd = new GenericTypeVar(tph,this.getOffset()); if(!this.genericClassParameters.contains(toAdd))this.genericClassParameters.add(toAdd); } } @@ -1213,40 +1229,45 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface * Errechnet die Generischen Parameter der Klasse für diese Klasse. * Die berechneten Variablen werden anschließend in die this.genericTypeVars eingesetzt. Dabei werden alte genericTypeVars überschrieben. * @param reconstructionResult - */ + public void createGenericTypeVars(TypeinferenceResultSet reconstructionResult){ this.genericClassParameters = new Vector(); for(Pair pair : reconstructionResult.getUnifiedConstraints()){ if(pair.TA2 instanceof TypePlaceholder && pair.TA1 instanceof TypePlaceholder){// if(pair.OperatorSmallerExtends() || pair.OperatorSmaller()){ Type ta1=reconstructionResult.getUnifiedConstraints().getTypeEqualTo(pair.TA1); Type ta2=reconstructionResult.getUnifiedConstraints().getTypeEqualTo(pair.TA2); - this.genericClassParameters.add(new GenericTypeVar(new Pair(ta1,ta2))); + this.genericClassParameters.add(new GenericTypeVar(new Pair(ta1,ta2),this.getOffset())); } - /* - // Auf SuperWildcardTypes überprüfen: - ArrayList wildcardTypes = pair.TA2.getSuperWildcardTypes(); - wildcardTypes.addAll(pair.TA1.getSuperWildcardTypes()); - for(SuperWildcardType wildcardType : wildcardTypes){ - this.genericClassParameters.add(new GenericTypeVar(new Pair(TypePlaceholder.fresh(), wildcardType.getContainedType()))); - } - */ } for(Pair pair : reconstructionResult.getConstraints()){ if( ! reconstructionResult.getUnifiedConstraints().contains(pair.TA1)){ - this.genericClassParameters.add(new GenericTypeVar(pair.TA1)); + this.genericClassParameters.add(new GenericTypeVar(pair.TA1,this.getOffset())); } if( ! reconstructionResult.getUnifiedConstraints().contains(pair.TA2)){ - this.genericClassParameters.add(new GenericTypeVar(pair.TA2)); + this.genericClassParameters.add(new GenericTypeVar(pair.TA2, this.getOffset())); } } } - + */ + + public int getOffset(){ + //TODO: richtiges Offset: + return 0; + } + /** * Erstellt einen RefType, welcher auf diese Klasse verweist + * Ersetzt alle Generischen Variablen in der Parameterliste mit TPH * @return */ public RefType getType() { + /* + Vector parameter = new Vector(); + for(Type param : this.get_ParaList()){ + parameter.add(((GenericTypeVar)param).getTypePlaceHolder());//(TypePlaceholder.fresh()); //Hier ist kein ReplacementListener notwendig. Der Typ soll nie eingesetzt werden. Der TPH wird nur gebraucht, damit das Unifizieren funktioniert. + } + */ return new RefType(this.getName(), this.get_ParaList(), 0); } @@ -1257,13 +1278,40 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface * @return */ public TypeAssumptions getPublicFieldAssumptions() { - TypeAssumptions ret = this.getTypeAssumptions(); + TypeAssumptions ret = new TypeAssumptions();//this.getPrivateFieldAssumptions(); + ret.addClassAssumption(new ClassAssumption(this)); + for(Field f : this.getFields()){ + if(f.isPublic())ret.add(f.createTypeAssumptions(this)); + } return ret; } @Override public void parserPostProcessing(SyntaxTreeNode parent) { super.parserPostProcessing(parent); + + //Wenn keine Superklasse, dann erbt die Klasse zwangsweise von Object: + if(superclassid == null || superclassid.get_Name().size()<1){ + int superclassidOffset = superclassid == null ? 0 : superclassid.getOffset(); + superclassid = new UsedId("Object", superclassidOffset); + } + + //Alle Methoden auf Konstruktoren durchsuchen und diese umwandeln: + Vector tempFields = new Vector(); + for(Field f : this.getFields()){ + if(f instanceof Method && !(f instanceof Constructor)){ + Method method = (Method)f; + if(method.get_Method_Name().equals(this.getName()) ){ + tempFields.add(new Constructor(method)); + }else{ + tempFields.add(f); + } + }else{ + tempFields.add(f); + } + } + this.fielddecl = tempFields; + //Prüfen ob ein Konstruktor vorhanden ist: boolean constructorVorhanden = false; for(Field f : this.getFields()){ @@ -1273,13 +1321,15 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface } } if(!constructorVorhanden){//Falls kein Konstruktor vorhanden ist, muss noch der Standardkonstruktor angefügt werden: - - Constructor standardKonstruktor = new Constructor(Method.createEmptyMethod(this.getName(), this)); this.addField(standardKonstruktor); } + + //TODO: Umwandlung zu RefTypes funktioniert noch nicht richtig. (siehe LambdaTest2) + //Als RefType geparste Generische Variablen umwandeln: + this.wandleRefTypeAttributes2GenericAttributes(); } - + @Override public SyntaxTreeNode getParent() { return this; @@ -1302,5 +1352,20 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface return true; } + + @Override + public String getDescription(){ + return "class "+this.getName(); + } + @Override + public int getVariableLength() { + // TODO Auto-generated method stub + return 0; + } + @Override + public void setGenericParameter(Vector params) { + this.genericClassParameters = params; + } + } // ino.end diff --git a/src/mycompiler/myclass/ClassHelper.java b/src/mycompiler/myclass/ClassHelper.java index a4d97f542..4a8b0e642 100755 --- a/src/mycompiler/myclass/ClassHelper.java +++ b/src/mycompiler/myclass/ClassHelper.java @@ -27,6 +27,7 @@ public class ClassHelper */ // ino.end // ino.method.findGenericType.23209.definition + @Deprecated public static GenericTypeVar findGenericType(Type type, Vector paralist, Vector methodParaList) // ino.end // ino.method.findGenericType.23209.body diff --git a/src/mycompiler/myclass/Constant.java b/src/mycompiler/myclass/Constant.java index 86a347bba..f4936a3ea 100755 --- a/src/mycompiler/myclass/Constant.java +++ b/src/mycompiler/myclass/Constant.java @@ -50,10 +50,12 @@ public class Constant extends Method // ino.end // ino.method.Constant.23228.definition + @Deprecated public Constant(String name, Modifiers mod) // ino.end // ino.method.Constant.23228.body { + super(0); //Nur ein Workaraound. Da Constant = Deprecated this.name = name; this.mod = mod; } diff --git a/src/mycompiler/myclass/Constructor.java b/src/mycompiler/myclass/Constructor.java index 767a683f0..0eb22ef34 100644 --- a/src/mycompiler/myclass/Constructor.java +++ b/src/mycompiler/myclass/Constructor.java @@ -15,7 +15,10 @@ import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; import typinferenz.SingleConstraint; +import typinferenz.assumptions.ConstructorAssumption; +import typinferenz.assumptions.MethodAssumption; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; public class Constructor extends Method { private Method methode; @@ -25,10 +28,13 @@ public class Constructor extends Method { * Diese Klasse beherbegt den als Methode geparsten Konstruktor und wandelt sein verhalten zu dem eines Konstruktors ab. */ public Constructor(Method methode){ + super(methode.getOffset()); this.methode = methode; this.setDeclIdVector(methode.getDeclIdVector()); + this.methode.setType(this.methode.getParentClass().getType()); } + @Override public void setGenericMethodParameters( Vector genericMethodParameters) { @@ -51,7 +57,7 @@ public class Constructor extends Method { @Override public String getTypeName() { - return this.methode.getTypeName(); + return this.getType().getName(); } @Override @@ -60,11 +66,7 @@ public class Constructor extends Method { return this.methode.get_Block(); } - @Override - public void setReturnType(Type type) { - - this.methode.setReturnType(type); - } + @Override public void set_Block(Block blo) { @@ -120,12 +122,6 @@ public class Constructor extends Method { this.methode.setOverloadedID(overloadedID); } - @Override - public Type getReturnType() { - - return this.methode.getReturnType(); - } - @Override public String get_codegen_Param_Type(Vector paralist) { @@ -244,10 +240,17 @@ public class Constructor extends Method { @Override public TypeAssumptions createTypeAssumptions(Class classmember) { - - return this.methode.createTypeAssumptions(classmember); + Class parentClass = this.getParentClass(); + TypeAssumptions ret = new TypeAssumptions(); + ret.addAssumption(new ConstructorAssumption(this, parentClass)); + return ret; } + @Override + public SyntaxTreeNode getParent(){ + return this.methode.getParent(); + } + @Override public void parserPostProcessing(SyntaxTreeNode parent) { @@ -262,14 +265,120 @@ public class Constructor extends Method { @Override public void setType(Type t) { - - this.methode.setType(t); + throw new TypeinferenceException("Einem Konstruktor kann kein Typ zugewiesen werden", this); + //this.methode.setType(t); } @Override public Type getType() { - return new RefType(this.methode.getParentClass().getName(),0); + return this.methode.getType(); + } + + + @Override + public boolean equals(Object obj) { + return this.methode.equals(obj); + } + + + @Override + public void set_DeclId(DeclId did) { + this.methode.set_DeclId(did); + } + + + @Override + public Vector get_Name() { + return this.methode.get_Name(); + } + + + @Override + public Vector getDeclIdVector() { + return this.methode.getDeclIdVector(); + } + + + @Override + public void setDeclIdVector(Vector vDeclId) { + this.methode.setDeclIdVector(vDeclId); + } + + + @Override + public String getIdentifier() { + return this.methode.getIdentifier(); + } + + + @Override + public String getDescription() { + return this.methode.getDescription(); + } + + + @Override + public Class getParentClass() { + return this.methode.getParentClass(); } } + +/* +// ino.class.Constructor.23267.declaration +public class Constructor_Backup extends Method +// ino.end +// ino.class.Constructor.23267.body +{ + // ino.method.Constructor.23271.definition + public Constructor_Backup() + // ino.end + // ino.method.Constructor.23271.body + { + this.setParameterList(null); + // #JB# 04.06.2005 + // ########################################################### + DeclId decl = new DeclId(); + decl.set_Name(""); + this.set_DeclId(decl); + // ########################################################### + } + // ino.end + + + + // ino.method.get_codegen_Param_Type.23274.definition + public String get_codegen_Param_Type(Vector paralist) + // ino.end + // ino.method.get_codegen_Param_Type.23274.body + { + String ret = new String(); + if(this.getParameterList() == null) + { + ret += "()"; + } + else + { + ret += this.getParameterList().get_codegen_ParameterList(paralist); + } + ret += "V"; + return ret; + } + // ino.end + + + + // ino.method.codegen.23277.definition + public void codegen(ClassFile classfile, Vector paralist) + throws JVMCodeException + // ino.end + // ino.method.codegen.23277.body + { + classfile.set_constructor_founded(true); + classfile.add_method("", this.get_codegen_Param_Type(paralist), this.getParameterList(), null, get_Block(), declid.firstElement().get_access_flags(), paralist, false); + } + // ino.end + +} +*/ diff --git a/src/mycompiler/myclass/Constructor_Backup.java b/src/mycompiler/myclass/Constructor_Backup.java deleted file mode 100755 index 1969a5056..000000000 --- a/src/mycompiler/myclass/Constructor_Backup.java +++ /dev/null @@ -1,79 +0,0 @@ -// ino.module.Constructor.8557.package -package mycompiler.myclass; -// ino.end -// ino.module.Constructor.8557.import -import java.util.Iterator; -import java.util.Vector; - -import typinferenz.ConstraintsSet; -import typinferenz.assumptions.TypeAssumptions; -import mycompiler.mybytecode.ClassFile; -import mycompiler.myexception.JVMCodeException; -// ino.end -import mycompiler.mytype.TypePlaceholder; -import mycompiler.mytypereconstruction.set.CTypeAssumptionSet; -import mycompiler.mytypereconstruction.typeassumption.CInstVarTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CLocalVarTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CMethodTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption; - - - - -// ino.class.Constructor.23267.declaration -public class Constructor_Backup extends Method -// ino.end -// ino.class.Constructor.23267.body -{ - // ino.method.Constructor.23271.definition - public Constructor_Backup() - // ino.end - // ino.method.Constructor.23271.body - { - this.setParameterList(null); - // #JB# 04.06.2005 - // ########################################################### - DeclId decl = new DeclId(); - decl.set_Name(""); - this.set_DeclId(decl); - // ########################################################### - } - // ino.end - - - - // ino.method.get_codegen_Param_Type.23274.definition - public String get_codegen_Param_Type(Vector paralist) - // ino.end - // ino.method.get_codegen_Param_Type.23274.body - { - String ret = new String(); - if(this.getParameterList() == null) - { - ret += "()"; - } - else - { - ret += this.getParameterList().get_codegen_ParameterList(paralist); - } - ret += "V"; - return ret; - } - // ino.end - - - - // ino.method.codegen.23277.definition - public void codegen(ClassFile classfile, Vector paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.23277.body - { - classfile.set_constructor_founded(true); - classfile.add_method("", this.get_codegen_Param_Type(paralist), this.getParameterList(), null, get_Block(), declid.firstElement().get_access_flags(), paralist, false); - } - // ino.end - -} -// ino.end diff --git a/src/mycompiler/myclass/Field.java b/src/mycompiler/myclass/Field.java index 552b4f847..234864039 100644 --- a/src/mycompiler/myclass/Field.java +++ b/src/mycompiler/myclass/Field.java @@ -5,7 +5,10 @@ import java.util.Vector; import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.myexception.JVMCodeException; +import mycompiler.mytype.GenericTypeVar; +import mycompiler.mytype.RefType; import mycompiler.mytype.Type; +import mycompiler.mytype.TypePlaceholder; import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent; import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; @@ -13,8 +16,9 @@ import typinferenz.ResultSet; import typinferenz.Typeable; import typinferenz.TypeInsertable; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.typedeployment.TypeInsertPoint; -public abstract class Field extends SyntaxTreeNode implements TypeInsertable, Typeable{ +public abstract class Field extends SyntaxTreeNode implements TypeInsertable, Typeable, Generic{ protected Vector declid = new Vector(); // Vector, da 'int a, b, c, ...' auch eingeparst werden muss @@ -22,6 +26,10 @@ public abstract class Field extends SyntaxTreeNode implements TypeInsertable, Ty private int offset; + public Field(int offset){ + this.offset = offset; + } + @Override public void setOffset(int offset){ this.offset = offset; @@ -86,4 +94,40 @@ public abstract class Field extends SyntaxTreeNode implements TypeInsertable, Ty public String getIdentifier() { return this.get_Name().firstElement().get_Name(); } + + @Override + public String getDescription(){ + return this.getIdentifier(); + } + + @Override + public TypeInsertPoint createTypeInsertPoint(TypePlaceholder tph, + ResultSet resultSet) { + return new TypeInsertPoint(this, resultSet.getTypeEqualTo(tph), resultSet); + } + + /** + * Wird im Zuge des ParserPostProcessing aufgerufen. + * Der Parser kann den Unterschied zwischen einem RefType und einer GTV nicht erkennen. + * Diese Methode ersetzt die RefTypes gegebenenfalls durch eine GTV. + * @param paralist + */ + public void wandleRefTypeAttributes2GenericAttributes(Vector paralist){ + // Zuerst Returntype untersuchen + Type type=getType(); + Type pendantReturnType = null; + if(type instanceof RefType)pendantReturnType = ((RefType)type).findGenericType(paralist, new Vector());//GenericTypeVar pendantReturnType=ClassHelper.findGenericType(type, paralist,new Vector()); + if(pendantReturnType!=null){ //Wenn generisch, dann modifizieren + setType(pendantReturnType); + } + } + + public boolean isPublic() { + //TODO: momentan ist jedes Feld public! + return true; + } + + + + } diff --git a/src/mycompiler/myclass/FieldDecl.java b/src/mycompiler/myclass/FieldDecl.java deleted file mode 100755 index d994b5679..000000000 --- a/src/mycompiler/myclass/FieldDecl.java +++ /dev/null @@ -1,95 +0,0 @@ -// ino.module.FieldDecl.8560.package -package mycompiler.myclass; -// ino.end -// ino.module.FieldDecl.8560.import -import java.util.Vector; - -import typinferenz.JavaCodeResult; -import typinferenz.ResultSet; -import typinferenz.Typeable; -import typinferenz.TypeInsertable; -import typinferenz.assumptions.TypeAssumptions; -import mycompiler.mybytecode.ClassFile; -import mycompiler.myexception.JVMCodeException; -// ino.end -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 -// ino.class.FieldDecl.23367.body -{ - // ino.attribute.declid.23370.declaration - protected Vector declid = new Vector(); // Vector, da 'int a, b, c, ...' auch eingeparst werden muss - - // ino.end - // ino.method.getTypeName.23373.declaration - public abstract String getTypeName(); - // ino.end - - - - // 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); - -} -// ino.end diff --git a/src/mycompiler/myclass/FieldDeclaration.java b/src/mycompiler/myclass/FieldDeclaration.java index 70edf82f5..667e9dfb8 100644 --- a/src/mycompiler/myclass/FieldDeclaration.java +++ b/src/mycompiler/myclass/FieldDeclaration.java @@ -7,11 +7,15 @@ import typinferenz.JavaCodeResult; import typinferenz.OderConstraint; import typinferenz.ResultSet; import typinferenz.SingleConstraint; +import typinferenz.assumptions.FieldAssumption; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.myexception.JVMCodeException; import mycompiler.mystatement.Expr; +import mycompiler.mytype.GenericTypeVar; +import mycompiler.mytype.RefType; import mycompiler.mytype.Type; import mycompiler.mytype.TypePlaceholder; import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent; @@ -26,6 +30,21 @@ public class FieldDeclaration extends Field{ private Expr wert; //private Type type; + private Vector parameter; + + /** + * Dieser Konstruktor der FieldDeclaration erstellt den Syntaxknoten vollständig. + * Kein nachträgliches hinzfügen von Informationen oder aufrufen von parserPostProcessing ist notwendig. + */ + public FieldDeclaration(String name, Type typ){ + super(0);//Dieser Deklarator wird nicht vom Parser aufgerufen. Dadurch gibt es auch keinen Offset + this.setType(typ); + this.set_DeclId(new DeclId(name)); + } + + public FieldDeclaration(int offset){ + super(offset); + } public void setWert(Expr initialExpression){ this.wert = initialExpression; @@ -48,7 +67,8 @@ public class FieldDeclaration extends Field{ @Override public String toString() { - return super.toString() + "=" + getWert().toString(); + if(getWert()!=null)return super.toString() + "=" + getWert().toString(); + return super.toString(); } @@ -68,18 +88,19 @@ public class FieldDeclaration extends Field{ ////////////////////////////// TypeAssumptions assumptions = new TypeAssumptions(); /* - * TODO: Der Feld-Assumption muss ein TPH als Typ hinzugefügt werden, falls er Typlos initialisiert wurde. Dies kann auch der Type-Algorithmus der Inst/FieldVar - Klasse machen. + * Der Feld-Assumption muss ein TPH als Typ hinzugefügt werden, falls er Typlos initialisiert wurde. Dies kann auch der Type-Algorithmus der Inst/FieldVar - Klasse machen. * Wird das Feld mit einem Typ initialisiert so muss dieser auch in die Assumptions. */ - if(this.getType() == null)this.setType(TypePlaceholder.fresh(this)); + if(this.getType() == null)throw new TypeinferenceException("Der Typ eines Feldes darf nicht null sein", this); //assumptions.add(TypeAssumptions.createFieldVarAssumption(classmember.getName(), this.getName(), this.getType())); - + assumptions.addAssumption(new FieldAssumption(this,classmember)); return assumptions; } @Override public void parserPostProcessing(SyntaxTreeNode parent){ super.parserPostProcessing(parent); + if(this.getType() == null)this.setType(TypePlaceholder.fresh(this)); } @@ -108,6 +129,24 @@ public class FieldDeclaration extends Field{ @Override public ConstraintsSet TYPE(TypeAssumptions publicAssumptions) { ConstraintsSet ret = new ConstraintsSet(); + /* + if(this.getType() instanceof GenericTypeVar){ + //Falls Typ ein GTV ist muss er syntaktisch kontrolliert werden... + GenericTypeVar gtv = (GenericTypeVar) this.getType(); + } + */ + + //TypeCheck, falls es sich um einen RefType handelt: + this.getType().checkType(publicAssumptions, this); + /* + if(this.getType()!=null && (this.getType() instanceof RefType)){ + Type replaceType = null; + replaceType = publicAssumptions.getTypeFor((RefType)this.getType()); + if(replaceType == null)throw new TypeinferenceException("Der Typ "+this.getType().getName()+" ist nicht korrekt",this); + this.setType(replaceType); + } + */ + SingleConstraint c1 = new SingleConstraint(this.getType(), this.getType()); ret.add(c1); //Damit die TypVariable des Felds in den Constraints auftaucht @@ -119,6 +158,15 @@ public class FieldDeclaration extends Field{ return ret; } + @Override + public void wandleRefTypeAttributes2GenericAttributes(Vector paralist){ + super.wandleRefTypeAttributes2GenericAttributes(paralist); + if(this.getWert()!=null)this.getWert().wandleRefTypeAttributes2GenericAttributes(paralist, new Vector()); //FieldDeclaration hat keine Generischen Variablen, daher leere Liste übergeben + } + @Override + public void setGenericParameter(Vector params) { + this.parameter = params; + } } diff --git a/src/mycompiler/myclass/FieldInitialization.java b/src/mycompiler/myclass/FieldInitialization.java deleted file mode 100755 index 39779a2c8..000000000 --- a/src/mycompiler/myclass/FieldInitialization.java +++ /dev/null @@ -1,87 +0,0 @@ -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.mytype.TypePlaceholder; -import mycompiler.mytypereconstruction.typeassumption.CInstVarTypeAssumption; - -@Deprecated -public class FieldInitialization extends InstVarDecl { - - - private Expr wert; - //private Type type; - - public void setWert(Expr initialExpression){ - this.wert = initialExpression; - } - public Expr getWert(){ - return this.wert; - } - - public String getIdentifier(){ - return this.getIdentifier().elementAt(0).name; - } - - - @Override - public String getTypeName() { - // TODO Auto-generated method stub - return null; - } - - - @Override - public void codegen(ClassFile classfile, Vector paralist) - throws JVMCodeException { - // TODO Auto-generated method stub - - } - /* - public Type getType() { - return this.type; - } - public void setType(Type type) { - this.type = type; - } - */ - - @Override - public String toString() - { - return super.toString() + "=" + getWert().toString(); - } - - - public JavaCodeResult printJavaCode(ResultSet resultSet) { - JavaCodeResult ret = new JavaCodeResult(); - ret.attach(this.getType().printJavaCode(resultSet)).attach( " ").attach( this.getName()+" = ").attach(this.getWert().printJavaCode(resultSet) ).attach( ";"); - - return ret; - } - - @Override - public TypeAssumptions createTypeAssumptions(Class classmember) { - ////////////////////////////// - //Felder: - ////////////////////////////// - - TypeAssumptions assumptions = new TypeAssumptions(); - /* - * TODO: Der Feld-Assumption muss ein TPH als Typ hinzugefügt werden, falls er Typlos initialisiert wurde. Dies kann auch der Type-Algorithmus der Inst/FieldVar - Klasse machen. - * Wird das Feld mit einem Typ initialisiert so muss dieser auch in die Assumptions. - */ - if(this.getType() == null)this.setType(TypePlaceholder.fresh(this)); - assumptions.add(TypeAssumptions.createFieldVarAssumption(classmember.getName(), this.getName(), this.getType())); - classmember.get_ClassBody().addField(this); - return assumptions; - } - -} diff --git a/src/mycompiler/myclass/FormalParameter.java b/src/mycompiler/myclass/FormalParameter.java index 2244e00e5..f30a394c6 100755 --- a/src/mycompiler/myclass/FormalParameter.java +++ b/src/mycompiler/myclass/FormalParameter.java @@ -3,6 +3,9 @@ package mycompiler.myclass; // ino.end // ino.module.FormalParameter.8561.import +import java.util.Vector; + +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mytype.Type; @@ -16,14 +19,27 @@ import org.apache.log4j.Logger; + + + + + + + + + + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; import typinferenz.Typeable; import typinferenz.TypeInsertable; +import typinferenz.exceptions.TypeinferenceException; +import typinferenz.typedeployment.TypeInsertPoint; +import typinferenz.typedeployment.TypeInsertSet; // ino.class.FormalParameter.23391.declaration -public class FormalParameter implements ITypeReplacementListener, Typeable, TypeInsertable +public class FormalParameter extends SyntaxTreeNode implements ITypeReplacementListener, Typeable, TypeInsertable // ino.end // ino.class.FormalParameter.23391.body { @@ -37,9 +53,25 @@ public class FormalParameter implements ITypeReplacementListener, Typeable, Type protected static Logger inferencelog = Logger.getLogger("inference"); // ino.end + public FormalParameter(DeclId name){ + this.set_DeclId(name); + } - // ino.method.setType.23404.defdescription type=javadoc + @Override + public boolean equals(Object object) { + if(!super.equals(object))return false; + if(!(object instanceof FormalParameter))return false; + FormalParameter equals = (FormalParameter)object; + if((this.type==null)!=(equals.type == null))return false; + if(this.type != null){ + return this.type.equals(equals.type); + } + return true; + } + + + // ino.method.setType.23404.defdescription type=javadoc /** *
Author: J�rg B�uerle * @param t @@ -68,6 +100,7 @@ public class FormalParameter implements ITypeReplacementListener, Typeable, Type // ino.end // ino.method.set_DeclId.23407.body { + if(did == null)throw new NullPointerException(); this.declid = did; } // ino.end @@ -100,7 +133,7 @@ public class FormalParameter implements ITypeReplacementListener, Typeable, Type public String getTypeName() // ino.end // ino.method.getTypeName.23416.body - { + { if(this.getType() == null)return ""; return this.getType().getName(); } // ino.end @@ -206,6 +239,8 @@ public class FormalParameter implements ITypeReplacementListener, Typeable, Type + + @Override public void setOffset(int offset) { //Das Offset steht in declId @@ -213,5 +248,50 @@ public class FormalParameter implements ITypeReplacementListener, Typeable, Type } + + @Override + public Vector getChildren() { + return new Vector(); + } + + + @Override + public void parserPostProcessing(SyntaxTreeNode parent) { + super.parserPostProcessing(parent); + if(this.type==null)this.type = TypePlaceholder.fresh(this); + } + + + @Override + public TypeInsertPoint createTypeInsertPoint(TypePlaceholder tph, + ResultSet resultSet) { + if(this.getOffset()<=0)return null; + Type t = resultSet.getTypeEqualTo(tph); + return new TypeInsertPoint(this, t, resultSet); + } + + + @Override + public int getVariableLength() { + int ret = 0; + ret += this.getTypeName().length(); + ret +=this.getIdentifier().length(); + return ret; + } + + + public DeclId getDeclId() { + return this.declid; + } + + @Override + public String getDescription() { + String ret = ""; + if(this.getType() != null && !(this.getType() instanceof TypePlaceholder)){ + ret += this.getType().getName() + " "; + } + return ret+this.getIdentifier(); + } + } // ino.end diff --git a/src/mycompiler/myclass/Generic.java b/src/mycompiler/myclass/Generic.java new file mode 100644 index 000000000..3c569b98e --- /dev/null +++ b/src/mycompiler/myclass/Generic.java @@ -0,0 +1,15 @@ +package mycompiler.myclass; + +import java.util.Vector; + +import mycompiler.mytype.GenericTypeVar; + +/** + * Wird von allen Klassen implementiert, welche generische Parameter halten können. (Class, Method und Field) + * @author janulrich + * + */ +public interface Generic { + public void setGenericParameter(Vector params); + //public int getGenericParameterOffset(); +} diff --git a/src/mycompiler/myclass/Method.java b/src/mycompiler/myclass/Method.java index f2465cc48..961dc25a5 100755 --- a/src/mycompiler/myclass/Method.java +++ b/src/mycompiler/myclass/Method.java @@ -38,7 +38,10 @@ import typinferenz.ConstraintsSet; import typinferenz.ResultSet; import typinferenz.TypeInsertable; import typinferenz.assumptions.MethodAssumption; +import typinferenz.assumptions.ParameterAssumption; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; +import typinferenz.typedeployment.TypeInsertPoint; @@ -50,7 +53,7 @@ import typinferenz.assumptions.TypeAssumptions; * @author janulrich * */ -public class Method extends Field implements ITypeReplacementListener, IItemWithOffset, TypeInsertable +public class Method extends Field implements IItemWithOffset, TypeInsertable // ino.end // ino.class.Method.23482.body { @@ -58,7 +61,7 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith private Block block; // ino.end // ino.attribute.parameterlist.23491.declaration - public ParameterList parameterlist = null; + public ParameterList parameterlist = new ParameterList(); // ino.end // ino.attribute.exceptionlist.23494.declaration private ExceptionList exceptionlist; @@ -99,6 +102,10 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith protected static Logger parserlog = Logger.getLogger("parser"); // ino.end + public Method(int offset){ + super(offset); + } + // ino.method.setGenericMethodParameters.23521.definition public void setGenericMethodParameters(Vector genericMethodParameters) // ino.end @@ -168,10 +175,10 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith // ino.end // ino.method.getTypeName.23533.body { - if( this.getReturnType() == null ) + if( this.getType() == null ) return null; else - return this.getReturnType().getName(); + return this.getType().getName(); } // ino.end @@ -191,7 +198,7 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith */ // ino.end // ino.method.setReturnType.23539.definition - public void setReturnType(Type type) + private void setReturnType(Type type) // ino.end // ino.method.setReturnType.23539.body { @@ -301,20 +308,7 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith } // ino.end - /** - * Liefert den Return Type der Methode. - * Dieser entspricht dem Returntype des Methoden-Block's - * @returnb - */ - // ino.method.getReturnType.23569.definition - public Type getReturnType() - // ino.end - // ino.method.getReturnType.23569.body - { - return this.returntype; //auskommentiert von Andreas Stadelmeier (a10023) - } - // ino.end - + // ino.method.get_codegen_Param_Type.23572.definition @@ -331,13 +325,13 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith { ret += this.getParameterList().get_codegen_ParameterList(paralist); } - if(this.getReturnType() == null) + if(this.getType() == null) { ret += "V"; } else { - ret += this.getReturnType().get_codegen_Type(paralist); + ret += this.getType().get_codegen_Type(paralist); } return ret; } @@ -372,7 +366,7 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith // ino.end // ino.method.codegen.23581.body { - classfile.add_method(declid.firstElement().get_Name(), this.get_codegen_Param_Type(paralist), this.getParameterList(), this.getReturnType(), block, declid.firstElement().get_access_flags(), paralist, isAbstract); + classfile.add_method(declid.firstElement().get_Name(), this.get_codegen_Param_Type(paralist), this.getParameterList(), this.getType(), block, declid.firstElement().get_access_flags(), paralist, isAbstract); } // ino.end @@ -472,7 +466,7 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith // ino.end // ino.method.toString.23605.body { - return this.getReturnType() + " " + block.toString(); + return this.getType() + " "+ this.get_Name() +( (block!=null)?block.toString():""); } // ino.end @@ -504,15 +498,19 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith { return isAbstract; } - // ino.end - // ino.method.wandleRefTypeAttributes2GenericAttributes.23614.definition - public void wandleRefTypeAttributes2GenericAttributes(Vector paralist) - // ino.end - // ino.method.wandleRefTypeAttributes2GenericAttributes.23614.body + + @Override + public void wandleRefTypeAttributes2GenericAttributes(Vector classParalist) { + Vector paralist = new Vector();//Mit den Generischen Typen der Methode + paralist.addAll(classParalist); + paralist.addAll(this.genericMethodParameters); + // Zuerst Returntype untersuchen - Type returnType=getReturnType(); - GenericTypeVar pendantReturnType=ClassHelper.findGenericType(returnType, paralist,genericMethodParameters); + Type returnType=getType(); + Type pendantReturnType = null; + if(returnType instanceof RefType)pendantReturnType = ((RefType)returnType).findGenericType(paralist, new Vector()); + //GenericTypeVar pendantReturnType=ClassHelper.findGenericType(returnType, paralist,genericMethodParameters); if(pendantReturnType!=null){ //Wenn generisch, dann modifizieren setReturnType(pendantReturnType); } @@ -522,7 +520,9 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith FormalParameter fp=parameterlist.formalparameter.get(par); Type fpType=fp.getType(); // Nur wenn es sich um ein RefType-Field handelt - GenericTypeVar pendantPara=ClassHelper.findGenericType(fpType,paralist,genericMethodParameters); + Type pendantPara = null; + if(fpType instanceof RefType)pendantPara = ((RefType)fpType).findGenericType(paralist, new Vector()); + //GenericTypeVar pendantPara=ClassHelper.findGenericType(fpType,paralist,genericMethodParameters); if(pendantPara!=null){ //Wenn generisch, dann modifizieren fp.setType(pendantPara); } @@ -547,8 +547,42 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith public ConstraintsSet TYPE(TypeAssumptions ass) { ConstraintsSet ret = new ConstraintsSet(); + TypeAssumptions localAss = new TypeAssumptions(); + localAss.add(ass); //Die globalen Assumptions anhängen + //Generische Parameterdeklarationen den Assumptions anfügen: + for(GenericTypeVar gtv : this.genericMethodParameters){ + ret.add(gtv.TYPE(localAss)); + } - ret.add(this.block.TYPEStmt(ass)); + //TypeCheck, falls es sich um einen RefType handelt: + this.returntype = this.returntype.checkType(localAss, this); + /* + if(this.returntype!=null && (this.returntype instanceof RefType)&& + !(this.returntype instanceof mycompiler.mytype.Void)){//Sonderfall der Methode: Ihr Typ darf Void definiert werden. + Type replaceType = null; + replaceType = ass.getTypeFor((RefType)this.returntype); + if(replaceType == null)throw new TypeinferenceException("Der Typ "+this.getType().getName()+" ist nicht korrekt",this); + this.returntype = replaceType; + } + */ + //Die Parameter zu den Assumptions hinzufügen: + if(this.parameterlist!=null)for(FormalParameter param : this.parameterlist){ + + param.setType(param.getType().checkType(localAss, this)); + /* + if(param.getType() instanceof RefType) + { + Type replaceType = null; + replaceType = ass.getTypeFor((RefType)param.getType()); + if(replaceType == null) + throw new TypeinferenceException("Der Typ "+param.getType().getName()+" ist nicht korrekt",param); + param.setType(replaceType); + } + */ + + localAss.addAssumption(new ParameterAssumption(param)); + } + ret.add(this.block.TYPEStmt(localAss)); //eine Verknüpfung mit der Type Assumption aus dem Assumption Set und dem ermittelten Typ der Methode: ret.add(new SingleConstraint(this.block.getType(), this.returntype)); return ret; @@ -560,28 +594,31 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith */ public String getTypeInformation(){ if(this.parameterlist!=null)return "Methode "+this.get_Name()+ " Parameter: "+this.parameterlist.getTypeInformation()+", Block: "+this.block.getTypeInformation(); - return "Methode "+this.get_Name()+" : "+this.getReturnType()+", Block: "+this.block.getTypeInformation(); + return "Methode "+this.get_Name()+" : "+this.getType()+", Block: "+this.block.getTypeInformation(); } @Override public JavaCodeResult printJavaCode(ResultSet resultSet) { JavaCodeResult ret = new JavaCodeResult(); - ret.attach(this.getReturnType().printJavaCode(resultSet)).attach(" ").attach(this.get_Method_Name()).attach("()\n"); //TODO: hier müssen auch noch die Parameter ausgegeben werden! + ret.attach(this.getType().printJavaCode(resultSet)).attach(" ").attach(this.get_Method_Name()).attach("(").attach(this.getParameterList().printJavaCode(resultSet)).attach(")\n"); ret.attach(this.block.printJavaCode(resultSet)); return ret; } + /** + * Liefert die MethodAssumption zu dieser Methode + */ @Override public TypeAssumptions createTypeAssumptions(Class classmember) { Class parentClass = this.getParentClass(); TypeAssumptions ret = new TypeAssumptions(); - ret.addMethodAssumption(new MethodAssumption(this, parentClass)); + ret.addAssumption(new MethodAssumption(this, parentClass)); return ret; /* TypeAssumptions assumptions = new TypeAssumptions(); this.assumedType = null; - //if((this.get_Method_Name().equals(classmember.getName()) || this.get_Method_Name().equals("")) && ((this.getReturnType().equals(new mycompiler.mytype.Void(0))) || this.getReturnType() instanceof TypePlaceholder)){ + //if((this.get_Method_Name().equals(classmember.getName()) || this.get_Method_Name().equals("")) && ((this.getType().equals(new mycompiler.mytype.Void(0))) || this.getType() instanceof TypePlaceholder)){ if((this.get_Method_Name().equals(classmember.getName()) || this.get_Method_Name().equals(""))) { this.set_Method_Name(""); this.assumedType = new RefType(classmember.getName(),0); @@ -609,7 +646,7 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith //methodList.addElement(method); //F�r V_fields_methods: - CMethodTypeAssumption methodAssum = new CMethodTypeAssumption(classmember.getType(), this.get_Method_Name(), this.getReturnType(), this.getParameterCount(),this.getLineNumber(),this.getOffset(),new Vector(),this.getGenericMethodParameters()); // Typannahme bauen... + CMethodTypeAssumption methodAssum = new CMethodTypeAssumption(classmember.getType(), this.get_Method_Name(), this.getType(), this.getParameterCount(),this.getLineNumber(),this.getOffset(),new Vector(),this.getGenericMethodParameters()); // Typannahme bauen... //Methode in V_Fields_methods ablegen @@ -669,8 +706,11 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith @Override public Vector getChildren() { - Vector ret = super.getChildren(); + Vector ret = new Vector(); ret.add(this.block); + for(FormalParameter param : this.parameterlist){ + ret.add(param); + } return ret; } @@ -681,6 +721,9 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith this.returntype = t; } + /** + * Der Typ einer Methode ist ihr Returntype + */ @Override public Type getType(){ //Methode und Block teilen sich einen ReturnType: @@ -688,17 +731,32 @@ public class Method extends Field implements ITypeReplacementListener, IItemWith } public static Method createEmptyMethod(String withSignature, Class parent){ - Method ret = new Method(); + Method ret = new Method(0); DeclId DImethod = new DeclId(); DImethod.set_Name(withSignature); ret.set_DeclId(DImethod); Block tempBlock = new Block(); //tempBlock.setType(new RefType(parent.getName(),0)); ret.set_Block(tempBlock); - ret.setType(TypePlaceholder.fresh(ret)); - ret.parent = parent; + ret.parserPostProcessing(parent); return ret; } + @Override + public boolean equals(Object obj){ + if(!(obj instanceof Method))return false; + Method equals = (Method) obj; + if((this.returntype!=null && equals.returntype==null))return false; + if((this.returntype==null && equals.returntype!=null))return false; + if(this.returntype!=null && equals.returntype!=null)if(!this.returntype.equals(equals.returntype))return false; + if(!this.parameterlist.equals(equals.parameterlist))return false; + return super.equals(obj); + } + + @Override + public void setGenericParameter(Vector params) { + this.genericMethodParameters = params; + } + } // ino.end diff --git a/src/mycompiler/myclass/ParameterList.java b/src/mycompiler/myclass/ParameterList.java index 6a7b49528..ee4e75bf9 100755 --- a/src/mycompiler/myclass/ParameterList.java +++ b/src/mycompiler/myclass/ParameterList.java @@ -3,11 +3,13 @@ package mycompiler.myclass; // ino.end // ino.module.ParameterList.8565.import import java.util.Vector; + import typinferenz.JavaCodeResult; import typinferenz.ResultSet; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mytype.*; + import java.util.Iterator; // ino.end @@ -16,7 +18,7 @@ import java.util.Iterator; // ino.class.ParameterList.23620.declaration -public class ParameterList +public class ParameterList implements Iterable // ino.end // ino.class.ParameterList.23620.body { @@ -37,7 +39,10 @@ public class ParameterList - // ino.method.get_codegen_ParameterList.23629.definition + + + + // ino.method.get_codegen_ParameterList.23629.definition public String get_codegen_ParameterList(Vector paralist) // ino.end // ino.method.get_codegen_ParameterList.23629.body @@ -146,5 +151,20 @@ public class ParameterList return ret; } + + + @Override + public Iterator iterator() { + return this.formalparameter.iterator(); + } + + @Override + public boolean equals(Object obj) { + if(!(obj instanceof ParameterList))return false; + ParameterList equals = (ParameterList)obj; + if((this.formalparameter == null )!=(equals.formalparameter==null))return false; + if(this.formalparameter!=null)return this.formalparameter.equals(equals.formalparameter); + return true; + } } // ino.end diff --git a/src/mycompiler/myclass/UsedId.java b/src/mycompiler/myclass/UsedId.java index a16db852a..b367580e5 100755 --- a/src/mycompiler/myclass/UsedId.java +++ b/src/mycompiler/myclass/UsedId.java @@ -7,7 +7,7 @@ import java.util.Vector; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; -import typinferenz.TypinferenzException; +import typinferenz.exceptions.TypeinferenceException; import mycompiler.IItemWithOffset; import mycompiler.mybytecode.JVMCode; import mycompiler.mytype.Type; @@ -312,7 +312,7 @@ public class UsedId implements IItemWithOffset // ino.end public JavaCodeResult printJavaCode(ResultSet resultSet) { - if(this.name.size()>1)throw new TypinferenzException("Es kann maximal nur eine Superklasse pro Klasse geben"); + if(this.name.size()>1)throw new TypeinferenceException("Es kann maximal nur eine Superklasse pro Klasse geben", this); JavaCodeResult ret = new JavaCodeResult(this.getQualifiedName()); if(this.paralist != null){ ret.attach( "<" ); diff --git a/src/mycompiler/myinterface/Interface.java b/src/mycompiler/myinterface/Interface.java index 3005d2742..5394d0706 100755 --- a/src/mycompiler/myinterface/Interface.java +++ b/src/mycompiler/myinterface/Interface.java @@ -7,6 +7,7 @@ import java.util.Vector; import mycompiler.AClassOrInterface; import mycompiler.mybytecode.ClassFile; +import mycompiler.myclass.Class; import mycompiler.myclass.ClassHelper; import mycompiler.myclass.Constant; import mycompiler.myclass.FormalParameter; @@ -27,12 +28,46 @@ import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption; import mycompiler.SourceFile; // ino.end +/** + * Ein Interface ist eine abstrakte Klasse, erbt daher von Class + * @author janulrich + * + */ +public class Interface extends Class { + + public Interface(String name){ + super(name); + } + + public Interface(String name, Modifiers modifiers) { + super(name,modifiers); + } + + public Vector getParaList() { + // TODO Auto-generated method stub + return null; + } + + public void setInterfaceBody(InterfaceBody interfaceBody) { + // TODO Auto-generated method stub + + } + + public void setParaList(Vector paraVector) { + // TODO Auto-generated method stub + + } + + +} + // ino.class.Interface.23932.description type=javadoc /** * Die Klasse stellt die Definition eines Interfaces dar. * @author SCJU * */ +/* // ino.end // ino.class.Interface.23932.declaration public class Interface implements AClassOrInterface @@ -85,23 +120,7 @@ public class Interface implements AClassOrInterface } // ino.end - - // ino.method.getParaList.23954.defdescription type=block - /*public Vector complete_paralist(boolean ext) - { - - Diese Funktion vervollt�ndigt die Parameterliste f�r vererbte Klassen - Vector child = paralist; - - paralist = (Vector)superclassid.get_ParaList(); - - for(Enumeration e = child.elements();e.hasMoreElements();){ - paralist.addElement(e.nextElement()); - } - - return this.paralist; - }*/ - // ino.end + @@ -209,12 +228,6 @@ public class Interface implements AClassOrInterface } // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.23981.defdescription type=javadoc - /** - * Alle RefTypes, die hier im Interface definiert sind - * bspw: E doSomething() - * und eigentlich Generics sind werden zu generics gewandelt - * - */ // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.23981.definition public void wandleRefTypeAttributes2GenericAttributes() @@ -255,3 +268,4 @@ public class Interface implements AClassOrInterface } // ino.end +*/ \ No newline at end of file diff --git a/src/mycompiler/myinterface/InterfaceBody.java b/src/mycompiler/myinterface/InterfaceBody.java index 54d904eaa..35123ef21 100755 --- a/src/mycompiler/myinterface/InterfaceBody.java +++ b/src/mycompiler/myinterface/InterfaceBody.java @@ -9,7 +9,6 @@ import mycompiler.myclass.Field; import mycompiler.mybytecode.ClassFile; import mycompiler.myclass.Constant; -import mycompiler.myclass.FieldDecl; import mycompiler.myclass.Method; import mycompiler.myexception.JVMCodeException; import mycompiler.mymodifier.Modifiers; diff --git a/src/mycompiler/myoperator/AddOp.java b/src/mycompiler/myoperator/AddOp.java index 0a4fc88cf..e81767423 100755 --- a/src/mycompiler/myoperator/AddOp.java +++ b/src/mycompiler/myoperator/AddOp.java @@ -2,17 +2,25 @@ package mycompiler.myoperator; // ino.end // ino.module.AddOp.8594.import +import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; + +import typinferenz.ConstraintsSet; +import typinferenz.SingleConstraint; +import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.DebugException; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.myexception.CTypeReconstructionException; import mycompiler.myexception.JVMCodeException; import mycompiler.mystatement.Binary; import mycompiler.mystatement.Expr; +import mycompiler.mytype.IntegerType; import mycompiler.mytype.Pair; import mycompiler.mytype.RefType; +import mycompiler.mytype.Type; import mycompiler.mytypereconstruction.CSupportData; import mycompiler.mytypereconstruction.CTriple; import mycompiler.mytypereconstruction.set.CSubstitutionSet; @@ -56,5 +64,17 @@ public abstract class AddOp extends Operator return types; } + @Override + public HashMap getReturnTypes(TypeAssumptions ass) { + HashMap ret = new HashMap(); + ret.put(ass.getTypeFor(new RefType("java.lang.Integer",-1)), ass.getTypeFor(new RefType("java.lang.Integer",-1))); + ret.put(ass.getTypeFor(new RefType("java.lang.Double",-1)), ass.getTypeFor(new RefType("java.lang.Double",-1))); + ret.put(ass.getTypeFor(new RefType("java.lang.Float",-1)), ass.getTypeFor(new RefType("java.lang.Float",-1))); + ret.put(ass.getTypeFor(new RefType("java.lang.Long",-1)), ass.getTypeFor(new RefType("java.lang.Long",-1))); + ret.put(ass.getTypeFor(new RefType("java.lang.String",-1)), ass.getTypeFor(new RefType("java.lang.String",-1))); + + return ret; + } + } // ino.end diff --git a/src/mycompiler/myoperator/AndOp.java b/src/mycompiler/myoperator/AndOp.java index ef7b80d9a..91926d7d1 100755 --- a/src/mycompiler/myoperator/AndOp.java +++ b/src/mycompiler/myoperator/AndOp.java @@ -1,5 +1,13 @@ // ino.module.AndOp.8595.package package mycompiler.myoperator; + +import mycompiler.mystatement.Expr; +import mycompiler.mytype.BooleanType; +import mycompiler.mytype.IntegerType; +import mycompiler.mytype.Type; +import typinferenz.ConstraintsSet; +import typinferenz.SingleConstraint; +import typinferenz.assumptions.TypeAssumptions; // ino.end // ino.class.AndOp.24101.declaration @@ -16,5 +24,7 @@ public class AndOp extends LogOp super(offset,variableLength); } // ino.end + + } // ino.end diff --git a/src/mycompiler/myoperator/LogOp.java b/src/mycompiler/myoperator/LogOp.java index 4d3c4203e..c59fc4c82 100755 --- a/src/mycompiler/myoperator/LogOp.java +++ b/src/mycompiler/myoperator/LogOp.java @@ -2,9 +2,15 @@ package mycompiler.myoperator; // ino.end // ino.module.LogOp.8602.import +import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; + +import typinferenz.ConstraintsSet; +import typinferenz.SingleConstraint; +import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.DebugException; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -15,8 +21,10 @@ import mycompiler.mystatement.Expr; import mycompiler.mystatement.NotExpr; import mycompiler.mystatement.Null; import mycompiler.mystatement.Statement; +import mycompiler.mytype.BooleanType; import mycompiler.mytype.Pair; import mycompiler.mytype.RefType; +import mycompiler.mytype.Type; import mycompiler.mytypereconstruction.CSupportData; import mycompiler.mytypereconstruction.CTriple; import mycompiler.mytypereconstruction.set.CSubstitutionSet; @@ -226,6 +234,13 @@ public abstract class LogOp extends Operator return types; } - + @Override + public HashMap getReturnTypes(TypeAssumptions ass) { + HashMap ret = new HashMap(); + ret.put(ass.getTypeFor(new RefType("java.lang.Boolean",-1)), ass.getTypeFor(new RefType("java.lang.Boolean",-1))); + + return ret; + } + } // ino.end diff --git a/src/mycompiler/myoperator/MulOp.java b/src/mycompiler/myoperator/MulOp.java index 2007040ee..8781b4a6d 100755 --- a/src/mycompiler/myoperator/MulOp.java +++ b/src/mycompiler/myoperator/MulOp.java @@ -3,13 +3,18 @@ package mycompiler.myoperator; // ino.end // ino.module.MulOp.8605.import +import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; + +import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.DebugException; import mycompiler.myexception.CTypeReconstructionException; import mycompiler.mystatement.Binary; import mycompiler.mytype.Pair; import mycompiler.mytype.RefType; +import mycompiler.mytype.Type; import mycompiler.mytypereconstruction.CSupportData; import mycompiler.mytypereconstruction.CTriple; import mycompiler.mytypereconstruction.set.CSubstitutionSet; @@ -36,13 +41,20 @@ public abstract class MulOp extends Operator protected Hashtable getOperatorTypes() { Hashtable types = new Hashtable(); - types.put(new RefType("java.lang.Integer",-1), new RefType("java.lang.Integer",-1)); - types.put(new RefType("java.lang.Double",-1), new RefType("java.lang.Double",-1)); - types.put(new RefType("java.lang.Float",-1), new RefType("java.lang.Float",-1)); - types.put(new RefType("java.lang.Long",-1), new RefType("java.lang.Long",-1)); return types; } + + @Override + public HashMap getReturnTypes(TypeAssumptions ass) { + HashMap ret = new HashMap(); + ret.put(ass.getTypeFor(new RefType("java.lang.Integer",-1)), ass.getTypeFor(new RefType("java.lang.Integer",-1))); + ret.put(ass.getTypeFor(new RefType("java.lang.Double",-1)), ass.getTypeFor(new RefType("java.lang.Double",-1))); + ret.put(ass.getTypeFor(new RefType("java.lang.Float",-1)), ass.getTypeFor(new RefType("java.lang.Float",-1))); + ret.put(ass.getTypeFor(new RefType("java.lang.Long",-1)), ass.getTypeFor(new RefType("java.lang.Long",-1))); + + return ret; + } } diff --git a/src/mycompiler/myoperator/Operator.java b/src/mycompiler/myoperator/Operator.java index e12c92f7f..7ea83b242 100755 --- a/src/mycompiler/myoperator/Operator.java +++ b/src/mycompiler/myoperator/Operator.java @@ -2,9 +2,17 @@ package mycompiler.myoperator; // ino.end // ino.module.Operator.8607.import +import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; + +import typinferenz.ConstraintsSet; +import typinferenz.OderConstraint; +import typinferenz.SingleConstraint; +import typinferenz.UndConstraint; +import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; import mycompiler.IItemWithOffset; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; @@ -15,6 +23,8 @@ import mycompiler.mystatement.Binary; import mycompiler.mystatement.Expr; import mycompiler.mytype.Pair; import mycompiler.mytype.RefType; +import mycompiler.mytype.Type; +import mycompiler.mytype.TypePlaceholder; import mycompiler.mytypereconstruction.CSupportData; import mycompiler.mytypereconstruction.CTriple; import mycompiler.mytypereconstruction.set.CSubstitutionSet; @@ -111,5 +121,13 @@ public abstract class Operator implements IItemWithOffset } // ino.end + + /** + * Liefert eine HashMap der Form: HashMap + * @param ass + * @return + */ + public abstract HashMap getReturnTypes(TypeAssumptions ass); + } // ino.end diff --git a/src/mycompiler/myoperator/RelOp.java b/src/mycompiler/myoperator/RelOp.java index ed320bb98..aa5f54b29 100755 --- a/src/mycompiler/myoperator/RelOp.java +++ b/src/mycompiler/myoperator/RelOp.java @@ -3,9 +3,13 @@ package mycompiler.myoperator; // ino.end // ino.module.RelOp.8610.import +import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; + +import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.DebugException; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.myexception.CTypeReconstructionException; @@ -13,6 +17,7 @@ import mycompiler.myexception.JVMCodeException; import mycompiler.mystatement.Binary; import mycompiler.mytype.Pair; import mycompiler.mytype.RefType; +import mycompiler.mytype.Type; import mycompiler.mytypereconstruction.CSupportData; import mycompiler.mytypereconstruction.CTriple; import mycompiler.mytypereconstruction.set.CSubstitutionSet; @@ -52,6 +57,17 @@ public abstract class RelOp extends Operator return types; } + @Override + public HashMap getReturnTypes(TypeAssumptions ass) { + HashMap ret = new HashMap(); + ret.put(ass.getTypeFor(new RefType("java.lang.Boolean",-1)), ass.getTypeFor(new RefType("java.lang.Integer",-1))); + ret.put(ass.getTypeFor(new RefType("java.lang.Boolean",-1)), ass.getTypeFor(new RefType("java.lang.Double",-1))); + ret.put(ass.getTypeFor(new RefType("java.lang.Boolean",-1)), ass.getTypeFor(new RefType("java.lang.Float",-1))); + ret.put(ass.getTypeFor(new RefType("java.lang.Boolean",-1)), ass.getTypeFor(new RefType("java.lang.Long",-1))); + + return ret; + } + } // ino.end diff --git a/src/mycompiler/myparser/JavaParser.java b/src/mycompiler/myparser/JavaParser.java index 4c0a9726d..b7f8a7982 100644 --- a/src/mycompiler/myparser/JavaParser.java +++ b/src/mycompiler/myparser/JavaParser.java @@ -266,10 +266,14 @@ public Vector testPair = new Vector(); */ //t protected jay.yydebug.yyDebug yydebug; - protected static final int yyFinal = 8; + protected static final int yyFinal = 15; //t public static final String yyRule [] = { //t "$accept : compilationunit", //t "compilationunit : typedeclarations", +//t "compilationunit : importdeclarations typedeclarations", +//t "compilationunit : packagedeclaration importdeclarations typedeclarations", +//t "compilationunit : packagedeclaration typedeclarations", +//t "compilationunit : type type compilationunit", //t "packagedeclaration : PACKAGE name ';'", //t "importdeclarations : importdeclaration", //t "importdeclarations : importdeclarations importdeclaration", @@ -279,6 +283,7 @@ public Vector testPair = new Vector(); //t "name : qualifiedname", //t "name : simplename", //t "typedeclaration : classdeclaration", +//t "typedeclaration : interfacedeclaration", //t "qualifiedname : name '.' IDENTIFIER", //t "importqualifiedname : name '.' IDENTIFIER", //t "importqualifiedname : name '.' '*'", @@ -335,8 +340,10 @@ public Vector testPair = new Vector(); //t "classbodydeclaration : staticinitializer", //t "classbodydeclaration : constructordeclaration", //t "classorinterfacetype : simplename parameter", +//t "typelist : type", +//t "typelist : typelist ',' type", //t "parameter :", -//t "parameter : '<' paralist '>'", +//t "parameter : '<' typelist '>'", //t "interfacememberdeclaration : constantdeclaration", //t "interfacememberdeclaration : abstractmethoddeclaration", //t "classmemberdeclaration : fielddeclaration", @@ -348,7 +355,8 @@ public Vector testPair = new Vector(); //t "abstractmethoddeclaration : methodheader ';'", //t "fielddeclarator : variabledeclarator '=' expression", //t "fielddeclaration : fielddeclarator ';'", -//t "fielddeclaration : type fielddeclarator", +//t "fielddeclaration : type fielddeclarator ';'", +//t "fielddeclaration : '<' boundedMethodParameters '>' type fielddeclarator ';'", //t "fielddeclaration : variabledeclarators ';'", //t "fielddeclaration : type variabledeclarators ';'", //t "fielddeclaration : modifiers type variabledeclarators ';'", @@ -745,98 +753,136 @@ public Vector testPair = new Vector(); yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]); switch (yyN) { case 1: - // line 322 "./../src/mycompiler/myparser/JavaParser.jay" + // line 323 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((SourceFile)yyVals[0+yyTop]); } break; case 2: - // line 350 "./../src/mycompiler/myparser/JavaParser.jay" + // line 327 "./../src/mycompiler/myparser/JavaParser.jay" + { + ((SourceFile)yyVals[0+yyTop]).addImports(((ImportDeclarations)yyVals[-1+yyTop])); + yyVal=((SourceFile)yyVals[0+yyTop]); + } + break; +case 3: + // line 332 "./../src/mycompiler/myparser/JavaParser.jay" + { + /* SCJU: Package*/ + ((SourceFile)yyVals[0+yyTop]).setPackageName(((UsedId)yyVals[-2+yyTop])); + ((SourceFile)yyVals[0+yyTop]).addImports(((ImportDeclarations)yyVals[-1+yyTop])); + yyVal=((SourceFile)yyVals[0+yyTop]); + } + break; +case 4: + // line 339 "./../src/mycompiler/myparser/JavaParser.jay" + { + /* SCJU: Package*/ + ((SourceFile)yyVals[0+yyTop]).setPackageName(((UsedId)yyVals[-1+yyTop])); + yyVal=((SourceFile)yyVals[0+yyTop]); + } + break; +case 5: + // line 345 "./../src/mycompiler/myparser/JavaParser.jay" + { + this.testPair.add(new Pair(((Type)yyVals[-2+yyTop]),((Type)yyVals[-1+yyTop]))); + yyVal=((SourceFile)yyVals[0+yyTop]); + } + break; +case 6: + // line 351 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Package*/ yyVal = ((UsedId)yyVals[-1+yyTop]); } break; -case 3: - // line 356 "./../src/mycompiler/myparser/JavaParser.jay" +case 7: + // line 357 "./../src/mycompiler/myparser/JavaParser.jay" { ImportDeclarations declarations=new ImportDeclarations(); declarations.addElement(((UsedId)yyVals[0+yyTop])); yyVal=declarations; } break; -case 4: - // line 362 "./../src/mycompiler/myparser/JavaParser.jay" +case 8: + // 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 368 "./../src/mycompiler/myparser/JavaParser.jay" +case 9: + // line 369 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((UsedId)yyVals[-1+yyTop]); } break; -case 6: - // line 373 "./../src/mycompiler/myparser/JavaParser.jay" +case 10: + // line 374 "./../src/mycompiler/myparser/JavaParser.jay" { SourceFile Scfile = new SourceFile(); Scfile.addElement(((AClassOrInterface)yyVals[0+yyTop])); yyVal=Scfile; } break; -case 7: - // line 379 "./../src/mycompiler/myparser/JavaParser.jay" +case 11: + // 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 385 "./../src/mycompiler/myparser/JavaParser.jay" +case 12: + // line 386 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((UsedId)yyVals[0+yyTop]); } break; -case 9: - // line 389 "./../src/mycompiler/myparser/JavaParser.jay" +case 13: + // line 390 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((UsedId)yyVals[0+yyTop]); } break; -case 10: - // line 394 "./../src/mycompiler/myparser/JavaParser.jay" +case 14: + // line 395 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Class)yyVals[0+yyTop]); } break; -case 11: - // line 405 "./../src/mycompiler/myparser/JavaParser.jay" +case 15: + // line 399 "./../src/mycompiler/myparser/JavaParser.jay" + { + /* SCJU: Interface*/ + yyVal=((Interface)yyVals[0+yyTop]); + } + break; +case 16: + // 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()); yyVal=((UsedId)yyVals[-2+yyTop]); } break; -case 12: - // line 412 "./../src/mycompiler/myparser/JavaParser.jay" +case 17: + // 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()); yyVal=((UsedId)yyVals[-2+yyTop]); } break; -case 13: - // line 418 "./../src/mycompiler/myparser/JavaParser.jay" +case 18: + // line 419 "./../src/mycompiler/myparser/JavaParser.jay" { ((UsedId)yyVals[-2+yyTop]).set_Name("*"); ((UsedId)yyVals[-2+yyTop]).setOffset(((UsedId)yyVals[-2+yyTop]).getOffset()); yyVal=((UsedId)yyVals[-2+yyTop]); } break; -case 14: - // line 426 "./../src/mycompiler/myparser/JavaParser.jay" +case 19: + // line 427 "./../src/mycompiler/myparser/JavaParser.jay" { UsedId UI = new UsedId(((Token)yyVals[0+yyTop]).getOffset()); UI.set_Name( ((Token)yyVals[0+yyTop]).getLexem() ); @@ -844,8 +890,8 @@ case 14: yyVal = UI; } break; -case 15: - // line 434 "./../src/mycompiler/myparser/JavaParser.jay" +case 20: + // line 435 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Um das hier uebersichtlicher zu halten,*/ /* gibt es einen allumfassenden Konstruktor fuer Class*/ @@ -863,92 +909,92 @@ case 15: this.initUsedIdsToCheck(); } break; -case 16: - // line 451 "./../src/mycompiler/myparser/JavaParser.jay" +case 21: + // 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(); this.initUsedIdsToCheck(); } break; -case 17: - // line 457 "./../src/mycompiler/myparser/JavaParser.jay" +case 22: + // 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(); this.initUsedIdsToCheck(); } break; -case 18: - // line 463 "./../src/mycompiler/myparser/JavaParser.jay" +case 23: + // 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(); this.initUsedIdsToCheck(); } break; -case 19: - // line 470 "./../src/mycompiler/myparser/JavaParser.jay" +case 24: + // 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(); this.initUsedIdsToCheck(); } break; -case 20: - // line 476 "./../src/mycompiler/myparser/JavaParser.jay" +case 25: + // 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(); this.initUsedIdsToCheck(); } break; -case 21: - // line 482 "./../src/mycompiler/myparser/JavaParser.jay" +case 26: + // 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(); this.initUsedIdsToCheck(); } break; -case 22: - // line 488 "./../src/mycompiler/myparser/JavaParser.jay" +case 27: + // 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(); this.initUsedIdsToCheck(); } break; -case 23: - // line 495 "./../src/mycompiler/myparser/JavaParser.jay" +case 28: + // line 496 "./../src/mycompiler/myparser/JavaParser.jay" { /* HOTI*/ /* Verbindet den Namen eines Interfaces mit einer optionalen Parameterliste*/ yyVal = new InterfaceAndParameter(((Token)yyVals[0+yyTop]).getLexem()); } break; -case 24: - // line 501 "./../src/mycompiler/myparser/JavaParser.jay" +case 29: + // line 502 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = new InterfaceAndParameter(((Token)yyVals[-3+yyTop]).getLexem(), ((ParaList)yyVals[-1+yyTop])); } break; -case 25: - // line 506 "./../src/mycompiler/myparser/JavaParser.jay" +case 30: + // line 507 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Hilfskonstrukt, um die Grammatik ueberschaubar zu halten*/ /* Verbindet den Namen einer Klasse mit einer optionalen Parameterliste*/ yyVal = new ClassAndParameter(((Token)yyVals[0+yyTop]).getLexem()); } break; -case 26: - // line 512 "./../src/mycompiler/myparser/JavaParser.jay" +case 31: + // line 513 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = new ClassAndParameter(((Token)yyVals[-3+yyTop]).getLexem(), ((ParaList)yyVals[-1+yyTop])); } break; -case 27: - // line 517 "./../src/mycompiler/myparser/JavaParser.jay" +case 32: + // line 518 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ Interface ic = new Interface(((InterfaceAndParameter)yyVals[-1+yyTop]).getName()); @@ -959,8 +1005,8 @@ case 27: yyVal = ic; } break; -case 28: - // line 527 "./../src/mycompiler/myparser/JavaParser.jay" +case 33: + // 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])); @@ -970,8 +1016,8 @@ case 28: yyVal = ic; } break; -case 29: - // line 536 "./../src/mycompiler/myparser/JavaParser.jay" +case 34: + // line 537 "./../src/mycompiler/myparser/JavaParser.jay" { Interface ic = new Interface(((InterfaceAndParameter)yyVals[-2+yyTop]).getName()); ic.setParaList(((InterfaceAndParameter)yyVals[-2+yyTop]).getParaVector()); @@ -982,8 +1028,8 @@ case 29: yyVal = ic; } break; -case 30: - // line 546 "./../src/mycompiler/myparser/JavaParser.jay" +case 35: + // 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()); @@ -994,8 +1040,8 @@ case 30: yyVal = ic; } break; -case 31: - // line 557 "./../src/mycompiler/myparser/JavaParser.jay" +case 36: + // line 558 "./../src/mycompiler/myparser/JavaParser.jay" { ParaList pl = new ParaList(); /* #JB# 05.04.2005 */ @@ -1007,8 +1053,8 @@ case 31: yyVal = pl; } break; -case 32: - // line 568 "./../src/mycompiler/myparser/JavaParser.jay" +case 37: + // 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() ); @@ -1018,16 +1064,16 @@ case 32: yyVal = pl; } break; -case 33: - // line 577 "./../src/mycompiler/myparser/JavaParser.jay" +case 38: + // line 578 "./../src/mycompiler/myparser/JavaParser.jay" { ParaList pl = new ParaList(); pl.getParalist().addElement(((WildcardType)yyVals[0+yyTop])); yyVal = pl; } break; -case 34: - // line 583 "./../src/mycompiler/myparser/JavaParser.jay" +case 39: + // line 584 "./../src/mycompiler/myparser/JavaParser.jay" { /* #JB# 05.04.2005 */ @@ -1040,8 +1086,8 @@ case 34: yyVal=((ParaList)yyVals[-2+yyTop]); } break; -case 35: - // line 596 "./../src/mycompiler/myparser/JavaParser.jay" +case 40: + // 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() ); @@ -1050,71 +1096,71 @@ case 35: yyVal=((ParaList)yyVals[-5+yyTop]); } break; -case 36: - // line 604 "./../src/mycompiler/myparser/JavaParser.jay" +case 41: + // 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 610 "./../src/mycompiler/myparser/JavaParser.jay" +case 42: + // line 611 "./../src/mycompiler/myparser/JavaParser.jay" { /*Luar 29.11.06 Offset auf -1, da keine Angabe vorhanden*/ WildcardType wc = new WildcardType(-1); yyVal = wc; } break; -case 38: - // line 616 "./../src/mycompiler/myparser/JavaParser.jay" +case 43: + // 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 621 "./../src/mycompiler/myparser/JavaParser.jay" +case 44: + // 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 627 "./../src/mycompiler/myparser/JavaParser.jay" +case 45: + // line 628 "./../src/mycompiler/myparser/JavaParser.jay" { ClassBody CB = new ClassBody(); yyVal = CB; } break; -case 41: - // line 633 "./../src/mycompiler/myparser/JavaParser.jay" +case 46: + // line 634 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = ((ClassBody)yyVals[-1+yyTop]); } break; -case 42: - // line 638 "./../src/mycompiler/myparser/JavaParser.jay" +case 47: + // line 639 "./../src/mycompiler/myparser/JavaParser.jay" { Modifiers Mod = new Modifiers(); Mod.addModifier(((Modifier)yyVals[0+yyTop])); yyVal = Mod; } break; -case 43: - // line 644 "./../src/mycompiler/myparser/JavaParser.jay" +case 48: + // 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 650 "./../src/mycompiler/myparser/JavaParser.jay" +case 49: + // line 651 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = ((UsedId)yyVals[0+yyTop]); } break; -case 45: - // line 655 "./../src/mycompiler/myparser/JavaParser.jay" +case 50: + // line 656 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ InterfaceList il = new InterfaceList(); @@ -1122,28 +1168,28 @@ case 45: yyVal = il; } break; -case 46: - // line 662 "./../src/mycompiler/myparser/JavaParser.jay" +case 51: + // 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 668 "./../src/mycompiler/myparser/JavaParser.jay" +case 52: + // line 669 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ yyVal = new InterfaceBody(); } break; -case 48: - // line 673 "./../src/mycompiler/myparser/JavaParser.jay" +case 53: + // line 674 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = ((InterfaceBody)yyVals[-1+yyTop]); } break; -case 49: - // line 680 "./../src/mycompiler/myparser/JavaParser.jay" +case 54: + // line 681 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ InterfaceList il = new InterfaceList(); @@ -1151,71 +1197,71 @@ case 49: yyVal = il; } break; -case 50: - // line 687 "./../src/mycompiler/myparser/JavaParser.jay" +case 55: + // 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 694 "./../src/mycompiler/myparser/JavaParser.jay" +case 56: + // line 695 "./../src/mycompiler/myparser/JavaParser.jay" { ClassBody CB = new ClassBody(); CB.addField( ((Field)yyVals[0+yyTop]) ); yyVal=CB; } break; -case 52: - // line 700 "./../src/mycompiler/myparser/JavaParser.jay" +case 57: + // line 701 "./../src/mycompiler/myparser/JavaParser.jay" { ((ClassBody)yyVals[-1+yyTop]).addField(((Field)yyVals[0+yyTop])); yyVal = ((ClassBody)yyVals[-1+yyTop]); } break; -case 53: - // line 707 "./../src/mycompiler/myparser/JavaParser.jay" +case 58: + // line 708 "./../src/mycompiler/myparser/JavaParser.jay" { Public Pub = new Public(); yyVal=Pub; } break; -case 54: - // line 712 "./../src/mycompiler/myparser/JavaParser.jay" +case 59: + // line 713 "./../src/mycompiler/myparser/JavaParser.jay" { Protected Pro = new Protected(); yyVal=Pro; } break; -case 55: - // line 717 "./../src/mycompiler/myparser/JavaParser.jay" +case 60: + // line 718 "./../src/mycompiler/myparser/JavaParser.jay" { Private Pri = new Private(); yyVal=Pri; } break; -case 56: - // line 722 "./../src/mycompiler/myparser/JavaParser.jay" +case 61: + // line 723 "./../src/mycompiler/myparser/JavaParser.jay" { Static Sta = new Static(); yyVal=Sta; } break; -case 57: - // line 727 "./../src/mycompiler/myparser/JavaParser.jay" +case 62: + // line 728 "./../src/mycompiler/myparser/JavaParser.jay" { Abstract Abs = new Abstract(); yyVal=Abs; } break; -case 58: - // line 732 "./../src/mycompiler/myparser/JavaParser.jay" +case 63: + // line 733 "./../src/mycompiler/myparser/JavaParser.jay" { Final fin = new Final(); yyVal = fin; } break; -case 59: - // line 738 "./../src/mycompiler/myparser/JavaParser.jay" +case 64: + // line 739 "./../src/mycompiler/myparser/JavaParser.jay" { /*PL 05-07-30 eingefuegt containedTypes ANFANG*/ RefType RT = new RefType(-1); @@ -1229,8 +1275,8 @@ case 59: yyVal = ((UsedId)yyVals[0+yyTop]); } break; -case 60: - // line 753 "./../src/mycompiler/myparser/JavaParser.jay" +case 65: + // line 754 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ InterfaceBody ib = new InterfaceBody(); @@ -1238,89 +1284,104 @@ case 60: yyVal = ib; } break; -case 61: - // line 760 "./../src/mycompiler/myparser/JavaParser.jay" +case 66: + // line 761 "./../src/mycompiler/myparser/JavaParser.jay" { ((InterfaceBody)yyVals[-1+yyTop]).addElement(((Field)yyVals[0+yyTop])); yyVal = ((InterfaceBody)yyVals[-1+yyTop]); } break; -case 62: - // line 766 "./../src/mycompiler/myparser/JavaParser.jay" +case 67: + // line 767 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interfaces*/ yyVal = ((UsedId)yyVals[0+yyTop]); } break; -case 63: - // line 772 "./../src/mycompiler/myparser/JavaParser.jay" +case 68: + // line 773 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Field)yyVals[0+yyTop]); } break; -case 64: - // line 777 "./../src/mycompiler/myparser/JavaParser.jay" +case 69: + // line 778 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Method)yyVals[0+yyTop]); } break; -case 65: - // line 781 "./../src/mycompiler/myparser/JavaParser.jay" +case 70: + // line 782 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Field)yyVals[0+yyTop]); } break; -case 66: - // line 786 "./../src/mycompiler/myparser/JavaParser.jay" +case 71: + // 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()); - + if (((Vector)yyVals[0+yyTop]) != null) { + /*$1.set_ParaList($2.get_ParaList());*/ + ((UsedId)yyVals[-1+yyTop]).set_ParaList(((Vector)yyVals[0+yyTop]));/*Änderung von Andreas Stadelmeier. Type statt GenericVarType*/ /* otth: originale (also diese) Parameterliste retten */ - ((UsedId)((UsedId)yyVals[-1+yyTop])).vParaOrg = new Vector( ((ParaList)yyVals[0+yyTop]).get_ParaList() ); + /*((UsedId)$1).vParaOrg = new Vector( $2.get_ParaList() );*/ } yyVal=((UsedId)yyVals[-1+yyTop]); } break; -case 67: - // line 797 "./../src/mycompiler/myparser/JavaParser.jay" +case 72: + // line 798 "./../src/mycompiler/myparser/JavaParser.jay" + { + Vector tl = new Vector(); + tl.add(((Type)yyVals[0+yyTop])); + yyVal = tl; + } + break; +case 73: + // line 804 "./../src/mycompiler/myparser/JavaParser.jay" + { + ((Vector)yyVals[-2+yyTop]).add(((Type)yyVals[0+yyTop])); + yyVal=((Vector)yyVals[-2+yyTop]); + } + break; +case 74: + // line 811 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = null; } break; -case 68: - // line 799 "./../src/mycompiler/myparser/JavaParser.jay" +case 75: + // line 813 "./../src/mycompiler/myparser/JavaParser.jay" { - yyVal = ((ParaList)yyVals[-1+yyTop]); + yyVal = ((Vector)yyVals[-1+yyTop]); } break; -case 69: - // line 804 "./../src/mycompiler/myparser/JavaParser.jay" +case 76: + // line 818 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interfaces, Spezialform Konstantendef.*/ yyVal = ((Constant)yyVals[0+yyTop]); } break; -case 70: - // line 809 "./../src/mycompiler/myparser/JavaParser.jay" +case 77: + // line 823 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = ((Method)yyVals[0+yyTop]); } break; -case 71: - // line 814 "./../src/mycompiler/myparser/JavaParser.jay" +case 78: + // line 828 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Field)yyVals[0+yyTop]); } break; -case 72: - // line 818 "./../src/mycompiler/myparser/JavaParser.jay" +case 79: + // line 832 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Method)yyVals[0+yyTop]); } break; -case 73: - // line 823 "./../src/mycompiler/myparser/JavaParser.jay" +case 80: + // line 837 "./../src/mycompiler/myparser/JavaParser.jay" { - Method STAT = new Method(); + Method STAT = new Method(((Token)yyVals[-1+yyTop]).getOffset()); DeclId DST = new DeclId(); DST.set_Name(((Token)yyVals[-1+yyTop]).getLexem()); STAT.set_DeclId(DST); @@ -1332,23 +1393,23 @@ case 73: yyVal=STAT; } break; -case 74: - // line 837 "./../src/mycompiler/myparser/JavaParser.jay" +case 81: + // line 851 "./../src/mycompiler/myparser/JavaParser.jay" { ((Constructor)yyVals[-1+yyTop]).set_Block(((Block)yyVals[0+yyTop])); yyVal = ((Constructor)yyVals[-1+yyTop]); } break; -case 75: - // line 842 "./../src/mycompiler/myparser/JavaParser.jay" +case 82: + // line 856 "./../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])); yyVal = ((Constructor)yyVals[-1+yyTop]); } break; -case 76: - // line 849 "./../src/mycompiler/myparser/JavaParser.jay" +case 83: + // line 863 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ Constant c = new Constant(((Token)yyVals[-3+yyTop]).getLexem(), ((Modifiers)yyVals[-5+yyTop])); @@ -1357,51 +1418,59 @@ case 76: yyVal = c; } break; -case 77: - // line 858 "./../src/mycompiler/myparser/JavaParser.jay" +case 84: + // line 872 "./../src/mycompiler/myparser/JavaParser.jay" { /* SCJU: Interface*/ yyVal = ((Method)yyVals[-1+yyTop]); } break; -case 78: - // line 871 "./../src/mycompiler/myparser/JavaParser.jay" +case 85: + // line 897 "./../src/mycompiler/myparser/JavaParser.jay" { - FieldDeclaration ret = new FieldDeclaration(); + FieldDeclaration ret = new FieldDeclaration(((DeclId)yyVals[-2+yyTop]).getOffset()); ret.set_DeclId(((DeclId)yyVals[-2+yyTop])); ret.setWert(((Expr)yyVals[0+yyTop])); yyVal=ret; } break; -case 79: - // line 879 "./../src/mycompiler/myparser/JavaParser.jay" +case 86: + // line 905 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((FieldDeclaration)yyVals[-1+yyTop]); } break; -case 80: - // line 883 "./../src/mycompiler/myparser/JavaParser.jay" +case 87: + // line 909 "./../src/mycompiler/myparser/JavaParser.jay" { - ((FieldDeclaration)yyVals[0+yyTop]).setType(((Type)yyVals[-1+yyTop])); - yyVal=((FieldDeclaration)yyVals[0+yyTop]); + ((FieldDeclaration)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); + yyVal=((FieldDeclaration)yyVals[-1+yyTop]); } break; -case 81: - // line 889 "./../src/mycompiler/myparser/JavaParser.jay" +case 88: + // line 914 "./../src/mycompiler/myparser/JavaParser.jay" + {/*angefügt von Andreas Stadelmeier*/ + ((FieldDeclaration)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); + ((FieldDeclaration)yyVals[-1+yyTop]).setGenericParameter(((Vector)yyVals[-4+yyTop])); + yyVal=((FieldDeclaration)yyVals[-1+yyTop]); + } + break; +case 89: + // line 921 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((FieldDeclaration)yyVals[-1+yyTop]); } break; -case 82: - // line 894 "./../src/mycompiler/myparser/JavaParser.jay" +case 90: + // line 926 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->fielddeclaration ...: type " + ((Type)yyVals[-2+yyTop])); ((FieldDeclaration)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); yyVal = ((FieldDeclaration)yyVals[-1+yyTop]); } break; -case 83: - // line 901 "./../src/mycompiler/myparser/JavaParser.jay" +case 91: + // line 933 "./../src/mycompiler/myparser/JavaParser.jay" { ((FieldDeclaration)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); for(int i=0;i<(((FieldDeclaration)yyVals[-1+yyTop]).getDeclIdVector().size());i++) @@ -1411,28 +1480,28 @@ case 83: yyVal = ((FieldDeclaration)yyVals[-1+yyTop]); } break; -case 84: - // line 911 "./../src/mycompiler/myparser/JavaParser.jay" +case 92: + // line 943 "./../src/mycompiler/myparser/JavaParser.jay" { ((Method)yyVals[-1+yyTop]).set_Block(((Block)yyVals[0+yyTop])); yyVal=((Method)yyVals[-1+yyTop]); } break; -case 85: - // line 918 "./../src/mycompiler/myparser/JavaParser.jay" +case 93: + // line 950 "./../src/mycompiler/myparser/JavaParser.jay" { Block Bl = new Block(); yyVal=Bl; } break; -case 86: - // line 924 "./../src/mycompiler/myparser/JavaParser.jay" +case 94: + // line 956 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Block)yyVals[-1+yyTop]); } break; -case 87: - // line 929 "./../src/mycompiler/myparser/JavaParser.jay" +case 95: + // line 961 "./../src/mycompiler/myparser/JavaParser.jay" { Constructor CON = new Constructor(null); /*TODO: Der Parser kann sowieso nicht zwischen einem Konstruktor und einer Methode unterscheiden. Das hier kann wegfallen...*/ DeclId DIDCon = new DeclId(); @@ -1441,8 +1510,8 @@ case 87: yyVal=CON; } break; -case 88: - // line 937 "./../src/mycompiler/myparser/JavaParser.jay" +case 96: + // line 969 "./../src/mycompiler/myparser/JavaParser.jay" { Constructor CONpara = new Constructor(null); DeclId DIconpara = new DeclId(); @@ -1452,29 +1521,29 @@ case 88: yyVal=CONpara; } break; -case 89: - // line 947 "./../src/mycompiler/myparser/JavaParser.jay" +case 97: + // line 979 "./../src/mycompiler/myparser/JavaParser.jay" { Block CBL = new Block(); yyVal=CBL; } break; -case 90: - // line 952 "./../src/mycompiler/myparser/JavaParser.jay" +case 98: + // line 984 "./../src/mycompiler/myparser/JavaParser.jay" { Block CBLexpl = new Block(); CBLexpl.set_Statement(((Statement)yyVals[-1+yyTop])); yyVal=CBLexpl; } break; -case 91: - // line 958 "./../src/mycompiler/myparser/JavaParser.jay" +case 99: + // line 990 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Block)yyVals[-1+yyTop]); } break; -case 92: - // line 962 "./../src/mycompiler/myparser/JavaParser.jay" +case 100: + // line 994 "./../src/mycompiler/myparser/JavaParser.jay" { Block CBes = new Block(); CBes.set_Statement(((Statement)yyVals[-2+yyTop])); @@ -1485,51 +1554,51 @@ case 92: yyVal=CBes; } break; -case 93: - // line 973 "./../src/mycompiler/myparser/JavaParser.jay" +case 101: + // line 1005 "./../src/mycompiler/myparser/JavaParser.jay" { ExceptionList EL = new ExceptionList(); EL.set_addElem(((RefType)yyVals[0+yyTop])); yyVal=EL; } break; -case 94: - // line 980 "./../src/mycompiler/myparser/JavaParser.jay" +case 102: + // line 1012 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal = ((GenericTypeVar)yyVals[0+yyTop]); } break; -case 95: - // line 985 "./../src/mycompiler/myparser/JavaParser.jay" +case 103: + // line 1017 "./../src/mycompiler/myparser/JavaParser.jay" { ParaList p = new ParaList(); p.add_ParaList(((GenericTypeVar)yyVals[0+yyTop])); yyVal=p; } break; -case 96: - // line 991 "./../src/mycompiler/myparser/JavaParser.jay" +case 104: + // line 1023 "./../src/mycompiler/myparser/JavaParser.jay" { ((ParaList)yyVals[-2+yyTop]).add_ParaList(((GenericTypeVar)yyVals[0+yyTop])); yyVal=((ParaList)yyVals[-2+yyTop]); } break; -case 97: - // line 998 "./../src/mycompiler/myparser/JavaParser.jay" +case 105: + // line 1030 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=new GenericTypeVar(((Token)yyVals[0+yyTop]).getLexem(),((Token)yyVals[0+yyTop]).getOffset()); } break; -case 98: - // line 1002 "./../src/mycompiler/myparser/JavaParser.jay" +case 106: + // line 1034 "./../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])); + BoundedGenericTypeVar gtv=new BoundedGenericTypeVar(((Token)yyVals[-2+yyTop]).getLexem(),((Vector)yyVals[0+yyTop]),((Token)yyVals[-2+yyTop]).getOffset()); + /*gtv.setBounds($3);*/ yyVal=gtv; } break; -case 99: - // line 1009 "./../src/mycompiler/myparser/JavaParser.jay" +case 107: + // line 1041 "./../src/mycompiler/myparser/JavaParser.jay" { Vector vec=new Vector(); vec.addElement(((RefType)yyVals[0+yyTop])); @@ -1537,305 +1606,306 @@ case 99: yyVal=vec; } break; -case 100: - // line 1016 "./../src/mycompiler/myparser/JavaParser.jay" +case 108: + // line 1048 "./../src/mycompiler/myparser/JavaParser.jay" { ((Vector)yyVals[-2+yyTop]).addElement(((RefType)yyVals[0+yyTop])); containedTypes.addElement(((RefType)yyVals[0+yyTop])); yyVal=((Vector)yyVals[-2+yyTop]); } break; -case 101: - // line 1023 "./../src/mycompiler/myparser/JavaParser.jay" +case 109: + // line 1055 "./../src/mycompiler/myparser/JavaParser.jay" { Vector vec=new Vector(); vec.addElement(((GenericTypeVar)yyVals[0+yyTop])); yyVal=vec; } break; -case 102: - // line 1029 "./../src/mycompiler/myparser/JavaParser.jay" +case 110: + // line 1061 "./../src/mycompiler/myparser/JavaParser.jay" { ((Vector)yyVals[-2+yyTop]).addElement(((GenericTypeVar)yyVals[0+yyTop])); yyVal=((Vector)yyVals[-2+yyTop]); } break; -case 103: - // line 1037 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((Method)yyVals[0+yyTop]).setReturnType(((Type)yyVals[-1+yyTop])); - ((Method)yyVals[0+yyTop]).setGenericMethodParameters(((Vector)yyVals[-3+yyTop])); - yyVal=((Method)yyVals[0+yyTop]); - } - break; -case 104: - // line 1043 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((Method)yyVals[0+yyTop]).setReturnType(((Type)yyVals[-1+yyTop])); - yyVal=((Method)yyVals[0+yyTop]); - } - break; -case 105: - // line 1048 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); - ((Method)yyVals[0+yyTop]).setReturnType(((Type)yyVals[-1+yyTop])); - yyVal=((Method)yyVals[0+yyTop]); - } - break; -case 106: - // line 1054 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-5+yyTop])); - ((Method)yyVals[0+yyTop]).setGenericMethodParameters(((Vector)yyVals[-3+yyTop])); - ((Method)yyVals[0+yyTop]).setReturnType(((Type)yyVals[-1+yyTop])); - yyVal=((Method)yyVals[0+yyTop]); - } - break; -case 107: - // line 1061 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((Method)yyVals[-1+yyTop]).setReturnType(((Type)yyVals[-2+yyTop])); - ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); - yyVal=((Method)yyVals[-1+yyTop]); - } - break; -case 108: - // line 1067 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((Method)yyVals[-1+yyTop]).setGenericMethodParameters(((Vector)yyVals[-4+yyTop])); - ((Method)yyVals[-1+yyTop]).setReturnType(((Type)yyVals[-2+yyTop])); - ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); - yyVal=((Method)yyVals[-1+yyTop]); - } - break; -case 109: - // line 1074 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); - ((Method)yyVals[-1+yyTop]).setReturnType(((Type)yyVals[-2+yyTop])); - ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); - yyVal=((Method)yyVals[-1+yyTop]); - } - break; -case 110: - // line 1081 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-6+yyTop])); - ((Method)yyVals[-1+yyTop]).setGenericMethodParameters(((Vector)yyVals[-4+yyTop])); - ((Method)yyVals[-1+yyTop]).setReturnType(((Type)yyVals[-2+yyTop])); - ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); - yyVal=((Method)yyVals[-1+yyTop]); - } - break; case 111: - // line 1089 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1069 "./../src/mycompiler/myparser/JavaParser.jay" { - Void Voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); - ((Method)yyVals[0+yyTop]).setReturnType(Voit); + ((Method)yyVals[0+yyTop]).setType(((Type)yyVals[-1+yyTop])); + ((Method)yyVals[0+yyTop]).setGenericMethodParameters(((Vector)yyVals[-3+yyTop])); yyVal=((Method)yyVals[0+yyTop]); } break; case 112: - // line 1095 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1075 "./../src/mycompiler/myparser/JavaParser.jay" { - Void voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); - ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); - ((Method)yyVals[0+yyTop]).setReturnType(voit); + ((Method)yyVals[0+yyTop]).setType(((Type)yyVals[-1+yyTop])); yyVal=((Method)yyVals[0+yyTop]); } break; case 113: - // line 1102 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1080 "./../src/mycompiler/myparser/JavaParser.jay" { - Void voyt = new Void(((Token)yyVals[-2+yyTop]).getOffset()); - ((Method)yyVals[-1+yyTop]).setReturnType(voyt); - ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); - yyVal=((Method)yyVals[-1+yyTop]); + ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); + ((Method)yyVals[0+yyTop]).setType(((Type)yyVals[-1+yyTop])); + yyVal=((Method)yyVals[0+yyTop]); } break; case 114: - // line 1109 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1086 "./../src/mycompiler/myparser/JavaParser.jay" { - Void voyd = new Void(((Token)yyVals[-2+yyTop]).getOffset()); - ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); - ((Method)yyVals[-1+yyTop]).setReturnType(voyd); + ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-5+yyTop])); + ((Method)yyVals[0+yyTop]).setGenericMethodParameters(((Vector)yyVals[-3+yyTop])); + ((Method)yyVals[0+yyTop]).setType(((Type)yyVals[-1+yyTop])); + yyVal=((Method)yyVals[0+yyTop]); + } + break; +case 115: + // line 1093 "./../src/mycompiler/myparser/JavaParser.jay" + { + ((Method)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); yyVal=((Method)yyVals[-1+yyTop]); } break; -case 115: - // line 1117 "./../src/mycompiler/myparser/JavaParser.jay" - { - Void Voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); - ((Method)yyVals[0+yyTop]).setReturnType(Voit); - ((Method)yyVals[0+yyTop]).setGenericMethodParameters(((Vector)yyVals[-3+yyTop])); - yyVal=((Method)yyVals[0+yyTop]); - } - break; case 116: - // line 1124 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1099 "./../src/mycompiler/myparser/JavaParser.jay" { - Void voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); - ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-5+yyTop])); - ((Method)yyVals[0+yyTop]).setReturnType(voit); - ((Method)yyVals[0+yyTop]).setGenericMethodParameters(((Vector)yyVals[-3+yyTop])); - yyVal=((Method)yyVals[0+yyTop]); + ((Method)yyVals[-1+yyTop]).setGenericMethodParameters(((Vector)yyVals[-4+yyTop])); + ((Method)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); + ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); + yyVal=((Method)yyVals[-1+yyTop]); } break; case 117: - // line 1132 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1106 "./../src/mycompiler/myparser/JavaParser.jay" { - Void voyt = new Void(((Token)yyVals[-2+yyTop]).getOffset()); - ((Method)yyVals[-1+yyTop]).setReturnType(voyt); + ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); + ((Method)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); - ((Method)yyVals[-1+yyTop]).setGenericMethodParameters(((Vector)yyVals[-4+yyTop])); yyVal=((Method)yyVals[-1+yyTop]); } break; case 118: - // line 1140 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1113 "./../src/mycompiler/myparser/JavaParser.jay" { - Void voyd = new Void(((Token)yyVals[-2+yyTop]).getOffset()); ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-6+yyTop])); - ((Method)yyVals[-1+yyTop]).setReturnType(voyd); - ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); ((Method)yyVals[-1+yyTop]).setGenericMethodParameters(((Vector)yyVals[-4+yyTop])); + ((Method)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); + ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); yyVal=((Method)yyVals[-1+yyTop]); } break; case 119: - // line 1150 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1121 "./../src/mycompiler/myparser/JavaParser.jay" { - /*auskommentiert von Andreas Stadelmeier (a10023) $1.setReturnType(TypePlaceholder.fresh()); */ + Void Voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); + ((Method)yyVals[0+yyTop]).setType(Voit); yyVal=((Method)yyVals[0+yyTop]); } break; case 120: - // line 1155 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1127 "./../src/mycompiler/myparser/JavaParser.jay" { - /*auskommentiert von Andreas Stadelmeier (a10023) $4.setReturnType(TypePlaceholder.fresh());*/ - ((Method)yyVals[0+yyTop]).setGenericMethodParameters(((Vector)yyVals[-2+yyTop])); + Void voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); + ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); + ((Method)yyVals[0+yyTop]).setType(voit); yyVal=((Method)yyVals[0+yyTop]); } break; case 121: - // line 1162 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1134 "./../src/mycompiler/myparser/JavaParser.jay" { - ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-1+yyTop])); - /*auskommentiert von Andreas Stadelmeier (a10023) $2.setReturnType(TypePlaceholder.fresh());*/ - yyVal=((Method)yyVals[0+yyTop]); + Void voyt = new Void(((Token)yyVals[-2+yyTop]).getOffset()); + ((Method)yyVals[-1+yyTop]).setType(voyt); + ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); + yyVal=((Method)yyVals[-1+yyTop]); } break; case 122: - // line 1168 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1141 "./../src/mycompiler/myparser/JavaParser.jay" { - /*auskommentiert von Andreas Stadelmeier (a10023) $1.setReturnType(TypePlaceholder.fresh());*/ + Void voyd = new Void(((Token)yyVals[-2+yyTop]).getOffset()); + ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-3+yyTop])); + ((Method)yyVals[-1+yyTop]).setType(voyd); ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); yyVal=((Method)yyVals[-1+yyTop]); } break; case 123: - // line 1174 "./../src/mycompiler/myparser/JavaParser.jay" + // line 1149 "./../src/mycompiler/myparser/JavaParser.jay" { - ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); - /*auskommentiert von Andreas Stadelmeier (a10023) $2.setReturnType(TypePlaceholder.fresh());*/ + Void Voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); + ((Method)yyVals[0+yyTop]).setType(Voit); + ((Method)yyVals[0+yyTop]).setGenericMethodParameters(((Vector)yyVals[-3+yyTop])); + yyVal=((Method)yyVals[0+yyTop]); + } + break; +case 124: + // line 1156 "./../src/mycompiler/myparser/JavaParser.jay" + { + Void voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); + ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-5+yyTop])); + ((Method)yyVals[0+yyTop]).setType(voit); + ((Method)yyVals[0+yyTop]).setGenericMethodParameters(((Vector)yyVals[-3+yyTop])); + yyVal=((Method)yyVals[0+yyTop]); + } + break; +case 125: + // line 1164 "./../src/mycompiler/myparser/JavaParser.jay" + { + Void voyt = new Void(((Token)yyVals[-2+yyTop]).getOffset()); + ((Method)yyVals[-1+yyTop]).setType(voyt); + ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); + ((Method)yyVals[-1+yyTop]).setGenericMethodParameters(((Vector)yyVals[-4+yyTop])); + yyVal=((Method)yyVals[-1+yyTop]); + } + break; +case 126: + // line 1172 "./../src/mycompiler/myparser/JavaParser.jay" + { + Void voyd = new Void(((Token)yyVals[-2+yyTop]).getOffset()); + ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-6+yyTop])); + ((Method)yyVals[-1+yyTop]).setType(voyd); + ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); + ((Method)yyVals[-1+yyTop]).setGenericMethodParameters(((Vector)yyVals[-4+yyTop])); + yyVal=((Method)yyVals[-1+yyTop]); + } + break; +case 127: + // line 1182 "./../src/mycompiler/myparser/JavaParser.jay" + { + /*auskommentiert von Andreas Stadelmeier (a10023) $1.setType(TypePlaceholder.fresh()); */ + yyVal=((Method)yyVals[0+yyTop]); + } + break; +case 128: + // line 1187 "./../src/mycompiler/myparser/JavaParser.jay" + { + /*auskommentiert von Andreas Stadelmeier (a10023) $4.setType(TypePlaceholder.fresh());*/ + ((Method)yyVals[0+yyTop]).setGenericMethodParameters(((Vector)yyVals[-2+yyTop])); + yyVal=((Method)yyVals[0+yyTop]); + } + break; +case 129: + // line 1194 "./../src/mycompiler/myparser/JavaParser.jay" + { + ((Method)yyVals[0+yyTop]).set_Modifiers(((Modifiers)yyVals[-1+yyTop])); + /*auskommentiert von Andreas Stadelmeier (a10023) $2.setType(TypePlaceholder.fresh());*/ + yyVal=((Method)yyVals[0+yyTop]); + } + break; +case 130: + // line 1200 "./../src/mycompiler/myparser/JavaParser.jay" + { + /*auskommentiert von Andreas Stadelmeier (a10023) $1.setType(TypePlaceholder.fresh());*/ ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); yyVal=((Method)yyVals[-1+yyTop]); } break; -case 124: - // line 1183 "./../src/mycompiler/myparser/JavaParser.jay" +case 131: + // line 1206 "./../src/mycompiler/myparser/JavaParser.jay" + { + ((Method)yyVals[-1+yyTop]).set_Modifiers(((Modifiers)yyVals[-2+yyTop])); + /*auskommentiert von Andreas Stadelmeier (a10023) $2.setType(TypePlaceholder.fresh());*/ + ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); + yyVal=((Method)yyVals[-1+yyTop]); + } + break; +case 132: + // line 1215 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((BaseType)yyVals[0+yyTop]); } break; -case 125: - // line 1187 "./../src/mycompiler/myparser/JavaParser.jay" +case 133: + // line 1219 "./../src/mycompiler/myparser/JavaParser.jay" { ((BaseType)yyVals[-2+yyTop]).setArray(true); } break; -case 126: - // line 1191 "./../src/mycompiler/myparser/JavaParser.jay" +case 134: + // line 1223 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((RefType)yyVals[0+yyTop]); } break; -case 127: - // line 1195 "./../src/mycompiler/myparser/JavaParser.jay" +case 135: + // line 1227 "./../src/mycompiler/myparser/JavaParser.jay" { ((RefType)yyVals[-2+yyTop]).setArray(true); } break; -case 128: - // line 1199 "./../src/mycompiler/myparser/JavaParser.jay" +case 136: + // line 1231 "./../src/mycompiler/myparser/JavaParser.jay" { - FieldDeclaration IVD = new FieldDeclaration(); + FieldDeclaration IVD = new FieldDeclaration(((DeclId)yyVals[0+yyTop]).getOffset()); IVD.getDeclIdVector().addElement( ((DeclId)yyVals[0+yyTop]) ); + IVD.setOffset(((DeclId)yyVals[0+yyTop]).getOffset()); yyVal = IVD; } break; -case 129: - // line 1205 "./../src/mycompiler/myparser/JavaParser.jay" +case 137: + // line 1238 "./../src/mycompiler/myparser/JavaParser.jay" { ((FieldDeclaration)yyVals[-2+yyTop]).getDeclIdVector().addElement(((DeclId)yyVals[0+yyTop])); yyVal=((FieldDeclaration)yyVals[-2+yyTop]); } break; -case 130: - // line 1211 "./../src/mycompiler/myparser/JavaParser.jay" +case 138: + // line 1244 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Block)yyVals[0+yyTop]); } break; -case 131: - // line 1216 "./../src/mycompiler/myparser/JavaParser.jay" +case 139: + // line 1249 "./../src/mycompiler/myparser/JavaParser.jay" { Block Blstat = new Block(); Blstat.set_Statement(((Statement)yyVals[0+yyTop])); yyVal=Blstat; } break; -case 132: - // line 1223 "./../src/mycompiler/myparser/JavaParser.jay" +case 140: + // line 1256 "./../src/mycompiler/myparser/JavaParser.jay" { ((Block)yyVals[-1+yyTop]).set_Statement(((Statement)yyVals[0+yyTop])); yyVal=((Block)yyVals[-1+yyTop]); } break; -case 133: - // line 1229 "./../src/mycompiler/myparser/JavaParser.jay" +case 141: + // line 1262 "./../src/mycompiler/myparser/JavaParser.jay" { ParameterList PL = new ParameterList(); PL.set_AddParameter(((FormalParameter)yyVals[0+yyTop])); yyVal = PL; } break; -case 134: - // line 1235 "./../src/mycompiler/myparser/JavaParser.jay" +case 142: + // line 1268 "./../src/mycompiler/myparser/JavaParser.jay" { ((ParameterList)yyVals[-2+yyTop]).set_AddParameter(((FormalParameter)yyVals[0+yyTop])); yyVal = ((ParameterList)yyVals[-2+yyTop]); } break; -case 135: - // line 1241 "./../src/mycompiler/myparser/JavaParser.jay" +case 143: + // line 1274 "./../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 1246 "./../src/mycompiler/myparser/JavaParser.jay" +case 144: + // line 1279 "./../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])); yyVal=THCONargl; } break; -case 137: - // line 1255 "./../src/mycompiler/myparser/JavaParser.jay" +case 145: + // line 1288 "./../src/mycompiler/myparser/JavaParser.jay" { RefType RT = new RefType(-1); RT.set_UsedId(((UsedId)yyVals[0+yyTop])); @@ -1843,18 +1913,18 @@ case 137: yyVal=RT; } break; -case 138: - // line 1262 "./../src/mycompiler/myparser/JavaParser.jay" +case 146: + // line 1295 "./../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()); yyVal=((RefType)yyVals[-2+yyTop]); } break; -case 139: - // line 1269 "./../src/mycompiler/myparser/JavaParser.jay" +case 147: + // line 1302 "./../src/mycompiler/myparser/JavaParser.jay" { - Method met = new Method(); + Method met = new Method(((Token)yyVals[-2+yyTop]).getOffset()); /* #JB# 10.04.2005 */ /* ########################################################### */ met.setLineNumber(((Token)yyVals[-2+yyTop]).getLineNumber()); @@ -1866,10 +1936,10 @@ case 139: yyVal = met; } break; -case 140: - // line 1282 "./../src/mycompiler/myparser/JavaParser.jay" +case 148: + // line 1315 "./../src/mycompiler/myparser/JavaParser.jay" { - Method met_para = new Method(); + Method met_para = new Method(((Token)yyVals[-3+yyTop]).getOffset()); /* #JB# 10.04.2005 */ /* ########################################################### */ met_para.setLineNumber(((Token)yyVals[-3+yyTop]).getLineNumber()); @@ -1882,8 +1952,8 @@ case 140: yyVal = met_para; } break; -case 141: - // line 1297 "./../src/mycompiler/myparser/JavaParser.jay" +case 149: + // line 1330 "./../src/mycompiler/myparser/JavaParser.jay" { BooleanType BT = new BooleanType(); /* #JB# 05.04.2005 */ @@ -1893,14 +1963,14 @@ case 141: yyVal=BT; } break; -case 142: - // line 1306 "./../src/mycompiler/myparser/JavaParser.jay" +case 150: + // line 1339 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((BaseType)yyVals[0+yyTop]); } break; -case 143: - // line 1312 "./../src/mycompiler/myparser/JavaParser.jay" +case 151: + // line 1344 "./../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()); @@ -1919,39 +1989,39 @@ case 143: yyVal=RT; } break; -case 144: - // line 1332 "./../src/mycompiler/myparser/JavaParser.jay" +case 152: + // line 1364 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((DeclId)yyVals[0+yyTop]); } break; -case 145: - // line 1353 "./../src/mycompiler/myparser/JavaParser.jay" +case 153: + // line 1385 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((LocalVarDecl)yyVals[0+yyTop]); } break; -case 146: - // line 1357 "./../src/mycompiler/myparser/JavaParser.jay" +case 154: + // line 1389 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Statement)yyVals[0+yyTop]); } break; -case 147: - // line 1362 "./../src/mycompiler/myparser/JavaParser.jay" +case 155: + // line 1394 "./../src/mycompiler/myparser/JavaParser.jay" { - FormalParameter FP = new FormalParameter(); + FormalParameter FP = new FormalParameter(((DeclId)yyVals[0+yyTop])); FP.setType(((Type)yyVals[-1+yyTop])); - FP.set_DeclId(((DeclId)yyVals[0+yyTop])); + /*FP.set_DeclId($2); //auskommentiert von Andreas Stadelmeier. DeclId wird nun dem Konstruktor von FormalParameter übergeben.*/ yyVal=FP; } break; -case 148: - // line 1387 "./../src/mycompiler/myparser/JavaParser.jay" +case 156: + // line 1419 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("\nFunktionsdeklaration mit typlosen Parametern: " + ((DeclId)yyVals[0+yyTop]).name); - FormalParameter FP = new FormalParameter(); + FormalParameter FP = new FormalParameter(((DeclId)yyVals[0+yyTop])); /* #JB# 31.03.2005*/ /* ###########################################################*/ @@ -1961,34 +2031,34 @@ case 148: /*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])); + /*FP.set_DeclId($1);*/ yyVal=FP; } break; -case 149: - // line 1406 "./../src/mycompiler/myparser/JavaParser.jay" +case 157: + // line 1438 "./../src/mycompiler/myparser/JavaParser.jay" { ArgumentList AL = new ArgumentList(); AL.expr.addElement(((Expr)yyVals[0+yyTop])); yyVal=AL; } break; -case 150: - // line 1412 "./../src/mycompiler/myparser/JavaParser.jay" +case 158: + // line 1444 "./../src/mycompiler/myparser/JavaParser.jay" { ((ArgumentList)yyVals[-2+yyTop]).expr.addElement(((Expr)yyVals[0+yyTop])); yyVal=((ArgumentList)yyVals[-2+yyTop]); } break; -case 151: - // line 1418 "./../src/mycompiler/myparser/JavaParser.jay" +case 159: + // line 1450 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((BaseType)yyVals[0+yyTop]); } break; -case 152: - // line 1423 "./../src/mycompiler/myparser/JavaParser.jay" +case 160: + // line 1455 "./../src/mycompiler/myparser/JavaParser.jay" { DeclId DI = new DeclId(); /* #JB# 10.04.2005 */ @@ -2000,62 +2070,62 @@ case 152: yyVal=DI; } break; -case 153: - // line 1435 "./../src/mycompiler/myparser/JavaParser.jay" +case 161: + // line 1467 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 154: - // line 1440 "./../src/mycompiler/myparser/JavaParser.jay" +case 162: + // line 1472 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((LocalVarDecl)yyVals[-1+yyTop]); } break; -case 155: - // line 1445 "./../src/mycompiler/myparser/JavaParser.jay" +case 163: + // line 1477 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Statement)yyVals[0+yyTop]); } break; -case 156: - // line 1449 "./../src/mycompiler/myparser/JavaParser.jay" +case 164: + // line 1481 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((IfStmt)yyVals[0+yyTop]); } break; -case 157: - // line 1453 "./../src/mycompiler/myparser/JavaParser.jay" +case 165: + // line 1485 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((IfStmt)yyVals[0+yyTop]); } break; -case 158: - // line 1457 "./../src/mycompiler/myparser/JavaParser.jay" +case 166: + // line 1489 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((WhileStmt)yyVals[0+yyTop]); } break; -case 159: - // line 1461 "./../src/mycompiler/myparser/JavaParser.jay" +case 167: + // line 1493 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((ForStmt)yyVals[0+yyTop]); } break; -case 160: - // line 1466 "./../src/mycompiler/myparser/JavaParser.jay" +case 168: + // line 1498 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 161: - // line 1470 "./../src/mycompiler/myparser/JavaParser.jay" +case 169: + // line 1502 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((NewClass)yyVals[0+yyTop]); } break; -case 162: - // line 1475 "./../src/mycompiler/myparser/JavaParser.jay" +case 170: + // line 1507 "./../src/mycompiler/myparser/JavaParser.jay" { IntegerType IT = new IntegerType(); /* #JB# 05.04.2005 */ @@ -2065,8 +2135,8 @@ case 162: yyVal=IT; } break; -case 163: - // line 1484 "./../src/mycompiler/myparser/JavaParser.jay" +case 171: + // line 1516 "./../src/mycompiler/myparser/JavaParser.jay" { CharacterType CT = new CharacterType(); /* #JB# 05.04.2005 */ @@ -2076,8 +2146,8 @@ case 163: yyVal=CT; } break; -case 164: - // line 1494 "./../src/mycompiler/myparser/JavaParser.jay" +case 172: + // line 1526 "./../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()); @@ -2086,8 +2156,8 @@ case 164: yyVal = LVD; } break; -case 165: - // line 1505 "./../src/mycompiler/myparser/JavaParser.jay" +case 173: + // line 1537 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("P -> Lokale Variable angelegt!"); LocalVarDecl LVD = new LocalVarDecl(((FieldDeclaration)yyVals[0+yyTop]).getOffset(),((FieldDeclaration)yyVals[0+yyTop]).getVariableLength()); @@ -2096,32 +2166,32 @@ case 165: yyVal = LVD; } break; -case 166: - // line 1515 "./../src/mycompiler/myparser/JavaParser.jay" +case 174: + // line 1547 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Block)yyVals[0+yyTop]); } break; -case 167: - // line 1519 "./../src/mycompiler/myparser/JavaParser.jay" +case 175: + // line 1551 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((EmptyStmt)yyVals[0+yyTop]); } break; -case 168: - // line 1523 "./../src/mycompiler/myparser/JavaParser.jay" +case 176: + // line 1555 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((ExprStmt)yyVals[0+yyTop]); } break; -case 169: - // line 1527 "./../src/mycompiler/myparser/JavaParser.jay" +case 177: + // line 1559 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Return)yyVals[0+yyTop]); } break; -case 170: - // line 1532 "./../src/mycompiler/myparser/JavaParser.jay" +case 178: + // line 1564 "./../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])); @@ -2129,8 +2199,8 @@ case 170: yyVal=Ifst; } break; -case 171: - // line 1540 "./../src/mycompiler/myparser/JavaParser.jay" +case 179: + // line 1572 "./../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])); @@ -2139,8 +2209,8 @@ case 171: yyVal=IfstElst; } break; -case 172: - // line 1549 "./../src/mycompiler/myparser/JavaParser.jay" +case 180: + // line 1581 "./../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])); @@ -2148,8 +2218,8 @@ case 172: yyVal=Whlst; } break; -case 173: - // line 1560 "./../src/mycompiler/myparser/JavaParser.jay" +case 181: + // line 1592 "./../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])); @@ -2161,8 +2231,8 @@ case 173: yyVal = Fst; } break; -case 174: - // line 1572 "./../src/mycompiler/myparser/JavaParser.jay" +case 182: + // line 1604 "./../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])); @@ -2173,8 +2243,8 @@ case 174: yyVal = Fst; } break; -case 175: - // line 1583 "./../src/mycompiler/myparser/JavaParser.jay" +case 183: + // line 1615 "./../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])); @@ -2185,8 +2255,8 @@ case 175: yyVal = Fst; } break; -case 176: - // line 1594 "./../src/mycompiler/myparser/JavaParser.jay" +case 184: + // line 1626 "./../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])); @@ -2197,8 +2267,8 @@ case 176: yyVal = Fst; } break; -case 177: - // line 1605 "./../src/mycompiler/myparser/JavaParser.jay" +case 185: + // line 1637 "./../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])); @@ -2208,8 +2278,8 @@ case 177: yyVal = Fst; } break; -case 178: - // line 1615 "./../src/mycompiler/myparser/JavaParser.jay" +case 186: + // line 1647 "./../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])); @@ -2219,8 +2289,8 @@ case 178: yyVal = Fst; } break; -case 179: - // line 1625 "./../src/mycompiler/myparser/JavaParser.jay" +case 187: + // line 1657 "./../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])); @@ -2230,8 +2300,8 @@ case 179: yyVal = Fst; } break; -case 180: - // line 1635 "./../src/mycompiler/myparser/JavaParser.jay" +case 188: + // line 1667 "./../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])); @@ -2240,73 +2310,73 @@ case 180: yyVal = Fst; } break; -case 181: - // line 1644 "./../src/mycompiler/myparser/JavaParser.jay" +case 189: + // line 1676 "./../src/mycompiler/myparser/JavaParser.jay" { org.apache.log4j.Logger.getLogger("parser").debug("conditionalexpression"); yyVal=((Expr)yyVals[0+yyTop]); } break; -case 182: - // line 1649 "./../src/mycompiler/myparser/JavaParser.jay" +case 190: + // line 1681 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Assign)yyVals[0+yyTop]); } break; -case 183: - // line 1655 "./../src/mycompiler/myparser/JavaParser.jay" +case 191: + // line 1687 "./../src/mycompiler/myparser/JavaParser.jay" { EmptyStmt Empst = new EmptyStmt(); yyVal=Empst; } break; -case 184: - // line 1661 "./../src/mycompiler/myparser/JavaParser.jay" +case 192: + // line 1693 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[-1+yyTop]); } break; -case 185: - // line 1666 "./../src/mycompiler/myparser/JavaParser.jay" +case 193: + // line 1698 "./../src/mycompiler/myparser/JavaParser.jay" { Return ret = new Return(-1,-1); yyVal= ret; } break; -case 186: - // line 1671 "./../src/mycompiler/myparser/JavaParser.jay" +case 194: + // line 1703 "./../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])); yyVal=retexp; } break; -case 187: - // line 1678 "./../src/mycompiler/myparser/JavaParser.jay" +case 195: + // line 1710 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Statement)yyVals[0+yyTop]); } break; -case 188: - // line 1682 "./../src/mycompiler/myparser/JavaParser.jay" +case 196: + // line 1714 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((IfStmt)yyVals[0+yyTop]); } break; -case 189: - // line 1686 "./../src/mycompiler/myparser/JavaParser.jay" +case 197: + // line 1718 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((WhileStmt)yyVals[0+yyTop]); } break; -case 190: - // line 1691 "./../src/mycompiler/myparser/JavaParser.jay" +case 198: + // line 1723 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 191: - // line 1697 "./../src/mycompiler/myparser/JavaParser.jay" +case 199: + // line 1729 "./../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()); @@ -2332,8 +2402,8 @@ case 191: yyVal=Ass; } break; -case 192: - // line 1722 "./../src/mycompiler/myparser/JavaParser.jay" +case 200: + // line 1754 "./../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()); @@ -2356,44 +2426,44 @@ case 192: yyVal=Ass; } break; -case 193: - // line 1745 "./../src/mycompiler/myparser/JavaParser.jay" +case 201: + // line 1777 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Assign)yyVals[0+yyTop]); } break; -case 194: - // line 1749 "./../src/mycompiler/myparser/JavaParser.jay" +case 202: + // line 1781 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 195: - // line 1753 "./../src/mycompiler/myparser/JavaParser.jay" +case 203: + // line 1785 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 196: - // line 1757 "./../src/mycompiler/myparser/JavaParser.jay" +case 204: + // line 1789 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 197: - // line 1761 "./../src/mycompiler/myparser/JavaParser.jay" +case 205: + // line 1793 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 198: - // line 1765 "./../src/mycompiler/myparser/JavaParser.jay" +case 206: + // line 1797 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((MethodCall)yyVals[0+yyTop]); } break; -case 199: - // line 1776 "./../src/mycompiler/myparser/JavaParser.jay" +case 207: + // line 1808 "./../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])); @@ -2402,8 +2472,8 @@ case 199: yyVal=IfElno; } break; -case 200: - // line 1785 "./../src/mycompiler/myparser/JavaParser.jay" +case 208: + // line 1817 "./../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])); @@ -2411,14 +2481,14 @@ case 200: yyVal=Whstno; } break; -case 201: - // line 1793 "./../src/mycompiler/myparser/JavaParser.jay" +case 209: + // line 1825 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 202: - // line 1797 "./../src/mycompiler/myparser/JavaParser.jay" +case 210: + // line 1829 "./../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()); @@ -2429,20 +2499,20 @@ case 202: yyVal=LogOr; } break; -case 203: - // line 1810 "./../src/mycompiler/myparser/JavaParser.jay" +case 211: + // line 1842 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=null; } break; -case 204: - // line 1815 "./../src/mycompiler/myparser/JavaParser.jay" +case 212: + // line 1847 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Block)yyVals[0+yyTop]); } break; -case 205: - // line 1819 "./../src/mycompiler/myparser/JavaParser.jay" +case 213: + // line 1851 "./../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";}|*/ @@ -2452,20 +2522,20 @@ case 205: yyVal=ret; } break; -case 206: - // line 1829 "./../src/mycompiler/myparser/JavaParser.jay" +case 214: + // line 1861 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=null; } break; -case 207: - // line 1833 "./../src/mycompiler/myparser/JavaParser.jay" +case 215: + // line 1865 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((ParameterList)yyVals[-1+yyTop]); } break; -case 208: - // line 1838 "./../src/mycompiler/myparser/JavaParser.jay" +case 216: + // line 1870 "./../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])); @@ -2473,87 +2543,87 @@ case 208: yyVal=lambda; } break; -case 209: - // line 1857 "./../src/mycompiler/myparser/JavaParser.jay" +case 217: + // line 1889 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((UsedId)yyVals[0+yyTop]); } break; -case 210: - // line 1862 "./../src/mycompiler/myparser/JavaParser.jay" +case 218: + // line 1894 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=null; } break; -case 211: - // line 1866 "./../src/mycompiler/myparser/JavaParser.jay" +case 219: + // line 1898 "./../src/mycompiler/myparser/JavaParser.jay" { TimesOp TEO = new TimesOp(-1,-1); yyVal=TEO; } break; -case 212: - // line 1871 "./../src/mycompiler/myparser/JavaParser.jay" +case 220: + // line 1903 "./../src/mycompiler/myparser/JavaParser.jay" { DivideOp DEO = new DivideOp(-1,-1); yyVal=DEO; } break; -case 213: - // line 1876 "./../src/mycompiler/myparser/JavaParser.jay" +case 221: + // line 1908 "./../src/mycompiler/myparser/JavaParser.jay" { ModuloOp MEO = new ModuloOp(-1,-1); yyVal=MEO; } break; -case 214: - // line 1881 "./../src/mycompiler/myparser/JavaParser.jay" +case 222: + // line 1913 "./../src/mycompiler/myparser/JavaParser.jay" { PlusOp PEO = new PlusOp(-1,-1); yyVal=PEO; } break; -case 215: - // line 1886 "./../src/mycompiler/myparser/JavaParser.jay" +case 223: + // line 1918 "./../src/mycompiler/myparser/JavaParser.jay" { MinusOp MEO = new MinusOp(-1,-1); yyVal=MEO; } break; -case 216: - // line 1898 "./../src/mycompiler/myparser/JavaParser.jay" +case 224: + // line 1930 "./../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])); yyVal=PRINC; } break; -case 217: - // line 1905 "./../src/mycompiler/myparser/JavaParser.jay" +case 225: + // line 1937 "./../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])); yyVal=PRDEC; } break; -case 218: - // line 1912 "./../src/mycompiler/myparser/JavaParser.jay" +case 226: + // line 1944 "./../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])); yyVal=PIE; } break; -case 219: - // line 1919 "./../src/mycompiler/myparser/JavaParser.jay" +case 227: + // line 1951 "./../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])); yyVal=PDE; } break; -case 220: - // line 1927 "./../src/mycompiler/myparser/JavaParser.jay" +case 228: + // line 1959 "./../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()); @@ -2584,8 +2654,8 @@ case 220: yyVal=MC; } break; -case 221: - // line 1957 "./../src/mycompiler/myparser/JavaParser.jay" +case 229: + // line 1989 "./../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()); @@ -2617,8 +2687,8 @@ case 221: yyVal=MCarg; } break; -case 222: - // line 1988 "./../src/mycompiler/myparser/JavaParser.jay" +case 230: + // line 2020 "./../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()); @@ -2638,8 +2708,8 @@ case 222: yyVal=MCpr; } break; -case 223: - // line 2007 "./../src/mycompiler/myparser/JavaParser.jay" +case 231: + // line 2039 "./../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()); @@ -2660,8 +2730,8 @@ case 223: yyVal=MCPA; } break; -case 224: - // line 2030 "./../src/mycompiler/myparser/JavaParser.jay" +case 232: + // line 2062 "./../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])); @@ -2670,8 +2740,8 @@ case 224: yyVal=NC; } break; -case 225: - // line 2038 "./../src/mycompiler/myparser/JavaParser.jay" +case 233: + // line 2070 "./../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])); @@ -2681,14 +2751,14 @@ case 225: yyVal=NCarg; } break; -case 226: - // line 2048 "./../src/mycompiler/myparser/JavaParser.jay" +case 234: + // line 2080 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 227: - // line 2052 "./../src/mycompiler/myparser/JavaParser.jay" +case 235: + // line 2084 "./../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()); @@ -2699,20 +2769,20 @@ case 227: yyVal=And; } break; -case 228: - // line 2068 "./../src/mycompiler/myparser/JavaParser.jay" +case 236: + // line 2100 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 229: - // line 2072 "./../src/mycompiler/myparser/JavaParser.jay" +case 237: + // line 2104 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 230: - // line 2076 "./../src/mycompiler/myparser/JavaParser.jay" +case 238: + // line 2108 "./../src/mycompiler/myparser/JavaParser.jay" { PositivExpr POSEX=new PositivExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); UnaryPlus UP= new UnaryPlus(); @@ -2721,8 +2791,8 @@ case 230: yyVal=POSEX; } break; -case 231: - // line 2084 "./../src/mycompiler/myparser/JavaParser.jay" +case 239: + // line 2116 "./../src/mycompiler/myparser/JavaParser.jay" { NegativeExpr NEGEX=new NegativeExpr(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); UnaryMinus UM=new UnaryMinus(); @@ -2731,20 +2801,20 @@ case 231: yyVal=NEGEX; } break; -case 232: - // line 2092 "./../src/mycompiler/myparser/JavaParser.jay" +case 240: + // line 2124 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 233: - // line 2097 "./../src/mycompiler/myparser/JavaParser.jay" +case 241: + // line 2129 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 234: - // line 2101 "./../src/mycompiler/myparser/JavaParser.jay" +case 242: + // line 2133 "./../src/mycompiler/myparser/JavaParser.jay" { if (((UsedId)yyVals[0+yyTop]).get_Name().size() > 1) { @@ -2763,38 +2833,38 @@ case 234: } } break; -case 235: - // line 2119 "./../src/mycompiler/myparser/JavaParser.jay" +case 243: + // line 2151 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 236: - // line 2123 "./../src/mycompiler/myparser/JavaParser.jay" +case 244: + // line 2155 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 237: - // line 2128 "./../src/mycompiler/myparser/JavaParser.jay" +case 245: + // line 2160 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 238: - // line 2133 "./../src/mycompiler/myparser/JavaParser.jay" +case 246: + // line 2165 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 240: - // line 2139 "./../src/mycompiler/myparser/JavaParser.jay" +case 248: + // line 2171 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Literal)yyVals[0+yyTop]); } break; -case 241: - // line 2143 "./../src/mycompiler/myparser/JavaParser.jay" +case 249: + // line 2175 "./../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()); @@ -2803,24 +2873,24 @@ case 241: yyVal=T; } break; -case 242: - // line 2164 "./../src/mycompiler/myparser/JavaParser.jay" +case 250: + // line 2196 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((MethodCall)yyVals[0+yyTop]); } break; -case 243: - // line 2168 "./../src/mycompiler/myparser/JavaParser.jay" +case 251: + // line 2200 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 244: - // line 2173 "./../src/mycompiler/myparser/JavaParser.jay" +case 252: + // line 2205 "./../src/mycompiler/myparser/JavaParser.jay" {yyVal=((Expr)yyVals[0+yyTop]);} break; -case 245: - // line 2175 "./../src/mycompiler/myparser/JavaParser.jay" +case 253: + // line 2207 "./../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); @@ -2828,75 +2898,75 @@ case 245: yyVal=NE; } break; -case 246: - // line 2181 "./../src/mycompiler/myparser/JavaParser.jay" +case 254: + // line 2213 "./../src/mycompiler/myparser/JavaParser.jay" {yyVal=((CastExpr)yyVals[0+yyTop]);} break; -case 247: - // line 2183 "./../src/mycompiler/myparser/JavaParser.jay" +case 255: + // line 2215 "./../src/mycompiler/myparser/JavaParser.jay" {yyVal=((Expr)yyVals[0+yyTop]);} break; -case 249: - // line 2188 "./../src/mycompiler/myparser/JavaParser.jay" +case 257: + // line 2220 "./../src/mycompiler/myparser/JavaParser.jay" {IntLiteral IL = new IntLiteral(); IL.set_Int(((Token)yyVals[0+yyTop]).String2Int()); yyVal = IL; } break; -case 250: - // line 2193 "./../src/mycompiler/myparser/JavaParser.jay" +case 258: + // line 2225 "./../src/mycompiler/myparser/JavaParser.jay" {BoolLiteral BL = new BoolLiteral(); BL.set_Bool(((Token)yyVals[0+yyTop]).String2Bool()); yyVal = BL; } break; -case 251: - // line 2197 "./../src/mycompiler/myparser/JavaParser.jay" +case 259: + // line 2229 "./../src/mycompiler/myparser/JavaParser.jay" {CharLiteral CL = new CharLiteral(); CL.set_Char(((Token)yyVals[0+yyTop]).CharInString()); yyVal=CL; } break; -case 252: - // line 2202 "./../src/mycompiler/myparser/JavaParser.jay" +case 260: + // line 2234 "./../src/mycompiler/myparser/JavaParser.jay" { StringLiteral ST = new StringLiteral(); ST.set_String(((Token)yyVals[0+yyTop]).get_String()); yyVal=ST; } break; -case 253: - // line 2207 "./../src/mycompiler/myparser/JavaParser.jay" +case 261: + // line 2239 "./../src/mycompiler/myparser/JavaParser.jay" { LongLiteral LL = new LongLiteral(); LL.set_Long(((Token)yyVals[0+yyTop]).String2Long()); yyVal = LL; } break; -case 254: - // line 2211 "./../src/mycompiler/myparser/JavaParser.jay" +case 262: + // line 2243 "./../src/mycompiler/myparser/JavaParser.jay" { FloatLiteral FL = new FloatLiteral(); FL.set_Float(((Token)yyVals[0+yyTop]).String2Float()); yyVal = FL; } break; -case 255: - // line 2216 "./../src/mycompiler/myparser/JavaParser.jay" +case 263: + // line 2248 "./../src/mycompiler/myparser/JavaParser.jay" { DoubleLiteral DL = new DoubleLiteral(); DL.set_Double(((Token)yyVals[0+yyTop]).String2Double()); yyVal = DL; } break; -case 256: - // line 2222 "./../src/mycompiler/myparser/JavaParser.jay" +case 264: + // line 2254 "./../src/mycompiler/myparser/JavaParser.jay" { Null NN = new Null(); yyVal=NN; } break; -case 257: - // line 2228 "./../src/mycompiler/myparser/JavaParser.jay" +case 265: + // line 2260 "./../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])); @@ -2904,25 +2974,25 @@ case 257: yyVal=CaEx; } break; -case 258: - // line 2237 "./../src/mycompiler/myparser/JavaParser.jay" +case 266: + // line 2269 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 259: - // line 2241 "./../src/mycompiler/myparser/JavaParser.jay" +case 267: + // line 2273 "./../src/mycompiler/myparser/JavaParser.jay" { } break; -case 260: - // line 2245 "./../src/mycompiler/myparser/JavaParser.jay" +case 268: + // line 2277 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 261: - // line 2249 "./../src/mycompiler/myparser/JavaParser.jay" +case 269: + // line 2281 "./../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()); @@ -2933,8 +3003,8 @@ case 261: yyVal=EQ; } break; -case 262: - // line 2259 "./../src/mycompiler/myparser/JavaParser.jay" +case 270: + // line 2291 "./../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()); @@ -2945,14 +3015,14 @@ case 262: yyVal=NEQ; } break; -case 263: - // line 2270 "./../src/mycompiler/myparser/JavaParser.jay" +case 271: + // line 2302 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 264: - // line 2274 "./../src/mycompiler/myparser/JavaParser.jay" +case 272: + // line 2306 "./../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()); @@ -2963,8 +3033,8 @@ case 264: yyVal=LO; } break; -case 265: - // line 2284 "./../src/mycompiler/myparser/JavaParser.jay" +case 273: + // line 2316 "./../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()); @@ -2975,8 +3045,8 @@ case 265: yyVal=GO; } break; -case 266: - // line 2294 "./../src/mycompiler/myparser/JavaParser.jay" +case 274: + // line 2326 "./../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()); @@ -2987,8 +3057,8 @@ case 266: yyVal=LE; } break; -case 267: - // line 2304 "./../src/mycompiler/myparser/JavaParser.jay" +case 275: + // line 2336 "./../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()); @@ -2999,8 +3069,8 @@ case 267: yyVal=GE; } break; -case 268: - // line 2314 "./../src/mycompiler/myparser/JavaParser.jay" +case 276: + // line 2346 "./../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])); @@ -3008,20 +3078,20 @@ case 268: yyVal=ISO; } break; -case 269: - // line 2322 "./../src/mycompiler/myparser/JavaParser.jay" +case 277: + // line 2354 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 270: - // line 2327 "./../src/mycompiler/myparser/JavaParser.jay" +case 278: + // line 2359 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 271: - // line 2331 "./../src/mycompiler/myparser/JavaParser.jay" +case 279: + // line 2363 "./../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()); @@ -3032,8 +3102,8 @@ case 271: yyVal=AD; } break; -case 272: - // line 2341 "./../src/mycompiler/myparser/JavaParser.jay" +case 280: + // line 2373 "./../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()); @@ -3044,14 +3114,14 @@ case 272: yyVal=MI; } break; -case 273: - // line 2352 "./../src/mycompiler/myparser/JavaParser.jay" +case 281: + // line 2384 "./../src/mycompiler/myparser/JavaParser.jay" { yyVal=((Expr)yyVals[0+yyTop]); } break; -case 274: - // line 2356 "./../src/mycompiler/myparser/JavaParser.jay" +case 282: + // line 2388 "./../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()); @@ -3062,8 +3132,8 @@ case 274: yyVal=ML; } break; -case 275: - // line 2366 "./../src/mycompiler/myparser/JavaParser.jay" +case 283: + // line 2398 "./../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()); @@ -3074,8 +3144,8 @@ case 275: yyVal = DV; } break; -case 276: - // line 2376 "./../src/mycompiler/myparser/JavaParser.jay" +case 284: + // line 2408 "./../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()); @@ -3086,7 +3156,7 @@ case 276: yyVal =MD; } break; - // line 3090 "-" + // line 3160 "-" } yyTop -= yyLen[yyN]; yyState = yyStates[yyTop]; @@ -3117,996 +3187,863 @@ case 276: } protected static final short yyLhs [] = { -1, - 0, 98, 26, 26, 25, 92, 92, 27, 27, 105, - 23, 24, 24, 22, 1, 1, 1, 1, 1, 1, - 1, 1, 9, 9, 8, 8, 2, 2, 2, 2, - 112, 112, 112, 112, 112, 112, 114, 114, 114, 7, - 7, 40, 40, 28, 32, 32, 3, 3, 33, 33, - 15, 15, 41, 41, 41, 41, 41, 41, 29, 4, - 4, 31, 16, 16, 16, 30, 113, 113, 5, 5, - 17, 17, 110, 106, 106, 10, 6, 19, 11, 11, - 11, 11, 11, 13, 42, 42, 107, 107, 108, 108, - 108, 108, 48, 94, 97, 97, 93, 93, 95, 95, - 96, 96, 12, 12, 12, 12, 12, 12, 12, 12, + 0, 0, 0, 0, 0, 98, 26, 26, 25, 92, + 92, 27, 27, 105, 105, 23, 24, 24, 22, 1, + 1, 1, 1, 1, 1, 1, 1, 9, 9, 8, + 8, 2, 2, 2, 2, 112, 112, 112, 112, 112, + 112, 115, 115, 115, 7, 7, 40, 40, 28, 32, + 32, 3, 3, 33, 33, 15, 15, 41, 41, 41, + 41, 41, 41, 29, 4, 4, 31, 16, 16, 16, + 30, 113, 113, 114, 114, 5, 5, 17, 17, 110, + 106, 106, 10, 6, 19, 11, 11, 11, 11, 11, + 11, 13, 42, 42, 107, 107, 108, 108, 108, 108, + 48, 94, 97, 97, 93, 93, 95, 95, 96, 96, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 39, 39, 39, 39, 18, 18, 43, - 44, 44, 50, 50, 109, 109, 38, 38, 14, 14, - 36, 36, 37, 20, 80, 80, 49, 49, 103, 103, - 35, 21, 78, 46, 81, 81, 81, 81, 81, 71, - 71, 34, 34, 47, 47, 79, 79, 79, 79, 86, - 87, 83, 84, 84, 84, 84, 84, 84, 84, 84, - 69, 69, 89, 77, 90, 90, 82, 82, 82, 68, - 99, 99, 72, 72, 72, 72, 72, 72, 88, 85, - 67, 67, 101, 45, 45, 51, 51, 70, 102, 100, - 100, 100, 100, 100, 100, 73, 74, 75, 76, 104, - 104, 104, 104, 91, 91, 66, 66, 57, 57, 57, - 57, 57, 55, 55, 55, 55, 54, 65, 65, 53, - 53, 53, 53, 56, 56, 56, 64, 64, 52, 52, - 52, 52, 52, 52, 52, 52, 111, 63, 63, 62, - 62, 62, 61, 61, 61, 61, 61, 61, 60, 59, - 59, 59, 58, 58, 58, 58, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 39, 39, 39, 39, 18, 18, 43, 44, 44, + 50, 50, 109, 109, 38, 38, 14, 14, 36, 36, + 37, 20, 80, 80, 49, 49, 103, 103, 35, 21, + 78, 46, 81, 81, 81, 81, 81, 71, 71, 34, + 34, 47, 47, 79, 79, 79, 79, 86, 87, 83, + 84, 84, 84, 84, 84, 84, 84, 84, 69, 69, + 89, 77, 90, 90, 82, 82, 82, 68, 99, 99, + 72, 72, 72, 72, 72, 72, 88, 85, 67, 67, + 101, 45, 45, 51, 51, 70, 102, 100, 100, 100, + 100, 100, 100, 73, 74, 75, 76, 104, 104, 104, + 104, 91, 91, 66, 66, 57, 57, 57, 57, 57, + 55, 55, 55, 55, 54, 65, 65, 53, 53, 53, + 53, 56, 56, 56, 64, 64, 52, 52, 52, 52, + 52, 52, 52, 52, 111, 63, 63, 62, 62, 62, + 61, 61, 61, 61, 61, 61, 60, 59, 59, 59, + 58, 58, 58, 58, }; protected static final short yyLen [] = { 2, - 1, 3, 1, 2, 3, 1, 2, 1, 1, 1, - 3, 3, 3, 1, 3, 4, 4, 5, 4, 5, - 5, 6, 1, 4, 1, 4, 3, 4, 4, 5, - 1, 4, 1, 3, 6, 3, 1, 3, 3, 2, - 3, 1, 2, 2, 2, 3, 2, 3, 2, 3, - 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 2, 0, 3, 1, 1, - 1, 1, 2, 2, 3, 6, 2, 3, 2, 2, - 2, 3, 4, 2, 2, 3, 3, 4, 2, 3, - 3, 4, 2, 1, 1, 3, 1, 3, 1, 3, - 1, 3, 5, 2, 3, 6, 3, 6, 4, 7, - 2, 3, 3, 4, 5, 6, 6, 7, 1, 4, - 2, 2, 3, 1, 3, 1, 3, 1, 3, 1, - 1, 2, 1, 3, 4, 5, 1, 3, 3, 4, - 1, 1, 1, 1, 1, 1, 2, 1, 1, 3, - 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 1, 1, 1, 1, 1, 5, - 7, 5, 9, 8, 8, 8, 7, 7, 7, 6, - 1, 1, 1, 2, 2, 3, 1, 1, 1, 1, - 3, 3, 1, 1, 1, 1, 1, 1, 7, 5, - 1, 3, 1, 1, 1, 2, 3, 3, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, - 4, 5, 6, 4, 5, 1, 3, 1, 1, 2, - 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, + 1, 2, 3, 2, 3, 3, 1, 2, 3, 1, + 2, 1, 1, 1, 1, 3, 3, 3, 1, 3, + 4, 4, 5, 4, 5, 5, 6, 1, 4, 1, + 4, 3, 4, 4, 5, 1, 4, 1, 3, 6, + 3, 1, 3, 3, 2, 3, 1, 2, 2, 2, + 3, 2, 3, 2, 3, 1, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, + 2, 1, 3, 0, 3, 1, 1, 1, 1, 2, + 2, 3, 6, 2, 3, 2, 3, 6, 2, 3, + 4, 2, 2, 3, 3, 4, 2, 3, 3, 4, + 2, 1, 1, 3, 1, 3, 1, 3, 1, 3, + 5, 2, 3, 6, 3, 6, 4, 7, 2, 3, + 3, 4, 5, 6, 6, 7, 1, 4, 2, 2, + 3, 1, 3, 1, 3, 1, 3, 1, 1, 2, + 1, 3, 4, 5, 1, 3, 3, 4, 1, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 1, 3, 1, - 3, 3, 1, 3, 3, 3, 3, 3, 1, 1, - 3, 3, 1, 3, 3, 3, + 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 1, 1, 1, 5, 7, 5, + 9, 8, 8, 8, 7, 7, 7, 6, 1, 1, + 1, 2, 2, 3, 1, 1, 1, 1, 3, 3, + 1, 1, 1, 1, 1, 1, 7, 5, 1, 3, + 1, 1, 1, 2, 3, 3, 1, 1, 1, 1, + 1, 1, 1, 2, 2, 2, 2, 3, 4, 5, + 6, 4, 5, 1, 3, 1, 1, 2, 2, 1, + 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, + 1, 1, 2, 1, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 1, 4, 1, 3, 1, 3, 3, + 1, 3, 3, 3, 3, 3, 1, 1, 3, 3, + 1, 3, 3, 3, }; protected static final short yyDefRed [] = { 0, - 57, 0, 58, 55, 54, 53, 56, 0, 10, 0, - 42, 0, 6, 0, 0, 0, 43, 7, 0, 0, - 0, 0, 15, 0, 0, 0, 0, 94, 95, 0, - 14, 0, 44, 59, 62, 45, 141, 163, 162, 0, - 0, 0, 0, 40, 71, 0, 72, 0, 0, 51, - 63, 0, 0, 0, 144, 0, 143, 151, 142, 0, - 0, 0, 0, 65, 0, 64, 17, 0, 0, 19, - 16, 0, 0, 0, 0, 26, 0, 66, 0, 73, - 0, 0, 0, 101, 0, 130, 84, 0, 122, 41, - 52, 0, 81, 79, 0, 0, 0, 0, 0, 0, - 0, 80, 0, 0, 0, 0, 0, 0, 0, 74, - 21, 46, 18, 0, 20, 99, 0, 96, 0, 0, - 0, 33, 0, 0, 0, 241, 0, 249, 253, 255, - 254, 250, 256, 251, 252, 0, 0, 0, 183, 85, - 0, 0, 128, 0, 8, 0, 0, 166, 0, 145, - 0, 0, 240, 237, 0, 0, 243, 0, 194, 195, - 0, 0, 168, 155, 131, 146, 158, 159, 156, 157, - 167, 169, 193, 0, 0, 113, 139, 148, 0, 133, - 0, 0, 0, 137, 0, 152, 129, 0, 0, 0, - 0, 0, 9, 0, 232, 273, 0, 0, 263, 0, - 0, 0, 0, 0, 0, 0, 181, 160, 78, 228, - 229, 235, 236, 161, 182, 242, 246, 87, 0, 125, - 127, 107, 82, 0, 0, 123, 0, 0, 75, 0, - 89, 0, 0, 22, 0, 0, 0, 0, 0, 68, - 0, 0, 185, 0, 0, 0, 216, 217, 206, 0, - 0, 0, 0, 86, 132, 154, 203, 0, 0, 218, - 219, 184, 214, 215, 211, 212, 213, 210, 0, 147, - 0, 140, 102, 0, 120, 0, 0, 0, 0, 230, - 231, 245, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, - 114, 0, 109, 83, 0, 91, 90, 0, 100, 0, - 38, 39, 0, 36, 0, 0, 0, 186, 0, 207, - 11, 220, 149, 0, 204, 208, 205, 0, 191, 192, - 134, 0, 0, 138, 0, 0, 274, 275, 276, 0, - 0, 268, 266, 267, 264, 265, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 92, 32, 0, - 0, 0, 0, 0, 0, 0, 221, 0, 117, 108, - 224, 0, 257, 0, 0, 135, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 170, 0, 189, 188, - 172, 150, 222, 0, 225, 118, 110, 136, 35, 180, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, - 179, 178, 0, 177, 0, 0, 0, 0, 0, 171, - 176, 175, 174, 0, 0, 0, 173, 0, 200, 0, - 199, - }; - protected static final short yyDgoto [] = { 8, - 9, 0, 0, 0, 0, 0, 23, 15, 0, 0, - 45, 46, 47, 48, 49, 50, 51, 142, 53, 143, - 55, 193, 145, 0, 0, 0, 146, 24, 33, 57, - 36, 25, 0, 58, 59, 60, 61, 185, 147, 10, - 11, 148, 87, 149, 326, 150, 151, 89, 180, 250, - 152, 153, 154, 155, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 157, - 323, 158, 210, 211, 212, 213, 163, 0, 164, 165, - 166, 388, 167, 168, 389, 169, 170, 390, 171, 172, - 214, 12, 28, 29, 117, 85, 30, 0, 173, 269, - 258, 174, 324, 216, 13, 64, 65, 110, 233, 66, - 217, 121, 78, 122, - }; - protected static final short yySindex [] = { 249, - 0, -251, 0, 0, 0, 0, 0, 0, 0, 332, - 0, 249, 0, 9, -104, -251, 0, 0, -241, -208, - -208, 1029, 0, -88, -1, -104, -170, 0, 0, 20, - 0, 100, 0, 0, 0, 0, 0, 0, 0, 33, - -139, 144, -241, 0, 0, 33, 0, -78, 1351, 0, - 0, 70, 137, 155, 0, 25, 0, 0, 0, 114, - 129, -70, 1946, 0, 99, 0, 0, -1, -208, 0, - 0, -88, -1, -208, -241, 0, -59, 0, 3006, 0, - 144, -78, -17, 0, 29, 0, 0, -208, 0, 0, - 0, -55, 0, 0, 941, -14, 165, 204, 144, -78, - 111, 0, -139, 144, -241, -78, -70, 99, 3058, 0, - 0, 0, 0, -1, 0, 0, 269, 0, 252, -73, - 42, 0, 273, 276, 462, 0, 277, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 968, 968, 0, 0, - 34, 275, 0, 100, 0, 61, -55, 0, 3110, 0, - 265, -3, 0, 0, 274, -118, 0, 268, 0, 0, + 62, 149, 171, 0, 63, 170, 60, 59, 58, 0, + 0, 0, 61, 19, 0, 14, 15, 0, 7, 0, + 151, 159, 150, 0, 0, 0, 0, 47, 0, 0, + 10, 0, 0, 13, 12, 0, 0, 0, 0, 0, + 0, 71, 8, 0, 0, 0, 0, 0, 0, 48, + 11, 0, 0, 0, 0, 0, 0, 20, 0, 0, + 6, 0, 9, 0, 0, 0, 0, 32, 0, 72, + 0, 133, 135, 5, 0, 0, 0, 0, 102, 103, + 0, 49, 64, 67, 50, 0, 0, 0, 0, 45, + 78, 0, 79, 0, 0, 56, 68, 0, 0, 0, + 152, 0, 0, 0, 70, 0, 69, 22, 0, 0, + 24, 16, 0, 18, 0, 54, 0, 0, 52, 0, + 65, 77, 76, 0, 0, 0, 0, 34, 0, 75, + 21, 0, 0, 33, 0, 0, 0, 31, 0, 80, + 0, 0, 0, 109, 0, 138, 92, 0, 130, 46, + 57, 0, 89, 86, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 81, 26, 51, 29, + 0, 53, 66, 84, 0, 55, 73, 23, 0, 25, + 35, 107, 0, 104, 0, 0, 0, 249, 0, 257, + 261, 263, 262, 258, 264, 259, 260, 0, 0, 0, + 191, 93, 0, 0, 136, 0, 0, 0, 174, 0, + 153, 0, 0, 248, 245, 0, 0, 251, 0, 202, + 203, 0, 0, 176, 163, 139, 154, 166, 167, 164, + 165, 175, 177, 201, 0, 0, 121, 147, 156, 0, + 141, 0, 0, 0, 145, 0, 160, 137, 0, 0, + 0, 0, 0, 0, 240, 281, 0, 0, 271, 0, + 0, 0, 0, 0, 0, 0, 189, 168, 85, 236, + 237, 243, 244, 169, 190, 250, 254, 95, 0, 115, + 90, 87, 0, 0, 131, 0, 0, 82, 0, 97, + 0, 0, 0, 0, 27, 0, 0, 0, 193, 0, + 0, 0, 224, 225, 214, 0, 0, 0, 94, 140, + 162, 211, 0, 0, 226, 227, 192, 222, 223, 219, + 220, 221, 218, 0, 155, 0, 148, 110, 0, 128, + 0, 0, 0, 0, 238, 239, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -44, 0, 0, 0, 0, -55, 0, - 107, -241, -196, 0, 284, 0, 0, -208, 34, 968, - 968, 968, 0, -118, 0, 0, 167, 83, 0, -54, - -120, 291, 237, 208, 26, 36, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 169, 0, - 0, 0, 0, -78, 59, 0, -78, 117, 0, 304, - 0, 3167, 3211, 0, -208, -59, -208, -208, -18, 0, - 579, 941, 0, 290, 941, 61, 0, 0, 0, 177, - 49, 616, 275, 0, 0, 0, 0, 426, 58, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 941, 0, - -93, 0, 0, -139, 0, -139, -208, 321, 5, 0, - 0, 0, 968, 968, 968, 968, 968, -208, 968, 968, - 968, 968, 968, 968, 968, 968, 968, 968, 968, 0, - 0, -128, 0, 0, 633, 0, 0, 3269, 0, 62, - 0, 0, 302, 0, 671, 308, 327, 0, 329, 0, - 0, 0, 0, 189, 0, 0, 0, 331, 0, 0, - 0, -78, -78, 0, 698, 968, 0, 0, 0, 167, - 167, 0, 0, 0, 0, 0, -54, -54, -120, 291, - 237, 208, 26, -139, -139, 314, 191, 0, 0, -59, - 735, 318, 778, 1489, 2205, 941, 0, 805, 0, 0, - 0, 199, 0, -78, -78, 0, 323, 71, 2205, 338, - 822, 849, 325, 340, 345, 0, 0, 119, 0, 0, - 0, 0, 0, 261, 0, 0, 0, 0, 0, 0, - 2205, 2205, 347, 2205, 350, 904, 941, 941, 2205, 0, - 0, 0, 2205, 0, 2205, 2205, 351, 352, 355, 0, - 0, 0, 0, 2205, 1489, 1489, 0, 134, 0, 1489, - 0, + 0, 0, 0, 0, 96, 122, 0, 117, 91, 0, + 99, 98, 0, 0, 0, 108, 0, 0, 0, 194, + 0, 215, 228, 157, 0, 212, 216, 213, 0, 199, + 200, 142, 0, 0, 0, 0, 146, 0, 0, 282, + 283, 284, 0, 0, 276, 274, 275, 272, 273, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 0, 0, 0, 0, 229, 0, + 125, 116, 88, 232, 0, 265, 0, 0, 143, 0, + 83, 0, 0, 0, 0, 0, 0, 0, 0, 178, + 0, 197, 196, 180, 158, 230, 0, 233, 126, 118, + 144, 188, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 231, 187, 186, 0, 185, 0, 0, 0, 0, + 0, 179, 184, 183, 182, 0, 0, 0, 181, 0, + 208, 0, 207, + }; + protected static final short yyDgoto [] = { 15, + 16, 17, 68, 120, 121, 122, 58, 33, 40, 123, + 91, 92, 93, 94, 95, 96, 97, 204, 99, 205, + 101, 34, 35, 37, 19, 20, 207, 59, 82, 21, + 85, 60, 69, 22, 23, 24, 25, 246, 208, 27, + 28, 209, 147, 210, 377, 211, 212, 149, 241, 306, + 213, 214, 215, 216, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 218, + 374, 219, 270, 271, 272, 273, 224, 0, 225, 226, + 227, 441, 228, 229, 442, 230, 231, 443, 232, 233, + 274, 29, 79, 80, 183, 145, 81, 30, 275, 324, + 313, 235, 375, 276, 31, 105, 106, 167, 292, 107, + 277, 0, 71, 42, 0, + }; + protected static final short yySindex [] = { 1681, + 0, 0, 0, -271, 0, 0, 0, 0, 0, -257, + -257, -240, 0, 0, 0, 0, 0, 27, 0, 710, + 0, 0, 0, 116, 121, 110, 1768, 0, 1799, 710, + 0, 92, -96, 0, 0, 24, 181, 168, 186, -97, + 110, 0, 0, 1799, 212, 223, 1681, -271, -240, 0, + 0, 710, 1799, 55, -257, -257, 2449, 0, -112, 5, + 0, 59, 0, -37, 55, -257, 2480, 0, 11, 0, + 159, 0, 0, 0, -96, -97, 1799, 54, 0, 0, + 175, 0, 0, 0, 0, 254, 82, 356, 55, 0, + 0, 254, 0, 114, 2515, 0, 0, 73, 365, 369, + 0, 64, 144, 1947, 0, 345, 0, 0, 5, -257, + 0, 0, 0, 0, 182, 0, 356, 55, 0, 2543, + 0, 0, 0, 398, 82, 1947, -257, 0, 110, 0, + 0, -112, 5, 0, 11, -257, 55, 0, 2027, 0, + 356, 114, 97, 0, 205, 0, 0, -257, 0, 0, + 0, 180, 0, 0, 935, 112, 356, 114, 289, 427, + 82, 55, 114, 144, 345, 2075, 0, 0, 0, 0, + 331, 0, 0, 0, 189, 0, 0, 0, 5, 0, + 0, 0, 449, 0, 451, 457, 463, 0, 458, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 543, 543, + 0, 0, 154, 456, 0, 27, 134, 180, 0, 2119, + 0, 442, 173, 0, 0, 459, -13, 0, 450, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -55, 0, 0, 0, 0, 180, + 0, 38, 55, 344, 0, 466, 0, 0, -257, 154, + 543, 543, 543, -13, 0, 0, 432, 70, 0, 3, + -66, 473, 418, 393, 213, 215, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 207, 0, + 0, 0, 114, 348, 0, 114, 308, 0, 479, 0, + 2163, 2228, 344, 41, 0, -257, 501, 935, 0, 464, + 935, 134, 0, 0, 0, 245, 518, 456, 0, 0, + 0, 0, 572, 226, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 935, 0, 412, 0, 0, 82, 0, + 144, -257, 484, 28, 0, 0, 0, 543, 543, 543, + 543, 543, -257, 543, 543, 543, 543, 543, 543, 543, + 543, 543, 543, 543, 0, 0, 352, 0, 0, 601, + 0, 0, 2272, 82, 935, 0, 663, 477, 497, 0, + 502, 0, 0, 0, 309, 0, 0, 0, 512, 0, + 0, 0, 114, 114, 483, 369, 0, 702, 543, 0, + 0, 0, 432, 432, 0, 0, 0, 0, 0, 3, + 3, -66, 473, 418, 393, 213, 82, 82, 494, 397, + 0, 496, 734, 498, 789, 2319, 2364, 935, 0, 817, + 0, 0, 0, 0, 431, 0, 114, 114, 0, 505, + 0, 2364, 515, 844, 871, 506, 528, 530, 0, 0, + 306, 0, 0, 0, 0, 0, 439, 0, 0, 0, + 0, 0, 2364, 2364, 534, 2364, 536, 899, 935, 935, + 2364, 0, 0, 0, 2364, 0, 2364, 2364, 538, 541, + 551, 0, 0, 0, 0, 2364, 2319, 2319, 0, 317, + 0, 2319, 0, }; protected static final short yyRindex [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 403, 0, -89, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 74, 0, 0, 0, - 0, 1123, 0, 0, 0, 0, 0, 0, 0, 2588, - 0, -23, 0, 0, 0, 0, 0, 282, 0, 0, - 0, 0, 0, 139, 0, -84, 0, 0, 0, 106, - 109, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1009, 0, 0, + 0, 0, 0, 2320, 2421, 0, 0, 0, 593, 0, + 0, -95, 0, 0, 0, 0, 0, 0, -92, 0, + 0, 0, 0, 594, 0, 0, 0, 0, 0, 0, + 0, 0, 596, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 292, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 91, 293, - 0, 0, 0, -50, 0, 297, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 76, 0, 87, 96, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, - 0, 362, 0, 320, 0, 526, 0, 0, 0, 0, - 0, 0, 0, 0, 1237, 0, 0, 0, 0, 0, - -45, 2, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -43, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 299, 0, 0, 0, 0, 0, - 0, 0, 0, 2981, 0, 0, 2708, 2152, 0, 2428, - 2254, 1292, 1398, 1543, 1602, 1671, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 301, 0, 0, 305, 0, 0, -41, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1708, 0, 0, 0, 0, - 0, 0, 380, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 106, 0, + 0, 0, 0, 0, 0, 0, 597, 363, 0, 0, + 0, 0, 0, 0, 0, 2571, 0, 12, 0, 0, + 0, 0, 0, -26, 0, 0, 0, 0, 0, 310, + 0, -88, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 164, 0, 0, 0, -48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 259, 61, 0, 0, + 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 97, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 378, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -24, 0, 0, + 0, 0, 0, 539, 0, 416, 620, 0, 0, 0, + 0, 0, 0, 0, 0, 1214, 0, 0, 0, 0, + 0, -52, -21, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -36, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 71, 0, 0, 0, 0, + 0, 0, 0, 1957, 0, 0, 1816, 1669, 0, 1565, + 1706, 1260, 1286, 1314, 1352, 1378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 317, 324, 0, 0, 0, 0, 0, 0, 2780, - 2870, 0, 0, 0, 0, 0, 2529, 2619, 2343, 1794, - 1879, 1981, 2067, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 76, 0, 0, 77, 0, 0, -28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 328, 333, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1192, 0, 0, 0, 0, + 0, 1389, 0, 0, 0, 0, 0, 544, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, + 0, 0, 78, 81, 0, 0, 0, 0, 0, 0, + 0, 0, 1859, 1887, 0, 0, 0, 0, 0, 1764, + 1790, 1732, 1415, 1452, 1511, 1590, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 83, 85, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1983, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, }; - protected static final short yyGindex [] = { 0, - 0, 0, 0, 0, 0, 0, 558, 398, 0, 0, - 0, 0, 0, -40, 0, 394, 0, -10, 382, 27, - -2, 465, 0, 0, 0, 0, 2657, 420, -77, 11, - 379, 53, 0, 0, 0, 266, -49, 0, -9, 35, - 37, -31, 0, -67, 0, 0, 0, -80, 187, -25, - 0, 0, 0, 0, -79, 0, -82, 3, 0, 143, - -56, 170, 164, 179, 182, 163, 0, 0, 214, 0, - 196, 0, -61, -26, -7, 48, 0, 0, -313, -116, - 944, -202, 0, 0, 0, 0, 0, 0, 0, 0, - 219, 0, -15, 402, 0, 388, 0, 0, 184, 0, - 0, 0, -276, 66, 472, 0, 431, 389, 0, 0, - 0, -192, 0, 259, + protected static final short yyGindex [] = { 557, + 0, 0, -30, 0, 487, 0, 383, 565, 570, 0, + 0, 125, 0, 56, 0, 526, 0, -3, -101, -53, + -25, 19, 0, 0, 39, 595, -10, 549, -123, -15, + 192, 31, 552, 0, 0, 377, -127, 0, 21, 334, + 62, -78, 0, -113, 0, 0, 0, -129, 303, 127, + 0, 0, 0, 0, -59, 0, -142, 111, 0, -20, + 118, 280, 285, 288, 295, 296, 0, 0, 327, 0, + 234, 0, -17, 17, 72, 113, 0, 0, -384, -195, + 2398, -51, 0, 0, 0, 0, 0, 0, 0, 0, + 332, 198, -41, 522, 0, -54, 590, 0, 155, 0, + 0, 0, -336, 222, 337, 0, 556, 507, 0, 0, + 0, 0, 0, 0, 0, }; - protected static final short yyTable [] = { 156, - 82, 176, 242, 120, 241, 291, 67, 292, 80, 14, - 184, 52, 62, 196, 86, 198, 268, 159, 22, 222, - 152, 100, 106, 177, 116, 226, 218, 84, 357, 156, - 34, 35, 255, 25, 22, 152, 14, 152, 52, 62, - 14, 232, 69, 310, 120, 336, 17, 159, 54, 14, - 386, 101, 160, 107, 247, 248, 63, 181, 372, 27, - 197, 37, 224, 75, 96, 38, 227, 14, 19, 156, - 219, 161, 182, 179, 249, 54, 68, 39, 73, 35, - 178, 76, 160, 63, 77, 239, 179, 159, 54, 84, - 183, 394, 31, 178, 274, 97, 228, 74, 34, 17, - 252, 161, 182, 240, 104, 239, 251, 280, 281, 282, - 278, 386, 386, 92, 239, 255, 386, 97, 187, 98, - 302, 22, 160, 359, 114, 286, 162, 287, 93, 37, - 31, 179, 399, 38, 152, 97, 253, 98, 178, 37, - 34, 161, 275, 301, 175, 39, 303, 272, 31, 152, - 271, 152, 156, 156, 92, 79, 162, 37, 34, 77, - 92, 81, 354, 20, 37, 308, 273, 378, 38, 223, - 159, 159, 31, 276, 175, 304, 270, 21, 25, 179, - 39, 293, 128, 83, 294, 309, 178, 311, 312, 260, - 261, 255, 25, 21, 237, 94, 162, 128, 34, 334, - 337, 338, 339, 285, 97, 160, 160, 136, 283, 300, - 88, 238, 271, 284, 175, 95, 67, 320, 288, 98, - 271, 109, 428, 429, 161, 161, 325, 431, 156, 367, - 99, 377, 366, 332, 366, 333, 347, 348, 342, 395, - 37, 119, 366, 37, 38, 186, 159, 38, 289, 290, - 14, 369, 370, 373, 14, 152, 39, 220, 152, 39, - 14, 179, 235, 235, 242, 242, 241, 241, 178, 263, - 264, 265, 266, 152, 14, 14, 267, 14, 215, 162, - 162, 160, 313, 136, 156, 156, 136, 34, 340, 341, - 209, 37, 355, 396, 397, 38, 221, 175, 175, 156, - 161, 410, 159, 159, 366, 14, 235, 39, 215, 236, - 236, 236, 241, 374, 375, 242, 245, 159, 92, 259, - 244, 156, 156, 256, 156, 257, 262, 277, 295, 156, - 296, 297, 298, 156, 136, 156, 156, 160, 160, 159, - 159, 299, 159, 305, 156, 156, 156, 159, 318, 321, - 156, 159, 160, 159, 159, 162, 161, 161, 328, 9, - 335, 360, 159, 159, 159, 9, 363, 364, 159, 365, - 368, 161, 376, 175, 160, 160, 381, 160, 401, 407, - 9, 398, 160, 406, 408, 409, 160, 413, 160, 160, - 415, 424, 425, 161, 161, 426, 161, 160, 160, 160, - 430, 161, 1, 160, 119, 161, 124, 161, 161, 126, - 67, 162, 162, 26, 111, 104, 161, 161, 161, 121, - 165, 93, 161, 112, 215, 215, 162, 105, 215, 175, - 175, 343, 344, 345, 346, 215, 316, 317, 164, 115, - 319, 215, 91, 102, 175, 72, 103, 112, 162, 162, - 116, 162, 215, 327, 279, 106, 162, 331, 192, 350, - 162, 353, 162, 162, 349, 189, 175, 175, 190, 175, - 191, 162, 162, 162, 175, 351, 118, 162, 175, 352, - 175, 175, 329, 18, 32, 32, 56, 330, 215, 175, - 175, 175, 225, 108, 192, 175, 229, 314, 215, 0, - 0, 189, 0, 0, 190, 1, 191, 0, 0, 0, - 362, 2, 0, 56, 0, 14, 0, 3, 215, 0, - 243, 0, 14, 14, 4, 5, 6, 56, 14, 14, - 14, 14, 7, 32, 0, 14, 0, 0, 32, 0, - 0, 0, 0, 144, 215, 0, 215, 32, 79, 215, - 0, 215, 32, 0, 0, 0, 380, 0, 383, 0, - 32, 392, 234, 234, 215, 215, 234, 234, 234, 234, - 234, 0, 234, 144, 0, 0, 403, 405, 0, 0, - 0, 67, 70, 71, 234, 234, 209, 234, 1, 215, - 215, 215, 0, 0, 16, 0, 0, 0, 0, 0, - 3, 417, 418, 419, 0, 32, 0, 4, 5, 6, - 0, 192, 0, 144, 0, 7, 0, 0, 189, 234, - 67, 190, 0, 191, 0, 111, 0, 9, 9, 113, - 115, 0, 0, 9, 9, 9, 9, 315, 0, 0, - 9, 0, 0, 0, 0, 0, 0, 32, 192, 234, - 234, 0, 32, 32, 0, 189, 322, 0, 190, 0, - 191, 0, 0, 0, 0, 192, 0, 0, 0, 0, - 0, 234, 189, 356, 0, 190, 0, 191, 0, 0, + protected static final short yyTable [] = { 36, + 38, 160, 74, 100, 114, 323, 204, 140, 182, 250, + 57, 19, 237, 146, 310, 19, 160, 249, 18, 160, + 26, 19, 206, 410, 245, 67, 57, 30, 280, 32, + 28, 439, 127, 285, 160, 19, 19, 205, 128, 83, + 84, 100, 19, 14, 18, 134, 47, 144, 110, 100, + 84, 425, 291, 98, 127, 160, 303, 304, 43, 18, + 39, 70, 346, 171, 347, 18, 19, 26, 389, 62, + 160, 19, 160, 18, 18, 102, 144, 103, 327, 217, + 143, 326, 61, 447, 18, 18, 41, 125, 50, 109, + 43, 98, 439, 439, 84, 310, 127, 439, 248, 159, + 119, 365, 19, 156, 181, 133, 217, 284, 335, 336, + 337, 84, 341, 102, 342, 103, 152, 239, 45, 112, + 144, 220, 102, 41, 164, 333, 129, 57, 18, 101, + 239, 153, 83, 67, 120, 113, 123, 238, 18, 111, + 125, 124, 142, 114, 18, 18, 175, 18, 220, 177, + 217, 54, 278, 356, 18, 221, 358, 206, 158, 163, + 287, 18, 179, 240, 119, 50, 18, 310, 366, 56, + 66, 55, 30, 307, 18, 28, 240, 239, 363, 62, + 158, 163, 221, 112, 206, 56, 30, 50, 302, 302, + 129, 124, 220, 101, 305, 390, 391, 392, 120, 113, + 123, 328, 129, 111, 308, 124, 45, 114, 387, 16, + 222, 46, 74, 64, 325, 395, 283, 44, 137, 286, + 130, 18, 17, 240, 239, 137, 221, 53, 206, 385, + 286, 217, 217, 83, 376, 348, 138, 222, 349, 63, + 302, 302, 302, 170, 124, 65, 426, 355, 243, 77, + 326, 223, 19, 421, 422, 243, 243, 116, 318, 319, + 320, 321, 18, 113, 331, 322, 244, 18, 18, 242, + 240, 250, 250, 220, 220, 343, 19, 386, 223, 249, + 249, 222, 279, 19, 19, 372, 244, 244, 326, 19, + 19, 19, 19, 234, 315, 316, 19, 449, 450, 330, + 239, 169, 160, 217, 72, 344, 345, 221, 221, 206, + 206, 18, 19, 364, 18, 73, 83, 160, 176, 160, + 234, 136, 223, 396, 397, 398, 399, 302, 302, 302, + 302, 302, 152, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 18, 220, 240, 281, 330, 419, + 18, 152, 418, 136, 2, 78, 217, 217, 3, 112, + 236, 18, 222, 222, 234, 51, 359, 2, 136, 2, + 6, 3, 217, 3, 243, 18, 139, 408, 302, 221, + 51, 206, 141, 6, 383, 6, 384, 236, 269, 51, + 104, 243, 293, 217, 217, 143, 217, 198, 220, 220, + 126, 217, 148, 223, 223, 217, 105, 217, 217, 357, + 14, 2, 198, 51, 220, 3, 217, 217, 217, 384, + 300, 106, 217, 154, 105, 480, 481, 6, 104, 155, + 483, 236, 221, 221, 222, 220, 220, 430, 220, 106, + 418, 108, 111, 220, 157, 234, 234, 220, 221, 220, + 220, 393, 394, 126, 198, 13, 174, 131, 220, 220, + 220, 13, 427, 428, 220, 400, 401, 166, 340, 221, + 221, 448, 221, 338, 418, 223, 13, 221, 339, 462, + 247, 221, 418, 221, 221, 282, 296, 222, 222, 294, + 297, 168, 221, 221, 221, 253, 298, 301, 221, 152, + 311, 312, 250, 222, 314, 251, 74, 252, 317, 332, + 350, 351, 236, 236, 178, 180, 352, 234, 360, 353, + 354, 299, 370, 388, 222, 222, 379, 222, 223, 223, + 368, 369, 222, 253, 371, 415, 222, 416, 222, 222, + 250, 423, 417, 251, 223, 252, 378, 222, 222, 222, + 253, 420, 429, 222, 431, 453, 434, 250, 373, 367, + 251, 295, 252, 451, 458, 223, 223, 459, 223, 460, + 234, 234, 461, 223, 465, 253, 467, 223, 476, 223, + 223, 477, 250, 482, 236, 251, 234, 252, 223, 223, + 223, 478, 1, 2, 223, 4, 3, 173, 412, 132, + 414, 2, 172, 74, 253, 3, 173, 234, 234, 2, + 234, 250, 75, 3, 251, 234, 252, 6, 76, 234, + 151, 234, 234, 132, 52, 6, 334, 135, 382, 402, + 234, 234, 234, 253, 329, 403, 234, 236, 236, 404, + 250, 409, 407, 251, 117, 252, 433, 405, 436, 406, + 380, 445, 14, 236, 115, 381, 242, 242, 184, 165, + 242, 242, 242, 242, 242, 0, 242, 455, 457, 2, + 0, 288, 0, 3, 236, 236, 0, 236, 242, 242, + 217, 242, 236, 0, 0, 6, 236, 0, 236, 236, + 0, 469, 470, 471, 139, 253, 0, 236, 236, 236, + 0, 0, 250, 236, 0, 251, 0, 252, 0, 0, + 0, 0, 198, 242, 0, 0, 74, 0, 0, 0, + 0, 413, 0, 13, 13, 0, 0, 0, 0, 13, + 13, 13, 13, 0, 253, 0, 13, 249, 0, 0, + 0, 250, 424, 242, 251, 0, 252, 0, 0, 188, + 0, 0, 0, 0, 0, 190, 191, 192, 193, 194, + 195, 196, 197, 14, 0, 0, 253, 0, 0, 0, + 199, 200, 0, 250, 432, 249, 251, 0, 252, 0, + 0, 0, 0, 0, 0, 0, 0, 188, 0, 0, + 0, 0, 249, 190, 191, 192, 193, 194, 195, 196, + 197, 14, 0, 0, 188, 0, 0, 0, 199, 200, + 190, 191, 192, 193, 194, 195, 196, 197, 14, 0, + 0, 253, 0, 0, 0, 199, 200, 0, 250, 188, + 0, 251, 0, 252, 0, 190, 191, 192, 193, 194, + 195, 196, 197, 14, 0, 0, 249, 435, 0, 253, + 199, 200, 0, 0, 0, 0, 250, 446, 188, 251, + 0, 252, 0, 0, 190, 191, 192, 193, 194, 195, + 196, 197, 14, 0, 0, 249, 253, 0, 0, 199, + 200, 0, 0, 250, 454, 0, 251, 188, 252, 0, + 0, 0, 242, 190, 191, 192, 193, 194, 195, 196, + 197, 14, 0, 253, 0, 0, 0, 0, 199, 200, + 250, 456, 0, 251, 0, 252, 0, 0, 0, 0, + 0, 242, 242, 242, 242, 242, 242, 242, 242, 0, + 0, 253, 0, 217, 217, 217, 217, 249, 250, 468, + 217, 251, 0, 252, 0, 0, 0, 0, 0, 188, + 0, 0, 0, 0, 0, 190, 191, 192, 193, 194, + 195, 196, 197, 14, 0, 0, 1, 253, 0, 0, + 199, 200, 4, 0, 250, 0, 249, 251, 5, 252, + 0, 0, 0, 0, 0, 7, 8, 9, 188, 11, + 12, 0, 0, 13, 190, 191, 192, 193, 194, 195, + 196, 197, 14, 0, 0, 0, 0, 0, 249, 199, + 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 0, 0, 190, 191, 192, 193, + 194, 195, 196, 197, 14, 0, 0, 0, 0, 0, + 0, 199, 200, 0, 0, 74, 74, 0, 74, 74, + 74, 74, 74, 74, 74, 74, 0, 0, 0, 0, + 0, 0, 0, 249, 0, 0, 0, 74, 0, 0, + 74, 0, 0, 0, 0, 188, 0, 0, 0, 0, + 0, 190, 191, 192, 193, 194, 195, 196, 197, 14, + 0, 249, 0, 0, 0, 0, 199, 200, 0, 74, + 0, 0, 74, 188, 0, 0, 0, 0, 0, 190, + 191, 192, 193, 194, 195, 196, 197, 14, 249, 0, + 0, 0, 0, 0, 199, 200, 0, 0, 0, 0, + 188, 74, 74, 0, 0, 0, 190, 191, 192, 193, + 194, 195, 196, 197, 14, 249, 0, 0, 0, 0, + 0, 199, 200, 0, 0, 0, 0, 188, 0, 0, + 0, 0, 0, 190, 191, 192, 193, 194, 195, 196, + 197, 14, 0, 249, 0, 0, 0, 0, 199, 200, + 0, 0, 0, 0, 0, 188, 0, 0, 0, 0, + 0, 190, 191, 192, 193, 194, 195, 196, 197, 14, + 0, 0, 0, 0, 0, 0, 199, 200, 0, 249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 144, 144, 0, 32, - 188, 32, 32, 192, 0, 0, 0, 0, 0, 0, - 189, 0, 126, 190, 0, 191, 0, 0, 128, 129, - 130, 131, 132, 133, 134, 135, 31, 0, 0, 361, - 192, 0, 0, 137, 138, 32, 188, 189, 371, 0, - 190, 32, 191, 0, 0, 0, 0, 0, 126, 0, - 0, 0, 32, 0, 128, 129, 130, 131, 132, 133, - 134, 135, 31, 0, 0, 0, 32, 192, 0, 137, - 138, 0, 144, 0, 189, 379, 0, 190, 0, 191, - 0, 0, 234, 234, 0, 0, 0, 234, 0, 0, - 0, 0, 0, 0, 234, 0, 0, 0, 234, 234, - 0, 234, 234, 234, 0, 0, 0, 0, 0, 234, - 192, 0, 0, 0, 0, 0, 234, 189, 0, 0, - 190, 0, 191, 0, 0, 0, 234, 234, 234, 234, - 234, 234, 234, 234, 234, 0, 382, 192, 0, 209, - 209, 209, 209, 0, 189, 393, 209, 190, 0, 191, - 0, 0, 0, 188, 192, 0, 0, 0, 0, 0, - 0, 189, 402, 0, 190, 126, 191, 0, 0, 0, - 0, 128, 129, 130, 131, 132, 133, 134, 135, 31, - 0, 192, 0, 0, 0, 0, 137, 138, 189, 404, - 188, 190, 0, 191, 0, 0, 0, 0, 0, 0, - 0, 0, 126, 0, 0, 0, 0, 188, 128, 129, - 130, 131, 132, 133, 134, 135, 31, 0, 0, 126, - 0, 0, 0, 137, 138, 128, 129, 130, 131, 132, - 133, 134, 135, 31, 0, 0, 192, 0, 0, 0, - 137, 138, 0, 189, 416, 188, 190, 0, 191, 0, - 0, 0, 0, 0, 0, 0, 0, 126, 0, 0, - 0, 0, 0, 128, 129, 130, 131, 132, 133, 134, - 135, 31, 188, 192, 0, 0, 0, 0, 137, 138, - 189, 0, 0, 190, 126, 191, 0, 0, 0, 0, - 128, 129, 130, 131, 132, 133, 134, 135, 31, 0, - 192, 0, 0, 0, 0, 137, 138, 189, 0, 188, - 190, 0, 191, 0, 0, 0, 0, 0, 0, 0, - 0, 126, 0, 0, 0, 0, 0, 128, 129, 130, - 131, 132, 133, 134, 135, 31, 0, 0, 0, 0, - 0, 0, 137, 138, 0, 0, 0, 0, 0, 0, - 0, 0, 188, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 126, 0, 0, 0, 0, 0, - 128, 129, 130, 131, 132, 133, 134, 135, 31, 188, - 0, 0, 0, 0, 0, 137, 138, 0, 43, 0, - 0, 126, 0, 0, 0, 0, 188, 128, 129, 130, - 131, 132, 133, 134, 135, 31, 0, 0, 126, 0, - 0, 0, 137, 138, 128, 129, 130, 131, 132, 133, - 134, 135, 31, 188, 0, 0, 0, 0, 0, 137, - 138, 0, 0, 0, 0, 126, 0, 0, 0, 0, - 0, 128, 129, 130, 131, 132, 133, 134, 135, 31, - 0, 0, 0, 44, 0, 0, 137, 138, 0, 67, - 67, 0, 67, 67, 67, 67, 67, 67, 67, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, - 0, 67, 0, 0, 67, 0, 0, 0, 0, 0, - 126, 0, 0, 0, 0, 0, 128, 129, 130, 131, - 132, 133, 134, 135, 31, 0, 0, 0, 0, 0, - 0, 137, 138, 67, 0, 188, 67, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 126, 0, 0, - 0, 155, 0, 128, 129, 130, 131, 132, 133, 134, - 135, 31, 0, 0, 0, 67, 67, 67, 137, 138, - 155, 0, 0, 0, 126, 0, 0, 0, 0, 0, - 128, 129, 130, 131, 132, 133, 134, 135, 31, 0, - 0, 0, 0, 233, 233, 137, 138, 233, 233, 233, - 233, 233, 0, 233, 0, 1, 37, 0, 0, 0, - 38, 0, 0, 0, 0, 233, 233, 3, 233, 0, - 0, 0, 39, 0, 4, 5, 6, 387, 391, 0, - 0, 0, 40, 0, 155, 0, 155, 0, 0, 41, - 0, 0, 400, 0, 0, 0, 0, 0, 247, 42, - 233, 0, 247, 247, 247, 247, 247, 247, 247, 0, - 0, 0, 0, 0, 411, 412, 0, 414, 0, 0, - 247, 247, 420, 247, 0, 0, 421, 0, 422, 423, - 233, 233, 0, 0, 0, 0, 0, 427, 387, 391, - 0, 0, 0, 420, 0, 0, 0, 0, 0, 67, - 67, 0, 0, 0, 67, 247, 0, 0, 0, 0, - 0, 67, 0, 0, 0, 67, 67, 0, 67, 67, - 67, 0, 0, 0, 67, 0, 67, 0, 0, 0, - 43, 0, 0, 67, 0, 247, 247, 0, 0, 0, - 0, 0, 0, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 0, 0, 238, 238, 0, 0, 238, 238, - 238, 238, 238, 238, 238, 0, 0, 0, 0, 155, - 0, 0, 0, 155, 0, 0, 238, 238, 187, 238, - 0, 0, 155, 155, 0, 155, 0, 0, 0, 0, - 0, 0, 0, 0, 155, 90, 0, 0, 155, 0, - 0, 0, 0, 155, 155, 155, 155, 155, 155, 155, - 155, 155, 155, 233, 233, 0, 0, 0, 233, 155, - 155, 0, 0, 0, 0, 233, 0, 0, 0, 233, - 233, 0, 233, 233, 233, 0, 0, 0, 0, 0, - 233, 238, 238, 0, 0, 0, 0, 233, 141, 0, - 0, 0, 0, 0, 0, 0, 0, 233, 233, 233, - 233, 233, 233, 233, 233, 233, 0, 139, 247, 247, - 0, 0, 0, 247, 0, 0, 0, 0, 0, 0, - 247, 0, 0, 0, 247, 247, 0, 247, 247, 247, - 0, 0, 0, 0, 0, 247, 0, 0, 0, 226, - 226, 0, 247, 226, 226, 226, 226, 226, 226, 226, - 0, 0, 247, 247, 247, 247, 247, 247, 247, 247, - 247, 226, 226, 0, 226, 0, 0, 1, 37, 0, - 0, 79, 38, 0, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 0, 39, 0, 4, 5, 6, 0, - 0, 0, 0, 0, 40, 0, 226, 0, 201, 201, - 0, 41, 201, 201, 201, 201, 201, 201, 201, 0, - 0, 42, 0, 0, 238, 238, 0, 0, 0, 238, - 201, 201, 0, 201, 0, 0, 238, 226, 0, 0, - 238, 238, 0, 238, 238, 238, 0, 0, 0, 0, - 0, 238, 0, 0, 0, 0, 0, 0, 238, 0, - 0, 0, 0, 0, 0, 201, 0, 0, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 190, 190, 0, - 0, 190, 190, 190, 190, 190, 190, 190, 0, 0, - 0, 0, 0, 0, 0, 201, 201, 0, 0, 190, - 190, 0, 190, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 234, 234, 0, 0, 234, 234, - 234, 234, 234, 0, 234, 0, 0, 0, 0, 123, - 384, 0, 0, 0, 190, 0, 234, 234, 0, 234, - 0, 125, 0, 0, 0, 126, 0, 0, 0, 0, - 385, 128, 129, 130, 131, 132, 133, 134, 135, 31, - 0, 0, 0, 0, 190, 190, 137, 138, 0, 226, - 226, 234, 0, 0, 226, 0, 0, 0, 0, 0, - 0, 226, 0, 0, 0, 226, 226, 0, 226, 226, - 226, 0, 0, 0, 0, 0, 226, 0, 0, 0, - 248, 234, 234, 226, 248, 248, 248, 248, 248, 248, - 248, 0, 0, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 248, 248, 0, 248, 0, 0, 201, 201, - 0, 0, 0, 201, 0, 0, 0, 0, 0, 0, - 201, 0, 0, 0, 201, 201, 0, 201, 201, 201, - 0, 0, 0, 0, 0, 201, 0, 248, 0, 0, - 0, 0, 201, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 201, 201, 201, 201, 201, 201, 0, 201, - 201, 0, 0, 0, 0, 239, 239, 248, 248, 239, - 239, 239, 239, 239, 239, 239, 0, 190, 190, 0, - 0, 0, 190, 0, 0, 0, 0, 239, 239, 190, - 239, 0, 0, 190, 190, 0, 190, 190, 190, 0, - 0, 0, 0, 0, 190, 0, 0, 0, 0, 0, - 0, 190, 0, 0, 234, 234, 0, 0, 0, 234, - 0, 190, 190, 190, 190, 190, 234, 190, 190, 190, - 234, 234, 0, 234, 234, 234, 0, 0, 0, 0, - 0, 234, 0, 0, 0, 0, 0, 0, 234, 0, - 0, 0, 239, 239, 0, 105, 0, 0, 234, 234, - 234, 234, 234, 234, 234, 234, 234, 227, 227, 0, - 0, 227, 227, 227, 227, 227, 227, 227, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 227, - 227, 0, 227, 0, 0, 0, 0, 0, 0, 0, - 248, 248, 0, 0, 0, 248, 0, 0, 0, 0, - 0, 0, 248, 0, 0, 0, 248, 248, 0, 248, - 248, 248, 0, 0, 227, 0, 0, 248, 0, 0, - 0, 0, 0, 0, 248, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 202, 202, 227, 0, 202, 202, 202, - 202, 202, 202, 202, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 202, 202, 0, 202, 0, - 0, 0, 0, 0, 0, 239, 239, 0, 0, 0, - 239, 0, 0, 0, 0, 0, 0, 239, 0, 0, - 0, 239, 239, 0, 239, 239, 239, 0, 0, 0, - 202, 0, 239, 0, 0, 0, 0, 0, 0, 239, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 269, 269, - 202, 202, 269, 269, 0, 269, 0, 269, 269, 0, - 0, 0, 1, 37, 0, 0, 0, 38, 0, 0, - 269, 269, 0, 269, 3, 0, 0, 0, 0, 39, - 0, 4, 5, 6, 0, 0, 0, 0, 0, 7, - 0, 0, 0, 0, 0, 0, 103, 227, 227, 0, - 0, 0, 227, 0, 141, 269, 104, 0, 0, 227, - 0, 0, 0, 227, 227, 0, 227, 227, 227, 0, - 0, 0, 0, 139, 227, 0, 0, 0, 0, 0, - 0, 227, 0, 0, 0, 269, 269, 0, 0, 0, - 0, 227, 227, 227, 227, 227, 227, 227, 227, 227, - 258, 258, 0, 0, 258, 258, 258, 258, 258, 258, - 258, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 258, 258, 0, 258, 0, 0, 0, 0, - 0, 0, 0, 202, 202, 0, 0, 79, 202, 0, - 0, 0, 0, 0, 0, 202, 0, 0, 0, 202, - 202, 0, 202, 202, 202, 0, 0, 258, 0, 0, - 202, 0, 0, 0, 0, 0, 0, 202, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 202, 202, 202, - 202, 202, 202, 0, 202, 202, 0, 258, 258, 259, - 259, 0, 0, 259, 259, 259, 259, 259, 259, 259, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 259, 259, 0, 259, 0, 0, 0, 269, 269, - 0, 0, 0, 269, 0, 0, 0, 0, 0, 0, - 269, 0, 0, 0, 269, 269, 0, 269, 269, 269, - 0, 0, 0, 0, 0, 269, 259, 0, 0, 0, - 0, 0, 269, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 269, 269, 269, 269, 269, 269, 269, 269, - 269, 0, 0, 0, 260, 260, 259, 259, 260, 260, - 260, 260, 260, 260, 260, 123, 124, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 260, 125, 0, 0, - 0, 126, 0, 0, 0, 0, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 31, 0, 0, 0, 0, - 258, 258, 137, 138, 0, 258, 0, 0, 0, 0, - 0, 260, 258, 0, 0, 0, 258, 258, 0, 258, - 258, 258, 0, 0, 0, 0, 0, 258, 0, 0, - 0, 0, 0, 0, 258, 0, 0, 0, 0, 0, - 0, 260, 260, 0, 258, 0, 258, 258, 0, 258, - 258, 258, 258, 0, 0, 261, 261, 0, 0, 261, - 261, 261, 261, 261, 261, 261, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 261, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 259, - 259, 0, 0, 0, 259, 0, 0, 0, 0, 0, - 0, 259, 0, 0, 0, 259, 259, 0, 259, 259, - 259, 0, 261, 0, 0, 0, 259, 0, 0, 0, - 0, 0, 0, 259, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 259, 0, 259, 259, 56, 259, 259, - 259, 259, 261, 261, 0, 262, 262, 0, 0, 262, - 262, 262, 262, 262, 262, 262, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 262, 0, 0, - 0, 0, 0, 0, 260, 260, 0, 0, 0, 260, - 0, 0, 0, 0, 0, 0, 260, 0, 0, 0, - 0, 260, 0, 260, 260, 260, 0, 0, 0, 0, - 0, 260, 262, 0, 0, 0, 0, 0, 260, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 260, 260, - 0, 0, 260, 260, 260, 260, 260, 0, 0, 0, - 0, 0, 262, 262, 0, 270, 0, 0, 270, 0, - 270, 270, 270, 270, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 270, 270, 0, 270, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 261, 261, 0, 0, 0, - 261, 0, 0, 246, 246, 0, 0, 261, 0, 0, - 0, 270, 261, 0, 261, 261, 261, 0, 0, 0, - 0, 0, 261, 0, 0, 0, 0, 271, 0, 261, - 271, 0, 271, 271, 271, 271, 0, 0, 0, 261, - 261, 270, 270, 261, 261, 261, 261, 261, 271, 271, - 0, 271, 0, 0, 56, 56, 246, 246, 246, 56, - 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, - 0, 56, 0, 56, 56, 56, 0, 0, 0, 0, - 0, 56, 0, 271, 0, 262, 262, 0, 56, 0, - 262, 0, 0, 0, 0, 0, 0, 262, 56, 0, - 0, 0, 262, 0, 262, 262, 262, 0, 0, 0, - 0, 0, 262, 271, 271, 0, 0, 272, 0, 262, - 272, 0, 272, 272, 272, 272, 0, 0, 0, 262, - 262, 0, 0, 262, 262, 262, 262, 262, 272, 272, - 0, 272, 0, 0, 0, 0, 0, 0, 0, 246, - 246, 246, 246, 246, 0, 246, 246, 246, 246, 246, - 246, 246, 246, 246, 246, 246, 0, 0, 0, 0, - 0, 0, 0, 272, 270, 270, 0, 0, 0, 270, - 0, 0, 0, 0, 0, 0, 270, 0, 0, 0, - 270, 270, 0, 270, 270, 270, 0, 0, 0, 0, - 0, 270, 246, 272, 272, 0, 0, 0, 270, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 270, 270, - 270, 270, 270, 270, 270, 270, 270, 244, 244, 0, - 0, 244, 244, 244, 244, 244, 244, 244, 0, 0, - 0, 0, 0, 0, 0, 0, 271, 271, 0, 244, - 244, 271, 244, 0, 0, 141, 0, 0, 271, 0, - 0, 0, 271, 271, 0, 271, 271, 271, 0, 0, - 0, 0, 0, 271, 139, 0, 0, 0, 0, 0, - 271, 0, 0, 0, 244, 0, 0, 0, 0, 0, - 271, 271, 271, 271, 271, 271, 271, 271, 271, 0, - 0, 0, 0, 0, 0, 0, 0, 141, 0, 0, - 0, 0, 0, 0, 244, 244, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 139, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 272, 272, 79, 0, - 140, 272, 0, 0, 0, 0, 0, 0, 272, 0, - 0, 0, 272, 272, 0, 272, 272, 272, 0, 141, - 0, 0, 0, 272, 0, 0, 0, 0, 0, 0, - 272, 0, 0, 0, 0, 0, 0, 0, 139, 0, - 272, 272, 272, 272, 272, 272, 272, 272, 272, 0, - 79, 0, 231, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 139, 0, 0, 0, 0, - 0, 0, 79, 0, 254, 0, 0, 244, 244, 0, - 0, 0, 244, 0, 0, 0, 0, 0, 0, 244, - 141, 0, 0, 244, 244, 0, 244, 244, 244, 0, - 0, 0, 0, 37, 244, 0, 0, 38, 0, 139, - 0, 244, 0, 0, 0, 0, 123, 124, 0, 39, - 0, 244, 244, 244, 244, 244, 244, 244, 125, 79, - 0, 306, 126, 0, 0, 0, 0, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 0, 141, 0, - 0, 0, 0, 137, 138, 37, 0, 0, 0, 38, - 0, 0, 0, 0, 0, 0, 0, 139, 123, 124, - 0, 39, 0, 79, 0, 307, 0, 0, 0, 0, - 125, 0, 0, 0, 230, 0, 0, 0, 0, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 0, - 0, 0, 0, 0, 0, 137, 138, 37, 0, 0, - 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, - 123, 124, 0, 39, 0, 0, 0, 0, 0, 0, - 0, 79, 125, 358, 0, 0, 126, 0, 0, 0, - 0, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 0, 0, 0, 0, 0, 0, 137, 138, 0, - 0, 0, 0, 0, 37, 0, 0, 0, 38, 0, - 0, 0, 0, 0, 0, 0, 0, 123, 124, 0, - 39, 0, 0, 0, 0, 0, 0, 0, 0, 125, - 0, 0, 0, 126, 0, 0, 0, 0, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 37, 0, - 0, 0, 38, 0, 137, 138, 0, 0, 0, 0, - 0, 123, 124, 0, 39, 0, 0, 0, 0, 0, - 0, 0, 0, 125, 0, 0, 0, 126, 0, 0, - 0, 0, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 0, 0, 0, 0, 0, 0, 137, 138, - 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, - 38, 0, 0, 0, 0, 0, 0, 0, 0, 123, - 124, 0, 39, 0, 0, 0, 0, 0, 0, 0, - 0, 125, 0, 0, 0, 126, 0, 0, 0, 0, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 0, 0, 0, 0, 0, 0, 137, 138, + 0, 188, 0, 0, 0, 0, 0, 190, 191, 192, + 193, 194, 195, 196, 197, 14, 0, 0, 0, 0, + 0, 0, 199, 200, 0, 0, 0, 0, 0, 0, + 241, 241, 0, 0, 241, 241, 241, 241, 241, 0, + 241, 0, 0, 0, 0, 74, 74, 0, 0, 0, + 74, 74, 241, 241, 0, 241, 0, 74, 0, 0, + 0, 74, 74, 0, 74, 74, 74, 74, 74, 74, + 74, 0, 74, 0, 0, 0, 255, 0, 0, 0, + 255, 255, 255, 255, 255, 255, 255, 241, 0, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 255, 255, + 0, 255, 246, 246, 0, 0, 246, 246, 246, 246, + 246, 246, 246, 0, 0, 0, 0, 241, 0, 0, + 0, 0, 0, 0, 246, 246, 0, 246, 0, 0, + 234, 234, 0, 255, 234, 234, 234, 234, 234, 234, + 234, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 234, 234, 0, 234, 0, 0, 0, 0, + 0, 0, 0, 255, 0, 0, 0, 0, 209, 209, + 0, 0, 209, 209, 209, 209, 209, 209, 209, 0, + 0, 0, 0, 0, 0, 0, 0, 234, 0, 246, + 209, 209, 0, 209, 198, 198, 0, 0, 198, 198, + 198, 198, 198, 198, 198, 242, 242, 0, 0, 242, + 242, 242, 242, 242, 0, 242, 198, 198, 0, 198, + 0, 0, 0, 0, 0, 209, 0, 242, 242, 0, + 242, 256, 0, 0, 0, 256, 256, 256, 256, 256, + 256, 256, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 198, 0, 256, 256, 209, 256, 0, 0, 0, + 0, 0, 242, 0, 0, 0, 241, 0, 247, 247, + 0, 0, 247, 247, 247, 247, 247, 247, 247, 0, + 0, 198, 0, 0, 0, 0, 0, 0, 256, 0, + 247, 247, 242, 247, 0, 241, 241, 241, 241, 241, + 241, 241, 241, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 255, 0, 0, 0, 0, 0, 256, 0, + 0, 0, 0, 0, 0, 0, 0, 235, 235, 0, + 0, 235, 235, 235, 235, 235, 235, 235, 246, 0, + 0, 255, 255, 255, 255, 255, 255, 255, 255, 235, + 235, 0, 235, 0, 0, 247, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 234, 246, 246, 246, + 246, 246, 246, 246, 246, 0, 0, 0, 0, 0, + 0, 268, 268, 0, 235, 268, 268, 268, 268, 268, + 268, 268, 0, 0, 0, 234, 234, 234, 234, 234, + 234, 234, 234, 268, 209, 0, 210, 210, 0, 0, + 210, 210, 210, 210, 210, 210, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 210, 210, + 198, 210, 0, 209, 209, 209, 209, 209, 268, 209, + 209, 242, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 198, + 198, 198, 198, 210, 198, 198, 198, 256, 268, 0, + 242, 242, 242, 242, 242, 242, 242, 242, 0, 0, + 0, 0, 0, 0, 0, 277, 277, 0, 0, 277, + 277, 0, 277, 210, 277, 277, 256, 256, 256, 256, + 256, 256, 256, 256, 247, 0, 0, 277, 277, 0, + 277, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 266, 266, 0, 0, 266, 266, 266, 266, + 266, 266, 266, 247, 247, 247, 247, 247, 247, 247, + 247, 0, 277, 0, 266, 266, 0, 266, 267, 267, + 0, 0, 267, 267, 267, 267, 267, 267, 267, 0, + 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, + 267, 267, 277, 267, 0, 0, 0, 0, 0, 266, + 269, 269, 0, 0, 269, 269, 269, 269, 269, 269, + 269, 0, 235, 235, 235, 235, 235, 235, 235, 235, + 0, 0, 269, 0, 0, 267, 270, 270, 0, 266, + 270, 270, 270, 270, 270, 270, 270, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 270, 0, + 0, 0, 0, 278, 0, 267, 278, 269, 278, 278, + 278, 278, 210, 0, 0, 0, 268, 0, 0, 268, + 268, 268, 268, 268, 278, 278, 0, 278, 0, 0, + 0, 0, 0, 270, 0, 0, 0, 269, 0, 0, + 0, 210, 210, 210, 210, 210, 279, 210, 210, 279, + 0, 279, 279, 279, 279, 0, 0, 0, 0, 278, + 0, 0, 0, 270, 0, 0, 0, 279, 279, 0, + 279, 0, 0, 0, 280, 0, 0, 280, 0, 280, + 280, 280, 280, 0, 0, 0, 0, 1, 2, 278, + 0, 277, 3, 4, 0, 280, 280, 0, 280, 5, + 0, 0, 279, 0, 6, 0, 7, 8, 9, 10, + 11, 12, 0, 0, 13, 0, 0, 0, 0, 0, + 277, 277, 277, 277, 277, 277, 277, 277, 266, 0, + 280, 14, 279, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 252, 252, 0, 0, 252, 252, 252, + 252, 252, 252, 252, 267, 0, 162, 0, 266, 266, + 280, 266, 266, 266, 266, 252, 252, 0, 252, 0, + 0, 0, 163, 0, 1, 0, 0, 0, 0, 0, + 48, 0, 0, 0, 267, 267, 5, 267, 267, 267, + 267, 163, 0, 7, 8, 9, 0, 0, 49, 0, + 252, 13, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 4, 0, 0, 0, 269, 203, 5, 269, 269, + 269, 269, 269, 0, 7, 8, 9, 0, 0, 12, + 252, 0, 13, 0, 0, 201, 0, 0, 278, 0, + 0, 270, 0, 0, 270, 270, 270, 270, 270, 0, + 0, 0, 0, 0, 0, 163, 0, 163, 0, 0, + 0, 0, 0, 0, 203, 0, 0, 278, 278, 278, + 278, 278, 278, 278, 278, 0, 0, 0, 0, 0, + 0, 279, 0, 201, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 139, + 0, 202, 0, 0, 0, 0, 0, 0, 203, 280, + 279, 279, 279, 279, 279, 279, 279, 279, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 201, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 280, 280, + 280, 280, 280, 280, 280, 280, 0, 139, 0, 290, + 0, 0, 203, 1, 2, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, + 6, 201, 7, 8, 9, 0, 0, 0, 0, 252, + 13, 0, 0, 0, 0, 0, 0, 161, 0, 0, + 163, 139, 0, 309, 163, 0, 0, 117, 0, 195, + 0, 0, 0, 163, 163, 0, 163, 0, 252, 252, + 252, 252, 252, 252, 0, 163, 0, 203, 0, 163, + 0, 0, 0, 0, 163, 163, 163, 163, 163, 163, + 163, 163, 163, 163, 2, 139, 201, 361, 3, 0, + 163, 163, 0, 0, 0, 0, 0, 185, 186, 0, + 6, 0, 0, 0, 0, 0, 0, 0, 0, 187, + 0, 203, 0, 188, 0, 0, 0, 0, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 0, 0, + 201, 0, 2, 0, 199, 200, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 185, 186, 0, 6, 0, + 139, 0, 362, 0, 0, 0, 0, 187, 203, 0, + 0, 289, 0, 132, 0, 0, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 2, 201, 0, 0, + 3, 132, 199, 200, 0, 0, 0, 0, 0, 185, + 186, 0, 6, 0, 139, 0, 411, 0, 0, 0, + 0, 187, 0, 203, 0, 188, 0, 0, 0, 0, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 2, 0, 201, 0, 3, 0, 199, 200, 0, 0, + 0, 0, 0, 185, 186, 0, 6, 0, 0, 0, + 0, 139, 0, 0, 0, 187, 0, 0, 0, 188, + 0, 0, 0, 0, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 134, 0, 0, 0, 0, 0, + 199, 200, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 134, 0, 0, 2, 139, 0, 0, 3, + 0, 0, 0, 0, 0, 0, 0, 0, 185, 186, + 0, 6, 0, 0, 0, 0, 0, 0, 89, 0, + 187, 0, 0, 0, 188, 0, 0, 0, 0, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 2, + 0, 0, 0, 3, 0, 199, 200, 0, 0, 118, + 0, 0, 185, 186, 0, 6, 0, 0, 0, 0, + 0, 0, 0, 0, 187, 0, 0, 0, 188, 0, + 0, 0, 0, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 90, 89, 0, 132, 132, 0, 199, + 200, 132, 132, 0, 0, 0, 0, 0, 132, 185, + 437, 0, 0, 132, 0, 132, 132, 132, 132, 132, + 132, 187, 118, 132, 119, 188, 0, 0, 0, 0, + 438, 190, 191, 192, 193, 194, 195, 196, 197, 14, + 132, 0, 0, 0, 0, 0, 199, 200, 0, 0, + 61, 0, 0, 0, 185, 186, 0, 0, 0, 150, + 0, 0, 0, 0, 0, 0, 187, 0, 0, 0, + 188, 0, 0, 0, 0, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 14, 0, 0, 172, 0, 0, + 0, 199, 200, 0, 0, 0, 0, 134, 134, 0, + 0, 0, 134, 134, 0, 0, 0, 0, 0, 134, + 0, 0, 0, 0, 134, 0, 134, 134, 134, 134, + 134, 134, 0, 0, 134, 1, 2, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 5, 0, 0, + 0, 134, 6, 0, 7, 8, 9, 0, 0, 0, + 0, 0, 86, 0, 0, 0, 1, 2, 0, 87, + 0, 3, 0, 0, 0, 0, 0, 0, 5, 88, + 0, 0, 0, 6, 0, 7, 8, 9, 0, 0, + 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, + 87, 1, 2, 0, 0, 0, 3, 0, 0, 0, + 117, 0, 0, 5, 0, 0, 0, 0, 6, 0, + 7, 8, 9, 0, 0, 0, 0, 0, 86, 1, + 2, 0, 0, 0, 3, 87, 0, 0, 0, 0, + 0, 5, 0, 440, 444, 88, 6, 0, 7, 8, + 9, 0, 0, 0, 0, 0, 13, 61, 61, 452, + 0, 0, 61, 87, 0, 0, 0, 0, 0, 61, + 0, 0, 0, 117, 61, 0, 61, 61, 61, 0, + 463, 464, 0, 466, 61, 0, 0, 0, 472, 0, + 0, 61, 473, 0, 474, 475, 0, 0, 0, 0, + 0, 61, 0, 479, 440, 444, 0, 0, 0, 472, }; - protected short yyCheck[] = new short[3579]; + protected short yyCheck[] = new short[2881]; } class yyCheck0 { - protected static final short yyCheck0 [] = { 79, - 41, 82, 46, 63, 46, 60, 91, 62, 40, 60, - 88, 22, 22, 59, 46, 59, 61, 79, 123, 100, - 44, 62, 63, 41, 74, 106, 41, 43, 305, 109, - 20, 21, 149, 123, 123, 59, 60, 61, 49, 49, - 91, 109, 44, 236, 63, 41, 10, 109, 22, 301, - 364, 62, 79, 63, 137, 138, 22, 83, 335, 301, - 59, 258, 103, 44, 40, 262, 107, 91, 60, 149, - 96, 79, 44, 83, 41, 49, 24, 274, 26, 69, - 83, 62, 109, 49, 60, 44, 96, 149, 62, 105, - 62, 368, 301, 96, 291, 91, 107, 268, 88, 63, - 40, 109, 44, 62, 301, 44, 46, 190, 191, 192, - 188, 425, 426, 44, 44, 232, 430, 44, 92, 44, - 62, 123, 149, 62, 72, 43, 79, 45, 59, 258, - 44, 141, 62, 262, 44, 62, 147, 62, 141, 44, - 44, 149, 183, 224, 79, 274, 227, 41, 62, 59, - 44, 61, 232, 233, 44, 123, 109, 62, 62, 60, - 44, 301, 291, 268, 258, 233, 182, 360, 262, 59, - 232, 233, 301, 183, 109, 59, 179, 282, 268, 189, - 274, 302, 44, 40, 305, 235, 189, 237, 238, 308, - 309, 308, 282, 282, 268, 59, 149, 59, 188, 277, - 283, 284, 285, 37, 91, 232, 233, 301, 42, 41, - 289, 285, 44, 47, 149, 61, 301, 41, 273, 91, - 44, 123, 425, 426, 232, 233, 258, 430, 308, 41, - 301, 41, 44, 274, 44, 276, 293, 294, 288, 41, - 258, 301, 44, 258, 262, 301, 308, 262, 303, 304, - 301, 332, 333, 336, 40, 41, 274, 93, 44, 274, - 46, 271, 308, 309, 308, 309, 308, 309, 271, 314, - 315, 316, 317, 59, 60, 61, 321, 301, 95, 232, - 233, 308, 301, 301, 364, 365, 301, 277, 286, 287, - 95, 258, 302, 374, 375, 262, 93, 232, 233, 379, - 308, 41, 364, 365, 44, 91, 38, 274, 125, 308, - 309, 60, 40, 354, 355, 40, 40, 379, 44, 46, - 125, 401, 402, 59, 404, 329, 59, 44, 38, 409, - 94, 124, 307, 413, 301, 415, 416, 364, 365, 401, - 402, 306, 404, 40, 424, 425, 426, 409, 59, 301, - 430, 413, 379, 415, 416, 308, 364, 365, 301, 40, - 40, 60, 424, 425, 426, 46, 59, 41, 430, 41, - 40, 379, 59, 308, 401, 402, 59, 404, 41, 40, - 61, 59, 409, 59, 40, 267, 413, 41, 415, 416, - 41, 41, 41, 401, 402, 41, 404, 424, 425, 426, - 267, 409, 0, 430, 123, 413, 301, 415, 416, 301, - 91, 364, 365, 16, 123, 123, 424, 425, 426, 123, - 59, 123, 430, 123, 241, 242, 379, 123, 245, 364, - 365, 289, 290, 291, 292, 252, 241, 242, 59, 123, - 245, 258, 49, 62, 379, 26, 123, 69, 401, 402, - 123, 404, 269, 258, 189, 123, 409, 271, 33, 296, - 413, 299, 415, 416, 295, 40, 401, 402, 43, 404, - 45, 424, 425, 426, 409, 297, 75, 430, 413, 298, - 415, 416, 269, 12, 20, 21, 22, 269, 305, 424, - 425, 426, 105, 63, 33, 430, 108, 239, 315, -1, - -1, 40, -1, -1, 43, 257, 45, -1, -1, -1, - 315, 263, -1, 49, -1, 301, -1, 269, 335, -1, - 59, -1, 308, 309, 276, 277, 278, 63, 314, 315, - 316, 317, 284, 69, -1, 321, -1, -1, 74, -1, - -1, -1, -1, 79, 361, -1, 363, 83, 123, 366, - -1, 368, 88, -1, -1, -1, 361, -1, 363, -1, - 96, 366, 37, 38, 381, 382, 41, 42, 43, 44, - 45, -1, 47, 109, -1, -1, 381, 382, -1, -1, - -1, 24, 25, 26, 59, 60, 61, 62, 257, 406, - 407, 408, -1, -1, 263, -1, -1, -1, -1, -1, - 269, 406, 407, 408, -1, 141, -1, 276, 277, 278, - -1, 33, -1, 149, -1, 284, -1, -1, 40, 94, - 301, 43, -1, 45, -1, 68, -1, 308, 309, 72, - 73, -1, -1, 314, 315, 316, 317, 59, -1, -1, - 321, -1, -1, -1, -1, -1, -1, 183, 33, 124, - 125, -1, 188, 189, -1, 40, 41, -1, 43, -1, - 45, -1, -1, -1, -1, 33, -1, -1, -1, -1, - -1, 114, 40, 41, -1, 43, -1, 45, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 232, 233, -1, 235, - 275, 237, 238, 33, -1, -1, -1, -1, -1, -1, - 40, -1, 287, 43, -1, 45, -1, -1, 293, 294, - 295, 296, 297, 298, 299, 300, 301, -1, -1, 59, - 33, -1, -1, 308, 309, 271, 275, 40, 41, -1, - 43, 277, 45, -1, -1, -1, -1, -1, 287, -1, - -1, -1, 288, -1, 293, 294, 295, 296, 297, 298, - 299, 300, 301, -1, -1, -1, 302, 33, -1, 308, - 309, -1, 308, -1, 40, 41, -1, 43, -1, 45, - -1, -1, 257, 258, -1, -1, -1, 262, -1, -1, - -1, -1, -1, -1, 269, -1, -1, -1, 273, 274, - -1, 276, 277, 278, -1, -1, -1, -1, -1, 284, - 33, -1, -1, -1, -1, -1, 291, 40, -1, -1, - 43, -1, 45, -1, -1, -1, 301, 302, 303, 304, - 305, 306, 307, 308, 309, -1, 59, 33, -1, 314, - 315, 316, 317, -1, 40, 41, 321, 43, -1, 45, - -1, -1, -1, 275, 33, -1, -1, -1, -1, -1, - -1, 40, 41, -1, 43, 287, 45, -1, -1, -1, - -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, - -1, 33, -1, -1, -1, -1, 308, 309, 40, 41, - 275, 43, -1, 45, -1, -1, -1, -1, -1, -1, - -1, -1, 287, -1, -1, -1, -1, 275, 293, 294, - 295, 296, 297, 298, 299, 300, 301, -1, -1, 287, - -1, -1, -1, 308, 309, 293, 294, 295, 296, 297, + protected static final short yyCheck0 [] = { 10, + 11, 103, 91, 57, 42, 61, 59, 86, 136, 46, + 123, 60, 142, 92, 210, 40, 41, 46, 0, 44, + 0, 46, 59, 360, 148, 123, 123, 123, 158, 301, + 123, 416, 59, 163, 59, 60, 61, 59, 69, 55, + 56, 95, 91, 301, 26, 76, 26, 89, 44, 103, + 66, 388, 166, 57, 44, 44, 199, 200, 20, 41, + 301, 41, 60, 118, 62, 47, 91, 47, 41, 46, + 59, 60, 61, 55, 56, 57, 118, 57, 41, 139, + 40, 44, 59, 420, 66, 67, 60, 67, 27, 59, + 52, 95, 477, 478, 110, 291, 123, 482, 152, 103, + 59, 61, 91, 40, 135, 75, 166, 162, 251, 252, + 253, 127, 43, 95, 45, 95, 44, 143, 91, 59, + 162, 139, 104, 60, 104, 249, 59, 123, 110, 59, + 156, 59, 148, 123, 59, 59, 59, 41, 120, 59, + 120, 59, 87, 59, 126, 127, 126, 129, 166, 129, + 210, 60, 41, 283, 136, 139, 286, 139, 103, 104, + 164, 143, 132, 143, 123, 104, 148, 363, 296, 282, + 268, 268, 268, 40, 156, 268, 156, 203, 292, 46, + 125, 126, 166, 123, 166, 282, 282, 126, 199, 200, + 123, 67, 210, 123, 41, 338, 339, 340, 123, 123, + 123, 243, 44, 123, 208, 123, 91, 123, 332, 46, + 139, 91, 301, 46, 240, 343, 161, 20, 44, 164, + 62, 203, 59, 203, 250, 44, 210, 30, 210, 331, + 175, 291, 292, 249, 313, 302, 62, 166, 305, 59, + 251, 252, 253, 62, 120, 60, 389, 41, 44, 52, + 44, 139, 301, 383, 384, 308, 309, 66, 314, 315, + 316, 317, 244, 301, 244, 321, 62, 249, 250, 143, + 250, 308, 309, 291, 292, 273, 301, 331, 166, 308, + 309, 210, 156, 308, 309, 41, 308, 309, 44, 314, + 315, 316, 317, 139, 308, 309, 321, 427, 428, 244, + 326, 110, 44, 363, 93, 303, 304, 291, 292, 291, + 292, 293, 301, 293, 296, 93, 332, 59, 127, 61, + 166, 268, 210, 344, 345, 346, 347, 338, 339, 340, + 341, 342, 44, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 326, 363, 326, 59, 293, 41, + 332, 44, 44, 44, 258, 301, 416, 417, 262, 301, + 139, 343, 291, 292, 210, 29, 59, 258, 59, 258, + 274, 262, 432, 262, 44, 357, 123, 357, 389, 363, + 44, 363, 301, 274, 329, 274, 331, 166, 155, 53, + 57, 44, 62, 453, 454, 40, 456, 301, 416, 417, + 67, 461, 289, 291, 292, 465, 44, 467, 468, 62, + 301, 258, 301, 77, 432, 262, 476, 477, 478, 364, + 187, 44, 482, 59, 62, 477, 478, 274, 95, 61, + 482, 210, 416, 417, 363, 453, 454, 41, 456, 62, + 44, 59, 60, 461, 301, 291, 292, 465, 432, 467, + 468, 341, 342, 120, 301, 40, 59, 75, 476, 477, + 478, 46, 407, 408, 482, 348, 349, 123, 37, 453, + 454, 41, 456, 42, 44, 363, 61, 461, 47, 41, + 301, 465, 44, 467, 468, 59, 38, 416, 417, 301, + 40, 109, 476, 477, 478, 33, 40, 40, 482, 44, + 59, 329, 40, 432, 46, 43, 91, 45, 59, 44, + 38, 94, 291, 292, 132, 133, 124, 363, 40, 307, + 306, 59, 59, 40, 453, 454, 301, 456, 416, 417, + 297, 298, 461, 33, 301, 59, 465, 41, 467, 468, + 40, 59, 41, 43, 432, 45, 313, 476, 477, 478, + 33, 40, 59, 482, 59, 41, 59, 40, 41, 59, + 43, 179, 45, 59, 59, 453, 454, 40, 456, 40, + 416, 417, 267, 461, 41, 33, 41, 465, 41, 467, + 468, 41, 40, 267, 363, 43, 432, 45, 476, 477, + 478, 41, 0, 0, 482, 0, 0, 59, 365, 301, + 367, 258, 59, 47, 33, 262, 120, 453, 454, 258, + 456, 40, 48, 262, 43, 461, 45, 274, 49, 465, + 95, 467, 468, 75, 30, 274, 250, 76, 326, 350, + 476, 477, 478, 33, 291, 351, 482, 416, 417, 352, + 40, 41, 291, 43, 301, 45, 413, 353, 415, 354, + 324, 418, 301, 432, 65, 324, 37, 38, 137, 104, + 41, 42, 43, 44, 45, -1, 47, 434, 435, 258, + -1, 165, -1, 262, 453, 454, -1, 456, 59, 60, + 61, 62, 461, -1, -1, 274, 465, -1, 467, 468, + -1, 458, 459, 460, 123, 33, -1, 476, 477, 478, + -1, -1, 40, 482, -1, 43, -1, 45, -1, -1, + -1, -1, 301, 94, -1, -1, 301, -1, -1, -1, + -1, 59, -1, 308, 309, -1, -1, -1, -1, 314, + 315, 316, 317, -1, 33, -1, 321, 275, -1, -1, + -1, 40, 41, 124, 43, -1, 45, -1, -1, 287, + -1, -1, -1, -1, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, -1, -1, 33, -1, -1, -1, 308, 309, -1, 40, 41, 275, 43, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, 287, -1, -1, - -1, -1, -1, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 275, 33, -1, -1, -1, -1, 308, 309, - 40, -1, -1, 43, 287, 45, -1, -1, -1, -1, + -1, -1, 275, 293, 294, 295, 296, 297, 298, 299, + 300, 301, -1, -1, 287, -1, -1, -1, 308, 309, 293, 294, 295, 296, 297, 298, 299, 300, 301, -1, + -1, 33, -1, -1, -1, 308, 309, -1, 40, 287, + -1, 43, -1, 45, -1, 293, 294, 295, 296, 297, + 298, 299, 300, 301, -1, -1, 275, 59, -1, 33, + 308, 309, -1, -1, -1, -1, 40, 41, 287, 43, + -1, 45, -1, -1, 293, 294, 295, 296, 297, 298, + 299, 300, 301, -1, -1, 275, 33, -1, -1, 308, + 309, -1, -1, 40, 41, -1, 43, 287, 45, -1, + -1, -1, 273, 293, 294, 295, 296, 297, 298, 299, + 300, 301, -1, 33, -1, -1, -1, -1, 308, 309, + 40, 41, -1, 43, -1, 45, -1, -1, -1, -1, + -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, + -1, 33, -1, 314, 315, 316, 317, 275, 40, 41, + 321, 43, -1, 45, -1, -1, -1, -1, -1, 287, + -1, -1, -1, -1, -1, 293, 294, 295, 296, 297, + 298, 299, 300, 301, -1, -1, 257, 33, -1, -1, + 308, 309, 263, -1, 40, -1, 275, 43, 269, 45, + -1, -1, -1, -1, -1, 276, 277, 278, 287, 280, + 281, -1, -1, 284, 293, 294, 295, 296, 297, 298, }; } class yyCheck1 { - protected static final short yyCheck1 [] = { 33, - -1, -1, -1, -1, 308, 309, 40, -1, 275, 43, - -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, - 287, -1, -1, -1, -1, -1, 293, 294, 295, 296, - 297, 298, 299, 300, 301, -1, -1, -1, -1, -1, - -1, 308, 309, -1, -1, -1, -1, -1, -1, -1, - -1, 275, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 287, -1, -1, -1, -1, -1, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 275, -1, - -1, -1, -1, -1, 308, 309, -1, 60, -1, -1, - 287, -1, -1, -1, -1, 275, 293, 294, 295, 296, - 297, 298, 299, 300, 301, -1, -1, 287, -1, -1, - -1, 308, 309, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 275, -1, -1, -1, -1, -1, 308, 309, - -1, -1, -1, -1, 287, -1, -1, -1, -1, -1, - 293, 294, 295, 296, 297, 298, 299, 300, 301, -1, - -1, -1, 125, -1, -1, 308, 309, -1, 37, 38, - -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, - -1, -1, -1, -1, -1, -1, -1, 275, -1, -1, - 59, -1, -1, 62, -1, -1, -1, -1, -1, 287, + protected static final short yyCheck1 [] = { 299, + 300, 301, -1, -1, -1, -1, -1, 275, 308, 309, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 287, -1, -1, -1, -1, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, -1, -1, -1, -1, -1, -1, - 308, 309, 91, -1, 275, 94, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 287, -1, -1, -1, - 40, -1, 293, 294, 295, 296, 297, 298, 299, 300, - 301, -1, -1, -1, 123, 124, 125, 308, 309, 59, - -1, -1, -1, 287, -1, -1, -1, -1, -1, 293, - 294, 295, 296, 297, 298, 299, 300, 301, -1, -1, - -1, -1, 37, 38, 308, 309, 41, 42, 43, 44, - 45, -1, 47, -1, 257, 258, -1, -1, -1, 262, - -1, -1, -1, -1, 59, 60, 269, 62, -1, -1, - -1, 274, -1, 276, 277, 278, 364, 365, -1, -1, - -1, 284, -1, 123, -1, 125, -1, -1, 291, -1, - -1, 379, -1, -1, -1, -1, -1, 37, 301, 94, - -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, - -1, -1, -1, 401, 402, -1, 404, -1, -1, 59, - 60, 409, 62, -1, -1, 413, -1, 415, 416, 124, - 125, -1, -1, -1, -1, -1, 424, 425, 426, -1, - -1, -1, 430, -1, -1, -1, -1, -1, 257, 258, - -1, -1, -1, 262, 94, -1, -1, -1, -1, -1, - 269, -1, -1, -1, 273, 274, -1, 276, 277, 278, - -1, -1, -1, 282, -1, 284, -1, -1, -1, 60, - -1, -1, 291, -1, 124, 125, -1, -1, -1, -1, - -1, -1, 301, 302, 303, 304, 305, 306, 307, 308, - 309, -1, -1, 37, 38, -1, -1, 41, 42, 43, - 44, 45, 46, 47, -1, -1, -1, -1, 258, -1, - -1, -1, 262, -1, -1, 59, 60, 267, 62, -1, - -1, 271, 272, -1, 274, -1, -1, -1, -1, -1, - -1, -1, -1, 283, 125, -1, -1, 287, -1, -1, - -1, -1, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 257, 258, -1, -1, -1, 262, 308, 309, - -1, -1, -1, -1, 269, -1, -1, -1, 273, 274, - -1, 276, 277, 278, -1, -1, -1, -1, -1, 284, - 124, 125, -1, -1, -1, -1, 291, 40, -1, -1, - -1, -1, -1, -1, -1, -1, 301, 302, 303, 304, - 305, 306, 307, 308, 309, -1, 59, 257, 258, -1, - -1, -1, 262, -1, -1, -1, -1, -1, -1, 269, - -1, -1, -1, 273, 274, -1, 276, 277, 278, -1, - -1, -1, -1, -1, 284, -1, -1, -1, 37, 38, - -1, 291, 41, 42, 43, 44, 45, 46, 47, -1, - -1, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 59, 60, -1, 62, -1, -1, 257, 258, -1, -1, - 123, 262, -1, -1, -1, -1, -1, -1, 269, -1, - -1, -1, -1, 274, -1, 276, 277, 278, -1, -1, - -1, -1, -1, 284, -1, 94, -1, 37, 38, -1, - 291, 41, 42, 43, 44, 45, 46, 47, -1, -1, - 301, -1, -1, 257, 258, -1, -1, -1, 262, 59, - 60, -1, 62, -1, -1, 269, 125, -1, -1, 273, - 274, -1, 276, 277, 278, -1, -1, -1, -1, -1, - 284, -1, -1, -1, -1, -1, -1, 291, -1, -1, - -1, -1, -1, -1, 94, -1, -1, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 37, 38, -1, -1, - 41, 42, 43, 44, 45, 46, 47, -1, -1, -1, - -1, -1, -1, -1, 124, 125, -1, -1, 59, 60, - -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 37, 38, -1, -1, 41, 42, 43, - 44, 45, -1, 47, -1, -1, -1, -1, 271, 272, - -1, -1, -1, 94, -1, 59, 60, -1, 62, -1, - 283, -1, -1, -1, 287, -1, -1, -1, -1, 292, + 308, 309, -1, -1, 37, 38, -1, 40, 41, 42, + 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, + -1, -1, 275, -1, -1, -1, 59, -1, -1, 62, + -1, -1, -1, -1, 287, -1, -1, -1, -1, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, -1, - -1, -1, -1, 124, 125, 308, 309, -1, 257, 258, - 94, -1, -1, 262, -1, -1, -1, -1, -1, -1, - 269, -1, -1, -1, 273, 274, -1, 276, 277, 278, - -1, -1, -1, -1, -1, 284, -1, -1, -1, 37, - 124, 125, 291, 41, 42, 43, 44, 45, 46, 47, - -1, -1, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 59, 60, -1, 62, -1, -1, 257, 258, -1, - -1, -1, 262, -1, -1, -1, -1, -1, -1, 269, - -1, -1, -1, 273, 274, -1, 276, 277, 278, -1, - -1, -1, -1, -1, 284, -1, 94, -1, -1, -1, - -1, 291, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 301, 302, 303, 304, 305, 306, -1, 308, 309, - -1, -1, -1, -1, 37, 38, 124, 125, 41, 42, - 43, 44, 45, 46, 47, -1, 257, 258, -1, -1, - -1, 262, -1, -1, -1, -1, 59, 60, 269, 62, - -1, -1, 273, 274, -1, 276, 277, 278, -1, -1, - -1, -1, -1, 284, -1, -1, -1, -1, -1, -1, - 291, -1, -1, 257, 258, -1, -1, -1, 262, -1, - 301, 302, 303, 304, 305, 269, 307, 308, 309, 273, - 274, -1, 276, 277, 278, -1, -1, -1, -1, -1, - 284, -1, -1, -1, -1, -1, -1, 291, -1, -1, + 275, -1, -1, -1, -1, 308, 309, -1, 91, -1, + -1, 94, 287, -1, -1, -1, -1, -1, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 275, -1, -1, + -1, -1, -1, 308, 309, -1, -1, -1, -1, 287, + 123, 124, -1, -1, -1, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 275, -1, -1, -1, -1, -1, + 308, 309, -1, -1, -1, -1, 287, -1, -1, -1, + -1, -1, 293, 294, 295, 296, 297, 298, 299, 300, + 301, -1, 275, -1, -1, -1, -1, 308, 309, -1, + -1, -1, -1, -1, 287, -1, -1, -1, -1, -1, + 293, 294, 295, 296, 297, 298, 299, 300, 301, -1, + -1, -1, -1, -1, -1, 308, 309, -1, 275, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 287, -1, -1, -1, -1, -1, 293, 294, 295, 296, + 297, 298, 299, 300, 301, -1, -1, -1, -1, -1, + -1, 308, 309, -1, -1, -1, -1, -1, -1, 37, + 38, -1, -1, 41, 42, 43, 44, 45, -1, 47, + -1, -1, -1, -1, 257, 258, -1, -1, -1, 262, + 263, 59, 60, -1, 62, -1, 269, -1, -1, -1, + 273, 274, -1, 276, 277, 278, 279, 280, 281, 282, + -1, 284, -1, -1, -1, 37, -1, -1, -1, 41, + 42, 43, 44, 45, 46, 47, 94, -1, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 59, 60, -1, + 62, 37, 38, -1, -1, 41, 42, 43, 44, 45, + 46, 47, -1, -1, -1, -1, 124, -1, -1, -1, + -1, -1, -1, 59, 60, -1, 62, -1, -1, 37, + 38, -1, 94, 41, 42, 43, 44, 45, 46, 47, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 59, 60, -1, 62, -1, -1, -1, -1, -1, + -1, -1, 124, -1, -1, -1, -1, 37, 38, -1, + -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, + -1, -1, -1, -1, -1, -1, 94, -1, 124, 59, + 60, -1, 62, 37, 38, -1, -1, 41, 42, 43, + 44, 45, 46, 47, 37, 38, -1, -1, 41, 42, + 43, 44, 45, -1, 47, 59, 60, -1, 62, -1, + -1, -1, -1, -1, 94, -1, 59, 60, -1, 62, + 37, -1, -1, -1, 41, 42, 43, 44, 45, 46, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 94, -1, 59, 60, 124, 62, -1, -1, -1, -1, + -1, 94, -1, -1, -1, 273, -1, 37, 38, -1, + -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, + 124, -1, -1, -1, -1, -1, -1, 94, -1, 59, + 60, 124, 62, -1, 302, 303, 304, 305, 306, 307, + 308, 309, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 273, -1, -1, -1, -1, -1, 124, -1, -1, + -1, -1, -1, -1, -1, -1, 37, 38, -1, -1, + 41, 42, 43, 44, 45, 46, 47, 273, -1, -1, + 302, 303, 304, 305, 306, 307, 308, 309, 59, 60, + -1, 62, -1, -1, 124, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 273, 302, 303, 304, 305, + 306, 307, 308, 309, -1, -1, -1, -1, -1, -1, + 37, 38, -1, 94, 41, 42, 43, 44, 45, 46, + 47, -1, -1, -1, 302, 303, 304, 305, 306, 307, + 308, 309, 59, 273, -1, 37, 38, -1, -1, 41, + 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 59, 60, 273, + 62, -1, 302, 303, 304, 305, 306, 94, 308, 309, + 273, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 302, 303, + 304, 305, 94, 307, 308, 309, 273, 124, -1, 302, + 303, 304, 305, 306, 307, 308, 309, -1, -1, -1, + -1, -1, -1, -1, 37, 38, -1, -1, 41, 42, + -1, 44, 124, 46, 47, 302, 303, 304, 305, 306, + 307, 308, 309, 273, -1, -1, 59, 60, -1, 62, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 37, 38, -1, -1, 41, 42, 43, 44, 45, + 46, 47, 302, 303, 304, 305, 306, 307, 308, 309, + -1, 94, -1, 59, 60, -1, 62, 37, 38, -1, + -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, + -1, -1, 273, -1, -1, -1, -1, -1, -1, 59, + 60, 124, 62, -1, -1, -1, -1, -1, 94, 37, + 38, -1, -1, 41, 42, 43, 44, 45, 46, 47, + -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, + -1, 59, -1, -1, 94, 37, 38, -1, 124, 41, + 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, + -1, -1, 38, -1, 124, 41, 94, 43, 44, 45, + 46, 273, -1, -1, -1, 302, -1, -1, 305, 306, + 307, 308, 309, 59, 60, -1, 62, -1, -1, -1, + -1, -1, 94, -1, -1, -1, 124, -1, -1, -1, + 302, 303, 304, 305, 306, 38, 308, 309, 41, -1, + 43, 44, 45, 46, -1, -1, -1, -1, 94, -1, + -1, -1, 124, -1, -1, -1, 59, 60, -1, 62, + -1, -1, -1, 38, -1, -1, 41, -1, 43, 44, + 45, 46, -1, -1, -1, -1, 257, 258, 124, -1, + 273, 262, 263, -1, 59, 60, -1, 62, 269, -1, + -1, 94, -1, 274, -1, 276, 277, 278, 279, 280, + 281, -1, -1, 284, -1, -1, -1, -1, -1, 302, + 303, 304, 305, 306, 307, 308, 309, 273, -1, 94, + 301, 124, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 37, 38, -1, -1, 41, 42, 43, 44, }; } class yyCheck2 { - protected static final short yyCheck2 [] = { -1, - 124, 125, -1, 60, -1, -1, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 37, 38, -1, -1, 41, - 42, 43, 44, 45, 46, 47, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 59, 60, -1, - 62, -1, -1, -1, -1, -1, -1, -1, 257, 258, - -1, -1, -1, 262, -1, -1, -1, -1, -1, -1, - 269, -1, -1, -1, 273, 274, -1, 276, 277, 278, - -1, -1, 94, -1, -1, 284, -1, -1, -1, -1, - -1, -1, 291, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 37, 38, 125, -1, 41, 42, 43, 44, 45, - 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 59, 60, -1, 62, -1, -1, -1, - -1, -1, -1, 257, 258, -1, -1, -1, 262, -1, - -1, -1, -1, -1, -1, 269, -1, -1, -1, 273, - 274, -1, 276, 277, 278, -1, -1, -1, 94, -1, - 284, -1, -1, -1, -1, -1, -1, 291, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 37, 38, 124, 125, - 41, 42, -1, 44, -1, 46, 47, -1, -1, -1, - 257, 258, -1, -1, -1, 262, -1, -1, 59, 60, - -1, 62, 269, -1, -1, -1, -1, 274, -1, 276, - 277, 278, -1, -1, -1, -1, -1, 284, -1, -1, - -1, -1, -1, -1, 291, 257, 258, -1, -1, -1, - 262, -1, 40, 94, 301, -1, -1, 269, -1, -1, - -1, 273, 274, -1, 276, 277, 278, -1, -1, -1, - -1, 59, 284, -1, -1, -1, -1, -1, -1, 291, - -1, -1, -1, 124, 125, -1, -1, -1, -1, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 37, 38, - -1, -1, 41, 42, 43, 44, 45, 46, 47, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 59, 60, -1, 62, -1, -1, -1, -1, -1, -1, - -1, 257, 258, -1, -1, 123, 262, -1, -1, -1, - -1, -1, -1, 269, -1, -1, -1, 273, 274, -1, - 276, 277, 278, -1, -1, 94, -1, -1, 284, -1, - -1, -1, -1, -1, -1, 291, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 301, 302, 303, 304, 305, - 306, -1, 308, 309, -1, 124, 125, 37, 38, -1, - -1, 41, 42, 43, 44, 45, 46, 47, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, - 60, -1, 62, -1, -1, -1, 257, 258, -1, -1, - -1, 262, -1, -1, -1, -1, -1, -1, 269, -1, - -1, -1, 273, 274, -1, 276, 277, 278, -1, -1, - -1, -1, -1, 284, 94, -1, -1, -1, -1, -1, - 291, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 301, 302, 303, 304, 305, 306, 307, 308, 309, -1, - -1, -1, 37, 38, 124, 125, 41, 42, 43, 44, - 45, 46, 47, 271, 272, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, 283, -1, -1, -1, 287, - -1, -1, -1, -1, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, -1, -1, -1, -1, 257, 258, - 308, 309, -1, 262, -1, -1, -1, -1, -1, 94, - 269, -1, -1, -1, 273, 274, -1, 276, 277, 278, - -1, -1, -1, -1, -1, 284, -1, -1, -1, -1, - -1, -1, 291, -1, -1, -1, -1, -1, -1, 124, - 125, -1, 301, -1, 303, 304, -1, 306, 307, 308, - 309, -1, -1, 37, 38, -1, -1, 41, 42, 43, - 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 59, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 257, 258, -1, - -1, -1, 262, -1, -1, -1, -1, -1, -1, 269, - -1, -1, -1, 273, 274, -1, 276, 277, 278, -1, - 94, -1, -1, -1, 284, -1, -1, -1, -1, -1, - -1, 291, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 301, -1, 303, 304, 60, 306, 307, 308, 309, - 124, 125, -1, 37, 38, -1, -1, 41, 42, 43, - 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 59, -1, -1, -1, -1, - -1, -1, 257, 258, -1, -1, -1, 262, -1, -1, - -1, -1, -1, -1, 269, -1, -1, -1, -1, 274, - -1, 276, 277, 278, -1, -1, -1, -1, -1, 284, - 94, -1, -1, -1, -1, -1, 291, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 301, 302, -1, -1, - 305, 306, 307, 308, 309, -1, -1, -1, -1, -1, - 124, 125, -1, 38, -1, -1, 41, -1, 43, 44, - 45, 46, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, 60, -1, 62, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 257, 258, -1, -1, -1, 262, -1, - -1, 137, 138, -1, -1, 269, -1, -1, -1, 94, - 274, -1, 276, 277, 278, -1, -1, -1, -1, -1, - 284, -1, -1, -1, -1, 38, -1, 291, 41, -1, - 43, 44, 45, 46, -1, -1, -1, 301, 302, 124, - 125, 305, 306, 307, 308, 309, 59, 60, -1, 62, - -1, -1, 257, 258, 190, 191, 192, 262, -1, -1, - -1, -1, -1, -1, 269, -1, -1, -1, -1, 274, - -1, 276, 277, 278, -1, -1, -1, -1, -1, 284, - -1, 94, -1, 257, 258, -1, 291, -1, 262, -1, - -1, -1, -1, -1, -1, 269, 301, -1, -1, -1, - 274, -1, 276, 277, 278, -1, -1, -1, -1, -1, - 284, 124, 125, -1, -1, 38, -1, 291, 41, -1, - 43, 44, 45, 46, -1, -1, -1, 301, 302, -1, - -1, 305, 306, 307, 308, 309, 59, 60, -1, 62, - -1, -1, -1, -1, -1, -1, -1, 283, 284, 285, - 286, 287, -1, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, -1, -1, -1, -1, -1, -1, - -1, 94, 257, 258, -1, -1, -1, 262, -1, -1, - -1, -1, -1, -1, 269, -1, -1, -1, 273, 274, - -1, 276, 277, 278, -1, -1, -1, -1, -1, 284, - 336, 124, 125, -1, -1, -1, 291, -1, -1, -1, - }; -} -class yyCheck3 { - protected static final short yyCheck3 [] = { -1, - -1, -1, -1, -1, -1, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 37, 38, -1, -1, 41, 42, - 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, - -1, -1, -1, 257, 258, -1, 59, 60, 262, 62, - -1, -1, 40, -1, -1, 269, -1, -1, -1, 273, - 274, -1, 276, 277, 278, -1, -1, -1, -1, -1, - 284, 59, -1, -1, -1, -1, -1, 291, -1, -1, - -1, 94, -1, -1, -1, -1, -1, 301, 302, 303, + protected static final short yyCheck2 [] = { 45, + 46, 47, 273, -1, 60, -1, 303, 304, 124, 306, + 307, 308, 309, 59, 60, -1, 62, -1, -1, -1, + 40, -1, 257, -1, -1, -1, -1, -1, 263, -1, + -1, -1, 303, 304, 269, 306, 307, 308, 309, 59, + -1, 276, 277, 278, -1, -1, 281, -1, 94, 284, + -1, -1, -1, 257, -1, -1, -1, -1, -1, 263, + -1, -1, -1, 302, 40, 269, 305, 306, 307, 308, + 309, -1, 276, 277, 278, -1, -1, 281, 124, -1, + 284, -1, -1, 59, -1, -1, 273, -1, -1, 302, + -1, -1, 305, 306, 307, 308, 309, -1, -1, -1, + -1, -1, -1, 123, -1, 125, -1, -1, -1, -1, + -1, -1, 40, -1, -1, 302, 303, 304, 305, 306, + 307, 308, 309, -1, -1, -1, -1, -1, -1, 273, + -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 123, -1, 125, + -1, -1, -1, -1, -1, -1, 40, 273, 302, 303, 304, 305, 306, 307, 308, 309, -1, -1, -1, -1, - -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, - -1, 124, 125, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 59, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 257, 258, 123, -1, 125, 262, -1, - -1, -1, -1, -1, -1, 269, -1, -1, -1, 273, - 274, -1, 276, 277, 278, -1, 40, -1, -1, -1, - 284, -1, -1, -1, -1, -1, -1, 291, -1, -1, - -1, -1, -1, -1, -1, 59, -1, 301, 302, 303, - 304, 305, 306, 307, 308, 309, -1, 123, -1, 125, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 59, -1, -1, -1, -1, -1, -1, 123, - -1, 125, -1, -1, 257, 258, -1, -1, -1, 262, - -1, -1, -1, -1, -1, -1, 269, 40, -1, -1, - 273, 274, -1, 276, 277, 278, -1, -1, -1, -1, - 258, 284, -1, -1, 262, -1, 59, -1, 291, -1, - -1, -1, -1, 271, 272, -1, 274, -1, 301, 302, - 303, 304, 305, 306, 307, 283, 123, -1, 125, 287, - -1, -1, -1, -1, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, -1, 40, -1, -1, -1, -1, - 308, 309, 258, -1, -1, -1, 262, -1, -1, -1, - -1, -1, -1, -1, 59, 271, 272, -1, 274, -1, - 123, -1, 125, -1, -1, -1, -1, 283, -1, -1, + -1, -1, -1, -1, -1, 59, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 302, 303, 304, 305, + 306, 307, 308, 309, -1, 123, -1, 125, -1, -1, + 40, 257, 258, -1, -1, -1, 262, -1, -1, -1, + -1, -1, -1, 269, -1, -1, -1, -1, 274, 59, + 276, 277, 278, -1, -1, -1, -1, 273, 284, -1, + -1, -1, -1, -1, -1, 291, -1, -1, 258, 123, + -1, 125, 262, -1, -1, 301, -1, 267, -1, -1, + -1, 271, 272, -1, 274, -1, 302, 303, 304, 305, + 306, 307, -1, 283, -1, 40, -1, 287, -1, -1, + -1, -1, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 258, 123, 59, 125, 262, -1, 308, 309, + -1, -1, -1, -1, -1, 271, 272, -1, 274, -1, + -1, -1, -1, -1, -1, -1, -1, 283, -1, 40, -1, 287, -1, -1, -1, -1, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, -1, -1, -1, -1, - -1, -1, 308, 309, 258, -1, -1, -1, 262, -1, - -1, -1, -1, -1, -1, -1, -1, 271, 272, -1, - 274, -1, -1, -1, -1, -1, -1, -1, 123, 283, - 125, -1, -1, 287, -1, -1, -1, -1, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, -1, -1, - -1, -1, -1, -1, 308, 309, -1, -1, -1, -1, - -1, 258, -1, -1, -1, 262, -1, -1, -1, -1, - -1, -1, -1, -1, 271, 272, -1, 274, -1, -1, - -1, -1, -1, -1, -1, -1, 283, -1, -1, -1, - 287, -1, -1, -1, -1, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 258, -1, -1, -1, 262, - -1, 308, 309, -1, -1, -1, -1, -1, 271, 272, - -1, 274, -1, -1, -1, -1, -1, -1, -1, -1, - 283, -1, -1, -1, 287, -1, -1, -1, -1, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, -1, - -1, -1, -1, -1, -1, 308, 309, -1, -1, -1, - -1, -1, -1, 258, -1, -1, -1, 262, -1, -1, + 296, 297, 298, 299, 300, 301, -1, -1, 59, -1, + 258, -1, 308, 309, 262, -1, -1, -1, -1, -1, + -1, -1, -1, 271, 272, -1, 274, -1, 123, -1, + 125, -1, -1, -1, -1, 283, 40, -1, -1, 287, + -1, 44, -1, -1, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 258, 59, -1, -1, 262, 62, + 308, 309, -1, -1, -1, -1, -1, 271, 272, -1, + 274, -1, 123, -1, 125, -1, -1, -1, -1, 283, + -1, 40, -1, 287, -1, -1, -1, -1, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 258, -1, + 59, -1, 262, -1, 308, 309, -1, -1, -1, -1, + -1, 271, 272, -1, 274, -1, -1, -1, -1, 123, + -1, -1, -1, 283, -1, -1, -1, 287, -1, -1, + -1, -1, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 44, -1, -1, -1, -1, -1, 308, 309, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 62, -1, -1, 258, 123, -1, -1, 262, -1, -1, -1, -1, -1, -1, -1, -1, 271, 272, -1, 274, - -1, -1, -1, -1, -1, -1, -1, -1, 283, -1, + -1, -1, -1, -1, -1, -1, 60, -1, 283, -1, -1, -1, 287, -1, -1, -1, -1, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, -1, -1, -1, - -1, -1, -1, 308, 309, + 295, 296, 297, 298, 299, 300, 301, 258, -1, -1, + -1, 262, -1, 308, 309, -1, -1, 60, -1, -1, + 271, 272, -1, 274, -1, -1, -1, -1, -1, -1, + -1, -1, 283, -1, -1, -1, 287, -1, -1, -1, + -1, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 125, 60, -1, 257, 258, -1, 308, 309, 262, + 263, -1, -1, -1, -1, -1, 269, 271, 272, -1, + -1, 274, -1, 276, 277, 278, 279, 280, 281, 283, + 60, 284, 125, 287, -1, -1, -1, -1, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 301, -1, + -1, -1, -1, -1, 308, 309, -1, -1, 60, -1, + -1, -1, 271, 272, -1, -1, -1, 125, -1, -1, + -1, -1, -1, -1, 283, -1, -1, -1, 287, -1, + -1, -1, -1, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, -1, -1, 125, -1, -1, -1, 308, + 309, -1, -1, -1, -1, 257, 258, -1, -1, -1, + 262, 263, -1, -1, -1, -1, -1, 269, -1, -1, + -1, -1, 274, -1, 276, 277, 278, 279, 280, 281, + -1, -1, 284, 257, 258, -1, -1, -1, 262, -1, + -1, -1, -1, -1, -1, 269, -1, -1, -1, 301, + 274, -1, 276, 277, 278, -1, -1, -1, -1, -1, + 284, -1, -1, -1, 257, 258, -1, 291, -1, 262, + -1, -1, -1, -1, -1, -1, 269, 301, -1, -1, + -1, 274, -1, 276, 277, 278, -1, -1, -1, -1, + -1, 284, -1, -1, -1, -1, -1, -1, 291, 257, + 258, -1, -1, -1, 262, -1, -1, -1, 301, -1, + -1, 269, -1, -1, -1, -1, 274, -1, 276, 277, + 278, -1, -1, -1, -1, -1, 284, 257, 258, -1, + -1, -1, 262, 291, -1, -1, -1, -1, -1, 269, + -1, 416, 417, 301, 274, -1, 276, 277, 278, -1, + -1, -1, -1, -1, 284, 257, 258, 432, -1, -1, + 262, 291, -1, -1, -1, -1, -1, 269, -1, -1, + -1, 301, 274, -1, 276, 277, 278, -1, 453, 454, + -1, 456, 284, -1, -1, -1, 461, -1, -1, 291, + 465, -1, 467, 468, -1, -1, -1, -1, -1, 301, + -1, 476, 477, 478, -1, -1, -1, 482, }; } class yyCheckInit { - static short[] yyCheck = new short[3579]; + static short[] yyCheck = new short[2881]; protected static void yyCheckInit () { int numyycheck; int yyCheckerun = 0; for (numyycheck = 0; numyycheck <= 1000; numyycheck++) { - if (yyCheckerun < 3579) { + if (yyCheckerun < 2881) { yyCheck[yyCheckerun] = yyCheck0.yyCheck0[numyycheck]; yyCheckerun++; } } for (numyycheck = 0; numyycheck <= 1000; numyycheck++) { - if (yyCheckerun < 3579) { + if (yyCheckerun < 2881) { yyCheck[yyCheckerun] = yyCheck1.yyCheck1[numyycheck]; yyCheckerun++; } } for (numyycheck = 0; numyycheck <= 1000; numyycheck++) { - if (yyCheckerun < 3579) { + if (yyCheckerun < 2881) { yyCheck[yyCheckerun] = yyCheck2.yyCheck2[numyycheck]; yyCheckerun++; } } - for (numyycheck = 0; numyycheck <= 1000; numyycheck++) { - if (yyCheckerun < 3579) { - yyCheck[yyCheckerun] = yyCheck3.yyCheck3[numyycheck]; - yyCheckerun++; - } - } } } diff --git a/src/mycompiler/myparser/JavaParser.jay b/src/mycompiler/myparser/JavaParser.jay index a2755734b..702414c31 100755 --- a/src/mycompiler/myparser/JavaParser.jay +++ b/src/mycompiler/myparser/JavaParser.jay @@ -313,7 +313,8 @@ public Vector testPair = new Vector(); %type explicitconstructorinvocation %type staticinitializer %type castexpression -%type paralist parameter +%type paralist +%type typelist parameter %type wildcardparameter %left ',' %% @@ -322,7 +323,7 @@ compilationunit : typedeclarations { $$=$1; } -/* |importdeclarations typedeclarations + |importdeclarations typedeclarations { $2.addImports($1); $$=$2; @@ -345,7 +346,7 @@ compilationunit : typedeclarations this.testPair.add(new Pair($1,$2)); $$=$3; } - */ + packagedeclaration : PACKAGE name ';' ; { // SCJU: Package @@ -394,12 +395,12 @@ typedeclaration :classdeclaration { $$=$1; } -/* | interfacedeclaration + | interfacedeclaration { // SCJU: Interface $$=$1; } -*/ + qualifiedname : name '.' IDENTIFIER { @@ -785,21 +786,34 @@ classbodydeclaration : classmemberdeclaration classorinterfacetype : simplename parameter { if ($2 != null) { - $1.set_ParaList($2.get_ParaList()); - + //$1.set_ParaList($2.get_ParaList()); + $1.set_ParaList($2);//Änderung von Andreas Stadelmeier. Type statt GenericVarType /* otth: originale (also diese) Parameterliste retten */ - ((UsedId)$1).vParaOrg = new Vector( $2.get_ParaList() ); + //((UsedId)$1).vParaOrg = new Vector( $2.get_ParaList() ); } $$=$1; } +typelist : type + { + Vector tl = new Vector(); + tl.add($1); + $$ = tl; + } + | typelist ',' type + { + $1.add($3); + $$=$1; + } + /* PL 05-07-28 erg�nzt, weil jeder classorinterfacetype auch parametrisiert sein kann */ +//TODO: Das hier ist möglicherweise falsch. Ein Typ hat keine parameterliste, nur eine Liste von RefTypes parameter : { $$ = null; } - | '<'paralist'>' + | '<'typelist'>'//'<'paralist'>'//typelist statt { $$ = $2; } - + interfacememberdeclaration : constantdeclaration { // SCJU: Interfaces, Spezialform Konstantendef. @@ -821,7 +835,7 @@ classmemberdeclaration : fielddeclaration staticinitializer : STATIC block { - Method STAT = new Method(); + Method STAT = new Method($1.getOffset()); DeclId DST = new DeclId(); DST.set_Name($1.getLexem()); STAT.set_DeclId(DST); @@ -867,9 +881,21 @@ Beispiel: var = 2; Bei einer lokalen Variable lässt sich hier nicht ermitteln ob die Variable deklariert werden soll oder bereits deklariert wurde und ihr nur ein Wert zugewiesen werden soll. Dieses Problem ist bei Feldern nicht der Fall. */ -fielddeclarator : variabledeclarator '=' expression +fielddeclarator : + /* + type variabledeclarator '=' expression { - FieldDeclaration ret = new FieldDeclaration(); + FieldDeclaration ret = new FieldDeclaration($2.getOffset()); + ret.setType($1); + ret.set_DeclId($2); + ret.setWert($4); + $$=ret; + } + | + */ + variabledeclarator '=' expression + { + FieldDeclaration ret = new FieldDeclaration($1.getOffset()); ret.set_DeclId($1); ret.setWert($3); $$=ret; @@ -879,11 +905,17 @@ fielddeclaration : fielddeclarator ';' { $$=$1; } - | type fielddeclarator + | type fielddeclarator ';' { $2.setType($1); $$=$2; } + | '<' boundedMethodParameters '>' type fielddeclarator ';' + {//angefügt von Andreas Stadelmeier + $5.setType($4); + $5.setGenericParameter($2); + $$=$5; + } | variabledeclarators ';' { @@ -1000,8 +1032,8 @@ boundedMethodParameter : IDENTIFIER } | IDENTIFIER EXTENDS boundedclassidentifierlist { - BoundedGenericTypeVar gtv=new BoundedGenericTypeVar($1.getLexem(),$1.getOffset()); - gtv.setBounds($3); + BoundedGenericTypeVar gtv=new BoundedGenericTypeVar($1.getLexem(),$3,$1.getOffset()); + //gtv.setBounds($3); $$=gtv; } // returns Vector @@ -1035,45 +1067,45 @@ boundedMethodParameters : boundedMethodParameter // returns Method methodheader :'<' boundedMethodParameters '>' type methoddeclarator { - $5.setReturnType($4); + $5.setType($4); $5.setGenericMethodParameters($2); $$=$5; } | type methoddeclarator { - $2.setReturnType($1); + $2.setType($1); $$=$2; } | modifiers type methoddeclarator { $3.set_Modifiers($1); - $3.setReturnType($2); + $3.setType($2); $$=$3; } | modifiers '<' boundedMethodParameters '>' type methoddeclarator { $6.set_Modifiers($1); $6.setGenericMethodParameters($3); - $6.setReturnType($5); + $6.setType($5); $$=$6; } | type methoddeclarator throws { - $2.setReturnType($1); + $2.setType($1); $2.set_ExceptionList($3); $$=$2; } | '<' boundedMethodParameters '>' type methoddeclarator throws { $5.setGenericMethodParameters($2); - $5.setReturnType($4); + $5.setType($4); $5.set_ExceptionList($6); $$=$5; } | modifiers type methoddeclarator throws { $3.set_Modifiers($1); - $3.setReturnType($2); + $3.setType($2); $3.set_ExceptionList($4); $$=$3; } @@ -1081,27 +1113,27 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator { $6.set_Modifiers($1); $6.setGenericMethodParameters($3); - $6.setReturnType($5); + $6.setType($5); $6.set_ExceptionList($7); $$=$6; } | VOID methoddeclarator { Void Voit = new Void($1.getOffset()); - $2.setReturnType(Voit); + $2.setType(Voit); $$=$2; } | modifiers VOID methoddeclarator { Void voit = new Void($2.getOffset()); $3.set_Modifiers($1); - $3.setReturnType(voit); + $3.setType(voit); $$=$3; } | VOID methoddeclarator throws { Void voyt = new Void($1.getOffset()); - $2.setReturnType(voyt); + $2.setType(voyt); $2.set_ExceptionList($3); $$=$2; } @@ -1109,14 +1141,14 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator { Void voyd = new Void($2.getOffset()); $3.set_Modifiers($1); - $3.setReturnType(voyd); + $3.setType(voyd); $3.set_ExceptionList($4); $$=$3; } | '<' boundedMethodParameters '>' VOID methoddeclarator { Void Voit = new Void($4.getOffset()); - $5.setReturnType(Voit); + $5.setType(Voit); $5.setGenericMethodParameters($2); $$=$5; } @@ -1124,14 +1156,14 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator { Void voit = new Void($5.getOffset()); $6.set_Modifiers($1); - $6.setReturnType(voit); + $6.setType(voit); $6.setGenericMethodParameters($3); $$=$6; } | '<' boundedMethodParameters '>' VOID methoddeclarator throws { Void voyt = new Void($4.getOffset()); - $5.setReturnType(voyt); + $5.setType(voyt); $5.set_ExceptionList($6); $5.setGenericMethodParameters($2); $$=$5; @@ -1140,7 +1172,7 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator { Void voyd = new Void($5.getOffset()); $6.set_Modifiers($1); - $6.setReturnType(voyd); + $6.setType(voyd); $6.set_ExceptionList($7); $6.setGenericMethodParameters($3); $$=$6; @@ -1148,12 +1180,12 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator | methoddeclarator { - //auskommentiert von Andreas Stadelmeier (a10023) $1.setReturnType(TypePlaceholder.fresh()); + //auskommentiert von Andreas Stadelmeier (a10023) $1.setType(TypePlaceholder.fresh()); $$=$1; } | '<' boundedMethodParameters '>' methoddeclarator { - //auskommentiert von Andreas Stadelmeier (a10023) $4.setReturnType(TypePlaceholder.fresh()); + //auskommentiert von Andreas Stadelmeier (a10023) $4.setType(TypePlaceholder.fresh()); $4.setGenericMethodParameters($2); $$=$4; } @@ -1161,19 +1193,19 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator | modifiers methoddeclarator { $2.set_Modifiers($1); - //auskommentiert von Andreas Stadelmeier (a10023) $2.setReturnType(TypePlaceholder.fresh()); + //auskommentiert von Andreas Stadelmeier (a10023) $2.setType(TypePlaceholder.fresh()); $$=$2; } | methoddeclarator throws { - //auskommentiert von Andreas Stadelmeier (a10023) $1.setReturnType(TypePlaceholder.fresh()); + //auskommentiert von Andreas Stadelmeier (a10023) $1.setType(TypePlaceholder.fresh()); $1.set_ExceptionList($2); $$=$1; } | modifiers methoddeclarator throws { $2.set_Modifiers($1); - //auskommentiert von Andreas Stadelmeier (a10023) $2.setReturnType(TypePlaceholder.fresh()); + //auskommentiert von Andreas Stadelmeier (a10023) $2.setType(TypePlaceholder.fresh()); $2.set_ExceptionList($3); $$=$2; } @@ -1197,8 +1229,9 @@ type : primitivetype } variabledeclarators : variabledeclarator { - FieldDeclaration IVD = new FieldDeclaration(); + FieldDeclaration IVD = new FieldDeclaration($1.getOffset()); IVD.getDeclIdVector().addElement( $1 ); + IVD.setOffset($1.getOffset()); $$ = IVD; } | variabledeclarators ',' variabledeclarator @@ -1267,7 +1300,7 @@ classtypelist : classtype methoddeclarator :IDENTIFIER '(' ')' { - Method met = new Method(); + Method met = new Method($1.getOffset()); /* #JB# 10.04.2005 */ /* ########################################################### */ met.setLineNumber($1.getLineNumber()); @@ -1280,7 +1313,7 @@ methoddeclarator :IDENTIFIER '(' ')' } |IDENTIFIER '(' formalparameterlist ')' { - Method met_para = new Method(); + Method met_para = new Method($1.getOffset()); /* #JB# 10.04.2005 */ /* ########################################################### */ met_para.setLineNumber($1.getLineNumber()); @@ -1307,7 +1340,6 @@ primitivetype :BOOLEAN $$=$1; } - referencetype :classorinterfacetype { org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->referenctype: " + $1); @@ -1360,9 +1392,9 @@ blockstatement :localvariabledeclarationstatement formalparameter : type variabledeclaratorid { - FormalParameter FP = new FormalParameter(); + FormalParameter FP = new FormalParameter($2); FP.setType($1); - FP.set_DeclId($2); + //FP.set_DeclId($2); //auskommentiert von Andreas Stadelmeier. DeclId wird nun dem Konstruktor von FormalParameter übergeben. $$=FP; } @@ -1374,9 +1406,9 @@ formalparameter : type variabledeclaratorid Parameterliste setzen $5.set_Paratyp($3.get_ParaList()); - FormalParameter FP = new FormalParameter(); + FormalParameter FP = new FormalParameter($5); FP.setType($1); - FP.set_DeclId($5); + //FP.set_DeclId($5); $$=FP; org.apache.log4j.Logger.getLogger("parser").debug("P->Polymorphes Methodenargument hinzugefuegt: Name = " + $5.get_Name() + " Typ = " + $1.getName()); @@ -1387,7 +1419,7 @@ formalparameter : type variabledeclaratorid { org.apache.log4j.Logger.getLogger("parser").debug("\nFunktionsdeklaration mit typlosen Parametern: " + $1.name); - FormalParameter FP = new FormalParameter(); + FormalParameter FP = new FormalParameter($1); // #JB# 31.03.2005 // ########################################################### @@ -1397,7 +1429,7 @@ formalparameter : type variabledeclaratorid //org.apache.log4j.Logger.getLogger("parser").debug("\n--> berechneter Name: " + T.getName()); //auskommentiert von Andreas Stadelmeier (a10023) FP.setType( T ); - FP.set_DeclId($1); + //FP.set_DeclId($1); $$=FP; } diff --git a/src/mycompiler/mystatement/Assign.java b/src/mycompiler/mystatement/Assign.java index 57d484cbf..bc81c7450 100755 --- a/src/mycompiler/mystatement/Assign.java +++ b/src/mycompiler/mystatement/Assign.java @@ -7,6 +7,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -32,6 +33,7 @@ import mycompiler.mytypereconstruction.unify.Unify; import org.apache.log4j.Logger; + // ino.end import typinferenz.JavaCodeResult; import typinferenz.SingleConstraint; @@ -259,5 +261,17 @@ public class Assign extends Expr return ret; } + + + + + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.expr1); + ret.add(this.expr2); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mystatement/Binary.java b/src/mycompiler/mystatement/Binary.java index d8b9edc99..80c6a885a 100755 --- a/src/mycompiler/mystatement/Binary.java +++ b/src/mycompiler/mystatement/Binary.java @@ -3,9 +3,11 @@ package mycompiler.mystatement; // ino.end // ino.module.Binary.8623.import import java.util.Enumeration; +import java.util.HashMap; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -20,7 +22,10 @@ import mycompiler.myoperator.MulOp; import mycompiler.myoperator.Operator; import mycompiler.myoperator.RelOp; import mycompiler.mytype.GenericTypeVar; +import mycompiler.mytype.Pair; +import mycompiler.mytype.RefType; import mycompiler.mytype.Type; +import mycompiler.mytype.TypePlaceholder; import mycompiler.mytypereconstruction.CSupportData; import mycompiler.mytypereconstruction.set.CSubstitutionSet; import mycompiler.mytypereconstruction.set.CTripleSet; @@ -31,10 +36,18 @@ import org.apache.log4j.Logger; // ino.end + + + + + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; +import typinferenz.OderConstraint; import typinferenz.ResultSet; +import typinferenz.SingleConstraint; +import typinferenz.UndConstraint; import typinferenz.assumptions.TypeAssumptions; @@ -253,7 +266,26 @@ public class Binary extends BinaryExpr @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { ConstraintsSet ret = new ConstraintsSet(); - // TODO Implement Method stub + ret.add(this.expr1.TYPEExpr(assumptions)); + ret.add(this.expr2.TYPEExpr(assumptions)); + /** + * Berechnet die Constraints dieses Operators für die 2 gegebenen Parameter + * Die Operatoren sind meistens überladen. Es entstehen mehrere Oder-Verknüpfte Constraints. + * @param expr1 + * @param expr2 + * @return + */ + if(this.getType()==null)this.set_Type(TypePlaceholder.fresh(this)); + OderConstraint oderCons = new OderConstraint(); + HashMap rMap = this.op.getReturnTypes(assumptions); + for(Type rT : rMap.keySet()){ + UndConstraint c = new UndConstraint(); + c.addConstraint(this.getType(),rT); + c.addConstraint(this.expr1.getType(), rMap.get(rT)); + c.addConstraint(this.expr2.getType(), rMap.get(rT)); + oderCons.addConstraint(c); + } + ret.add(oderCons); return ret; } @@ -261,7 +293,21 @@ public class Binary extends BinaryExpr @Override public JavaCodeResult printJavaCode(ResultSet resultSet) { - throw new NotImplementedException(); + JavaCodeResult ret = new JavaCodeResult(); + ret.attach(this.expr1.printJavaCode(resultSet)).attach(" "); + ret.attach(this.op.toString()+" "); + ret.attach(this.expr2.printJavaCode(resultSet)); + return ret; + } + + + + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.expr1); + ret.add(this.expr2); + return ret; } diff --git a/src/mycompiler/mystatement/BinaryExpr.java b/src/mycompiler/mystatement/BinaryExpr.java index 8af06a319..a8e4ca28a 100755 --- a/src/mycompiler/mystatement/BinaryExpr.java +++ b/src/mycompiler/mystatement/BinaryExpr.java @@ -1,5 +1,8 @@ // ino.module.BinaryExpr.8624.package package mycompiler.mystatement; + +import typinferenz.ConstraintsSet; +import typinferenz.assumptions.TypeAssumptions; // ino.end @@ -17,7 +20,8 @@ public abstract class BinaryExpr extends Expr super(offset,variableLength); } // ino.end - + + // abstract public void if_codegen(ClassFile classfile, Code_attribute code, boolean sw) throws jvmCode_Exception; // abstract public void not_codegen(ClassFile classfile, Code_attribute code) throws jvmCode_Exception; diff --git a/src/mycompiler/mystatement/Block.java b/src/mycompiler/mystatement/Block.java index 074d3410b..f0eeda9fc 100755 --- a/src/mycompiler/mystatement/Block.java +++ b/src/mycompiler/mystatement/Block.java @@ -7,6 +7,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.myclass.Class; @@ -30,14 +31,16 @@ import org.apache.log4j.Logger; // ino.end + + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.JavaCodeResult; import typinferenz.SingleConstraint; import typinferenz.ConstraintsSet; import typinferenz.FreshTypeVariable; import typinferenz.ResultSet; -import typinferenz.TypinferenzException; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; @@ -65,15 +68,7 @@ public class Block extends Statement // ino.attribute.statements.25047.declaration public Vector statements = new Vector(); // ino.end - // ino.attribute.HashTabelleKlasse.25050.declaration - private Hashtable HashTabelleKlasse; - // ino.end - // ino.attribute.HashTabelleBlock.25053.declaration - private Hashtable HashTabelleBlock; - // ino.end - // ino.attribute.block_para.25056.declaration - private Hashtable block_para; - // ino.end + //private String sc_meth_ret_type; // ino.attribute.inferencelog.25059.decldescription type=javadoc @@ -221,6 +216,7 @@ public class Block extends Statement @Override public ConstraintsSet TYPEStmt(TypeAssumptions assumptions) { ConstraintsSet ret = new ConstraintsSet(); + if(statements.size()==0)this.setType(new Void(0)); /* this.setTypeVariable(TypePlaceholder.fresh(this)); */ for(Statement stmt : statements){ typinferenceLog.debug("Prozessing statement: "+stmt); @@ -240,7 +236,7 @@ public class Block extends Statement if (!(stmt.getType() instanceof Void)) if (this.getType() instanceof Void) { //this.setTypeVariable(stmt.getTypeVariable()); - throw new TypinferenzException("Falscher Return Type"); + throw new TypeinferenceException("Block besitzt falschen Rückgabetyp (fehlendes return-stmt)", this); } else { TypePlaceholder tph = TypePlaceholder.fresh(this); @@ -304,5 +300,19 @@ public class Block extends Statement return ret.attach("}"); } + + @Override + public Vector getChildren() { + Vector ret = new Vector(); + for(Statement st : this.get_Statement()){ + ret.add(st); + } + return ret; + } + + @Override + public String getDescription(){ + return "Block"; + } } // ino.end diff --git a/src/mycompiler/mystatement/BoolLiteral.java b/src/mycompiler/mystatement/BoolLiteral.java index 646e57362..7c4c9a373 100755 --- a/src/mycompiler/mystatement/BoolLiteral.java +++ b/src/mycompiler/mystatement/BoolLiteral.java @@ -5,6 +5,7 @@ package mycompiler.mystatement; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -25,6 +26,7 @@ import org.apache.log4j.Logger; // ino.end + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -178,7 +180,7 @@ public class BoolLiteral extends Literal @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { - + this.type = assumptions.getTypeFor(new RefType("java.lang.Boolean",-1)); return new ConstraintsSet(); } @@ -190,6 +192,14 @@ public class BoolLiteral extends Literal return new JavaCodeResult("false"); } + + + @Override + public Vector getChildren() { + Vector ret = new Vector(); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mystatement/CastExpr.java b/src/mycompiler/mystatement/CastExpr.java index fb7b7c8e1..20add38d2 100755 --- a/src/mycompiler/mystatement/CastExpr.java +++ b/src/mycompiler/mystatement/CastExpr.java @@ -6,6 +6,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -27,6 +28,7 @@ import org.apache.log4j.Logger; // ino.end + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -149,6 +151,15 @@ public class CastExpr extends UnaryExpr return new JavaCodeResult("(("+this.usedid+")").attach(this.expr.printJavaCode(resultSet)).attach(")"); } + + + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.expr); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mystatement/CharLiteral.java b/src/mycompiler/mystatement/CharLiteral.java index e19d3022f..c1ed88936 100755 --- a/src/mycompiler/mystatement/CharLiteral.java +++ b/src/mycompiler/mystatement/CharLiteral.java @@ -5,6 +5,7 @@ package mycompiler.mystatement; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -26,6 +27,7 @@ import org.apache.log4j.Logger; // ino.end + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -181,6 +183,10 @@ public class CharLiteral extends Literal public JavaCodeResult printJavaCode(ResultSet resultSet) { return new JavaCodeResult("'"+String.valueOf(this.Char)+"'"); } - + @Override + public Vector getChildren() { + Vector ret = new Vector(); + return ret; + } } // ino.end diff --git a/src/mycompiler/mystatement/DoubleLiteral.java b/src/mycompiler/mystatement/DoubleLiteral.java index b302f5adb..7a80f1c13 100755 --- a/src/mycompiler/mystatement/DoubleLiteral.java +++ b/src/mycompiler/mystatement/DoubleLiteral.java @@ -5,6 +5,7 @@ package mycompiler.mystatement; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -204,15 +205,20 @@ public class DoubleLiteral extends Literal @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { - // TODO Auto-generated method stub - return null; + this.setType(assumptions.getTypeFor(new RefType("Double",this.getOffset()))); + return new ConstraintsSet(); } @Override public JavaCodeResult printJavaCode(ResultSet resultSet) { - // TODO Auto-generated method stub - return null; + JavaCodeResult ret = new JavaCodeResult(); + ret.attach(""+this.Double); + return ret; + } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + return ret; } - } // ino.end diff --git a/src/mycompiler/mystatement/EmptyStmt.java b/src/mycompiler/mystatement/EmptyStmt.java index 44bba19bf..b944dcd43 100755 --- a/src/mycompiler/mystatement/EmptyStmt.java +++ b/src/mycompiler/mystatement/EmptyStmt.java @@ -5,6 +5,7 @@ package mycompiler.mystatement; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.myclass.Class; @@ -23,6 +24,7 @@ import org.apache.log4j.Logger; // ino.end + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; @@ -111,5 +113,11 @@ public class EmptyStmt extends Statement public JavaCodeResult printJavaCode(ResultSet resultSet) { return new JavaCodeResult(""); } + + @Override + public Vector getChildren() { + return new Vector(); + } + } // ino.end diff --git a/src/mycompiler/mystatement/FloatLiteral.java b/src/mycompiler/mystatement/FloatLiteral.java index af4c1e688..55cec4f80 100755 --- a/src/mycompiler/mystatement/FloatLiteral.java +++ b/src/mycompiler/mystatement/FloatLiteral.java @@ -5,6 +5,7 @@ package mycompiler.mystatement; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.myclass.Class; @@ -207,6 +208,10 @@ public JavaCodeResult printJavaCode(ResultSet resultSet) { // TODO Auto-generated method stub return null; } - + @Override + public Vector getChildren() { + Vector ret = new Vector(); + return ret; + } } // ino.end diff --git a/src/mycompiler/mystatement/ForStmt.java b/src/mycompiler/mystatement/ForStmt.java index 9c266e765..51e25223a 100755 --- a/src/mycompiler/mystatement/ForStmt.java +++ b/src/mycompiler/mystatement/ForStmt.java @@ -5,6 +5,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -131,4 +132,18 @@ public JavaCodeResult printJavaCode(ResultSet resultSet) { // TODO Auto-generated method stub throw new NotImplementedException(); } + + @Override + public Vector getChildren() { + Vector ret = new Vector(); + if(this.body_Loop_block!=null)ret.add(this.body_Loop_block); + if(this.head_Condition!=null)ret.add(this.head_Condition); + if(this.head_Condition_1!=null)ret.add(this.head_Condition_1); + if(this.head_Initializer!=null)ret.add(this.head_Initializer); + if(this.head_Initializer_1!=null)ret.add(this.head_Initializer_1); + if(this.head_Loop_expr!=null)ret.add(this.head_Loop_expr); + if(this.head_Loop_expr_1!=null)ret.add(this.head_Loop_expr_1); + //throw new NotImplementedException(); + return ret; + } } \ No newline at end of file diff --git a/src/mycompiler/mystatement/IfStmt.java b/src/mycompiler/mystatement/IfStmt.java index b869eb902..c79d15297 100755 --- a/src/mycompiler/mystatement/IfStmt.java +++ b/src/mycompiler/mystatement/IfStmt.java @@ -7,6 +7,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -40,6 +41,7 @@ import org.apache.log4j.Logger; // ino.end + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.JavaCodeResult; import typinferenz.SingleConstraint; @@ -414,5 +416,16 @@ public class IfStmt extends Statement ret.attach("\n}"); return ret; } + + + + @Override + public Vector getChildren() { + Vector ret = new Vector(); + if(this.expr!=null)ret.add(this.expr); + if(this.else_block!=null)ret.add(this.else_block); + if(this.then_block!=null)ret.add(this.then_block); + return ret; + } } // ino.end diff --git a/src/mycompiler/mystatement/InstVar.java b/src/mycompiler/mystatement/InstVar.java index d196037bf..45a2ba42b 100755 --- a/src/mycompiler/mystatement/InstVar.java +++ b/src/mycompiler/mystatement/InstVar.java @@ -7,6 +7,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -34,10 +35,17 @@ import org.apache.log4j.Logger; // ino.end + + + + import typinferenz.ConstraintsSet; import typinferenz.FreshTypeVariable; import typinferenz.JavaCodeResult; +import typinferenz.OderConstraint; import typinferenz.ResultSet; +import typinferenz.UndConstraint; +import typinferenz.assumptions.FieldAssumption; import typinferenz.assumptions.TypeAssumptions; @@ -101,19 +109,25 @@ public class InstVar extends Expr super(offset,variableLength); Iterator namen = ui.get_Name().iterator(); LocalOrFieldVar innerLOFV = new LocalOrFieldVar((String)namen.next(),getOffset()); - innerLOFV.setType(TypePlaceholder.fresh(this)); + //innerLOFV.setType(TypePlaceholder.fresh(this)); InstVar INSTVA = new InstVar(innerLOFV, (String)namen.next(),offset); - INSTVA.setType(TypePlaceholder.fresh(this)); + //INSTVA.setType(TypePlaceholder.fresh(this)); while(namen.hasNext()) { INSTVA = new InstVar(INSTVA, (String)namen.next(),offset); - INSTVA.setType(TypePlaceholder.fresh(this)); + //INSTVA.setType(TypePlaceholder.fresh(this)); } expr = INSTVA.expr; usedid = INSTVA.usedid; } // ino.end - // ino.method.sc_check.25417.definition + @Override + public void parserPostProcessing(SyntaxTreeNode parent) { + super.parserPostProcessing(parent); + if(this.getType()==null)this.set_Type(TypePlaceholder.fresh(this)); + } + + // ino.method.sc_check.25417.definition public void sc_check(Vector classname, Hashtable ch, Hashtable bh, boolean ext, Hashtable parach, Hashtable parabh) // ino.end // ino.method.sc_check.25417.body @@ -150,7 +164,7 @@ public class InstVar extends Expr // ino.end // ino.method.get_Name.25420.body { - return null; + return this.usedid.get_Name_1Element(); } // ino.end @@ -265,14 +279,34 @@ public class InstVar extends Expr @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { ConstraintsSet ret = new ConstraintsSet(); + if(this.expr == null){ + this.expr = new This(0, 0); + } ret.add(expr.TYPEExpr(assumptions)); this.setType(TypePlaceholder.fresh(this)); - return null; + OderConstraint oderConstraint = new OderConstraint(); + for(FieldAssumption fa : assumptions.getFieldVars(this.get_Name())){ + UndConstraint undConstraint = new UndConstraint(); + undConstraint.addConstraint(fa.getAssumedType(),this.getType()); + undConstraint.addConstraint(this.expr.getType(),fa.getParentClass().getType()); + oderConstraint.addConstraint(undConstraint); + } + ret.add(oderConstraint); + return ret; } @Override public JavaCodeResult printJavaCode(ResultSet resultSet) { - return new JavaCodeResult().attach(this.expr.printJavaCode(resultSet)).attach("."+this.usedid.get_Name_1Element()); + JavaCodeResult ret = new JavaCodeResult(); + if(this.expr != null)ret.attach(this.expr.printJavaCode(resultSet)).attach("."); + return ret.attach(this.usedid.get_Name_1Element()); + } + + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.expr); + return ret; } } // ino.end diff --git a/src/mycompiler/mystatement/InstanceOf.java b/src/mycompiler/mystatement/InstanceOf.java index 27c04ca98..07975f8b1 100755 --- a/src/mycompiler/mystatement/InstanceOf.java +++ b/src/mycompiler/mystatement/InstanceOf.java @@ -6,6 +6,7 @@ import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -27,6 +28,7 @@ import org.apache.log4j.Logger; // ino.end + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -150,6 +152,13 @@ public JavaCodeResult printJavaCode(ResultSet resultSet) { // TODO Auto-generated method stub return null; } + + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.expr); + return ret; + } } diff --git a/src/mycompiler/mystatement/IntLiteral.java b/src/mycompiler/mystatement/IntLiteral.java index 199768698..4a71809da 100755 --- a/src/mycompiler/mystatement/IntLiteral.java +++ b/src/mycompiler/mystatement/IntLiteral.java @@ -5,6 +5,7 @@ package mycompiler.mystatement; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -26,6 +27,7 @@ import org.apache.log4j.Logger; // ino.end + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; @@ -204,7 +206,8 @@ public class IntLiteral extends Literal @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { ConstraintsSet ret = new ConstraintsSet(); - this.setType(new IntegerType()); + //this.setType(new IntegerType()); + this.set_Type(assumptions.getTypeFor(new RefType("java.lang.Integer",-1))); return ret; } @@ -212,6 +215,10 @@ public class IntLiteral extends Literal public JavaCodeResult printJavaCode(ResultSet resultSet) { return new JavaCodeResult(String.valueOf(this.Int)); } - + @Override + public Vector getChildren() { + Vector ret = new Vector(); + return ret; + } } // ino.end diff --git a/src/mycompiler/mystatement/LambdaExpression.java b/src/mycompiler/mystatement/LambdaExpression.java index ea4d47a3e..3374ecfbb 100755 --- a/src/mycompiler/mystatement/LambdaExpression.java +++ b/src/mycompiler/mystatement/LambdaExpression.java @@ -10,12 +10,14 @@ import typinferenz.FreshTypeVariable; import typinferenz.FunN; import typinferenz.ResultSet; import typinferenz.Typeable; -import typinferenz.TypinferenzException; import typinferenz.assumptions.ParameterAssumption; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.myclass.Class; +import mycompiler.myclass.ClassHelper; import mycompiler.myclass.FormalParameter; import mycompiler.myclass.Method; import mycompiler.myclass.ParameterList; @@ -24,6 +26,7 @@ import mycompiler.myexception.JVMCodeException; import mycompiler.myexception.SCStatementException; import mycompiler.mytype.DoubleType; import mycompiler.mytype.GenericTypeVar; +import mycompiler.mytype.RefType; import mycompiler.mytype.Type; import mycompiler.mytype.TypePlaceholder; import mycompiler.mytypereconstruction.CSupportData; @@ -64,7 +67,11 @@ public class LambdaExpression extends Expr{ } public void setParameterList(ParameterList params){ - this.params = params; + ParameterList lambdaParameter = new ParameterList(); + for(FormalParameter fp : params){ + lambdaParameter.formalparameter.add(new LambdaParameter(fp)); + } + this.params = lambdaParameter; } @@ -80,8 +87,34 @@ public class LambdaExpression extends Expr{ public void wandleRefTypeAttributes2GenericAttributes( Vector paralist, Vector genericMethodParameters) { - // TODO Auto-generated method stub - + Block block = this.method_body; + // Zuerst Returntype untersuchen + Type returnType=getType(); + Type pendantReturnType = null; + if(returnType instanceof RefType) + pendantReturnType = ((RefType)returnType).findGenericType(paralist, new Vector()); + //GenericTypeVar pendantReturnType=ClassHelper.findGenericType(returnType, paralist,genericMethodParameters); + if(pendantReturnType!=null){ //Wenn generisch, dann modifizieren + setType(pendantReturnType); + } + + // Dann parameterlist untersuchen + for(FormalParameter fp : params){ + Type fpType=fp.getType(); + // Nur wenn es sich um ein RefType-Field handelt + Type pendantPara = null; + if(fpType instanceof RefType) + pendantPara = ((RefType)fpType).findGenericType(paralist, new Vector()); + //GenericTypeVar pendantPara=ClassHelper.findGenericType(fpType,paralist,genericMethodParameters); + if(pendantPara!=null){ //Wenn generisch, dann modifizieren + fp.setType(pendantPara); + } + } + + // Zuletzt alle Lokalen Variablendeklarationen durchgehen + if(block!=null){ + block.wandleRefTypeAttributes2GenericAttributes(paralist,genericMethodParameters); + } } @Override @@ -123,14 +156,14 @@ public class LambdaExpression extends Expr{ public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { ConstraintsSet ret = new ConstraintsSet(); //Die Assumptions für die Parameter der LambdaExpression - TypeAssumptions ArgumentAssumptions = new TypeAssumptions(assumptions.getThisValue().getName()); + TypeAssumptions ArgumentAssumptions = new TypeAssumptions(this.getParentClass().getName()); Vector paramTypes = new Vector(); for(FormalParameter param : params.formalparameter){ if(param.getType()==null)param.setType(TypePlaceholder.fresh(this)); int offset = 0; //Jeder Parameter der LambdaExpression wird als CParaTypeAssumption der Assumption liste hinzugefügt: - ArgumentAssumptions.addParameterAssumption(new ParameterAssumption(param)); + ArgumentAssumptions.addAssumption(new ParameterAssumption(param)); paramTypes.add(param.getType()); } this.setType(TypePlaceholder.fresh(this)); @@ -142,7 +175,7 @@ public class LambdaExpression extends Expr{ @Override public ConstraintsSet TYPEStmt(TypeAssumptions ass){ - throw new TypinferenzException("Eine LambdaExpression darf nicht als Statement verwendet werden."); + throw new TypeinferenceException("Eine LambdaExpression darf nicht als Statement verwendet werden.", this); } @Override @@ -164,4 +197,12 @@ public class LambdaExpression extends Expr{ return ret; } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.method_body); + for(FormalParameter fp : this.params)ret.add(fp); + return ret; + } + } diff --git a/src/mycompiler/mystatement/LambdaParameter.java b/src/mycompiler/mystatement/LambdaParameter.java new file mode 100644 index 000000000..4dad882ae --- /dev/null +++ b/src/mycompiler/mystatement/LambdaParameter.java @@ -0,0 +1,30 @@ +package mycompiler.mystatement; + +import typinferenz.ResultSet; +import typinferenz.typedeployment.TypeInsertPoint; +import mycompiler.myclass.DeclId; +import mycompiler.myclass.FormalParameter; +import mycompiler.mytype.Type; +import mycompiler.mytype.TypePlaceholder; + +/** + * Der FormalParameter einer LambdaExpression hat gesonderte Eigenschaften. + * @author janulrich + * + */ +public class LambdaParameter extends FormalParameter { + + public LambdaParameter(FormalParameter fp) { + super(fp.getDeclId()); + this.setType(fp.getType()); + this.parent = fp.getParent(); + this.inferencelog = fp.inferencelog; + } + + @Override + public TypeInsertPoint createTypeInsertPoint(TypePlaceholder tph, + ResultSet resultSet) { + return null;//Ein LambdaParameter darf keine Typen einsetzen. + } + +} diff --git a/src/mycompiler/mystatement/LocalOrFieldVar.java b/src/mycompiler/mystatement/LocalOrFieldVar.java index db6b5973c..53958a980 100755 --- a/src/mycompiler/mystatement/LocalOrFieldVar.java +++ b/src/mycompiler/mystatement/LocalOrFieldVar.java @@ -6,6 +6,7 @@ import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -32,6 +33,8 @@ import org.apache.log4j.Logger; // ino.end + + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.JavaCodeResult; import typinferenz.SingleConstraint; @@ -39,6 +42,7 @@ import typinferenz.ConstraintsSet; import typinferenz.FreshTypeVariable; import typinferenz.ResultSet; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; @@ -204,7 +208,8 @@ public class LocalOrFieldVar extends Expr public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { ConstraintsSet ret = new ConstraintsSet(); //gibt es eine Assumption für den die LocalOrFieldVar-Variablen, dann folgendes ausführen: - Type thisTypeAssumption = assumptions.getVarType(this.get_Name()); + Type thisTypeAssumption = assumptions.getVarType(this.get_Name(), this.getParentClass()); + if(thisTypeAssumption == null)throw new TypeinferenceException("Eine Variable "+this.get_Name()+" ist in den Assumptions nicht vorhanden",this); this.setType(thisTypeAssumption); //ret.add(new Constraint(thisTypeAssumption, this.getTypeVariable())); return ret; @@ -220,5 +225,11 @@ public class LocalOrFieldVar extends Expr return new JavaCodeResult(this.get_Name()); } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mystatement/LocalVarDecl.java b/src/mycompiler/mystatement/LocalVarDecl.java index 7c0f301cd..487c5657a 100755 --- a/src/mycompiler/mystatement/LocalVarDecl.java +++ b/src/mycompiler/mystatement/LocalVarDecl.java @@ -12,6 +12,7 @@ import mycompiler.myclass.Class; import mycompiler.myclass.ClassHelper; import mycompiler.myclass.DeclId; import mycompiler.MyCompiler; +import mycompiler.SyntaxTreeNode; import mycompiler.myexception.JVMCodeException; import mycompiler.myexception.SCExcept; import mycompiler.myexception.SCStatementException; @@ -37,6 +38,10 @@ import org.apache.log4j.Logger; + + + + import typinferenz.ConstraintsSet; import typinferenz.FreshTypeVariable; import typinferenz.JavaCodeResult; @@ -44,6 +49,8 @@ import typinferenz.ResultSet; import typinferenz.TypeInsertable; import typinferenz.assumptions.LocalVarAssumption; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; +import typinferenz.typedeployment.TypeInsertPoint; @@ -65,9 +72,6 @@ public class LocalVarDecl extends Statement implements TypeInsertable // ino.attribute.declid.25548.declaration private Vector declid = new Vector(); // ino.end - // ino.attribute.type.25551.declaration - private Type declType; - // ino.end // ino.attribute.paralist.25554.declaration private Vector paralist = null; // ino.end @@ -84,33 +88,6 @@ public class LocalVarDecl extends Statement implements TypeInsertable public Block block; // ino.end - - // ino.method.setType.25569.definition - public void setDeclType(Type t) - // ino.end - // ino.method.setType.25569.body - { - if(this.declType instanceof TypePlaceholder){ - ((TypePlaceholder)this.declType).removeReplacementListener(this); - } - - if(t instanceof TypePlaceholder){ - ((TypePlaceholder)t).addReplacementListener(this); - } - this.declType=t; - } - // ino.end - - // ino.method.getType.25572.definition - public Type getDeclType() - // ino.end - // ino.method.getType.25572.body - { - return this.declType; - } - // ino.end - - // ino.method.set_DeclId.25575.definition public void set_DeclId(DeclId did) // ino.end @@ -297,7 +274,7 @@ public class LocalVarDecl extends Statement implements TypeInsertable { if(declid != null) for(int i = 0; i < declid.size(); i++) - declid.elementAt(i).codegen_LocalVarDecl(classfile, code, this.getDeclType(), paralist); + declid.elementAt(i).codegen_LocalVarDecl(classfile, code, this.getType(), paralist); } // ino.end // ino.method.getDeclidVector.25596.definition @@ -374,12 +351,12 @@ public class LocalVarDecl extends Statement implements TypeInsertable } this.setType(e.getNewType()); } - if(e.getOldType().equals(this.getDeclType())){ + if(e.getOldType().equals(this.getType())){ inferencelog.debug("Ersetze Typ in LocalVarDecl \""+this.get_Name()+"\"\n"); - if(declType instanceof TypePlaceholder){ - ((TypePlaceholder)declType).removeReplacementListener(this); + if(this.getType() instanceof TypePlaceholder){ + ((TypePlaceholder)this.getType()).removeReplacementListener(this); } - this.setDeclType(e.getNewType()); + this.setType(e.getNewType()); } } // ino.end @@ -417,7 +394,7 @@ public class LocalVarDecl extends Statement implements TypeInsertable CTripleSet resultSet = new CTripleSet(); V = V.shallowCopy(); CTypeAssumptionSet localSet = new CTypeAssumptionSet(); - CLocalVarTypeAssumption varAssum = new CLocalVarTypeAssumption(supportData.getCurrentClass(), supportData.getCurrentMethod(), supportData.getCurrentMethodParaCount(), supportData.getCurrentMethodOverloadedID(), supportData.getCurrentBlockId(), this.get_Name() ,this.getDeclType(), this.getLineNumber(),this.getOffset(),new Vector()); + CLocalVarTypeAssumption varAssum = new CLocalVarTypeAssumption(supportData.getCurrentClass(), supportData.getCurrentMethod(), supportData.getCurrentMethodParaCount(), supportData.getCurrentMethodOverloadedID(), supportData.getCurrentBlockId(), this.get_Name() ,this.getType(), this.getLineNumber(),this.getOffset(),new Vector()); Class.isFirstLocalVarDecl=true; if(this.block != null) @@ -441,8 +418,8 @@ public class LocalVarDecl extends Statement implements TypeInsertable // ino.end // ino.method.toString.25617.body { - if(declType == null)return "no type " + declid.toString(); - return declType.toString() + " " + declid.toString(); + if(this.getType() == null)return "no type " + declid.toString(); + return this.getType().toString() + " " + declid.toString(); } // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.25620.definition @@ -451,9 +428,12 @@ public class LocalVarDecl extends Statement implements TypeInsertable // ino.method.wandleRefTypeAttributes2GenericAttributes.25620.body { - Type fpType=getDeclType(); + Type fpType=getType(); // Nur wenn es sich um ein RefType-Field handelt - GenericTypeVar pendantPara=ClassHelper.findGenericType(fpType,paralist,genericMethodParameters); + Type pendantPara = null; + if(fpType instanceof RefType) + pendantPara = ((RefType)fpType).findGenericType(paralist, new Vector()); + //GenericTypeVar pendantPara=ClassHelper.findGenericType(fpType,paralist,genericMethodParameters); if(pendantPara!=null){ //Wenn generisch, dann modifizieren setType(pendantPara); } @@ -486,25 +466,39 @@ public class LocalVarDecl extends Statement implements TypeInsertable @Override public ConstraintsSet TYPEStmt(TypeAssumptions assumptions) { ConstraintsSet ret = new ConstraintsSet(); - if(this.getDeclType()==null || this.getDeclType() instanceof TypePlaceholder)this.setDeclType(TypePlaceholder.fresh(this)); - assumptions.addLocalVarAssumption(new LocalVarAssumption(this)); + if((this.getType() instanceof RefType)){ + Type replaceType = null; + replaceType = assumptions.getTypeFor((RefType)this.getType()); + if(replaceType == null) + throw new TypeinferenceException("Der Typ "+this.getType().getName()+" ist nicht korrekt",this); + this.setType(replaceType); + } + assumptions.addAssumption(new LocalVarAssumption(this, this.getType())); //Bevor der Typ auf Void gesetzt wird. //assumptions.remove(null); // falls Variable mit diesem Namen bereits vorhanden. this.setType(new Void(0)); //Return typ einer Variablendeklaration ist Void return ret; } + @Override + public void parserPostProcessing(SyntaxTreeNode parent) { + super.parserPostProcessing(parent); + if(this.getType()==null || this.getType() instanceof TypePlaceholder)this.setType(TypePlaceholder.fresh(this)); + } + @Override public String getTypeInformation(){ String ret = "VarDeclaration "; - if(this.getDeclType()!=null)ret+= this.getDeclType().toString()+" "; + if(this.getType()!=null)ret+= this.getType().toString()+" "; ret+=this.get_Name(); return ret; } @Override public JavaCodeResult printJavaCode(ResultSet resultSet) { - return new JavaCodeResult().attach(getDeclType().printJavaCode(resultSet)) .attach( " "+this.get_Name()+";"); - } + JavaCodeResult ret = new JavaCodeResult(); + if(this.getType()!=null)ret.attach(getType().printJavaCode(resultSet)).attach(" "); + ret.attach(this.get_Name()+";"); + return ret;} @Override public void setOffset(int offset) { @@ -516,5 +510,16 @@ public class LocalVarDecl extends Statement implements TypeInsertable return this.get_Name(); } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + return ret; + } + + @Override + public TypeInsertPoint createTypeInsertPoint(TypePlaceholder tph, + ResultSet resultSet) { + return new TypeInsertPoint(this, resultSet.getTypeEqualTo(tph),resultSet); + } } // ino.end diff --git a/src/mycompiler/mystatement/LongLiteral.java b/src/mycompiler/mystatement/LongLiteral.java index 405d87a2e..31d1b724b 100755 --- a/src/mycompiler/mystatement/LongLiteral.java +++ b/src/mycompiler/mystatement/LongLiteral.java @@ -5,6 +5,7 @@ package mycompiler.mystatement; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -212,6 +213,10 @@ public JavaCodeResult printJavaCode(ResultSet resultSet) { // TODO Auto-generated method stub return null; } - + @Override + public Vector getChildren() { + Vector ret = new Vector(); + return ret; + } } // ino.end diff --git a/src/mycompiler/mystatement/MethodCall.java b/src/mycompiler/mystatement/MethodCall.java index 4296171a4..ab73632c0 100755 --- a/src/mycompiler/mystatement/MethodCall.java +++ b/src/mycompiler/mystatement/MethodCall.java @@ -7,6 +7,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -50,6 +51,7 @@ import org.apache.log4j.Logger; // ino.end + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.ConstraintsSet; import typinferenz.FreshTypeVariable; @@ -93,15 +95,13 @@ public class MethodCall extends Expr private Receiver receiver; // ino.end // ino.attribute.arglist.25642.declaration - private ArgumentList arglist=null; + private ArgumentList arglist=new ArgumentList(); // ino.end private Vector exprtypes=new Vector(); //hier werden die Typen der �bergabewerten von sc_check eingetragen. // ino.attribute.class_name.25645.declaration private String class_name; //hier steht in welcher Klasse die Methode deklariert ist. // ino.end - // ino.attribute.called_method.25648.declaration - private Method called_method=null; //hier steht nach Ende von sc_check die aufgerufene Methode. - // ino.end + // ino.attribute.uebernachdurch.25651.declaration private Hashtable uebernachdurch; // ino.end @@ -231,17 +231,17 @@ public class MethodCall extends Expr } Vector paraAssumptions=assumption.getParaAssumptions(); Type returnType=assumption.getAssumedType(); - Method meth=new Method(); + Method meth=new Method(0); Vector parameterVector=new Vector(); ParameterList pl=new ParameterList(); for(int i=0;i getChildren() { + Vector ret = new Vector(); + for(Expr e : this.arglist.expr){ + ret.add(e); + } + if(this.receiver!=null)ret.add(this.receiver.get_Expr()); + return ret; + } + + @Override + public void parserPostProcessing(SyntaxTreeNode parent) { + super.parserPostProcessing(parent); + } + } // ino.end diff --git a/src/mycompiler/mystatement/NegativeExpr.java b/src/mycompiler/mystatement/NegativeExpr.java index 53e56408b..4263d1281 100755 --- a/src/mycompiler/mystatement/NegativeExpr.java +++ b/src/mycompiler/mystatement/NegativeExpr.java @@ -6,6 +6,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.myclass.Class; @@ -30,6 +31,7 @@ import org.apache.log4j.Logger; // ino.end + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -139,10 +141,17 @@ public class NegativeExpr extends UnaryExpr } @Override -public JavaCodeResult printJavaCode(ResultSet resultSet) { + public JavaCodeResult printJavaCode(ResultSet resultSet) { // TODO Auto-generated method stub return null; } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.expr); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mystatement/NewArray.java b/src/mycompiler/mystatement/NewArray.java index 39620b019..cf07bbc83 100755 --- a/src/mycompiler/mystatement/NewArray.java +++ b/src/mycompiler/mystatement/NewArray.java @@ -5,6 +5,7 @@ package mycompiler.mystatement; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -23,6 +24,7 @@ import org.apache.log4j.Logger; // ino.end + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -202,5 +204,12 @@ public JavaCodeResult printJavaCode(ResultSet resultSet) { return null; } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.addAll(this.expr); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mystatement/NewClass.java b/src/mycompiler/mystatement/NewClass.java index 63c75dd42..dddfb35d3 100755 --- a/src/mycompiler/mystatement/NewClass.java +++ b/src/mycompiler/mystatement/NewClass.java @@ -7,6 +7,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -35,6 +36,11 @@ import org.apache.log4j.Logger; // ino.end + + + + + import typinferenz.JavaCodeResult; import typinferenz.Overloading; import typinferenz.SingleConstraint; @@ -42,7 +48,10 @@ import typinferenz.ConstraintsSet; import typinferenz.FreshTypeVariable; import typinferenz.FunN; import typinferenz.ResultSet; +import typinferenz.UndConstraint; +import typinferenz.assumptions.ConstructorAssumption; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; @@ -223,8 +232,7 @@ public class NewClass extends Expr public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { //TODO: Das hier noch vervollständigen ConstraintsSet ret = new ConstraintsSet(); - - this.set_Type(TypePlaceholder.fresh(this)); + UndConstraint callConstraints = new UndConstraint(); //Die Auskommentierten Zeilen gehören zu MethodRefNew //Vector argumentTypeList = new Vector(); //for(Expr expr : this.arglist.expr){ @@ -234,19 +242,31 @@ public class NewClass extends Expr //Constraint newClassTypeConstraint = new Constraint(null,null); //ret.add(newClassTypeConstraint); + int numArgs = 0; + if(this.arglist != null)numArgs = this.arglist.size(); + ConstructorAssumption cA = assumptions.getConstructorAssumption(this.get_Name(), numArgs); + if(cA == null)throw new TypeinferenceException("Der Konstruktor "+this.get_Name()+" mit "+numArgs+" Parametern ist nicht vorhanden.", this); - if(this.arglist != null && this.arglist.expr != null)for(Expr arg : this.arglist.expr){ - ret.add(arg.TYPEExpr(assumptions)); + for(int i=0; i MethodCall newAufruf = new MethodCall(0,0); - this.setType(new RefType(this.get_Name(),0)); - newAufruf.type = new RefType(this.get_Name(),0); + this.setType(assumptions.getTypeFor(new RefType(this.get_Name(),0))); + newAufruf.type = this.getType(); newAufruf.set_Name(""); newAufruf.set_Receiver(null); ret.add(new Overloading(assumptions, newAufruf, this.getType()).generateConsstraints()); - + */ return ret; } @@ -259,14 +279,14 @@ public class NewClass extends Expr @Override public ConstraintsSet TYPEStmt(TypeAssumptions assumptions){ ConstraintsSet ret = this.TYPEExpr(assumptions); //TypeExpr aufrufen - this.set_Type(new Void(0)); //Typ des Statments auf Void setzen. + this.setType(new Void(0)); //Typ des Statments auf Void setzen. return ret; } @Override public JavaCodeResult printJavaCode(ResultSet resultSet) { JavaCodeResult ret = new JavaCodeResult("new "); - ret.attach(this.getType().printJavaCode(resultSet)); + ret.attach(this.get_Name()); ret.attach("("); if(this.arglist!=null && this.arglist.expr != null){ Iterator it = this.arglist.expr.iterator(); @@ -281,5 +301,15 @@ public class NewClass extends Expr return ret; } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + if(this.arglist!=null)for(Expr e : this.arglist.expr){ + ret.add(e); + } + return ret; + } + + } // ino.end diff --git a/src/mycompiler/mystatement/NotExpr.java b/src/mycompiler/mystatement/NotExpr.java index 1546a3610..607d25d43 100755 --- a/src/mycompiler/mystatement/NotExpr.java +++ b/src/mycompiler/mystatement/NotExpr.java @@ -6,12 +6,14 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.myclass.Class; import mycompiler.myexception.CTypeReconstructionException; import mycompiler.myexception.JVMCodeException; import mycompiler.myexception.SCStatementException; +import mycompiler.mytype.BooleanType; import mycompiler.mytype.GenericTypeVar; import mycompiler.mytype.Pair; import mycompiler.mytype.RefType; @@ -29,8 +31,12 @@ import org.apache.log4j.Logger; // ino.end + + + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; +import typinferenz.OderConstraint; import typinferenz.ResultSet; import typinferenz.assumptions.TypeAssumptions; @@ -153,8 +159,11 @@ public class NotExpr extends UnaryExpr @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { - // TODO Auto-generated method stub - return null; + ConstraintsSet ret = new ConstraintsSet(); + OderConstraint constraint = new OderConstraint(); + constraint.addConstraint(new Pair(this.getType(), new BooleanType())); + ret.add(constraint); + return ret; } @Override @@ -163,5 +172,12 @@ public JavaCodeResult printJavaCode(ResultSet resultSet) { return null; } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.expr); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mystatement/Null.java b/src/mycompiler/mystatement/Null.java index d78fae32a..58db707fd 100755 --- a/src/mycompiler/mystatement/Null.java +++ b/src/mycompiler/mystatement/Null.java @@ -5,6 +5,7 @@ package mycompiler.mystatement; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -25,6 +26,7 @@ import org.apache.log4j.Logger; // ino.end + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -120,5 +122,10 @@ public class Null extends Literal return new JavaCodeResult("null"); } + @Override + public Vector getChildren() { + return new Vector(); + } + } // ino.end diff --git a/src/mycompiler/mystatement/PositivExpr.java b/src/mycompiler/mystatement/PositivExpr.java index 7d613ad43..d086074b8 100755 --- a/src/mycompiler/mystatement/PositivExpr.java +++ b/src/mycompiler/mystatement/PositivExpr.java @@ -5,6 +5,7 @@ package mycompiler.mystatement; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.myclass.Class; @@ -22,6 +23,7 @@ import org.apache.log4j.Logger; // ino.end + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -143,5 +145,12 @@ public JavaCodeResult printJavaCode(ResultSet resultSet) { return null; } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.expr); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mystatement/PostDecExpr.java b/src/mycompiler/mystatement/PostDecExpr.java index 8f9b4ec51..2e9a10946 100755 --- a/src/mycompiler/mystatement/PostDecExpr.java +++ b/src/mycompiler/mystatement/PostDecExpr.java @@ -6,6 +6,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -31,6 +32,7 @@ import org.apache.log4j.Logger; // ino.end + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -182,5 +184,12 @@ public JavaCodeResult printJavaCode(ResultSet resultSet) { return null; } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.expr); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mystatement/PostIncExpr.java b/src/mycompiler/mystatement/PostIncExpr.java index 29e95277c..ae6ddbf54 100755 --- a/src/mycompiler/mystatement/PostIncExpr.java +++ b/src/mycompiler/mystatement/PostIncExpr.java @@ -6,6 +6,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -31,6 +32,7 @@ import org.apache.log4j.Logger; // ino.end + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -182,5 +184,12 @@ public JavaCodeResult printJavaCode(ResultSet resultSet) { return null; } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.expr); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mystatement/PreDecExpr.java b/src/mycompiler/mystatement/PreDecExpr.java index 9fd411812..0576c46de 100755 --- a/src/mycompiler/mystatement/PreDecExpr.java +++ b/src/mycompiler/mystatement/PreDecExpr.java @@ -6,6 +6,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -31,6 +32,7 @@ import org.apache.log4j.Logger; // ino.end + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -175,10 +177,16 @@ public class PreDecExpr extends UnaryExpr return null; } @Override -public JavaCodeResult printJavaCode(ResultSet resultSet) { + public JavaCodeResult printJavaCode(ResultSet resultSet) { // TODO Auto-generated method stub return null; } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.expr); + return ret; + } } // ino.end diff --git a/src/mycompiler/mystatement/PreIncExpr.java b/src/mycompiler/mystatement/PreIncExpr.java index 155e57ea5..839b154fc 100755 --- a/src/mycompiler/mystatement/PreIncExpr.java +++ b/src/mycompiler/mystatement/PreIncExpr.java @@ -6,6 +6,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -31,6 +32,7 @@ import org.apache.log4j.Logger; // ino.end + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -183,5 +185,12 @@ public JavaCodeResult printJavaCode(ResultSet resultSet) { return null; } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.expr); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mystatement/Return.java b/src/mycompiler/mystatement/Return.java index 70297c5b7..50a5cc7a2 100755 --- a/src/mycompiler/mystatement/Return.java +++ b/src/mycompiler/mystatement/Return.java @@ -5,6 +5,7 @@ package mycompiler.mystatement; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -27,6 +28,7 @@ import org.apache.log4j.Logger; // ino.end + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.JavaCodeResult; import typinferenz.SingleConstraint; @@ -142,6 +144,13 @@ public class Return extends Statement ret.attach(this.retexpr.printJavaCode(resultSet)); return ret.attach(";"); } + + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.retexpr); + return ret; + } } // ino.end diff --git a/src/mycompiler/mystatement/Statement.java b/src/mycompiler/mystatement/Statement.java index 032b1fd6b..f7b16e4d3 100755 --- a/src/mycompiler/mystatement/Statement.java +++ b/src/mycompiler/mystatement/Statement.java @@ -50,7 +50,6 @@ public abstract class Statement extends SyntaxTreeNode implements IItemWithOffse // ino.end protected Type type; - private SyntaxTreeNode parent; // ino.method.Statement.26194.definition public Statement(int offset, int variableLength) @@ -145,5 +144,10 @@ public abstract class Statement extends SyntaxTreeNode implements IItemWithOffse public abstract JavaCodeResult printJavaCode(ResultSet resultSet); + @Override + public String getDescription(){ + return this.printJavaCode(new ResultSet(new Vector())).toString(); + } + } // ino.end diff --git a/src/mycompiler/mystatement/StringLiteral.java b/src/mycompiler/mystatement/StringLiteral.java index 56705fc4d..247f8483c 100755 --- a/src/mycompiler/mystatement/StringLiteral.java +++ b/src/mycompiler/mystatement/StringLiteral.java @@ -5,6 +5,7 @@ package mycompiler.mystatement; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -25,10 +26,13 @@ import org.apache.log4j.Logger; // ino.end + + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; @@ -135,7 +139,8 @@ public class StringLiteral extends Literal @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { - this.set_Type(new RefType("String",0)); + this.set_Type(assumptions.getTypeFor(new RefType("String",0))); + if(this.getType() == null)throw new TypeinferenceException("java.lang.String nicht importiert",this); return new ConstraintsSet(); } @@ -143,7 +148,12 @@ public class StringLiteral extends Literal public JavaCodeResult printJavaCode(ResultSet resultSet) { return new JavaCodeResult("\""+this.string+"\""); } - + @Override + public Vector getChildren() { + Vector ret = new Vector(); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mystatement/This.java b/src/mycompiler/mystatement/This.java index 9942e6007..a77bb2228 100755 --- a/src/mycompiler/mystatement/This.java +++ b/src/mycompiler/mystatement/This.java @@ -5,6 +5,7 @@ package mycompiler.mystatement; import java.util.Hashtable; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -27,6 +28,7 @@ import org.apache.log4j.Logger; // ino.end + import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -48,6 +50,11 @@ public class This extends Expr } // ino.end + public This(SyntaxTreeNode parent){ + this(0,0); + this.parent = parent; + } + // ino.attribute.arglist.26268.declaration public ArgumentList arglist; // ino.end @@ -168,7 +175,8 @@ public class This extends Expr public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { ConstraintsSet ret = new ConstraintsSet(); //this.set_Type(new); - this.setType(assumptions.getThisValue());//Die Assumption für this als TypeVariable setzen. + //this.setType(assumptions.getThisValue());//Die Assumption für this als TypeVariable setzen. + this.setType(this.getParentClass().getType()); return ret; } @@ -185,5 +193,11 @@ public class This extends Expr return new JavaCodeResult("this"); } + @Override + public Vector getChildren() { + Vector ret = new Vector(); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mystatement/WhileStmt.java b/src/mycompiler/mystatement/WhileStmt.java index 97a8194c6..ff9989ee2 100755 --- a/src/mycompiler/mystatement/WhileStmt.java +++ b/src/mycompiler/mystatement/WhileStmt.java @@ -7,6 +7,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; @@ -36,6 +37,7 @@ import org.apache.log4j.Logger; // ino.end + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.JavaCodeResult; import typinferenz.SingleConstraint; @@ -200,5 +202,13 @@ public class WhileStmt extends Statement public JavaCodeResult printJavaCode(ResultSet resultSet) { return new JavaCodeResult().attach("while(").attach(this.expr.printJavaCode(resultSet)).attach(")").attach(this.loop_block.printJavaCode(resultSet)); } + + @Override + public Vector getChildren() { + Vector ret = new Vector(); + ret.add(this.expr); + ret.add(this.loop_block); + return ret; + } } // ino.end diff --git a/src/mycompiler/mytest/CByteCodeTest.java b/src/mycompiler/mytest/CByteCodeTest.java deleted file mode 100755 index 23b97c6c3..000000000 --- a/src/mycompiler/mytest/CByteCodeTest.java +++ /dev/null @@ -1,58 +0,0 @@ -// ino.module.CByteCodeTest.8661.package -package mycompiler.mytest; -// ino.end - -// ino.module.CByteCodeTest.8661.import -import java.io.File; -import java.util.Iterator; -import java.util.Vector; -import mycompiler.MyCompiler; -import mycompiler.MyCompilerAPI; -import mycompiler.mytypereconstruction.CSubstitution; -import mycompiler.mytypereconstruction.TypeinferenceResultSet; -// ino.end - -// ino.class.CByteCodeTest.26367.description type=javadoc -/** - * Testklasse zum Generieren des ByteCode. - * @author scju - */ -// ino.end -// ino.class.CByteCodeTest.26367.declaration -public class CByteCodeTest -// ino.end -// ino.class.CByteCodeTest.26367.body -{ - - // ino.method.main.26370.definition - public static void main(String[] args) - throws Exception - // ino.end - // ino.method.main.26370.body - { - MyCompilerAPI compiler = MyCompiler.getAPI(); - - // Ausgabeverzeichnis festlegen - compiler.setOutputDir("Bytecode/"); - - // Parsen der Klasse - compiler.parse(new File(args[0])); - - // Typ-Rekonstruktion - Vector resultSet = compiler.typeReconstruction(); - if ((resultSet != null) && (resultSet.size() > 0)) { - TypeinferenceResultSet onePossibility = resultSet.firstElement(); - Iterator substIt = onePossibility.getSubstitutions().getIterator(); - while(substIt.hasNext()){ - CSubstitution subst = (CSubstitution)substIt.next(); - // Substition machen - subst.execute(); - } - } - - // Code generieren - compiler.codeGeneration(); - } - // ino.end -} -// ino.end diff --git a/src/mycompiler/mytest/CInferenceTest.java b/src/mycompiler/mytest/CInferenceTest.java deleted file mode 100755 index 256c7022e..000000000 --- a/src/mycompiler/mytest/CInferenceTest.java +++ /dev/null @@ -1,103 +0,0 @@ -// ino.module.CInferenceTest.8662.package -package mycompiler.mytest; -// ino.end - -// ino.module.CInferenceTest.8662.import -import java.io.File; -import java.util.Iterator; -import java.util.Vector; -import mycompiler.MyCompiler; -import mycompiler.MyCompilerAPI; -import mycompiler.myexception.CTypeReconstructionException; -import mycompiler.mytypereconstruction.CSubstitution; -import mycompiler.mytypereconstruction.TypeinferenceResultSet; -import org.apache.log4j.Logger; -// ino.end - -// ino.class.CInferenceTest.26373.description type=javadoc -/** - * Testklasse fr die Typinferenz - * @author Timo Holzherr - */ -// ino.end -// ino.class.CInferenceTest.26373.declaration -public class CInferenceTest -// ino.end -// ino.class.CInferenceTest.26373.body -{ - - // ino.attribute.inferencelog.26376.declaration - protected static Logger inferencelog = Logger.getLogger("inference"); - // ino.end - - // ino.method.main.26379.definition - public static void main(String[] args) - throws Exception - // ino.end - // ino.method.main.26379.body - { - MyCompilerAPI compiler = MyCompiler.getAPI(); - try{ - - ///////////////////////// - // Parsen: - ///////////////////////// - - //1. Argument: zu kompilierende Datei - compiler.parse(new File(args[0])); - - MyCompiler.getAPI().setOutputDir("Bytecode/"); - - //compiler.semanticCheck(); - - ///////////////////////// - // Typrekonstruktion: - ///////////////////////// - Vector resultSet = compiler.typeReconstruction(); - ///////////////////////// - // Ausgabe: - ///////////////////////// - - - if(resultSet==null||resultSet.size()==0){ - inferencelog.error("Das Resultset ist leer!!!"); - System.exit(1); - } - - // if(true)System.exit(0); - TypeinferenceResultSet onePossibility = resultSet.firstElement(); - Iterator substIt = onePossibility.getSubstitutions().getIterator(); - while(substIt.hasNext()){ - CSubstitution subst = (CSubstitution)substIt.next(); - /*Vector lineNumbers = ((TypePlaceholder)subst.getTypeVar()).getLineNumbers(); - String s = new String(); - for(int l=0; l resultSet = compiler.typeReconstruction(); - ///////////////////////// - // Ausgabe: - ///////////////////////// - TypeinferenceResultSet onePossibility = resultSet.firstElement(); - Iterator substIt = onePossibility.getSubstitutions().getIterator(); - while(substIt.hasNext()){ - CSubstitution subst = (CSubstitution)substIt.next(); - Vector lineNumbers = ((TypePlaceholder)subst.getTypeVar()).getLineNumbers(); - String s = new String(); - for(int l=0; l resultSet = compiler.typeReconstruction(); - ///////////////////////// - // Ausgabe: - ///////////////////////// - - //test - SourceFile file = compiler.getSyntaxTree(); - FC_TTO fc_tto = file.makeFC(); - for(Pair p : fc_tto.getFC()) - { - if(p.TA1 instanceof RefType && ((RefType)p.TA1).get_ParaList() != null) - MyCompiler.wandleGeneric2RefType(((RefType)p.TA1).get_ParaList(),fc_tto.getClasses()); - - if(p.TA2 instanceof RefType && ((RefType)p.TA2).get_ParaList() != null) - MyCompiler.wandleGeneric2RefType(((RefType)p.TA2).get_ParaList(),fc_tto.getClasses()); - } - for(Pair p : ((MyCompiler)compiler).testPair) - { - RefType TA1 = (RefType)p.TA1; - RefType TA2 = (RefType)p.TA2; - MyCompiler.wandleGeneric2RefType(TA1.get_ParaList(),fc_tto.getClasses()); - MyCompiler.wandleGeneric2RefType(TA2.get_ParaList(),fc_tto.getClasses()); - - //Vector smallers = Unify.smaller(TA2,fc_tto); - //Vector greaters = Unify.greater(TA2,fc_tto); - MyCompiler.makeGenericTypeVars2TypePlaceHolders(TA2); - MyCompiler.makeGenericTypeVars2TypePlaceHolders(TA1); - } - Vector> unifyers = Unify.unify(((MyCompiler)compiler).testPair,fc_tto); - - //Vector> testUni = Unify.unify(TypePlaceholder.fresh(),TypePlaceholder.fresh(),fc_tto); - /* - if(resultSet==null||resultSet.size()==0){ - //inferencelog.error("Das Resultset ist leer!!!"); - System.exit(1); - }*/ - - // inferencelog.debug("========FERTIG========"); - - compiler.codeGeneration(); - - - }catch(CTypeReconstructionException tre){ - tre.printStackTrace(); - }catch(Exception e){ - e.printStackTrace(); - } - } -} diff --git a/src/mycompiler/mytest/CompilerTestCase.java b/src/mycompiler/mytest/CompilerTestCase.java deleted file mode 100755 index ca753cf04..000000000 --- a/src/mycompiler/mytest/CompilerTestCase.java +++ /dev/null @@ -1,162 +0,0 @@ -// ino.module.CompilerTestCase.8663.package -package mycompiler.mytest; -// ino.end - -// ino.module.CompilerTestCase.8663.import -import java.io.File; -import java.util.Iterator; -import java.util.Vector; -import junit.framework.TestCase; -import mycompiler.MyCompiler; -import mycompiler.MyCompilerAPI; -import mycompiler.mytypereconstruction.CSubstitution; -import mycompiler.mytypereconstruction.TypeinferenceResultSet; -import org.apache.log4j.FileAppender; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.apache.log4j.PatternLayout; -// ino.end - - -// ino.class.CompilerTestCase.26382.description type=javadoc -/** - * Testet den Compiler mit dem angegebenen JAV-File. - * @author SCJU - * - */ -// ino.end -// ino.class.CompilerTestCase.26382.declaration -public class CompilerTestCase extends TestCase -// ino.end -// ino.class.CompilerTestCase.26382.body -{ - - // ino.attribute.javFile.26386.declaration - protected File javFile; - // ino.end - // ino.attribute.compiler.26389.declaration - protected MyCompilerAPI compiler = MyCompiler.getAPI(); - // ino.end - - // ino.method.CompilerTestCase.26392.definition - public CompilerTestCase(String javFile, String name) - // ino.end - // ino.method.CompilerTestCase.26392.body - { - this.javFile = new File(javFile); - setName(name); - } - // ino.end - - // ino.method.CompilerTestCase.26395.definition - public CompilerTestCase(String javFile) - // ino.end - // ino.method.CompilerTestCase.26395.body - { - this.javFile = new File(javFile); - setName(this.javFile.getName()); - } - // ino.end - - - // ino.method.runTest.26398.definition - protected void runTest() - throws Throwable - // ino.end - // ino.method.runTest.26398.body - { - // Testablauf. Tritt eine Exception auf, - // schlaegt der Test fehl. - parseFile(); - typeReconstruction(); - codeGeneration(); - } - // ino.end - - // ino.method.parseFile.26401.definition - protected void parseFile() - throws Throwable - // ino.end - // ino.method.parseFile.26401.body - { - // Parsen der Klasse - compiler.parse(javFile); - } - // ino.end - - // ino.method.typeReconstruction.26404.definition - protected void typeReconstruction() - throws Exception - // ino.end - // ino.method.typeReconstruction.26404.body - { - // Typ-Rekonstruktion - Vector resultSet = compiler.typeReconstruction(); - // Keine Typ-Rekonstruktion erforderlich - if (resultSet == null || resultSet.size() == 0) throw new Exception("Typrekonstruktion nicht durchfuehrbar!"); - TypeinferenceResultSet onePossibility = resultSet.firstElement(); - Iterator substIt = onePossibility.getSubstitutions().getIterator(); - while(substIt.hasNext()){ - CSubstitution subst = (CSubstitution)substIt.next(); - // Substition machen - subst.execute(); - } - } - // ino.end - - // ino.method.codeGeneration.26407.definition - protected void codeGeneration() - throws Exception - // ino.end - // ino.method.codeGeneration.26407.body - { - // Code generieren - compiler.codeGeneration(); - } - // ino.end - - // ino.method.setUp.26410.definition - protected void setUp() - throws Exception - // ino.end - // ino.method.setUp.26410.body - { - super.setUp(); - - // Setup fuer Log4J - // Logfiles werden im Ordner testResults gespeichert - // Der Dateiname ist der Klassename plus .log - String logFile = "testResults/"+ javFile.getName() + ".log"; - - File f = new File(logFile); // Altes Logfile loeschen - f.delete(); - - // Ausgabeoptionen fuer die Logger - PatternLayout pl = new PatternLayout("%-15C{1} %-5p [%-9c] %m%n"); - FileAppender fa = new FileAppender(pl, logFile); - - // Die Einstellungen jedes Loggers veraendern - ModifyLogger("parser", Level.ALL, fa); - ModifyLogger("inference", Level.INFO, fa); - ModifyLogger("codegen", Level.ALL, fa); - ModifyLogger("bytecode", Level.ALL, fa); - } - // ino.end - - // ino.method.ModifyLogger.26413.defdescription type=line - // Veraendert die Ausgabeoptionen des angegebenen Loggers - // ino.end - // ino.method.ModifyLogger.26413.definition - protected void ModifyLogger(String strlogger, Level lv, FileAppender fa) - // ino.end - // ino.method.ModifyLogger.26413.body - { - Logger lg = Logger.getLogger(strlogger); - - lg.setLevel(lv); - lg.removeAllAppenders(); - lg.addAppender(fa); - } - // ino.end -} -// ino.end diff --git a/src/mycompiler/mytest/JUnitTests.java b/src/mycompiler/mytest/JUnitTests.java deleted file mode 100755 index e602650bf..000000000 --- a/src/mycompiler/mytest/JUnitTests.java +++ /dev/null @@ -1,98 +0,0 @@ -// ino.module.JUnitTests.8665.package -package mycompiler.mytest; -// ino.end - -// ino.module.JUnitTests.8665.import -import junit.framework.Test; -import junit.framework.TestSuite; -import mycompiler.MyCompiler; -// ino.end - -// ino.class.JUnitTests.26425.description type=javadoc -/** - * Erstellt eine JUnit-Testsuite, die saemtliche Testcases enthaelt und - * ausfuehrt. - * @author SCJU - * - */ -// ino.end -// ino.class.JUnitTests.26425.declaration -public class JUnitTests -// ino.end -// ino.class.JUnitTests.26425.body -{ - - - // ino.method.main.26428.defdescription type=line - // Aufruf ist auch als normale Anwendung moeglich. - // In Eclipse bietet sich allerdings eine Run-Config - // als JUnit-Test an! - // ino.end - // ino.method.main.26428.definition - public static void main(String[] args) - // ino.end - // ino.method.main.26428.body - { - junit.textui.TestRunner.run(JUnitTests.suite()); - } - // ino.end - - // ino.method.suite.26431.definition - public static Test suite() - // ino.end - // ino.method.suite.26431.body - { - TestSuite suite = new TestSuite("Teste Usecases for Compiler ..."); - //$JUnit-BEGIN$ - - - MyCompiler.getAPI().setOutputDir("Bytecode/"); - - - - // DER WICHTIGSTE - suite.addTest(new CompilerTestCase("examples/bajo1_usecases/Matrix.jav")); - - // Usecases PL - suite.addTest(new CompilerTestCase("examples/pl_usecases/UsecaseOne_pl.jav")); - suite.addTest(new CompilerTestCase("examples/pl_usecases/UsecaseTwo_pl.jav")); - suite.addTest(new CompilerTestCase("examples/pl_usecases/UsecaseThree_pl.jav")); - suite.addTest(new CompilerTestCase("examples/pl_usecases/UsecaseFour_pl.jav")); - suite.addTest(new CompilerTestCase("examples/pl_usecases/UsecaseFive_pl.jav")); - suite.addTest(new CompilerTestCase("examples/pl_usecases/UsecaseSix_pl.jav")); - suite.addTest(new CompilerTestCase("examples/pl_usecases/UsecaseSeven_pl.jav")); - suite.addTest(new CompilerTestCase("examples/pl_usecases/UsecaseEight_pl.jav")); - suite.addTest(new CompilerTestCase("examples/pl_usecases/UsecaseNine_pl.jav")); - suite.addTest(new CompilerTestCase("examples/pl_usecases/UsecaseTen_pl.jav")); - - - // Usecases HOTI - suite.addTest(new CompilerTestCase("examples/hoti/Constr.jav")); - suite.addTest(new CompilerTestCase("examples/hoti/Generic.jav")); - suite.addTest(new CompilerTestCase("examples/hoti/GenericsTest.jav")); - suite.addTest(new CompilerTestCase("examples/hoti/ImplClass.jav")); - suite.addTest(new CompilerTestCase("examples/hoti/Import.jav")); - suite.addTest(new CompilerTestCase("examples/hoti/Intf.jav")); - suite.addTest(new CompilerTestCase("examples/hoti/Multiclass.jav")); - suite.addTest(new CompilerTestCase("examples/hoti/Overl.jav")); - suite.addTest(new CompilerTestCase("examples/hoti/Simple.jav")); - suite.addTest(new CompilerTestCase("examples/hoti/Simple2.jav")); - suite.addTest(new CompilerTestCase("examples/hoti/Test.jav")); - suite.addTest(new CompilerTestCase("examples/hoti/Test2.jav")); - suite.addTest(new CompilerTestCase("examples/hoti/Test3.jav")); - suite.addTest(new CompilerTestCase("examples/hoti/VererbProb.jav")); - - // Usecases SCJU - suite.addTest(new CompilerTestCase("examples/scju/ClassGenerics.jav")); - suite.addTest(new CompilerTestCase("examples/scju/FieldGenerics.jav")); - suite.addTest(new CompilerTestCase("examples/scju/MethodGenerics.jav")); - suite.addTest(new CompilerTestCase("examples/scju/ClassKonstanten.jav")); - suite.addTest(new CompilerTestCase("examples/scju/InterfaceTest.jav")); - suite.addTest(new CompilerTestCase("examples/scju/testPackage/Test.jav")); - //$JUnit-END$ - return suite; - } - // ino.end - -} -// ino.end diff --git a/src/mycompiler/mytest/LambdaTest.java b/src/mycompiler/mytest/LambdaTest.java index dee04725f..a86bcf755 100755 --- a/src/mycompiler/mytest/LambdaTest.java +++ b/src/mycompiler/mytest/LambdaTest.java @@ -15,8 +15,8 @@ import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; import org.apache.log4j.SimpleLayout; -import typinferenz.TypinferenzException; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; import mycompiler.MyCompiler; import mycompiler.MyCompilerAPI; import mycompiler.mytype.Type; @@ -98,7 +98,7 @@ public class LambdaTest { TypeAssumptions assumptions = result1.getInterferedClass().getPublicFieldAssumptions();// TypeAssumptions.getAssumptionsFor(classname); assertTrue("Fehler in Methode TypeAssumptions.getAssumptionsFor", assumptions!=null); for(String variable : variableTypeAssumptions.keySet()){ - Type assumedType = assumptions.getVarType(variable); + Type assumedType = assumptions.getVarType(variable, result1.getInterferedClass()); assertTrue("Der Variable muss ein TPH zugewiesen sein.", assumedType!=null && assumedType instanceof TypePlaceholder); //AssumedType auflösen: @@ -145,7 +145,7 @@ public class LambdaTest { ///////////////////////// try{ resultSet = compiler.typeReconstruction(); - }catch(TypinferenzException texc){ + }catch(TypeinferenceException texc){ texc.printStackTrace(); fail("Fehler bei Typinferenzalgorithmus. Message: "+texc.getMessage()); } @@ -189,6 +189,7 @@ public class LambdaTest { }catch(Exception e){ e.printStackTrace(); assertNotNull("Fehler bei Typinferenzalgorithmus. Message: "+e.getMessage(), resultSet); + fail(); } return resultSet; } diff --git a/src/mycompiler/mytype/BaseType.java b/src/mycompiler/mytype/BaseType.java index ad606c5ce..21c0c6f9e 100755 --- a/src/mycompiler/mytype/BaseType.java +++ b/src/mycompiler/mytype/BaseType.java @@ -1,5 +1,9 @@ // ino.module.BaseType.8667.package package mycompiler.mytype; + +import mycompiler.IItemWithOffset; +import typinferenz.assumptions.TypeAssumptions; + // ino.end // ino.class.BaseType.26435.declaration public abstract class BaseType extends Type @@ -76,5 +80,12 @@ public abstract class BaseType extends Type public void setArray(boolean IsArray) { this.IsArray = IsArray; } + + @Override + public Type checkType(TypeAssumptions ass, IItemWithOffset parent) { + return this; //Die Base-Types müssen nicht nachgeschlagen werden. + } + + } // ino.end diff --git a/src/mycompiler/mytype/BoundedGenericTypeVar.java b/src/mycompiler/mytype/BoundedGenericTypeVar.java index c8bbdc175..a2d8566af 100755 --- a/src/mycompiler/mytype/BoundedGenericTypeVar.java +++ b/src/mycompiler/mytype/BoundedGenericTypeVar.java @@ -5,6 +5,8 @@ package mycompiler.mytype; // ino.module.BoundedGenericTypeVar.8669.import import java.util.Vector; + +import sun.reflect.generics.reflectiveObjects.NotImplementedException; // ino.end // ino.class.BoundedGenericTypeVar.26464.description type=javadoc @@ -34,11 +36,12 @@ public class BoundedGenericTypeVar extends GenericTypeVar // ino.end // ino.method.BoundedGenericTypeVar.26471.definition - public BoundedGenericTypeVar(String s, int offset) + public BoundedGenericTypeVar(String s, int offset, Vector t) // ino.end // ino.method.BoundedGenericTypeVar.26471.body { super(s, offset); + throw new NotImplementedException(); } // ino.end @@ -48,6 +51,10 @@ public class BoundedGenericTypeVar extends GenericTypeVar // ino.method.BoundedGenericTypeVar.29409.body { super(s, offset); + if(bounds != null)for(Type t : bounds){ + if(t!=null)this.extendVars.add(t); + } + this.genericTypeVar = new RefType(s,offset); this.bounds = bounds; } // ino.end @@ -66,6 +73,7 @@ public class BoundedGenericTypeVar extends GenericTypeVar // ino.end // ino.method.setBounds.26477.body { + this.bounds=types; } // ino.end diff --git a/src/mycompiler/mytype/GenericTypeVar.java b/src/mycompiler/mytype/GenericTypeVar.java index ffc23b41a..6d2feccc8 100755 --- a/src/mycompiler/mytype/GenericTypeVar.java +++ b/src/mycompiler/mytype/GenericTypeVar.java @@ -3,18 +3,35 @@ package mycompiler.mytype; // ino.end // ino.module.GenericTypeVar.8671.import +import java.util.HashMap; +import java.util.Iterator; import java.util.Vector; // ino.end + + + + + + + + + +import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent; import mycompiler.mytypereconstruction.replacementlistener.ITypeReplacementListener; +import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; +import typinferenz.SingleConstraint; +import typinferenz.TypeInsertable; +import typinferenz.assumptions.TypeAssumptions; +import typinferenz.typedeployment.TypeInsertPoint; // ino.class.GenericTypeVar.26505.description type=javadoc /** - * + * TODO: Diese Klasse überarbeiten. Pair genericTypeVar ist nicht implementiert. * @author J�rg B�uerle * @version $Date: 2013/09/22 20:12:53 $ */ @@ -24,8 +41,10 @@ public class GenericTypeVar extends Type // ino.end // ino.class.GenericTypeVar.26505.body { - Pair genericTypeVar; - /** + Type genericTypeVar; + Vector extendVars = new Vector(); + protected Pair genericConstraint; + /** * Eine Registry f�r alle Generic-Instanzen, die vor der Bytecode-Generierung durch * Ihre Superklasse ersetzt werden m�ssen. Siehe "Type Erasure" in Sun Spezifikation. *
Autor: J�rg B�uerle @@ -33,14 +52,19 @@ public class GenericTypeVar extends Type // ino.method.GenericTypeVar.26509.defdescription type=line // private Hashtable> m_TypeErasureList; // ino.end + private static HashMap tph = new HashMap(); /** * * @param genericTypeVarExtendsVar */ - public GenericTypeVar(Pair genericTypeVarExtendsVar){ - super(0); - genericTypeVar = genericTypeVarExtendsVar; + public GenericTypeVar(Pair genericTypeVarExtendsVar, int offset){ + super(offset); + genericTypeVar = genericTypeVarExtendsVar.TA1; + if(genericTypeVarExtendsVar.TA2!=null)this.extendVars.add(genericTypeVarExtendsVar.TA2); + else{ + this.genericConstraint = genericTypeVarExtendsVar; + } this.name = genericTypeVar.toString(); } @@ -54,8 +78,8 @@ public class GenericTypeVar extends Type } // ino.end - public GenericTypeVar(Type tA1) { - this(new Pair(tA1,null)); + public GenericTypeVar(Type tA1, int offset) { + this(new Pair(tA1,null),offset); } // ino.method.clone.26512.defdescription type=javadoc @@ -73,7 +97,8 @@ public class GenericTypeVar extends Type } // ino.end - // ino.method.equals.26515.defdescription type=javadoc + + // ino.method.equals.26515.defdescription type=javadoc /** *
Author: J�rg B�uerle * @param obj @@ -89,6 +114,8 @@ public class GenericTypeVar extends Type } // ino.end + + // ino.method.toString.26518.definition public String toString() // ino.end @@ -98,7 +125,12 @@ public class GenericTypeVar extends Type } // ino.end - // ino.method.get_codegen_Type.26521.defdescription type=javadoc + @Override + public int hashCode() { + return this.name.hashCode(); + } + + // ino.method.get_codegen_Type.26521.defdescription type=javadoc /** * hoti 4.5.06 * Generische Typen werden im Bytecode @@ -127,14 +159,52 @@ public class GenericTypeVar extends Type public JavaCodeResult printJavaCode(ResultSet resultSet) { if(this.genericTypeVar!=null){ JavaCodeResult ret = new JavaCodeResult(); - ret.attach(this.genericTypeVar.TA1.printJavaCode(resultSet)); - if(this.genericTypeVar.TA2!=null)ret.attach(" extends ").attach(this.genericTypeVar.TA2.printJavaCode(resultSet)); + ret.attach(this.genericTypeVar.printJavaCode(resultSet)); + if(this.extendVars.size()>0){ + ret.attach(" extends "); + Iterator it = this.extendVars.iterator(); + while(it.hasNext()){ + Type extend = it.next(); + ret.attach(extend.printJavaCode(resultSet)); + if(it.hasNext())ret.attach(", "); + } + } return ret; } return new JavaCodeResult(this.name); } + public TypePlaceholder getTypePlaceHolder() { + if(!GenericTypeVar.tph.containsKey(this)){ + GenericTypeVar.tph.put(this, TypePlaceholder.fresh()); + } + return GenericTypeVar.tph.get(this); + //if(this.tph == null)this.tph = TypePlaceholder.fresh(); + //return this.tph; + } + + @Override + public String get_Name() { + return this.getName(); + } + + @Override + public String getName() { + return this.name; + } + + public ConstraintsSet TYPE(TypeAssumptions ass){ + ConstraintsSet ret = new ConstraintsSet(); + ass.addGenericVarAssumption(this); + //if(this.genericConstraint != null)ret.add(new SingleConstraint(this.genericConstraint.TA1, this.genericConstraint.TA2)); + if(this.extendVars != null){ + for(Type ev : this.extendVars){ + ret.add(new SingleConstraint(ass.getTypeFor(this), ass.getTypeFor(ev))); + } + } + return ret; + } + } // ino.end - diff --git a/src/mycompiler/mytype/Pair.java b/src/mycompiler/mytype/Pair.java index 1db66f94f..35ce4b3d6 100755 --- a/src/mycompiler/mytype/Pair.java +++ b/src/mycompiler/mytype/Pair.java @@ -303,6 +303,7 @@ public class Pair { boolean ret = true; ret &= (obj instanceof Pair); + if(!ret)return ret; ret &= ((Pair)obj).TA1.equals(this.TA1); ret &= ((Pair)obj).TA2.equals(this.TA2); return ret; @@ -380,7 +381,8 @@ public class Pair */ public Vector getTypePlaceholder() { Vector ret = new Vector(); - + if(this.TA1 instanceof TypePlaceholder)ret.add((TypePlaceholder)TA1); + if(this.TA2 instanceof TypePlaceholder)ret.add((TypePlaceholder)TA2); return ret; } } diff --git a/src/mycompiler/mytype/RefType.java b/src/mycompiler/mytype/RefType.java index bfe772bba..0cbe76aaf 100755 --- a/src/mycompiler/mytype/RefType.java +++ b/src/mycompiler/mytype/RefType.java @@ -18,9 +18,12 @@ import org.apache.log4j.Logger; // ino.end + + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; +import typinferenz.TypeInsertable; @@ -80,14 +83,21 @@ public class RefType extends Type implements IMatchable } // ino.end - // ino.method.RefType.26640.definition + @Override + public int hashCode() { + int hash = 0; + hash += this.name.hashCode();//Nur den Name hashen. Sorgt für langsame, aber funktionierende HashMaps + return hash; + } + + // ino.method.RefType.26640.definition public RefType(String fullyQualifiedName, Vector parameter, int offset) // ino.end // ino.method.RefType.26640.body { super(offset); this.setName(fullyQualifiedName); - if(parameter != null && parameter.size()>0)this.parameter = parameter; + if(parameter != null && parameter.size()>0)this.set_ParaList(parameter); } // ino.end @@ -99,7 +109,7 @@ public class RefType extends Type implements IMatchable super(offset); // otth: Copy-Konstruktor this.setName(R.getTypeName()); - this.parameter = R.get_ParaList(); + this.set_ParaList(R.get_ParaList()); } // ino.end @@ -195,7 +205,55 @@ public class RefType extends Type implements IMatchable //*/ } // ino.end - + + /** + * Wandelt die Parameter des RefTypes in TPHs um, sofern es sich um Generische Variablen handelt. + * @return + */ + public void GTV2TPH(){ + Vector paralist = new Vector(); + if(this.get_ParaList()!=null)for(Type t : this.get_ParaList()){ + if(t instanceof GenericTypeVar)paralist.add(((GenericTypeVar)t).getTypePlaceHolder()); + else paralist.add(t); + } + this.set_ParaList(paralist); + } + + /** + * HOTI + * Diese Methode sucht in der Klassendefinition nach einen GTV, die + * so heißt wie die im RefType definierte Variable. Wenn sie diese gefunden + * hat, wird sie zurückgeben. Wenn dies nicht der Fall war, schaut sie, falls + * angegeben in den Methodenparametern nach. Findet sie dort auch nichts, liefert + * die Methode null. + * @param type + * @return + */ + public GenericTypeVar findGenericType(Vector paralist, Vector methodParaList) + { + for(int i=0;i v) // ino.end // ino.method.set_ParaList.26661.body { - this.parameter = v; - parserlog.debug("T->Type.java->set_ParaList->parameter: " + parameter); - parserlog.debug("T->Type.java->get_Type: " + getName()); + /* + Vector paralist = new Vector(); + if(v!=null)for(Type t : v){ + if(t instanceof GenericTypeVar)paralist.add(((GenericTypeVar)t).getTypePlaceHolder()); + else paralist.add(t); + }*/ + this.parameter = v;//paralist; + parserlog.debug("T->Type.java->set_ParaList->parameter: " + parameter); + parserlog.debug("T->Type.java->get_Type: " + getName()); } // ino.end @@ -551,7 +622,7 @@ public class RefType extends Type implements IMatchable // ino.end // ino.method.modifyToGenericTypeVar.26694.definition - public GenericTypeVar modifyToGenericTypeVar() + public GenericTypeVar modifyToGenericTypeVar(TypeInsertable parent) // ino.end // ino.method.modifyToGenericTypeVar.26694.body { @@ -682,6 +753,22 @@ public class RefType extends Type implements IMatchable } return ret; } + + @Override + public Vector getUnresolvedTPH(ResultSet resultSet) { + Vector ret = super.getUnresolvedTPH(resultSet); + /* + if(this.parameter!=null)for(Type t : this.parameter){ + if(t instanceof TypePlaceholder){ + TypePlaceholder tph = (TypePlaceholder)t; + Type eq = resultSet.getTypeEqualTo(tph); + if(eq instanceof TypePlaceholder)ret.add((TypePlaceholder)eq); + } + } + */ + ret.addAll(this.printJavaCode(resultSet).getUnresolvedTPH()); + return ret; + } } // ino.end diff --git a/src/mycompiler/mytype/Type.java b/src/mycompiler/mytype/Type.java index 15b23b94d..81f6efa59 100755 --- a/src/mycompiler/mytype/Type.java +++ b/src/mycompiler/mytype/Type.java @@ -7,7 +7,10 @@ import java.util.Vector; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; +import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; import mycompiler.IItemWithOffset; +import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.JVMCode; import mycompiler.myclass.UsedId; // ino.end @@ -58,6 +61,10 @@ public class Type implements IItemWithOffset } // ino.end + public void setOffset(int offset){ + this.offset = offset; + } + // ino.method.getVariableLength.26738.definition public int getVariableLength() // ino.end @@ -169,8 +176,8 @@ public class Type implements IItemWithOffset // ino.method.equals.26765.body { if(obj instanceof Type){ - String name2 = ((Type)obj).name; - return getName().equals(name2); + String name2 = ((Type)obj).printJavaCode(new ResultSet()).toString(); + return printJavaCode(new ResultSet()).toString().equals(name2); } else{ return false; @@ -254,6 +261,35 @@ public class Type implements IItemWithOffset if(this instanceof SuperWildcardType)ret.add((SuperWildcardType)this); return ret; } + + /** + * Sucht nach TPHs in diesem Typ, denen das resultSet keinen Typ zuordnen kann. + * @param resultSet + * @return + */ + public Vector getUnresolvedTPH(ResultSet resultSet) { + return new Vector(); + } + + /** + * Prüft ob der Typ von dem übergebenen TypPlaceholder abhängt. + * @param tph + * @return + */ + public boolean involves(TypePlaceholder tph) { + return false; + } + + /** + * Prüft ob der Typ in den Assumptions ass vorhanden ist. + * Dabei kann eine neue Instanz eines Typs entstehen, welche von der Methode zurückgegeben wird. + * @param ass - Die Assumptions für den jeweiligen Kontext in dem sich der Typ befindet. + */ + public Type checkType(TypeAssumptions ass, IItemWithOffset parent){ + Type t = ass.getTypeFor(this); + if(t==null)throw new TypeinferenceException("Der Typ "+this.getName()+" ist nicht korrekt", parent); + return t; + } } // ino.end diff --git a/src/mycompiler/mytype/TypePlaceholder.java b/src/mycompiler/mytype/TypePlaceholder.java index c996f9aa8..a443aea67 100755 --- a/src/mycompiler/mytype/TypePlaceholder.java +++ b/src/mycompiler/mytype/TypePlaceholder.java @@ -6,9 +6,13 @@ package mycompiler.mytype; import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; +import java.util.logging.Logger; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; +import typinferenz.TypeInsertable; +import typinferenz.typedeployment.TypeInsertPoint; +import typinferenz.typedeployment.TypeInsertSet; import mycompiler.MyCompiler; import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent; import mycompiler.mytypereconstruction.replacementlistener.IReplaceTypeEventProvider; @@ -508,6 +512,38 @@ public class TypePlaceholder extends Type implements IReplaceTypeEventProvider return equalType.printJavaCode(resultSet); } + + /** + * Berechnet die InsertPoints dieses TypePlaceholders. + * Alle an diesem TypePlaceholder registrierten ITypeReplacementListener werden darauf kontrolliert, + * ob sie von TypeInsertable erben. + * Diese ergeben zusammen mit den Informationen aus dem übergebenen ResultSet einen TypeInsertPoint. + * Mehrere TypeInsertPoint's ergeben ein TypeInsertSet. + * @param result Das ResultSet das den einzusetzenden Typ für diesen TPH enthält. + * @return + * @see TypeInsertPoint + */ + public Vector getTypeInsertPoints(ResultSet result) { + Vector ret = new Vector(); + for(ITypeReplacementListener ti : this.m_ReplacementListeners){ + if(ti instanceof TypeInsertable){ + TypeInsertPoint toAdd = ((TypeInsertable) ti).createTypeInsertPoint(this, result); + if(toAdd != null)ret.add(toAdd); + //ret.add(new TypeInsertPoint(this, (TypeInsertable)ti, result.getTypeEqualTo(this), result)); + } + } + return ret; + } + + @Override + public Vector getUnresolvedTPH(ResultSet resultSet) { + Vector ret = super.getUnresolvedTPH(resultSet); + Type t = resultSet.getTypeEqualTo(this); + if(t instanceof TypePlaceholder){ + ret.add((TypePlaceholder)t); + } + return ret; + } } // ino.end diff --git a/src/mycompiler/mytype/Void.java b/src/mycompiler/mytype/Void.java index 00c817780..61426af73 100755 --- a/src/mycompiler/mytype/Void.java +++ b/src/mycompiler/mytype/Void.java @@ -1,5 +1,11 @@ // ino.module.Void.8679.package package mycompiler.mytype; + +import mycompiler.IItemWithOffset; +import mycompiler.myclass.Method; +import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; + // ino.end // ino.class.Void.26857.declaration public class Void extends RefType @@ -61,5 +67,10 @@ public class Void extends RefType return new Void(getOffset()); } // ino.end + + @Override + public Type checkType(TypeAssumptions ass, IItemWithOffset parent){ + return this; + } } // ino.end diff --git a/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java b/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java index c5fb71783..51575b459 100755 --- a/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java +++ b/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java @@ -9,9 +9,10 @@ import java.util.Vector; import typinferenz.ConstraintsSet; import typinferenz.ResultSet; -import typinferenz.TypeInsertPoint; -import typinferenz.TypinferenzException; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; +import typinferenz.typedeployment.TypeInsertPoint; +import typinferenz.typedeployment.TypeInsertSet; import mycompiler.mytype.GenericTypeVar; import mycompiler.mytype.Pair; import mycompiler.mytype.RefType; @@ -28,7 +29,7 @@ import mycompiler.mytypereconstruction.typeassumptionkey.CTypeAssumptionKey; // ino.class.CTypeReconstructionResult.27238.description type=javadoc /** * Diese Container-Klasse kapselt alle Ergebniswerte f�r eine m�gliche - * Typkombination aller Klassen und deren Methoden sowie lokalen Variablen. Eine + * Typkombination einer Klasse und deren Methoden sowie lokalen Variablen. Eine * Instanz dieser Klasse steht f�r genau eine m�gliche Typkombination.
* Objekte dieser Klasse werden vom Typrekonstruktionsalgorithmus �ber die * Compiler-API zur�ckgegeben. @@ -52,12 +53,13 @@ public class TypeinferenceResultSet private mycompiler.myclass.Class ownerOfResultSet;//Jedes Resultset gilt immer nur für eine Klasse. Diese wird in dieser Variable gespeichert. // ino.method.CTypeReconstructionResult.27256.definition - public TypeinferenceResultSet(mycompiler.myclass.Class inferedClass) + public TypeinferenceResultSet(mycompiler.myclass.Class inferedClass, Vector constraints, ResultSet unifiedConstraints) // ino.end // ino.method.CTypeReconstructionResult.27256.body { - this.ownerOfResultSet = inferedClass; - + this.ownerOfResultSet = inferedClass; + this.constraints = constraints; + this.unifiedConstraints = unifiedConstraints; } // ino.end @@ -71,12 +73,7 @@ public class TypeinferenceResultSet public Vector getConstraints() { return this.constraints; } - - public void setConstraints(Vector constraints) { - this.constraints = constraints; - } - /** * @author Andreas Stadelmeier, a10023 * Nach dem Durchführen des Interferenzalgorithmus von Lambda 8 entsteht für jede Lösung ein Set con Constraints. @@ -87,9 +84,6 @@ public class TypeinferenceResultSet return unifiedConstraints; } - public void setUnifiedConstraints(Vector unifiedConstraints) { - this.unifiedConstraints = new ResultSet(unifiedConstraints); - } /** * Ermittelt den in diesem ResultSet für den TypePlaceholder tph zugewiesenen Wert. @@ -114,15 +108,24 @@ public class TypeinferenceResultSet /** * Berechnet alle möglichen Punkte zum Einsetzen eines Typs im Quelltext + * Dabei entstehen TypeInsertSets. Für jeden gesammelten TypeInsertPoint werden alle Abhängigkeiten berechnet. + * * @return */ - public Vector getTypeInsertionPoints(){ - for(Pair p : constraints){ - for(TypePlaceholder tph : p.getTypePlaceholder()){ - - } - } - return null; + public TypeInsertSet getTypeInsertionPoints(){ + TypeInsertSet ret = new TypeInsertSet(this.unifiedConstraints); + + this.ownerOfResultSet.addTypeInsertPoints(ret,this.unifiedConstraints); + + return ret; + } + + /** + * Startet die Bytecodegenerierung dieser Lösung. + * Dabei wird die codegen-Methode der inferierten Klasse mit diesem ResultSet aufgerufen. + */ + public void codegen(){ + //TODO: Alles! } } diff --git a/src/typinferenz/FunN.java b/src/typinferenz/FunN.java index 890a16f54..f00ae9ec5 100755 --- a/src/typinferenz/FunN.java +++ b/src/typinferenz/FunN.java @@ -21,6 +21,9 @@ import mycompiler.mytypereconstruction.typeassumption.CMethodTypeAssumption; * "interface FunN { R apply(T1 arg1, T2 arg2, ... , TN argN); }" * @author A10023 - Andreas Stadelmeier * + * Bemerkung: + * FunN ist ein RefType. Der RefType ist nicht mit einem FunNInterface verbunden. + * */ public class FunN extends RefType implements ITypeReplacementListener{ @@ -139,6 +142,7 @@ public class FunN extends RefType implements ITypeReplacementListener{ } */ + /* @Override public JavaCodeResult printJavaCode(ResultSet resultSet){ //String ret = super.printJavaCode(resultSet) + (T!=null ? this.T.size() : 0) +"<"; @@ -153,7 +157,7 @@ public class FunN extends RefType implements ITypeReplacementListener{ //ret = ret.substring(0, ret.length()-2); return ret.attach(">"); } - + */ /** * Die Clone-Methode von RefType darf von FunN NICHT überschrieben werden. @Override diff --git a/src/typinferenz/FunNInterface.java b/src/typinferenz/FunNInterface.java index 2141951c1..754427355 100644 --- a/src/typinferenz/FunNInterface.java +++ b/src/typinferenz/FunNInterface.java @@ -1,11 +1,57 @@ package typinferenz; +import java.util.Vector; + +import typinferenz.assumptions.ClassAssumption; +import typinferenz.assumptions.MethodAssumption; +import typinferenz.assumptions.TypeAssumptions; +import mycompiler.mytype.*; import mycompiler.myclass.Class; +import mycompiler.mytype.TypePlaceholder; +/** + * Stellt das Interface FunN dar. + * @author janulrich + * + */ public class FunNInterface extends Class{ - - public FunNInterface() { - super("FunN"); +//TODO: Diese Klasse sollte eigentlich von Interface erben + //TODO: getType muss einen Typ mit der ParameterListe zurückliefern. + /** + * Ein FunN-Interface enthält nur eine Methode (namens apply). Ist also ein Funktionales Interface. + * @param N - Die Anzahl der Parameter der apply-Methode. Beispiel N = 1 ergibt R apply(T1 par1); + */ + public FunNInterface(int N) { + super("Fun"+N); + Vector paralist = new Vector(); + paralist.add(new GenericTypeVar("R",0)); + //paralist.add(TypePlaceholder.fresh()); + for(int i = 1; i<=N;i++){ + paralist.add(new GenericTypeVar("T"+i,0)); + //paralist.add(TypePlaceholder.fresh()); + } + this.set_ParaList(paralist); + } + + /** + * @return Im Falle von einem FunN-Interface ist dies die apply-Methode + */ + @Override + public TypeAssumptions getPublicFieldAssumptions() { + //return super.getPublicFieldAssumptions(); + TypeAssumptions ret = new TypeAssumptions(); + ret.addAssumption(new MethodAssumption(this.getApplyFunction(), this)); + ret.addClassAssumption(new ClassAssumption(this)); + return ret; } + /** + * Erstellt die nach Definition des Typinferenzalgorithmus von Martin Plümicke, in jedem FunN-Interface enthaltene apply-Methode + * @return + */ + private FunNMethod getApplyFunction(){ + return new FunNMethod(this.get_ParaList()); + //return new FunNMethod(this.get_ParaList().size()-1); + } + } diff --git a/src/typinferenz/FunNMethod.java b/src/typinferenz/FunNMethod.java index 48d60fa37..269a58ab7 100644 --- a/src/typinferenz/FunNMethod.java +++ b/src/typinferenz/FunNMethod.java @@ -1,15 +1,57 @@ package typinferenz; -import mycompiler.myclass.Method; +import java.util.Vector; + +import typinferenz.typedeployment.TypeInsertPoint; +import mycompiler.mytype.*; +import mycompiler.myclass.*; +import mycompiler.mytype.TypePlaceholder; public class FunNMethod extends Method{ - /** * * @param N - Anzahl der Parameter (Beispiel: Fun2) */ + public FunNMethod(Vector paralist){ + super(0); //Hat keinen Offset, da nur theoretisch gedachte Methode + int N = paralist.size(); //In der paraliste ist der erste Parameter der Rückgabetyp + this.setType(paralist.firstElement()); + this.set_DeclId(new DeclId("apply")); + ParameterList pl = new ParameterList(); + Vector fpList = new Vector(); + for(int i = 1;i fpList = new Vector(); + for(int i = 1;i<=N;i++){ //Alle verbleibenden Elemente in der übergebenen paralist durchgehen. + DeclId paramName = new DeclId("T"+i); + FormalParameter parameter = new FormalParameter(paramName); + parameter.setType(TypePlaceholder.fresh(parameter)); + //parameter.set_DeclId(paramName); + fpList.add(parameter); + } + pl.formalparameter = fpList; + this.parameterlist = pl; + } + + @Override + public TypeInsertPoint createTypeInsertPoint(TypePlaceholder tph, + ResultSet resultSet) { + return null; } } diff --git a/src/typinferenz/GenericTypeInsertPoint.java b/src/typinferenz/GenericTypeInsertPoint.java new file mode 100644 index 000000000..0ca14fd76 --- /dev/null +++ b/src/typinferenz/GenericTypeInsertPoint.java @@ -0,0 +1,147 @@ +package typinferenz; + +import java.util.Iterator; +import java.util.Vector; + +import typinferenz.exceptions.DebugException; +import typinferenz.typedeployment.TypeInsertPoint; +import mycompiler.IItemWithOffset; +import mycompiler.SyntaxTreeNode; +import mycompiler.mytype.GenericTypeVar; +import mycompiler.mytype.Pair; +import mycompiler.mytype.RefType; +import mycompiler.mytype.Type; +import mycompiler.mytype.TypePlaceholder; + +/** + * Ein InsertPoint für Generische Variablen + * @author janulrich + * + */ +public class GenericTypeInsertPoint extends TypeInsertPoint { + + + private Vector genericPairs = new Vector(); + + public GenericTypeInsertPoint(TypeInsertPoint p) { + super(p.point, p.type, p.resultSet); + } + + public GenericTypeInsertPoint(TypeInsertable syntaxTreeNode, + TypePlaceholder tph ,ResultSet resultSet) { + super(syntaxTreeNode, tph, resultSet); + } + + public GenericTypeInsertPoint(TypeInsertable syntaxTreeNode, + Vector pairs,ResultSet resultSet) { + super(syntaxTreeNode, null, resultSet); + this.genericPairs = pairs; + if(this.genericPairs.size() == 0)throw new DebugException("Menge der generischen Paare ist leer"); + } + + /** + * Fügt eine generische Variable in Form eines Pairs an. + * @param p + */ + public void addGenericPair(Pair p){ + if(!this.genericPairs.contains(p))this.genericPairs.add(p); + } + + @Override + public JavaCodeResult getTypeInsertString() { + //if(genericPairs.size()==0)return new JavaCodeResult(); + return super.getTypeInsertString(); + } + + @Override + protected Type getInsertType(){ + if(genericPairs.size()==0){ + return new RefType("<"+this.type.printJavaCode(resultSet)+">",-1); + } + + Vector pairs = new Vector(); + //Problem: ist falsch! Es muss: heißen: + Vector P1s = new Vector(); + Vector P2s = new Vector(); + for(Pair p : genericPairs){ + P1s.add(p.TA1); + P2s.add(p.TA2); + } + for(Type t : P2s){ + if(!P1s.contains(t))pairs.add(new Pair(t,null)); + } + pairs.addAll(this.genericPairs); + + Iterator it = pairs.iterator(); + String genericTypeParameters = "<"; + while(it.hasNext()){ + genericTypeParameters += new GenericTypeVar(it.next(), 0).printJavaCode(this.getResultSet()); + if(it.hasNext())genericTypeParameters += ", "; + } + genericTypeParameters += ">"; + //Der Generische Variablen String zum Einsetzen ist nun vorhanden + this.type = new RefType(genericTypeParameters,0); + return this.type; + } + + @Override + public boolean equals(Object obj){ + if(obj instanceof GenericTypeInsertPoint)return super.equals(obj); + return false; + } + + @Override + public int compareTo(TypeInsertPoint arg0) { + int ret = new Integer(this.getOffset()).compareTo(new Integer(arg0.getOffset())); + if(ret == 0){ + if(! (arg0 instanceof GenericTypeInsertPoint)){ + ret = new Integer(this.getOffset()-1).compareTo(new Integer(arg0.getOffset())); + } + } + return ret; + } + + @Override + public TypeInsertable getInsertNode(){ + return super.getGenericTypeVarInsertNode(); + } + + /** + * Versucht den GenericTypeInsertPoint mit dem bergebenenen p2 zusam + * basierend auf ihren insertPoints. + * @param p2 + * @return - Die bei der Zusammenfhrung entstandene GenericTypeInser + */ + public Vector merge(GenericTypeInsertPoint p2) { + Vector ret = new Vector(); + if(this.getInsertNode().equals(p2.getInsertNode())){ + for(Pair p : p2.genericPairs)this.addGenericPair(p); + ret.add(this); + }else{ + ret.add(this); + ret.add(p2); + } + return ret; + } + + @Override + public JavaCodeResult insertType(String fileContent, int additionalOffset) { + //TODO: Es kann sein, dass eine Methode bereits Generische Variablen hat, diese müssen dann an diese Liste angefügt werden. + + return super.insertType(fileContent, additionalOffset); + } + + public boolean associatedWith(TypeInsertPoint tip, ResultSet resultSet) { + if((tip.type instanceof TypePlaceholder)){ + Vector tphs = new Vector<>(); + tphs.add((TypePlaceholder)tip.type); + for(Pair p : resultSet.getConstraintsFor(tphs)){ + if(p.TA1.equals(this.type))return true; + if(p.TA2.equals(this.type))return true; + if(this.genericPairs.contains(p))return true; + } + } + + return false; + } +} diff --git a/src/typinferenz/JavaCodeResult.java b/src/typinferenz/JavaCodeResult.java index 757e35a0e..4d7b9f9ee 100755 --- a/src/typinferenz/JavaCodeResult.java +++ b/src/typinferenz/JavaCodeResult.java @@ -39,6 +39,11 @@ public class JavaCodeResult{ unresolvedTPHs.add(typePlaceholder); } + /** + * Liefert alle TPHs, welche in diesem JavaCodeResult nicht zu einem Typ aufgelöst wurden. + * Diese TPHs stehen dadurch im JavaCode als Variablennamen ohne zugeordnetem Typ. + * @return + */ public Vector getUnresolvedTPH(){ return unresolvedTPHs; } diff --git a/src/typinferenz/OderConstraint.java b/src/typinferenz/OderConstraint.java index f3208bd21..61aff4fe0 100755 --- a/src/typinferenz/OderConstraint.java +++ b/src/typinferenz/OderConstraint.java @@ -16,6 +16,7 @@ public class OderConstraint{ * @param p2 */ public OderConstraint(Type p1, Type p2){ + if(p1 == null || p2 == null)throw new NullPointerException(); Pair constraintPair = new Pair(p1,p2); oderConstraintPairs = new Vector(); this.addConstraint(constraintPair); @@ -58,8 +59,8 @@ public class OderConstraint{ @Override public String toString(){ String ret = "["; - for(Pair p : this.getConstraintPairs()){ - ret += p.toString()+ ", "; + for(UndConstraint p : this.getUndConstraints()){ + ret += p.toString()+ "| "; } return ret+"]"; } diff --git a/src/typinferenz/Overloading.java b/src/typinferenz/Overloading.java index c961ec46a..d371e2f75 100755 --- a/src/typinferenz/Overloading.java +++ b/src/typinferenz/Overloading.java @@ -4,6 +4,8 @@ import java.util.Vector; import typinferenz.assumptions.MethodAssumption; import typinferenz.assumptions.TypeAssumptions; +import typinferenz.exceptions.TypeinferenceException; +import mycompiler.mystatement.Expr; import mycompiler.mystatement.MethodCall; import mycompiler.mytype.RefType; import mycompiler.mytype.Type; @@ -55,7 +57,13 @@ public class Overloading{ */ public OderConstraint generateConsstraints(){ OderConstraint ret = new OderConstraint(); - for(MethodAssumption methodAssumption : assumptions.getMethodAssumptions(methodCall.getName(), methodCall.getArgumentList().size())){ + Vector parameterList = new Vector(); + for(Expr argument : methodCall.getArgumentList().expr){ + parameterList.add(argument.getType()); + } + Vector methodAssumptions = assumptions.getMethodAssumptions(methodCall.getName(), parameterList); + if(methodAssumptions.size()==0)throw new TypeinferenceException("Eine Methode "+methodCall.get_Name()+" ist in den Assumptions nicht vorhanden", methodCall); + for(MethodAssumption methodAssumption : methodAssumptions){ if(!(this.type instanceof TypePlaceholder) && !this.type.equals(methodAssumption.getAssumedType()))break; UndConstraint methodConstraint = new UndConstraint(); //Ein Constraint für den ReturnType der Methode... @@ -76,6 +84,7 @@ public class Overloading{ //Ein Constraint für den Receiver der Methode (falls vorhanden)... //ret.add(new Constraint(methodCall.get_Receiver().get_Expr().getTypeVariable(), new RefType(assumption.getClassName(), null, 0))); if(methodCall.get_Receiver() != null && methodCall.get_Receiver().get_Expr() != null) + //TODO: FunN-MethodAssumption darf keine Klasse (Class) als ParentClass besitzen. Denn der Typ der Klasse steht noch nicht fest (bisher ist es immer "FunN"). methodConstraint.addConstraint(methodCall.get_Receiver().get_Expr().getType(), methodAssumption.getParentClassType()); //ret.add(new Constraint(methodCall.get_Receiver().get_Expr().getTypeVariable(), new RefType(assumption.getClassName(), parameterAssumptions, 0))); diff --git a/src/typinferenz/ResultSet.java b/src/typinferenz/ResultSet.java index 274bf02d5..997c5c1d9 100755 --- a/src/typinferenz/ResultSet.java +++ b/src/typinferenz/ResultSet.java @@ -5,6 +5,7 @@ import java.util.Vector; import mycompiler.mytype.Pair; import mycompiler.mytype.Type; +import mycompiler.mytype.TypePlaceholder; /** * Im Grunde Sammlung von Pair s mit Equal-Operatoren. @@ -20,6 +21,13 @@ public class ResultSet implements Iterable { resultPairs = resultSet; } + /** + * Erstellt ein leeres ResultSet + */ + public ResultSet() { + this(new Vector()); + } + public Vector getResultSet(){ return resultPairs; } @@ -71,4 +79,49 @@ public class ResultSet implements Iterable { return this.getResultSet().toString(); } + @Override + public boolean equals(Object obj){ + return true; + } + + + /** + * Sammelt alle Constraints, welche mit den übergebenen TPH's in Verbindung stehen. + * Auch alle Constraints, welche wiederum mit den gesammelten Constraints in Verbindung stehen werden gesammelt. + * @return + */ + public Vector getConstraintsFor(Vector typePlaceholders) { + Vector ret = new Vector(); + Vector tphs = (Vector) typePlaceholders.clone(); + for(int i = 0;i getTypesInvolving(Vector unresolvedTPH) { + Vector ret = new Vector(); + for(Pair p : this.resultPairs){ + for(TypePlaceholder tph : unresolvedTPH){ + if(p.TA1.involves(tph))ret.add(p.TA1); + if(p.TA2.involves(tph))ret.add(p.TA2); + } + } + return ret; + } } diff --git a/src/typinferenz/SingleConstraint.java b/src/typinferenz/SingleConstraint.java index e15b921b3..431f2da65 100755 --- a/src/typinferenz/SingleConstraint.java +++ b/src/typinferenz/SingleConstraint.java @@ -2,6 +2,9 @@ package typinferenz; import java.util.Vector; +import typinferenz.exceptions.DebugException; +import typinferenz.exceptions.TypeinferenceException; +import mycompiler.mytype.GenericTypeVar; import mycompiler.mytype.Pair; import mycompiler.mytype.RefType; import mycompiler.mytype.Type; @@ -41,15 +44,23 @@ public class SingleConstraint extends UndConstraint{ } public void addConstraint(Pair toAdd){ - if(constraintPair != null)throw new TypinferenzException("Ein Constraint darf nur aus einem ConstraintPair bestehen. Das hinzufügen von "+ toAdd + " ist nicht möglich."); + if(constraintPair != null)throw new DebugException("Ein Constraint darf nur aus einem ConstraintPair bestehen. Das hinzufügen von "+ toAdd + " ist nicht möglich."); Type p1 = toAdd.TA1; Type p2 = toAdd.TA2; if(p1==null || p2 == null)throw new NullPointerException(); + + + //Hier werden die GTVs zu TPH gewandelt. + if(p1 instanceof RefType)((RefType)p1).GTV2TPH(); + if(p2 instanceof RefType)((RefType)p2).GTV2TPH(); + + if((p1 instanceof GenericTypeVar))p1 = ((GenericTypeVar)p1).getTypePlaceHolder();//throw new DebugException("GenericTypeVar sind in den Constraints nicht erlaubt");// + if((p2 instanceof GenericTypeVar))p2 = ((GenericTypeVar)p2).getTypePlaceHolder();//throw new DebugException("GenericTypeVar sind in den Constraints nicht erlaubt");// // BaseTypes werden in RefTypes umgewandelt. Constraints dürfen nur RefTypes oder TypePlaceholder enthalten, da sonst der Unify-Algorithmus nicht funktioniert. - if(!(p1 instanceof RefType) && !(p1 instanceof TypePlaceholder))p1 = new RefType(p1); - if(!(p2 instanceof RefType) && !(p2 instanceof TypePlaceholder))p2 = new RefType(p2); + if(!(p1 instanceof RefType) && !(p1 instanceof TypePlaceholder) && !(p1 instanceof GenericTypeVar))p1 = new RefType(p1); + if(!(p2 instanceof RefType) && !(p2 instanceof TypePlaceholder) && !(p2 instanceof GenericTypeVar))p2 = new RefType(p2); //if(!(TypePlaceholder.class.isInstance(p1)) || !(RefType.class.isInstance(p1)) || !(TypePlaceholder.class.isInstance(p2)) || !(RefType.class.isInstance(p2))) //{//Wenn die beiden übergebenen Typen weder RefTypes noch TypePlaceholder sind: diff --git a/src/typinferenz/TIPConstraints.java b/src/typinferenz/TIPConstraints.java new file mode 100644 index 000000000..d664e601b --- /dev/null +++ b/src/typinferenz/TIPConstraints.java @@ -0,0 +1,17 @@ +package typinferenz; + +import java.util.Vector; + +import mycompiler.mytype.TypePlaceholder; + +/** + * + * @author janulrich + * + */ +public class TIPConstraints { + + public TIPConstraints(Vector involvedTPHs){ + + } +} diff --git a/src/typinferenz/TypeInsertPoint.java b/src/typinferenz/TypeInsertPoint.java deleted file mode 100644 index 7c552d7bf..000000000 --- a/src/typinferenz/TypeInsertPoint.java +++ /dev/null @@ -1,5 +0,0 @@ -package typinferenz; - -public class TypeInsertPoint { - -} diff --git a/src/typinferenz/TypeInsertable.java b/src/typinferenz/TypeInsertable.java index f3e9409a0..ca93a49e6 100644 --- a/src/typinferenz/TypeInsertable.java +++ b/src/typinferenz/TypeInsertable.java @@ -1,11 +1,23 @@ package typinferenz; +import typinferenz.typedeployment.TypeInsertPoint; +import mycompiler.IItemWithOffset; +import mycompiler.mytype.TypePlaceholder; import mycompiler.mytypereconstruction.replacementlistener.ITypeReplacementListener; -public interface TypeInsertable extends ITypeReplacementListener, Typeable { +public interface TypeInsertable extends ITypeReplacementListener, Typeable, IItemWithOffset { public int getOffset(); public void setOffset(int offset); public String getIdentifier(); + /** + * Errechnet den TypeInsertPoint für das TypeInsertable. + * TypeInsertPoints sollten nur über diese Funktion erstellt werden. + * @param tph + * @param resultSet + * @return - kann auch null zurückgeben. + */ + public TypeInsertPoint createTypeInsertPoint(TypePlaceholder tph, ResultSet resultSet); + } diff --git a/src/typinferenz/TypinferenzException.java b/src/typinferenz/TypinferenzException.java deleted file mode 100755 index aa0e082fd..000000000 --- a/src/typinferenz/TypinferenzException.java +++ /dev/null @@ -1,13 +0,0 @@ -package typinferenz; - -/** - * Eine RuntimeException, welche bei einem Fehler während des Typinferenzalgorithmus ausgelöst wird. - * Dies wird zum Beispiel durch Programmierfehler in der Java-Eingabedatei ausgelöst. - * @author Andreas Stadelmeier, a10023 - * - */ -public class TypinferenzException extends RuntimeException { - public TypinferenzException(String message){ - super(message); - } -} diff --git a/src/typinferenz/UndConstraint.java b/src/typinferenz/UndConstraint.java index ceb4e3881..f5dc88084 100755 --- a/src/typinferenz/UndConstraint.java +++ b/src/typinferenz/UndConstraint.java @@ -27,9 +27,15 @@ public class UndConstraint extends OderConstraint { return ret; } + @Override public String toString(){ - String ret = super.toString(); - return ret.replace(',', '|'); + //String ret = super.toString(); + //return ret.replace('|', ','); + String ret = "["; + for(Pair p : this.getConstraintPairs()){ + ret += p.toString()+ ", "; + } + return ret+"]"; } } diff --git a/src/typinferenz/assumptions/Assumption.java b/src/typinferenz/assumptions/Assumption.java index 8e92c5e89..d370d85f3 100644 --- a/src/typinferenz/assumptions/Assumption.java +++ b/src/typinferenz/assumptions/Assumption.java @@ -9,6 +9,12 @@ public class Assumption { private TypeInsertable typable; + /** + * Wird dieser Konstruktor benutzt müssen alle Methoden der Klasse Assumption überschrieben werden. + */ + protected Assumption(){ + } + public Assumption(TypeInsertable ass){ this.typable = ass; } diff --git a/src/typinferenz/assumptions/ClassAssumption.java b/src/typinferenz/assumptions/ClassAssumption.java new file mode 100644 index 000000000..98b9f4b65 --- /dev/null +++ b/src/typinferenz/assumptions/ClassAssumption.java @@ -0,0 +1,35 @@ +package typinferenz.assumptions; + +import mycompiler.myclass.*; +import mycompiler.myclass.Class; +import mycompiler.mytype.*; + +/** + * Nicht wirklich eine Assumption. + * Wird benutzt um Typen von Variablen zu verifizieren. + * @author janulrich + * + */ +public class ClassAssumption{ + + private Class classType; + + public ClassAssumption(Class cls){ + this.classType = cls; + } + + public Class getAssumedClass(){ + return classType; + } + + public String toString(){ + return this.classType.getName(); + } + + public boolean equals(Object obj){ + if(!(obj instanceof ClassAssumption))return false; + ClassAssumption equals = (ClassAssumption)obj; + if(!equals.classType.equals(this.classType))return false; + return true; + } +} diff --git a/src/typinferenz/assumptions/ConstructorAssumption.java b/src/typinferenz/assumptions/ConstructorAssumption.java new file mode 100644 index 000000000..855c40f9f --- /dev/null +++ b/src/typinferenz/assumptions/ConstructorAssumption.java @@ -0,0 +1,21 @@ +package typinferenz.assumptions; + +import mycompiler.myclass.Class; +import mycompiler.myclass.Field; +import mycompiler.myclass.Method; +import mycompiler.mystatement.ArgumentList; + +public class ConstructorAssumption extends MethodAssumption{ + + public ConstructorAssumption(Method assumedMethod, Class parentClass) { + super(assumedMethod, parentClass); + } + + @Override + public boolean equals(Object obj) { + if(!(obj instanceof ConstructorAssumption))return false; + return super.equals(obj); + } + + +} diff --git a/src/typinferenz/assumptions/CopyOfTypeAssumptions.java b/src/typinferenz/assumptions/CopyOfTypeAssumptions.java deleted file mode 100644 index d18d26233..000000000 --- a/src/typinferenz/assumptions/CopyOfTypeAssumptions.java +++ /dev/null @@ -1,302 +0,0 @@ -package typinferenz.assumptions; - -import java.util.Iterator; -import java.util.Vector; - -import sun.reflect.generics.reflectiveObjects.NotImplementedException; -import typinferenz.FunN; -import typinferenz.TypinferenzException; -import mycompiler.mytype.GenericTypeVar; -import mycompiler.mytype.RefType; -import mycompiler.mytype.Type; -import mycompiler.mytype.TypePlaceholder; -import mycompiler.mytypereconstruction.set.CTypeAssumptionSet; -import mycompiler.mytypereconstruction.typeassumption.CInstVarTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CLocalVarTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CMethodTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption; - -/** - * Eine Sammlung von TypeAssumptions. - * Jede Expression und jedes Statement erhält beim Aufrufen ihrer TYPE-Methode ein AssumptionSet mit den Assumptions ihrer Umgebung als Parameter übergeben. - * @author janulrich - * - * Es gibt verschiedene Assumptions: - * 1. Methoden Assumptions - * 2. Konstruktor Assumptions - * 3. Lokale Variablen Assumptions - * 4. Feldvariablen Assumptions - * - */ -public class CopyOfTypeAssumptions implements Iterable { - - //private static CTypeAssumptionSet globalAssumptions = new CTypeAssumptionSet(); - private String thisClassName; - - //private Vector assumptions; - CTypeAssumptionSet assumptions = new CTypeAssumptionSet(); - - private Vector methodAssumptions = new Vector(); - - public CopyOfTypeAssumptions(){ - assumptions = new CTypeAssumptionSet(); - } - - /** - * Dieser Konstruktor setzt bei der Initialisierung auch den Wert von "this" - * @param klassenname - Wert für "this" - */ - public CopyOfTypeAssumptions(String klassenname){ - this(); - this.setThisClassname(klassenname); - } - - public CopyOfTypeAssumptions(CTypeAssumptionSet ass, String classname){ - assumptions = ass; - this.setThisClassname(classname); - } - - public CopyOfTypeAssumptions(CopyOfTypeAssumptions assumptions2) { - assumptions = new CTypeAssumptionSet(); - this.add(assumptions2); - } - - /** - * Im AssumptionSet muss je nach Umfeld der Wert von "this" neu gesetzt werden. - * Dies übernimmt diese Funktion. - * @param name - Der Klassenname der von this referenzierten Klasse. - */ - public void setThisClassname(String name){ - this.thisClassName = name; - } - - /** - * Erstellt eine CInstVarTypeAssumption und fügt sie den Assumptions hinzu. - * @param className - * @param identifier - * @param assumedType - */ - public void addInstVarAssumption(String className, String identifier, Type assumedType){ - this.add(createFieldVarAssumption(className, identifier, assumedType)); - } - - - /** - * Ruft createMethodAssumption auf und fügt die Assumption dem AssumptionSet hinzu - * @param classType - * @param identifier - * @param assumedType - * @param parameterTypes - */ - @Deprecated - public void addMethodAssumption_Backup(Type classType, String identifier, Type assumedType, Vector parameterTypes){ - CMethodTypeAssumption ass = createMethodAssumption(classType, identifier, assumedType, parameterTypes); - this.add(ass); - } - - public void addMethodAssumption(MethodAssumption mAss){ - this.methodAssumptions.add(mAss); - } - - /** - * - * @param className - * @param identifier - * @param assumedType - ReturnTyp der Methode - * @param parameterTypes - Liste der Parameter der Methode. TIPP: Zur Erstellung der CParaTypeAssumption-Liste kann die Methode TypeAssumptions.createCParaTypeAssumption verwendert werden. - */ - public static CMethodTypeAssumption createMethodAssumption_backup(Type classType, String identifier, Type assumedType, Vector parameterTypes){ - CMethodTypeAssumption ass = new CMethodTypeAssumption(classType, identifier, assumedType, parameterTypes.size(), 0, 0, null, null); - for(CParaTypeAssumption paraAssumption : parameterTypes){ - //Es wird eine neue ParameterAssumption generiert. Nur der Identifier und der AssumedType der CParaTypeAssumption wird dabei übernommen. - CParaTypeAssumption newParaAssumption = new CParaTypeAssumption(classType.get_Name(), identifier, parameterTypes.size(),0, paraAssumption.getIdentifier(), paraAssumption.getAssumedType(), 0,0,null); - ass.addParaAssumption(newParaAssumption); - } - return ass; - } - - public static CInstVarTypeAssumption createFieldVarAssumption_backup(String className, String fieldName, Type type){ - if(className==null || fieldName == null || type == null) throw new TypinferenzException("Ungültige Feld-Assumption"); - CInstVarTypeAssumption ret = new CInstVarTypeAssumption(className, fieldName, type, 0,0,null); - - return ret; - } - - /** - * Erstellt eine CParaTypeAssumption. - * Diese enthält nur den Identifier und den Typ des Parameters. Die Zuordnung zu einer Methode und einer Klasse erhält die Assumption erst durch den Einsatz in der TypeAssumptions.addMethodAssumption. - * @param identifier - * @param assumedType - * @return - */ - public static CParaTypeAssumption createCParaTypeAssumption_backup( String identifier, Type assumedType){ - CParaTypeAssumption ret; - ret = new CParaTypeAssumption( null, null, 0, 0, identifier, assumedType, 0,0, null); - return ret; - } - - public void addLocalVarAssumption(){ - throw new NotImplementedException(); - } - - - - /** - * Durchsucht die Assumptions des aktuellen Gültigkeitsbereichs (lokale Variablen und Felder der aktuellen Klasse) nach einem Eintrag für den übergebenen Variablennamen. - * In den Assumptions wird dann in der Reihenfolge LocalVarAssumptions, FieldAssumption nach dem übergebenen Variablennamen gesucht. - * @param variableName - der Identifier der gesuchten Variablen - * @return - Der Typ für diesen Identifier. - */ - public Type getVarType(String variableName){ - //Zuerst die Parameter durchsuchen - for(CTypeAssumption ass : this.assumptions){//this.getParameterAssumptions(null)){ - if(ass.getIdentifier().equals(variableName))return ass.getAssumedType(); - } - //TODO: Dann die lokalen Variablen - // ... (noch nicht implementiert) - //und zuletzt die Felder der Klasse in dessen Namensraum sich dieses AssumptionSet befindet. - for(CTypeAssumption ass : this.getInstVarAssumptions()){ - if(ass.getIdentifier().equals(variableName))return ass.getAssumedType(); - } - //Wird keine Assumption gefunden, muss ein Fehler vorliegen: - throw new TypinferenzException("Eine Variable "+variableName+" ist in den Assumptions nicht vorhanden"); - } - - /** - * Ermittelt alle Assumptions zu Instanzvariablen, welche sich in der Klasse "this" befinden, also der Klasse für welche dieses AssumptionSet gültig ist. - * @return - */ - public CopyOfTypeAssumptions getInstVarAssumptions(){ - String className = this.getThisValue().getName(); - CopyOfTypeAssumptions ret = new CopyOfTypeAssumptions(); - for(CTypeAssumption ass : this.assumptions){ - if(ass instanceof CInstVarTypeAssumption && ass.getClassName().equals(className))ret.add(ass); - } - return ret; - } - - /** - * @return - Alle Assumptions dieses AssumptionSets, welche Annahmen für Parameter darstellen - */ - private CopyOfTypeAssumptions getParameterAssumptions(CMethodTypeAssumption method) { - CopyOfTypeAssumptions ret = new CopyOfTypeAssumptions(); - if(method==null)return ret; - for(CParaTypeAssumption ass : method.getParaAssumptions()){ - //if(ass instanceof CParaTypeAssumption)ret.add(ass); - ret.add(ass); - } - return ret; - } - - /** - * Sucht nach MethodAssumptions einer bestimmten Klasse mit einem bestimmten Namen. - * @param className - * @param methodName - * @param parameterCount - * @return - */ - public Vector getMethodAssumptions(String className, String methodName){ - Vector ret = new Vector(); - for(CTypeAssumption ass : this.getAssumptionsFor(className)){ - //System.out.println(ass.getIdentifier()); - if(ass.getIdentifier().equals(methodName) && ass instanceof CMethodTypeAssumption)ret.add((CMethodTypeAssumption)ass); - } - //if(ret.size()==0)throw new TypinferenzException("Eine Methode "+methodName+" ist in den Assumptions nicht vorhanden"); - return ret; - } - - /** - * Sucht nach Assumptions zu einer Methode mit dem Namen methodName und parameterCount Parametern. - * @param methodName - * @param parameterCount Anzahl der Parameter der gesuchten Methoden-Assumption - * @return - */ - public Vector getMethodAssumptions(String methodName, int parameterCount){ - Vector ret = new Vector(); - for(CTypeAssumption ass : assumptions){ - //System.out.println(ass.getIdentifier()); - if(ass.getIdentifier().equals(methodName) && ass instanceof CMethodTypeAssumption){ - CMethodTypeAssumption toAdd = (CMethodTypeAssumption)ass; - if(toAdd.getParaCount() == parameterCount)ret.add(toAdd); - } - } - //Falls es sich um die apply-Methode eines FunN-Interface handelt: - if(methodName.equals("apply")){ //Ein Workaround für den Typinferenzalgorithmus TODO: Das hier rausnehmen. - CMethodTypeAssumption funNAssumption = new FunN(parameterCount).toCMethodTypeAssumption(); - ret.add(funNAssumption); - } - if(ret.size()==0)throw new TypinferenzException("Eine Methode "+methodName+" ist in den Assumptions nicht vorhanden"); - return ret; - } - - - /** - * Fügt dem Assumption-Set eine neue Assumption hinzu. - * @param ass - * @return - */ - public CopyOfTypeAssumptions add(CTypeAssumption ass){ - if(ass.getAssumedType()==null)throw new NullPointerException();//ass.setAssumedType(TypePlaceholder.fresh()); - - //if(ass instanceof CParaTypeAssumption)throw new TypinferenzException("ParameterAssumptions müssen einer Methode zugewiesen sein"); - - //globalAssumptions.addElement(ass); - assumptions.addElement(ass); - return this; - } - - public void remove(CTypeAssumption typeAssumption){ - throw new NotImplementedException(); - } - - public CopyOfTypeAssumptions add(CopyOfTypeAssumptions assumptions){ - for(CTypeAssumption ass : assumptions){ - this.add(ass); - } - return this; - } - - public CopyOfTypeAssumptions add(CTypeAssumptionSet assumptionSet){ - assumptions.unite(assumptionSet); - return this; - } - - public Iterator iterator() { - return assumptions.iterator(); - } - - @Override - public CopyOfTypeAssumptions clone(){ - CTypeAssumptionSet assSet = new CTypeAssumptionSet(); - for(CTypeAssumption ass : assumptions){ - assSet.addElement(ass); - } - return new CopyOfTypeAssumptions(assSet, thisClassName); - } - - /** - * Jede erstellte Assumption wird von der TypeAssumptions-Klasse gespeichert. - * Diese Funktion ermittelt alle zu einer Klasse gehörenden Assumptions. - * @param classname - * @return Alle Assumptions mit - assumption.getClassname().equals(classname) - der this-Wert ist auf "classname" gesetzt. - */ - public CopyOfTypeAssumptions getAssumptionsFor(String classname){ - CTypeAssumptionSet assumptions = new CTypeAssumptionSet(); - //for(CTypeAssumption ass : globalAssumptions){ - for(CTypeAssumption ass : this.assumptions){ - if(ass.getClassName().equals(classname))assumptions.addElement(ass); - } - return new CopyOfTypeAssumptions(assumptions, classname); - } - - @Override - public String toString(){ - return assumptions.toString(); - } - - public Type getThisValue() { - return new RefType(thisClassName, 0); - } - -} diff --git a/src/typinferenz/assumptions/FieldAssumption.java b/src/typinferenz/assumptions/FieldAssumption.java index 0eb6df619..8e36d20de 100644 --- a/src/typinferenz/assumptions/FieldAssumption.java +++ b/src/typinferenz/assumptions/FieldAssumption.java @@ -23,6 +23,19 @@ public class FieldAssumption extends Assumption { return this.field.getIdentifier(); } + @Override + public String toString(){ + return "FieldAssumption: "+this.field.getType()+" "+this.getIdentifier(); + } + + @Override + public boolean equals(Object obj) { + if(!(obj instanceof FieldAssumption))return false; + FieldAssumption equals = (FieldAssumption)obj; + if(!equals.field.equals(this.field))return false; + if(!equals.parentClass.equals(this.parentClass))return false; + return true; + } } diff --git a/src/typinferenz/assumptions/GenericVarAssumption.java b/src/typinferenz/assumptions/GenericVarAssumption.java new file mode 100644 index 000000000..2cc2a4655 --- /dev/null +++ b/src/typinferenz/assumptions/GenericVarAssumption.java @@ -0,0 +1,24 @@ +package typinferenz.assumptions; + +import mycompiler.mystatement.LocalVarDecl; +import mycompiler.mytype.GenericTypeVar; +import mycompiler.mytype.RefType; +import mycompiler.mytype.Type; + +public class GenericVarAssumption extends Assumption{ + + private GenericTypeVar genericVar; + + public GenericVarAssumption(GenericTypeVar genericVar){ + super(); + this.genericVar = genericVar; + } + + public Type getAssumedType() { + return genericVar;//new RefType(this.getIdentifier(), -1); + } + + public String getIdentifier(){ + return genericVar.getName(); + } +} diff --git a/src/typinferenz/assumptions/LocalVarAssumption.java b/src/typinferenz/assumptions/LocalVarAssumption.java index bde1c70a1..218c9fd26 100644 --- a/src/typinferenz/assumptions/LocalVarAssumption.java +++ b/src/typinferenz/assumptions/LocalVarAssumption.java @@ -6,14 +6,17 @@ import mycompiler.mystatement.LocalVarDecl; public class LocalVarAssumption extends Assumption { private LocalVarDecl localVar; + private Type type; - public LocalVarAssumption(LocalVarDecl localVar){ + public LocalVarAssumption(LocalVarDecl localVar, Type declaredType){ super(localVar); this.localVar = localVar; + this.type = declaredType; } @Override public Type getAssumedType() { - return this.localVar.getDeclType(); + return this.type; } + } diff --git a/src/typinferenz/assumptions/MethodAssumption.java b/src/typinferenz/assumptions/MethodAssumption.java index 4b4c51843..5981d0a1e 100644 --- a/src/typinferenz/assumptions/MethodAssumption.java +++ b/src/typinferenz/assumptions/MethodAssumption.java @@ -1,5 +1,8 @@ package typinferenz.assumptions; +import java.util.Iterator; + +import mycompiler.myclass.FormalParameter; import mycompiler.myclass.Method; import mycompiler.myclass.Class; import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption; @@ -31,14 +34,39 @@ public class MethodAssumption extends FieldAssumption { * @return */ public Type getParameterType(int i) { - return this.method.getParameterList().getParameterAt(i).getType(); + Type ret = this.method.getParameterList().getParameterAt(i).getType(); + return ret; } public Type getParentClassType() { - return new RefType(this.parentClass.getName(),0); + return this.parentClass.getType(); } + public String toString(){ + String ret = "MethodAssumption: "; + ret += this.method.getType().toString()+" "; + ret += this.method.get_Name().toString()+"("; + Iterator it = this.method.parameterlist.formalparameter.iterator(); + while(it.hasNext()){ + FormalParameter fp = it.next(); + ret+=fp.toString(); + if(it.hasNext())ret += ","; + } + ret+=")"; + return ret; + } + @Override + public boolean equals(Object obj){ + if(!(obj instanceof MethodAssumption))return false; + MethodAssumption equals = (MethodAssumption)obj; + if(equals.method==null)return false; + if(equals.parentClass==null)return false; + if(!(equals.method.equals(this.method)))return false; + if(!(equals.parentClass.equals(this.parentClass)))return false; + + return true; + } } diff --git a/src/typinferenz/assumptions/TypeAssumptions.java b/src/typinferenz/assumptions/TypeAssumptions.java index 8dc9562a4..a7e0795d2 100755 --- a/src/typinferenz/assumptions/TypeAssumptions.java +++ b/src/typinferenz/assumptions/TypeAssumptions.java @@ -1,13 +1,17 @@ package typinferenz.assumptions; import java.util.Iterator; + +import mycompiler.IItemWithOffset; +import mycompiler.myclass.Class; + import java.util.Vector; import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.FunN; import typinferenz.FunNInterface; import typinferenz.FunNMethod; -import typinferenz.TypinferenzException; +import typinferenz.exceptions.TypeinferenceException; import mycompiler.mytype.GenericTypeVar; import mycompiler.mytype.RefType; import mycompiler.mytype.Type; @@ -45,10 +49,12 @@ public class TypeAssumptions { private Vector methodAssumptions = new Vector(); + private Vector constructorAssumptions = new Vector(); private Vector fieldAssumptions = new Vector(); private Vector localVarAssumptions = new Vector(); private Vector parameterAssumptions = new Vector(); - + private Vector genericVarAssumptions = new Vector(); + private Vector classAssumptions = new Vector(); /** * Dieser Konstruktor setzt bei der Initialisierung auch den Wert von "this" @@ -63,33 +69,30 @@ public class TypeAssumptions { this.thisClassName = thisClassName; } - public void addMethodAssumption(MethodAssumption mAss){ - this.methodAssumptions.add(mAss); - } - - public void addFieldAssumption(FieldAssumption ass){ - this.fieldAssumptions.add(ass); - } - - public void addLocalVarAssumption(LocalVarAssumption ass){ - this.localVarAssumptions.add(ass); - } - - public void addParameterAssumption(ParameterAssumption ass){ - this.parameterAssumptions.add(ass); - } - /** * Liefert alle bekannten öffentlichen Feldern mit dem Namen withName. Dabei werden alle bekannten Klassen durchsucht. * @param withName * @return */ public Vector getFieldVars(String withName){ - //TODO: Implementieren - return null; + Vector ret = new Vector(); + for(FieldAssumption fa : this.fieldAssumptions){ + if(fa.getIdentifier().equals(withName))ret.add(fa); + } + return ret; } + /** + * Liefert den Typ einer Feldvariable der Klasse inClass + * @param withName + * @param inClass + * @return null, falls die Klasse kein zugängliches Feld enthält + */ public Type getTypeOfFieldVar(String withName, Class inClass){ + for(FieldAssumption fa : this.getFieldVars(withName)){ + if(fa.getParentClass().equals(inClass))return fa.getAssumedType(); + } + //throw new TypeinferenceException("Das Feld "+withName+" ist in der Klasse "+inClass.getName()+" nicht vorhanden."); return null; } @@ -98,8 +101,10 @@ public class TypeAssumptions { * @param withName * @return */ - public Vector getMethods(String withName){ - return null; + @Deprecated + public Vector getMethods2(String withName){ + //TODO: Implementieren + return new Vector(); } /** @@ -107,7 +112,9 @@ public class TypeAssumptions { * @param withName * @return */ - public Type getTypeOfLocalVar(String withName){ + @Deprecated + public Type getTypeOfLocalVar2(String withName){ + //TODO: Implementieren return null; } @@ -119,24 +126,27 @@ public class TypeAssumptions { /** * Sucht nach Assumptions zu einer Methode mit dem Namen methodName und parameterCount Parametern. * @param methodName - * @param parameterCount Anzahl der Parameter der gesuchten Methoden-Assumption - * @return + * @param parameter Die Parameter, welche die Methode verarbeiten soll + * @return Alle Methoden in den Assumptions, welche eine Parameterliste der Länge der übergebenen Parameterliste (parameter) verarbeiten können. */ - public Vector getMethodAssumptions(String methodName, int parameterCount){ + public Vector getMethodAssumptions(String methodName, Vector parameter){ + int parameterCount = parameter.size(); Vector ret = new Vector(); for(MethodAssumption ass : this.methodAssumptions){ if(ass.getMethodName().equals(methodName) && ass.getParaCount() == parameterCount){ + ret.add(ass); } } + //TODO: Dieser Teil mit der Generierung von FunN-Methoden kann raus, da die FunNInterfaces sich in den Basic-Assumptions befinden sollten. //Falls es sich um die apply-Methode eines FunN-Interface handelt: - if(methodName.equals("apply")){ //Ein Workaround für den Typinferenzalgorithmus TODO: Das hier rausnehmen. + //if(methodName.equals("apply")){ //Ein Workaround für den Typinferenzalgorithmus TODO: Das hier rausnehmen. //CMethodTypeAssumption funNAssumption = new FunN(parameterCount).toCMethodTypeAssumption(); - MethodAssumption funNAssumption = new MethodAssumption(new FunNMethod(parameterCount), new FunNInterface()); - ret.add(funNAssumption); - } - if(ret.size()==0)throw new TypinferenzException("Eine Methode "+methodName+" ist in den Assumptions nicht vorhanden"); + // MethodAssumption funNAssumption = new MethodAssumption(new FunNMethod(parameterCount), new FunNInterface(parameter)); + // ret.add(funNAssumption); + //} + //if(ret.size()==0)throw new TypeinferenceException("Eine Methode "+methodName+" ist in den Assumptions nicht vorhanden"); return ret; } @@ -145,9 +155,10 @@ public class TypeAssumptions { * Durchsucht die Assumptions des aktuellen Gültigkeitsbereichs (lokale Variablen und Felder der aktuellen Klasse) nach einem Eintrag für den übergebenen Variablennamen. * In den Assumptions wird dann in der Reihenfolge LocalVarAssumptions, FieldAssumption nach dem übergebenen Variablennamen gesucht. * @param variableName - der Identifier der gesuchten Variablen - * @return - Der Typ für diesen Identifier. + * @param inScope - Sucht auch die Felder der übergebenen Klasse ab. Hier kann auch null übergeben werden, dann werden nur die Lokalen Variablen dieser TypeAssumption durchsucht. + * @return - Der Typ für diesen Identifier, oder null, falls kein Typ vorliegt. */ - public Type getVarType(String variableName){ + public Type getVarType(String variableName, Class inScope){ //Zuerst die Parameter durchsuchen for(ParameterAssumption ass : this.parameterAssumptions){//this.getParameterAssumptions(null)){ if(ass.getIdentifier().equals(variableName))return ass.getAssumedType(); @@ -156,15 +167,20 @@ public class TypeAssumptions { for(LocalVarAssumption ass : this.localVarAssumptions){ if(ass.getIdentifier().equals(variableName))return ass.getAssumedType(); } - + //Ebenso wie die Generischen Variablen: + for(GenericVarAssumption ass : this.genericVarAssumptions){ + + } + //und zuletzt die Felder der Klasse in dessen Namensraum sich dieses AssumptionSet befindet. - if(this.thisClassName!=null){ - for(FieldAssumption ass : this.getAssumptionsFor(this.thisClassName)){ + if(inScope!=null){ + for(FieldAssumption ass : this.getAssumptionsFor(inScope.getName())){ if(ass.getIdentifier().equals(variableName) && ass instanceof FieldAssumption)return ass.getAssumedType(); } } //Wird keine Assumption gefunden, muss ein Fehler vorliegen: - throw new TypinferenzException("Eine Variable "+variableName+" ist in den Assumptions nicht vorhanden"); + //throw new TypeinferenceException("Eine Variable "+variableName+" ist in den Assumptions nicht vorhanden"); + return null; } /** @@ -207,18 +223,46 @@ public class TypeAssumptions { for(Assumption f : this.methodAssumptions)ret.add(f); for(Assumption f : this.fieldAssumptions)ret.add(f); for(Assumption f : this.parameterAssumptions)ret.add(f); + for(Assumption f : this.constructorAssumptions)ret.add(f); + for(Assumption f : this.genericVarAssumptions)ret.add(f); return ret; } - public TypeAssumptions add(TypeAssumptions assumptions){ - this.methodAssumptions.addAll(assumptions.methodAssumptions); - this.fieldAssumptions.addAll(assumptions.fieldAssumptions); - this.localVarAssumptions.addAll(assumptions.localVarAssumptions); - this.parameterAssumptions.addAll(assumptions.parameterAssumptions); + public void addAssumption(Assumption ass){ + if(ass instanceof ConstructorAssumption){ + if(!this.constructorAssumptions.contains(ass))this.constructorAssumptions.add((ConstructorAssumption)ass);//this.constructorAssumptions.add((ConstructorAssumption)ass); + return; + } + if(ass instanceof MethodAssumption){ + if(!this.methodAssumptions.contains(ass))this.methodAssumptions.add((MethodAssumption)ass);//this.methodAssumptions.add((MethodAssumption)ass);// + return; + } + if(ass instanceof LocalVarAssumption)if(!this.localVarAssumptions.contains(ass))this.localVarAssumptions.add((LocalVarAssumption)ass);//this.localVarAssumptions.add((LocalVarAssumption)ass);// + if(ass instanceof ParameterAssumption)if(!this.parameterAssumptions.contains(ass))this.parameterAssumptions.add((ParameterAssumption)ass);//this.parameterAssumptions.add((ParameterAssumption)ass); + if(ass instanceof FieldAssumption)if(!this.fieldAssumptions.contains(ass))this.fieldAssumptions.add((FieldAssumption)ass);//this.fieldAssumptions.add((FieldAssumption)ass); + if(ass instanceof GenericVarAssumption)if(!this.genericVarAssumptions.contains(ass))this.genericVarAssumptions.add((GenericVarAssumption)ass); - return this; } + private void addAllAssumptions(Vector assumptions){ + for(Assumption ass : assumptions){ + this.addAssumption(ass); + } + } + + public TypeAssumptions add(TypeAssumptions assumptions){ + //for(MethodAssumption ass : assumptions.methodAssumptions){ + // if(!this.methodAssumptions.contains(ass))this.methodAssumptions.add(ass); + //} + //this.methodAssumptions.addAll(assumptions.methodAssumptions); + //this.fieldAssumptions.addAll(assumptions.fieldAssumptions); + //this.localVarAssumptions.addAll(assumptions.localVarAssumptions); + //this.parameterAssumptions.addAll(assumptions.parameterAssumptions); + //this.constructorAssumptions.addAll(assumptions.constructorAssumptions); + this.addAllAssumptions(assumptions.getAllAssumptions()); + this.classAssumptions.addAll(assumptions.classAssumptions); + return this; + } @Override @@ -232,17 +276,97 @@ public class TypeAssumptions { @Override public String toString(){ - String ret = "this: "+this.thisClassName; + String ret = "this: "+this.thisClassName+"\n"; ret += "Method Assumptions:\n" + this.methodAssumptions.toString() + "\n"; ret += "FieldVar Assumptions:\n" + this.fieldAssumptions.toString() + "\n"; ret += "LocalVar Assumptions:\n" + this.localVarAssumptions.toString() + "\n"; ret += "Parameter Assumptions:\n" + this.parameterAssumptions.toString() + "\n"; + ret += "Generic Var Assumptions:\n" + this.genericVarAssumptions.toString() + "\n"; + ret += "Konstruktor Assumptions:\n" + this.constructorAssumptions.toString() + "\n"; + ret += "Class Assumptions:\n" + this.classAssumptions.toString() + "\n"; //return assumptions.toString(); return ret; } - public Type getThisValue() { - return new RefType(thisClassName, 0); + + /** + * Kontrolliert den vom Parser gesetzten Typ. + * Erweitert dessen Bezeichnung, wenn nötig. + * @param t + * @return null, falls der Typ nicht vorhanden ist. + */ + public Type getTypeFor(Type t){ + + if(t instanceof TypePlaceholder) + return t; //Handelt es sich um einen TypePlaceholder kann dieser nicht in den Assumptions vorkommen. + + //Alle bekannten Klassen nach diesem Typ durchsuchen: + String typName = t.getName(); + String[] names = typName.split("[.]"); + for(ClassAssumption ass : this.classAssumptions){ + String name = ass.getAssumedClass().getName(); //Das kann auch java.util.Vector sein + String[] assNames = name.split("[.]"); + boolean match = true; + if(names.length == 1){ + match = names[0].equals(assNames[assNames.length-1]); + }else if(names.length == 0 || names.length != assNames.length){ + match = false; + }else for(int i = names.length-1; i>-1;i--){ + if(!names[i].equals(assNames[i]))match = false; + } + if(match && t instanceof RefType){ + RefType tr = (RefType)t; + RefType ret = ass.getAssumedClass().getType(); //Dadurch erhält der RefType den vollen Namen (bsp. java.lang.Integer) + ret.set_ParaList(tr.get_ParaList()); + return ret; + } + } + //Auch die generischen Variablen durchsuchen: + for(GenericVarAssumption ass : this.genericVarAssumptions){ + if(ass.getIdentifier().equals(t.getName()))return ass.getAssumedType(); + } + + return null; } - + + /** + * Fügt eine TypAssumption an. + * Dadurch wird ein Pool von Typen aufgebaut, welche überhaupt erlaubt sind. + * Wird genutzt um vom Parser eingelesene Typen auf ihre Korrektheit zu kontrollieren. + * @param classAssumption + */ + public void addClassAssumption(ClassAssumption classAssumption) { + if(!this.classAssumptions.contains(classAssumption))//throw new TypinferenzException("Die Klasse "+classAssumption.getAssumedClass().getName()+" wurde bereits deklariert"); + this.classAssumptions.add(classAssumption); + } + + /** + * + * @param name + * @param size + * @return Null, falls kein Konstruktor vorhanden. + */ + public ConstructorAssumption getConstructorAssumption(String name, int size) { + for(ConstructorAssumption ca : this.constructorAssumptions){ + if(ca.getParaCount()==size && ca.getIdentifier().equals(name))return ca; + } + return null; + } + + public void addGenericVarAssumption( + GenericTypeVar genericTypeVar) { + this.genericVarAssumptions.add(new GenericVarAssumption(genericTypeVar)); + } + + /** + * Prüft einen Typ auf das vorhandensein in den BasicAssumptions. + * Dabei werden alle Konstruktoren nach diesem Typ durchsucht. Denn jede Klasse hat einen Konstruktor und der muss in den TypeAssumptions vorhanden sein. + * @param t + * @return + + public Type validateType(Type t){ + return null; + } + */ } + diff --git a/src/typinferenz/exceptions/DebugException.java b/src/typinferenz/exceptions/DebugException.java new file mode 100644 index 000000000..2043320aa --- /dev/null +++ b/src/typinferenz/exceptions/DebugException.java @@ -0,0 +1,8 @@ +package typinferenz.exceptions; + +public class DebugException extends RuntimeException { + + public DebugException(String message) { + System.err.print(message); + } +} diff --git a/src/typinferenz/exceptions/ParserError.java b/src/typinferenz/exceptions/ParserError.java new file mode 100644 index 000000000..02105ba51 --- /dev/null +++ b/src/typinferenz/exceptions/ParserError.java @@ -0,0 +1,11 @@ +package typinferenz.exceptions; + +import mycompiler.myparser.JavaParser.yyException; + + +public class ParserError extends TypeinferenceException{ + + public ParserError(yyException exc){ + super(exc.getMessage(), exc.token.getOffset()); + } +} diff --git a/src/typinferenz/exceptions/TypeinferenceException.java b/src/typinferenz/exceptions/TypeinferenceException.java new file mode 100755 index 000000000..ef5d6c6fa --- /dev/null +++ b/src/typinferenz/exceptions/TypeinferenceException.java @@ -0,0 +1,44 @@ +package typinferenz.exceptions; + +import mycompiler.IItemWithOffset; + +/** + * Eine RuntimeException, welche bei einem Fehler während des Typinferenzalgorithmus ausgelöst wird. + * Dies wird zum Beispiel durch Programmierfehler in der Java-Eingabedatei ausgelöst. + * @author Andreas Stadelmeier, a10023 + * + */ +//TODO: Diese Klasse muss von Exception erben +public class TypeinferenceException extends RuntimeException { + + /** + * Das Offset im Quelltext bei dem das Problem aufgetaucht ist + */ + private int offset; + private String message; + + public TypeinferenceException(String message, IItemWithOffset problemSource) + { + super(message); + this.message=message; + this.offset=problemSource.getOffset(); + } + + public TypeinferenceException(String message, int offset){ + this.message=message; + this.offset = offset; + } + + /** + * + * @return Der Offset an dem im Quellcode der Fehler aufgetreten ist. + */ + public int getOffset(){ + return offset; + } + + public String getMessage(){ + return this.message; + } + +} diff --git a/src/typinferenz/typedeployment/TypeInsertPoint.java b/src/typinferenz/typedeployment/TypeInsertPoint.java new file mode 100644 index 000000000..33741cd9a --- /dev/null +++ b/src/typinferenz/typedeployment/TypeInsertPoint.java @@ -0,0 +1,123 @@ +package typinferenz.typedeployment; + +import java.util.Vector; + +import typinferenz.JavaCodeResult; +import typinferenz.ResultSet; +import typinferenz.TypeInsertable; +import typinferenz.exceptions.DebugException; +import mycompiler.myclass.*; +import mycompiler.myclass.Class; +import mycompiler.IItemWithOffset; +import mycompiler.SyntaxTreeNode; +import mycompiler.mytype.*; +import mycompiler.mytypereconstruction.replacementlistener.ITypeReplacementListener; + +/** + * Stellt eine Einsetzungsmöglichkeit für einen Typ an einem (Typeable)Punkt im Syntaxbaum dar. + * Mehrere TypeInsertPoint's werden in einem TypInsertSet zusammengefasst. + * @author janulrich + * + */ +public class TypeInsertPoint implements Comparable{ + + public TypeInsertable point; + public Type type; + public ResultSet resultSet; + + /** + * Dieser Konstruktor erstellt einen TypInsertPoint + * @param insertPoint + * @param insertType + * @param resultSet + * @param generics - die generischen Parameter des einzusetzenden Typs + */ + public TypeInsertPoint(TypeInsertable insertPoint, Type insertType, ResultSet resultSet){ + this.point = insertPoint; + this.type = insertType; + this.resultSet = resultSet; + } + + /** + * Setzt den Typ dieses TypeInsertPoint in den übergebenen Quelltext ein. + * @param fileContent - der Quelltext + * @param additionalOffset - Falls mehrere Typen in einen Quellcode eingesetzet werden muss die Verschiebung der Offsets mit einbezogen werden. + * @return + */ + public JavaCodeResult insertType(String fileContent, int additionalOffset) { + String anfang = fileContent.substring(0, this.getInsertNode().getOffset()+additionalOffset); + JavaCodeResult mitte = this.getTypeInsertString(); + String ende = fileContent.substring(this.getInsertNode().getOffset()+additionalOffset); + return new JavaCodeResult(anfang).attach(mitte).attach(ende); + } + + public int getInsertLength() { + return this.getTypeInsertString().toString().length(); + } + + public Vector getUnresolvedTPH(){ + Vector ret = new Vector(); + ret.addAll(this.getInsertType().getUnresolvedTPH(resultSet)); + return ret; + } + + /** + * + * @return Der Offset des TypeInsertPoints in dem geparsten Source für dessen Klasse er erstellt wurde. + */ + public int getOffset(){ + return this.getInsertNode().getOffset(); + } + + protected Type getInsertType(){ + return this.type; + } + + /** + * Die Zeichenkette die durch diesen TypeInsertPoint eingesetzt wird. (Der Typ als String) + * @return + */ + public JavaCodeResult getTypeInsertString(){ + JavaCodeResult ret = this.getInsertType().printJavaCode(this.resultSet).attach(" "); + return ret; + } + + /** + * @return - Der Punkt (Knoten) im Syntaxbaum, für den dieser TypeInsertPoint gilt. + */ + public IItemWithOffset getInsertNode(){ + return this.point; + } + + @Override + public boolean equals(Object obj){ + if(! (obj instanceof TypeInsertPoint))return false; + TypeInsertPoint equals = (TypeInsertPoint) obj; + if(!(equals.getInsertNode().equals(this.getInsertNode())))return false; + if(!(equals.resultSet.equals(this.resultSet)))return false; //ResultSet spielt bei Equals keine Rolle + if(!(equals.getInsertType().equals(this.getInsertType())))return false; + + return true; + } + + @Override + public int compareTo(TypeInsertPoint arg0) { + return new Integer(this.getOffset()).compareTo(new Integer(arg0.getOffset())); + } + + public ResultSet getResultSet() { + return resultSet; + } + + public TypeInsertable getGenericTypeVarInsertNode() { + SyntaxTreeNode ret = (SyntaxTreeNode)this.point; + while(!(ret instanceof Field || ret instanceof Class)){ + ret = ret.getParent(); + if(ret == null){ + throw new DebugException(this.getInsertNode().toString()+" hat kein Feld oder Klasse als Elternelement"); + } + } + return (TypeInsertable) ret; + } + +} diff --git a/src/typinferenz/typedeployment/TypeInsertSet.java b/src/typinferenz/typedeployment/TypeInsertSet.java new file mode 100644 index 000000000..91e30e65d --- /dev/null +++ b/src/typinferenz/typedeployment/TypeInsertSet.java @@ -0,0 +1,228 @@ +package typinferenz.typedeployment; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Vector; + +import typinferenz.GenericTypeInsertPoint; +import typinferenz.JavaCodeResult; +import typinferenz.ResultSet; +import typinferenz.TypeInsertable; +import mycompiler.IItemWithOffset; +import mycompiler.SyntaxTreeNode; +import mycompiler.mytype.GenericTypeVar; +import mycompiler.mytype.Pair; +import mycompiler.mytype.RefType; +import mycompiler.mytype.TypePlaceholder; + +/* + * Der Plan: + * SyntaxTreeNode generiert die TypeInsertPoints. + * Beim Einsetzen eines TIP werden die ebenfalls von den SyntaxTreeNodes berechneten GenericInsertPoints durchsucht nach den Punkten + * die mit dem einzusetzenden TIP zusammenhängen. + * Das funktioniert mithilfe des ResultSets. Denn es müssen alle Constraints mit einbezogen werden, da der Unify + * Algorithmus als Ergebnis nur die zu einem RefType aufgelösten TPHs ausgibt. + */ +/** + * Bündelt ein Set von TypeInsertPoints, die alle zu einem TypePlaceholder gehören. + * Diese müssen gemeinsam eingesetzt werden. + * Das TypeInsertSet löst zudem Abhängigkeiten auf. Wird eine Generische Variable eingesetzt, + * müssen alle mit ihr in Verbindung stehenden Typen ebenfalls eingesetzt werden. + * TODO: Es müssen eigentlich nur die generischen Variablendeklarationen eingesetzt werden. + * TODO: Einsetzen von generischen Variablen in eine bereits vorhanden Parameterliste funktioniert nicht. + * @author janulrich + * + */ +public class TypeInsertSet { + + public Vector points = new Vector(); + private Vector genericTypeInsertPoints = new Vector(); + private ResultSet resultSet; + + public TypeInsertSet(ResultSet resultSet) { + this.resultSet = resultSet; + } + + /** + * Fügt einen TypeInsertPoint dem TypeInsertSet hinzu. + * @param typeInsertPoint + * @return + */ + public void add(TypeInsertPoint typeInsertPoint) { + if( typeInsertPoint!=null && ! this.points.contains(typeInsertPoint)){ //Nur falls typeInsertPoint noch nicht im Set vorhanden ist: + points.add(typeInsertPoint); + } + } + + public void add(GenericTypeInsertPoint typeInsertPoint) { + //this.add((TypeInsertPoint)typeInsertPoint); + if(!this.genericTypeInsertPoints.contains(typeInsertPoint))this.genericTypeInsertPoints.add(typeInsertPoint); + } + + /** + * Fügt nur einen einzelnen TypeInsertPoint in fileContent ein. + * @param tip + * @param fileContent + * @return + */ + public String insertType(TypeInsertPoint tip, String fileContent){ + TypePatchJob tpj = new TypePatchJob(); + int additionalOffset = 0; + String ret = fileContent; + JavaCodeResult unresolvedTPHs = tip.insertType(ret, additionalOffset); + for(TypePlaceholder tph : unresolvedTPHs.getUnresolvedTPH()){ + GenericTypeInsertPoint genericTIP = new GenericTypeInsertPoint(tip.getGenericTypeVarInsertNode(),tph,tip.getResultSet()); + tpj.add(genericTIP); + } + tpj.add(tip); + + return tpj.run(fileContent); + } + + /** + * Fügt einen einzelnen TypeInsertPoint einem TypePatchJob hinzu + * @param tip + * @param tpj + */ + public void insertType(TypeInsertPoint tip, TypePatchJob tpj){ + for(GenericTypeInsertPoint gip : this.genericTypeInsertPoints){ + if(gip.associatedWith(tip, this.resultSet)){ + tpj.add(gip); + } + } + tpj.add(tip); + } + + + + /** + * Fügt alle Typen dieses TypeInsertSets in den übergebenen Quellcode ein + * @param fileContent + * @return + */ + public String insertAllTypes(String fileContent) { + //TODO: Das hier kann nicht funktionieren. Nach jedem einsetzen eines TIP muss momentan neu geparst werden + TypePatchJob tpj = new TypePatchJob(); + for(TypeInsertPoint tip : this.points){ + this.insertType(tip, tpj); + } + return tpj.run(fileContent); + /* + int additionalOffset = 0; + String ret = fileContent; + + + Vector mergedPoints = new Vector(); + //GenericTypeInsertPoints mergen und dem TypeInsertSet anfügen: + for(GenericTypeInsertPoint p : this.genericTypeInsertPoints){ + GenericTypeInsertPoint mergePoint = null; + for(GenericTypeInsertPoint mp : mergedPoints){ + if(mp.getOffset() == p.getOffset())mergePoint = mp; + } + if(mergePoint == null){ + mergedPoints.add(p); + }else{ + mergePoint.merge(p); + } + } + for(TypeInsertPoint mp : mergedPoints){ + this.add(mp); + } + + //Anschließend sortieren (nach dem Offset der InsertPoints): + Collections.sort(points); + + for(TypeInsertPoint p : points){ + //Zuerst den Typ einsetzen + JavaCodeResult insertCode = p.insertType(ret, additionalOffset); + ret = insertCode.toString(); + //Dann Additional Offset korrigieren: + additionalOffset += p.getInsertLength(); + } + return ret; + */ + } + + /** + * + * @param node + * @return - null, falls kein InsertPoint für node vorhanden. + */ + public TypeInsertPoint getInsertPointFor(TypeInsertable node){ + for(TypeInsertPoint point : points){ + if(point.getInsertNode().equals(node))return point; + } + return null; + } + + @Override + public boolean equals(Object obj){ + if(! (obj instanceof TypeInsertSet))return false; + TypeInsertSet equals = (TypeInsertSet) obj; + if(points.size()!=equals.points.size())return false; + + for(TypeInsertPoint point : points){ + //Jeder TypeInsertPoint muss auch in equals vorkommen: + if(!equals.points.contains(point)) + return false; + //... aber nicht öfter als 1x : + if(equals.points.lastIndexOf(point)!=equals.points.indexOf(point))return false; + } + for(GenericTypeInsertPoint point : this.genericTypeInsertPoints){ + //Jeder TypeInsertPoint muss auch in equals vorkommen: + if(!equals.genericTypeInsertPoints.contains(point))return false; + //... aber nicht öfter als 1x : + if(equals.genericTypeInsertPoints.lastIndexOf(point)!=equals.genericTypeInsertPoints.indexOf(point))return false; + } + return true; + } + + /** + * Fügt TypeInsertPoints an + * @param insertPoints + */ + public void add(Vector insertPoints) { + for(TypeInsertPoint p : insertPoints){ + this.add(p); + } + } + + /** + * Durchsucht alle bisher angefügten TypeInsertPoints nach nicht aufgelösten TypePlaceholdern. + * Diese sollten als Generische Variablen eingesetzt werden. + * TODO: Es dürfen nur die TypePlaceholder zurückgegeben werden, welche noch in keinem GenericVarTypeInsertPoint verwendet wurden. + * @return + */ + public Vector getUnresolvedTPHs(){ + Vector ret = new Vector(); + for(TypeInsertPoint p : this.points){ + ret.addAll(p.getUnresolvedTPH()); + } + return ret; + } + +} + +/** + * Stellt eine Reihe von TypeInsertions dar + */ +class TypePatchJob{ + private Vector points = new Vector<>(); + void add(TypeInsertPoint tip){ + points.add(tip); + } + String run(String fileContent){ + //sortieren (nach dem Offset der InsertPoints): + Collections.sort(points); + int additionalOffset = 0; + for(TypeInsertPoint p : points){ + //Zuerst den Typ einsetzen + JavaCodeResult insertCode = p.insertType(fileContent, additionalOffset); + fileContent = insertCode.toString(); + //Dann Additional Offset korrigieren: + additionalOffset += p.getInsertLength(); + } + return fileContent; + } +} diff --git a/src/userinterface/ConsoleInterface.java b/src/userinterface/ConsoleInterface.java index 045f95321..b009508d1 100755 --- a/src/userinterface/ConsoleInterface.java +++ b/src/userinterface/ConsoleInterface.java @@ -8,7 +8,8 @@ import java.util.Vector; import mycompiler.MyCompiler; import mycompiler.MyCompilerAPI; import mycompiler.mytypereconstruction.TypeinferenceResultSet; -import typinferenz.TypinferenzException; +import typinferenz.exceptions.TypeinferenceException; + import java.util.*; import org.apache.log4j.Logger; @@ -44,7 +45,7 @@ public class ConsoleInterface { ///////////////////////// try{ resultSet = compiler.typeReconstruction(); - }catch(TypinferenzException texc){ + }catch(TypeinferenceException texc){ texc.printStackTrace(); fail("Fehler bei Typinferenzalgorithmus. Message: "+texc.getMessage()); } diff --git a/test/bytecode/BytecodeTester.java b/test/bytecode/BytecodeTester.java new file mode 100644 index 000000000..db64d3d87 --- /dev/null +++ b/test/bytecode/BytecodeTester.java @@ -0,0 +1,45 @@ +package bytecode; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Vector; + +import junit.framework.TestCase; +import mycompiler.MyCompiler; +import mycompiler.MyCompilerAPI; +import mycompiler.mybytecode.ClassFile; +import mycompiler.myexception.JVMCodeException; + +public class BytecodeTester{ + + //Web-Disassembler: http://hakurai.github.io/javap.js/web/ + + public static final String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; + + public static Vector testCodegen(String sourceCode){ + MyCompilerAPI compiler = MyCompiler.getAPI(); + compiler.parse(sourceCode); + Vector ret = null; + try { + ret = compiler.codeGeneration(null); + } catch (NullPointerException | JVMCodeException e) { + e.printStackTrace(); + TestCase.fail(); + } + TestCase.assertTrue("Es wurden keine ClassFiles generiert",ret != null && ret.size()>0); + return ret; + } + + public static Vector readFileAndTestCodegen(String fileName) throws IOException{ + return testCodegen(getFileContent(rootDirectory + fileName)); + } + + private static String getFileContent(String path)throws IOException + { + byte[] encoded = Files.readAllBytes(Paths.get(path)); + return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(encoded)).toString(); + } +} diff --git a/test/bytecode/EmptyClassTest.java b/test/bytecode/EmptyClassTest.java new file mode 100644 index 000000000..471640ef5 --- /dev/null +++ b/test/bytecode/EmptyClassTest.java @@ -0,0 +1,20 @@ +package bytecode; + +import java.util.Vector; + +import junit.framework.TestCase; +import mycompiler.MyCompiler; +import mycompiler.MyCompilerAPI; +import mycompiler.myexception.JVMCodeException; +import mycompiler.mytypereconstruction.TypeinferenceResultSet; + +import org.junit.Test; + +public class EmptyClassTest extends TestCase { + + @Test + public void test(){ + BytecodeTester.testCodegen("class EmptyClass{}"); + } + +} diff --git a/test/bytecode/FieldTest.jav b/test/bytecode/FieldTest.jav new file mode 100644 index 000000000..57f1614ab --- /dev/null +++ b/test/bytecode/FieldTest.jav @@ -0,0 +1,6 @@ +class FieldTest{ + String var; + String methode(String para1){ + return var; + } +} \ No newline at end of file diff --git a/test/bytecode/GeneralTest.java b/test/bytecode/GeneralTest.java new file mode 100644 index 000000000..816ecfbf6 --- /dev/null +++ b/test/bytecode/GeneralTest.java @@ -0,0 +1,35 @@ +package bytecode; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Vector; + +import junit.framework.TestCase; + +import org.junit.Test; + +import sun.misc.IOUtils; +import mycompiler.mybytecode.ClassFile; + +public class GeneralTest extends TestCase{ + @Test + public void test(){ + Vector cfs = null; + try { + cfs = BytecodeTester.readFileAndTestCodegen("FieldTest.jav"); + } catch (IOException e) { + e.printStackTrace(); + fail(); + } + assertTrue("Es darf nur eine ClassFile erstellt werden", cfs.size()==1); + try { + FileOutputStream output = new FileOutputStream(new File(BytecodeTester.rootDirectory+"FieldTest.class")); + output.write(cfs.firstElement().getBytecode()); + } catch (IOException e) { + e.printStackTrace(); + fail(); + } + } + +} diff --git a/test/bytecode/MethodTest.java b/test/bytecode/MethodTest.java new file mode 100644 index 000000000..6df9d4199 --- /dev/null +++ b/test/bytecode/MethodTest.java @@ -0,0 +1,12 @@ +package bytecode; + +import org.junit.Test; + +public class MethodTest { + + @Test + public void test(){ + BytecodeTester.testCodegen("class MethodTest{ public void method(){} }"); + } + +} diff --git a/test/mycompiler/test/AbstractInferenceTest.java b/test/mycompiler/test/AbstractInferenceTest.java deleted file mode 100755 index acba625c0..000000000 --- a/test/mycompiler/test/AbstractInferenceTest.java +++ /dev/null @@ -1,446 +0,0 @@ -package mycompiler.test; - -import java.io.File; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Vector; - -import junit.framework.TestCase; -import mycompiler.MyCompiler; -import mycompiler.MyCompilerAPI; -import mycompiler.mytype.BoundedGenericTypeVar; -import mycompiler.mytype.GenericTypeVar; -import mycompiler.mytype.RefType; -import mycompiler.mytype.Type; -import mycompiler.mytype.TypePlaceholder; -import mycompiler.mytypereconstruction.CIntersectionType; -import mycompiler.mytypereconstruction.CSubstitution; -import mycompiler.mytypereconstruction.TypeinferenceResultSet; -import mycompiler.mytypereconstruction.typeassumption.CInstVarTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CLocalVarTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CMethodTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption; -import mycompiler.mytypereconstruction.typeassumptionkey.CMethodKey; -import mycompiler.test.expectationTypes.BlockExpect; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.GenericTypeVarExpect; -import mycompiler.test.expectationTypes.IExpectation; -import mycompiler.test.expectationTypes.IUnknownTypeExpect; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.TypePlaceholderExpect; -import mycompiler.test.expectationTypes.VarExpect; - -import org.apache.log4j.Logger; - -/** Todo: - * - exception handling cannot verify correct exception yet - * - * done: - exception handling - * - commented asserts - * - log4j - * - cmethodkey usage - * - Typeplaceholder support - * @author - * last change: 26-05-08 - */ -public abstract class AbstractInferenceTest extends TestCase { - - private static Logger testlog = Logger.getLogger("funcTest"); - private File javFile=null; - private Expectation expectation=null; - private MyCompilerAPI compiler = MyCompiler.getAPI(); - - protected AbstractInferenceTest(String name, String javFilename) { - super(name); - - javFile = new File(javFilename); - - //retrieve Expectation object from specific Testcase for comparisons - this.expectation = getExpectations(); - } - - /** - * runs the JUnit-Test, calls all compiler steps - * @throws Throwable - */ - public void testSetup() throws Throwable { - //runs all compiler steps, any exception will cause the Test to fail, if not expected - - //enable Logging - Log4jWrapper.getInstance().configureLog4j(); - - try { - testlog.info("Parsing..."); - parseFile(); - testlog.info("Type reconstruction..."); - typeReconstruction(); - testlog.info("Code generation..."); - codeGeneration(); - //checks whether there is an expected exception that has not been thrown - AbstractInferenceTest.assertTrue("exception expected but not found",this.expectation.getExceptions().isEmpty()); - } catch (Exception e) { - testlog.info("Error during compiler step: " + e); - checkForExpectedException(e); - - } - } - - /** - * calls parse() from Compiler-API - * @throws Throwable - */ - - protected void parseFile() - throws Throwable - { - // Parse file - compiler.parse(javFile); - } - - /** - * calls typeReconstruction() from Compiler-API, checks result against expectations and substitutes all types according to first assumption - * @throws Exception - */ - - protected void typeReconstruction() - throws Exception - { - // Typ-Rekonstruktion - Vector resultSet = compiler.typeReconstruction(); - testlog.info("Type reconstruction completed..."); - // Keine Typ-Rekonstruktion erforderlich - if (resultSet == null || resultSet.size() == 0) throw new Exception("Type reconstruction could not be done!"); - - if (this.expectation!=null) { - if(this.expectation.getClasses()!=null) - checkResults(resultSet,this.expectation); - } - else - testlog.info("An Error has occurred receiving the expectations for this testcase: "+ this.javFile); - - TypeinferenceResultSet onePossibility = resultSet.firstElement(); - Iterator substIt = onePossibility.getSubstitutions().getIterator(); - while(substIt.hasNext()){ - CSubstitution subst = (CSubstitution)substIt.next(); - // Substition machen - subst.execute(); - } - } - - /** - * calls codeGeneration from Compiler-API - * @throws Exception - */ - - protected void codeGeneration() - throws Exception - { - // Code generieren - compiler.codeGeneration(); - } - - /** - * compares resultSet from compiler to expectations - * @param resultSet - * @param expect - */ - - protected void checkResults(Vector resultSet, Expectation expect) { - - //iterates thru all available assumption-sets - testlog.info("Starting checking for valid type assumptions..."); - for (int resIndex=0; resIndex < resultSet.size(); resIndex++) { - //checks whether all expected classes, methods, members are available - checkClasses(resultSet.get(resIndex),expect); - //-------------- - //Methods - //-------------- - //iterates through all found methods - for (CIntersectionType vecAssumpt : resultSet.get(resIndex).getMethodIntersectionTypes().values()) { - //for (int i=0; i iter2 = resultSet.get(resIndex).getFieldAndLocalVarAssumptions().values().iterator(); - //while (iter2.hasNext()) { - //CTypeAssumption assumption = iter2.next(); - for (CTypeAssumption assumption : resultSet.get(resIndex).getFieldAndLocalVarAssumptions().values()) { - // local variable - if (assumption instanceof CLocalVarTypeAssumption) { - - CLocalVarTypeAssumption assu = (CLocalVarTypeAssumption)assumption; - if (expect.getClasses().containsKey(assu.getClassName())){ - //current method to compare assumption to: - MethodExpect method = expect.getClasses().get(assu.getClassName()).getMethods().get(new CMethodKey(assu.getClassName(),assu.getMethodName(),assu.getMethodParaCount(),assu.getMethodOverloadedID())); - testlog.debug("assumption: local variable '"+assu.getIdentifier()+"' of '"+assu.getClassName()+":"+assu.getMethodName()+"'"); - testlog.debug("searching in: '"+method.getName()+"'"); - AbstractInferenceTest.assertTrue("block variable '" + assu.getIdentifier() + "' in '" + assu.getMethodName()+ "' not valid or not found!",checkFoundVariable(assu, method.getBlock())); - } - - } - - // member variable - else if (assumption instanceof CInstVarTypeAssumption) { - - CInstVarTypeAssumption assu = (CInstVarTypeAssumption)assumption; - if (expect.getClasses().containsKey(assu.getClassName())){ - //current class to compare assumption to: - ClassExpect classexpect = expect.getClasses().get(assu.getClassName()); - testlog.debug("assumption: member variable '"+assu.getIdentifier()+"' of '"+assu.getClassName()+"'"); - testlog.debug("searching in: '"+classexpect.getName()+"'"); - checkFoundMembers(assu, classexpect.getMembers()); - } - } - } - } - - //verify that every single type assumption that was expected has been detected by the compiler - testlog.info("verifying all expectations have been met"); - AbstractInferenceTest.assertTrue("not all expected types have been found", expectation.verifyTypeExpectationsCompletelyMet()); - } - - /** - * @return returns a vector of class names of tested file - */ - protected abstract Expectation getExpectations(); - - - /** - * checks the return type of a method comparing it to the expectation - * @param assumpt - * @param expect - */ - protected void checkReturnType(Type assumpt, MethodExpect expect) { - if (!expect.getReturntypes().isEmpty()) { - AbstractInferenceTest.assertTrue("found return type " + assumpt.getName() + " is not in expected list", expect.getReturntypes().contains(assumpt)); - - checkBoundedTypes(assumpt,expect.getReturntypes().get(expect.getReturntypes().indexOf(assumpt))); - //remove this expectation to assure, all expectations have been met at least once - if (expect.getReturntypesCopy().contains(assumpt)) - expect.getReturntypesCopy().remove(assumpt); - } - else if ((assumpt instanceof GenericTypeVar || assumpt instanceof TypePlaceholder) && expect.getUnknownReturnType()!=null) { - //expect.addGeneric((GenericTypeVar) assumpt); - - checkUnknownTypes(assumpt, expect.getUnknownReturnType()); - } - else - AbstractInferenceTest.fail("no return type for " + assumpt.getName() +" has been defined in expectation"); - } - - /** - * checks for generic methods comparing them to the expectation - * @param assumpt - * @param expect - */ - protected void checkFoundGenerics(Vector assumpt, Vector expect) { - AbstractInferenceTest.assertTrue("amount of generic variables expected != assumed",((assumpt==null || assumpt.size()==0) && (expect==null || expect.size()==0)) || assumpt.size()==expect.size()); - for (GenericTypeVar typ : assumpt) { - //System.out.println("Generics: " + typ.get_Name() + ((BoundedGenericTypeVar)typ).getBounds() + ", " + expect.indexOf(typ)); - AbstractInferenceTest.assertTrue("Generic " + typ.getName() + " has not been expected",expect.contains(typ)); - - checkBoundedTypes(typ,expect.get(expect.indexOf(typ))); - } - } - - protected void checkBoundedTypes(Type assumed, Type expected) { - if (assumed instanceof BoundedGenericTypeVar) { - AbstractInferenceTest.assertTrue("assumed: BoundedGenericTypeVar, expected:' "+expected.getClass()+"'",expected instanceof BoundedGenericTypeVar); - BoundedGenericTypeVar typBound = (BoundedGenericTypeVar)assumed; - BoundedGenericTypeVar expBound = (BoundedGenericTypeVar)expected; - for (Type t : typBound.getBounds()) { - boolean ret = false; - for (Type e : expBound.getBounds()) { -//System.out.println(" here " + t + " -- " + e); - if (e.equals(t)) { - ret=true; - } - } - AbstractInferenceTest.assertTrue("Bounded generic's type is not equal", ret); - } - } - else if (assumed instanceof GenericTypeVar) { -// System.out.println("GENERICTYPEVAR"); - } - } - - protected void checkUnknownTypes(Type assumed, IUnknownTypeExpect expect) { - if (assumed instanceof GenericTypeVar) { - AbstractInferenceTest.assertTrue("Assumed type is of GenericTypeVar",expect instanceof GenericTypeVarExpect); - } - else if (assumed instanceof TypePlaceholder) { - AbstractInferenceTest.assertTrue("Assumed type is of TypePlaceholder",expect instanceof TypePlaceholderExpect); - } - - String mappedType=this.expectation.getMappings().getMappedType(expect.getName()); - if (mappedType!=null) { - AbstractInferenceTest.assertEquals("Same expected UnknownType mapped to different assumed types",mappedType,assumed.getName()); - } - else - this.expectation.getMappings().addMapping(expect.getName(), assumed.getName()); - } - - /** - * searches recursively for the matching block in the expectation set and compares found variables to the expectation - * @param assumpt - * @param expect - * @return - */ - - protected boolean checkFoundVariable(CLocalVarTypeAssumption assumpt, BlockExpect expect) { - //there is an expectation for a variable - AbstractInferenceTest.assertTrue(expect!=null); - boolean ret=false; - if (expect.getBlockID().equals(assumpt.getBlockId())) { - AbstractInferenceTest.assertTrue("Variable "+assumpt.getIdentifier() + " is not defined in expectation",expect.getLocalVar().containsKey(assumpt.getIdentifier())); - VarExpect varExpect = expect.getLocalVar().get(assumpt.getIdentifier()); - Vector expTypes = varExpect.getExpectedType(); - //check if a specific type for this variable is expected or whether it should be a typeplaceholder/generictypevar - if (!expTypes.isEmpty()) { - AbstractInferenceTest.assertTrue("Type " + assumpt.getAssumedType() + " for variable " + assumpt.getIdentifier() + " is not found in expectations", expTypes.contains(assumpt.getAssumedType())); - checkBoundedTypes(assumpt.getAssumedType(), expTypes.get(expTypes.indexOf(assumpt.getAssumedType()))); - - //remove this expectation to assure, all expectations have been met at least once - expect.getLocalVar().get(assumpt.getIdentifier()).getExpectedTypeCopy().remove(assumpt.getAssumedType()); - } - else if ((assumpt.getAssumedType() instanceof GenericTypeVar || assumpt.getAssumedType() instanceof TypePlaceholder) && varExpect.getExpectedUnknownType()!=null) { - checkUnknownTypes(assumpt.getAssumedType(),varExpect.getExpectedUnknownType()); - } - else - AbstractInferenceTest.fail("no type for variable "+ assumpt.getIdentifier() + " has been defined"); - - return true; - } - else if (expect.getContainedBlocks()!=null){ - //dig one block deeper in hierarchy - for (BlockExpect exp : expect.getContainedBlocks()) - ret |= checkFoundVariable(assumpt,exp); - return ret; - } - return false; - } - /** - * checks method parameters comparing them to the expectation - * @param assumpt - * @param expect - */ - - protected void checkParameters(CMethodTypeAssumption methodAssumpt, MethodExpect methodExpect) { - Vector assumpt = methodAssumpt.getParaAssumptions(); - HashMap expect = methodExpect.getParameter(); - //amount of parameter - not needed anymore since methodkey contains amount of parameters already - //AbstractInferenceTest.assertEquals("amount of parameters not equal!", assumpt.size(),expect.size()); - - for (CParaTypeAssumption paraAssumpt : assumpt) { - //check if variable is expected - AbstractInferenceTest.assertTrue("variable " + paraAssumpt.getIdentifier() + " is not expected!", expect.containsKey(paraAssumpt.getIdentifier())); - Vector expectedTypes = expect.get(paraAssumpt.getIdentifier()).getExpectedType(); - //check if variable's type is expected - if (!expectedTypes.isEmpty()) { - AbstractInferenceTest.assertTrue("type " + paraAssumpt.getAssumedType() + " for variable " + paraAssumpt.getIdentifier() + " is not expected!", expectedTypes.contains(paraAssumpt.getAssumedType())); - AbstractInferenceTest.assertEquals("type " + paraAssumpt.getAssumedType() + " for variable " + paraAssumpt.getIdentifier() + " is not expected!", expectedTypes.get(expectedTypes.indexOf(paraAssumpt.getAssumedType())).getClass(),paraAssumpt.getAssumedType().getClass()); - checkBoundedTypes(paraAssumpt.getAssumedType(), expectedTypes.get(expectedTypes.indexOf(paraAssumpt.getAssumedType()))); - - //remove this expectation to assure, all expectations have been met at least once - expect.get(paraAssumpt.getIdentifier()).getExpectedTypeCopy().remove(paraAssumpt.getAssumedType()); - } - else if (paraAssumpt.getAssumedType() instanceof GenericTypeVar && expect.get(paraAssumpt.getIdentifier()).getExpectedUnknownType()!=null) { - //case of undefined type (generic variable), add generic to generic list - if (!methodExpect.getGenerics().contains((GenericTypeVar)paraAssumpt.getAssumedType())) - methodExpect.addGeneric((GenericTypeVar) paraAssumpt.getAssumedType()); - checkUnknownTypes(paraAssumpt.getAssumedType(),expect.get(paraAssumpt.getIdentifier()).getExpectedUnknownType() ); - } - else if (paraAssumpt.getAssumedType() instanceof TypePlaceholder && expect.get(paraAssumpt.getIdentifier()).getExpectedUnknownType()!=null) - checkUnknownTypes(paraAssumpt.getAssumedType(),expect.get(paraAssumpt.getIdentifier()).getExpectedUnknownType() ); - else - AbstractInferenceTest.fail("no type for " + paraAssumpt.getIdentifier() +" has been defined in expectation"); - } - } - - /** - * checks every class expected is included in compiler assumption + available generics - * @param assumption - * @param expectation - */ - protected void checkClasses(TypeinferenceResultSet assumption, Expectation expectation) { - - - for (String expect : expectation.getClasses().keySet()) { - //class exists - AbstractInferenceTest.assertTrue("class " + expect + " is not found in assumption!", assumption.getClassNameList().contains(expect)); - //generics - checkFoundGenerics(assumption.getGenerics(expect), expectation.getClasses().get(expect).getGenerics()); - } - } - - /** - * members found are compared to the expectation - * @param assumpt - * @param expect - */ - - protected void checkFoundMembers(CInstVarTypeAssumption assumpt, HashMap expect) { - AbstractInferenceTest.assertTrue("Member " + assumpt.getIdentifier() + " is not found in expectation!", expect.containsKey(assumpt.getIdentifier())); - AbstractInferenceTest.assertTrue("Type " + assumpt.getAssumedType() + " for member " + assumpt.getIdentifier() + " is not found in expectation",expect.get(assumpt.getIdentifier()).getExpectedType().contains(assumpt.getAssumedType())); - // - //remove this expectation to assure, all expectations have been met at least once - if (expect.get(assumpt.getIdentifier()).getExpectedTypeCopy().contains(assumpt.getAssumedType())) - expect.get(assumpt.getIdentifier()).getExpectedTypeCopy().remove(assumpt.getAssumedType()); - } - - /** - * called to verify whether thrown exception from compiler calls is expected - * @param e - * @throws Throwable - */ - protected void checkForExpectedException (Exception e) throws Throwable { - if (!this.expectation.getExceptions().isEmpty()) { - //check if thrown exception has been expected - e.printStackTrace(); -// System.out.println(e.getClass()); - //AbstractInferenceTest2.assertTrue("Exception " + e.getMessage() + " is not same as expected", e.getClass().equals(this.expectation.getExceptions().firstElement())); - AbstractInferenceTest.assertTrue("Exception " + e.getMessage() + " is not expected", !this.expectation.getExceptions().isEmpty()); - } - else - throw e; - } - -// @Deprecated -// protected void checkForValidMethodTypes(CMethodTypeAssumption assumpt) {} -// protected void setUp() {} -// protected void tearDown() {} - - protected Vector createVectorAllNumberTypes() { - Vector ret = new Vector(); - ret.add(new RefType("java.lang.Integer",-1)); - ret.add(new RefType("java.lang.Long",-1)); - ret.add(new RefType("java.lang.Double",-1)); - ret.add(new RefType("java.lang.Float",-1)); -// ret.add(new RefType("java.lang.Short",-1)); -// ret.add(new RefType("java.lang.Byte",-1)); -// ret.add(new RefType("java.lang.Character",-1)); - - return ret; - } -} diff --git a/test/mycompiler/test/lambda/BasicAssumptions.jav b/test/mycompiler/test/lambda/BasicAssumptions.jav index f9da2d184..16726c822 100755 --- a/test/mycompiler/test/lambda/BasicAssumptions.jav +++ b/test/mycompiler/test/lambda/BasicAssumptions.jav @@ -1,3 +1,5 @@ +import java.util.Vector; + class BasicAssumptionsTest{ varString; @@ -5,6 +7,6 @@ var = 2; void methode(){ var = 1; - varString = varString.toString(); + varString.add(var); } } \ No newline at end of file diff --git a/test/mycompiler/test/lambda/ConstructorTest.java b/test/mycompiler/test/lambda/ConstructorTest.java index 2da4e867f..b1ab6b916 100755 --- a/test/mycompiler/test/lambda/ConstructorTest.java +++ b/test/mycompiler/test/lambda/ConstructorTest.java @@ -37,7 +37,7 @@ public class ConstructorTest { anzahlGeparsterKlassen++; }else if(cl.getName().equals("ConstructorTest2")){ anzahlGeparsterKlassen++; - assertTrue("ConstructorTest2.var muss vom Typ ConstructorTest1 sein.", ass.getVarType("var").printJavaCode( + assertTrue("ConstructorTest2.var muss vom Typ ConstructorTest1 sein.", ass.getVarType("var",cl).printJavaCode( res.getUnifiedConstraints()).toString().equals("ConstructorTest1")); }else fail("Die geparsten Klassen müssen ConstructorTest1 und ConstructorTest2 heißen"); } diff --git a/test/mycompiler/test/lambda/OverloadingTest.jav b/test/mycompiler/test/lambda/OverloadingTest.jav index bed6f9604..bdcba2bc6 100755 --- a/test/mycompiler/test/lambda/OverloadingTest.jav +++ b/test/mycompiler/test/lambda/OverloadingTest.jav @@ -2,7 +2,7 @@ class OverloadingTest{ var; - public Object clone(){ + public clone(){ return this; } @@ -14,7 +14,7 @@ class OverloadingTest{ class OverloadingTest2{ - public Object clone(){ + public clone(){ return this; } diff --git a/test/mycompiler/test/lambda/ParseMultipleFilesTest.java b/test/mycompiler/test/lambda/ParseMultipleFilesTest.java index b912e06f0..cebc22648 100755 --- a/test/mycompiler/test/lambda/ParseMultipleFilesTest.java +++ b/test/mycompiler/test/lambda/ParseMultipleFilesTest.java @@ -33,10 +33,10 @@ public class ParseMultipleFilesTest { TypeAssumptions ass = cl.getPublicFieldAssumptions(); if(cl.getName().equals("Klasse1")){ anzahlGeparsterKlassen++; - assertTrue("Klasse1.var1 muss vom Typ int sein.", ass.getVarType("var1").printJavaCode(res.getUnifiedConstraints()).toString().equals("int")); + assertTrue("Klasse1.var1 muss vom Typ int sein.", ass.getVarType("var1",cl).printJavaCode(res.getUnifiedConstraints()).toString().equals("int")); }else if(cl.getName().equals("Klasse2")){ anzahlGeparsterKlassen++; - assertTrue("Klasse1.var1 muss vom Typ Klasse1 sein.", ass.getVarType("var1").printJavaCode(res.getUnifiedConstraints()).toString().equals("Klasse1")); + assertTrue("Klasse1.var1 muss vom Typ Klasse1 sein.", ass.getVarType("var1",cl).printJavaCode(res.getUnifiedConstraints()).toString().equals("Klasse1")); }else fail("Die geparsten Klassen müssen Klasse1 und Klasse2 heißen"); } assertTrue("Es müssen insgesamt 2 Klassen inferierd worden sein", anzahlGeparsterKlassen == 2); diff --git a/test/mycompiler/test/lambda/TestAssign.java b/test/mycompiler/test/lambda/TestAssign.java index ac98bb26e..83e101c74 100755 --- a/test/mycompiler/test/lambda/TestAssign.java +++ b/test/mycompiler/test/lambda/TestAssign.java @@ -18,7 +18,7 @@ public class TestAssign extends TestCase{ @Test public void test() { - variableTypeAssumptions.put("stringVar", "String"); + variableTypeAssumptions.put("stringVar", "java.lang.String"); executeTest(); } diff --git a/test/mycompiler/test/lambda/TestInterface.jav b/test/mycompiler/test/lambda/TestInterface.jav new file mode 100644 index 000000000..569e12943 --- /dev/null +++ b/test/mycompiler/test/lambda/TestInterface.jav @@ -0,0 +1,9 @@ +interface TestInterface{ + methode(); +} + +class TestClass implements TestInterface{ + methode(){ + return "test"; + } +} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/TestInterface.java b/test/mycompiler/test/lambda/TestInterface.java new file mode 100644 index 000000000..a73aa9520 --- /dev/null +++ b/test/mycompiler/test/lambda/TestInterface.java @@ -0,0 +1,24 @@ +package mycompiler.test.lambda; + +import java.util.HashMap; + +import mycompiler.mytest.LambdaTest; + +import org.junit.Test; + +public class TestInterface { + @Test + public void test() { + //Testet nur ob ein Interface ohne Fehler geparst und inferiert wird. + executeTest(); + } + + private static final String exampleJavFile = "TestInterface.jav"; + + private HashMap variableTypeAssumptions = new HashMap(); + + public void executeTest(){ + LambdaTest tester = new LambdaTest(exampleJavFile); + tester.runTest(); + } +} diff --git a/test/mycompiler/test/lambda/TestMethodCall.java b/test/mycompiler/test/lambda/TestMethodCall.java index 4be420a8e..5e39ba271 100755 --- a/test/mycompiler/test/lambda/TestMethodCall.java +++ b/test/mycompiler/test/lambda/TestMethodCall.java @@ -24,7 +24,6 @@ public class TestMethodCall { public void executeTest(){ LambdaTest tester = new LambdaTest(exampleJavFile); tester.runTestAndCheckResultSet(classname, variableTypeAssumptions); - } } diff --git a/test/mycompiler/test/lambda/TestWhile.jav b/test/mycompiler/test/lambda/TestWhile.jav index 019bf8f4e..504a72cf1 100755 --- a/test/mycompiler/test/lambda/TestWhile.jav +++ b/test/mycompiler/test/lambda/TestWhile.jav @@ -1,7 +1,7 @@ class WhileTest{ - public method(){ var; + public method(){ while(true){ var = "String"; } diff --git a/test/mycompiler/test/lambda/parseMultipleFilesFile1.jav b/test/mycompiler/test/lambda/parseMultipleFilesFile1.jav index 79a5554a5..e51527c00 100755 --- a/test/mycompiler/test/lambda/parseMultipleFilesFile1.jav +++ b/test/mycompiler/test/lambda/parseMultipleFilesFile1.jav @@ -7,4 +7,12 @@ testMethode(){ return var1.getVar1(); } -} \ No newline at end of file +} + +class Klasse1 { + var1; + + int getVar1(){ + return var1; + } +} diff --git a/test/mycompiler/test/lambda/testResults/LambdaTest.log b/test/mycompiler/test/lambda/testResults/LambdaTest.log index f4fd14841..738a29402 100644 --- a/test/mycompiler/test/lambda/testResults/LambdaTest.log +++ b/test/mycompiler/test/lambda/testResults/LambdaTest.log @@ -1,40 +1,603 @@ -Class DEBUG [Typeinference] Erstellte Assumptions: this: WhileTestMethod Assumptions: -[typinferenz.assumptions.MethodAssumption@33e8c1e4, typinferenz.assumptions.MethodAssumption@76117a5b] -FieldVar Assumptions: +SourceFile DEBUG [Typeinference] Von JRE erstellte Assumptions: this: null +Method Assumptions: [] +FieldVar Assumptions: +[FieldAssumption: int MIN_VALUE, FieldAssumption: int MAX_VALUE, FieldAssumption: java.lang.Class TYPE, FieldAssumption: int SIZE, FieldAssumption: java.util.Comparator CASE_INSENSITIVE_ORDER, FieldAssumption: int MIN_RADIX, FieldAssumption: int MAX_RADIX, FieldAssumption: char MIN_VALUE, FieldAssumption: char MAX_VALUE, FieldAssumption: java.lang.Class TYPE, FieldAssumption: byte UNASSIGNED, FieldAssumption: byte UPPERCASE_LETTER, FieldAssumption: byte LOWERCASE_LETTER, FieldAssumption: byte TITLECASE_LETTER, FieldAssumption: byte MODIFIER_LETTER, FieldAssumption: byte OTHER_LETTER, FieldAssumption: byte NON_SPACING_MARK, FieldAssumption: byte ENCLOSING_MARK, FieldAssumption: byte COMBINING_SPACING_MARK, FieldAssumption: byte DECIMAL_DIGIT_NUMBER, FieldAssumption: byte LETTER_NUMBER, FieldAssumption: byte OTHER_NUMBER, FieldAssumption: byte SPACE_SEPARATOR, FieldAssumption: byte LINE_SEPARATOR, FieldAssumption: byte PARAGRAPH_SEPARATOR, FieldAssumption: byte CONTROL, FieldAssumption: byte FORMAT, FieldAssumption: byte PRIVATE_USE, FieldAssumption: byte SURROGATE, FieldAssumption: byte DASH_PUNCTUATION, FieldAssumption: byte START_PUNCTUATION, FieldAssumption: byte END_PUNCTUATION, FieldAssumption: byte CONNECTOR_PUNCTUATION, FieldAssumption: byte OTHER_PUNCTUATION, FieldAssumption: byte MATH_SYMBOL, FieldAssumption: byte CURRENCY_SYMBOL, FieldAssumption: byte MODIFIER_SYMBOL, FieldAssumption: byte OTHER_SYMBOL, FieldAssumption: byte INITIAL_QUOTE_PUNCTUATION, FieldAssumption: byte FINAL_QUOTE_PUNCTUATION, FieldAssumption: byte DIRECTIONALITY_UNDEFINED, FieldAssumption: byte DIRECTIONALITY_LEFT_TO_RIGHT, FieldAssumption: byte DIRECTIONALITY_RIGHT_TO_LEFT, FieldAssumption: byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC, FieldAssumption: byte DIRECTIONALITY_EUROPEAN_NUMBER, FieldAssumption: byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR, FieldAssumption: byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR, FieldAssumption: byte DIRECTIONALITY_ARABIC_NUMBER, FieldAssumption: byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR, FieldAssumption: byte DIRECTIONALITY_NONSPACING_MARK, FieldAssumption: byte DIRECTIONALITY_BOUNDARY_NEUTRAL, FieldAssumption: byte DIRECTIONALITY_PARAGRAPH_SEPARATOR, FieldAssumption: byte DIRECTIONALITY_SEGMENT_SEPARATOR, FieldAssumption: byte DIRECTIONALITY_WHITESPACE, FieldAssumption: byte DIRECTIONALITY_OTHER_NEUTRALS, FieldAssumption: byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING, FieldAssumption: byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE, FieldAssumption: byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING, FieldAssumption: byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE, FieldAssumption: byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT, FieldAssumption: char MIN_HIGH_SURROGATE, FieldAssumption: char MAX_HIGH_SURROGATE, FieldAssumption: char MIN_LOW_SURROGATE, FieldAssumption: char MAX_LOW_SURROGATE, FieldAssumption: char MIN_SURROGATE, FieldAssumption: char MAX_SURROGATE, FieldAssumption: int MIN_SUPPLEMENTARY_CODE_POINT, FieldAssumption: int MIN_CODE_POINT, FieldAssumption: int MAX_CODE_POINT, FieldAssumption: int SIZE, FieldAssumption: java.lang.Boolean TRUE, FieldAssumption: java.lang.Boolean FALSE, FieldAssumption: java.lang.Class TYPE, FieldAssumption: double POSITIVE_INFINITY, FieldAssumption: double NEGATIVE_INFINITY, FieldAssumption: double NaN, FieldAssumption: double MAX_VALUE, FieldAssumption: double MIN_NORMAL, FieldAssumption: double MIN_VALUE, FieldAssumption: int MAX_EXPONENT, FieldAssumption: int MIN_EXPONENT, FieldAssumption: int SIZE, FieldAssumption: java.lang.Class TYPE, FieldAssumption: float POSITIVE_INFINITY, FieldAssumption: float NEGATIVE_INFINITY, FieldAssumption: float NaN, FieldAssumption: float MAX_VALUE, FieldAssumption: float MIN_NORMAL, FieldAssumption: float MIN_VALUE, FieldAssumption: int MAX_EXPONENT, FieldAssumption: int MIN_EXPONENT, FieldAssumption: int SIZE, FieldAssumption: java.lang.Class TYPE, FieldAssumption: long MIN_VALUE, FieldAssumption: long MAX_VALUE, FieldAssumption: java.lang.Class TYPE, FieldAssumption: int SIZE] LocalVar Assumptions: [] Parameter Assumptions: [] +Konstruktor Assumptions: +[MethodAssumption: java.lang.Integer [](), MethodAssumption: java.lang.Integer [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.Character [](), MethodAssumption: java.lang.Boolean [](), MethodAssumption: java.lang.Boolean [](), MethodAssumption: java.lang.Double [](), MethodAssumption: java.lang.Double [](), MethodAssumption: java.lang.Float [](), MethodAssumption: java.lang.Float [](), MethodAssumption: java.lang.Float [](), MethodAssumption: java.lang.Long [](), MethodAssumption: java.lang.Long [](), MethodAssumption: java.lang.Object []()] +Class Assumptions: +[java.lang.Integer, java.lang.String, java.lang.Character, java.lang.Boolean, java.lang.Double, java.lang.Float, java.lang.Long, java.lang.Object] -Block DEBUG [Typeinference] Prozessing statement: no type [var] -Block DEBUG [Typeinference] Prozessing statement: WHILE null { [(var = mycompiler.mystatement.StringLiteral@25cc8345)] -Block DEBUG [Typeinference] Prozessing statement: (var = mycompiler.mystatement.StringLiteral@25cc8345) -Block DEBUG [Typeinference] Prozessing statement: void(var: TPH C = mycompiler.mystatement.StringLiteral@25cc8345) -Block DEBUG [Typeinference] Prozessing statement: WHILE void { [void(var: TPH C = mycompiler.mystatement.StringLiteral@25cc8345)] -Block DEBUG [Typeinference] Prozessing statement: TPH C [var] -Class DEBUG [Typeinference] Erstellte Constraints: boolean < boolean -String < TPH C -TPH C < TPH D -void < TPH A +Class DEBUG [Typeinference] Erstellte Assumptions: this: LambdaTest1 +Method Assumptions: +[MethodAssumption: GTV R [apply](), MethodAssumption: GTV R [apply](GTV T1 T1), MethodAssumption: GTV R [apply](GTV T1 T1,GTV T2 T2), MethodAssumption: GTV R [apply](GTV T1 T1,GTV T2 T2,GTV T3 T3), MethodAssumption: GTV R [apply](GTV T1 T1,GTV T2 T2,GTV T3 T3,GTV T4 T4), MethodAssumption: GTV R [apply](GTV T1 T1,GTV T2 T2,GTV T3 T3,GTV T4 T4,GTV T5 T5), MethodAssumption: TPH B [method](String toAppend)] +FieldVar Assumptions: +[FieldAssumption: TPH A var, FieldAssumption: int MIN_VALUE, FieldAssumption: int MAX_VALUE, FieldAssumption: java.lang.Class TYPE, FieldAssumption: int SIZE, FieldAssumption: java.util.Comparator CASE_INSENSITIVE_ORDER, FieldAssumption: int MIN_RADIX, FieldAssumption: int MAX_RADIX, FieldAssumption: char MIN_VALUE, FieldAssumption: char MAX_VALUE, FieldAssumption: java.lang.Class TYPE, FieldAssumption: byte UNASSIGNED, FieldAssumption: byte UPPERCASE_LETTER, FieldAssumption: byte LOWERCASE_LETTER, FieldAssumption: byte TITLECASE_LETTER, FieldAssumption: byte MODIFIER_LETTER, FieldAssumption: byte OTHER_LETTER, FieldAssumption: byte NON_SPACING_MARK, FieldAssumption: byte ENCLOSING_MARK, FieldAssumption: byte COMBINING_SPACING_MARK, FieldAssumption: byte DECIMAL_DIGIT_NUMBER, FieldAssumption: byte LETTER_NUMBER, FieldAssumption: byte OTHER_NUMBER, FieldAssumption: byte SPACE_SEPARATOR, FieldAssumption: byte LINE_SEPARATOR, FieldAssumption: byte PARAGRAPH_SEPARATOR, FieldAssumption: byte CONTROL, FieldAssumption: byte FORMAT, FieldAssumption: byte PRIVATE_USE, FieldAssumption: byte SURROGATE, FieldAssumption: byte DASH_PUNCTUATION, FieldAssumption: byte START_PUNCTUATION, FieldAssumption: byte END_PUNCTUATION, FieldAssumption: byte CONNECTOR_PUNCTUATION, FieldAssumption: byte OTHER_PUNCTUATION, FieldAssumption: byte MATH_SYMBOL, FieldAssumption: byte CURRENCY_SYMBOL, FieldAssumption: byte MODIFIER_SYMBOL, FieldAssumption: byte OTHER_SYMBOL, FieldAssumption: byte INITIAL_QUOTE_PUNCTUATION, FieldAssumption: byte FINAL_QUOTE_PUNCTUATION, FieldAssumption: byte DIRECTIONALITY_UNDEFINED, FieldAssumption: byte DIRECTIONALITY_LEFT_TO_RIGHT, FieldAssumption: byte DIRECTIONALITY_RIGHT_TO_LEFT, FieldAssumption: byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC, FieldAssumption: byte DIRECTIONALITY_EUROPEAN_NUMBER, FieldAssumption: byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR, FieldAssumption: byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR, FieldAssumption: byte DIRECTIONALITY_ARABIC_NUMBER, FieldAssumption: byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR, FieldAssumption: byte DIRECTIONALITY_NONSPACING_MARK, FieldAssumption: byte DIRECTIONALITY_BOUNDARY_NEUTRAL, FieldAssumption: byte DIRECTIONALITY_PARAGRAPH_SEPARATOR, FieldAssumption: byte DIRECTIONALITY_SEGMENT_SEPARATOR, FieldAssumption: byte DIRECTIONALITY_WHITESPACE, FieldAssumption: byte DIRECTIONALITY_OTHER_NEUTRALS, FieldAssumption: byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING, FieldAssumption: byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE, FieldAssumption: byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING, FieldAssumption: byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE, FieldAssumption: byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT, FieldAssumption: char MIN_HIGH_SURROGATE, FieldAssumption: char MAX_HIGH_SURROGATE, FieldAssumption: char MIN_LOW_SURROGATE, FieldAssumption: char MAX_LOW_SURROGATE, FieldAssumption: char MIN_SURROGATE, FieldAssumption: char MAX_SURROGATE, FieldAssumption: int MIN_SUPPLEMENTARY_CODE_POINT, FieldAssumption: int MIN_CODE_POINT, FieldAssumption: int MAX_CODE_POINT, FieldAssumption: int SIZE, FieldAssumption: java.lang.Boolean TRUE, FieldAssumption: java.lang.Boolean FALSE, FieldAssumption: java.lang.Class TYPE, FieldAssumption: double POSITIVE_INFINITY, FieldAssumption: double NEGATIVE_INFINITY, FieldAssumption: double NaN, FieldAssumption: double MAX_VALUE, FieldAssumption: double MIN_NORMAL, FieldAssumption: double MIN_VALUE, FieldAssumption: int MAX_EXPONENT, FieldAssumption: int MIN_EXPONENT, FieldAssumption: int SIZE, FieldAssumption: java.lang.Class TYPE, FieldAssumption: float POSITIVE_INFINITY, FieldAssumption: float NEGATIVE_INFINITY, FieldAssumption: float NaN, FieldAssumption: float MAX_VALUE, FieldAssumption: float MIN_NORMAL, FieldAssumption: float MIN_VALUE, FieldAssumption: int MAX_EXPONENT, FieldAssumption: int MIN_EXPONENT, FieldAssumption: int SIZE, FieldAssumption: java.lang.Class TYPE, FieldAssumption: long MIN_VALUE, FieldAssumption: long MAX_VALUE, FieldAssumption: java.lang.Class TYPE, FieldAssumption: int SIZE] +LocalVar Assumptions: +[] +Parameter Assumptions: +[] +Konstruktor Assumptions: +[MethodAssumption: LambdaTest1 [LambdaTest1](), MethodAssumption: java.lang.Integer [](), MethodAssumption: java.lang.Integer [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.String [](), MethodAssumption: java.lang.Character [](), MethodAssumption: java.lang.Boolean [](), MethodAssumption: java.lang.Boolean [](), MethodAssumption: java.lang.Double [](), MethodAssumption: java.lang.Double [](), MethodAssumption: java.lang.Float [](), MethodAssumption: java.lang.Float [](), MethodAssumption: java.lang.Float [](), MethodAssumption: java.lang.Long [](), MethodAssumption: java.lang.Long [](), MethodAssumption: java.lang.Object []()] +Class Assumptions: +[Fun0, Fun1, Fun2, Fun3, Fun4, Fun5, LambdaTest1, java.lang.Integer, java.lang.String, java.lang.Character, java.lang.Boolean, java.lang.Double, java.lang.Float, java.lang.Long, java.lang.Object] -SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(boolean <. boolean), (String <. TPH C), (TPH C <. TPH D), (void <. TPH A)]] -SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH D = String), (TPH C = String), (TPH A = void)]] +Block DEBUG [Typeinference] Prozessing statement: null Return null (( [ String text, ]) -> null { [null Return toAppend]) +Block DEBUG [Typeinference] Prozessing statement: null Return toAppend +Block DEBUG [Typeinference] Prozessing statement: TPH AG Return toAppend: java.lang.String +Block DEBUG [Typeinference] Prozessing statement: TPH AH Return TPH AF (( [ String text, ]) -> TPH AG { [TPH AG Return toAppend: java.lang.String]) +Class DEBUG [Typeinference] Erstellte Constraints: TPH A < TPH A +java.lang.String < TPH A +java.lang.String < TPH AG +Fun1< TPH AG, String > < TPH AF +TPH AF < TPH AH +TPH AH < TPH B + +SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(TPH A <. TPH A), (java.lang.String <. TPH A), (java.lang.String <. TPH AG), (Fun1< TPH AG, String > <. TPH AF), (TPH AF <. TPH AH), (TPH AH <. TPH B)]] +SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH B = Fun1< java.lang.String, String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? extends java.lang.String, String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? extends java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? extends java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? super java.lang.String, String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? super java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? super java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? extends java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? super java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? extends java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? super java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? extends java.lang.String, String >), (TPH AH = Fun1< ? extends java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? extends java.lang.String, ? extends String >), (TPH AH = Fun1< ? extends java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? extends java.lang.String, ? super String >), (TPH AH = Fun1< ? extends java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? extends java.lang.String, ? extends String >), (TPH AH = Fun1< ? extends java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? extends java.lang.String, ? super String >), (TPH AH = Fun1< ? extends java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? super java.lang.String, String >), (TPH AH = Fun1< ? super java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? super java.lang.String, ? extends String >), (TPH AH = Fun1< ? super java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? super java.lang.String, ? super String >), (TPH AH = Fun1< ? super java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? super java.lang.String, ? extends String >), (TPH AH = Fun1< ? super java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< ? super java.lang.String, ? super String >), (TPH AH = Fun1< ? super java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)], [(TPH B = Fun1< java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? extends String >)], [(TPH B = Fun1< ? extends java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? extends String >)], [(TPH B = Fun1< ? super java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? extends String >)], [(TPH B = Fun1< ? extends java.lang.String, ? extends String >), (TPH AH = Fun1< ? extends java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? extends String >)], [(TPH B = Fun1< ? super java.lang.String, ? extends String >), (TPH AH = Fun1< ? super java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? extends String >)], [(TPH B = Fun1< java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? super String >)], [(TPH B = Fun1< ? extends java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? super String >)], [(TPH B = Fun1< ? super java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? super String >)], [(TPH B = Fun1< ? extends java.lang.String, ? super String >), (TPH AH = Fun1< ? extends java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? super String >)], [(TPH B = Fun1< ? super java.lang.String, ? super String >), (TPH AH = Fun1< ? super java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? super String >)]] SourceFile DEBUG [Typeinference] JavaFiles: -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH D = String), (TPH C = String), (TPH A = void)] +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< java.lang.String, String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] -SourceFile DEBUG [Typeinference] class WhileTest extends Object +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object { -void method() +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) { -String var; -while(true){ -var = "String"; +return (String text) -> { +return toAppend; +}; } -} -B WhileTest() +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, String >), (TPH AH = Fun1< ? extends java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, ? extends String >), (TPH AH = Fun1< ? extends java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, ? super String >), (TPH AH = Fun1< ? extends java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, ? extends String >), (TPH AH = Fun1< ? extends java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, ? super String >), (TPH AH = Fun1< ? extends java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, String >), (TPH AH = Fun1< ? super java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, ? extends String >), (TPH AH = Fun1< ? super java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, ? super String >), (TPH AH = Fun1< ? super java.lang.String, String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, ? extends String >), (TPH AH = Fun1< ? super java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, ? super String >), (TPH AH = Fun1< ? super java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? extends String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? extends String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, ? extends String >), (TPH AH = Fun1< java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? extends String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, ? extends String >), (TPH AH = Fun1< ? extends java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? extends String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, ? extends String >), (TPH AH = Fun1< ? super java.lang.String, ? extends String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? extends String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? super String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? super String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, ? super String >), (TPH AH = Fun1< java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? super String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? extends java.lang.String, ? super String >), (TPH AH = Fun1< ? extends java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? super String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = Fun1< ? super java.lang.String, ? super String >), (TPH AH = Fun1< ? super java.lang.String, ? super String >), (TPH A = java.lang.String), (TPH AG = java.lang.String), (TPH AF = Fun1< java.lang.String, ? super String >)] + +SourceFile DEBUG [Typeinference] class LambdaTest1 extends Object +{ +java.lang.String var = "test"; +Fun1 method(java.lang.String toAppend) +{ +return (String text) -> { +return toAppend; +}; +} +LambdaTest1 LambdaTest1() { } } diff --git a/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest.java b/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest.java index e373a052c..a3d26b7e7 100755 --- a/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest.java +++ b/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest.java @@ -7,9 +7,6 @@ import mycompiler.mytypereconstruction.typeassumption.CLocalVarTypeAssumption; import mycompiler.mytypereconstruction.typeassumption.CMethodTypeAssumption; -/*TODO: -*/ - public class TestAbstractInferenceTest extends AbstractInferenceTestOLD_2 { private final static String TESTEDCLASSNAME="TestAbstractInferenceTest"; diff --git a/test/parser/BoundedParameter.jav b/test/parser/BoundedParameter.jav new file mode 100644 index 000000000..6d7518a9c --- /dev/null +++ b/test/parser/BoundedParameter.jav @@ -0,0 +1,3 @@ +class Matrix{ + String op = "String"; +} diff --git a/test/parser/FieldInitializationTest.jav b/test/parser/FieldInitializationTest.jav new file mode 100644 index 000000000..302667b97 --- /dev/null +++ b/test/parser/FieldInitializationTest.jav @@ -0,0 +1,3 @@ +class FieldInitializationTest{ + String var = "hallo"; +} \ No newline at end of file diff --git a/test/parser/GeneralParserTest.java b/test/parser/GeneralParserTest.java new file mode 100644 index 000000000..3349d324c --- /dev/null +++ b/test/parser/GeneralParserTest.java @@ -0,0 +1,46 @@ +package parser; + +import static org.junit.Assert.*; + +import java.io.File; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Vector; + +import junit.framework.TestCase; +import mycompiler.MyCompiler; +import mycompiler.MyCompilerAPI; + +import org.junit.Test; + +/** + * Dieser Test prüft nur, ob .java-Dateien fehlerfrei geparst werden. + * Der dabei erstellte Syntaxbaum wird nicht kontrolliert. + * @author janulrich + * + */ +public class GeneralParserTest{ + private static final String rootDirectory = System.getProperty("user.dir")+"/test/parser/"; + + @Test + public void run(){ + Vector filenames = new Vector(); + filenames.add("FieldInitializationTest.jav"); + filenames.add("ImportTest.jav"); + filenames.add("BoundedParameter.jav"); + filenames.add("GenericFieldVarTest.jav"); + MyCompilerAPI compiler = MyCompiler.getAPI(); + try{ + for(String filename : filenames) + compiler.parse(new File(rootDirectory + filename)); + }catch(Exception exc){ + exc.printStackTrace(); + fail(); + } + assertTrue("Tests durchlaufen",filenames.size()>0); + } + +} diff --git a/test/parser/GenericFieldVarTest.jav b/test/parser/GenericFieldVarTest.jav new file mode 100644 index 000000000..a47b41eb0 --- /dev/null +++ b/test/parser/GenericFieldVarTest.jav @@ -0,0 +1,3 @@ +class Test{ + A var; +} diff --git a/test/parser/ImportTest.jav b/test/parser/ImportTest.jav new file mode 100644 index 000000000..2de55cee8 --- /dev/null +++ b/test/parser/ImportTest.jav @@ -0,0 +1,4 @@ +import java.util.*; + +class ImportTest{ +} \ No newline at end of file diff --git a/test/plugindevelopment/InsertSingleTypeTest.java b/test/plugindevelopment/InsertSingleTypeTest.java new file mode 100644 index 000000000..0a524771a --- /dev/null +++ b/test/plugindevelopment/InsertSingleTypeTest.java @@ -0,0 +1,60 @@ +package plugindevelopment; + +import java.io.File; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Vector; + +import org.junit.Test; + +import junit.framework.TestCase; +import mycompiler.MyCompiler; +import mycompiler.MyCompilerAPI; +import mycompiler.myparser.JavaParser.yyException; +import mycompiler.mytypereconstruction.TypeinferenceResultSet; +import typinferenz.typedeployment.TypeInsertPoint; +import typinferenz.typedeployment.TypeInsertSet; + +public class InsertSingleTypeTest { + private static final String testFile = "SingleTypeInsertTest.jav"; + + @Test + public void test1(){ + TypeinferenceResultSet res = test(testFile); + TypeInsertPoint p = res.getTypeInsertionPoints().points.firstElement(); + try { + System.out.println(res.getTypeInsertionPoints().insertType(p, this.getFileContent(rootDirectory + testFile))); + } catch (IOException e) { + TestCase.fail(); + e.printStackTrace(); + } + } + + static final String rootDirectory = System.getProperty("user.dir")+"/test/plugindevelopment/"; + + public static TypeinferenceResultSet test(String sourceFileToInfere){ + String inferedSource = ""; + MyCompilerAPI compiler = MyCompiler.getAPI(); + try { + compiler.parse(new File(rootDirectory + sourceFileToInfere)); + Vector results = compiler.typeReconstruction(); + TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); + return results.firstElement(); + } catch (IOException | yyException e) { + e.printStackTrace(); + TestCase.fail(); + return null; + } + } + + //Source: https://stackoverflow.com/questions/326390/how-to-create-a-java-string-from-the-contents-of-a-file + //PS: benötigt Java 7 + public static String getFileContent(String path)throws IOException + { + byte[] encoded = Files.readAllBytes(Paths.get(path)); + return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(encoded)).toString(); + } +} diff --git a/test/plugindevelopment/MartinTestCases/AchimTest1.jav b/test/plugindevelopment/MartinTestCases/AchimTest1.jav new file mode 100755 index 000000000..35d7739d5 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/AchimTest1.jav @@ -0,0 +1,9 @@ +class Test{ + test(){ + return 1; + } + test2(){ + i; + i = test(); + } +} diff --git a/test/plugindevelopment/MartinTestCases/BoundedType.jav b/test/plugindevelopment/MartinTestCases/BoundedType.jav new file mode 100755 index 000000000..ca33735a7 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/BoundedType.jav @@ -0,0 +1,12 @@ +class BoundedType { + + m(T x) { + return x; + } + + m1(x) { + T y; + x = y; + return y; + } +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/BoundedType1.jav b/test/plugindevelopment/MartinTestCases/BoundedType1.jav new file mode 100755 index 000000000..af71bfa73 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/BoundedType1.jav @@ -0,0 +1,16 @@ +interface BB { } +interface AA extends BB { + AAm(BB x); + } + +interface RR extends BB { + } + +class BoundedType1 { + + + m1(AA a) { + T1 b; + a.AAm(b); + } +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/BoundedType2.jav b/test/plugindevelopment/MartinTestCases/BoundedType2.jav new file mode 100755 index 000000000..47602aba5 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/BoundedType2.jav @@ -0,0 +1,15 @@ +class BoundedType { + m(T x) { + r; + r=x; + return r; + } + m1(b) { return b; } + +} + +class Id { + BoundedType bb; + m(x) { return bb.m1(x); } + } + \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/Id.jav b/test/plugindevelopment/MartinTestCases/Id.jav new file mode 100644 index 000000000..d2293b4b8 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Id.jav @@ -0,0 +1,3 @@ +class Id { + Fun1 op = (x) -> x; + } \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/MatrixVectorMul.jav b/test/plugindevelopment/MartinTestCases/MatrixVectorMul.jav new file mode 100644 index 000000000..5aa6ee451 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/MatrixVectorMul.jav @@ -0,0 +1,14 @@ +import java.util.Vector; + +class Matrix extends Vector> { + + mvmul(Vector v) { + i; + ele; + v.add(1); + while (i < v.size()) { + + ele = 5 + v.elementAt(i); + } + } +} diff --git a/test/plugindevelopment/MartinTestCases/MatrixWhile.jav b/test/plugindevelopment/MartinTestCases/MatrixWhile.jav new file mode 100644 index 000000000..e696ea61e --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/MatrixWhile.jav @@ -0,0 +1,43 @@ +class Matrix extends Vector> { + + Matrix mul_rec(Matrix m) { + v1; + v1 = new Vector(); + v2; + v2 = new Vector(); + i; + i = 0; + while(i < m.size()) { + v; + v = m.elementAt(i); + v2.addElement(v.remove(v.size()-1)); + i++; + } + Matrix ret; + if (m.elementAt(0).size() > 0) { + ret = this.mul_rec(m); + } + else { + ret = new Matrix(); + i = 0; + while (i < this.size()) { + ret.addElement(new Vector()); + i++; + } + } + i = 0; + while (i < this.size()) { + int erg = 0; + j; + j = 0; + while (j < v2.size()) { + erg = erg + this.elementAt(i).elementAt(j).intValue() + * v2.elementAt(j).intValue(); + j++; + } + ret.elementAt(i).addElement(erg); + i++; + } + return ret; + } +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/Matrix_lambda.jav b/test/plugindevelopment/MartinTestCases/Matrix_lambda.jav new file mode 100644 index 000000000..293f776e4 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Matrix_lambda.jav @@ -0,0 +1,5 @@ +import java.util.Vector; + +class Matrix extends Vector> { + op = (Matrix m) -> (f) -> f.apply(this, m); +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/MethodId.jav b/test/plugindevelopment/MartinTestCases/MethodId.jav new file mode 100644 index 000000000..f8f44dec3 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/MethodId.jav @@ -0,0 +1,6 @@ +class MethodId { + + US m (UR x) { + return x; + } + } \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/MethodIntegerUse.jav b/test/plugindevelopment/MartinTestCases/MethodIntegerUse.jav new file mode 100644 index 000000000..11f2c06bc --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/MethodIntegerUse.jav @@ -0,0 +1,8 @@ +class MethodIntegerUse { + Fun1 op = (x) -> m(x); + + + Integer m (Integer x) { + return x; + } + } \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/MethodUse.jav b/test/plugindevelopment/MartinTestCases/MethodUse.jav new file mode 100644 index 000000000..1349b7ff7 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/MethodUse.jav @@ -0,0 +1,8 @@ +class MethodUse { + Fun1 op = (x) -> m(x); + + + AP m (AO x) { + return x; + } + } \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/OL.jav b/test/plugindevelopment/MartinTestCases/OL.jav new file mode 100755 index 000000000..66e95aeb3 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/OL.jav @@ -0,0 +1,16 @@ +class OL { + + Integer m(Integer x) { return x + x; } + + Boolean m(Boolean x) {return x || x; } +} + +class Main { + + main(x) { + ol; + ol = new OL(); + return ol.m(x); + } + +} diff --git a/test/plugindevelopment/MartinTestCases/OL2.jav b/test/plugindevelopment/MartinTestCases/OL2.jav new file mode 100755 index 000000000..799d586de --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/OL2.jav @@ -0,0 +1,19 @@ +import java.util.Vector; + +class OL2 { + + Integer m(Integer x) { return x + x; } + + Boolean m(Boolean x) {return x || x; } +} + +class Main { + + main(x) { + ol; + ol = new OL2(); + y; + y.add(ol.m(x)); + } + +} diff --git a/test/plugindevelopment/MartinTestCases/OL3.jav b/test/plugindevelopment/MartinTestCases/OL3.jav new file mode 100644 index 000000000..0ccd6da1b --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/OL3.jav @@ -0,0 +1,9 @@ +class Test{ + String main(){ + return m(()->{return "Test";}); + } + String m(p){ + return p.apply(); + } + void m(p){} +} diff --git a/test/plugindevelopment/MartinTestCases/Plus1.jav b/test/plugindevelopment/MartinTestCases/Plus1.jav new file mode 100644 index 000000000..6b0ca749a --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Plus1.jav @@ -0,0 +1,3 @@ +class Plus1 { + Fun1 op = (x) -> x+1; + } \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/Plus1_Float_Double.jav b/test/plugindevelopment/MartinTestCases/Plus1_Float_Double.jav new file mode 100644 index 000000000..75c3baad7 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Plus1_Float_Double.jav @@ -0,0 +1,3 @@ +class Plus1_Float_Double { + op = (x) -> x+1.0; + } \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/Probleme b/test/plugindevelopment/MartinTestCases/Probleme new file mode 100755 index 000000000..4a69c5d07 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Probleme @@ -0,0 +1,41 @@ +- Sequenz-Diagramme fuer TR-Algorithmen +- In der GUI werden bei der Auswahl bei Typisierungen mehrerer Klassen immer nur die Typisierung der einzelnen Klasse angepasst (Use-Rase ZweiKlassen.jav) +- Bound bleiben in der GUI erhalten auch wenn durch Auswahl die Bounds gar nicht mehr existieren (Use-Rase BoundedType2.jav) +- Parameter gehen nicht Matrix Use-Rase +- gleiche TypePlaceHolder in unterschiedlichen Intersections werden durch unterschiedliche GentypeVars ersetzt (BoundedType2.jav) +- Mail von Juergen, welche Usecases machen ihm Probleme? +- UsedId bei bei "extends" in RefType bzw. bei "implements" in Vector umwandeln. (siehe mail an Timo) +- Roundtrip fuer den Innovator einbauen erledigt 06-06 +- Schnittstelle mit syntaktischen Angaben fuer den Konstantenpool wird bei unbeboxten Typen nicht richtig erzeugt +- Boxing und Unboxing geht noch nicht bei allen primitiven Typen und Operatoren +-------------------------------------------------------------------------------------------------- +- makeFC testen durch Verschiebung von TyploseVaribale yu GentypeVar + sind Probleme entstanden PL 06-03-16 +- Alle UseCases noch mit Vervielfachung testen +- Codeerzeugung: called_method +- Returntyp void UsecaseThree_pl.jav ERLEDIGT Fehler in Void.java 05-07-31 +- Parameter in Typen: Werden die �berhaupt betrachtet? UsecaseTwo_pl.jav +- Die Argumente bei UsedId Konstruktion f�r die Parameter in dem Attribut paralist von Typen + sind immer GenericTypeVars, k�nnten aber auch Typen wie Integer als RefTypes sein. + In der Methode wandleGeneric2RefType (MyCompiler) werden nur die GenericTypeVars + der Superklassen-Deklarationen angepasst. Hier muessten alle expliziten Typdeklarationen + im gesamten abstrakten Syntaxbaum angepasst werden. Koennte ueber eine Registry + und die Listener realisiert werden. ERLEDIGT SourceFile.java 05-07-31 +- getypte Variablen werden nicht richtig gesetzt UsecaseFive_pl.jav ERLEDIGT JavaParser.jay 05-07-30 + +- UNIFY funktioniert nicht mit GenericTypeVars UsecaseOne_pl.jav +- Einschränkungen bei TRMAPP von noch einbauen. +- a.b wird als Expression nicht in InstVar umgewandelt, sondern bleibt LocalOrFieldVar mit UsedId UsecaseNine_pl.jav + wird inzwischen bei zwei Identifieren umgewandelt. Mit mehr testen +- In Usecase UsecaseNine_pl.jav wird der Parameter bei der Klasse bei b nicht bestimmt. +- Braucht man das Field type vom Typ String in InstVar.java? +- in Assign stimmt der Typ von Assign nicht (Beispiel Matrix1.jav in bajo) +- unifyAndregister in allen Subklassen von ExprStmt durch register ersetzen. erledigt 05-08-21 +- Class.java: m_MethodIntersectionTypes wird in CTypeReconstructionResult nicht richtig gestetzt. + Beispiel Matrix.jav in bajo1_usecases +- clone in alle Subklassen von CTypeAssumption ueberpruefen. +- Was ist der Unterschied zwischen RefType.clone() und Pair.copyType +- in instanceSmaller neuhinzugekommene GENTYPEVARS durch typlose Vars ersetzen. +- EST95A anschauen. Insbesondere: Wann ist this View und wann GView? + siehe SubtypeingTest this wird immer dynamisch angepasst. Auch in + der Theorie aendern \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/SMatrix.jav b/test/plugindevelopment/MartinTestCases/SMatrix.jav new file mode 100755 index 000000000..80dd631ab --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/SMatrix.jav @@ -0,0 +1,11 @@ +import java.util.Vector; + +class Matrix extends Vector> { + + mul(){ + Vector> ret1; + Vector ret; + return ret; + } + +} diff --git a/test/plugindevelopment/MartinTestCases/Simple.jav b/test/plugindevelopment/MartinTestCases/Simple.jav new file mode 100755 index 000000000..312e8a885 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Simple.jav @@ -0,0 +1,10 @@ +class Simple { + + simple(a) { + return 1; + } + + main(a) { + return a; + } +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/Tester.java b/test/plugindevelopment/MartinTestCases/Tester.java new file mode 100644 index 000000000..2f9778e06 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Tester.java @@ -0,0 +1,95 @@ +package plugindevelopment.MartinTestCases; + +import java.io.File; +import java.io.IOException; +import java.util.Vector; + +import org.junit.Test; + +import plugindevelopment.TypeInsertTester; +import plugindevelopment.TypeInsertTests.MultipleTypesInsertTester; +import junit.framework.TestCase; +import mycompiler.MyCompiler; +import mycompiler.MyCompilerAPI; +import mycompiler.myparser.JavaParser.yyException; +import mycompiler.mytypereconstruction.TypeinferenceResultSet; +import typinferenz.typedeployment.TypeInsertSet; + +public class Tester extends TypeInsertTester{ + + public final static String rootDirectory = System.getProperty("user.dir")+"/test/plugindevelopment/MartinTestCases/"; + + public static void test(String sourceFileToInfere, Vector mustContain){ + String gesamterSrc = ""; + String inferedSource = ""; + MyCompilerAPI compiler = MyCompiler.getAPI(); + try { + compiler.parse(new File(rootDirectory + sourceFileToInfere)); + Vector results = compiler.typeReconstruction(); + //TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); + for(TypeinferenceResultSet result : results){ + TypeInsertSet point = result.getTypeInsertionPoints(); + //TestCase.assertTrue("Es muss mindestens ein TypeInsertSet vorhanden sein", points.size()>0); + + //TestCase.assertTrue("Es muss mindestens ein TypeInsertPoint vorhanden sein", point.points.size()>0); + if(point.points.size()>0){ + inferedSource = point.insertAllTypes(TypeInsertTester.getFileContent(rootDirectory + sourceFileToInfere)); + System.out.println(inferedSource); + gesamterSrc += inferedSource; + } + + } + + } catch (IOException | yyException e) { + e.printStackTrace(); + TestCase.fail(); + } + for(String containString : mustContain){ + TestCase.assertTrue("\""+containString+"\" muss in den inferierten Lösungen vorkommen",gesamterSrc.contains(containString)); + } + } + + @Test + public void runTests(){ + Vector testFiles = new Vector(); + //testFiles.add("OL3.jav"); + testFiles.add("Plus1_Float_Double.jav"); + /* + testFiles.add("AchimTest1.jav"); + testFiles.add("MatrixWhile.jav"); + //testFiles.add("BoundedType1.jav"); + testFiles.add("BoundedType2.jav"); + testFiles.add("BoundedType.jav"); + + testFiles.add("OL2.jav"); + testFiles.add("OL.jav"); + testFiles.add("Simple.jav"); + testFiles.add("SMatrix.jav"); + testFiles.add("UnifyTest1.jav"); + testFiles.add("UsecaseEight_pl.jav"); + testFiles.add("UsecaseFive_pl.jav"); + testFiles.add("UsecaseFour_pl.jav"); + testFiles.add("Usecase_MUBTest1.jav"); + testFiles.add("Usecase_MUBTest2.jav"); + testFiles.add("Usecase_MUBTest3.jav"); + testFiles.add("Usecase_MUBTest4.jav"); + testFiles.add("Usecase_MUBTest5.jav"); + testFiles.add("Usecase_MUBTest6.jav"); + testFiles.add("Usecase_MUBTest.jav"); + testFiles.add("UsecaseNine_pl.jav"); + testFiles.add("UsecaseOne_pl.jav"); + testFiles.add("UsecaseSeven_pl.jav"); + testFiles.add("UsecaseSix_pl.jav"); + testFiles.add("UsecaseTen_pl.jav"); + testFiles.add("UsecaseThree_pl.jav"); + testFiles.add("UsecaseThree_pl.orig.jav"); + testFiles.add("UsecaseTwo_pl.jav"); + testFiles.add("ZweiKlassen.jav"); + //*/ + for(String file : testFiles){ + System.out.println("Testfile: "+file); + Tester.test(file, new Vector()); + } + } + +} diff --git a/test/plugindevelopment/MartinTestCases/UnifyTest1.jav b/test/plugindevelopment/MartinTestCases/UnifyTest1.jav new file mode 100755 index 000000000..88d59e586 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/UnifyTest1.jav @@ -0,0 +1,11 @@ +import java.util.Vector; +import java.util.Stack; + + +class Test { + public getValue(a){ + String x; + a.add(x); + } + +} diff --git a/test/plugindevelopment/MartinTestCases/UsecaseEight_pl.jav b/test/plugindevelopment/MartinTestCases/UsecaseEight_pl.jav new file mode 100755 index 000000000..f2395352f --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/UsecaseEight_pl.jav @@ -0,0 +1,10 @@ +class UsecaseEight_pl { + + foo1() { + a; + b; + a = b.foo1(); + return 1; + } + +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/UsecaseFive_pl.jav b/test/plugindevelopment/MartinTestCases/UsecaseFive_pl.jav new file mode 100755 index 000000000..5e25f6d83 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/UsecaseFive_pl.jav @@ -0,0 +1,11 @@ +import java.util.Vector; + +class UsecaseFive_pl { + + foo() { + Vector c; + c = new Vector() ; + return c; + } + +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/UsecaseFour_pl.jav b/test/plugindevelopment/MartinTestCases/UsecaseFour_pl.jav new file mode 100755 index 000000000..b40233f6d --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/UsecaseFour_pl.jav @@ -0,0 +1,9 @@ +class UsecaseFour_pl { + + foo() { + c; + c = new Vector() ; + return c; + } + +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/UsecaseNine_pl.jav b/test/plugindevelopment/MartinTestCases/UsecaseNine_pl.jav new file mode 100755 index 000000000..979b2baad --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/UsecaseNine_pl.jav @@ -0,0 +1,12 @@ +class UsecaseNine_pl { + + Integer c; + + foo1() { + a; + b; + a = b.c; + return 1; + } + +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/UsecaseOne_pl.jav b/test/plugindevelopment/MartinTestCases/UsecaseOne_pl.jav new file mode 100755 index 000000000..cf614cbe7 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/UsecaseOne_pl.jav @@ -0,0 +1,20 @@ +import java.util.Vector; + +class UsecaseOne_pl { + + A x; + + foo(bar){ + bar = true; + return 1; + } +/* + foo1(a) { + c; + c = new Vector(); + b; + b = new UsecaseOne_pl(); + return c.addElement(a); + } +*/ +} diff --git a/test/plugindevelopment/MartinTestCases/UsecaseSeven_pl.jav b/test/plugindevelopment/MartinTestCases/UsecaseSeven_pl.jav new file mode 100755 index 000000000..9833b49be --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/UsecaseSeven_pl.jav @@ -0,0 +1,18 @@ +import java.util.Vector; + +class UsecaseSeven_pl { + + foo(bar){ + bar = true; + return 1; + } + + foo1(a) { + c; + c = new Vector(); + b; + b = new UsecaseSeven_pl(); + return c.addElement(a); + } + +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/UsecaseSix_pl.jav b/test/plugindevelopment/MartinTestCases/UsecaseSix_pl.jav new file mode 100755 index 000000000..e6a1a5cc2 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/UsecaseSix_pl.jav @@ -0,0 +1,5 @@ +class uuu {} +class vvv {} +class UsecaseSix_pl extends Vector> { + +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/UsecaseTen_pl.jav b/test/plugindevelopment/MartinTestCases/UsecaseTen_pl.jav new file mode 100755 index 000000000..3a679aa94 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/UsecaseTen_pl.jav @@ -0,0 +1,14 @@ +import java.util.Vector; + +class UsecaseTen_pl { + + Vector c; + + foo1() { + a; + b; + a = b.c.elementAt(1); + return b; + } + +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/UsecaseThree_pl.jav b/test/plugindevelopment/MartinTestCases/UsecaseThree_pl.jav new file mode 100755 index 000000000..7ce53593a --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/UsecaseThree_pl.jav @@ -0,0 +1,9 @@ +class UsecaseThree_pl { + + foo() { + c; + c = new Vector(); + return c; + } + +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/UsecaseThree_pl.orig.jav b/test/plugindevelopment/MartinTestCases/UsecaseThree_pl.orig.jav new file mode 100755 index 000000000..074acc31f --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/UsecaseThree_pl.orig.jav @@ -0,0 +1,11 @@ +import java.util.Vector; + +class UsecaseThree_pl_org { + + Vector foo() { + Vector c; + c = new Vector(); + return c; + } + +} diff --git a/test/plugindevelopment/MartinTestCases/UsecaseTwo_pl.jav b/test/plugindevelopment/MartinTestCases/UsecaseTwo_pl.jav new file mode 100755 index 000000000..8fbb75e16 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/UsecaseTwo_pl.jav @@ -0,0 +1,11 @@ +class UsecaseTwo_pl { + + foo() { + d; + d = new UsecaseTwo_pl (); + e; + e = d.foo(); + return d; + } + +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/Usecase_MUBTest.jav b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest.jav new file mode 100755 index 000000000..bda38eb28 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest.jav @@ -0,0 +1,12 @@ +class A { } + +class B extends A { + f(Boolean x) { + if (x) { + return new B(); } + else { + return new A(); } + } +} + +class C extends B> {} diff --git a/test/plugindevelopment/MartinTestCases/Usecase_MUBTest1.jav b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest1.jav new file mode 100755 index 000000000..cfe0e30e8 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest1.jav @@ -0,0 +1,17 @@ + + +class A { } + +class B extends A { + f(Boolean x) { + if (x) { + return new B(); } + else { + return new A(); } + } +} + +class C extends B> {} + + + diff --git a/test/plugindevelopment/MartinTestCases/Usecase_MUBTest2.jav b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest2.jav new file mode 100755 index 000000000..08e66aed6 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest2.jav @@ -0,0 +1,13 @@ +class A { } + +class B extends A { + f(x) { + a; + if (x) { + return new C(); } + else { + return a; } + } +} + +class C extends B> {} diff --git a/test/plugindevelopment/MartinTestCases/Usecase_MUBTest3.jav b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest3.jav new file mode 100755 index 000000000..fc7a33cd3 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest3.jav @@ -0,0 +1,14 @@ +class A { } + +class B extends A { + f(x) { + a; + b; + if (x) { + return a; } + else { + return b; } + } +} + +class C extends B> {} diff --git a/test/plugindevelopment/MartinTestCases/Usecase_MUBTest4.jav b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest4.jav new file mode 100755 index 000000000..0325a6008 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest4.jav @@ -0,0 +1,12 @@ +class A { } + +class B extends A { + f(Boolean x) { + if (x) { + return new B(); } + else { + return new C(); } + } +} + +class C extends B> {} diff --git a/test/plugindevelopment/MartinTestCases/Usecase_MUBTest5.jav b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest5.jav new file mode 100755 index 000000000..c1b2b19b6 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest5.jav @@ -0,0 +1,12 @@ +class A { } + +class B extends A { + f(Boolean x) { + if (x) { + return new B(); } + else { + return new C(); } + } +} + +class C extends B> {} diff --git a/test/plugindevelopment/MartinTestCases/Usecase_MUBTest6.jav b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest6.jav new file mode 100755 index 000000000..2d494563d --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/Usecase_MUBTest6.jav @@ -0,0 +1,9 @@ +class Test2 { + public meth(){ + if(true) { + return(1); + }else{ + return(2); + } + } +} diff --git a/test/plugindevelopment/MartinTestCases/ZweiKlassen.jav b/test/plugindevelopment/MartinTestCases/ZweiKlassen.jav new file mode 100755 index 000000000..2e3968848 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/ZweiKlassen.jav @@ -0,0 +1,17 @@ +import java.util.Vector; + +class ZweiKlassen { + + foo() { + c; + c = new Vector() ; + return c; + } + +} + +class X { + ZweiKlassen bb; + + foo2() { return bb.foo();} +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Fehler Report b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Fehler Report new file mode 100644 index 000000000..246508723 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Fehler Report @@ -0,0 +1,37 @@ +Allgemeine Probleme: + +- Argument von lambda-Aussdrücken hat falsche Typvar: Könnte das darin liegen, + dass die Typvar auch in der abstrakten Syntax gelöscht wird? + +- unnötige constraints entfernen + +- Textmarker werden, beim speichern nicht gelöscht, es wird einfach der neue + Text hinzugefügt + +Dateien: + +- Id.jav: funktioniert + +- Matrix_lambda.jav: es bleiben TPH im Typ stehen. + TPH IM müsste irgend Supertyp von Matrix (this) sein. + +- MethodId.jav: funktioniert; + +- MethodIntegerUse.jav: funktioniert; + +- MethodUse.jav: funktioniert; + +- OL.jav: + * java.lang.Float funktioniert als Return-Typ nicht: Parseerror + * wenn man beim ersten m einen Typ auswählt wird der vom zweiten m eingetragen + warum? + In der zweiten Klasse kann man nach dem eintragen nichts mehr auswählen + * Wenn man in der zweiten Klassen einen Typ auswählt kann man in der ersten + nichts mehr auswählen. Was wird eigetragen? + +- Plus1_Float_Double.jav: Syntax-Error und Nullpointer-Exception + +- Plus1.jav: funktioniert; Frage: gibt es keinen anderen Typ mit +1? + + + diff --git a/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Id.jav b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Id.jav new file mode 100644 index 000000000..d2293b4b8 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Id.jav @@ -0,0 +1,3 @@ +class Id { + Fun1 op = (x) -> x; + } \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/MatrixVectorMul.jav b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/MatrixVectorMul.jav new file mode 100644 index 000000000..5aa6ee451 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/MatrixVectorMul.jav @@ -0,0 +1,14 @@ +import java.util.Vector; + +class Matrix extends Vector> { + + mvmul(Vector v) { + i; + ele; + v.add(1); + while (i < v.size()) { + + ele = 5 + v.elementAt(i); + } + } +} diff --git a/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Matrix_lambda.jav b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Matrix_lambda.jav new file mode 100644 index 000000000..f9d2f4e06 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Matrix_lambda.jav @@ -0,0 +1,5 @@ +import java.util.Vector; + +class Matrix extends Vector> { + Fun1>, Matrix> op = (Matrix m) -> (f) -> f.apply(this, m); +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/MethodId.jav b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/MethodId.jav new file mode 100644 index 000000000..f8f44dec3 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/MethodId.jav @@ -0,0 +1,6 @@ +class MethodId { + + US m (UR x) { + return x; + } + } \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/MethodIntegerUse.jav b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/MethodIntegerUse.jav new file mode 100644 index 000000000..11f2c06bc --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/MethodIntegerUse.jav @@ -0,0 +1,8 @@ +class MethodIntegerUse { + Fun1 op = (x) -> m(x); + + + Integer m (Integer x) { + return x; + } + } \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/MethodUse.jav b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/MethodUse.jav new file mode 100644 index 000000000..1349b7ff7 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/MethodUse.jav @@ -0,0 +1,8 @@ +class MethodUse { + Fun1 op = (x) -> m(x); + + + AP m (AO x) { + return x; + } + } \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/OL.jav b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/OL.jav new file mode 100644 index 000000000..65b5f88f3 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/OL.jav @@ -0,0 +1,19 @@ + +class OL { + + java.lang.Float m(java.lang.Float x) { return x + x; } + + java.lang.Boolean m(java.lang.Boolean x) {return x || x; } +} + + + +class Main { + + main(x) { + ol; + ol = new OL(); + return ol.m(x); + } + +} diff --git a/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Plus1.jav b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Plus1.jav new file mode 100644 index 000000000..6b0ca749a --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Plus1.jav @@ -0,0 +1,3 @@ +class Plus1 { + Fun1 op = (x) -> x+1; + } \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Plus1_Float_Double.jav b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Plus1_Float_Double.jav new file mode 100644 index 000000000..75c3baad7 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/jav/Lambda_usecases/Plus1_Float_Double.jav @@ -0,0 +1,3 @@ +class Plus1_Float_Double { + op = (x) -> x+1.0; + } \ No newline at end of file diff --git a/test/plugindevelopment/MethodTypeInsertTest.jav b/test/plugindevelopment/MethodTypeInsertTest.jav new file mode 100644 index 000000000..03b20bc8f --- /dev/null +++ b/test/plugindevelopment/MethodTypeInsertTest.jav @@ -0,0 +1,6 @@ + +class VariableTypeInsertTest{ + methode(){ + return "String"; + } +} diff --git a/test/plugindevelopment/MethodTypeInsertTest.java b/test/plugindevelopment/MethodTypeInsertTest.java new file mode 100644 index 000000000..cf9c5aef0 --- /dev/null +++ b/test/plugindevelopment/MethodTypeInsertTest.java @@ -0,0 +1,16 @@ +package plugindevelopment; + +import org.junit.Test; + +public class MethodTypeInsertTest { + + + private static final String TEST_FILE = "MethodTypeInsertTest.jav"; + private static final String SOLUTION_FILE = "MethodTypeInsertTestSolution.jav"; + + @Test + public void run(){ + TypeInsertTester.test(this.TEST_FILE, this.SOLUTION_FILE); + } + +} diff --git a/test/plugindevelopment/MethodTypeInsertTestSolution.jav b/test/plugindevelopment/MethodTypeInsertTestSolution.jav new file mode 100644 index 000000000..4246f9536 --- /dev/null +++ b/test/plugindevelopment/MethodTypeInsertTestSolution.jav @@ -0,0 +1,6 @@ + +class VariableTypeInsertTest{ + String methode(){ + return "String"; + } +} diff --git a/test/plugindevelopment/ParameterInsertTest.java b/test/plugindevelopment/ParameterInsertTest.java new file mode 100644 index 000000000..63b108196 --- /dev/null +++ b/test/plugindevelopment/ParameterInsertTest.java @@ -0,0 +1,13 @@ +package plugindevelopment; + +import org.junit.Test; + +public class ParameterInsertTest { + private static final String TEST_FILE = "ParameterTypeInsertTest.jav"; + private static final String SOLUTION_FILE = "ParameterTypeInsertTestSolution.jav"; + + @Test + public void run(){ + TypeInsertTester.test(this.TEST_FILE, this.SOLUTION_FILE); + } +} diff --git a/test/plugindevelopment/ParameterTypeInsertTest.jav b/test/plugindevelopment/ParameterTypeInsertTest.jav new file mode 100644 index 000000000..9a2405af3 --- /dev/null +++ b/test/plugindevelopment/ParameterTypeInsertTest.jav @@ -0,0 +1,7 @@ + +class VariableTypeInsertTest{ + String var; + void methode(test){ + var = test; + } +} diff --git a/test/plugindevelopment/ParameterTypeInsertTestSolution.jav b/test/plugindevelopment/ParameterTypeInsertTestSolution.jav new file mode 100644 index 000000000..4a53daa8f --- /dev/null +++ b/test/plugindevelopment/ParameterTypeInsertTestSolution.jav @@ -0,0 +1,7 @@ + +class VariableTypeInsertTest{ + String var; + void methode(java.lang.String test){ + var = test; + } +} diff --git a/test/plugindevelopment/SingleTypeInsertTest.jav b/test/plugindevelopment/SingleTypeInsertTest.jav new file mode 100644 index 000000000..8039f8972 --- /dev/null +++ b/test/plugindevelopment/SingleTypeInsertTest.jav @@ -0,0 +1,3 @@ +class Test{ +var; +} \ No newline at end of file diff --git a/test/plugindevelopment/SyntaxTreeTests.java b/test/plugindevelopment/SyntaxTreeTests.java new file mode 100644 index 000000000..105897a1c --- /dev/null +++ b/test/plugindevelopment/SyntaxTreeTests.java @@ -0,0 +1,7 @@ +package plugindevelopment; + +public class SyntaxTreeTests { + + //TODO: Hier tests für getChildren anfügen. + +} diff --git a/test/plugindevelopment/TRMEqualTest.java b/test/plugindevelopment/TRMEqualTest.java new file mode 100644 index 000000000..c10221f27 --- /dev/null +++ b/test/plugindevelopment/TRMEqualTest.java @@ -0,0 +1,125 @@ +package plugindevelopment; + +import static org.junit.Assert.*; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Vector; + +import org.junit.Test; + +import junit.framework.TestCase; +import mycompiler.MyCompiler; +import mycompiler.MyCompilerAPI; +import mycompiler.myparser.JavaParser.yyException; +import mycompiler.mytype.Pair; +import mycompiler.mytype.Pair.PairOperator; +import mycompiler.mytype.RefType; +import mycompiler.mytype.Type; +import mycompiler.mytype.TypePlaceholder; +import mycompiler.mytypereconstruction.TypeinferenceResultSet; +import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent; +import typinferenz.ResultSet; +import typinferenz.TypeInsertable; +import typinferenz.typedeployment.TypeInsertPoint; +import typinferenz.typedeployment.TypeInsertSet; + +public class TRMEqualTest { + Vector replaceSet = new Vector(); + TestNode node; + TypePlaceholder tph; + + + public void initTRMEqualTest(){ + node = new TestNode(); + tph = TypePlaceholder.fresh(node); + node.setType(tph); + } + + @Test + public void test(){ + initTRMEqualTest(); + assertTrue("Zu Beginn ist das Set leer",replaceSet.size()==0); + addTestNode("Typ1"); + assertTrue("Nach dem Anfügen eines Type muss das Set 1 Element enthalten",replaceSet.size()==1); + addTestNode("Typ2"); + assertTrue("Nach dem Anfügen eines weiteren Typs muss das Set 2 Elemente enthalten und nicht "+replaceSet.size(),replaceSet.size()==2); + addTestNode("Typ1"); + assertTrue("Nach dem Anfügen des selben Typs wie zuvor muss das Set immer noch 2 Element enthalten. Und nicht "+replaceSet.size(),replaceSet.size()==2); + } + + private void addTestNode(String type){ + Vector resultContent = new Vector(); + Pair pair = new Pair(tph,new RefType(type,0)); + pair.SetOperator(PairOperator.Equal); + resultContent.add(pair); + ResultSet resultSet = new ResultSet(resultContent); + Vector tphs = tph.getTypeInsertPoints(resultSet); + TypeInsertSet toAdd = new TypeInsertSet(resultSet); + for(TypeInsertPoint tip : tphs){ + toAdd.add(tip); + } + System.out.println("Füge hinzu: "+toAdd); + if(!replaceSet.contains(toAdd))replaceSet.add(toAdd); + } +} + +class TestNode implements TypeInsertable{ + + @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 setType(Type typ) { + // TODO Auto-generated method stub + + } + + @Override + public Type getType() { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getOffset() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void setOffset(int offset) { + // TODO Auto-generated method stub + + } + + @Override + public String getIdentifier() { + // TODO Auto-generated method stub + return null; + } + + @Override + public TypeInsertPoint createTypeInsertPoint(TypePlaceholder tph, + ResultSet resultSet) { + return new TypeInsertPoint( this, resultSet.getTypeEqualTo(tph), resultSet); + } + + @Override + public int getVariableLength() { + // TODO Auto-generated method stub + return 0; + } + +} + diff --git a/test/plugindevelopment/TypeInsertSetEqualTest.jav b/test/plugindevelopment/TypeInsertSetEqualTest.jav new file mode 100644 index 000000000..cf9cf8bae --- /dev/null +++ b/test/plugindevelopment/TypeInsertSetEqualTest.jav @@ -0,0 +1,10 @@ +import java.util.Vector; + +class ImportTest{ +Vector var; +var2; +methode(){ + var.add(var2); +} + +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertSetEqualTest.java b/test/plugindevelopment/TypeInsertSetEqualTest.java new file mode 100644 index 000000000..592a9f1e2 --- /dev/null +++ b/test/plugindevelopment/TypeInsertSetEqualTest.java @@ -0,0 +1,48 @@ +package plugindevelopment; + +import java.io.File; +import java.io.IOException; +import java.util.Vector; + +import junit.framework.TestCase; +import mycompiler.MyCompiler; +import mycompiler.MyCompilerAPI; +import mycompiler.myparser.JavaParser.yyException; +import mycompiler.mytypereconstruction.TypeinferenceResultSet; + +import org.junit.Test; + +import typinferenz.typedeployment.TypeInsertSet; + +public class TypeInsertSetEqualTest { + + + private static final String TEST_FILE = "TypeInsertSetEqualTest.jav"; + + @Test + public void run(){ + String inferedSource = ""; + MyCompilerAPI compiler = MyCompiler.getAPI(); + try { + compiler.parse(new File(TypeInsertTester.rootDirectory + TEST_FILE)); + Vector results = compiler.typeReconstruction(); + //TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); + Vector insertSets = new Vector(); + for(TypeinferenceResultSet result : results){ + TypeInsertSet point = result.getTypeInsertionPoints(); + if(!insertSets.contains(point))insertSets.add(point); + //TestCase.assertTrue("Es muss mindestens ein TypeInsertSet vorhanden sein", points.size()>0); + + } + if(insertSets.size()!=1){ + TestCase.fail("Es darf nur ein TypeInsertSet geben und nicht "+insertSets.size()); + } + + } catch (IOException | yyException e) { + e.printStackTrace(); + TestCase.fail(); + } + + } + +} diff --git a/test/plugindevelopment/TypeInsertTester.java b/test/plugindevelopment/TypeInsertTester.java new file mode 100644 index 000000000..f1129eac2 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTester.java @@ -0,0 +1,76 @@ +package plugindevelopment; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Vector; + +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.FileAppender; +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.apache.log4j.PatternLayout; +import org.apache.log4j.SimpleLayout; + +import typinferenz.typedeployment.TypeInsertPoint; +import typinferenz.typedeployment.TypeInsertSet; +import junit.framework.TestCase; +import mycompiler.MyCompiler; +import mycompiler.MyCompilerAPI; +import mycompiler.myparser.JavaParser.yyException; +import mycompiler.mytest.LambdaTest; +import mycompiler.mytypereconstruction.TypeinferenceResultSet; + + +public class TypeInsertTester{ + + private static Logger inferencelog = Logger.getLogger("Typeinference"); + static{ + { + // Ausgabeoptionen fuer die Logger + ConsoleAppender logAppender = new ConsoleAppender(new SimpleLayout()); + logAppender.setTarget("System.out"); + logAppender.activateOptions(); + inferencelog.addAppender(logAppender); //Bei den Tests wird der Log auch in System.out geschrieben. + } + } + static final String rootDirectory = System.getProperty("user.dir")+"/test/plugindevelopment/"; + + public static void test(String sourceFileToInfere, String solutionFile){ + String inferedSource = ""; + MyCompilerAPI compiler = MyCompiler.getAPI(); + try { + compiler.parse(new File(rootDirectory + sourceFileToInfere)); + Vector results = compiler.typeReconstruction(); + TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); + for(TypeinferenceResultSet result : results){ + TypeInsertSet point = result.getTypeInsertionPoints(); + //TestCase.assertTrue("Es muss mindestens ein TypeInsertSet vorhanden sein", points.size()>0); + if(point.points.size()>0){ + inferedSource = point.insertAllTypes(getFileContent(rootDirectory + sourceFileToInfere)); + String solutionSource = getFileContent(rootDirectory + solutionFile); + System.out.println("\nInferierter Source:\n"+inferedSource); + TestCase.assertTrue("Nicht das erwartete Ergebnis", inferedSource.equals(solutionSource)); + } + } + + } catch (IOException | yyException e) { + e.printStackTrace(); + TestCase.fail(); + } + } + + //Source: https://stackoverflow.com/questions/326390/how-to-create-a-java-string-from-the-contents-of-a-file + //PS: benötigt Java 7 + public static String getFileContent(String path)throws IOException + { + byte[] encoded = Files.readAllBytes(Paths.get(path)); + return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(encoded)).toString(); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/BoundedGenericTest.jav b/test/plugindevelopment/TypeInsertTests/BoundedGenericTest.jav new file mode 100644 index 000000000..a3991d785 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/BoundedGenericTest.jav @@ -0,0 +1,6 @@ +class BoundedGenericTest{ + var; + B methode(){ + return var; + } +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/BoundedGenericsTest.java b/test/plugindevelopment/TypeInsertTests/BoundedGenericsTest.java new file mode 100644 index 000000000..6e2c772c8 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/BoundedGenericsTest.java @@ -0,0 +1,16 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class BoundedGenericsTest { + private static final String TEST_FILE = "BoundedGenericTest.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + mustContain.add("java.lang.String var"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } +} diff --git a/test/plugindevelopment/TypeInsertTests/FunNInsertTest.jav b/test/plugindevelopment/TypeInsertTests/FunNInsertTest.jav new file mode 100644 index 000000000..ba2dbbd99 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/FunNInsertTest.jav @@ -0,0 +1,18 @@ +class FunNInsertTest{ + + Object1 var1; + Object2 var2; + Object3 var3; + op = (a) -> (b) -> (c) -> { + var1 = a; + var2 = b; + var3 = c; + }; + + + +} + +class Object1{} +class Object2{} +class Object3{} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/FunNInsertTest.java b/test/plugindevelopment/TypeInsertTests/FunNInsertTest.java new file mode 100644 index 000000000..161e4e80e --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/FunNInsertTest.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class FunNInsertTest { + + private static final String TEST_FILE = "FunNInsertTest.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + mustContain.add("Fun1, Object2>, Object1> op"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/GenericParaListInsertTest.jav b/test/plugindevelopment/TypeInsertTests/GenericParaListInsertTest.jav new file mode 100644 index 000000000..e3c98b2b3 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/GenericParaListInsertTest.jav @@ -0,0 +1,3 @@ +class GenericParaListInsertTest{ +methode(a){return a;} +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/GenericParaListInsertTest.java b/test/plugindevelopment/TypeInsertTests/GenericParaListInsertTest.java new file mode 100644 index 000000000..d88ca52cc --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/GenericParaListInsertTest.java @@ -0,0 +1,16 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class GenericParaListInsertTest { + private static final String TEST_FILE = "GenericParaListInsertTest.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + mustContain.add("<"); //Es muss eine Parameterliste generiert werden. + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } +} diff --git a/test/plugindevelopment/TypeInsertTests/GenericTypeVarTest.jav b/test/plugindevelopment/TypeInsertTests/GenericTypeVarTest.jav new file mode 100644 index 000000000..6c08eff52 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/GenericTypeVarTest.jav @@ -0,0 +1,11 @@ +class GTVTest{ +GTVTest2 var; + +methode(){ + return var.var2; +} +} + +class GTVTest2{ + GTV2 var2; +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/GenericTypeVarTest.java b/test/plugindevelopment/TypeInsertTests/GenericTypeVarTest.java new file mode 100644 index 000000000..46e1c93db --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/GenericTypeVarTest.java @@ -0,0 +1,25 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class GenericTypeVarTest { + + private static final String TEST_FILE = "GenericTypeVarTest.jav"; + private static final String TEST_FILE2 = "GenericTypeVarTest2.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + mustContain.add("String methode"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + + @Test + public void run2(){ + Vector mustContain = new Vector(); + mustContain.add("String var2"); + MultipleTypesInsertTester.test(TEST_FILE2, mustContain); + } +} diff --git a/test/plugindevelopment/TypeInsertTests/GenericTypeVarTest2.jav b/test/plugindevelopment/TypeInsertTests/GenericTypeVarTest2.jav new file mode 100644 index 000000000..30a9b171a --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/GenericTypeVarTest2.jav @@ -0,0 +1,14 @@ +class GTVTest{ +GTVTest2 var; +var2; + +methode(){ + return var.test(var2); +} +} + +class GTVTest2{ + test(GTV2 param){ + return param; + } +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/GenericVarInsertTest.jav b/test/plugindevelopment/TypeInsertTests/GenericVarInsertTest.jav new file mode 100644 index 000000000..3f552dbca --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/GenericVarInsertTest.jav @@ -0,0 +1,3 @@ +class GenericVarInsertTest{ + op = (m) -> (f) -> f; +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/GenericVarInsertTest.java b/test/plugindevelopment/TypeInsertTests/GenericVarInsertTest.java new file mode 100644 index 000000000..453e46e71 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/GenericVarInsertTest.java @@ -0,0 +1,16 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class GenericVarInsertTest { + private static final String TEST_FILE = "GenericVarInsertTest.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + mustContain.add("Fun1, Object2>, Object1> op"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } +} diff --git a/test/plugindevelopment/TypeInsertTests/ImportTest.jav b/test/plugindevelopment/TypeInsertTests/ImportTest.jav new file mode 100644 index 000000000..cf9cf8bae --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/ImportTest.jav @@ -0,0 +1,10 @@ +import java.util.Vector; + +class ImportTest{ +Vector var; +var2; +methode(){ + var.add(var2); +} + +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/ImportTest.java b/test/plugindevelopment/TypeInsertTests/ImportTest.java new file mode 100644 index 000000000..54fd6612a --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/ImportTest.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class ImportTest { + + private static final String TEST_FILE = "ImportTest.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + mustContain.add("String var2"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/ImportTest2.jav b/test/plugindevelopment/TypeInsertTests/ImportTest2.jav new file mode 100644 index 000000000..1e112c525 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/ImportTest2.jav @@ -0,0 +1,10 @@ +import java.util.Vector; + +class ImportTest{ +var; + +void methode(a){ + var.add(a); +} + +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/ImportTest2.java b/test/plugindevelopment/TypeInsertTests/ImportTest2.java new file mode 100644 index 000000000..7d241e6aa --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/ImportTest2.java @@ -0,0 +1,17 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class ImportTest2 { + + private static final String TEST_FILE = "ImportTest2.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/IntTest.jav b/test/plugindevelopment/TypeInsertTests/IntTest.jav new file mode 100644 index 000000000..305772949 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/IntTest.jav @@ -0,0 +1,6 @@ +class IntTest{ + var; + int methode(){ + return var; + } +} diff --git a/test/plugindevelopment/TypeInsertTests/IntTest.java b/test/plugindevelopment/TypeInsertTests/IntTest.java new file mode 100644 index 000000000..8020e6673 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/IntTest.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class IntTest { + + private static final String TEST_FILE = "IntTest.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + mustContain.add("int var"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest1.jav b/test/plugindevelopment/TypeInsertTests/LambdaTest1.jav new file mode 100644 index 000000000..9df778187 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest1.jav @@ -0,0 +1,10 @@ +class LambdaTest{ + +String var; + +op = () -> (f) -> { + f.apply(this,var); + return var; +}; + +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest1.java b/test/plugindevelopment/TypeInsertTests/LambdaTest1.java new file mode 100644 index 000000000..f9d3f0c20 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest1.java @@ -0,0 +1,19 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class LambdaTest1 { + + private static final String TEST_FILE = "LambdaTest1.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + + mustContain.add("Fun0>> op"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest10.jav b/test/plugindevelopment/TypeInsertTests/LambdaTest10.jav new file mode 100644 index 000000000..a1e40a2d7 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest10.jav @@ -0,0 +1,9 @@ +class Test{ + +m; + + CT methode(){ +return m; +} + +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest10.java b/test/plugindevelopment/TypeInsertTests/LambdaTest10.java new file mode 100644 index 000000000..ef9af4c80 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest10.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class LambdaTest10 { + + private static final String TEST_FILE = "LambdaTest10.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + //mustContain.add("A a"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest2.jav b/test/plugindevelopment/TypeInsertTests/LambdaTest2.jav new file mode 100644 index 000000000..ca670b4d4 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest2.jav @@ -0,0 +1,5 @@ +class LambdaTest{ + +Fun1, S>>, S> op = (m) -> (f) -> f.apply(this,m); + +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest2.java b/test/plugindevelopment/TypeInsertTests/LambdaTest2.java new file mode 100644 index 000000000..9cd8ef035 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest2.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class LambdaTest2 { + + private static final String TEST_FILE = "LambdaTest2.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + //mustContain.add("S m"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest3.jav b/test/plugindevelopment/TypeInsertTests/LambdaTest3.jav new file mode 100644 index 000000000..64a50f566 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest3.jav @@ -0,0 +1,5 @@ +class LambdaTest{ +var; +Fun0 op = () -> {return var;}; + +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest3.java b/test/plugindevelopment/TypeInsertTests/LambdaTest3.java new file mode 100644 index 000000000..e7b8f4ba9 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest3.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class LambdaTest3 { + + private static final String TEST_FILE = "LambdaTest3.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + mustContain.add("String var"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest4.jav b/test/plugindevelopment/TypeInsertTests/LambdaTest4.jav new file mode 100644 index 000000000..34c32b1dd --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest4.jav @@ -0,0 +1,5 @@ +class LambdaTest{ + +Fun1 op = (var) -> {return var;}; + +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest4.java b/test/plugindevelopment/TypeInsertTests/LambdaTest4.java new file mode 100644 index 000000000..b54765122 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest4.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class LambdaTest4 { + + private static final String TEST_FILE = "LambdaTest4.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + mustContain.add("String var"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest5.jav b/test/plugindevelopment/TypeInsertTests/LambdaTest5.jav new file mode 100644 index 000000000..5476e7b30 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest5.jav @@ -0,0 +1,5 @@ +class LambdaTest{ + +Fun1 op = (var) -> {return var;}; + +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest5.java b/test/plugindevelopment/TypeInsertTests/LambdaTest5.java new file mode 100644 index 000000000..34cc8c9ec --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest5.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class LambdaTest5 { + + private static final String TEST_FILE = "LambdaTest5.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + //mustContain.add("A var"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest6.jav b/test/plugindevelopment/TypeInsertTests/LambdaTest6.jav new file mode 100644 index 000000000..ba1d552ab --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest6.jav @@ -0,0 +1,3 @@ +class Matrix{ + op = (m) -> (f) -> f.apply(this, m); +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest6.java b/test/plugindevelopment/TypeInsertTests/LambdaTest6.java new file mode 100644 index 000000000..6ba600d12 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest6.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class LambdaTest6 { + + private static final String TEST_FILE = "LambdaTest6.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + //mustContain.add("A var"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest7.jav b/test/plugindevelopment/TypeInsertTests/LambdaTest7.jav new file mode 100644 index 000000000..760677873 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest7.jav @@ -0,0 +1,3 @@ +class Test7{ + void testMethode(a){} +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest7.java b/test/plugindevelopment/TypeInsertTests/LambdaTest7.java new file mode 100644 index 000000000..f29dabdf7 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest7.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class LambdaTest7 { + + private static final String TEST_FILE = "LambdaTest7.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + //mustContain.add("A a"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest8.jav b/test/plugindevelopment/TypeInsertTests/LambdaTest8.jav new file mode 100644 index 000000000..0df204987 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest8.jav @@ -0,0 +1,3 @@ +class Plus1 { + op = (x) -> x+1; + } \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest8.java b/test/plugindevelopment/TypeInsertTests/LambdaTest8.java new file mode 100644 index 000000000..04e85bf29 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest8.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class LambdaTest8 { + + private static final String TEST_FILE = "LambdaTest8.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + //mustContain.add("A a"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest9.jav b/test/plugindevelopment/TypeInsertTests/LambdaTest9.jav new file mode 100644 index 000000000..cb1643634 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest9.jav @@ -0,0 +1,6 @@ +class MethodId { + + m (x) { + return x; + } +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest9.java b/test/plugindevelopment/TypeInsertTests/LambdaTest9.java new file mode 100644 index 000000000..ca336ef59 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest9.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class LambdaTest9 { + + private static final String TEST_FILE = "LambdaTest9.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + //mustContain.add("A a"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/MultipleTypesInsertTester.java b/test/plugindevelopment/TypeInsertTests/MultipleTypesInsertTester.java new file mode 100644 index 000000000..16229e7b1 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/MultipleTypesInsertTester.java @@ -0,0 +1,49 @@ +package plugindevelopment.TypeInsertTests; + +import java.io.File; +import java.io.IOException; +import java.util.Vector; + +import plugindevelopment.TypeInsertTester; +import junit.framework.TestCase; +import mycompiler.MyCompiler; +import mycompiler.MyCompilerAPI; +import mycompiler.myparser.JavaParser.yyException; +import mycompiler.mytypereconstruction.TypeinferenceResultSet; +import typinferenz.typedeployment.TypeInsertSet; + +public class MultipleTypesInsertTester extends TypeInsertTester{ + + public final static String rootDirectory = System.getProperty("user.dir")+"/test/plugindevelopment/TypeInsertTests/"; + + public static void test(String sourceFileToInfere, Vector mustContain){ + String gesamterSrc = ""; + String inferedSource = ""; + MyCompilerAPI compiler = MyCompiler.getAPI(); + try { + compiler.parse(new File(rootDirectory + sourceFileToInfere)); + Vector results = compiler.typeReconstruction(); + //TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); + for(TypeinferenceResultSet result : results){ + TypeInsertSet point = result.getTypeInsertionPoints(); + //TestCase.assertTrue("Es muss mindestens ein TypeInsertSet vorhanden sein", points.size()>0); + + //TestCase.assertTrue("Es muss mindestens ein TypeInsertPoint vorhanden sein", point.points.size()>0); + if(point.points.size()>0){ + inferedSource = point.insertAllTypes(TypeInsertTester.getFileContent(rootDirectory + sourceFileToInfere)); + System.out.println(inferedSource); + gesamterSrc += inferedSource; + } + + } + + } catch (IOException | yyException e) { + e.printStackTrace(); + TestCase.fail(); + } + for(String containString : mustContain){ + TestCase.assertTrue("\""+containString+"\" muss in den inferierten Lösungen vorkommen",gesamterSrc.contains(containString)); + } + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/MutlitpleTestCases.java b/test/plugindevelopment/TypeInsertTests/MutlitpleTestCases.java new file mode 100644 index 000000000..82fa17a8c --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/MutlitpleTestCases.java @@ -0,0 +1,26 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class MutlitpleTestCases { + + private static final String TEST_FILE = "Test1.jav"; + private static final String TEST_FILE2 = "Test2.jav"; + + + @Test + public void test1(){ + Vector mustContain = new Vector(); + mustContain.add("OverloadingTest testMethode"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + + @Test + public void test2(){ + Vector mustContain = new Vector(); + MultipleTypesInsertTester.test(this.TEST_FILE2, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/OverloadingInsertTest.jav b/test/plugindevelopment/TypeInsertTests/OverloadingInsertTest.jav new file mode 100644 index 000000000..5952fe38d --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/OverloadingInsertTest.jav @@ -0,0 +1,20 @@ +class OverloadingInsertTest{ + + var; + + overload(){ + return this; + } +} + +class Overloading2{ + var2; + + methode(){ + return var2.overload(); + } + + overload(){ + return this; + } +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/OverloadingInsertTest.java b/test/plugindevelopment/TypeInsertTests/OverloadingInsertTest.java new file mode 100644 index 000000000..77e3ea9d9 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/OverloadingInsertTest.java @@ -0,0 +1,33 @@ +package plugindevelopment.TypeInsertTests; + +import java.io.File; +import java.io.IOException; +import java.util.Vector; + +import junit.framework.TestCase; +import mycompiler.MyCompiler; +import mycompiler.MyCompilerAPI; +import mycompiler.myparser.JavaParser.yyException; +import mycompiler.mytypereconstruction.TypeinferenceResultSet; + +import org.junit.Test; + +import typinferenz.typedeployment.TypeInsertSet; + +public class OverloadingInsertTest { + private static final String TEST_FILE = "OverloadingInsertTest.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + mustContain.add("Overloading2 methode"); + mustContain.add("Overloading2 overload"); + mustContain.add("Overloading2 var2"); + mustContain.add("OverloadingInsertTest methode"); + mustContain.add("OverloadingInsertTest overload"); + mustContain.add("OverloadingInsertTest var2"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + + +} diff --git a/test/plugindevelopment/TypeInsertTests/Recursive.jav b/test/plugindevelopment/TypeInsertTests/Recursive.jav new file mode 100644 index 000000000..0f689a498 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/Recursive.jav @@ -0,0 +1,13 @@ +class Recursive{ + +var = "test"; + +methode1(a){ + return methode2(a); +} + +String methode2(b){ + return methode1(var); +} + +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/Recursive2.jav b/test/plugindevelopment/TypeInsertTests/Recursive2.jav new file mode 100644 index 000000000..7585b500e --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/Recursive2.jav @@ -0,0 +1,15 @@ +class Recursive{ + +Test var; + +Test methode1(a){ + return methode2(a); +} + +Test methode2(b){ + return methode1(var); +} + +} + +class Test{} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/ReursiveTest.java b/test/plugindevelopment/TypeInsertTests/ReursiveTest.java new file mode 100644 index 000000000..9afb090c7 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/ReursiveTest.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class ReursiveTest { + + private static final String TEST_FILE = "Recursive.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + //mustContain.add("A a"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/ReursiveTest2.java b/test/plugindevelopment/TypeInsertTests/ReursiveTest2.java new file mode 100644 index 000000000..95040a8db --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/ReursiveTest2.java @@ -0,0 +1,18 @@ +package plugindevelopment.TypeInsertTests; + +import java.util.Vector; + +import org.junit.Test; + +public class ReursiveTest2 { + + private static final String TEST_FILE = "Recursive2.jav"; + + @Test + public void run(){ + Vector mustContain = new Vector(); + //mustContain.add("A a"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +} diff --git a/test/plugindevelopment/TypeInsertTests/Test1.jav b/test/plugindevelopment/TypeInsertTests/Test1.jav new file mode 100644 index 000000000..4f7f56612 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/Test1.jav @@ -0,0 +1,25 @@ +class OverloadingTest{ + + OverloadingTest var; + + + clone(){ + return this; + } + + testMethode(var2){ + var.clone(); + return var.clone(); + } + +} + +class OverloadingTest2{ + + String var = "test"; + + OverloadingTest2 clone(){ + return this; + } + +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/Test2.jav b/test/plugindevelopment/TypeInsertTests/Test2.jav new file mode 100644 index 000000000..4114c341f --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/Test2.jav @@ -0,0 +1,4 @@ + +public class Matrix{ + op = (m) -> (f) -> f.apply(this, m); +} \ No newline at end of file diff --git a/test/plugindevelopment/VariableTypeInsertTest.jav b/test/plugindevelopment/VariableTypeInsertTest.jav new file mode 100644 index 000000000..228c7fc12 --- /dev/null +++ b/test/plugindevelopment/VariableTypeInsertTest.jav @@ -0,0 +1,4 @@ + +class VariableTypeInsertTest{ + var = "test"; +} diff --git a/test/plugindevelopment/VariableTypeInsertTest.java b/test/plugindevelopment/VariableTypeInsertTest.java new file mode 100644 index 000000000..f59bcf2ee --- /dev/null +++ b/test/plugindevelopment/VariableTypeInsertTest.java @@ -0,0 +1,15 @@ +package plugindevelopment; + +import org.junit.Test; + +public class VariableTypeInsertTest { + + private static final String TEST_FILE = "VariableTypeInsertTest.jav"; + private static final String SOLUTION_FILE = "VariableTypeInsertTestSolution.jav"; + + @Test + public void run(){ + TypeInsertTester.test(this.TEST_FILE, this.SOLUTION_FILE); + } + +} diff --git a/test/plugindevelopment/VariableTypeInsertTestSolution.jav b/test/plugindevelopment/VariableTypeInsertTestSolution.jav new file mode 100644 index 000000000..626e53454 --- /dev/null +++ b/test/plugindevelopment/VariableTypeInsertTestSolution.jav @@ -0,0 +1,4 @@ + +class VariableTypeInsertTest{ + String var = "test"; +} diff --git a/test/syntaxTree/NodeEqualTest.jav b/test/syntaxTree/NodeEqualTest.jav new file mode 100644 index 000000000..15cbdba50 --- /dev/null +++ b/test/syntaxTree/NodeEqualTest.jav @@ -0,0 +1,9 @@ +class NodeEqualTest { + String var1; + void methode1(){ + var1 = "String"; + } + String methode2(String test){ + return test; + } +} \ No newline at end of file diff --git a/test/syntaxTree/NodeEqualTest.java b/test/syntaxTree/NodeEqualTest.java new file mode 100644 index 000000000..312d4a368 --- /dev/null +++ b/test/syntaxTree/NodeEqualTest.java @@ -0,0 +1,56 @@ +package syntaxTree; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; + +import mycompiler.MyCompiler; +import mycompiler.MyCompilerAPI; +import mycompiler.SourceFile; +import mycompiler.SyntaxTreeNode; +import mycompiler.myparser.JavaParser.yyException; + +import org.junit.Test; + +import junit.framework.TestCase; + +public class NodeEqualTest extends TestCase{ + private static final String rootDirectory = System.getProperty("user.dir")+"/test/syntaxTree/"; + private static final String testFile = "NodeEqualTest.jav"; + + @Test + public void test(){ + MyCompilerAPI compiler = MyCompiler.getAPI(); + MyCompilerAPI compiler2 = MyCompiler.getAPI(); + SourceFile tree = null; + SourceFile tree2 = null; + try { + tree = compiler.parse(new File(rootDirectory + testFile)); + tree2 = compiler2.parse(new File(rootDirectory + testFile)); + } catch (IOException | yyException e) { + e.printStackTrace(); + fail(); + } + recursivlyCheckEqual(tree, tree2); + } + + private void recursivlyCheckEqual(SyntaxTreeNode node1, SyntaxTreeNode node2){ + for(SyntaxTreeNode n1 : node1.getChildren()){ + int matches = 0; + for(SyntaxTreeNode n2 : node2.getChildren()){ + if(n2.equals(n1)){ + System.out.println(n2 + " == "+n1); + matches++; + this.recursivlyCheckEqual(n1, n2); + }else{ + System.out.println(n2 + " != "+ n1); + } + } + System.out.println(""); + assertTrue("Nur eines der Children darf gleich sein, nicht "+matches, matches == 1 && node2.getChildren().size()>0); + } + } + + + +} diff --git a/tools/y.output b/tools/y.output index 048aeef5d..80f01111b 100644 --- a/tools/y.output +++ b/tools/y.output @@ -1,2158 +1,3767 @@ 0 $accept : compilationunit $end 1 compilationunit : typedeclarations + 2 | importdeclarations typedeclarations + 3 | packagedeclaration importdeclarations typedeclarations + 4 | packagedeclaration typedeclarations + 5 | type type compilationunit - 2 packagedeclaration : PACKAGE name ';' + 6 packagedeclaration : PACKAGE name ';' - 3 importdeclarations : importdeclaration - 4 | importdeclarations importdeclaration + 7 importdeclarations : importdeclaration + 8 | importdeclarations importdeclaration - 5 importdeclaration : IMPORT importqualifiedname ';' + 9 importdeclaration : IMPORT importqualifiedname ';' - 6 typedeclarations : typedeclaration - 7 | typedeclarations typedeclaration + 10 typedeclarations : typedeclaration + 11 | typedeclarations typedeclaration - 8 name : qualifiedname - 9 | simplename + 12 name : qualifiedname + 13 | simplename - 10 typedeclaration : classdeclaration + 14 typedeclaration : classdeclaration + 15 | interfacedeclaration - 11 qualifiedname : name '.' IDENTIFIER + 16 qualifiedname : name '.' IDENTIFIER - 12 importqualifiedname : name '.' IDENTIFIER - 13 | name '.' '*' + 17 importqualifiedname : name '.' IDENTIFIER + 18 | name '.' '*' - 14 simplename : IDENTIFIER + 19 simplename : IDENTIFIER - 15 classdeclaration : CLASS classidentifier classbody - 16 | modifiers CLASS classidentifier classbody - 17 | CLASS classidentifier super classbody - 18 | modifiers CLASS classidentifier super classbody - 19 | CLASS classidentifier interfaces classbody - 20 | modifiers CLASS classidentifier interfaces classbody - 21 | CLASS classidentifier super interfaces classbody - 22 | modifiers CLASS classidentifier super interfaces classbody + 20 classdeclaration : CLASS classidentifier classbody + 21 | modifiers CLASS classidentifier classbody + 22 | CLASS classidentifier super classbody + 23 | modifiers CLASS classidentifier super classbody + 24 | CLASS classidentifier interfaces classbody + 25 | modifiers CLASS classidentifier interfaces classbody + 26 | CLASS classidentifier super interfaces classbody + 27 | modifiers CLASS classidentifier super interfaces classbody - 23 interfaceidentifier : IDENTIFIER - 24 | IDENTIFIER '<' boundedClassParameters '>' + 28 interfaceidentifier : IDENTIFIER + 29 | IDENTIFIER '<' boundedClassParameters '>' - 25 classidentifier : IDENTIFIER - 26 | IDENTIFIER '<' boundedClassParameters '>' + 30 classidentifier : IDENTIFIER + 31 | IDENTIFIER '<' boundedClassParameters '>' - 27 interfacedeclaration : INTERFACE interfaceidentifier interfacebody - 28 | modifiers INTERFACE interfaceidentifier interfacebody - 29 | INTERFACE interfaceidentifier extendsinterfaces interfacebody - 30 | modifiers INTERFACE interfaceidentifier extendsinterfaces interfacebody + 32 interfacedeclaration : INTERFACE interfaceidentifier interfacebody + 33 | modifiers INTERFACE interfaceidentifier interfacebody + 34 | INTERFACE interfaceidentifier extendsinterfaces interfacebody + 35 | modifiers INTERFACE interfaceidentifier extendsinterfaces interfacebody - 31 paralist : IDENTIFIER - 32 | IDENTIFIER '<' paralist '>' - 33 | wildcardparameter - 34 | paralist ',' IDENTIFIER - 35 | paralist ',' IDENTIFIER '<' paralist '>' - 36 | paralist ',' wildcardparameter + 36 paralist : IDENTIFIER + 37 | IDENTIFIER '<' paralist '>' + 38 | wildcardparameter + 39 | paralist ',' IDENTIFIER + 40 | paralist ',' IDENTIFIER '<' paralist '>' + 41 | paralist ',' wildcardparameter - 37 wildcardparameter : '?' - 38 | '?' EXTENDS referencetype - 39 | '?' SUPER referencetype + 42 wildcardparameter : '?' + 43 | '?' EXTENDS referencetype + 44 | '?' SUPER referencetype - 40 classbody : '{' '}' - 41 | '{' classbodydeclarations '}' + 45 classbody : '{' '}' + 46 | '{' classbodydeclarations '}' - 42 modifiers : modifier - 43 | modifiers modifier + 47 modifiers : modifier + 48 | modifiers modifier - 44 super : EXTENDS classtype + 49 super : EXTENDS classtype - 45 interfaces : IMPLEMENTS interfacetype - 46 | interfaces ',' interfacetype + 50 interfaces : IMPLEMENTS interfacetype + 51 | interfaces ',' interfacetype - 47 interfacebody : '{' '}' - 48 | '{' interfacememberdeclarations '}' + 52 interfacebody : '{' '}' + 53 | '{' interfacememberdeclarations '}' - 49 extendsinterfaces : EXTENDS interfacetype - 50 | extendsinterfaces ',' interfacetype + 54 extendsinterfaces : EXTENDS interfacetype + 55 | extendsinterfaces ',' interfacetype - 51 classbodydeclarations : classbodydeclaration - 52 | classbodydeclarations classbodydeclaration + 56 classbodydeclarations : classbodydeclaration + 57 | classbodydeclarations classbodydeclaration - 53 modifier : PUBLIC - 54 | PROTECTED - 55 | PRIVATE - 56 | STATIC - 57 | ABSTRACT - 58 | FINAL + 58 modifier : PUBLIC + 59 | PROTECTED + 60 | PRIVATE + 61 | STATIC + 62 | ABSTRACT + 63 | FINAL - 59 classtype : classorinterfacetype + 64 classtype : classorinterfacetype - 60 interfacememberdeclarations : interfacememberdeclaration - 61 | interfacememberdeclarations interfacememberdeclaration + 65 interfacememberdeclarations : interfacememberdeclaration + 66 | interfacememberdeclarations interfacememberdeclaration - 62 interfacetype : classorinterfacetype + 67 interfacetype : classorinterfacetype - 63 classbodydeclaration : classmemberdeclaration - 64 | staticinitializer - 65 | constructordeclaration + 68 classbodydeclaration : classmemberdeclaration + 69 | staticinitializer + 70 | constructordeclaration - 66 classorinterfacetype : simplename parameter + 71 classorinterfacetype : simplename parameter - 67 parameter : - 68 | '<' paralist '>' + 72 typelist : type + 73 | typelist ',' type - 69 interfacememberdeclaration : constantdeclaration - 70 | abstractmethoddeclaration + 74 parameter : + 75 | '<' typelist '>' - 71 classmemberdeclaration : fielddeclaration - 72 | methoddeclaration + 76 interfacememberdeclaration : constantdeclaration + 77 | abstractmethoddeclaration - 73 staticinitializer : STATIC block + 78 classmemberdeclaration : fielddeclaration + 79 | methoddeclaration - 74 constructordeclaration : constructordeclarator constructorbody - 75 | modifiers constructordeclarator constructorbody + 80 staticinitializer : STATIC block - 76 constantdeclaration : modifiers type IDENTIFIER '=' expression ';' + 81 constructordeclaration : constructordeclarator constructorbody + 82 | modifiers constructordeclarator constructorbody - 77 abstractmethoddeclaration : methodheader ';' + 83 constantdeclaration : modifiers type IDENTIFIER '=' expression ';' - 78 fielddeclarator : variabledeclarator '=' expression + 84 abstractmethoddeclaration : methodheader ';' - 79 fielddeclaration : fielddeclarator ';' - 80 | type fielddeclarator - 81 | variabledeclarators ';' - 82 | type variabledeclarators ';' - 83 | modifiers type variabledeclarators ';' + 85 fielddeclarator : variabledeclarator '=' expression - 84 methoddeclaration : methodheader methodbody + 86 fielddeclaration : fielddeclarator ';' + 87 | type fielddeclarator ';' + 88 | '<' boundedMethodParameters '>' type fielddeclarator ';' + 89 | variabledeclarators ';' + 90 | type variabledeclarators ';' + 91 | modifiers type variabledeclarators ';' - 85 block : '{' '}' - 86 | '{' blockstatements '}' + 92 methoddeclaration : methodheader methodbody - 87 constructordeclarator : simplename '(' ')' - 88 | simplename '(' formalparameterlist ')' + 93 block : '{' '}' + 94 | '{' blockstatements '}' - 89 constructorbody : '{' '}' - 90 | '{' explicitconstructorinvocation '}' - 91 | '{' blockstatements '}' - 92 | '{' explicitconstructorinvocation blockstatements '}' + 95 constructordeclarator : simplename '(' ')' + 96 | simplename '(' formalparameterlist ')' - 93 throws : THROWS classtypelist + 97 constructorbody : '{' '}' + 98 | '{' explicitconstructorinvocation '}' + 99 | '{' blockstatements '}' + 100 | '{' explicitconstructorinvocation blockstatements '}' - 94 boundedClassParameter : boundedMethodParameter + 101 throws : THROWS classtypelist - 95 boundedClassParameters : boundedClassParameter - 96 | boundedClassParameters ',' boundedClassParameter + 102 boundedClassParameter : boundedMethodParameter - 97 boundedMethodParameter : IDENTIFIER - 98 | IDENTIFIER EXTENDS boundedclassidentifierlist + 103 boundedClassParameters : boundedClassParameter + 104 | boundedClassParameters ',' boundedClassParameter - 99 boundedclassidentifierlist : referencetype - 100 | boundedclassidentifierlist '&' referencetype + 105 boundedMethodParameter : IDENTIFIER + 106 | IDENTIFIER EXTENDS boundedclassidentifierlist - 101 boundedMethodParameters : boundedMethodParameter - 102 | boundedMethodParameters ',' boundedMethodParameter + 107 boundedclassidentifierlist : referencetype + 108 | boundedclassidentifierlist '&' referencetype - 103 methodheader : '<' boundedMethodParameters '>' type methoddeclarator - 104 | type methoddeclarator - 105 | modifiers type methoddeclarator - 106 | modifiers '<' boundedMethodParameters '>' type methoddeclarator - 107 | type methoddeclarator throws - 108 | '<' boundedMethodParameters '>' type methoddeclarator throws - 109 | modifiers type methoddeclarator throws - 110 | modifiers '<' boundedMethodParameters '>' type methoddeclarator throws - 111 | VOID methoddeclarator - 112 | modifiers VOID methoddeclarator - 113 | VOID methoddeclarator throws - 114 | modifiers VOID methoddeclarator throws - 115 | '<' boundedMethodParameters '>' VOID methoddeclarator - 116 | modifiers '<' boundedMethodParameters '>' VOID methoddeclarator - 117 | '<' boundedMethodParameters '>' VOID methoddeclarator throws - 118 | modifiers '<' boundedMethodParameters '>' VOID methoddeclarator throws - 119 | methoddeclarator - 120 | '<' boundedMethodParameters '>' methoddeclarator - 121 | modifiers methoddeclarator - 122 | methoddeclarator throws - 123 | modifiers methoddeclarator throws + 109 boundedMethodParameters : boundedMethodParameter + 110 | boundedMethodParameters ',' boundedMethodParameter - 124 type : primitivetype - 125 | primitivetype '[' ']' - 126 | referencetype - 127 | referencetype '[' ']' + 111 methodheader : '<' boundedMethodParameters '>' type methoddeclarator + 112 | type methoddeclarator + 113 | modifiers type methoddeclarator + 114 | modifiers '<' boundedMethodParameters '>' type methoddeclarator + 115 | type methoddeclarator throws + 116 | '<' boundedMethodParameters '>' type methoddeclarator throws + 117 | modifiers type methoddeclarator throws + 118 | modifiers '<' boundedMethodParameters '>' type methoddeclarator throws + 119 | VOID methoddeclarator + 120 | modifiers VOID methoddeclarator + 121 | VOID methoddeclarator throws + 122 | modifiers VOID methoddeclarator throws + 123 | '<' boundedMethodParameters '>' VOID methoddeclarator + 124 | modifiers '<' boundedMethodParameters '>' VOID methoddeclarator + 125 | '<' boundedMethodParameters '>' VOID methoddeclarator throws + 126 | modifiers '<' boundedMethodParameters '>' VOID methoddeclarator throws + 127 | methoddeclarator + 128 | '<' boundedMethodParameters '>' methoddeclarator + 129 | modifiers methoddeclarator + 130 | methoddeclarator throws + 131 | modifiers methoddeclarator throws - 128 variabledeclarators : variabledeclarator - 129 | variabledeclarators ',' variabledeclarator + 132 type : primitivetype + 133 | primitivetype '[' ']' + 134 | referencetype + 135 | referencetype '[' ']' - 130 methodbody : block + 136 variabledeclarators : variabledeclarator + 137 | variabledeclarators ',' variabledeclarator - 131 blockstatements : blockstatement - 132 | blockstatements blockstatement + 138 methodbody : block - 133 formalparameterlist : formalparameter - 134 | formalparameterlist ',' formalparameter + 139 blockstatements : blockstatement + 140 | blockstatements blockstatement - 135 explicitconstructorinvocation : THIS '(' ')' ';' - 136 | THIS '(' argumentlist ')' ';' + 141 formalparameterlist : formalparameter + 142 | formalparameterlist ',' formalparameter - 137 classtypelist : classtype - 138 | classtypelist ',' classtype + 143 explicitconstructorinvocation : THIS '(' ')' ';' + 144 | THIS '(' argumentlist ')' ';' - 139 methoddeclarator : IDENTIFIER '(' ')' - 140 | IDENTIFIER '(' formalparameterlist ')' + 145 classtypelist : classtype + 146 | classtypelist ',' classtype - 141 primitivetype : BOOLEAN - 142 | numerictype + 147 methoddeclarator : IDENTIFIER '(' ')' + 148 | IDENTIFIER '(' formalparameterlist ')' - 143 referencetype : classorinterfacetype + 149 primitivetype : BOOLEAN + 150 | numerictype - 144 variabledeclarator : variabledeclaratorid + 151 referencetype : classorinterfacetype - 145 blockstatement : localvariabledeclarationstatement - 146 | statement + 152 variabledeclarator : variabledeclaratorid - 147 formalparameter : type variabledeclaratorid - 148 | variabledeclaratorid + 153 blockstatement : localvariabledeclarationstatement + 154 | statement - 149 argumentlist : expression - 150 | argumentlist ',' expression + 155 formalparameter : type variabledeclaratorid + 156 | variabledeclaratorid - 151 numerictype : integraltype + 157 argumentlist : expression + 158 | argumentlist ',' expression - 152 variabledeclaratorid : IDENTIFIER + 159 numerictype : integraltype - 153 variableinitializer : expression + 160 variabledeclaratorid : IDENTIFIER - 154 localvariabledeclarationstatement : localvariabledeclaration ';' + 161 variableinitializer : expression - 155 statement : statementwithouttrailingsubstatement - 156 | ifthenstatement - 157 | ifthenelsestatement - 158 | whilestatement - 159 | forstatement + 162 localvariabledeclarationstatement : localvariabledeclaration ';' - 160 expression : assignmentexpression - 161 | classinstancecreationexpression + 163 statement : statementwithouttrailingsubstatement + 164 | ifthenstatement + 165 | ifthenelsestatement + 166 | whilestatement + 167 | forstatement - 162 integraltype : INT - 163 | CHAR + 168 expression : assignmentexpression + 169 | classinstancecreationexpression - 164 localvariabledeclaration : type variabledeclarators - 165 | variabledeclarators + 170 integraltype : INT + 171 | CHAR - 166 statementwithouttrailingsubstatement : block - 167 | emptystatement - 168 | expressionstatement - 169 | returnstatement + 172 localvariabledeclaration : type variabledeclarators + 173 | variabledeclarators - 170 ifthenstatement : IF '(' expression ')' statement + 174 statementwithouttrailingsubstatement : block + 175 | emptystatement + 176 | expressionstatement + 177 | returnstatement - 171 ifthenelsestatement : IF '(' expression ')' statementnoshortif ELSE statement + 178 ifthenstatement : IF '(' expression ')' statement - 172 whilestatement : WHILE '(' expression ')' statement + 179 ifthenelsestatement : IF '(' expression ')' statementnoshortif ELSE statement - 173 forstatement : FOR '(' expression ';' expression ';' expression ')' statement - 174 | FOR '(' expression ';' expression ';' ')' statement - 175 | FOR '(' expression ';' ';' expression ')' statement - 176 | FOR '(' ';' expression ';' expression ')' statement - 177 | FOR '(' expression ';' ';' ')' statement - 178 | FOR '(' ';' expression ';' ')' statement - 179 | FOR '(' ';' ';' expression ')' statement - 180 | FOR '(' ';' ';' ')' statement + 180 whilestatement : WHILE '(' expression ')' statement - 181 assignmentexpression : conditionalexpression - 182 | assignment + 181 forstatement : FOR '(' expression ';' expression ';' expression ')' statement + 182 | FOR '(' expression ';' expression ';' ')' statement + 183 | FOR '(' expression ';' ';' expression ')' statement + 184 | FOR '(' ';' expression ';' expression ')' statement + 185 | FOR '(' expression ';' ';' ')' statement + 186 | FOR '(' ';' expression ';' ')' statement + 187 | FOR '(' ';' ';' expression ')' statement + 188 | FOR '(' ';' ';' ')' statement - 183 emptystatement : ';' + 189 assignmentexpression : conditionalexpression + 190 | assignment - 184 expressionstatement : statementexpression ';' + 191 emptystatement : ';' - 185 returnstatement : RETURN ';' - 186 | RETURN expression ';' + 192 expressionstatement : statementexpression ';' - 187 statementnoshortif : statementwithouttrailingsubstatement - 188 | ifthenelsestatementnoshortif - 189 | whilestatementnoshortif + 193 returnstatement : RETURN ';' + 194 | RETURN expression ';' - 190 conditionalexpression : conditionalorexpression + 195 statementnoshortif : statementwithouttrailingsubstatement + 196 | ifthenelsestatementnoshortif + 197 | whilestatementnoshortif - 191 assignment : lefthandside assignmentoperator assignmentexpression - 192 | lefthandside assignmentoperator classinstancecreationexpression + 198 conditionalexpression : conditionalorexpression - 193 statementexpression : assignment - 194 | preincrementexpression - 195 | predecrementexpression - 196 | postincrementexpression - 197 | postdecrementexpression - 198 | methodinvocation + 199 assignment : lefthandside assignmentoperator assignmentexpression + 200 | lefthandside assignmentoperator classinstancecreationexpression - 199 ifthenelsestatementnoshortif : IF '(' expression ')' statementnoshortif ELSE statementnoshortif + 201 statementexpression : assignment + 202 | preincrementexpression + 203 | predecrementexpression + 204 | postincrementexpression + 205 | postdecrementexpression + 206 | methodinvocation - 200 whilestatementnoshortif : WHILE '(' expression ')' statementnoshortif + 207 ifthenelsestatementnoshortif : IF '(' expression ')' statementnoshortif ELSE statementnoshortif - 201 conditionalorexpression : conditionalandexpression - 202 | conditionalorexpression LOGICALOR conditionalandexpression + 208 whilestatementnoshortif : WHILE '(' expression ')' statementnoshortif - 203 lambdaassignmentoperator : LAMBDAASSIGNMENT + 209 conditionalorexpression : conditionalandexpression + 210 | conditionalorexpression LOGICALOR conditionalandexpression - 204 lambdabody : block - 205 | expression + 211 lambdaassignmentoperator : LAMBDAASSIGNMENT - 206 lambdaexpressionparameter : '(' ')' - 207 | '(' formalparameterlist ')' + 212 lambdabody : block + 213 | expression - 208 lambdaexpression : lambdaexpressionparameter lambdaassignmentoperator lambdabody + 214 lambdaexpressionparameter : '(' ')' + 215 | '(' formalparameterlist ')' - 209 lefthandside : name + 216 lambdaexpression : lambdaexpressionparameter lambdaassignmentoperator lambdabody - 210 assignmentoperator : '=' - 211 | TIMESEQUAL - 212 | DIVIDEEQUAL - 213 | MODULOEQUAL - 214 | PLUSEQUAL - 215 | MINUSEQUAL + 217 lefthandside : name - 216 preincrementexpression : INCREMENT unaryexpression + 218 assignmentoperator : '=' + 219 | TIMESEQUAL + 220 | DIVIDEEQUAL + 221 | MODULOEQUAL + 222 | PLUSEQUAL + 223 | MINUSEQUAL - 217 predecrementexpression : DECREMENT unaryexpression + 224 preincrementexpression : INCREMENT unaryexpression - 218 postincrementexpression : postfixexpression INCREMENT + 225 predecrementexpression : DECREMENT unaryexpression - 219 postdecrementexpression : postfixexpression DECREMENT + 226 postincrementexpression : postfixexpression INCREMENT - 220 methodinvocation : name '(' ')' - 221 | name '(' argumentlist ')' - 222 | primary '.' IDENTIFIER '(' ')' - 223 | primary '.' IDENTIFIER '(' argumentlist ')' + 227 postdecrementexpression : postfixexpression DECREMENT - 224 classinstancecreationexpression : NEW classtype '(' ')' - 225 | NEW classtype '(' argumentlist ')' + 228 methodinvocation : name '(' ')' + 229 | name '(' argumentlist ')' + 230 | primary '.' IDENTIFIER '(' ')' + 231 | primary '.' IDENTIFIER '(' argumentlist ')' - 226 conditionalandexpression : inclusiveorexpression - 227 | conditionalandexpression LOGICALAND inclusiveorexpression + 232 classinstancecreationexpression : NEW classtype '(' ')' + 233 | NEW classtype '(' argumentlist ')' - 228 unaryexpression : preincrementexpression - 229 | predecrementexpression - 230 | '+' unaryexpression - 231 | '-' unaryexpression - 232 | unaryexpressionnotplusminus + 234 conditionalandexpression : inclusiveorexpression + 235 | conditionalandexpression LOGICALAND inclusiveorexpression - 233 postfixexpression : primary - 234 | name - 235 | postincrementexpression - 236 | postdecrementexpression + 236 unaryexpression : preincrementexpression + 237 | predecrementexpression + 238 | '+' unaryexpression + 239 | '-' unaryexpression + 240 | unaryexpressionnotplusminus - 237 primary : primarynonewarray + 241 postfixexpression : primary + 242 | name + 243 | postincrementexpression + 244 | postdecrementexpression - 238 inclusiveorexpression : exclusiveorexpression - 239 | inclusiveorexpression '|' exclusiveorexpression + 245 primary : primarynonewarray - 240 primarynonewarray : literal - 241 | THIS - 242 | methodinvocation - 243 | lambdaexpression + 246 inclusiveorexpression : exclusiveorexpression + 247 | inclusiveorexpression '|' exclusiveorexpression - 244 unaryexpressionnotplusminus : postfixexpression - 245 | '!' unaryexpression - 246 | castexpression + 248 primarynonewarray : literal + 249 | THIS + 250 | methodinvocation + 251 | lambdaexpression - 247 exclusiveorexpression : andexpression - 248 | exclusiveorexpression '^' andexpression + 252 unaryexpressionnotplusminus : postfixexpression + 253 | '!' unaryexpression + 254 | castexpression - 249 literal : INTLITERAL - 250 | BOOLLITERAL - 251 | CHARLITERAL - 252 | STRINGLITERAL - 253 | LONGLITERAL - 254 | FLOATLITERAL - 255 | DOUBLELITERAL - 256 | JNULL + 255 exclusiveorexpression : andexpression + 256 | exclusiveorexpression '^' andexpression - 257 castexpression : '(' primitivetype ')' unaryexpression + 257 literal : INTLITERAL + 258 | BOOLLITERAL + 259 | CHARLITERAL + 260 | STRINGLITERAL + 261 | LONGLITERAL + 262 | FLOATLITERAL + 263 | DOUBLELITERAL + 264 | JNULL - 258 andexpression : equalityexpression - 259 | andexpression '&' equalityexpression + 265 castexpression : '(' primitivetype ')' unaryexpression - 260 equalityexpression : relationalexpression - 261 | equalityexpression EQUAL relationalexpression - 262 | equalityexpression NOTEQUAL relationalexpression + 266 andexpression : equalityexpression + 267 | andexpression '&' equalityexpression - 263 relationalexpression : shiftexpression - 264 | relationalexpression '<' shiftexpression - 265 | relationalexpression '>' shiftexpression - 266 | relationalexpression LESSEQUAL shiftexpression - 267 | relationalexpression GREATEREQUAL shiftexpression - 268 | relationalexpression INSTANCEOF referencetype + 268 equalityexpression : relationalexpression + 269 | equalityexpression EQUAL relationalexpression + 270 | equalityexpression NOTEQUAL relationalexpression - 269 shiftexpression : additiveexpression + 271 relationalexpression : shiftexpression + 272 | relationalexpression '<' shiftexpression + 273 | relationalexpression '>' shiftexpression + 274 | relationalexpression LESSEQUAL shiftexpression + 275 | relationalexpression GREATEREQUAL shiftexpression + 276 | relationalexpression INSTANCEOF referencetype - 270 additiveexpression : multiplicativeexpression - 271 | additiveexpression '+' multiplicativeexpression - 272 | additiveexpression '-' multiplicativeexpression + 277 shiftexpression : additiveexpression - 273 multiplicativeexpression : unaryexpression - 274 | multiplicativeexpression '*' unaryexpression - 275 | multiplicativeexpression '/' unaryexpression - 276 | multiplicativeexpression '%' unaryexpression + 278 additiveexpression : multiplicativeexpression + 279 | additiveexpression '+' multiplicativeexpression + 280 | additiveexpression '-' multiplicativeexpression + + 281 multiplicativeexpression : unaryexpression + 282 | multiplicativeexpression '*' unaryexpression + 283 | multiplicativeexpression '/' unaryexpression + 284 | multiplicativeexpression '%' unaryexpression state 0 $accept : . compilationunit $end (0) ABSTRACT shift 1 - CLASS shift 2 - FINAL shift 3 - PRIVATE shift 4 - PROTECTED shift 5 - PUBLIC shift 6 - STATIC shift 7 - . error - - compilationunit goto 8 - classdeclaration goto 9 - modifiers goto 10 - modifier goto 11 - typedeclarations goto 12 - typedeclaration goto 13 - - -state 1 - modifier : ABSTRACT . (57) - - . reduce 57 - - -state 2 - classdeclaration : CLASS . classidentifier classbody (15) - classdeclaration : CLASS . classidentifier super classbody (17) - classdeclaration : CLASS . classidentifier interfaces classbody (19) - classdeclaration : CLASS . classidentifier super interfaces classbody (21) - + BOOLEAN shift 2 + CHAR shift 3 + CLASS shift 4 + FINAL shift 5 + INT shift 6 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + PACKAGE shift 10 + IMPORT shift 11 + INTERFACE shift 12 + STATIC shift 13 IDENTIFIER shift 14 . error - classidentifier goto 15 + compilationunit goto 15 + classdeclaration goto 16 + interfacedeclaration goto 17 + simplename goto 18 + importdeclaration goto 19 + importdeclarations goto 20 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 26 + modifiers goto 27 + modifier goto 28 + typedeclarations goto 29 + packagedeclaration goto 30 + typedeclaration goto 31 + + +state 1 + modifier : ABSTRACT . (62) + + . reduce 62 + + +state 2 + primitivetype : BOOLEAN . (149) + + . reduce 149 state 3 - modifier : FINAL . (58) + integraltype : CHAR . (171) + + . reduce 171 + + +state 4 + classdeclaration : CLASS . classidentifier classbody (20) + classdeclaration : CLASS . classidentifier super classbody (22) + classdeclaration : CLASS . classidentifier interfaces classbody (24) + classdeclaration : CLASS . classidentifier super interfaces classbody (26) + + IDENTIFIER shift 32 + . error + + classidentifier goto 33 + + +state 5 + modifier : FINAL . (63) + + . reduce 63 + + +state 6 + integraltype : INT . (170) + + . reduce 170 + + +state 7 + modifier : PRIVATE . (60) + + . reduce 60 + + +state 8 + modifier : PROTECTED . (59) + + . reduce 59 + + +state 9 + modifier : PUBLIC . (58) . reduce 58 -state 4 - modifier : PRIVATE . (55) +state 10 + packagedeclaration : PACKAGE . name ';' (6) - . reduce 55 + IDENTIFIER shift 14 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 36 -state 5 - modifier : PROTECTED . (54) +state 11 + importdeclaration : IMPORT . importqualifiedname ';' (9) - . reduce 54 + IDENTIFIER shift 14 + . error + + simplename goto 34 + qualifiedname goto 35 + importqualifiedname goto 37 + name goto 38 -state 6 - modifier : PUBLIC . (53) +state 12 + interfacedeclaration : INTERFACE . interfaceidentifier interfacebody (32) + interfacedeclaration : INTERFACE . interfaceidentifier extendsinterfaces interfacebody (34) - . reduce 53 + IDENTIFIER shift 39 + . error + + interfaceidentifier goto 40 -state 7 - modifier : STATIC . (56) +state 13 + modifier : STATIC . (61) - . reduce 56 + . reduce 61 -state 8 +state 14 + simplename : IDENTIFIER . (19) + + . reduce 19 + + +state 15 $accept : compilationunit . $end (0) $end accept -state 9 - typedeclaration : classdeclaration . (10) - - . reduce 10 - - -state 10 - classdeclaration : modifiers . CLASS classidentifier classbody (16) - classdeclaration : modifiers . CLASS classidentifier super classbody (18) - classdeclaration : modifiers . CLASS classidentifier interfaces classbody (20) - classdeclaration : modifiers . CLASS classidentifier super interfaces classbody (22) - modifiers : modifiers . modifier (43) - - ABSTRACT shift 1 - CLASS shift 16 - FINAL shift 3 - PRIVATE shift 4 - PROTECTED shift 5 - PUBLIC shift 6 - STATIC shift 7 - . error - - modifier goto 17 - - -state 11 - modifiers : modifier . (42) - - . reduce 42 - - -state 12 - compilationunit : typedeclarations . (1) - typedeclarations : typedeclarations . typedeclaration (7) - - ABSTRACT shift 1 - CLASS shift 2 - FINAL shift 3 - PRIVATE shift 4 - PROTECTED shift 5 - PUBLIC shift 6 - STATIC shift 7 - $end reduce 1 - - classdeclaration goto 9 - modifiers goto 10 - modifier goto 11 - typedeclaration goto 18 - - -state 13 - typedeclarations : typedeclaration . (6) - - . reduce 6 - - -state 14 - classidentifier : IDENTIFIER . (25) - classidentifier : IDENTIFIER . '<' boundedClassParameters '>' (26) - - '<' shift 19 - EXTENDS reduce 25 - IMPLEMENTS reduce 25 - '{' reduce 25 - - -state 15 - classdeclaration : CLASS classidentifier . classbody (15) - classdeclaration : CLASS classidentifier . super classbody (17) - classdeclaration : CLASS classidentifier . interfaces classbody (19) - classdeclaration : CLASS classidentifier . super interfaces classbody (21) - - EXTENDS shift 20 - IMPLEMENTS shift 21 - '{' shift 22 - . error - - classbody goto 23 - super goto 24 - interfaces goto 25 - - state 16 - classdeclaration : modifiers CLASS . classidentifier classbody (16) - classdeclaration : modifiers CLASS . classidentifier super classbody (18) - classdeclaration : modifiers CLASS . classidentifier interfaces classbody (20) - classdeclaration : modifiers CLASS . classidentifier super interfaces classbody (22) - - IDENTIFIER shift 14 - . error - - classidentifier goto 26 - - -state 17 - modifiers : modifiers modifier . (43) - - . reduce 43 - - -state 18 - typedeclarations : typedeclarations typedeclaration . (7) - - . reduce 7 - - -state 19 - classidentifier : IDENTIFIER '<' . boundedClassParameters '>' (26) - - IDENTIFIER shift 27 - . error - - boundedMethodParameter goto 28 - boundedClassParameter goto 29 - boundedClassParameters goto 30 - - -state 20 - super : EXTENDS . classtype (44) - - IDENTIFIER shift 31 - . error - - simplename goto 32 - classtype goto 33 - classorinterfacetype goto 34 - - -state 21 - interfaces : IMPLEMENTS . interfacetype (45) - - IDENTIFIER shift 31 - . error - - simplename goto 32 - classorinterfacetype goto 35 - interfacetype goto 36 - - -state 22 - classbody : '{' . '}' (40) - classbody : '{' . classbodydeclarations '}' (41) - - ABSTRACT shift 1 - BOOLEAN shift 37 - CHAR shift 38 - FINAL shift 3 - INT shift 39 - PRIVATE shift 4 - PROTECTED shift 5 - PUBLIC shift 6 - STATIC shift 40 - VOID shift 41 - IDENTIFIER shift 42 - '<' shift 43 - '}' shift 44 - . error - - fielddeclaration goto 45 - methodheader goto 46 - methoddeclaration goto 47 - methoddeclarator goto 48 - classbodydeclarations goto 49 - classbodydeclaration goto 50 - classmemberdeclaration goto 51 - variabledeclarators goto 52 - fielddeclarator goto 53 - variabledeclarator goto 54 - variabledeclaratorid goto 55 - simplename goto 56 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 62 - modifiers goto 63 - modifier goto 11 - constructordeclaration goto 64 - constructordeclarator goto 65 - staticinitializer goto 66 - - -state 23 - classdeclaration : CLASS classidentifier classbody . (15) - - . reduce 15 - - -state 24 - classdeclaration : CLASS classidentifier super . classbody (17) - classdeclaration : CLASS classidentifier super . interfaces classbody (21) - - IMPLEMENTS shift 21 - '{' shift 22 - . error - - classbody goto 67 - interfaces goto 68 - - -state 25 - classdeclaration : CLASS classidentifier interfaces . classbody (19) - interfaces : interfaces . ',' interfacetype (46) - - ',' shift 69 - '{' shift 22 - . error - - classbody goto 70 - - -state 26 - classdeclaration : modifiers CLASS classidentifier . classbody (16) - classdeclaration : modifiers CLASS classidentifier . super classbody (18) - classdeclaration : modifiers CLASS classidentifier . interfaces classbody (20) - classdeclaration : modifiers CLASS classidentifier . super interfaces classbody (22) - - EXTENDS shift 20 - IMPLEMENTS shift 21 - '{' shift 22 - . error - - classbody goto 71 - super goto 72 - interfaces goto 73 - - -state 27 - boundedMethodParameter : IDENTIFIER . (97) - boundedMethodParameter : IDENTIFIER . EXTENDS boundedclassidentifierlist (98) - - EXTENDS shift 74 - ',' reduce 97 - '>' reduce 97 - - -state 28 - boundedClassParameter : boundedMethodParameter . (94) - - . reduce 94 - - -state 29 - boundedClassParameters : boundedClassParameter . (95) - - . reduce 95 - - -state 30 - classidentifier : IDENTIFIER '<' boundedClassParameters . '>' (26) - boundedClassParameters : boundedClassParameters . ',' boundedClassParameter (96) - - ',' shift 75 - '>' shift 76 - . error - - -state 31 - simplename : IDENTIFIER . (14) + typedeclaration : classdeclaration . (14) . reduce 14 -32: shift/reduce conflict (shift 77, reduce 67) on '<' -state 32 - classorinterfacetype : simplename . parameter (66) - parameter : . (67) +state 17 + typedeclaration : interfacedeclaration . (15) - '<' shift 77 - ABSTRACT reduce 67 - BOOLEAN reduce 67 - CHAR reduce 67 - FINAL reduce 67 - INSTANCEOF reduce 67 - INT reduce 67 - PRIVATE reduce 67 - PROTECTED reduce 67 - PUBLIC reduce 67 - IMPLEMENTS reduce 67 - STATIC reduce 67 - VOID reduce 67 - IDENTIFIER reduce 67 - EQUAL reduce 67 - LESSEQUAL reduce 67 - GREATEREQUAL reduce 67 - NOTEQUAL reduce 67 - LOGICALOR reduce 67 - LOGICALAND reduce 67 - INCREMENT reduce 67 - DECREMENT reduce 67 - ',' reduce 67 - ';' reduce 67 - '.' reduce 67 - '*' reduce 67 - '>' reduce 67 - '{' reduce 67 - '}' reduce 67 - '(' reduce 67 - ')' reduce 67 - '&' reduce 67 - '[' reduce 67 - '+' reduce 67 - '-' reduce 67 - '|' reduce 67 - '^' reduce 67 - '/' reduce 67 - '%' reduce 67 - - parameter goto 78 + . reduce 15 -state 33 - super : EXTENDS classtype . (44) +18: shift/reduce conflict (shift 41, reduce 74) on '<' +state 18 + classorinterfacetype : simplename . parameter (71) + parameter : . (74) - . reduce 44 + '<' shift 41 + ABSTRACT reduce 74 + BOOLEAN reduce 74 + CHAR reduce 74 + CLASS reduce 74 + FINAL reduce 74 + INSTANCEOF reduce 74 + INT reduce 74 + PRIVATE reduce 74 + PROTECTED reduce 74 + PUBLIC reduce 74 + PACKAGE reduce 74 + IMPORT reduce 74 + INTERFACE reduce 74 + IMPLEMENTS reduce 74 + STATIC reduce 74 + IDENTIFIER reduce 74 + EQUAL reduce 74 + LESSEQUAL reduce 74 + GREATEREQUAL reduce 74 + NOTEQUAL reduce 74 + LOGICALOR reduce 74 + LOGICALAND reduce 74 + INCREMENT reduce 74 + DECREMENT reduce 74 + ',' reduce 74 + ';' reduce 74 + '.' reduce 74 + '*' reduce 74 + '>' reduce 74 + '{' reduce 74 + '(' reduce 74 + ')' reduce 74 + '&' reduce 74 + '[' reduce 74 + '+' reduce 74 + '-' reduce 74 + '|' reduce 74 + '^' reduce 74 + '/' reduce 74 + '%' reduce 74 + + parameter goto 42 -state 34 - classtype : classorinterfacetype . (59) +state 19 + importdeclarations : importdeclaration . (7) - . reduce 59 + . reduce 7 -state 35 - interfacetype : classorinterfacetype . (62) - - . reduce 62 - - -state 36 - interfaces : IMPLEMENTS interfacetype . (45) - - . reduce 45 - - -state 37 - primitivetype : BOOLEAN . (141) - - . reduce 141 - - -state 38 - integraltype : CHAR . (163) - - . reduce 163 - - -state 39 - integraltype : INT . (162) - - . reduce 162 - - -state 40 - modifier : STATIC . (56) - staticinitializer : STATIC . block (73) - - '{' shift 79 - ABSTRACT reduce 56 - BOOLEAN reduce 56 - CHAR reduce 56 - FINAL reduce 56 - INT reduce 56 - PRIVATE reduce 56 - PROTECTED reduce 56 - PUBLIC reduce 56 - STATIC reduce 56 - VOID reduce 56 - IDENTIFIER reduce 56 - '<' reduce 56 - - block goto 80 - - -state 41 - methodheader : VOID . methoddeclarator (111) - methodheader : VOID . methoddeclarator throws (113) - - IDENTIFIER shift 81 - . error - - methoddeclarator goto 82 - - -42: shift/reduce conflict (shift 83, reduce 14) on '(' -state 42 - simplename : IDENTIFIER . (14) - methoddeclarator : IDENTIFIER . '(' ')' (139) - methoddeclarator : IDENTIFIER . '(' formalparameterlist ')' (140) - variabledeclaratorid : IDENTIFIER . (152) - - '(' shift 83 - IDENTIFIER reduce 14 - ',' reduce 152 - ';' reduce 152 - '<' reduce 14 - '=' reduce 152 - '[' reduce 14 - - -state 43 - methodheader : '<' . boundedMethodParameters '>' type methoddeclarator (103) - methodheader : '<' . boundedMethodParameters '>' type methoddeclarator throws (108) - methodheader : '<' . boundedMethodParameters '>' VOID methoddeclarator (115) - methodheader : '<' . boundedMethodParameters '>' VOID methoddeclarator throws (117) - methodheader : '<' . boundedMethodParameters '>' methoddeclarator (120) - - IDENTIFIER shift 27 - . error - - boundedMethodParameter goto 84 - boundedMethodParameters goto 85 - - -state 44 - classbody : '{' '}' . (40) - - . reduce 40 - - -state 45 - classmemberdeclaration : fielddeclaration . (71) - - . reduce 71 - - -state 46 - methoddeclaration : methodheader . methodbody (84) - - '{' shift 79 - . error - - block goto 86 - methodbody goto 87 - - -state 47 - classmemberdeclaration : methoddeclaration . (72) - - . reduce 72 - - -state 48 - methodheader : methoddeclarator . (119) - methodheader : methoddeclarator . throws (122) - - THROWS shift 88 - '{' reduce 119 - - throws goto 89 - - -state 49 - classbody : '{' classbodydeclarations . '}' (41) - classbodydeclarations : classbodydeclarations . classbodydeclaration (52) +state 20 + compilationunit : importdeclarations . typedeclarations (2) + importdeclarations : importdeclarations . importdeclaration (8) ABSTRACT shift 1 - BOOLEAN shift 37 - CHAR shift 38 - FINAL shift 3 - INT shift 39 - PRIVATE shift 4 - PROTECTED shift 5 - PUBLIC shift 6 - STATIC shift 40 - VOID shift 41 - IDENTIFIER shift 42 - '<' shift 43 - '}' shift 90 + CLASS shift 4 + FINAL shift 5 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + IMPORT shift 11 + INTERFACE shift 12 + STATIC shift 13 . error - fielddeclaration goto 45 - methodheader goto 46 - methoddeclaration goto 47 - methoddeclarator goto 48 - classbodydeclaration goto 91 - classmemberdeclaration goto 51 - variabledeclarators goto 52 - fielddeclarator goto 53 - variabledeclarator goto 54 - variabledeclaratorid goto 55 - simplename goto 56 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 62 - modifiers goto 63 - modifier goto 11 - constructordeclaration goto 64 - constructordeclarator goto 65 - staticinitializer goto 66 + classdeclaration goto 16 + interfacedeclaration goto 17 + importdeclaration goto 43 + modifiers goto 27 + modifier goto 28 + typedeclarations goto 44 + typedeclaration goto 31 -state 50 - classbodydeclarations : classbodydeclaration . (51) - - . reduce 51 - - -state 51 - classbodydeclaration : classmemberdeclaration . (63) - - . reduce 63 - - -state 52 - fielddeclaration : variabledeclarators . ';' (81) - variabledeclarators : variabledeclarators . ',' variabledeclarator (129) - - ',' shift 92 - ';' shift 93 - . error - - -state 53 - fielddeclaration : fielddeclarator . ';' (79) - - ';' shift 94 - . error - - -state 54 - fielddeclarator : variabledeclarator . '=' expression (78) - variabledeclarators : variabledeclarator . (128) - - '=' shift 95 - ',' reduce 128 - ';' reduce 128 - - -state 55 - variabledeclarator : variabledeclaratorid . (144) - - . reduce 144 - - -state 56 - classorinterfacetype : simplename . parameter (66) - constructordeclarator : simplename . '(' ')' (87) - constructordeclarator : simplename . '(' formalparameterlist ')' (88) - parameter : . (67) - - '<' shift 77 - '(' shift 96 - IDENTIFIER reduce 67 - '[' reduce 67 - - parameter goto 78 - - -state 57 - referencetype : classorinterfacetype . (143) - - . reduce 143 - - -state 58 - numerictype : integraltype . (151) +state 21 + referencetype : classorinterfacetype . (151) . reduce 151 -state 59 - primitivetype : numerictype . (142) +state 22 + numerictype : integraltype . (159) - . reduce 142 + . reduce 159 + + +state 23 + primitivetype : numerictype . (150) + + . reduce 150 + + +state 24 + type : primitivetype . (132) + type : primitivetype . '[' ']' (133) + + '[' shift 45 + ABSTRACT reduce 132 + BOOLEAN reduce 132 + CHAR reduce 132 + CLASS reduce 132 + FINAL reduce 132 + INT reduce 132 + PRIVATE reduce 132 + PROTECTED reduce 132 + PUBLIC reduce 132 + PACKAGE reduce 132 + IMPORT reduce 132 + INTERFACE reduce 132 + STATIC reduce 132 + IDENTIFIER reduce 132 + ',' reduce 132 + '>' reduce 132 + + +state 25 + type : referencetype . (134) + type : referencetype . '[' ']' (135) + + '[' shift 46 + ABSTRACT reduce 134 + BOOLEAN reduce 134 + CHAR reduce 134 + CLASS reduce 134 + FINAL reduce 134 + INT reduce 134 + PRIVATE reduce 134 + PROTECTED reduce 134 + PUBLIC reduce 134 + PACKAGE reduce 134 + IMPORT reduce 134 + INTERFACE reduce 134 + STATIC reduce 134 + IDENTIFIER reduce 134 + ',' reduce 134 + '>' reduce 134 + + +state 26 + compilationunit : type . type compilationunit (5) + + BOOLEAN shift 2 + CHAR shift 3 + INT shift 6 + IDENTIFIER shift 14 + . error + + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 47 + + +state 27 + classdeclaration : modifiers . CLASS classidentifier classbody (21) + classdeclaration : modifiers . CLASS classidentifier super classbody (23) + classdeclaration : modifiers . CLASS classidentifier interfaces classbody (25) + classdeclaration : modifiers . CLASS classidentifier super interfaces classbody (27) + interfacedeclaration : modifiers . INTERFACE interfaceidentifier interfacebody (33) + interfacedeclaration : modifiers . INTERFACE interfaceidentifier extendsinterfaces interfacebody (35) + modifiers : modifiers . modifier (48) + + ABSTRACT shift 1 + CLASS shift 48 + FINAL shift 5 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + INTERFACE shift 49 + STATIC shift 13 + . error + + modifier goto 50 + + +state 28 + modifiers : modifier . (47) + + . reduce 47 + + +state 29 + compilationunit : typedeclarations . (1) + typedeclarations : typedeclarations . typedeclaration (11) + + ABSTRACT shift 1 + CLASS shift 4 + FINAL shift 5 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + INTERFACE shift 12 + STATIC shift 13 + $end reduce 1 + + classdeclaration goto 16 + interfacedeclaration goto 17 + modifiers goto 27 + modifier goto 28 + typedeclaration goto 51 + + +state 30 + compilationunit : packagedeclaration . importdeclarations typedeclarations (3) + compilationunit : packagedeclaration . typedeclarations (4) + + ABSTRACT shift 1 + CLASS shift 4 + FINAL shift 5 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + IMPORT shift 11 + INTERFACE shift 12 + STATIC shift 13 + . error + + classdeclaration goto 16 + interfacedeclaration goto 17 + importdeclaration goto 19 + importdeclarations goto 52 + modifiers goto 27 + modifier goto 28 + typedeclarations goto 53 + typedeclaration goto 31 + + +state 31 + typedeclarations : typedeclaration . (10) + + . reduce 10 + + +state 32 + classidentifier : IDENTIFIER . (30) + classidentifier : IDENTIFIER . '<' boundedClassParameters '>' (31) + + '<' shift 54 + EXTENDS reduce 30 + IMPLEMENTS reduce 30 + '{' reduce 30 + + +state 33 + classdeclaration : CLASS classidentifier . classbody (20) + classdeclaration : CLASS classidentifier . super classbody (22) + classdeclaration : CLASS classidentifier . interfaces classbody (24) + classdeclaration : CLASS classidentifier . super interfaces classbody (26) + + EXTENDS shift 55 + IMPLEMENTS shift 56 + '{' shift 57 + . error + + classbody goto 58 + super goto 59 + interfaces goto 60 + + +state 34 + name : simplename . (13) + + . reduce 13 + + +state 35 + name : qualifiedname . (12) + + . reduce 12 + + +state 36 + packagedeclaration : PACKAGE name . ';' (6) + qualifiedname : name . '.' IDENTIFIER (16) + + ';' shift 61 + '.' shift 62 + . error + + +state 37 + importdeclaration : IMPORT importqualifiedname . ';' (9) + + ';' shift 63 + . error + + +state 38 + qualifiedname : name . '.' IDENTIFIER (16) + importqualifiedname : name . '.' IDENTIFIER (17) + importqualifiedname : name . '.' '*' (18) + + '.' shift 64 + . error + + +state 39 + interfaceidentifier : IDENTIFIER . (28) + interfaceidentifier : IDENTIFIER . '<' boundedClassParameters '>' (29) + + '<' shift 65 + EXTENDS reduce 28 + '{' reduce 28 + + +state 40 + interfacedeclaration : INTERFACE interfaceidentifier . interfacebody (32) + interfacedeclaration : INTERFACE interfaceidentifier . extendsinterfaces interfacebody (34) + + EXTENDS shift 66 + '{' shift 67 + . error + + interfacebody goto 68 + extendsinterfaces goto 69 + + +state 41 + parameter : '<' . typelist '>' (75) + + BOOLEAN shift 2 + CHAR shift 3 + INT shift 6 + IDENTIFIER shift 14 + . error + + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 70 + typelist goto 71 + + +state 42 + classorinterfacetype : simplename parameter . (71) + + . reduce 71 + + +state 43 + importdeclarations : importdeclarations importdeclaration . (8) + + . reduce 8 + + +state 44 + compilationunit : importdeclarations typedeclarations . (2) + typedeclarations : typedeclarations . typedeclaration (11) + + ABSTRACT shift 1 + CLASS shift 4 + FINAL shift 5 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + INTERFACE shift 12 + STATIC shift 13 + $end reduce 2 + + classdeclaration goto 16 + interfacedeclaration goto 17 + modifiers goto 27 + modifier goto 28 + typedeclaration goto 51 + + +state 45 + type : primitivetype '[' . ']' (133) + + ']' shift 72 + . error + + +state 46 + type : referencetype '[' . ']' (135) + + ']' shift 73 + . error + + +state 47 + compilationunit : type type . compilationunit (5) + + ABSTRACT shift 1 + BOOLEAN shift 2 + CHAR shift 3 + CLASS shift 4 + FINAL shift 5 + INT shift 6 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + PACKAGE shift 10 + IMPORT shift 11 + INTERFACE shift 12 + STATIC shift 13 + IDENTIFIER shift 14 + . error + + compilationunit goto 74 + classdeclaration goto 16 + interfacedeclaration goto 17 + simplename goto 18 + importdeclaration goto 19 + importdeclarations goto 20 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 26 + modifiers goto 27 + modifier goto 28 + typedeclarations goto 29 + packagedeclaration goto 30 + typedeclaration goto 31 + + +state 48 + classdeclaration : modifiers CLASS . classidentifier classbody (21) + classdeclaration : modifiers CLASS . classidentifier super classbody (23) + classdeclaration : modifiers CLASS . classidentifier interfaces classbody (25) + classdeclaration : modifiers CLASS . classidentifier super interfaces classbody (27) + + IDENTIFIER shift 32 + . error + + classidentifier goto 75 + + +state 49 + interfacedeclaration : modifiers INTERFACE . interfaceidentifier interfacebody (33) + interfacedeclaration : modifiers INTERFACE . interfaceidentifier extendsinterfaces interfacebody (35) + + IDENTIFIER shift 39 + . error + + interfaceidentifier goto 76 + + +state 50 + modifiers : modifiers modifier . (48) + + . reduce 48 + + +state 51 + typedeclarations : typedeclarations typedeclaration . (11) + + . reduce 11 + + +state 52 + compilationunit : packagedeclaration importdeclarations . typedeclarations (3) + importdeclarations : importdeclarations . importdeclaration (8) + + ABSTRACT shift 1 + CLASS shift 4 + FINAL shift 5 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + IMPORT shift 11 + INTERFACE shift 12 + STATIC shift 13 + . error + + classdeclaration goto 16 + interfacedeclaration goto 17 + importdeclaration goto 43 + modifiers goto 27 + modifier goto 28 + typedeclarations goto 77 + typedeclaration goto 31 + + +state 53 + compilationunit : packagedeclaration typedeclarations . (4) + typedeclarations : typedeclarations . typedeclaration (11) + + ABSTRACT shift 1 + CLASS shift 4 + FINAL shift 5 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + INTERFACE shift 12 + STATIC shift 13 + $end reduce 4 + + classdeclaration goto 16 + interfacedeclaration goto 17 + modifiers goto 27 + modifier goto 28 + typedeclaration goto 51 + + +state 54 + classidentifier : IDENTIFIER '<' . boundedClassParameters '>' (31) + + IDENTIFIER shift 78 + . error + + boundedMethodParameter goto 79 + boundedClassParameter goto 80 + boundedClassParameters goto 81 + + +state 55 + super : EXTENDS . classtype (49) + + IDENTIFIER shift 14 + . error + + simplename goto 18 + classtype goto 82 + classorinterfacetype goto 83 + + +state 56 + interfaces : IMPLEMENTS . interfacetype (50) + + IDENTIFIER shift 14 + . error + + simplename goto 18 + classorinterfacetype goto 84 + interfacetype goto 85 + + +state 57 + classbody : '{' . '}' (45) + classbody : '{' . classbodydeclarations '}' (46) + + ABSTRACT shift 1 + BOOLEAN shift 2 + CHAR shift 3 + FINAL shift 5 + INT shift 6 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + STATIC shift 86 + VOID shift 87 + IDENTIFIER shift 88 + '<' shift 89 + '}' shift 90 + . error + + fielddeclaration goto 91 + methodheader goto 92 + methoddeclaration goto 93 + methoddeclarator goto 94 + classbodydeclarations goto 95 + classbodydeclaration goto 96 + classmemberdeclaration goto 97 + variabledeclarators goto 98 + fielddeclarator goto 99 + variabledeclarator goto 100 + variabledeclaratorid goto 101 + simplename goto 102 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 103 + modifiers goto 104 + modifier goto 28 + constructordeclaration goto 105 + constructordeclarator goto 106 + staticinitializer goto 107 + + +state 58 + classdeclaration : CLASS classidentifier classbody . (20) + + . reduce 20 + + +state 59 + classdeclaration : CLASS classidentifier super . classbody (22) + classdeclaration : CLASS classidentifier super . interfaces classbody (26) + + IMPLEMENTS shift 56 + '{' shift 57 + . error + + classbody goto 108 + interfaces goto 109 state 60 - type : primitivetype . (124) - type : primitivetype . '[' ']' (125) + classdeclaration : CLASS classidentifier interfaces . classbody (24) + interfaces : interfaces . ',' interfacetype (51) - '[' shift 97 - IDENTIFIER reduce 124 - - -state 61 - type : referencetype . (126) - type : referencetype . '[' ']' (127) - - '[' shift 98 - IDENTIFIER reduce 126 - - -state 62 - fielddeclaration : type . fielddeclarator (80) - fielddeclaration : type . variabledeclarators ';' (82) - methodheader : type . methoddeclarator (104) - methodheader : type . methoddeclarator throws (107) - - IDENTIFIER shift 99 - . error - - methoddeclarator goto 100 - variabledeclarators goto 101 - fielddeclarator goto 102 - variabledeclarator goto 54 - variabledeclaratorid goto 55 - - -state 63 - modifiers : modifiers . modifier (43) - constructordeclaration : modifiers . constructordeclarator constructorbody (75) - fielddeclaration : modifiers . type variabledeclarators ';' (83) - methodheader : modifiers . type methoddeclarator (105) - methodheader : modifiers . '<' boundedMethodParameters '>' type methoddeclarator (106) - methodheader : modifiers . type methoddeclarator throws (109) - methodheader : modifiers . '<' boundedMethodParameters '>' type methoddeclarator throws (110) - methodheader : modifiers . VOID methoddeclarator (112) - methodheader : modifiers . VOID methoddeclarator throws (114) - methodheader : modifiers . '<' boundedMethodParameters '>' VOID methoddeclarator (116) - methodheader : modifiers . '<' boundedMethodParameters '>' VOID methoddeclarator throws (118) - methodheader : modifiers . methoddeclarator (121) - methodheader : modifiers . methoddeclarator throws (123) - - ABSTRACT shift 1 - BOOLEAN shift 37 - CHAR shift 38 - FINAL shift 3 - INT shift 39 - PRIVATE shift 4 - PROTECTED shift 5 - PUBLIC shift 6 - STATIC shift 7 - VOID shift 103 - IDENTIFIER shift 104 - '<' shift 105 - . error - - methoddeclarator goto 106 - simplename goto 56 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 107 - modifier goto 17 - constructordeclarator goto 108 - - -state 64 - classbodydeclaration : constructordeclaration . (65) - - . reduce 65 - - -state 65 - constructordeclaration : constructordeclarator . constructorbody (74) - - '{' shift 109 - . error - - constructorbody goto 110 - - -state 66 - classbodydeclaration : staticinitializer . (64) - - . reduce 64 - - -state 67 - classdeclaration : CLASS classidentifier super classbody . (17) - - . reduce 17 - - -state 68 - classdeclaration : CLASS classidentifier super interfaces . classbody (21) - interfaces : interfaces . ',' interfacetype (46) - - ',' shift 69 - '{' shift 22 + ',' shift 110 + '{' shift 57 . error classbody goto 111 -state 69 - interfaces : interfaces ',' . interfacetype (46) +state 61 + packagedeclaration : PACKAGE name ';' . (6) - IDENTIFIER shift 31 + . reduce 6 + + +state 62 + qualifiedname : name '.' . IDENTIFIER (16) + + IDENTIFIER shift 112 . error - simplename goto 32 - classorinterfacetype goto 35 - interfacetype goto 112 + +state 63 + importdeclaration : IMPORT importqualifiedname ';' . (9) + + . reduce 9 + + +state 64 + qualifiedname : name '.' . IDENTIFIER (16) + importqualifiedname : name '.' . IDENTIFIER (17) + importqualifiedname : name '.' . '*' (18) + + IDENTIFIER shift 113 + '*' shift 114 + . error + + +state 65 + interfaceidentifier : IDENTIFIER '<' . boundedClassParameters '>' (29) + + IDENTIFIER shift 78 + . error + + boundedMethodParameter goto 79 + boundedClassParameter goto 80 + boundedClassParameters goto 115 + + +state 66 + extendsinterfaces : EXTENDS . interfacetype (54) + + IDENTIFIER shift 14 + . error + + simplename goto 18 + classorinterfacetype goto 84 + interfacetype goto 116 + + +state 67 + interfacebody : '{' . '}' (52) + interfacebody : '{' . interfacememberdeclarations '}' (53) + + ABSTRACT shift 1 + BOOLEAN shift 2 + CHAR shift 3 + FINAL shift 5 + INT shift 6 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + STATIC shift 13 + VOID shift 87 + IDENTIFIER shift 117 + '<' shift 118 + '}' shift 119 + . error + + interfacememberdeclarations goto 120 + interfacememberdeclaration goto 121 + abstractmethoddeclaration goto 122 + constantdeclaration goto 123 + methodheader goto 124 + methoddeclarator goto 94 + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 125 + modifiers goto 126 + modifier goto 28 + + +state 68 + interfacedeclaration : INTERFACE interfaceidentifier interfacebody . (32) + + . reduce 32 + + +state 69 + interfacedeclaration : INTERFACE interfaceidentifier extendsinterfaces . interfacebody (34) + extendsinterfaces : extendsinterfaces . ',' interfacetype (55) + + ',' shift 127 + '{' shift 67 + . error + + interfacebody goto 128 state 70 - classdeclaration : CLASS classidentifier interfaces classbody . (19) + typelist : type . (72) - . reduce 19 + . reduce 72 state 71 - classdeclaration : modifiers CLASS classidentifier classbody . (16) + typelist : typelist . ',' type (73) + parameter : '<' typelist . '>' (75) - . reduce 16 + ',' shift 129 + '>' shift 130 + . error state 72 - classdeclaration : modifiers CLASS classidentifier super . classbody (18) - classdeclaration : modifiers CLASS classidentifier super . interfaces classbody (22) + type : primitivetype '[' ']' . (133) - IMPLEMENTS shift 21 - '{' shift 22 - . error - - classbody goto 113 - interfaces goto 114 + . reduce 133 state 73 - classdeclaration : modifiers CLASS classidentifier interfaces . classbody (20) - interfaces : interfaces . ',' interfacetype (46) + type : referencetype '[' ']' . (135) - ',' shift 69 - '{' shift 22 - . error - - classbody goto 115 + . reduce 135 state 74 - boundedMethodParameter : IDENTIFIER EXTENDS . boundedclassidentifierlist (98) + compilationunit : type type compilationunit . (5) - IDENTIFIER shift 31 - . error - - simplename goto 32 - classorinterfacetype goto 57 - referencetype goto 116 - boundedclassidentifierlist goto 117 + . reduce 5 state 75 - boundedClassParameters : boundedClassParameters ',' . boundedClassParameter (96) + classdeclaration : modifiers CLASS classidentifier . classbody (21) + classdeclaration : modifiers CLASS classidentifier . super classbody (23) + classdeclaration : modifiers CLASS classidentifier . interfaces classbody (25) + classdeclaration : modifiers CLASS classidentifier . super interfaces classbody (27) - IDENTIFIER shift 27 + EXTENDS shift 55 + IMPLEMENTS shift 56 + '{' shift 57 . error - boundedMethodParameter goto 28 - boundedClassParameter goto 118 + classbody goto 131 + super goto 132 + interfaces goto 133 state 76 - classidentifier : IDENTIFIER '<' boundedClassParameters '>' . (26) + interfacedeclaration : modifiers INTERFACE interfaceidentifier . interfacebody (33) + interfacedeclaration : modifiers INTERFACE interfaceidentifier . extendsinterfaces interfacebody (35) - . reduce 26 + EXTENDS shift 66 + '{' shift 67 + . error + + interfacebody goto 134 + extendsinterfaces goto 135 state 77 - parameter : '<' . paralist '>' (68) + compilationunit : packagedeclaration importdeclarations typedeclarations . (3) + typedeclarations : typedeclarations . typedeclaration (11) - IDENTIFIER shift 119 - '?' shift 120 - . error + ABSTRACT shift 1 + CLASS shift 4 + FINAL shift 5 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + INTERFACE shift 12 + STATIC shift 13 + $end reduce 3 - paralist goto 121 - wildcardparameter goto 122 + classdeclaration goto 16 + interfacedeclaration goto 17 + modifiers goto 27 + modifier goto 28 + typedeclaration goto 51 state 78 - classorinterfacetype : simplename parameter . (66) + boundedMethodParameter : IDENTIFIER . (105) + boundedMethodParameter : IDENTIFIER . EXTENDS boundedclassidentifierlist (106) - . reduce 66 + EXTENDS shift 136 + ',' reduce 105 + '>' reduce 105 state 79 - block : '{' . '}' (85) - block : '{' . blockstatements '}' (86) + boundedClassParameter : boundedMethodParameter . (102) - BOOLEAN shift 37 - CHAR shift 38 - FOR shift 123 - IF shift 124 - INT shift 39 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 136 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '}' shift 140 - '(' shift 141 - . error - - variabledeclarators goto 142 - variabledeclarator goto 143 - variabledeclaratorid goto 55 - simplename goto 144 - qualifiedname goto 145 - name goto 146 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 147 - block goto 148 - blockstatements goto 149 - localvariabledeclarationstatement goto 150 - localvariabledeclaration goto 151 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - blockstatement goto 165 - statement goto 166 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 + . reduce 102 state 80 - staticinitializer : STATIC block . (73) + boundedClassParameters : boundedClassParameter . (103) - . reduce 73 + . reduce 103 state 81 - methoddeclarator : IDENTIFIER . '(' ')' (139) - methoddeclarator : IDENTIFIER . '(' formalparameterlist ')' (140) + classidentifier : IDENTIFIER '<' boundedClassParameters . '>' (31) + boundedClassParameters : boundedClassParameters . ',' boundedClassParameter (104) - '(' shift 83 + ',' shift 137 + '>' shift 138 . error state 82 - methodheader : VOID methoddeclarator . (111) - methodheader : VOID methoddeclarator . throws (113) + super : EXTENDS classtype . (49) - THROWS shift 88 - '{' reduce 111 - - throws goto 176 + . reduce 49 state 83 - methoddeclarator : IDENTIFIER '(' . ')' (139) - methoddeclarator : IDENTIFIER '(' . formalparameterlist ')' (140) + classtype : classorinterfacetype . (64) - BOOLEAN shift 37 - CHAR shift 38 - INT shift 39 - IDENTIFIER shift 136 - ')' shift 177 - . error - - variabledeclaratorid goto 178 - simplename goto 32 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 179 - formalparameter goto 180 - formalparameterlist goto 181 + . reduce 64 state 84 - boundedMethodParameters : boundedMethodParameter . (101) + interfacetype : classorinterfacetype . (67) - . reduce 101 + . reduce 67 state 85 - boundedMethodParameters : boundedMethodParameters . ',' boundedMethodParameter (102) - methodheader : '<' boundedMethodParameters . '>' type methoddeclarator (103) - methodheader : '<' boundedMethodParameters . '>' type methoddeclarator throws (108) - methodheader : '<' boundedMethodParameters . '>' VOID methoddeclarator (115) - methodheader : '<' boundedMethodParameters . '>' VOID methoddeclarator throws (117) - methodheader : '<' boundedMethodParameters . '>' methoddeclarator (120) + interfaces : IMPLEMENTS interfacetype . (50) - ',' shift 182 - '>' shift 183 - . error + . reduce 50 state 86 - methodbody : block . (130) + modifier : STATIC . (61) + staticinitializer : STATIC . block (80) - . reduce 130 + '{' shift 139 + ABSTRACT reduce 61 + BOOLEAN reduce 61 + CHAR reduce 61 + FINAL reduce 61 + INT reduce 61 + PRIVATE reduce 61 + PROTECTED reduce 61 + PUBLIC reduce 61 + STATIC reduce 61 + VOID reduce 61 + IDENTIFIER reduce 61 + '<' reduce 61 + + block goto 140 state 87 - methoddeclaration : methodheader methodbody . (84) + methodheader : VOID . methoddeclarator (119) + methodheader : VOID . methoddeclarator throws (121) - . reduce 84 - - -state 88 - throws : THROWS . classtypelist (93) - - IDENTIFIER shift 31 + IDENTIFIER shift 141 . error - simplename goto 32 - classtype goto 184 - classorinterfacetype goto 34 - classtypelist goto 185 + methoddeclarator goto 142 + + +88: shift/reduce conflict (shift 143, reduce 19) on '(' +state 88 + simplename : IDENTIFIER . (19) + methoddeclarator : IDENTIFIER . '(' ')' (147) + methoddeclarator : IDENTIFIER . '(' formalparameterlist ')' (148) + variabledeclaratorid : IDENTIFIER . (160) + + '(' shift 143 + IDENTIFIER reduce 19 + ',' reduce 160 + ';' reduce 160 + '<' reduce 19 + '=' reduce 160 + '[' reduce 19 state 89 - methodheader : methoddeclarator throws . (122) + fielddeclaration : '<' . boundedMethodParameters '>' type fielddeclarator ';' (88) + methodheader : '<' . boundedMethodParameters '>' type methoddeclarator (111) + methodheader : '<' . boundedMethodParameters '>' type methoddeclarator throws (116) + methodheader : '<' . boundedMethodParameters '>' VOID methoddeclarator (123) + methodheader : '<' . boundedMethodParameters '>' VOID methoddeclarator throws (125) + methodheader : '<' . boundedMethodParameters '>' methoddeclarator (128) - . reduce 122 + IDENTIFIER shift 78 + . error + + boundedMethodParameter goto 144 + boundedMethodParameters goto 145 state 90 - classbody : '{' classbodydeclarations '}' . (41) + classbody : '{' '}' . (45) - . reduce 41 + . reduce 45 state 91 - classbodydeclarations : classbodydeclarations classbodydeclaration . (52) + classmemberdeclaration : fielddeclaration . (78) - . reduce 52 + . reduce 78 state 92 - variabledeclarators : variabledeclarators ',' . variabledeclarator (129) + methoddeclaration : methodheader . methodbody (92) - IDENTIFIER shift 186 + '{' shift 139 . error - variabledeclarator goto 187 - variabledeclaratorid goto 55 + block goto 146 + methodbody goto 147 state 93 - fielddeclaration : variabledeclarators ';' . (81) - - . reduce 81 - - -state 94 - fielddeclaration : fielddeclarator ';' . (79) + classmemberdeclaration : methoddeclaration . (79) . reduce 79 -state 95 - fielddeclarator : variabledeclarator '=' . expression (78) +state 94 + methodheader : methoddeclarator . (127) + methodheader : methoddeclarator . throws (130) - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 + THROWS shift 148 + ';' reduce 127 + '{' reduce 127 + + throws goto 149 + + +state 95 + classbody : '{' classbodydeclarations . '}' (46) + classbodydeclarations : classbodydeclarations . classbodydeclaration (57) + + ABSTRACT shift 1 + BOOLEAN shift 2 + CHAR shift 3 + FINAL shift 5 + INT shift 6 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + STATIC shift 86 + VOID shift 87 + IDENTIFIER shift 88 + '<' shift 89 + '}' shift 150 . error - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 209 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 + fielddeclaration goto 91 + methodheader goto 92 + methoddeclaration goto 93 + methoddeclarator goto 94 + classbodydeclaration goto 151 + classmemberdeclaration goto 97 + variabledeclarators goto 98 + fielddeclarator goto 99 + variabledeclarator goto 100 + variabledeclaratorid goto 101 + simplename goto 102 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 103 + modifiers goto 104 + modifier goto 28 + constructordeclaration goto 105 + constructordeclarator goto 106 + staticinitializer goto 107 state 96 - constructordeclarator : simplename '(' . ')' (87) - constructordeclarator : simplename '(' . formalparameterlist ')' (88) + classbodydeclarations : classbodydeclaration . (56) - BOOLEAN shift 37 - CHAR shift 38 - INT shift 39 - IDENTIFIER shift 136 - ')' shift 218 - . error - - variabledeclaratorid goto 178 - simplename goto 32 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 179 - formalparameter goto 180 - formalparameterlist goto 219 + . reduce 56 state 97 - type : primitivetype '[' . ']' (125) + classbodydeclaration : classmemberdeclaration . (68) - ']' shift 220 - . error + . reduce 68 state 98 - type : referencetype '[' . ']' (127) + fielddeclaration : variabledeclarators . ';' (89) + variabledeclarators : variabledeclarators . ',' variabledeclarator (137) - ']' shift 221 + ',' shift 152 + ';' shift 153 . error state 99 - methoddeclarator : IDENTIFIER . '(' ')' (139) - methoddeclarator : IDENTIFIER . '(' formalparameterlist ')' (140) - variabledeclaratorid : IDENTIFIER . (152) + fielddeclaration : fielddeclarator . ';' (86) - '(' shift 83 - ',' reduce 152 - ';' reduce 152 - '=' reduce 152 + ';' shift 154 + . error state 100 - methodheader : type methoddeclarator . (104) - methodheader : type methoddeclarator . throws (107) + fielddeclarator : variabledeclarator . '=' expression (85) + variabledeclarators : variabledeclarator . (136) - THROWS shift 88 - '{' reduce 104 - - throws goto 222 + '=' shift 155 + ',' reduce 136 + ';' reduce 136 state 101 - fielddeclaration : type variabledeclarators . ';' (82) - variabledeclarators : variabledeclarators . ',' variabledeclarator (129) + variabledeclarator : variabledeclaratorid . (152) - ',' shift 92 - ';' shift 223 - . error + . reduce 152 state 102 - fielddeclaration : type fielddeclarator . (80) + classorinterfacetype : simplename . parameter (71) + constructordeclarator : simplename . '(' ')' (95) + constructordeclarator : simplename . '(' formalparameterlist ')' (96) + parameter : . (74) - . reduce 80 + '<' shift 41 + '(' shift 156 + IDENTIFIER reduce 74 + '[' reduce 74 + + parameter goto 42 state 103 - methodheader : modifiers VOID . methoddeclarator (112) - methodheader : modifiers VOID . methoddeclarator throws (114) + fielddeclaration : type . fielddeclarator ';' (87) + fielddeclaration : type . variabledeclarators ';' (90) + methodheader : type . methoddeclarator (112) + methodheader : type . methoddeclarator throws (115) - IDENTIFIER shift 81 + IDENTIFIER shift 157 . error - methoddeclarator goto 224 + methoddeclarator goto 158 + variabledeclarators goto 159 + fielddeclarator goto 160 + variabledeclarator goto 100 + variabledeclaratorid goto 101 -104: shift/reduce conflict (shift 83, reduce 14) on '(' state 104 - simplename : IDENTIFIER . (14) - methoddeclarator : IDENTIFIER . '(' ')' (139) - methoddeclarator : IDENTIFIER . '(' formalparameterlist ')' (140) + modifiers : modifiers . modifier (48) + constructordeclaration : modifiers . constructordeclarator constructorbody (82) + fielddeclaration : modifiers . type variabledeclarators ';' (91) + methodheader : modifiers . type methoddeclarator (113) + methodheader : modifiers . '<' boundedMethodParameters '>' type methoddeclarator (114) + methodheader : modifiers . type methoddeclarator throws (117) + methodheader : modifiers . '<' boundedMethodParameters '>' type methoddeclarator throws (118) + methodheader : modifiers . VOID methoddeclarator (120) + methodheader : modifiers . VOID methoddeclarator throws (122) + methodheader : modifiers . '<' boundedMethodParameters '>' VOID methoddeclarator (124) + methodheader : modifiers . '<' boundedMethodParameters '>' VOID methoddeclarator throws (126) + methodheader : modifiers . methoddeclarator (129) + methodheader : modifiers . methoddeclarator throws (131) - '(' shift 83 - IDENTIFIER reduce 14 - '<' reduce 14 - '[' reduce 14 + ABSTRACT shift 1 + BOOLEAN shift 2 + CHAR shift 3 + FINAL shift 5 + INT shift 6 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + STATIC shift 13 + VOID shift 161 + IDENTIFIER shift 117 + '<' shift 162 + . error + + methoddeclarator goto 163 + simplename goto 102 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 164 + modifier goto 50 + constructordeclarator goto 165 state 105 - methodheader : modifiers '<' . boundedMethodParameters '>' type methoddeclarator (106) - methodheader : modifiers '<' . boundedMethodParameters '>' type methoddeclarator throws (110) - methodheader : modifiers '<' . boundedMethodParameters '>' VOID methoddeclarator (116) - methodheader : modifiers '<' . boundedMethodParameters '>' VOID methoddeclarator throws (118) + classbodydeclaration : constructordeclaration . (70) - IDENTIFIER shift 27 - . error - - boundedMethodParameter goto 84 - boundedMethodParameters goto 225 + . reduce 70 state 106 - methodheader : modifiers methoddeclarator . (121) - methodheader : modifiers methoddeclarator . throws (123) + constructordeclaration : constructordeclarator . constructorbody (81) - THROWS shift 88 - '{' reduce 121 + '{' shift 166 + . error - throws goto 226 + constructorbody goto 167 state 107 - fielddeclaration : modifiers type . variabledeclarators ';' (83) - methodheader : modifiers type . methoddeclarator (105) - methodheader : modifiers type . methoddeclarator throws (109) + classbodydeclaration : staticinitializer . (69) - IDENTIFIER shift 99 - . error - - methoddeclarator goto 227 - variabledeclarators goto 228 - variabledeclarator goto 143 - variabledeclaratorid goto 55 + . reduce 69 state 108 - constructordeclaration : modifiers constructordeclarator . constructorbody (75) + classdeclaration : CLASS classidentifier super classbody . (22) - '{' shift 109 - . error - - constructorbody goto 229 + . reduce 22 state 109 - constructorbody : '{' . '}' (89) - constructorbody : '{' . explicitconstructorinvocation '}' (90) - constructorbody : '{' . blockstatements '}' (91) - constructorbody : '{' . explicitconstructorinvocation blockstatements '}' (92) + classdeclaration : CLASS classidentifier super interfaces . classbody (26) + interfaces : interfaces . ',' interfacetype (51) - BOOLEAN shift 37 - CHAR shift 38 - FOR shift 123 - IF shift 124 - INT shift 39 - RETURN shift 125 - THIS shift 230 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 136 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '}' shift 231 - '(' shift 141 + ',' shift 110 + '{' shift 57 . error - variabledeclarators goto 142 - variabledeclarator goto 143 - variabledeclaratorid goto 55 - simplename goto 144 - qualifiedname goto 145 - name goto 146 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 147 - block goto 148 - blockstatements goto 232 - localvariabledeclarationstatement goto 150 - localvariabledeclaration goto 151 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - blockstatement goto 165 - statement goto 166 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - explicitconstructorinvocation goto 233 + classbody goto 168 state 110 - constructordeclaration : constructordeclarator constructorbody . (74) + interfaces : interfaces ',' . interfacetype (51) - . reduce 74 + IDENTIFIER shift 14 + . error + + simplename goto 18 + classorinterfacetype goto 84 + interfacetype goto 169 state 111 - classdeclaration : CLASS classidentifier super interfaces classbody . (21) + classdeclaration : CLASS classidentifier interfaces classbody . (24) - . reduce 21 + . reduce 24 state 112 - interfaces : interfaces ',' interfacetype . (46) + qualifiedname : name '.' IDENTIFIER . (16) - . reduce 46 + . reduce 16 state 113 - classdeclaration : modifiers CLASS classidentifier super classbody . (18) + qualifiedname : name '.' IDENTIFIER . (16) + importqualifiedname : name '.' IDENTIFIER . (17) + + ';' reduce 17 + '.' reduce 16 + + +state 114 + importqualifiedname : name '.' '*' . (18) . reduce 18 -state 114 - classdeclaration : modifiers CLASS classidentifier super interfaces . classbody (22) - interfaces : interfaces . ',' interfacetype (46) - - ',' shift 69 - '{' shift 22 - . error - - classbody goto 234 - - state 115 - classdeclaration : modifiers CLASS classidentifier interfaces classbody . (20) + interfaceidentifier : IDENTIFIER '<' boundedClassParameters . '>' (29) + boundedClassParameters : boundedClassParameters . ',' boundedClassParameter (104) - . reduce 20 + ',' shift 137 + '>' shift 170 + . error state 116 - boundedclassidentifierlist : referencetype . (99) + extendsinterfaces : EXTENDS interfacetype . (54) - . reduce 99 + . reduce 54 +117: shift/reduce conflict (shift 143, reduce 19) on '(' state 117 - boundedMethodParameter : IDENTIFIER EXTENDS boundedclassidentifierlist . (98) - boundedclassidentifierlist : boundedclassidentifierlist . '&' referencetype (100) + simplename : IDENTIFIER . (19) + methoddeclarator : IDENTIFIER . '(' ')' (147) + methoddeclarator : IDENTIFIER . '(' formalparameterlist ')' (148) - '&' shift 235 - ',' reduce 98 - '>' reduce 98 + '(' shift 143 + IDENTIFIER reduce 19 + '<' reduce 19 + '[' reduce 19 state 118 - boundedClassParameters : boundedClassParameters ',' boundedClassParameter . (96) + methodheader : '<' . boundedMethodParameters '>' type methoddeclarator (111) + methodheader : '<' . boundedMethodParameters '>' type methoddeclarator throws (116) + methodheader : '<' . boundedMethodParameters '>' VOID methoddeclarator (123) + methodheader : '<' . boundedMethodParameters '>' VOID methoddeclarator throws (125) + methodheader : '<' . boundedMethodParameters '>' methoddeclarator (128) - . reduce 96 + IDENTIFIER shift 78 + . error + + boundedMethodParameter goto 144 + boundedMethodParameters goto 171 state 119 - paralist : IDENTIFIER . (31) - paralist : IDENTIFIER . '<' paralist '>' (32) + interfacebody : '{' '}' . (52) - '<' shift 236 - ',' reduce 31 - '>' reduce 31 + . reduce 52 state 120 - wildcardparameter : '?' . (37) - wildcardparameter : '?' . EXTENDS referencetype (38) - wildcardparameter : '?' . SUPER referencetype (39) + interfacebody : '{' interfacememberdeclarations . '}' (53) + interfacememberdeclarations : interfacememberdeclarations . interfacememberdeclaration (66) - EXTENDS shift 237 - SUPER shift 238 - ',' reduce 37 - '>' reduce 37 + ABSTRACT shift 1 + BOOLEAN shift 2 + CHAR shift 3 + FINAL shift 5 + INT shift 6 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + STATIC shift 13 + VOID shift 87 + IDENTIFIER shift 117 + '<' shift 118 + '}' shift 172 + . error + + interfacememberdeclaration goto 173 + abstractmethoddeclaration goto 122 + constantdeclaration goto 123 + methodheader goto 124 + methoddeclarator goto 94 + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 125 + modifiers goto 126 + modifier goto 28 state 121 - paralist : paralist . ',' IDENTIFIER (34) - paralist : paralist . ',' IDENTIFIER '<' paralist '>' (35) - paralist : paralist . ',' wildcardparameter (36) - parameter : '<' paralist . '>' (68) + interfacememberdeclarations : interfacememberdeclaration . (65) - ',' shift 239 - '>' shift 240 - . error + . reduce 65 state 122 - paralist : wildcardparameter . (33) + interfacememberdeclaration : abstractmethoddeclaration . (77) - . reduce 33 + . reduce 77 state 123 - forstatement : FOR . '(' expression ';' expression ';' expression ')' statement (173) - forstatement : FOR . '(' expression ';' expression ';' ')' statement (174) - forstatement : FOR . '(' expression ';' ';' expression ')' statement (175) - forstatement : FOR . '(' ';' expression ';' expression ')' statement (176) - forstatement : FOR . '(' expression ';' ';' ')' statement (177) - forstatement : FOR . '(' ';' expression ';' ')' statement (178) - forstatement : FOR . '(' ';' ';' expression ')' statement (179) - forstatement : FOR . '(' ';' ';' ')' statement (180) + interfacememberdeclaration : constantdeclaration . (76) - '(' shift 241 - . error + . reduce 76 state 124 - ifthenstatement : IF . '(' expression ')' statement (170) - ifthenelsestatement : IF . '(' expression ')' statementnoshortif ELSE statement (171) + abstractmethoddeclaration : methodheader . ';' (84) - '(' shift 242 + ';' shift 174 . error state 125 - returnstatement : RETURN . ';' (185) - returnstatement : RETURN . expression ';' (186) + methodheader : type . methoddeclarator (112) + methodheader : type . methoddeclarator throws (115) - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 243 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 + IDENTIFIER shift 141 . error - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 244 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 + methoddeclarator goto 158 state 126 - primarynonewarray : THIS . (241) + modifiers : modifiers . modifier (48) + constantdeclaration : modifiers . type IDENTIFIER '=' expression ';' (83) + methodheader : modifiers . type methoddeclarator (113) + methodheader : modifiers . '<' boundedMethodParameters '>' type methoddeclarator (114) + methodheader : modifiers . type methoddeclarator throws (117) + methodheader : modifiers . '<' boundedMethodParameters '>' type methoddeclarator throws (118) + methodheader : modifiers . VOID methoddeclarator (120) + methodheader : modifiers . VOID methoddeclarator throws (122) + methodheader : modifiers . '<' boundedMethodParameters '>' VOID methoddeclarator (124) + methodheader : modifiers . '<' boundedMethodParameters '>' VOID methoddeclarator throws (126) + methodheader : modifiers . methoddeclarator (129) + methodheader : modifiers . methoddeclarator throws (131) - . reduce 241 + ABSTRACT shift 1 + BOOLEAN shift 2 + CHAR shift 3 + FINAL shift 5 + INT shift 6 + PRIVATE shift 7 + PROTECTED shift 8 + PUBLIC shift 9 + STATIC shift 13 + VOID shift 161 + IDENTIFIER shift 117 + '<' shift 162 + . error + + methoddeclarator goto 163 + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 175 + modifier goto 50 state 127 - whilestatement : WHILE . '(' expression ')' statement (172) + extendsinterfaces : extendsinterfaces ',' . interfacetype (55) - '(' shift 245 + IDENTIFIER shift 14 . error + simplename goto 18 + classorinterfacetype goto 84 + interfacetype goto 176 + state 128 - literal : INTLITERAL . (249) + interfacedeclaration : INTERFACE interfaceidentifier extendsinterfaces interfacebody . (34) + + . reduce 34 + + +state 129 + typelist : typelist ',' . type (73) + + BOOLEAN shift 2 + CHAR shift 3 + INT shift 6 + IDENTIFIER shift 14 + . error + + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 177 + + +state 130 + parameter : '<' typelist '>' . (75) + + . reduce 75 + + +state 131 + classdeclaration : modifiers CLASS classidentifier classbody . (21) + + . reduce 21 + + +state 132 + classdeclaration : modifiers CLASS classidentifier super . classbody (23) + classdeclaration : modifiers CLASS classidentifier super . interfaces classbody (27) + + IMPLEMENTS shift 56 + '{' shift 57 + . error + + classbody goto 178 + interfaces goto 179 + + +state 133 + classdeclaration : modifiers CLASS classidentifier interfaces . classbody (25) + interfaces : interfaces . ',' interfacetype (51) + + ',' shift 110 + '{' shift 57 + . error + + classbody goto 180 + + +state 134 + interfacedeclaration : modifiers INTERFACE interfaceidentifier interfacebody . (33) + + . reduce 33 + + +state 135 + interfacedeclaration : modifiers INTERFACE interfaceidentifier extendsinterfaces . interfacebody (35) + extendsinterfaces : extendsinterfaces . ',' interfacetype (55) + + ',' shift 127 + '{' shift 67 + . error + + interfacebody goto 181 + + +state 136 + boundedMethodParameter : IDENTIFIER EXTENDS . boundedclassidentifierlist (106) + + IDENTIFIER shift 14 + . error + + simplename goto 18 + classorinterfacetype goto 21 + referencetype goto 182 + boundedclassidentifierlist goto 183 + + +state 137 + boundedClassParameters : boundedClassParameters ',' . boundedClassParameter (104) + + IDENTIFIER shift 78 + . error + + boundedMethodParameter goto 79 + boundedClassParameter goto 184 + + +state 138 + classidentifier : IDENTIFIER '<' boundedClassParameters '>' . (31) + + . reduce 31 + + +state 139 + block : '{' . '}' (93) + block : '{' . blockstatements '}' (94) + + BOOLEAN shift 2 + CHAR shift 3 + FOR shift 185 + IF shift 186 + INT shift 6 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 198 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '}' shift 202 + '(' shift 203 + . error + + variabledeclarators goto 204 + variabledeclarator goto 205 + variabledeclaratorid goto 101 + simplename goto 206 + qualifiedname goto 35 + name goto 207 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 208 + block goto 209 + blockstatements goto 210 + localvariabledeclarationstatement goto 211 + localvariabledeclaration goto 212 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + blockstatement goto 226 + statement goto 227 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 140 + staticinitializer : STATIC block . (80) + + . reduce 80 + + +state 141 + methoddeclarator : IDENTIFIER . '(' ')' (147) + methoddeclarator : IDENTIFIER . '(' formalparameterlist ')' (148) + + '(' shift 143 + . error + + +state 142 + methodheader : VOID methoddeclarator . (119) + methodheader : VOID methoddeclarator . throws (121) + + THROWS shift 148 + ';' reduce 119 + '{' reduce 119 + + throws goto 237 + + +state 143 + methoddeclarator : IDENTIFIER '(' . ')' (147) + methoddeclarator : IDENTIFIER '(' . formalparameterlist ')' (148) + + BOOLEAN shift 2 + CHAR shift 3 + INT shift 6 + IDENTIFIER shift 198 + ')' shift 238 + . error + + variabledeclaratorid goto 239 + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 240 + formalparameter goto 241 + formalparameterlist goto 242 + + +state 144 + boundedMethodParameters : boundedMethodParameter . (109) + + . reduce 109 + + +state 145 + fielddeclaration : '<' boundedMethodParameters . '>' type fielddeclarator ';' (88) + boundedMethodParameters : boundedMethodParameters . ',' boundedMethodParameter (110) + methodheader : '<' boundedMethodParameters . '>' type methoddeclarator (111) + methodheader : '<' boundedMethodParameters . '>' type methoddeclarator throws (116) + methodheader : '<' boundedMethodParameters . '>' VOID methoddeclarator (123) + methodheader : '<' boundedMethodParameters . '>' VOID methoddeclarator throws (125) + methodheader : '<' boundedMethodParameters . '>' methoddeclarator (128) + + ',' shift 243 + '>' shift 244 + . error + + +state 146 + methodbody : block . (138) + + . reduce 138 + + +state 147 + methoddeclaration : methodheader methodbody . (92) + + . reduce 92 + + +state 148 + throws : THROWS . classtypelist (101) + + IDENTIFIER shift 14 + . error + + simplename goto 18 + classtype goto 245 + classorinterfacetype goto 83 + classtypelist goto 246 + + +state 149 + methodheader : methoddeclarator throws . (130) + + . reduce 130 + + +state 150 + classbody : '{' classbodydeclarations '}' . (46) + + . reduce 46 + + +state 151 + classbodydeclarations : classbodydeclarations classbodydeclaration . (57) + + . reduce 57 + + +state 152 + variabledeclarators : variabledeclarators ',' . variabledeclarator (137) + + IDENTIFIER shift 247 + . error + + variabledeclarator goto 248 + variabledeclaratorid goto 101 + + +state 153 + fielddeclaration : variabledeclarators ';' . (89) + + . reduce 89 + + +state 154 + fielddeclaration : fielddeclarator ';' . (86) + + . reduce 86 + + +state 155 + fielddeclarator : variabledeclarator '=' . expression (85) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 269 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 + + +state 156 + constructordeclarator : simplename '(' . ')' (95) + constructordeclarator : simplename '(' . formalparameterlist ')' (96) + + BOOLEAN shift 2 + CHAR shift 3 + INT shift 6 + IDENTIFIER shift 198 + ')' shift 278 + . error + + variabledeclaratorid goto 239 + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 240 + formalparameter goto 241 + formalparameterlist goto 279 + + +state 157 + methoddeclarator : IDENTIFIER . '(' ')' (147) + methoddeclarator : IDENTIFIER . '(' formalparameterlist ')' (148) + variabledeclaratorid : IDENTIFIER . (160) + + '(' shift 143 + ',' reduce 160 + ';' reduce 160 + '=' reduce 160 + + +state 158 + methodheader : type methoddeclarator . (112) + methodheader : type methoddeclarator . throws (115) + + THROWS shift 148 + ';' reduce 112 + '{' reduce 112 + + throws goto 280 + + +state 159 + fielddeclaration : type variabledeclarators . ';' (90) + variabledeclarators : variabledeclarators . ',' variabledeclarator (137) + + ',' shift 152 + ';' shift 281 + . error + + +state 160 + fielddeclaration : type fielddeclarator . ';' (87) + + ';' shift 282 + . error + + +state 161 + methodheader : modifiers VOID . methoddeclarator (120) + methodheader : modifiers VOID . methoddeclarator throws (122) + + IDENTIFIER shift 141 + . error + + methoddeclarator goto 283 + + +state 162 + methodheader : modifiers '<' . boundedMethodParameters '>' type methoddeclarator (114) + methodheader : modifiers '<' . boundedMethodParameters '>' type methoddeclarator throws (118) + methodheader : modifiers '<' . boundedMethodParameters '>' VOID methoddeclarator (124) + methodheader : modifiers '<' . boundedMethodParameters '>' VOID methoddeclarator throws (126) + + IDENTIFIER shift 78 + . error + + boundedMethodParameter goto 144 + boundedMethodParameters goto 284 + + +state 163 + methodheader : modifiers methoddeclarator . (129) + methodheader : modifiers methoddeclarator . throws (131) + + THROWS shift 148 + ';' reduce 129 + '{' reduce 129 + + throws goto 285 + + +state 164 + fielddeclaration : modifiers type . variabledeclarators ';' (91) + methodheader : modifiers type . methoddeclarator (113) + methodheader : modifiers type . methoddeclarator throws (117) + + IDENTIFIER shift 157 + . error + + methoddeclarator goto 286 + variabledeclarators goto 287 + variabledeclarator goto 205 + variabledeclaratorid goto 101 + + +state 165 + constructordeclaration : modifiers constructordeclarator . constructorbody (82) + + '{' shift 166 + . error + + constructorbody goto 288 + + +state 166 + constructorbody : '{' . '}' (97) + constructorbody : '{' . explicitconstructorinvocation '}' (98) + constructorbody : '{' . blockstatements '}' (99) + constructorbody : '{' . explicitconstructorinvocation blockstatements '}' (100) + + BOOLEAN shift 2 + CHAR shift 3 + FOR shift 185 + IF shift 186 + INT shift 6 + RETURN shift 187 + THIS shift 289 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 198 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '}' shift 290 + '(' shift 203 + . error + + variabledeclarators goto 204 + variabledeclarator goto 205 + variabledeclaratorid goto 101 + simplename goto 206 + qualifiedname goto 35 + name goto 207 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 208 + block goto 209 + blockstatements goto 291 + localvariabledeclarationstatement goto 211 + localvariabledeclaration goto 212 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + blockstatement goto 226 + statement goto 227 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + explicitconstructorinvocation goto 292 + + +state 167 + constructordeclaration : constructordeclarator constructorbody . (81) + + . reduce 81 + + +state 168 + classdeclaration : CLASS classidentifier super interfaces classbody . (26) + + . reduce 26 + + +state 169 + interfaces : interfaces ',' interfacetype . (51) + + . reduce 51 + + +state 170 + interfaceidentifier : IDENTIFIER '<' boundedClassParameters '>' . (29) + + . reduce 29 + + +state 171 + boundedMethodParameters : boundedMethodParameters . ',' boundedMethodParameter (110) + methodheader : '<' boundedMethodParameters . '>' type methoddeclarator (111) + methodheader : '<' boundedMethodParameters . '>' type methoddeclarator throws (116) + methodheader : '<' boundedMethodParameters . '>' VOID methoddeclarator (123) + methodheader : '<' boundedMethodParameters . '>' VOID methoddeclarator throws (125) + methodheader : '<' boundedMethodParameters . '>' methoddeclarator (128) + + ',' shift 243 + '>' shift 293 + . error + + +state 172 + interfacebody : '{' interfacememberdeclarations '}' . (53) + + . reduce 53 + + +state 173 + interfacememberdeclarations : interfacememberdeclarations interfacememberdeclaration . (66) + + . reduce 66 + + +state 174 + abstractmethoddeclaration : methodheader ';' . (84) + + . reduce 84 + + +state 175 + constantdeclaration : modifiers type . IDENTIFIER '=' expression ';' (83) + methodheader : modifiers type . methoddeclarator (113) + methodheader : modifiers type . methoddeclarator throws (117) + + IDENTIFIER shift 294 + . error + + methoddeclarator goto 286 + + +state 176 + extendsinterfaces : extendsinterfaces ',' interfacetype . (55) + + . reduce 55 + + +state 177 + typelist : typelist ',' type . (73) + + . reduce 73 + + +state 178 + classdeclaration : modifiers CLASS classidentifier super classbody . (23) + + . reduce 23 + + +state 179 + classdeclaration : modifiers CLASS classidentifier super interfaces . classbody (27) + interfaces : interfaces . ',' interfacetype (51) + + ',' shift 110 + '{' shift 57 + . error + + classbody goto 295 + + +state 180 + classdeclaration : modifiers CLASS classidentifier interfaces classbody . (25) + + . reduce 25 + + +state 181 + interfacedeclaration : modifiers INTERFACE interfaceidentifier extendsinterfaces interfacebody . (35) + + . reduce 35 + + +state 182 + boundedclassidentifierlist : referencetype . (107) + + . reduce 107 + + +state 183 + boundedMethodParameter : IDENTIFIER EXTENDS boundedclassidentifierlist . (106) + boundedclassidentifierlist : boundedclassidentifierlist . '&' referencetype (108) + + '&' shift 296 + ',' reduce 106 + '>' reduce 106 + + +state 184 + boundedClassParameters : boundedClassParameters ',' boundedClassParameter . (104) + + . reduce 104 + + +state 185 + forstatement : FOR . '(' expression ';' expression ';' expression ')' statement (181) + forstatement : FOR . '(' expression ';' expression ';' ')' statement (182) + forstatement : FOR . '(' expression ';' ';' expression ')' statement (183) + forstatement : FOR . '(' ';' expression ';' expression ')' statement (184) + forstatement : FOR . '(' expression ';' ';' ')' statement (185) + forstatement : FOR . '(' ';' expression ';' ')' statement (186) + forstatement : FOR . '(' ';' ';' expression ')' statement (187) + forstatement : FOR . '(' ';' ';' ')' statement (188) + + '(' shift 297 + . error + + +state 186 + ifthenstatement : IF . '(' expression ')' statement (178) + ifthenelsestatement : IF . '(' expression ')' statementnoshortif ELSE statement (179) + + '(' shift 298 + . error + + +state 187 + returnstatement : RETURN . ';' (193) + returnstatement : RETURN . expression ';' (194) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 299 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 300 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 + + +state 188 + primarynonewarray : THIS . (249) . reduce 249 -state 129 - literal : LONGLITERAL . (253) +state 189 + whilestatement : WHILE . '(' expression ')' statement (180) - . reduce 253 + '(' shift 301 + . error -state 130 - literal : DOUBLELITERAL . (255) +state 190 + literal : INTLITERAL . (257) - . reduce 255 + . reduce 257 -state 131 - literal : FLOATLITERAL . (254) +state 191 + literal : LONGLITERAL . (261) - . reduce 254 + . reduce 261 -state 132 - literal : BOOLLITERAL . (250) +state 192 + literal : DOUBLELITERAL . (263) - . reduce 250 + . reduce 263 -state 133 - literal : JNULL . (256) +state 193 + literal : FLOATLITERAL . (262) - . reduce 256 + . reduce 262 -state 134 - literal : CHARLITERAL . (251) +state 194 + literal : BOOLLITERAL . (258) + + . reduce 258 + + +state 195 + literal : JNULL . (264) + + . reduce 264 + + +state 196 + literal : CHARLITERAL . (259) + + . reduce 259 + + +state 197 + literal : STRINGLITERAL . (260) + + . reduce 260 + + +state 198 + simplename : IDENTIFIER . (19) + variabledeclaratorid : IDENTIFIER . (160) + + IDENTIFIER reduce 19 + INCREMENT reduce 19 + DECREMENT reduce 19 + PLUSEQUAL reduce 19 + MINUSEQUAL reduce 19 + TIMESEQUAL reduce 19 + DIVIDEEQUAL reduce 19 + MODULOEQUAL reduce 19 + ',' reduce 160 + ';' reduce 160 + '.' reduce 19 + '<' reduce 19 + '=' reduce 19 + '(' reduce 19 + ')' reduce 160 + '[' reduce 19 + + +state 199 + preincrementexpression : INCREMENT . unaryexpression (224) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 303 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 + + +state 200 + predecrementexpression : DECREMENT . unaryexpression (225) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 304 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 + + +state 201 + emptystatement : ';' . (191) + + . reduce 191 + + +state 202 + block : '{' '}' . (93) + + . reduce 93 + + +state 203 + lambdaexpressionparameter : '(' . ')' (214) + lambdaexpressionparameter : '(' . formalparameterlist ')' (215) + + BOOLEAN shift 2 + CHAR shift 3 + INT shift 6 + IDENTIFIER shift 198 + ')' shift 305 + . error + + variabledeclaratorid goto 239 + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 240 + formalparameter goto 241 + formalparameterlist goto 306 + + +state 204 + variabledeclarators : variabledeclarators . ',' variabledeclarator (137) + localvariabledeclaration : variabledeclarators . (173) + + ',' shift 152 + ';' reduce 173 + + +state 205 + variabledeclarators : variabledeclarator . (136) + + . reduce 136 + + +state 206 + name : simplename . (13) + classorinterfacetype : simplename . parameter (71) + parameter : . (74) + + '<' shift 41 + IDENTIFIER reduce 74 + INCREMENT reduce 13 + DECREMENT reduce 13 + PLUSEQUAL reduce 13 + MINUSEQUAL reduce 13 + TIMESEQUAL reduce 13 + DIVIDEEQUAL reduce 13 + MODULOEQUAL reduce 13 + '.' reduce 13 + '=' reduce 13 + '(' reduce 13 + '[' reduce 74 + + parameter goto 42 + + +207: shift/reduce conflict (shift 62, reduce 242) on '.' +state 207 + qualifiedname : name . '.' IDENTIFIER (16) + lefthandside : name . (217) + methodinvocation : name . '(' ')' (228) + methodinvocation : name . '(' argumentlist ')' (229) + postfixexpression : name . (242) + + '.' shift 62 + '(' shift 307 + INSTANCEOF reduce 242 + EQUAL reduce 242 + LESSEQUAL reduce 242 + GREATEREQUAL reduce 242 + NOTEQUAL reduce 242 + LOGICALOR reduce 242 + LOGICALAND reduce 242 + INCREMENT reduce 242 + DECREMENT reduce 242 + PLUSEQUAL reduce 217 + MINUSEQUAL reduce 217 + TIMESEQUAL reduce 217 + DIVIDEEQUAL reduce 217 + MODULOEQUAL reduce 217 + ',' reduce 242 + ';' reduce 242 + '*' reduce 242 + '<' reduce 242 + '>' reduce 242 + '=' reduce 217 + ')' reduce 242 + '&' reduce 242 + '+' reduce 242 + '-' reduce 242 + '|' reduce 242 + '^' reduce 242 + '/' reduce 242 + '%' reduce 242 + + +state 208 + localvariabledeclaration : type . variabledeclarators (172) + + IDENTIFIER shift 247 + . error + + variabledeclarators goto 308 + variabledeclarator goto 205 + variabledeclaratorid goto 101 + + +state 209 + statementwithouttrailingsubstatement : block . (174) + + . reduce 174 + + +state 210 + block : '{' blockstatements . '}' (94) + blockstatements : blockstatements . blockstatement (140) + + BOOLEAN shift 2 + CHAR shift 3 + FOR shift 185 + IF shift 186 + INT shift 6 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 198 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '}' shift 309 + '(' shift 203 + . error + + variabledeclarators goto 204 + variabledeclarator goto 205 + variabledeclaratorid goto 101 + simplename goto 206 + qualifiedname goto 35 + name goto 207 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 208 + block goto 209 + localvariabledeclarationstatement goto 211 + localvariabledeclaration goto 212 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + blockstatement goto 310 + statement goto 227 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 211 + blockstatement : localvariabledeclarationstatement . (153) + + . reduce 153 + + +state 212 + localvariabledeclarationstatement : localvariabledeclaration . ';' (162) + + ';' shift 311 + . error + + +state 213 + lambdaexpression : lambdaexpressionparameter . lambdaassignmentoperator lambdabody (216) + + LAMBDAASSIGNMENT shift 312 + . error + + lambdaassignmentoperator goto 313 + + +state 214 + primarynonewarray : literal . (248) + + . reduce 248 + + +state 215 + primary : primarynonewarray . (245) + + . reduce 245 + + +216: shift/reduce conflict (shift 314, reduce 241) on '.' +state 216 + methodinvocation : primary . '.' IDENTIFIER '(' ')' (230) + methodinvocation : primary . '.' IDENTIFIER '(' argumentlist ')' (231) + postfixexpression : primary . (241) + + '.' shift 314 + INSTANCEOF reduce 241 + EQUAL reduce 241 + LESSEQUAL reduce 241 + GREATEREQUAL reduce 241 + NOTEQUAL reduce 241 + LOGICALOR reduce 241 + LOGICALAND reduce 241 + INCREMENT reduce 241 + DECREMENT reduce 241 + ',' reduce 241 + ';' reduce 241 + '*' reduce 241 + '<' reduce 241 + '>' reduce 241 + ')' reduce 241 + '&' reduce 241 + '+' reduce 241 + '-' reduce 241 + '|' reduce 241 + '^' reduce 241 + '/' reduce 241 + '%' reduce 241 + + +state 217 + postincrementexpression : postfixexpression . INCREMENT (226) + postdecrementexpression : postfixexpression . DECREMENT (227) + + INCREMENT shift 315 + DECREMENT shift 316 + . error + + +state 218 + primarynonewarray : lambdaexpression . (251) . reduce 251 -state 135 - literal : STRINGLITERAL . (252) +state 219 + expressionstatement : statementexpression . ';' (192) - . reduce 252 - - -state 136 - simplename : IDENTIFIER . (14) - variabledeclaratorid : IDENTIFIER . (152) - - IDENTIFIER reduce 14 - INCREMENT reduce 14 - DECREMENT reduce 14 - PLUSEQUAL reduce 14 - MINUSEQUAL reduce 14 - TIMESEQUAL reduce 14 - DIVIDEEQUAL reduce 14 - MODULOEQUAL reduce 14 - ',' reduce 152 - ';' reduce 152 - '.' reduce 14 - '<' reduce 14 - '=' reduce 14 - '(' reduce 14 - ')' reduce 152 - '[' reduce 14 - - -state 137 - preincrementexpression : INCREMENT . unaryexpression (216) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 + ';' shift 317 . error - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 247 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 + +state 220 + statementexpression : preincrementexpression . (202) + + . reduce 202 -state 138 - predecrementexpression : DECREMENT . unaryexpression (217) +state 221 + statementexpression : predecrementexpression . (203) - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 + . reduce 203 + + +state 222 + statementexpression : postincrementexpression . (204) + postfixexpression : postincrementexpression . (243) + + INCREMENT reduce 243 + DECREMENT reduce 243 + ';' reduce 204 + + +state 223 + statementexpression : postdecrementexpression . (205) + postfixexpression : postdecrementexpression . (244) + + INCREMENT reduce 244 + DECREMENT reduce 244 + ';' reduce 205 + + +state 224 + statementwithouttrailingsubstatement : expressionstatement . (176) + + . reduce 176 + + +state 225 + statement : statementwithouttrailingsubstatement . (163) + + . reduce 163 + + +state 226 + blockstatements : blockstatement . (139) + + . reduce 139 + + +state 227 + blockstatement : statement . (154) + + . reduce 154 + + +state 228 + statement : whilestatement . (166) + + . reduce 166 + + +state 229 + statement : forstatement . (167) + + . reduce 167 + + +state 230 + statement : ifthenstatement . (164) + + . reduce 164 + + +state 231 + statement : ifthenelsestatement . (165) + + . reduce 165 + + +state 232 + statementwithouttrailingsubstatement : emptystatement . (175) + + . reduce 175 + + +state 233 + statementwithouttrailingsubstatement : returnstatement . (177) + + . reduce 177 + + +state 234 + statementexpression : assignment . (201) + + . reduce 201 + + +state 235 + assignment : lefthandside . assignmentoperator assignmentexpression (199) + assignment : lefthandside . assignmentoperator classinstancecreationexpression (200) + + PLUSEQUAL shift 318 + MINUSEQUAL shift 319 + TIMESEQUAL shift 320 + DIVIDEEQUAL shift 321 + MODULOEQUAL shift 322 + '=' shift 323 . error - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 248 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 + assignmentoperator goto 324 -state 139 - emptystatement : ';' . (183) +state 236 + statementexpression : methodinvocation . (206) + primarynonewarray : methodinvocation . (250) - . reduce 183 + INCREMENT reduce 250 + DECREMENT reduce 250 + ';' reduce 206 + '.' reduce 250 -state 140 - block : '{' '}' . (85) +state 237 + methodheader : VOID methoddeclarator throws . (121) - . reduce 85 + . reduce 121 -state 141 - lambdaexpressionparameter : '(' . ')' (206) - lambdaexpressionparameter : '(' . formalparameterlist ')' (207) +state 238 + methoddeclarator : IDENTIFIER '(' ')' . (147) - BOOLEAN shift 37 - CHAR shift 38 - INT shift 39 - IDENTIFIER shift 136 - ')' shift 249 + . reduce 147 + + +state 239 + formalparameter : variabledeclaratorid . (156) + + . reduce 156 + + +state 240 + formalparameter : type . variabledeclaratorid (155) + + IDENTIFIER shift 247 . error - variabledeclaratorid goto 178 - simplename goto 32 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 179 - formalparameter goto 180 - formalparameterlist goto 250 + variabledeclaratorid goto 325 -state 142 - variabledeclarators : variabledeclarators . ',' variabledeclarator (129) - localvariabledeclaration : variabledeclarators . (165) +state 241 + formalparameterlist : formalparameter . (141) - ',' shift 92 - ';' reduce 165 + . reduce 141 -state 143 - variabledeclarators : variabledeclarator . (128) +state 242 + formalparameterlist : formalparameterlist . ',' formalparameter (142) + methoddeclarator : IDENTIFIER '(' formalparameterlist . ')' (148) - . reduce 128 + ',' shift 326 + ')' shift 327 + . error -state 144 - name : simplename . (9) - classorinterfacetype : simplename . parameter (66) - parameter : . (67) +state 243 + boundedMethodParameters : boundedMethodParameters ',' . boundedMethodParameter (110) - '<' shift 77 - IDENTIFIER reduce 67 - INCREMENT reduce 9 - DECREMENT reduce 9 - PLUSEQUAL reduce 9 - MINUSEQUAL reduce 9 - TIMESEQUAL reduce 9 - DIVIDEEQUAL reduce 9 - MODULOEQUAL reduce 9 - '.' reduce 9 - '=' reduce 9 - '(' reduce 9 - '[' reduce 67 + IDENTIFIER shift 78 + . error - parameter goto 78 + boundedMethodParameter goto 328 -state 145 - name : qualifiedname . (8) +state 244 + fielddeclaration : '<' boundedMethodParameters '>' . type fielddeclarator ';' (88) + methodheader : '<' boundedMethodParameters '>' . type methoddeclarator (111) + methodheader : '<' boundedMethodParameters '>' . type methoddeclarator throws (116) + methodheader : '<' boundedMethodParameters '>' . VOID methoddeclarator (123) + methodheader : '<' boundedMethodParameters '>' . VOID methoddeclarator throws (125) + methodheader : '<' boundedMethodParameters '>' . methoddeclarator (128) - . reduce 8 + BOOLEAN shift 2 + CHAR shift 3 + INT shift 6 + VOID shift 329 + IDENTIFIER shift 117 + . error + + methoddeclarator goto 330 + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 331 -146: shift/reduce conflict (shift 251, reduce 234) on '.' -state 146 - qualifiedname : name . '.' IDENTIFIER (11) - lefthandside : name . (209) - methodinvocation : name . '(' ')' (220) - methodinvocation : name . '(' argumentlist ')' (221) - postfixexpression : name . (234) +state 245 + classtypelist : classtype . (145) - '.' shift 251 - '(' shift 252 - ABSTRACT reduce 234 - BOOLEAN reduce 234 - CHAR reduce 234 - FINAL reduce 234 + . reduce 145 + + +state 246 + throws : THROWS classtypelist . (101) + classtypelist : classtypelist . ',' classtype (146) + + ',' shift 332 + ';' reduce 101 + '{' reduce 101 + + +state 247 + variabledeclaratorid : IDENTIFIER . (160) + + . reduce 160 + + +state 248 + variabledeclarators : variabledeclarators ',' variabledeclarator . (137) + + . reduce 137 + + +state 249 + classinstancecreationexpression : NEW . classtype '(' ')' (232) + classinstancecreationexpression : NEW . classtype '(' argumentlist ')' (233) + + IDENTIFIER shift 14 + . error + + simplename goto 18 + classtype goto 333 + classorinterfacetype goto 83 + + +state 250 + lambdaexpressionparameter : '(' . ')' (214) + lambdaexpressionparameter : '(' . formalparameterlist ')' (215) + castexpression : '(' . primitivetype ')' unaryexpression (265) + + BOOLEAN shift 2 + CHAR shift 3 + INT shift 6 + IDENTIFIER shift 198 + ')' shift 305 + . error + + variabledeclaratorid goto 239 + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 334 + referencetype goto 25 + type goto 240 + formalparameter goto 241 + formalparameterlist goto 306 + + +state 251 + unaryexpression : '+' . unaryexpression (238) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 335 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 + + +state 252 + unaryexpression : '-' . unaryexpression (239) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 336 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 + + +state 253 + unaryexpressionnotplusminus : '!' . unaryexpression (253) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 337 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 + + +254: shift/reduce conflict (shift 315, reduce 252) on INCREMENT +254: shift/reduce conflict (shift 316, reduce 252) on DECREMENT +state 254 + postincrementexpression : postfixexpression . INCREMENT (226) + postdecrementexpression : postfixexpression . DECREMENT (227) + unaryexpressionnotplusminus : postfixexpression . (252) + + INCREMENT shift 315 + DECREMENT shift 316 + INSTANCEOF reduce 252 + EQUAL reduce 252 + LESSEQUAL reduce 252 + GREATEREQUAL reduce 252 + NOTEQUAL reduce 252 + LOGICALOR reduce 252 + LOGICALAND reduce 252 + ',' reduce 252 + ';' reduce 252 + '.' reduce 252 + '*' reduce 252 + '<' reduce 252 + '>' reduce 252 + ')' reduce 252 + '&' reduce 252 + '+' reduce 252 + '-' reduce 252 + '|' reduce 252 + '^' reduce 252 + '/' reduce 252 + '%' reduce 252 + + +state 255 + unaryexpression : unaryexpressionnotplusminus . (240) + + . reduce 240 + + +state 256 + multiplicativeexpression : unaryexpression . (281) + + . reduce 281 + + +257: shift/reduce conflict (shift 338, reduce 278) on '*' +257: shift/reduce conflict (shift 339, reduce 278) on '/' +257: shift/reduce conflict (shift 340, reduce 278) on '%' +state 257 + additiveexpression : multiplicativeexpression . (278) + multiplicativeexpression : multiplicativeexpression . '*' unaryexpression (282) + multiplicativeexpression : multiplicativeexpression . '/' unaryexpression (283) + multiplicativeexpression : multiplicativeexpression . '%' unaryexpression (284) + + '*' shift 338 + '/' shift 339 + '%' shift 340 + INSTANCEOF reduce 278 + EQUAL reduce 278 + LESSEQUAL reduce 278 + GREATEREQUAL reduce 278 + NOTEQUAL reduce 278 + LOGICALOR reduce 278 + LOGICALAND reduce 278 + INCREMENT reduce 278 + DECREMENT reduce 278 + ',' reduce 278 + ';' reduce 278 + '.' reduce 278 + '<' reduce 278 + '>' reduce 278 + ')' reduce 278 + '&' reduce 278 + '+' reduce 278 + '-' reduce 278 + '|' reduce 278 + '^' reduce 278 + + +258: shift/reduce conflict (shift 341, reduce 277) on '+' +258: shift/reduce conflict (shift 342, reduce 277) on '-' +state 258 + shiftexpression : additiveexpression . (277) + additiveexpression : additiveexpression . '+' multiplicativeexpression (279) + additiveexpression : additiveexpression . '-' multiplicativeexpression (280) + + '+' shift 341 + '-' shift 342 + INSTANCEOF reduce 277 + EQUAL reduce 277 + LESSEQUAL reduce 277 + GREATEREQUAL reduce 277 + NOTEQUAL reduce 277 + LOGICALOR reduce 277 + LOGICALAND reduce 277 + INCREMENT reduce 277 + DECREMENT reduce 277 + ',' reduce 277 + ';' reduce 277 + '.' reduce 277 + '*' reduce 277 + '<' reduce 277 + '>' reduce 277 + ')' reduce 277 + '&' reduce 277 + '|' reduce 277 + '^' reduce 277 + '/' reduce 277 + '%' reduce 277 + + +state 259 + relationalexpression : shiftexpression . (271) + + . reduce 271 + + +260: shift/reduce conflict (shift 343, reduce 268) on INSTANCEOF +260: shift/reduce conflict (shift 344, reduce 268) on LESSEQUAL +260: shift/reduce conflict (shift 345, reduce 268) on GREATEREQUAL +260: shift/reduce conflict (shift 346, reduce 268) on '<' +260: shift/reduce conflict (shift 347, reduce 268) on '>' +state 260 + equalityexpression : relationalexpression . (268) + relationalexpression : relationalexpression . '<' shiftexpression (272) + relationalexpression : relationalexpression . '>' shiftexpression (273) + relationalexpression : relationalexpression . LESSEQUAL shiftexpression (274) + relationalexpression : relationalexpression . GREATEREQUAL shiftexpression (275) + relationalexpression : relationalexpression . INSTANCEOF referencetype (276) + + INSTANCEOF shift 343 + LESSEQUAL shift 344 + GREATEREQUAL shift 345 + '<' shift 346 + '>' shift 347 + EQUAL reduce 268 + NOTEQUAL reduce 268 + LOGICALOR reduce 268 + LOGICALAND reduce 268 + INCREMENT reduce 268 + DECREMENT reduce 268 + ',' reduce 268 + ';' reduce 268 + '.' reduce 268 + '*' reduce 268 + ')' reduce 268 + '&' reduce 268 + '+' reduce 268 + '-' reduce 268 + '|' reduce 268 + '^' reduce 268 + '/' reduce 268 + '%' reduce 268 + + +261: shift/reduce conflict (shift 348, reduce 266) on EQUAL +261: shift/reduce conflict (shift 349, reduce 266) on NOTEQUAL +state 261 + andexpression : equalityexpression . (266) + equalityexpression : equalityexpression . EQUAL relationalexpression (269) + equalityexpression : equalityexpression . NOTEQUAL relationalexpression (270) + + EQUAL shift 348 + NOTEQUAL shift 349 + INSTANCEOF reduce 266 + LESSEQUAL reduce 266 + GREATEREQUAL reduce 266 + LOGICALOR reduce 266 + LOGICALAND reduce 266 + INCREMENT reduce 266 + DECREMENT reduce 266 + ',' reduce 266 + ';' reduce 266 + '.' reduce 266 + '*' reduce 266 + '<' reduce 266 + '>' reduce 266 + ')' reduce 266 + '&' reduce 266 + '+' reduce 266 + '-' reduce 266 + '|' reduce 266 + '^' reduce 266 + '/' reduce 266 + '%' reduce 266 + + +262: shift/reduce conflict (shift 350, reduce 255) on '&' +state 262 + exclusiveorexpression : andexpression . (255) + andexpression : andexpression . '&' equalityexpression (267) + + '&' shift 350 + INSTANCEOF reduce 255 + EQUAL reduce 255 + LESSEQUAL reduce 255 + GREATEREQUAL reduce 255 + NOTEQUAL reduce 255 + LOGICALOR reduce 255 + LOGICALAND reduce 255 + INCREMENT reduce 255 + DECREMENT reduce 255 + ',' reduce 255 + ';' reduce 255 + '.' reduce 255 + '*' reduce 255 + '<' reduce 255 + '>' reduce 255 + ')' reduce 255 + '+' reduce 255 + '-' reduce 255 + '|' reduce 255 + '^' reduce 255 + '/' reduce 255 + '%' reduce 255 + + +263: shift/reduce conflict (shift 351, reduce 246) on '^' +state 263 + inclusiveorexpression : exclusiveorexpression . (246) + exclusiveorexpression : exclusiveorexpression . '^' andexpression (256) + + '^' shift 351 + INSTANCEOF reduce 246 + EQUAL reduce 246 + LESSEQUAL reduce 246 + GREATEREQUAL reduce 246 + NOTEQUAL reduce 246 + LOGICALOR reduce 246 + LOGICALAND reduce 246 + INCREMENT reduce 246 + DECREMENT reduce 246 + ',' reduce 246 + ';' reduce 246 + '.' reduce 246 + '*' reduce 246 + '<' reduce 246 + '>' reduce 246 + ')' reduce 246 + '&' reduce 246 + '+' reduce 246 + '-' reduce 246 + '|' reduce 246 + '/' reduce 246 + '%' reduce 246 + + +264: shift/reduce conflict (shift 352, reduce 234) on '|' +state 264 + conditionalandexpression : inclusiveorexpression . (234) + inclusiveorexpression : inclusiveorexpression . '|' exclusiveorexpression (247) + + '|' shift 352 INSTANCEOF reduce 234 - INT reduce 234 - PRIVATE reduce 234 - PROTECTED reduce 234 - PUBLIC reduce 234 - STATIC reduce 234 - VOID reduce 234 - IDENTIFIER reduce 234 EQUAL reduce 234 LESSEQUAL reduce 234 GREATEREQUAL reduce 234 @@ -2161,724 +3770,2492 @@ state 146 LOGICALAND reduce 234 INCREMENT reduce 234 DECREMENT reduce 234 - PLUSEQUAL reduce 209 - MINUSEQUAL reduce 209 - TIMESEQUAL reduce 209 - DIVIDEEQUAL reduce 209 - MODULOEQUAL reduce 209 ',' reduce 234 ';' reduce 234 + '.' reduce 234 '*' reduce 234 '<' reduce 234 '>' reduce 234 - '}' reduce 234 - '=' reduce 209 ')' reduce 234 '&' reduce 234 '+' reduce 234 '-' reduce 234 - '|' reduce 234 '^' reduce 234 '/' reduce 234 '%' reduce 234 -state 147 - localvariabledeclaration : type . variabledeclarators (164) +265: shift/reduce conflict (shift 353, reduce 209) on LOGICALAND +state 265 + conditionalorexpression : conditionalandexpression . (209) + conditionalandexpression : conditionalandexpression . LOGICALAND inclusiveorexpression (235) - IDENTIFIER shift 186 - . error - - variabledeclarators goto 253 - variabledeclarator goto 143 - variabledeclaratorid goto 55 + LOGICALAND shift 353 + INSTANCEOF reduce 209 + EQUAL reduce 209 + LESSEQUAL reduce 209 + GREATEREQUAL reduce 209 + NOTEQUAL reduce 209 + LOGICALOR reduce 209 + INCREMENT reduce 209 + DECREMENT reduce 209 + ',' reduce 209 + ';' reduce 209 + '.' reduce 209 + '*' reduce 209 + '<' reduce 209 + '>' reduce 209 + ')' reduce 209 + '&' reduce 209 + '+' reduce 209 + '-' reduce 209 + '|' reduce 209 + '^' reduce 209 + '/' reduce 209 + '%' reduce 209 -state 148 - statementwithouttrailingsubstatement : block . (166) +266: shift/reduce conflict (shift 354, reduce 198) on LOGICALOR +state 266 + conditionalexpression : conditionalorexpression . (198) + conditionalorexpression : conditionalorexpression . LOGICALOR conditionalandexpression (210) - . reduce 166 + LOGICALOR shift 354 + INSTANCEOF reduce 198 + EQUAL reduce 198 + LESSEQUAL reduce 198 + GREATEREQUAL reduce 198 + NOTEQUAL reduce 198 + LOGICALAND reduce 198 + INCREMENT reduce 198 + DECREMENT reduce 198 + ',' reduce 198 + ';' reduce 198 + '.' reduce 198 + '*' reduce 198 + '<' reduce 198 + '>' reduce 198 + ')' reduce 198 + '&' reduce 198 + '+' reduce 198 + '-' reduce 198 + '|' reduce 198 + '^' reduce 198 + '/' reduce 198 + '%' reduce 198 -state 149 - block : '{' blockstatements . '}' (86) - blockstatements : blockstatements . blockstatement (132) +state 267 + assignmentexpression : conditionalexpression . (189) - BOOLEAN shift 37 - CHAR shift 38 - FOR shift 123 - IF shift 124 - INT shift 39 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 136 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '}' shift 254 - '(' shift 141 - . error - - variabledeclarators goto 142 - variabledeclarator goto 143 - variabledeclaratorid goto 55 - simplename goto 144 - qualifiedname goto 145 - name goto 146 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 147 - block goto 148 - localvariabledeclarationstatement goto 150 - localvariabledeclaration goto 151 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - blockstatement goto 255 - statement goto 166 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 + . reduce 189 -state 150 - blockstatement : localvariabledeclarationstatement . (145) - - . reduce 145 - - -state 151 - localvariabledeclarationstatement : localvariabledeclaration . ';' (154) - - ';' shift 256 - . error - - -state 152 - lambdaexpression : lambdaexpressionparameter . lambdaassignmentoperator lambdabody (208) - - LAMBDAASSIGNMENT shift 257 - . error - - lambdaassignmentoperator goto 258 - - -state 153 - primarynonewarray : literal . (240) - - . reduce 240 - - -state 154 - primary : primarynonewarray . (237) - - . reduce 237 - - -155: shift/reduce conflict (shift 259, reduce 233) on '.' -state 155 - methodinvocation : primary . '.' IDENTIFIER '(' ')' (222) - methodinvocation : primary . '.' IDENTIFIER '(' argumentlist ')' (223) - postfixexpression : primary . (233) - - '.' shift 259 - ABSTRACT reduce 233 - BOOLEAN reduce 233 - CHAR reduce 233 - FINAL reduce 233 - INSTANCEOF reduce 233 - INT reduce 233 - PRIVATE reduce 233 - PROTECTED reduce 233 - PUBLIC reduce 233 - STATIC reduce 233 - VOID reduce 233 - IDENTIFIER reduce 233 - EQUAL reduce 233 - LESSEQUAL reduce 233 - GREATEREQUAL reduce 233 - NOTEQUAL reduce 233 - LOGICALOR reduce 233 - LOGICALAND reduce 233 - INCREMENT reduce 233 - DECREMENT reduce 233 - ',' reduce 233 - ';' reduce 233 - '*' reduce 233 - '<' reduce 233 - '>' reduce 233 - '}' reduce 233 - ')' reduce 233 - '&' reduce 233 - '+' reduce 233 - '-' reduce 233 - '|' reduce 233 - '^' reduce 233 - '/' reduce 233 - '%' reduce 233 - - -state 156 - postincrementexpression : postfixexpression . INCREMENT (218) - postdecrementexpression : postfixexpression . DECREMENT (219) - - INCREMENT shift 260 - DECREMENT shift 261 - . error - - -state 157 - primarynonewarray : lambdaexpression . (243) - - . reduce 243 - - -state 158 - expressionstatement : statementexpression . ';' (184) - - ';' shift 262 - . error - - -state 159 - statementexpression : preincrementexpression . (194) - - . reduce 194 - - -state 160 - statementexpression : predecrementexpression . (195) - - . reduce 195 - - -state 161 - statementexpression : postincrementexpression . (196) - postfixexpression : postincrementexpression . (235) - - INCREMENT reduce 235 - DECREMENT reduce 235 - ';' reduce 196 - - -state 162 - statementexpression : postdecrementexpression . (197) - postfixexpression : postdecrementexpression . (236) - - INCREMENT reduce 236 - DECREMENT reduce 236 - ';' reduce 197 - - -state 163 - statementwithouttrailingsubstatement : expressionstatement . (168) +state 268 + expression : assignmentexpression . (168) . reduce 168 -state 164 - statement : statementwithouttrailingsubstatement . (155) +state 269 + fielddeclarator : variabledeclarator '=' expression . (85) - . reduce 155 + . reduce 85 -state 165 - blockstatements : blockstatement . (131) +state 270 + unaryexpression : preincrementexpression . (236) - . reduce 131 + . reduce 236 -state 166 - blockstatement : statement . (146) +state 271 + unaryexpression : predecrementexpression . (237) - . reduce 146 + . reduce 237 -state 167 - statement : whilestatement . (158) +state 272 + postfixexpression : postincrementexpression . (243) - . reduce 158 + . reduce 243 -state 168 - statement : forstatement . (159) +state 273 + postfixexpression : postdecrementexpression . (244) - . reduce 159 + . reduce 244 -state 169 - statement : ifthenstatement . (156) - - . reduce 156 - - -state 170 - statement : ifthenelsestatement . (157) - - . reduce 157 - - -state 171 - statementwithouttrailingsubstatement : emptystatement . (167) - - . reduce 167 - - -state 172 - statementwithouttrailingsubstatement : returnstatement . (169) +state 274 + expression : classinstancecreationexpression . (169) . reduce 169 -state 173 - statementexpression : assignment . (193) +state 275 + assignmentexpression : assignment . (190) + + . reduce 190 + + +state 276 + primarynonewarray : methodinvocation . (250) + + . reduce 250 + + +state 277 + unaryexpressionnotplusminus : castexpression . (254) + + . reduce 254 + + +state 278 + constructordeclarator : simplename '(' ')' . (95) + + . reduce 95 + + +state 279 + constructordeclarator : simplename '(' formalparameterlist . ')' (96) + formalparameterlist : formalparameterlist . ',' formalparameter (142) + + ',' shift 326 + ')' shift 355 + . error + + +state 280 + methodheader : type methoddeclarator throws . (115) + + . reduce 115 + + +state 281 + fielddeclaration : type variabledeclarators ';' . (90) + + . reduce 90 + + +state 282 + fielddeclaration : type fielddeclarator ';' . (87) + + . reduce 87 + + +state 283 + methodheader : modifiers VOID methoddeclarator . (120) + methodheader : modifiers VOID methoddeclarator . throws (122) + + THROWS shift 148 + ';' reduce 120 + '{' reduce 120 + + throws goto 356 + + +state 284 + boundedMethodParameters : boundedMethodParameters . ',' boundedMethodParameter (110) + methodheader : modifiers '<' boundedMethodParameters . '>' type methoddeclarator (114) + methodheader : modifiers '<' boundedMethodParameters . '>' type methoddeclarator throws (118) + methodheader : modifiers '<' boundedMethodParameters . '>' VOID methoddeclarator (124) + methodheader : modifiers '<' boundedMethodParameters . '>' VOID methoddeclarator throws (126) + + ',' shift 243 + '>' shift 357 + . error + + +state 285 + methodheader : modifiers methoddeclarator throws . (131) + + . reduce 131 + + +state 286 + methodheader : modifiers type methoddeclarator . (113) + methodheader : modifiers type methoddeclarator . throws (117) + + THROWS shift 148 + ';' reduce 113 + '{' reduce 113 + + throws goto 358 + + +state 287 + fielddeclaration : modifiers type variabledeclarators . ';' (91) + variabledeclarators : variabledeclarators . ',' variabledeclarator (137) + + ',' shift 152 + ';' shift 359 + . error + + +state 288 + constructordeclaration : modifiers constructordeclarator constructorbody . (82) + + . reduce 82 + + +state 289 + explicitconstructorinvocation : THIS . '(' ')' ';' (143) + explicitconstructorinvocation : THIS . '(' argumentlist ')' ';' (144) + primarynonewarray : THIS . (249) + + '(' shift 360 + INCREMENT reduce 249 + DECREMENT reduce 249 + '.' reduce 249 + + +state 290 + constructorbody : '{' '}' . (97) + + . reduce 97 + + +state 291 + constructorbody : '{' blockstatements . '}' (99) + blockstatements : blockstatements . blockstatement (140) + + BOOLEAN shift 2 + CHAR shift 3 + FOR shift 185 + IF shift 186 + INT shift 6 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 198 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '}' shift 361 + '(' shift 203 + . error + + variabledeclarators goto 204 + variabledeclarator goto 205 + variabledeclaratorid goto 101 + simplename goto 206 + qualifiedname goto 35 + name goto 207 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 208 + block goto 209 + localvariabledeclarationstatement goto 211 + localvariabledeclaration goto 212 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + blockstatement goto 310 + statement goto 227 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 292 + constructorbody : '{' explicitconstructorinvocation . '}' (98) + constructorbody : '{' explicitconstructorinvocation . blockstatements '}' (100) + + BOOLEAN shift 2 + CHAR shift 3 + FOR shift 185 + IF shift 186 + INT shift 6 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 198 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '}' shift 362 + '(' shift 203 + . error + + variabledeclarators goto 204 + variabledeclarator goto 205 + variabledeclaratorid goto 101 + simplename goto 206 + qualifiedname goto 35 + name goto 207 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 208 + block goto 209 + blockstatements goto 363 + localvariabledeclarationstatement goto 211 + localvariabledeclaration goto 212 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + blockstatement goto 226 + statement goto 227 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 293 + methodheader : '<' boundedMethodParameters '>' . type methoddeclarator (111) + methodheader : '<' boundedMethodParameters '>' . type methoddeclarator throws (116) + methodheader : '<' boundedMethodParameters '>' . VOID methoddeclarator (123) + methodheader : '<' boundedMethodParameters '>' . VOID methoddeclarator throws (125) + methodheader : '<' boundedMethodParameters '>' . methoddeclarator (128) + + BOOLEAN shift 2 + CHAR shift 3 + INT shift 6 + VOID shift 329 + IDENTIFIER shift 117 + . error + + methoddeclarator goto 330 + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 364 + + +state 294 + constantdeclaration : modifiers type IDENTIFIER . '=' expression ';' (83) + methoddeclarator : IDENTIFIER . '(' ')' (147) + methoddeclarator : IDENTIFIER . '(' formalparameterlist ')' (148) + + '=' shift 365 + '(' shift 143 + . error + + +state 295 + classdeclaration : modifiers CLASS classidentifier super interfaces classbody . (27) + + . reduce 27 + + +state 296 + boundedclassidentifierlist : boundedclassidentifierlist '&' . referencetype (108) + + IDENTIFIER shift 14 + . error + + simplename goto 18 + classorinterfacetype goto 21 + referencetype goto 366 + + +state 297 + forstatement : FOR '(' . expression ';' expression ';' expression ')' statement (181) + forstatement : FOR '(' . expression ';' expression ';' ')' statement (182) + forstatement : FOR '(' . expression ';' ';' expression ')' statement (183) + forstatement : FOR '(' . ';' expression ';' expression ')' statement (184) + forstatement : FOR '(' . expression ';' ';' ')' statement (185) + forstatement : FOR '(' . ';' expression ';' ')' statement (186) + forstatement : FOR '(' . ';' ';' expression ')' statement (187) + forstatement : FOR '(' . ';' ';' ')' statement (188) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 367 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 368 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 + + +state 298 + ifthenstatement : IF '(' . expression ')' statement (178) + ifthenelsestatement : IF '(' . expression ')' statementnoshortif ELSE statement (179) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 369 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 + + +state 299 + returnstatement : RETURN ';' . (193) . reduce 193 -state 174 - assignment : lefthandside . assignmentoperator assignmentexpression (191) - assignment : lefthandside . assignmentoperator classinstancecreationexpression (192) +state 300 + returnstatement : RETURN expression . ';' (194) - PLUSEQUAL shift 263 - MINUSEQUAL shift 264 - TIMESEQUAL shift 265 - DIVIDEEQUAL shift 266 - MODULOEQUAL shift 267 - '=' shift 268 + ';' shift 370 . error - assignmentoperator goto 269 + +state 301 + whilestatement : WHILE '(' . expression ')' statement (180) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 371 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 -state 175 - statementexpression : methodinvocation . (198) - primarynonewarray : methodinvocation . (242) +302: shift/reduce conflict (shift 62, reduce 242) on '.' +state 302 + qualifiedname : name . '.' IDENTIFIER (16) + methodinvocation : name . '(' ')' (228) + methodinvocation : name . '(' argumentlist ')' (229) + postfixexpression : name . (242) + '.' shift 62 + '(' shift 307 + INSTANCEOF reduce 242 + EQUAL reduce 242 + LESSEQUAL reduce 242 + GREATEREQUAL reduce 242 + NOTEQUAL reduce 242 + LOGICALOR reduce 242 + LOGICALAND reduce 242 INCREMENT reduce 242 DECREMENT reduce 242 - ';' reduce 198 - '.' reduce 242 + ',' reduce 242 + ';' reduce 242 + '*' reduce 242 + '<' reduce 242 + '>' reduce 242 + ')' reduce 242 + '&' reduce 242 + '+' reduce 242 + '-' reduce 242 + '|' reduce 242 + '^' reduce 242 + '/' reduce 242 + '%' reduce 242 -state 176 - methodheader : VOID methoddeclarator throws . (113) +state 303 + preincrementexpression : INCREMENT unaryexpression . (224) - . reduce 113 + . reduce 224 -state 177 - methoddeclarator : IDENTIFIER '(' ')' . (139) +state 304 + predecrementexpression : DECREMENT unaryexpression . (225) - . reduce 139 + . reduce 225 -state 178 - formalparameter : variabledeclaratorid . (148) +state 305 + lambdaexpressionparameter : '(' ')' . (214) + + . reduce 214 + + +state 306 + formalparameterlist : formalparameterlist . ',' formalparameter (142) + lambdaexpressionparameter : '(' formalparameterlist . ')' (215) + + ',' shift 326 + ')' shift 372 + . error + + +state 307 + methodinvocation : name '(' . ')' (228) + methodinvocation : name '(' . argumentlist ')' (229) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + ')' shift 373 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 374 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + argumentlist goto 375 + methodinvocation goto 276 + castexpression goto 277 + + +state 308 + variabledeclarators : variabledeclarators . ',' variabledeclarator (137) + localvariabledeclaration : type variabledeclarators . (172) + + ',' shift 152 + ';' reduce 172 + + +state 309 + block : '{' blockstatements '}' . (94) + + . reduce 94 + + +state 310 + blockstatements : blockstatements blockstatement . (140) + + . reduce 140 + + +state 311 + localvariabledeclarationstatement : localvariabledeclaration ';' . (162) + + . reduce 162 + + +state 312 + lambdaassignmentoperator : LAMBDAASSIGNMENT . (211) + + . reduce 211 + + +state 313 + lambdaexpression : lambdaexpressionparameter lambdaassignmentoperator . lambdabody (216) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '{' shift 139 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 376 + lambdabody goto 377 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 378 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 + + +state 314 + methodinvocation : primary '.' . IDENTIFIER '(' ')' (230) + methodinvocation : primary '.' . IDENTIFIER '(' argumentlist ')' (231) + + IDENTIFIER shift 379 + . error + + +state 315 + postincrementexpression : postfixexpression INCREMENT . (226) + + . reduce 226 + + +state 316 + postdecrementexpression : postfixexpression DECREMENT . (227) + + . reduce 227 + + +state 317 + expressionstatement : statementexpression ';' . (192) + + . reduce 192 + + +state 318 + assignmentoperator : PLUSEQUAL . (222) + + . reduce 222 + + +state 319 + assignmentoperator : MINUSEQUAL . (223) + + . reduce 223 + + +state 320 + assignmentoperator : TIMESEQUAL . (219) + + . reduce 219 + + +state 321 + assignmentoperator : DIVIDEEQUAL . (220) + + . reduce 220 + + +state 322 + assignmentoperator : MODULOEQUAL . (221) + + . reduce 221 + + +state 323 + assignmentoperator : '=' . (218) + + . reduce 218 + + +state 324 + assignment : lefthandside assignmentoperator . assignmentexpression (199) + assignment : lefthandside assignmentoperator . classinstancecreationexpression (200) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 380 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 381 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 + + +state 325 + formalparameter : type variabledeclaratorid . (155) + + . reduce 155 + + +state 326 + formalparameterlist : formalparameterlist ',' . formalparameter (142) + + BOOLEAN shift 2 + CHAR shift 3 + INT shift 6 + IDENTIFIER shift 198 + . error + + variabledeclaratorid goto 239 + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 240 + formalparameter goto 382 + + +state 327 + methoddeclarator : IDENTIFIER '(' formalparameterlist ')' . (148) . reduce 148 -state 179 - formalparameter : type . variabledeclaratorid (147) +state 328 + boundedMethodParameters : boundedMethodParameters ',' boundedMethodParameter . (110) - IDENTIFIER shift 186 + . reduce 110 + + +state 329 + methodheader : '<' boundedMethodParameters '>' VOID . methoddeclarator (123) + methodheader : '<' boundedMethodParameters '>' VOID . methoddeclarator throws (125) + + IDENTIFIER shift 141 . error - variabledeclaratorid goto 270 + methoddeclarator goto 383 -state 180 - formalparameterlist : formalparameter . (133) +state 330 + methodheader : '<' boundedMethodParameters '>' methoddeclarator . (128) - . reduce 133 + . reduce 128 -state 181 - formalparameterlist : formalparameterlist . ',' formalparameter (134) - methoddeclarator : IDENTIFIER '(' formalparameterlist . ')' (140) +state 331 + fielddeclaration : '<' boundedMethodParameters '>' type . fielddeclarator ';' (88) + methodheader : '<' boundedMethodParameters '>' type . methoddeclarator (111) + methodheader : '<' boundedMethodParameters '>' type . methoddeclarator throws (116) - ',' shift 271 - ')' shift 272 + IDENTIFIER shift 157 + . error + + methoddeclarator goto 384 + fielddeclarator goto 385 + variabledeclarator goto 386 + variabledeclaratorid goto 101 + + +state 332 + classtypelist : classtypelist ',' . classtype (146) + + IDENTIFIER shift 14 + . error + + simplename goto 18 + classtype goto 387 + classorinterfacetype goto 83 + + +state 333 + classinstancecreationexpression : NEW classtype . '(' ')' (232) + classinstancecreationexpression : NEW classtype . '(' argumentlist ')' (233) + + '(' shift 388 . error -state 182 - boundedMethodParameters : boundedMethodParameters ',' . boundedMethodParameter (102) +state 334 + type : primitivetype . (132) + type : primitivetype . '[' ']' (133) + castexpression : '(' primitivetype . ')' unaryexpression (265) - IDENTIFIER shift 27 + ')' shift 389 + '[' shift 45 + IDENTIFIER reduce 132 + + +state 335 + unaryexpression : '+' unaryexpression . (238) + + . reduce 238 + + +state 336 + unaryexpression : '-' unaryexpression . (239) + + . reduce 239 + + +state 337 + unaryexpressionnotplusminus : '!' unaryexpression . (253) + + . reduce 253 + + +state 338 + multiplicativeexpression : multiplicativeexpression '*' . unaryexpression (282) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 . error - boundedMethodParameter goto 273 + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 390 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 -state 183 - methodheader : '<' boundedMethodParameters '>' . type methoddeclarator (103) - methodheader : '<' boundedMethodParameters '>' . type methoddeclarator throws (108) - methodheader : '<' boundedMethodParameters '>' . VOID methoddeclarator (115) - methodheader : '<' boundedMethodParameters '>' . VOID methoddeclarator throws (117) - methodheader : '<' boundedMethodParameters '>' . methoddeclarator (120) +state 339 + multiplicativeexpression : multiplicativeexpression '/' . unaryexpression (283) - BOOLEAN shift 37 - CHAR shift 38 - INT shift 39 - VOID shift 274 - IDENTIFIER shift 104 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 . error - methoddeclarator goto 275 - simplename goto 32 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 276 + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 391 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 -state 184 - classtypelist : classtype . (137) +state 340 + multiplicativeexpression : multiplicativeexpression '%' . unaryexpression (284) - . reduce 137 - - -state 185 - throws : THROWS classtypelist . (93) - classtypelist : classtypelist . ',' classtype (138) - - ',' shift 277 - '{' reduce 93 - - -state 186 - variabledeclaratorid : IDENTIFIER . (152) - - . reduce 152 - - -state 187 - variabledeclarators : variabledeclarators ',' variabledeclarator . (129) - - . reduce 129 - - -state 188 - classinstancecreationexpression : NEW . classtype '(' ')' (224) - classinstancecreationexpression : NEW . classtype '(' argumentlist ')' (225) - - IDENTIFIER shift 31 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 . error - simplename goto 32 - classtype goto 278 - classorinterfacetype goto 34 + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 392 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 -state 189 - lambdaexpressionparameter : '(' . ')' (206) - lambdaexpressionparameter : '(' . formalparameterlist ')' (207) - castexpression : '(' . primitivetype ')' unaryexpression (257) +state 341 + additiveexpression : additiveexpression '+' . multiplicativeexpression (279) - BOOLEAN shift 37 - CHAR shift 38 - INT shift 39 - IDENTIFIER shift 136 - ')' shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 . error - variabledeclaratorid goto 178 - simplename goto 32 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 279 - referencetype goto 61 - type goto 179 - formalparameter goto 180 - formalparameterlist goto 250 + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 393 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 -state 190 - unaryexpression : '+' . unaryexpression (230) +state 342 + additiveexpression : additiveexpression '-' . multiplicativeexpression (280) - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 . error - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 280 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 394 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 -state 191 - unaryexpression : '-' . unaryexpression (231) +state 343 + relationalexpression : relationalexpression INSTANCEOF . referencetype (276) - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 + IDENTIFIER shift 14 . error - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 281 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 + simplename goto 18 + classorinterfacetype goto 21 + referencetype goto 395 -state 192 - unaryexpressionnotplusminus : '!' . unaryexpression (245) +state 344 + relationalexpression : relationalexpression LESSEQUAL . shiftexpression (274) - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 . error - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 282 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 396 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 -state 193 - name : simplename . (9) +state 345 + relationalexpression : relationalexpression GREATEREQUAL . shiftexpression (275) - . reduce 9 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 397 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 -194: shift/reduce conflict (shift 260, reduce 244) on INCREMENT -194: shift/reduce conflict (shift 261, reduce 244) on DECREMENT -state 194 - postincrementexpression : postfixexpression . INCREMENT (218) - postdecrementexpression : postfixexpression . DECREMENT (219) - unaryexpressionnotplusminus : postfixexpression . (244) +state 346 + relationalexpression : relationalexpression '<' . shiftexpression (272) - INCREMENT shift 260 - DECREMENT shift 261 - ABSTRACT reduce 244 - BOOLEAN reduce 244 - CHAR reduce 244 - FINAL reduce 244 - INSTANCEOF reduce 244 - INT reduce 244 - PRIVATE reduce 244 - PROTECTED reduce 244 - PUBLIC reduce 244 - STATIC reduce 244 - VOID reduce 244 - IDENTIFIER reduce 244 - EQUAL reduce 244 - LESSEQUAL reduce 244 - GREATEREQUAL reduce 244 - NOTEQUAL reduce 244 - LOGICALOR reduce 244 - LOGICALAND reduce 244 - ',' reduce 244 - ';' reduce 244 - '.' reduce 244 - '*' reduce 244 - '<' reduce 244 - '>' reduce 244 - '}' reduce 244 - ')' reduce 244 - '&' reduce 244 - '+' reduce 244 - '-' reduce 244 - '|' reduce 244 - '^' reduce 244 - '/' reduce 244 - '%' reduce 244 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 398 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 -state 195 - unaryexpression : unaryexpressionnotplusminus . (232) +state 347 + relationalexpression : relationalexpression '>' . shiftexpression (273) - . reduce 232 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 399 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 -state 196 - multiplicativeexpression : unaryexpression . (273) +state 348 + equalityexpression : equalityexpression EQUAL . relationalexpression (269) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 400 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 + + +state 349 + equalityexpression : equalityexpression NOTEQUAL . relationalexpression (270) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 401 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 + + +state 350 + andexpression : andexpression '&' . equalityexpression (267) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 402 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 + + +state 351 + exclusiveorexpression : exclusiveorexpression '^' . andexpression (256) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 403 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 + + +state 352 + inclusiveorexpression : inclusiveorexpression '|' . exclusiveorexpression (247) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 404 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 + + +state 353 + conditionalandexpression : conditionalandexpression LOGICALAND . inclusiveorexpression (235) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 405 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 + + +state 354 + conditionalorexpression : conditionalorexpression LOGICALOR . conditionalandexpression (210) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 406 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 + + +state 355 + constructordeclarator : simplename '(' formalparameterlist ')' . (96) + + . reduce 96 + + +state 356 + methodheader : modifiers VOID methoddeclarator throws . (122) + + . reduce 122 + + +state 357 + methodheader : modifiers '<' boundedMethodParameters '>' . type methoddeclarator (114) + methodheader : modifiers '<' boundedMethodParameters '>' . type methoddeclarator throws (118) + methodheader : modifiers '<' boundedMethodParameters '>' . VOID methoddeclarator (124) + methodheader : modifiers '<' boundedMethodParameters '>' . VOID methoddeclarator throws (126) + + BOOLEAN shift 2 + CHAR shift 3 + INT shift 6 + VOID shift 407 + IDENTIFIER shift 14 + . error + + simplename goto 18 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 408 + + +state 358 + methodheader : modifiers type methoddeclarator throws . (117) + + . reduce 117 + + +state 359 + fielddeclaration : modifiers type variabledeclarators ';' . (91) + + . reduce 91 + + +state 360 + explicitconstructorinvocation : THIS '(' . ')' ';' (143) + explicitconstructorinvocation : THIS '(' . argumentlist ')' ';' (144) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + ')' shift 409 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 374 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + argumentlist goto 410 + methodinvocation goto 276 + castexpression goto 277 + + +state 361 + constructorbody : '{' blockstatements '}' . (99) + + . reduce 99 + + +state 362 + constructorbody : '{' explicitconstructorinvocation '}' . (98) + + . reduce 98 + + +state 363 + constructorbody : '{' explicitconstructorinvocation blockstatements . '}' (100) + blockstatements : blockstatements . blockstatement (140) + + BOOLEAN shift 2 + CHAR shift 3 + FOR shift 185 + IF shift 186 + INT shift 6 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 198 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '}' shift 411 + '(' shift 203 + . error + + variabledeclarators goto 204 + variabledeclarator goto 205 + variabledeclaratorid goto 101 + simplename goto 206 + qualifiedname goto 35 + name goto 207 + classorinterfacetype goto 21 + integraltype goto 22 + numerictype goto 23 + primitivetype goto 24 + referencetype goto 25 + type goto 208 + block goto 209 + localvariabledeclarationstatement goto 211 + localvariabledeclaration goto 212 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + blockstatement goto 310 + statement goto 227 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 364 + methodheader : '<' boundedMethodParameters '>' type . methoddeclarator (111) + methodheader : '<' boundedMethodParameters '>' type . methoddeclarator throws (116) + + IDENTIFIER shift 141 + . error + + methoddeclarator goto 384 + + +state 365 + constantdeclaration : modifiers type IDENTIFIER '=' . expression ';' (83) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 412 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 + + +state 366 + boundedclassidentifierlist : boundedclassidentifierlist '&' referencetype . (108) + + . reduce 108 + + +state 367 + forstatement : FOR '(' ';' . expression ';' expression ')' statement (184) + forstatement : FOR '(' ';' . expression ';' ')' statement (186) + forstatement : FOR '(' ';' . ';' expression ')' statement (187) + forstatement : FOR '(' ';' . ';' ')' statement (188) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 413 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 414 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 + + +state 368 + forstatement : FOR '(' expression . ';' expression ';' expression ')' statement (181) + forstatement : FOR '(' expression . ';' expression ';' ')' statement (182) + forstatement : FOR '(' expression . ';' ';' expression ')' statement (183) + forstatement : FOR '(' expression . ';' ';' ')' statement (185) + + ';' shift 415 + . error + + +state 369 + ifthenstatement : IF '(' expression . ')' statement (178) + ifthenelsestatement : IF '(' expression . ')' statementnoshortif ELSE statement (179) + + ')' shift 416 + . error + + +state 370 + returnstatement : RETURN expression ';' . (194) + + . reduce 194 + + +state 371 + whilestatement : WHILE '(' expression . ')' statement (180) + + ')' shift 417 + . error + + +state 372 + lambdaexpressionparameter : '(' formalparameterlist ')' . (215) + + . reduce 215 + + +state 373 + methodinvocation : name '(' ')' . (228) + + . reduce 228 + + +state 374 + argumentlist : expression . (157) + + . reduce 157 + + +state 375 + argumentlist : argumentlist . ',' expression (158) + methodinvocation : name '(' argumentlist . ')' (229) + + ',' shift 418 + ')' shift 419 + . error + + +state 376 + lambdabody : block . (212) + + . reduce 212 + + +state 377 + lambdaexpression : lambdaexpressionparameter lambdaassignmentoperator lambdabody . (216) + + . reduce 216 + + +state 378 + lambdabody : expression . (213) + + . reduce 213 + + +state 379 + methodinvocation : primary '.' IDENTIFIER . '(' ')' (230) + methodinvocation : primary '.' IDENTIFIER . '(' argumentlist ')' (231) + + '(' shift 420 + . error + + +state 380 + assignment : lefthandside assignmentoperator assignmentexpression . (199) + + . reduce 199 + + +state 381 + assignment : lefthandside assignmentoperator classinstancecreationexpression . (200) + + . reduce 200 + + +state 382 + formalparameterlist : formalparameterlist ',' formalparameter . (142) + + . reduce 142 + + +state 383 + methodheader : '<' boundedMethodParameters '>' VOID methoddeclarator . (123) + methodheader : '<' boundedMethodParameters '>' VOID methoddeclarator . throws (125) + + THROWS shift 148 + ';' reduce 123 + '{' reduce 123 + + throws goto 421 + + +state 384 + methodheader : '<' boundedMethodParameters '>' type methoddeclarator . (111) + methodheader : '<' boundedMethodParameters '>' type methoddeclarator . throws (116) + + THROWS shift 148 + ';' reduce 111 + '{' reduce 111 + + throws goto 422 + + +state 385 + fielddeclaration : '<' boundedMethodParameters '>' type fielddeclarator . ';' (88) + + ';' shift 423 + . error + + +state 386 + fielddeclarator : variabledeclarator . '=' expression (85) + + '=' shift 155 + . error + + +state 387 + classtypelist : classtypelist ',' classtype . (146) + + . reduce 146 + + +state 388 + classinstancecreationexpression : NEW classtype '(' . ')' (232) + classinstancecreationexpression : NEW classtype '(' . argumentlist ')' (233) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + ')' shift 424 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 374 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + argumentlist goto 425 + methodinvocation goto 276 + castexpression goto 277 + + +state 389 + castexpression : '(' primitivetype ')' . unaryexpression (265) + + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 302 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 426 + lambdaexpression goto 218 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + methodinvocation goto 276 + castexpression goto 277 + + +state 390 + multiplicativeexpression : multiplicativeexpression '*' unaryexpression . (282) + + . reduce 282 + + +state 391 + multiplicativeexpression : multiplicativeexpression '/' unaryexpression . (283) + + . reduce 283 + + +state 392 + multiplicativeexpression : multiplicativeexpression '%' unaryexpression . (284) + + . reduce 284 + + +393: shift/reduce conflict (shift 338, reduce 279) on '*' +393: shift/reduce conflict (shift 339, reduce 279) on '/' +393: shift/reduce conflict (shift 340, reduce 279) on '%' +state 393 + additiveexpression : additiveexpression '+' multiplicativeexpression . (279) + multiplicativeexpression : multiplicativeexpression . '*' unaryexpression (282) + multiplicativeexpression : multiplicativeexpression . '/' unaryexpression (283) + multiplicativeexpression : multiplicativeexpression . '%' unaryexpression (284) + + '*' shift 338 + '/' shift 339 + '%' shift 340 + INSTANCEOF reduce 279 + EQUAL reduce 279 + LESSEQUAL reduce 279 + GREATEREQUAL reduce 279 + NOTEQUAL reduce 279 + LOGICALOR reduce 279 + LOGICALAND reduce 279 + INCREMENT reduce 279 + DECREMENT reduce 279 + ',' reduce 279 + ';' reduce 279 + '.' reduce 279 + '<' reduce 279 + '>' reduce 279 + ')' reduce 279 + '&' reduce 279 + '+' reduce 279 + '-' reduce 279 + '|' reduce 279 + '^' reduce 279 + + +394: shift/reduce conflict (shift 338, reduce 280) on '*' +394: shift/reduce conflict (shift 339, reduce 280) on '/' +394: shift/reduce conflict (shift 340, reduce 280) on '%' +state 394 + additiveexpression : additiveexpression '-' multiplicativeexpression . (280) + multiplicativeexpression : multiplicativeexpression . '*' unaryexpression (282) + multiplicativeexpression : multiplicativeexpression . '/' unaryexpression (283) + multiplicativeexpression : multiplicativeexpression . '%' unaryexpression (284) + + '*' shift 338 + '/' shift 339 + '%' shift 340 + INSTANCEOF reduce 280 + EQUAL reduce 280 + LESSEQUAL reduce 280 + GREATEREQUAL reduce 280 + NOTEQUAL reduce 280 + LOGICALOR reduce 280 + LOGICALAND reduce 280 + INCREMENT reduce 280 + DECREMENT reduce 280 + ',' reduce 280 + ';' reduce 280 + '.' reduce 280 + '<' reduce 280 + '>' reduce 280 + ')' reduce 280 + '&' reduce 280 + '+' reduce 280 + '-' reduce 280 + '|' reduce 280 + '^' reduce 280 + + +state 395 + relationalexpression : relationalexpression INSTANCEOF referencetype . (276) + + . reduce 276 + + +state 396 + relationalexpression : relationalexpression LESSEQUAL shiftexpression . (274) + + . reduce 274 + + +state 397 + relationalexpression : relationalexpression GREATEREQUAL shiftexpression . (275) + + . reduce 275 + + +state 398 + relationalexpression : relationalexpression '<' shiftexpression . (272) + + . reduce 272 + + +state 399 + relationalexpression : relationalexpression '>' shiftexpression . (273) . reduce 273 -197: shift/reduce conflict (shift 283, reduce 270) on '*' -197: shift/reduce conflict (shift 284, reduce 270) on '/' -197: shift/reduce conflict (shift 285, reduce 270) on '%' -state 197 - additiveexpression : multiplicativeexpression . (270) - multiplicativeexpression : multiplicativeexpression . '*' unaryexpression (274) - multiplicativeexpression : multiplicativeexpression . '/' unaryexpression (275) - multiplicativeexpression : multiplicativeexpression . '%' unaryexpression (276) +400: shift/reduce conflict (shift 343, reduce 269) on INSTANCEOF +400: shift/reduce conflict (shift 344, reduce 269) on LESSEQUAL +400: shift/reduce conflict (shift 345, reduce 269) on GREATEREQUAL +400: shift/reduce conflict (shift 346, reduce 269) on '<' +400: shift/reduce conflict (shift 347, reduce 269) on '>' +state 400 + equalityexpression : equalityexpression EQUAL relationalexpression . (269) + relationalexpression : relationalexpression . '<' shiftexpression (272) + relationalexpression : relationalexpression . '>' shiftexpression (273) + relationalexpression : relationalexpression . LESSEQUAL shiftexpression (274) + relationalexpression : relationalexpression . GREATEREQUAL shiftexpression (275) + relationalexpression : relationalexpression . INSTANCEOF referencetype (276) - '*' shift 283 - '/' shift 284 - '%' shift 285 - ABSTRACT reduce 270 - BOOLEAN reduce 270 - CHAR reduce 270 - FINAL reduce 270 - INSTANCEOF reduce 270 - INT reduce 270 - PRIVATE reduce 270 - PROTECTED reduce 270 - PUBLIC reduce 270 - STATIC reduce 270 - VOID reduce 270 - IDENTIFIER reduce 270 - EQUAL reduce 270 - LESSEQUAL reduce 270 - GREATEREQUAL reduce 270 - NOTEQUAL reduce 270 - LOGICALOR reduce 270 - LOGICALAND reduce 270 - INCREMENT reduce 270 - DECREMENT reduce 270 - ',' reduce 270 - ';' reduce 270 - '.' reduce 270 - '<' reduce 270 - '>' reduce 270 - '}' reduce 270 - ')' reduce 270 - '&' reduce 270 - '+' reduce 270 - '-' reduce 270 - '|' reduce 270 - '^' reduce 270 - - -198: shift/reduce conflict (shift 286, reduce 269) on '+' -198: shift/reduce conflict (shift 287, reduce 269) on '-' -state 198 - shiftexpression : additiveexpression . (269) - additiveexpression : additiveexpression . '+' multiplicativeexpression (271) - additiveexpression : additiveexpression . '-' multiplicativeexpression (272) - - '+' shift 286 - '-' shift 287 - ABSTRACT reduce 269 - BOOLEAN reduce 269 - CHAR reduce 269 - FINAL reduce 269 - INSTANCEOF reduce 269 - INT reduce 269 - PRIVATE reduce 269 - PROTECTED reduce 269 - PUBLIC reduce 269 - STATIC reduce 269 - VOID reduce 269 - IDENTIFIER reduce 269 + INSTANCEOF shift 343 + LESSEQUAL shift 344 + GREATEREQUAL shift 345 + '<' shift 346 + '>' shift 347 EQUAL reduce 269 - LESSEQUAL reduce 269 - GREATEREQUAL reduce 269 NOTEQUAL reduce 269 LOGICALOR reduce 269 LOGICALAND reduce 269 @@ -2888,135 +6265,123 @@ state 198 ';' reduce 269 '.' reduce 269 '*' reduce 269 - '<' reduce 269 - '>' reduce 269 - '}' reduce 269 ')' reduce 269 '&' reduce 269 + '+' reduce 269 + '-' reduce 269 '|' reduce 269 '^' reduce 269 '/' reduce 269 '%' reduce 269 -state 199 - relationalexpression : shiftexpression . (263) +401: shift/reduce conflict (shift 343, reduce 270) on INSTANCEOF +401: shift/reduce conflict (shift 344, reduce 270) on LESSEQUAL +401: shift/reduce conflict (shift 345, reduce 270) on GREATEREQUAL +401: shift/reduce conflict (shift 346, reduce 270) on '<' +401: shift/reduce conflict (shift 347, reduce 270) on '>' +state 401 + equalityexpression : equalityexpression NOTEQUAL relationalexpression . (270) + relationalexpression : relationalexpression . '<' shiftexpression (272) + relationalexpression : relationalexpression . '>' shiftexpression (273) + relationalexpression : relationalexpression . LESSEQUAL shiftexpression (274) + relationalexpression : relationalexpression . GREATEREQUAL shiftexpression (275) + relationalexpression : relationalexpression . INSTANCEOF referencetype (276) - . reduce 263 + INSTANCEOF shift 343 + LESSEQUAL shift 344 + GREATEREQUAL shift 345 + '<' shift 346 + '>' shift 347 + EQUAL reduce 270 + NOTEQUAL reduce 270 + LOGICALOR reduce 270 + LOGICALAND reduce 270 + INCREMENT reduce 270 + DECREMENT reduce 270 + ',' reduce 270 + ';' reduce 270 + '.' reduce 270 + '*' reduce 270 + ')' reduce 270 + '&' reduce 270 + '+' reduce 270 + '-' reduce 270 + '|' reduce 270 + '^' reduce 270 + '/' reduce 270 + '%' reduce 270 -200: shift/reduce conflict (shift 288, reduce 260) on INSTANCEOF -200: shift/reduce conflict (shift 289, reduce 260) on LESSEQUAL -200: shift/reduce conflict (shift 290, reduce 260) on GREATEREQUAL -200: shift/reduce conflict (shift 291, reduce 260) on '<' -200: shift/reduce conflict (shift 292, reduce 260) on '>' -state 200 - equalityexpression : relationalexpression . (260) - relationalexpression : relationalexpression . '<' shiftexpression (264) - relationalexpression : relationalexpression . '>' shiftexpression (265) - relationalexpression : relationalexpression . LESSEQUAL shiftexpression (266) - relationalexpression : relationalexpression . GREATEREQUAL shiftexpression (267) - relationalexpression : relationalexpression . INSTANCEOF referencetype (268) +402: shift/reduce conflict (shift 348, reduce 267) on EQUAL +402: shift/reduce conflict (shift 349, reduce 267) on NOTEQUAL +state 402 + andexpression : andexpression '&' equalityexpression . (267) + equalityexpression : equalityexpression . EQUAL relationalexpression (269) + equalityexpression : equalityexpression . NOTEQUAL relationalexpression (270) - INSTANCEOF shift 288 - LESSEQUAL shift 289 - GREATEREQUAL shift 290 - '<' shift 291 - '>' shift 292 - ABSTRACT reduce 260 - BOOLEAN reduce 260 - CHAR reduce 260 - FINAL reduce 260 - INT reduce 260 - PRIVATE reduce 260 - PROTECTED reduce 260 - PUBLIC reduce 260 - STATIC reduce 260 - VOID reduce 260 - IDENTIFIER reduce 260 - EQUAL reduce 260 - NOTEQUAL reduce 260 - LOGICALOR reduce 260 - LOGICALAND reduce 260 - INCREMENT reduce 260 - DECREMENT reduce 260 - ',' reduce 260 - ';' reduce 260 - '.' reduce 260 - '*' reduce 260 - '}' reduce 260 - ')' reduce 260 - '&' reduce 260 - '+' reduce 260 - '-' reduce 260 - '|' reduce 260 - '^' reduce 260 - '/' reduce 260 - '%' reduce 260 + EQUAL shift 348 + NOTEQUAL shift 349 + INSTANCEOF reduce 267 + LESSEQUAL reduce 267 + GREATEREQUAL reduce 267 + LOGICALOR reduce 267 + LOGICALAND reduce 267 + INCREMENT reduce 267 + DECREMENT reduce 267 + ',' reduce 267 + ';' reduce 267 + '.' reduce 267 + '*' reduce 267 + '<' reduce 267 + '>' reduce 267 + ')' reduce 267 + '&' reduce 267 + '+' reduce 267 + '-' reduce 267 + '|' reduce 267 + '^' reduce 267 + '/' reduce 267 + '%' reduce 267 -201: shift/reduce conflict (shift 293, reduce 258) on EQUAL -201: shift/reduce conflict (shift 294, reduce 258) on NOTEQUAL -state 201 - andexpression : equalityexpression . (258) - equalityexpression : equalityexpression . EQUAL relationalexpression (261) - equalityexpression : equalityexpression . NOTEQUAL relationalexpression (262) +403: shift/reduce conflict (shift 350, reduce 256) on '&' +state 403 + exclusiveorexpression : exclusiveorexpression '^' andexpression . (256) + andexpression : andexpression . '&' equalityexpression (267) - EQUAL shift 293 - NOTEQUAL shift 294 - ABSTRACT reduce 258 - BOOLEAN reduce 258 - CHAR reduce 258 - FINAL reduce 258 - INSTANCEOF reduce 258 - INT reduce 258 - PRIVATE reduce 258 - PROTECTED reduce 258 - PUBLIC reduce 258 - STATIC reduce 258 - VOID reduce 258 - IDENTIFIER reduce 258 - LESSEQUAL reduce 258 - GREATEREQUAL reduce 258 - LOGICALOR reduce 258 - LOGICALAND reduce 258 - INCREMENT reduce 258 - DECREMENT reduce 258 - ',' reduce 258 - ';' reduce 258 - '.' reduce 258 - '*' reduce 258 - '<' reduce 258 - '>' reduce 258 - '}' reduce 258 - ')' reduce 258 - '&' reduce 258 - '+' reduce 258 - '-' reduce 258 - '|' reduce 258 - '^' reduce 258 - '/' reduce 258 - '%' reduce 258 + '&' shift 350 + INSTANCEOF reduce 256 + EQUAL reduce 256 + LESSEQUAL reduce 256 + GREATEREQUAL reduce 256 + NOTEQUAL reduce 256 + LOGICALOR reduce 256 + LOGICALAND reduce 256 + INCREMENT reduce 256 + DECREMENT reduce 256 + ',' reduce 256 + ';' reduce 256 + '.' reduce 256 + '*' reduce 256 + '<' reduce 256 + '>' reduce 256 + ')' reduce 256 + '+' reduce 256 + '-' reduce 256 + '|' reduce 256 + '^' reduce 256 + '/' reduce 256 + '%' reduce 256 -202: shift/reduce conflict (shift 295, reduce 247) on '&' -state 202 - exclusiveorexpression : andexpression . (247) - andexpression : andexpression . '&' equalityexpression (259) +404: shift/reduce conflict (shift 351, reduce 247) on '^' +state 404 + inclusiveorexpression : inclusiveorexpression '|' exclusiveorexpression . (247) + exclusiveorexpression : exclusiveorexpression . '^' andexpression (256) - '&' shift 295 - ABSTRACT reduce 247 - BOOLEAN reduce 247 - CHAR reduce 247 - FINAL reduce 247 + '^' shift 351 INSTANCEOF reduce 247 - INT reduce 247 - PRIVATE reduce 247 - PROTECTED reduce 247 - PUBLIC reduce 247 - STATIC reduce 247 - VOID reduce 247 - IDENTIFIER reduce 247 EQUAL reduce 247 LESSEQUAL reduce 247 GREATEREQUAL reduce 247 @@ -3031,4663 +6396,1803 @@ state 202 '*' reduce 247 '<' reduce 247 '>' reduce 247 - '}' reduce 247 ')' reduce 247 + '&' reduce 247 '+' reduce 247 '-' reduce 247 '|' reduce 247 - '^' reduce 247 '/' reduce 247 '%' reduce 247 -203: shift/reduce conflict (shift 296, reduce 238) on '^' -state 203 - inclusiveorexpression : exclusiveorexpression . (238) - exclusiveorexpression : exclusiveorexpression . '^' andexpression (248) +405: shift/reduce conflict (shift 352, reduce 235) on '|' +state 405 + conditionalandexpression : conditionalandexpression LOGICALAND inclusiveorexpression . (235) + inclusiveorexpression : inclusiveorexpression . '|' exclusiveorexpression (247) - '^' shift 296 - ABSTRACT reduce 238 - BOOLEAN reduce 238 - CHAR reduce 238 - FINAL reduce 238 - INSTANCEOF reduce 238 - INT reduce 238 - PRIVATE reduce 238 - PROTECTED reduce 238 - PUBLIC reduce 238 - STATIC reduce 238 - VOID reduce 238 - IDENTIFIER reduce 238 - EQUAL reduce 238 - LESSEQUAL reduce 238 - GREATEREQUAL reduce 238 - NOTEQUAL reduce 238 - LOGICALOR reduce 238 - LOGICALAND reduce 238 - INCREMENT reduce 238 - DECREMENT reduce 238 - ',' reduce 238 - ';' reduce 238 - '.' reduce 238 - '*' reduce 238 - '<' reduce 238 - '>' reduce 238 - '}' reduce 238 - ')' reduce 238 - '&' reduce 238 - '+' reduce 238 - '-' reduce 238 - '|' reduce 238 - '/' reduce 238 - '%' reduce 238 + '|' shift 352 + INSTANCEOF reduce 235 + EQUAL reduce 235 + LESSEQUAL reduce 235 + GREATEREQUAL reduce 235 + NOTEQUAL reduce 235 + LOGICALOR reduce 235 + LOGICALAND reduce 235 + INCREMENT reduce 235 + DECREMENT reduce 235 + ',' reduce 235 + ';' reduce 235 + '.' reduce 235 + '*' reduce 235 + '<' reduce 235 + '>' reduce 235 + ')' reduce 235 + '&' reduce 235 + '+' reduce 235 + '-' reduce 235 + '^' reduce 235 + '/' reduce 235 + '%' reduce 235 -204: shift/reduce conflict (shift 297, reduce 226) on '|' -state 204 - conditionalandexpression : inclusiveorexpression . (226) - inclusiveorexpression : inclusiveorexpression . '|' exclusiveorexpression (239) +406: shift/reduce conflict (shift 353, reduce 210) on LOGICALAND +state 406 + conditionalorexpression : conditionalorexpression LOGICALOR conditionalandexpression . (210) + conditionalandexpression : conditionalandexpression . LOGICALAND inclusiveorexpression (235) - '|' shift 297 - ABSTRACT reduce 226 - BOOLEAN reduce 226 - CHAR reduce 226 - FINAL reduce 226 - INSTANCEOF reduce 226 - INT reduce 226 - PRIVATE reduce 226 - PROTECTED reduce 226 - PUBLIC reduce 226 - STATIC reduce 226 - VOID reduce 226 - IDENTIFIER reduce 226 - EQUAL reduce 226 - LESSEQUAL reduce 226 - GREATEREQUAL reduce 226 - NOTEQUAL reduce 226 - LOGICALOR reduce 226 - LOGICALAND reduce 226 - INCREMENT reduce 226 - DECREMENT reduce 226 - ',' reduce 226 - ';' reduce 226 - '.' reduce 226 - '*' reduce 226 - '<' reduce 226 - '>' reduce 226 - '}' reduce 226 - ')' reduce 226 - '&' reduce 226 - '+' reduce 226 - '-' reduce 226 - '^' reduce 226 - '/' reduce 226 - '%' reduce 226 + LOGICALAND shift 353 + INSTANCEOF reduce 210 + EQUAL reduce 210 + LESSEQUAL reduce 210 + GREATEREQUAL reduce 210 + NOTEQUAL reduce 210 + LOGICALOR reduce 210 + INCREMENT reduce 210 + DECREMENT reduce 210 + ',' reduce 210 + ';' reduce 210 + '.' reduce 210 + '*' reduce 210 + '<' reduce 210 + '>' reduce 210 + ')' reduce 210 + '&' reduce 210 + '+' reduce 210 + '-' reduce 210 + '|' reduce 210 + '^' reduce 210 + '/' reduce 210 + '%' reduce 210 -205: shift/reduce conflict (shift 298, reduce 201) on LOGICALAND -state 205 - conditionalorexpression : conditionalandexpression . (201) - conditionalandexpression : conditionalandexpression . LOGICALAND inclusiveorexpression (227) +state 407 + methodheader : modifiers '<' boundedMethodParameters '>' VOID . methoddeclarator (124) + methodheader : modifiers '<' boundedMethodParameters '>' VOID . methoddeclarator throws (126) - LOGICALAND shift 298 - ABSTRACT reduce 201 - BOOLEAN reduce 201 - CHAR reduce 201 - FINAL reduce 201 - INSTANCEOF reduce 201 - INT reduce 201 - PRIVATE reduce 201 - PROTECTED reduce 201 - PUBLIC reduce 201 - STATIC reduce 201 - VOID reduce 201 - IDENTIFIER reduce 201 - EQUAL reduce 201 - LESSEQUAL reduce 201 - GREATEREQUAL reduce 201 - NOTEQUAL reduce 201 - LOGICALOR reduce 201 - INCREMENT reduce 201 - DECREMENT reduce 201 - ',' reduce 201 - ';' reduce 201 - '.' reduce 201 - '*' reduce 201 - '<' reduce 201 - '>' reduce 201 - '}' reduce 201 - ')' reduce 201 - '&' reduce 201 - '+' reduce 201 - '-' reduce 201 - '|' reduce 201 - '^' reduce 201 - '/' reduce 201 - '%' reduce 201 + IDENTIFIER shift 141 + . error + + methoddeclarator goto 427 -206: shift/reduce conflict (shift 299, reduce 190) on LOGICALOR -state 206 - conditionalexpression : conditionalorexpression . (190) - conditionalorexpression : conditionalorexpression . LOGICALOR conditionalandexpression (202) +state 408 + methodheader : modifiers '<' boundedMethodParameters '>' type . methoddeclarator (114) + methodheader : modifiers '<' boundedMethodParameters '>' type . methoddeclarator throws (118) - LOGICALOR shift 299 - ABSTRACT reduce 190 - BOOLEAN reduce 190 - CHAR reduce 190 - FINAL reduce 190 - INSTANCEOF reduce 190 - INT reduce 190 - PRIVATE reduce 190 - PROTECTED reduce 190 - PUBLIC reduce 190 - STATIC reduce 190 - VOID reduce 190 - IDENTIFIER reduce 190 - EQUAL reduce 190 - LESSEQUAL reduce 190 - GREATEREQUAL reduce 190 - NOTEQUAL reduce 190 - LOGICALAND reduce 190 - INCREMENT reduce 190 - DECREMENT reduce 190 - ',' reduce 190 - ';' reduce 190 - '.' reduce 190 - '*' reduce 190 - '<' reduce 190 - '>' reduce 190 - '}' reduce 190 - ')' reduce 190 - '&' reduce 190 - '+' reduce 190 - '-' reduce 190 - '|' reduce 190 - '^' reduce 190 - '/' reduce 190 - '%' reduce 190 + IDENTIFIER shift 141 + . error + + methoddeclarator goto 428 -state 207 - assignmentexpression : conditionalexpression . (181) +state 409 + explicitconstructorinvocation : THIS '(' ')' . ';' (143) - . reduce 181 - - -state 208 - expression : assignmentexpression . (160) - - . reduce 160 - - -state 209 - fielddeclarator : variabledeclarator '=' expression . (78) - - . reduce 78 - - -state 210 - unaryexpression : preincrementexpression . (228) - - . reduce 228 - - -state 211 - unaryexpression : predecrementexpression . (229) - - . reduce 229 - - -state 212 - postfixexpression : postincrementexpression . (235) - - . reduce 235 - - -state 213 - postfixexpression : postdecrementexpression . (236) - - . reduce 236 - - -state 214 - expression : classinstancecreationexpression . (161) - - . reduce 161 - - -state 215 - assignmentexpression : assignment . (182) - - . reduce 182 - - -state 216 - primarynonewarray : methodinvocation . (242) - - . reduce 242 - - -state 217 - unaryexpressionnotplusminus : castexpression . (246) - - . reduce 246 - - -state 218 - constructordeclarator : simplename '(' ')' . (87) - - . reduce 87 - - -state 219 - constructordeclarator : simplename '(' formalparameterlist . ')' (88) - formalparameterlist : formalparameterlist . ',' formalparameter (134) - - ',' shift 271 - ')' shift 300 + ';' shift 429 . error -state 220 - type : primitivetype '[' ']' . (125) +state 410 + explicitconstructorinvocation : THIS '(' argumentlist . ')' ';' (144) + argumentlist : argumentlist . ',' expression (158) - . reduce 125 - - -state 221 - type : referencetype '[' ']' . (127) - - . reduce 127 - - -state 222 - methodheader : type methoddeclarator throws . (107) - - . reduce 107 - - -state 223 - fielddeclaration : type variabledeclarators ';' . (82) - - . reduce 82 - - -state 224 - methodheader : modifiers VOID methoddeclarator . (112) - methodheader : modifiers VOID methoddeclarator . throws (114) - - THROWS shift 88 - '{' reduce 112 - - throws goto 301 - - -state 225 - boundedMethodParameters : boundedMethodParameters . ',' boundedMethodParameter (102) - methodheader : modifiers '<' boundedMethodParameters . '>' type methoddeclarator (106) - methodheader : modifiers '<' boundedMethodParameters . '>' type methoddeclarator throws (110) - methodheader : modifiers '<' boundedMethodParameters . '>' VOID methoddeclarator (116) - methodheader : modifiers '<' boundedMethodParameters . '>' VOID methoddeclarator throws (118) - - ',' shift 182 - '>' shift 302 + ',' shift 418 + ')' shift 430 . error -state 226 - methodheader : modifiers methoddeclarator throws . (123) - - . reduce 123 - - -state 227 - methodheader : modifiers type methoddeclarator . (105) - methodheader : modifiers type methoddeclarator . throws (109) - - THROWS shift 88 - '{' reduce 105 - - throws goto 303 - - -state 228 - fielddeclaration : modifiers type variabledeclarators . ';' (83) - variabledeclarators : variabledeclarators . ',' variabledeclarator (129) - - ',' shift 92 - ';' shift 304 - . error - - -state 229 - constructordeclaration : modifiers constructordeclarator constructorbody . (75) - - . reduce 75 - - -state 230 - explicitconstructorinvocation : THIS . '(' ')' ';' (135) - explicitconstructorinvocation : THIS . '(' argumentlist ')' ';' (136) - primarynonewarray : THIS . (241) - - '(' shift 305 - INCREMENT reduce 241 - DECREMENT reduce 241 - '.' reduce 241 - - -state 231 - constructorbody : '{' '}' . (89) - - . reduce 89 - - -state 232 - constructorbody : '{' blockstatements . '}' (91) - blockstatements : blockstatements . blockstatement (132) - - BOOLEAN shift 37 - CHAR shift 38 - FOR shift 123 - IF shift 124 - INT shift 39 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 136 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '}' shift 306 - '(' shift 141 - . error - - variabledeclarators goto 142 - variabledeclarator goto 143 - variabledeclaratorid goto 55 - simplename goto 144 - qualifiedname goto 145 - name goto 146 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 147 - block goto 148 - localvariabledeclarationstatement goto 150 - localvariabledeclaration goto 151 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - blockstatement goto 255 - statement goto 166 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 233 - constructorbody : '{' explicitconstructorinvocation . '}' (90) - constructorbody : '{' explicitconstructorinvocation . blockstatements '}' (92) - - BOOLEAN shift 37 - CHAR shift 38 - FOR shift 123 - IF shift 124 - INT shift 39 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 136 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '}' shift 307 - '(' shift 141 - . error - - variabledeclarators goto 142 - variabledeclarator goto 143 - variabledeclaratorid goto 55 - simplename goto 144 - qualifiedname goto 145 - name goto 146 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 147 - block goto 148 - blockstatements goto 308 - localvariabledeclarationstatement goto 150 - localvariabledeclaration goto 151 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - blockstatement goto 165 - statement goto 166 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 234 - classdeclaration : modifiers CLASS classidentifier super interfaces classbody . (22) - - . reduce 22 - - -state 235 - boundedclassidentifierlist : boundedclassidentifierlist '&' . referencetype (100) - - IDENTIFIER shift 31 - . error - - simplename goto 32 - classorinterfacetype goto 57 - referencetype goto 309 - - -state 236 - paralist : IDENTIFIER '<' . paralist '>' (32) - - IDENTIFIER shift 119 - '?' shift 120 - . error - - paralist goto 310 - wildcardparameter goto 122 - - -state 237 - wildcardparameter : '?' EXTENDS . referencetype (38) - - IDENTIFIER shift 31 - . error - - simplename goto 32 - classorinterfacetype goto 57 - referencetype goto 311 - - -state 238 - wildcardparameter : '?' SUPER . referencetype (39) - - IDENTIFIER shift 31 - . error - - simplename goto 32 - classorinterfacetype goto 57 - referencetype goto 312 - - -state 239 - paralist : paralist ',' . IDENTIFIER (34) - paralist : paralist ',' . IDENTIFIER '<' paralist '>' (35) - paralist : paralist ',' . wildcardparameter (36) - - IDENTIFIER shift 313 - '?' shift 120 - . error - - wildcardparameter goto 314 - - -state 240 - parameter : '<' paralist '>' . (68) - - . reduce 68 - - -state 241 - forstatement : FOR '(' . expression ';' expression ';' expression ')' statement (173) - forstatement : FOR '(' . expression ';' expression ';' ')' statement (174) - forstatement : FOR '(' . expression ';' ';' expression ')' statement (175) - forstatement : FOR '(' . ';' expression ';' expression ')' statement (176) - forstatement : FOR '(' . expression ';' ';' ')' statement (177) - forstatement : FOR '(' . ';' expression ';' ')' statement (178) - forstatement : FOR '(' . ';' ';' expression ')' statement (179) - forstatement : FOR '(' . ';' ';' ')' statement (180) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 315 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 316 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 - - -state 242 - ifthenstatement : IF '(' . expression ')' statement (170) - ifthenelsestatement : IF '(' . expression ')' statementnoshortif ELSE statement (171) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 317 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 - - -state 243 - returnstatement : RETURN ';' . (185) - - . reduce 185 - - -state 244 - returnstatement : RETURN expression . ';' (186) - - ';' shift 318 - . error - - -state 245 - whilestatement : WHILE '(' . expression ')' statement (172) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 319 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 - - -246: shift/reduce conflict (shift 251, reduce 234) on '.' -state 246 - qualifiedname : name . '.' IDENTIFIER (11) - methodinvocation : name . '(' ')' (220) - methodinvocation : name . '(' argumentlist ')' (221) - postfixexpression : name . (234) - - '.' shift 251 - '(' shift 252 - ABSTRACT reduce 234 - BOOLEAN reduce 234 - CHAR reduce 234 - FINAL reduce 234 - INSTANCEOF reduce 234 - INT reduce 234 - PRIVATE reduce 234 - PROTECTED reduce 234 - PUBLIC reduce 234 - STATIC reduce 234 - VOID reduce 234 - IDENTIFIER reduce 234 - EQUAL reduce 234 - LESSEQUAL reduce 234 - GREATEREQUAL reduce 234 - NOTEQUAL reduce 234 - LOGICALOR reduce 234 - LOGICALAND reduce 234 - INCREMENT reduce 234 - DECREMENT reduce 234 - ',' reduce 234 - ';' reduce 234 - '*' reduce 234 - '<' reduce 234 - '>' reduce 234 - '}' reduce 234 - ')' reduce 234 - '&' reduce 234 - '+' reduce 234 - '-' reduce 234 - '|' reduce 234 - '^' reduce 234 - '/' reduce 234 - '%' reduce 234 - - -state 247 - preincrementexpression : INCREMENT unaryexpression . (216) - - . reduce 216 - - -state 248 - predecrementexpression : DECREMENT unaryexpression . (217) - - . reduce 217 - - -state 249 - lambdaexpressionparameter : '(' ')' . (206) - - . reduce 206 - - -state 250 - formalparameterlist : formalparameterlist . ',' formalparameter (134) - lambdaexpressionparameter : '(' formalparameterlist . ')' (207) - - ',' shift 271 - ')' shift 320 - . error - - -state 251 - qualifiedname : name '.' . IDENTIFIER (11) - - IDENTIFIER shift 321 - . error - - -state 252 - methodinvocation : name '(' . ')' (220) - methodinvocation : name '(' . argumentlist ')' (221) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - ')' shift 322 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 323 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - argumentlist goto 324 - methodinvocation goto 216 - castexpression goto 217 - - -state 253 - variabledeclarators : variabledeclarators . ',' variabledeclarator (129) - localvariabledeclaration : type variabledeclarators . (164) - - ',' shift 92 - ';' reduce 164 - - -state 254 - block : '{' blockstatements '}' . (86) - - . reduce 86 - - -state 255 - blockstatements : blockstatements blockstatement . (132) - - . reduce 132 - - -state 256 - localvariabledeclarationstatement : localvariabledeclaration ';' . (154) - - . reduce 154 - - -state 257 - lambdaassignmentoperator : LAMBDAASSIGNMENT . (203) - - . reduce 203 - - -state 258 - lambdaexpression : lambdaexpressionparameter lambdaassignmentoperator . lambdabody (208) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '{' shift 79 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 325 - lambdabody goto 326 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 327 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 - - -state 259 - methodinvocation : primary '.' . IDENTIFIER '(' ')' (222) - methodinvocation : primary '.' . IDENTIFIER '(' argumentlist ')' (223) - - IDENTIFIER shift 328 - . error - - -state 260 - postincrementexpression : postfixexpression INCREMENT . (218) - - . reduce 218 - - -state 261 - postdecrementexpression : postfixexpression DECREMENT . (219) - - . reduce 219 - - -state 262 - expressionstatement : statementexpression ';' . (184) - - . reduce 184 - - -state 263 - assignmentoperator : PLUSEQUAL . (214) - - . reduce 214 - - -state 264 - assignmentoperator : MINUSEQUAL . (215) - - . reduce 215 - - -state 265 - assignmentoperator : TIMESEQUAL . (211) - - . reduce 211 - - -state 266 - assignmentoperator : DIVIDEEQUAL . (212) - - . reduce 212 - - -state 267 - assignmentoperator : MODULOEQUAL . (213) - - . reduce 213 - - -state 268 - assignmentoperator : '=' . (210) - - . reduce 210 - - -state 269 - assignment : lefthandside assignmentoperator . assignmentexpression (191) - assignment : lefthandside assignmentoperator . classinstancecreationexpression (192) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 329 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 330 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 - - -state 270 - formalparameter : type variabledeclaratorid . (147) - - . reduce 147 - - -state 271 - formalparameterlist : formalparameterlist ',' . formalparameter (134) - - BOOLEAN shift 37 - CHAR shift 38 - INT shift 39 - IDENTIFIER shift 136 - . error - - variabledeclaratorid goto 178 - simplename goto 32 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 179 - formalparameter goto 331 - - -state 272 - methoddeclarator : IDENTIFIER '(' formalparameterlist ')' . (140) - - . reduce 140 - - -state 273 - boundedMethodParameters : boundedMethodParameters ',' boundedMethodParameter . (102) - - . reduce 102 - - -state 274 - methodheader : '<' boundedMethodParameters '>' VOID . methoddeclarator (115) - methodheader : '<' boundedMethodParameters '>' VOID . methoddeclarator throws (117) - - IDENTIFIER shift 81 - . error - - methoddeclarator goto 332 - - -state 275 - methodheader : '<' boundedMethodParameters '>' methoddeclarator . (120) - - . reduce 120 - - -state 276 - methodheader : '<' boundedMethodParameters '>' type . methoddeclarator (103) - methodheader : '<' boundedMethodParameters '>' type . methoddeclarator throws (108) - - IDENTIFIER shift 81 - . error - - methoddeclarator goto 333 - - -state 277 - classtypelist : classtypelist ',' . classtype (138) - - IDENTIFIER shift 31 - . error - - simplename goto 32 - classtype goto 334 - classorinterfacetype goto 34 - - -state 278 - classinstancecreationexpression : NEW classtype . '(' ')' (224) - classinstancecreationexpression : NEW classtype . '(' argumentlist ')' (225) - - '(' shift 335 - . error - - -state 279 - type : primitivetype . (124) - type : primitivetype . '[' ']' (125) - castexpression : '(' primitivetype . ')' unaryexpression (257) - - ')' shift 336 - '[' shift 97 - IDENTIFIER reduce 124 - - -state 280 - unaryexpression : '+' unaryexpression . (230) - - . reduce 230 - - -state 281 - unaryexpression : '-' unaryexpression . (231) - - . reduce 231 - - -state 282 - unaryexpressionnotplusminus : '!' unaryexpression . (245) - - . reduce 245 - - -state 283 - multiplicativeexpression : multiplicativeexpression '*' . unaryexpression (274) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 337 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 284 - multiplicativeexpression : multiplicativeexpression '/' . unaryexpression (275) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 338 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 285 - multiplicativeexpression : multiplicativeexpression '%' . unaryexpression (276) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 339 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 286 - additiveexpression : additiveexpression '+' . multiplicativeexpression (271) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 340 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 287 - additiveexpression : additiveexpression '-' . multiplicativeexpression (272) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 341 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 288 - relationalexpression : relationalexpression INSTANCEOF . referencetype (268) - - IDENTIFIER shift 31 - . error - - simplename goto 32 - classorinterfacetype goto 57 - referencetype goto 342 - - -state 289 - relationalexpression : relationalexpression LESSEQUAL . shiftexpression (266) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 343 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 290 - relationalexpression : relationalexpression GREATEREQUAL . shiftexpression (267) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 344 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 291 - relationalexpression : relationalexpression '<' . shiftexpression (264) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 345 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 292 - relationalexpression : relationalexpression '>' . shiftexpression (265) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 346 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 293 - equalityexpression : equalityexpression EQUAL . relationalexpression (261) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 347 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 294 - equalityexpression : equalityexpression NOTEQUAL . relationalexpression (262) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 348 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 295 - andexpression : andexpression '&' . equalityexpression (259) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 349 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 296 - exclusiveorexpression : exclusiveorexpression '^' . andexpression (248) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 350 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 297 - inclusiveorexpression : inclusiveorexpression '|' . exclusiveorexpression (239) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 351 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 298 - conditionalandexpression : conditionalandexpression LOGICALAND . inclusiveorexpression (227) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 352 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 299 - conditionalorexpression : conditionalorexpression LOGICALOR . conditionalandexpression (202) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 353 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 300 - constructordeclarator : simplename '(' formalparameterlist ')' . (88) - - . reduce 88 - - -state 301 - methodheader : modifiers VOID methoddeclarator throws . (114) - - . reduce 114 - - -state 302 - methodheader : modifiers '<' boundedMethodParameters '>' . type methoddeclarator (106) - methodheader : modifiers '<' boundedMethodParameters '>' . type methoddeclarator throws (110) - methodheader : modifiers '<' boundedMethodParameters '>' . VOID methoddeclarator (116) - methodheader : modifiers '<' boundedMethodParameters '>' . VOID methoddeclarator throws (118) - - BOOLEAN shift 37 - CHAR shift 38 - INT shift 39 - VOID shift 354 - IDENTIFIER shift 31 - . error - - simplename goto 32 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 355 - - -state 303 - methodheader : modifiers type methoddeclarator throws . (109) - - . reduce 109 - - -state 304 - fielddeclaration : modifiers type variabledeclarators ';' . (83) - - . reduce 83 - - -state 305 - explicitconstructorinvocation : THIS '(' . ')' ';' (135) - explicitconstructorinvocation : THIS '(' . argumentlist ')' ';' (136) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - ')' shift 356 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 323 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - argumentlist goto 357 - methodinvocation goto 216 - castexpression goto 217 - - -state 306 - constructorbody : '{' blockstatements '}' . (91) - - . reduce 91 - - -state 307 - constructorbody : '{' explicitconstructorinvocation '}' . (90) - - . reduce 90 - - -state 308 - constructorbody : '{' explicitconstructorinvocation blockstatements . '}' (92) - blockstatements : blockstatements . blockstatement (132) - - BOOLEAN shift 37 - CHAR shift 38 - FOR shift 123 - IF shift 124 - INT shift 39 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 136 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '}' shift 358 - '(' shift 141 - . error - - variabledeclarators goto 142 - variabledeclarator goto 143 - variabledeclaratorid goto 55 - simplename goto 144 - qualifiedname goto 145 - name goto 146 - classorinterfacetype goto 57 - integraltype goto 58 - numerictype goto 59 - primitivetype goto 60 - referencetype goto 61 - type goto 147 - block goto 148 - localvariabledeclarationstatement goto 150 - localvariabledeclaration goto 151 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - blockstatement goto 255 - statement goto 166 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 309 - boundedclassidentifierlist : boundedclassidentifierlist '&' referencetype . (100) +state 411 + constructorbody : '{' explicitconstructorinvocation blockstatements '}' . (100) . reduce 100 -state 310 - paralist : IDENTIFIER '<' paralist . '>' (32) - paralist : paralist . ',' IDENTIFIER (34) - paralist : paralist . ',' IDENTIFIER '<' paralist '>' (35) - paralist : paralist . ',' wildcardparameter (36) +state 412 + constantdeclaration : modifiers type IDENTIFIER '=' expression . ';' (83) - ',' shift 239 - '>' shift 359 + ';' shift 431 . error -state 311 - wildcardparameter : '?' EXTENDS referencetype . (38) +state 413 + forstatement : FOR '(' ';' ';' . expression ')' statement (187) + forstatement : FOR '(' ';' ';' . ')' statement (188) - . reduce 38 - - -state 312 - wildcardparameter : '?' SUPER referencetype . (39) - - . reduce 39 - - -state 313 - paralist : paralist ',' IDENTIFIER . (34) - paralist : paralist ',' IDENTIFIER . '<' paralist '>' (35) - - '<' shift 360 - ',' reduce 34 - '>' reduce 34 - - -state 314 - paralist : paralist ',' wildcardparameter . (36) - - . reduce 36 - - -state 315 - forstatement : FOR '(' ';' . expression ';' expression ')' statement (176) - forstatement : FOR '(' ';' . expression ';' ')' statement (178) - forstatement : FOR '(' ';' . ';' expression ')' statement (179) - forstatement : FOR '(' ';' . ';' ')' statement (180) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 361 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + ')' shift 432 + '+' shift 251 + '-' shift 252 + '!' shift 253 . error - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 362 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 433 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 -state 316 - forstatement : FOR '(' expression . ';' expression ';' expression ')' statement (173) - forstatement : FOR '(' expression . ';' expression ';' ')' statement (174) - forstatement : FOR '(' expression . ';' ';' expression ')' statement (175) - forstatement : FOR '(' expression . ';' ';' ')' statement (177) +state 414 + forstatement : FOR '(' ';' expression . ';' expression ')' statement (184) + forstatement : FOR '(' ';' expression . ';' ')' statement (186) - ';' shift 363 + ';' shift 434 . error -state 317 - ifthenstatement : IF '(' expression . ')' statement (170) - ifthenelsestatement : IF '(' expression . ')' statementnoshortif ELSE statement (171) +state 415 + forstatement : FOR '(' expression ';' . expression ';' expression ')' statement (181) + forstatement : FOR '(' expression ';' . expression ';' ')' statement (182) + forstatement : FOR '(' expression ';' . ';' expression ')' statement (183) + forstatement : FOR '(' expression ';' . ';' ')' statement (185) - ')' shift 364 + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 435 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 436 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 + + +state 416 + ifthenstatement : IF '(' expression ')' . statement (178) + ifthenelsestatement : IF '(' expression ')' . statementnoshortif ELSE statement (179) + + FOR shift 185 + IF shift 437 + RETURN shift 187 + THIS shift 188 + WHILE shift 438 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 439 + statement goto 440 + statementnoshortif goto 441 + whilestatement goto 228 + forstatement goto 229 + whilestatementnoshortif goto 442 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + ifthenelsestatementnoshortif goto 443 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 417 + whilestatement : WHILE '(' expression ')' . statement (180) + + FOR shift 185 + IF shift 186 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + statement goto 444 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 418 + argumentlist : argumentlist ',' . expression (158) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 445 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 + + +state 419 + methodinvocation : name '(' argumentlist ')' . (229) + + . reduce 229 + + +state 420 + methodinvocation : primary '.' IDENTIFIER '(' . ')' (230) + methodinvocation : primary '.' IDENTIFIER '(' . argumentlist ')' (231) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + ')' shift 446 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 374 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + argumentlist goto 447 + methodinvocation goto 276 + castexpression goto 277 + + +state 421 + methodheader : '<' boundedMethodParameters '>' VOID methoddeclarator throws . (125) + + . reduce 125 + + +state 422 + methodheader : '<' boundedMethodParameters '>' type methoddeclarator throws . (116) + + . reduce 116 + + +state 423 + fielddeclaration : '<' boundedMethodParameters '>' type fielddeclarator ';' . (88) + + . reduce 88 + + +state 424 + classinstancecreationexpression : NEW classtype '(' ')' . (232) + + . reduce 232 + + +state 425 + argumentlist : argumentlist . ',' expression (158) + classinstancecreationexpression : NEW classtype '(' argumentlist . ')' (233) + + ',' shift 418 + ')' shift 448 . error -state 318 - returnstatement : RETURN expression ';' . (186) - - . reduce 186 - - -state 319 - whilestatement : WHILE '(' expression . ')' statement (172) - - ')' shift 365 - . error - - -state 320 - lambdaexpressionparameter : '(' formalparameterlist ')' . (207) - - . reduce 207 - - -state 321 - qualifiedname : name '.' IDENTIFIER . (11) - - . reduce 11 - - -state 322 - methodinvocation : name '(' ')' . (220) - - . reduce 220 - - -state 323 - argumentlist : expression . (149) - - . reduce 149 - - -state 324 - argumentlist : argumentlist . ',' expression (150) - methodinvocation : name '(' argumentlist . ')' (221) - - ',' shift 366 - ')' shift 367 - . error - - -state 325 - lambdabody : block . (204) - - . reduce 204 - - -state 326 - lambdaexpression : lambdaexpressionparameter lambdaassignmentoperator lambdabody . (208) - - . reduce 208 - - -state 327 - lambdabody : expression . (205) - - . reduce 205 - - -state 328 - methodinvocation : primary '.' IDENTIFIER . '(' ')' (222) - methodinvocation : primary '.' IDENTIFIER . '(' argumentlist ')' (223) - - '(' shift 368 - . error - - -state 329 - assignment : lefthandside assignmentoperator assignmentexpression . (191) - - . reduce 191 - - -state 330 - assignment : lefthandside assignmentoperator classinstancecreationexpression . (192) - - . reduce 192 - - -state 331 - formalparameterlist : formalparameterlist ',' formalparameter . (134) - - . reduce 134 - - -state 332 - methodheader : '<' boundedMethodParameters '>' VOID methoddeclarator . (115) - methodheader : '<' boundedMethodParameters '>' VOID methoddeclarator . throws (117) - - THROWS shift 88 - '{' reduce 115 - - throws goto 369 - - -state 333 - methodheader : '<' boundedMethodParameters '>' type methoddeclarator . (103) - methodheader : '<' boundedMethodParameters '>' type methoddeclarator . throws (108) - - THROWS shift 88 - '{' reduce 103 - - throws goto 370 - - -state 334 - classtypelist : classtypelist ',' classtype . (138) - - . reduce 138 - - -state 335 - classinstancecreationexpression : NEW classtype '(' . ')' (224) - classinstancecreationexpression : NEW classtype '(' . argumentlist ')' (225) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - ')' shift 371 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 323 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - argumentlist goto 372 - methodinvocation goto 216 - castexpression goto 217 - - -state 336 - castexpression : '(' primitivetype ')' . unaryexpression (257) - - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 246 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 373 - lambdaexpression goto 157 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - methodinvocation goto 216 - castexpression goto 217 - - -state 337 - multiplicativeexpression : multiplicativeexpression '*' unaryexpression . (274) - - . reduce 274 - - -state 338 - multiplicativeexpression : multiplicativeexpression '/' unaryexpression . (275) - - . reduce 275 - - -state 339 - multiplicativeexpression : multiplicativeexpression '%' unaryexpression . (276) - - . reduce 276 - - -340: shift/reduce conflict (shift 283, reduce 271) on '*' -340: shift/reduce conflict (shift 284, reduce 271) on '/' -340: shift/reduce conflict (shift 285, reduce 271) on '%' -state 340 - additiveexpression : additiveexpression '+' multiplicativeexpression . (271) - multiplicativeexpression : multiplicativeexpression . '*' unaryexpression (274) - multiplicativeexpression : multiplicativeexpression . '/' unaryexpression (275) - multiplicativeexpression : multiplicativeexpression . '%' unaryexpression (276) - - '*' shift 283 - '/' shift 284 - '%' shift 285 - ABSTRACT reduce 271 - BOOLEAN reduce 271 - CHAR reduce 271 - FINAL reduce 271 - INSTANCEOF reduce 271 - INT reduce 271 - PRIVATE reduce 271 - PROTECTED reduce 271 - PUBLIC reduce 271 - STATIC reduce 271 - VOID reduce 271 - IDENTIFIER reduce 271 - EQUAL reduce 271 - LESSEQUAL reduce 271 - GREATEREQUAL reduce 271 - NOTEQUAL reduce 271 - LOGICALOR reduce 271 - LOGICALAND reduce 271 - INCREMENT reduce 271 - DECREMENT reduce 271 - ',' reduce 271 - ';' reduce 271 - '.' reduce 271 - '<' reduce 271 - '>' reduce 271 - '}' reduce 271 - ')' reduce 271 - '&' reduce 271 - '+' reduce 271 - '-' reduce 271 - '|' reduce 271 - '^' reduce 271 - - -341: shift/reduce conflict (shift 283, reduce 272) on '*' -341: shift/reduce conflict (shift 284, reduce 272) on '/' -341: shift/reduce conflict (shift 285, reduce 272) on '%' -state 341 - additiveexpression : additiveexpression '-' multiplicativeexpression . (272) - multiplicativeexpression : multiplicativeexpression . '*' unaryexpression (274) - multiplicativeexpression : multiplicativeexpression . '/' unaryexpression (275) - multiplicativeexpression : multiplicativeexpression . '%' unaryexpression (276) - - '*' shift 283 - '/' shift 284 - '%' shift 285 - ABSTRACT reduce 272 - BOOLEAN reduce 272 - CHAR reduce 272 - FINAL reduce 272 - INSTANCEOF reduce 272 - INT reduce 272 - PRIVATE reduce 272 - PROTECTED reduce 272 - PUBLIC reduce 272 - STATIC reduce 272 - VOID reduce 272 - IDENTIFIER reduce 272 - EQUAL reduce 272 - LESSEQUAL reduce 272 - GREATEREQUAL reduce 272 - NOTEQUAL reduce 272 - LOGICALOR reduce 272 - LOGICALAND reduce 272 - INCREMENT reduce 272 - DECREMENT reduce 272 - ',' reduce 272 - ';' reduce 272 - '.' reduce 272 - '<' reduce 272 - '>' reduce 272 - '}' reduce 272 - ')' reduce 272 - '&' reduce 272 - '+' reduce 272 - '-' reduce 272 - '|' reduce 272 - '^' reduce 272 - - -state 342 - relationalexpression : relationalexpression INSTANCEOF referencetype . (268) - - . reduce 268 - - -state 343 - relationalexpression : relationalexpression LESSEQUAL shiftexpression . (266) - - . reduce 266 - - -state 344 - relationalexpression : relationalexpression GREATEREQUAL shiftexpression . (267) - - . reduce 267 - - -state 345 - relationalexpression : relationalexpression '<' shiftexpression . (264) - - . reduce 264 - - -state 346 - relationalexpression : relationalexpression '>' shiftexpression . (265) +state 426 + castexpression : '(' primitivetype ')' unaryexpression . (265) . reduce 265 -347: shift/reduce conflict (shift 288, reduce 261) on INSTANCEOF -347: shift/reduce conflict (shift 289, reduce 261) on LESSEQUAL -347: shift/reduce conflict (shift 290, reduce 261) on GREATEREQUAL -347: shift/reduce conflict (shift 291, reduce 261) on '<' -347: shift/reduce conflict (shift 292, reduce 261) on '>' -state 347 - equalityexpression : equalityexpression EQUAL relationalexpression . (261) - relationalexpression : relationalexpression . '<' shiftexpression (264) - relationalexpression : relationalexpression . '>' shiftexpression (265) - relationalexpression : relationalexpression . LESSEQUAL shiftexpression (266) - relationalexpression : relationalexpression . GREATEREQUAL shiftexpression (267) - relationalexpression : relationalexpression . INSTANCEOF referencetype (268) +state 427 + methodheader : modifiers '<' boundedMethodParameters '>' VOID methoddeclarator . (124) + methodheader : modifiers '<' boundedMethodParameters '>' VOID methoddeclarator . throws (126) - INSTANCEOF shift 288 - LESSEQUAL shift 289 - GREATEREQUAL shift 290 - '<' shift 291 - '>' shift 292 - ABSTRACT reduce 261 - BOOLEAN reduce 261 - CHAR reduce 261 - FINAL reduce 261 - INT reduce 261 - PRIVATE reduce 261 - PROTECTED reduce 261 - PUBLIC reduce 261 - STATIC reduce 261 - VOID reduce 261 - IDENTIFIER reduce 261 - EQUAL reduce 261 - NOTEQUAL reduce 261 - LOGICALOR reduce 261 - LOGICALAND reduce 261 - INCREMENT reduce 261 - DECREMENT reduce 261 - ',' reduce 261 - ';' reduce 261 - '.' reduce 261 - '*' reduce 261 - '}' reduce 261 - ')' reduce 261 - '&' reduce 261 - '+' reduce 261 - '-' reduce 261 - '|' reduce 261 - '^' reduce 261 - '/' reduce 261 - '%' reduce 261 + THROWS shift 148 + ';' reduce 124 + '{' reduce 124 + + throws goto 449 -348: shift/reduce conflict (shift 288, reduce 262) on INSTANCEOF -348: shift/reduce conflict (shift 289, reduce 262) on LESSEQUAL -348: shift/reduce conflict (shift 290, reduce 262) on GREATEREQUAL -348: shift/reduce conflict (shift 291, reduce 262) on '<' -348: shift/reduce conflict (shift 292, reduce 262) on '>' -state 348 - equalityexpression : equalityexpression NOTEQUAL relationalexpression . (262) - relationalexpression : relationalexpression . '<' shiftexpression (264) - relationalexpression : relationalexpression . '>' shiftexpression (265) - relationalexpression : relationalexpression . LESSEQUAL shiftexpression (266) - relationalexpression : relationalexpression . GREATEREQUAL shiftexpression (267) - relationalexpression : relationalexpression . INSTANCEOF referencetype (268) +state 428 + methodheader : modifiers '<' boundedMethodParameters '>' type methoddeclarator . (114) + methodheader : modifiers '<' boundedMethodParameters '>' type methoddeclarator . throws (118) - INSTANCEOF shift 288 - LESSEQUAL shift 289 - GREATEREQUAL shift 290 - '<' shift 291 - '>' shift 292 - ABSTRACT reduce 262 - BOOLEAN reduce 262 - CHAR reduce 262 - FINAL reduce 262 - INT reduce 262 - PRIVATE reduce 262 - PROTECTED reduce 262 - PUBLIC reduce 262 - STATIC reduce 262 - VOID reduce 262 - IDENTIFIER reduce 262 - EQUAL reduce 262 - NOTEQUAL reduce 262 - LOGICALOR reduce 262 - LOGICALAND reduce 262 - INCREMENT reduce 262 - DECREMENT reduce 262 - ',' reduce 262 - ';' reduce 262 - '.' reduce 262 - '*' reduce 262 - '}' reduce 262 - ')' reduce 262 - '&' reduce 262 - '+' reduce 262 - '-' reduce 262 - '|' reduce 262 - '^' reduce 262 - '/' reduce 262 - '%' reduce 262 + THROWS shift 148 + ';' reduce 114 + '{' reduce 114 + + throws goto 450 -349: shift/reduce conflict (shift 293, reduce 259) on EQUAL -349: shift/reduce conflict (shift 294, reduce 259) on NOTEQUAL -state 349 - andexpression : andexpression '&' equalityexpression . (259) - equalityexpression : equalityexpression . EQUAL relationalexpression (261) - equalityexpression : equalityexpression . NOTEQUAL relationalexpression (262) +state 429 + explicitconstructorinvocation : THIS '(' ')' ';' . (143) - EQUAL shift 293 - NOTEQUAL shift 294 - ABSTRACT reduce 259 - BOOLEAN reduce 259 - CHAR reduce 259 - FINAL reduce 259 - INSTANCEOF reduce 259 - INT reduce 259 - PRIVATE reduce 259 - PROTECTED reduce 259 - PUBLIC reduce 259 - STATIC reduce 259 - VOID reduce 259 - IDENTIFIER reduce 259 - LESSEQUAL reduce 259 - GREATEREQUAL reduce 259 - LOGICALOR reduce 259 - LOGICALAND reduce 259 - INCREMENT reduce 259 - DECREMENT reduce 259 - ',' reduce 259 - ';' reduce 259 - '.' reduce 259 - '*' reduce 259 - '<' reduce 259 - '>' reduce 259 - '}' reduce 259 - ')' reduce 259 - '&' reduce 259 - '+' reduce 259 - '-' reduce 259 - '|' reduce 259 - '^' reduce 259 - '/' reduce 259 - '%' reduce 259 + . reduce 143 -350: shift/reduce conflict (shift 295, reduce 248) on '&' -state 350 - exclusiveorexpression : exclusiveorexpression '^' andexpression . (248) - andexpression : andexpression . '&' equalityexpression (259) +state 430 + explicitconstructorinvocation : THIS '(' argumentlist ')' . ';' (144) - '&' shift 295 - ABSTRACT reduce 248 - BOOLEAN reduce 248 - CHAR reduce 248 - FINAL reduce 248 - INSTANCEOF reduce 248 - INT reduce 248 - PRIVATE reduce 248 - PROTECTED reduce 248 - PUBLIC reduce 248 - STATIC reduce 248 - VOID reduce 248 - IDENTIFIER reduce 248 - EQUAL reduce 248 - LESSEQUAL reduce 248 - GREATEREQUAL reduce 248 - NOTEQUAL reduce 248 - LOGICALOR reduce 248 - LOGICALAND reduce 248 - INCREMENT reduce 248 - DECREMENT reduce 248 - ',' reduce 248 - ';' reduce 248 - '.' reduce 248 - '*' reduce 248 - '<' reduce 248 - '>' reduce 248 - '}' reduce 248 - ')' reduce 248 - '+' reduce 248 - '-' reduce 248 - '|' reduce 248 - '^' reduce 248 - '/' reduce 248 - '%' reduce 248 - - -351: shift/reduce conflict (shift 296, reduce 239) on '^' -state 351 - inclusiveorexpression : inclusiveorexpression '|' exclusiveorexpression . (239) - exclusiveorexpression : exclusiveorexpression . '^' andexpression (248) - - '^' shift 296 - ABSTRACT reduce 239 - BOOLEAN reduce 239 - CHAR reduce 239 - FINAL reduce 239 - INSTANCEOF reduce 239 - INT reduce 239 - PRIVATE reduce 239 - PROTECTED reduce 239 - PUBLIC reduce 239 - STATIC reduce 239 - VOID reduce 239 - IDENTIFIER reduce 239 - EQUAL reduce 239 - LESSEQUAL reduce 239 - GREATEREQUAL reduce 239 - NOTEQUAL reduce 239 - LOGICALOR reduce 239 - LOGICALAND reduce 239 - INCREMENT reduce 239 - DECREMENT reduce 239 - ',' reduce 239 - ';' reduce 239 - '.' reduce 239 - '*' reduce 239 - '<' reduce 239 - '>' reduce 239 - '}' reduce 239 - ')' reduce 239 - '&' reduce 239 - '+' reduce 239 - '-' reduce 239 - '|' reduce 239 - '/' reduce 239 - '%' reduce 239 - - -352: shift/reduce conflict (shift 297, reduce 227) on '|' -state 352 - conditionalandexpression : conditionalandexpression LOGICALAND inclusiveorexpression . (227) - inclusiveorexpression : inclusiveorexpression . '|' exclusiveorexpression (239) - - '|' shift 297 - ABSTRACT reduce 227 - BOOLEAN reduce 227 - CHAR reduce 227 - FINAL reduce 227 - INSTANCEOF reduce 227 - INT reduce 227 - PRIVATE reduce 227 - PROTECTED reduce 227 - PUBLIC reduce 227 - STATIC reduce 227 - VOID reduce 227 - IDENTIFIER reduce 227 - EQUAL reduce 227 - LESSEQUAL reduce 227 - GREATEREQUAL reduce 227 - NOTEQUAL reduce 227 - LOGICALOR reduce 227 - LOGICALAND reduce 227 - INCREMENT reduce 227 - DECREMENT reduce 227 - ',' reduce 227 - ';' reduce 227 - '.' reduce 227 - '*' reduce 227 - '<' reduce 227 - '>' reduce 227 - '}' reduce 227 - ')' reduce 227 - '&' reduce 227 - '+' reduce 227 - '-' reduce 227 - '^' reduce 227 - '/' reduce 227 - '%' reduce 227 - - -353: shift/reduce conflict (shift 298, reduce 202) on LOGICALAND -state 353 - conditionalorexpression : conditionalorexpression LOGICALOR conditionalandexpression . (202) - conditionalandexpression : conditionalandexpression . LOGICALAND inclusiveorexpression (227) - - LOGICALAND shift 298 - ABSTRACT reduce 202 - BOOLEAN reduce 202 - CHAR reduce 202 - FINAL reduce 202 - INSTANCEOF reduce 202 - INT reduce 202 - PRIVATE reduce 202 - PROTECTED reduce 202 - PUBLIC reduce 202 - STATIC reduce 202 - VOID reduce 202 - IDENTIFIER reduce 202 - EQUAL reduce 202 - LESSEQUAL reduce 202 - GREATEREQUAL reduce 202 - NOTEQUAL reduce 202 - LOGICALOR reduce 202 - INCREMENT reduce 202 - DECREMENT reduce 202 - ',' reduce 202 - ';' reduce 202 - '.' reduce 202 - '*' reduce 202 - '<' reduce 202 - '>' reduce 202 - '}' reduce 202 - ')' reduce 202 - '&' reduce 202 - '+' reduce 202 - '-' reduce 202 - '|' reduce 202 - '^' reduce 202 - '/' reduce 202 - '%' reduce 202 - - -state 354 - methodheader : modifiers '<' boundedMethodParameters '>' VOID . methoddeclarator (116) - methodheader : modifiers '<' boundedMethodParameters '>' VOID . methoddeclarator throws (118) - - IDENTIFIER shift 81 - . error - - methoddeclarator goto 374 - - -state 355 - methodheader : modifiers '<' boundedMethodParameters '>' type . methoddeclarator (106) - methodheader : modifiers '<' boundedMethodParameters '>' type . methoddeclarator throws (110) - - IDENTIFIER shift 81 - . error - - methoddeclarator goto 375 - - -state 356 - explicitconstructorinvocation : THIS '(' ')' . ';' (135) - - ';' shift 376 + ';' shift 451 . error -state 357 - explicitconstructorinvocation : THIS '(' argumentlist . ')' ';' (136) - argumentlist : argumentlist . ',' expression (150) +state 431 + constantdeclaration : modifiers type IDENTIFIER '=' expression ';' . (83) - ',' shift 366 - ')' shift 377 + . reduce 83 + + +state 432 + forstatement : FOR '(' ';' ';' ')' . statement (188) + + FOR shift 185 + IF shift 186 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + statement goto 452 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 433 + forstatement : FOR '(' ';' ';' expression . ')' statement (187) + + ')' shift 453 . error -state 358 - constructorbody : '{' explicitconstructorinvocation blockstatements '}' . (92) +state 434 + forstatement : FOR '(' ';' expression ';' . expression ')' statement (184) + forstatement : FOR '(' ';' expression ';' . ')' statement (186) - . reduce 92 - - -state 359 - paralist : IDENTIFIER '<' paralist '>' . (32) - - . reduce 32 - - -state 360 - paralist : paralist ',' IDENTIFIER '<' . paralist '>' (35) - - IDENTIFIER shift 119 - '?' shift 120 + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + ')' shift 454 + '+' shift 251 + '-' shift 252 + '!' shift 253 . error - paralist goto 378 - wildcardparameter goto 122 + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 455 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 -state 361 - forstatement : FOR '(' ';' ';' . expression ')' statement (179) - forstatement : FOR '(' ';' ';' . ')' statement (180) +state 435 + forstatement : FOR '(' expression ';' ';' . expression ')' statement (183) + forstatement : FOR '(' expression ';' ';' . ')' statement (185) - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - ')' shift 379 - '+' shift 190 - '-' shift 191 - '!' shift 192 + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + ')' shift 456 + '+' shift 251 + '-' shift 252 + '!' shift 253 . error - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 380 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 457 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 -state 362 - forstatement : FOR '(' ';' expression . ';' expression ')' statement (176) - forstatement : FOR '(' ';' expression . ';' ')' statement (178) +state 436 + forstatement : FOR '(' expression ';' expression . ';' expression ')' statement (181) + forstatement : FOR '(' expression ';' expression . ';' ')' statement (182) - ';' shift 381 + ';' shift 458 . error -state 363 - forstatement : FOR '(' expression ';' . expression ';' expression ')' statement (173) - forstatement : FOR '(' expression ';' . expression ';' ')' statement (174) - forstatement : FOR '(' expression ';' . ';' expression ')' statement (175) - forstatement : FOR '(' expression ';' . ';' ')' statement (177) +state 437 + ifthenstatement : IF . '(' expression ')' statement (178) + ifthenelsestatement : IF . '(' expression ')' statementnoshortif ELSE statement (179) + ifthenelsestatementnoshortif : IF . '(' expression ')' statementnoshortif ELSE statementnoshortif (207) - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 382 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 383 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 - - -state 364 - ifthenstatement : IF '(' expression ')' . statement (170) - ifthenelsestatement : IF '(' expression ')' . statementnoshortif ELSE statement (171) - - FOR shift 123 - IF shift 384 - RETURN shift 125 - THIS shift 126 - WHILE shift 385 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 386 - statement goto 387 - statementnoshortif goto 388 - whilestatement goto 167 - forstatement goto 168 - whilestatementnoshortif goto 389 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - ifthenelsestatementnoshortif goto 390 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 365 - whilestatement : WHILE '(' expression ')' . statement (172) - - FOR shift 123 - IF shift 124 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - statement goto 391 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 366 - argumentlist : argumentlist ',' . expression (150) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 392 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 - - -state 367 - methodinvocation : name '(' argumentlist ')' . (221) - - . reduce 221 - - -state 368 - methodinvocation : primary '.' IDENTIFIER '(' . ')' (222) - methodinvocation : primary '.' IDENTIFIER '(' . argumentlist ')' (223) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - ')' shift 393 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 323 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - argumentlist goto 394 - methodinvocation goto 216 - castexpression goto 217 - - -state 369 - methodheader : '<' boundedMethodParameters '>' VOID methoddeclarator throws . (117) - - . reduce 117 - - -state 370 - methodheader : '<' boundedMethodParameters '>' type methoddeclarator throws . (108) - - . reduce 108 - - -state 371 - classinstancecreationexpression : NEW classtype '(' ')' . (224) - - . reduce 224 - - -state 372 - argumentlist : argumentlist . ',' expression (150) - classinstancecreationexpression : NEW classtype '(' argumentlist . ')' (225) - - ',' shift 366 - ')' shift 395 + '(' shift 459 . error -state 373 - castexpression : '(' primitivetype ')' unaryexpression . (257) +state 438 + whilestatement : WHILE . '(' expression ')' statement (180) + whilestatementnoshortif : WHILE . '(' expression ')' statementnoshortif (208) - . reduce 257 - - -state 374 - methodheader : modifiers '<' boundedMethodParameters '>' VOID methoddeclarator . (116) - methodheader : modifiers '<' boundedMethodParameters '>' VOID methoddeclarator . throws (118) - - THROWS shift 88 - '{' reduce 116 - - throws goto 396 - - -state 375 - methodheader : modifiers '<' boundedMethodParameters '>' type methoddeclarator . (106) - methodheader : modifiers '<' boundedMethodParameters '>' type methoddeclarator . throws (110) - - THROWS shift 88 - '{' reduce 106 - - throws goto 397 - - -state 376 - explicitconstructorinvocation : THIS '(' ')' ';' . (135) - - . reduce 135 - - -state 377 - explicitconstructorinvocation : THIS '(' argumentlist ')' . ';' (136) - - ';' shift 398 + '(' shift 460 . error -state 378 - paralist : paralist . ',' IDENTIFIER (34) - paralist : paralist . ',' IDENTIFIER '<' paralist '>' (35) - paralist : paralist ',' IDENTIFIER '<' paralist . '>' (35) - paralist : paralist . ',' wildcardparameter (36) - - ',' shift 239 - '>' shift 399 - . error - - -state 379 - forstatement : FOR '(' ';' ';' ')' . statement (180) - - FOR shift 123 - IF shift 124 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - statement goto 400 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 380 - forstatement : FOR '(' ';' ';' expression . ')' statement (179) - - ')' shift 401 - . error - - -state 381 - forstatement : FOR '(' ';' expression ';' . expression ')' statement (176) - forstatement : FOR '(' ';' expression ';' . ')' statement (178) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - ')' shift 402 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 403 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 - - -state 382 - forstatement : FOR '(' expression ';' ';' . expression ')' statement (175) - forstatement : FOR '(' expression ';' ';' . ')' statement (177) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - ')' shift 404 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 405 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 - - -state 383 - forstatement : FOR '(' expression ';' expression . ';' expression ')' statement (173) - forstatement : FOR '(' expression ';' expression . ';' ')' statement (174) - - ';' shift 406 - . error - - -state 384 - ifthenstatement : IF . '(' expression ')' statement (170) - ifthenelsestatement : IF . '(' expression ')' statementnoshortif ELSE statement (171) - ifthenelsestatementnoshortif : IF . '(' expression ')' statementnoshortif ELSE statementnoshortif (199) - - '(' shift 407 - . error - - -state 385 - whilestatement : WHILE . '(' expression ')' statement (172) - whilestatementnoshortif : WHILE . '(' expression ')' statementnoshortif (200) - - '(' shift 408 - . error - - -state 386 - statement : statementwithouttrailingsubstatement . (155) - statementnoshortif : statementwithouttrailingsubstatement . (187) - - BOOLEAN reduce 155 - CHAR reduce 155 - ELSE reduce 187 - FOR reduce 155 - IF reduce 155 - INT reduce 155 - RETURN reduce 155 - THIS reduce 155 - WHILE reduce 155 - INTLITERAL reduce 155 - LONGLITERAL reduce 155 - DOUBLELITERAL reduce 155 - FLOATLITERAL reduce 155 - BOOLLITERAL reduce 155 - JNULL reduce 155 - CHARLITERAL reduce 155 - STRINGLITERAL reduce 155 - IDENTIFIER reduce 155 - INCREMENT reduce 155 - DECREMENT reduce 155 - ';' reduce 155 - '{' reduce 155 - '}' reduce 155 - '(' reduce 155 - - -state 387 - ifthenstatement : IF '(' expression ')' statement . (170) - - . reduce 170 - - -state 388 - ifthenelsestatement : IF '(' expression ')' statementnoshortif . ELSE statement (171) - - ELSE shift 409 - . error - - -state 389 - statementnoshortif : whilestatementnoshortif . (189) - - . reduce 189 - - -state 390 - statementnoshortif : ifthenelsestatementnoshortif . (188) - - . reduce 188 - - -state 391 - whilestatement : WHILE '(' expression ')' statement . (172) - - . reduce 172 - - -state 392 - argumentlist : argumentlist ',' expression . (150) - - . reduce 150 - - -state 393 - methodinvocation : primary '.' IDENTIFIER '(' ')' . (222) - - . reduce 222 - - -state 394 - argumentlist : argumentlist . ',' expression (150) - methodinvocation : primary '.' IDENTIFIER '(' argumentlist . ')' (223) - - ',' shift 366 - ')' shift 410 - . error - - -state 395 - classinstancecreationexpression : NEW classtype '(' argumentlist ')' . (225) - - . reduce 225 - - -state 396 - methodheader : modifiers '<' boundedMethodParameters '>' VOID methoddeclarator throws . (118) - - . reduce 118 - - -state 397 - methodheader : modifiers '<' boundedMethodParameters '>' type methoddeclarator throws . (110) - - . reduce 110 - - -state 398 - explicitconstructorinvocation : THIS '(' argumentlist ')' ';' . (136) - - . reduce 136 - - -state 399 - paralist : paralist ',' IDENTIFIER '<' paralist '>' . (35) - - . reduce 35 - - -state 400 - forstatement : FOR '(' ';' ';' ')' statement . (180) - - . reduce 180 - - -state 401 - forstatement : FOR '(' ';' ';' expression ')' . statement (179) - - FOR shift 123 - IF shift 124 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - statement goto 411 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 402 - forstatement : FOR '(' ';' expression ';' ')' . statement (178) - - FOR shift 123 - IF shift 124 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - statement goto 412 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 403 - forstatement : FOR '(' ';' expression ';' expression . ')' statement (176) - - ')' shift 413 - . error - - -state 404 - forstatement : FOR '(' expression ';' ';' ')' . statement (177) - - FOR shift 123 - IF shift 124 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - statement goto 414 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 405 - forstatement : FOR '(' expression ';' ';' expression . ')' statement (175) - - ')' shift 415 - . error - - -state 406 - forstatement : FOR '(' expression ';' expression ';' . expression ')' statement (173) - forstatement : FOR '(' expression ';' expression ';' . ')' statement (174) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - ')' shift 416 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 417 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 - - -state 407 - ifthenstatement : IF '(' . expression ')' statement (170) - ifthenelsestatement : IF '(' . expression ')' statementnoshortif ELSE statement (171) - ifthenelsestatementnoshortif : IF '(' . expression ')' statementnoshortif ELSE statementnoshortif (199) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 418 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 - - -state 408 - whilestatement : WHILE '(' . expression ')' statement (172) - whilestatementnoshortif : WHILE '(' . expression ')' statementnoshortif (200) - - NEW shift 188 - THIS shift 126 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - '(' shift 189 - '+' shift 190 - '-' shift 191 - '!' shift 192 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 194 - unaryexpressionnotplusminus goto 195 - unaryexpression goto 196 - multiplicativeexpression goto 197 - additiveexpression goto 198 - shiftexpression goto 199 - relationalexpression goto 200 - equalityexpression goto 201 - andexpression goto 202 - exclusiveorexpression goto 203 - inclusiveorexpression goto 204 - conditionalandexpression goto 205 - conditionalorexpression goto 206 - conditionalexpression goto 207 - assignmentexpression goto 208 - lambdaexpression goto 157 - expression goto 419 - preincrementexpression goto 210 - predecrementexpression goto 211 - postincrementexpression goto 212 - postdecrementexpression goto 213 - classinstancecreationexpression goto 214 - assignment goto 215 - lefthandside goto 174 - methodinvocation goto 216 - castexpression goto 217 - - -state 409 - ifthenelsestatement : IF '(' expression ')' statementnoshortif ELSE . statement (171) - - FOR shift 123 - IF shift 124 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - statement goto 420 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 410 - methodinvocation : primary '.' IDENTIFIER '(' argumentlist ')' . (223) - - . reduce 223 - - -state 411 - forstatement : FOR '(' ';' ';' expression ')' statement . (179) - - . reduce 179 - - -state 412 - forstatement : FOR '(' ';' expression ';' ')' statement . (178) +state 439 + statement : statementwithouttrailingsubstatement . (163) + statementnoshortif : statementwithouttrailingsubstatement . (195) + + BOOLEAN reduce 163 + CHAR reduce 163 + ELSE reduce 195 + FOR reduce 163 + IF reduce 163 + INT reduce 163 + RETURN reduce 163 + THIS reduce 163 + WHILE reduce 163 + INTLITERAL reduce 163 + LONGLITERAL reduce 163 + DOUBLELITERAL reduce 163 + FLOATLITERAL reduce 163 + BOOLLITERAL reduce 163 + JNULL reduce 163 + CHARLITERAL reduce 163 + STRINGLITERAL reduce 163 + IDENTIFIER reduce 163 + INCREMENT reduce 163 + DECREMENT reduce 163 + ';' reduce 163 + '{' reduce 163 + '}' reduce 163 + '(' reduce 163 + + +state 440 + ifthenstatement : IF '(' expression ')' statement . (178) . reduce 178 -state 413 - forstatement : FOR '(' ';' expression ';' expression ')' . statement (176) +state 441 + ifthenelsestatement : IF '(' expression ')' statementnoshortif . ELSE statement (179) - FOR shift 123 - IF shift 124 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - statement goto 421 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 414 - forstatement : FOR '(' expression ';' ';' ')' statement . (177) - - . reduce 177 - - -state 415 - forstatement : FOR '(' expression ';' ';' expression ')' . statement (175) - - FOR shift 123 - IF shift 124 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - statement goto 422 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 416 - forstatement : FOR '(' expression ';' expression ';' ')' . statement (174) - - FOR shift 123 - IF shift 124 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - statement goto 423 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 417 - forstatement : FOR '(' expression ';' expression ';' expression . ')' statement (173) - - ')' shift 424 + ELSE shift 461 . error -state 418 - ifthenstatement : IF '(' expression . ')' statement (170) - ifthenelsestatement : IF '(' expression . ')' statementnoshortif ELSE statement (171) - ifthenelsestatementnoshortif : IF '(' expression . ')' statementnoshortif ELSE statementnoshortif (199) +state 442 + statementnoshortif : whilestatementnoshortif . (197) - ')' shift 425 + . reduce 197 + + +state 443 + statementnoshortif : ifthenelsestatementnoshortif . (196) + + . reduce 196 + + +state 444 + whilestatement : WHILE '(' expression ')' statement . (180) + + . reduce 180 + + +state 445 + argumentlist : argumentlist ',' expression . (158) + + . reduce 158 + + +state 446 + methodinvocation : primary '.' IDENTIFIER '(' ')' . (230) + + . reduce 230 + + +state 447 + argumentlist : argumentlist . ',' expression (158) + methodinvocation : primary '.' IDENTIFIER '(' argumentlist . ')' (231) + + ',' shift 418 + ')' shift 462 . error -state 419 - whilestatement : WHILE '(' expression . ')' statement (172) - whilestatementnoshortif : WHILE '(' expression . ')' statementnoshortif (200) +state 448 + classinstancecreationexpression : NEW classtype '(' argumentlist ')' . (233) - ')' shift 426 + . reduce 233 + + +state 449 + methodheader : modifiers '<' boundedMethodParameters '>' VOID methoddeclarator throws . (126) + + . reduce 126 + + +state 450 + methodheader : modifiers '<' boundedMethodParameters '>' type methoddeclarator throws . (118) + + . reduce 118 + + +state 451 + explicitconstructorinvocation : THIS '(' argumentlist ')' ';' . (144) + + . reduce 144 + + +state 452 + forstatement : FOR '(' ';' ';' ')' statement . (188) + + . reduce 188 + + +state 453 + forstatement : FOR '(' ';' ';' expression ')' . statement (187) + + FOR shift 185 + IF shift 186 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + statement goto 463 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 454 + forstatement : FOR '(' ';' expression ';' ')' . statement (186) + + FOR shift 185 + IF shift 186 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + statement goto 464 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 455 + forstatement : FOR '(' ';' expression ';' expression . ')' statement (184) + + ')' shift 465 . error -state 420 - ifthenelsestatement : IF '(' expression ')' statementnoshortif ELSE statement . (171) +state 456 + forstatement : FOR '(' expression ';' ';' ')' . statement (185) - . reduce 171 - - -state 421 - forstatement : FOR '(' ';' expression ';' expression ')' statement . (176) - - . reduce 176 - - -state 422 - forstatement : FOR '(' expression ';' ';' expression ')' statement . (175) - - . reduce 175 - - -state 423 - forstatement : FOR '(' expression ';' expression ';' ')' statement . (174) - - . reduce 174 - - -state 424 - forstatement : FOR '(' expression ';' expression ';' expression ')' . statement (173) - - FOR shift 123 - IF shift 124 - RETURN shift 125 - THIS shift 126 - WHILE shift 127 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 + FOR shift 185 + IF shift 186 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 . error - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 164 - statement goto 427 - whilestatement goto 167 - forstatement goto 168 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + statement goto 466 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 -state 425 - ifthenstatement : IF '(' expression ')' . statement (170) - ifthenelsestatement : IF '(' expression ')' . statementnoshortif ELSE statement (171) - ifthenelsestatementnoshortif : IF '(' expression ')' . statementnoshortif ELSE statementnoshortif (199) +state 457 + forstatement : FOR '(' expression ';' ';' expression . ')' statement (183) - FOR shift 123 - IF shift 384 - RETURN shift 125 - THIS shift 126 - WHILE shift 385 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 386 - statement goto 387 - statementnoshortif goto 428 - whilestatement goto 167 - forstatement goto 168 - whilestatementnoshortif goto 389 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - ifthenelsestatementnoshortif goto 390 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 426 - whilestatement : WHILE '(' expression ')' . statement (172) - whilestatementnoshortif : WHILE '(' expression ')' . statementnoshortif (200) - - FOR shift 123 - IF shift 384 - RETURN shift 125 - THIS shift 126 - WHILE shift 385 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 - . error - - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 386 - statement goto 391 - statementnoshortif goto 429 - whilestatement goto 167 - forstatement goto 168 - whilestatementnoshortif goto 389 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - ifthenelsestatementnoshortif goto 390 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 - - -state 427 - forstatement : FOR '(' expression ';' expression ';' expression ')' statement . (173) - - . reduce 173 - - -state 428 - ifthenelsestatement : IF '(' expression ')' statementnoshortif . ELSE statement (171) - ifthenelsestatementnoshortif : IF '(' expression ')' statementnoshortif . ELSE statementnoshortif (199) - - ELSE shift 430 + ')' shift 467 . error -state 429 - whilestatementnoshortif : WHILE '(' expression ')' statementnoshortif . (200) +state 458 + forstatement : FOR '(' expression ';' expression ';' . expression ')' statement (181) + forstatement : FOR '(' expression ';' expression ';' . ')' statement (182) - . reduce 200 - - -state 430 - ifthenelsestatement : IF '(' expression ')' statementnoshortif ELSE . statement (171) - ifthenelsestatementnoshortif : IF '(' expression ')' statementnoshortif ELSE . statementnoshortif (199) - - FOR shift 123 - IF shift 384 - RETURN shift 125 - THIS shift 126 - WHILE shift 385 - INTLITERAL shift 128 - LONGLITERAL shift 129 - DOUBLELITERAL shift 130 - FLOATLITERAL shift 131 - BOOLLITERAL shift 132 - JNULL shift 133 - CHARLITERAL shift 134 - STRINGLITERAL shift 135 - IDENTIFIER shift 31 - INCREMENT shift 137 - DECREMENT shift 138 - ';' shift 139 - '{' shift 79 - '(' shift 141 + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + ')' shift 468 + '+' shift 251 + '-' shift 252 + '!' shift 253 . error - simplename goto 193 - qualifiedname goto 145 - name goto 146 - block goto 148 - lambdaexpressionparameter goto 152 - literal goto 153 - primarynonewarray goto 154 - primary goto 155 - postfixexpression goto 156 - lambdaexpression goto 157 - statementexpression goto 158 - preincrementexpression goto 159 - predecrementexpression goto 160 - postincrementexpression goto 161 - postdecrementexpression goto 162 - expressionstatement goto 163 - statementwithouttrailingsubstatement goto 386 - statement goto 420 - statementnoshortif goto 431 - whilestatement goto 167 - forstatement goto 168 - whilestatementnoshortif goto 389 - ifthenstatement goto 169 - ifthenelsestatement goto 170 - ifthenelsestatementnoshortif goto 390 - emptystatement goto 171 - returnstatement goto 172 - assignment goto 173 - lefthandside goto 174 - methodinvocation goto 175 + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 469 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 -state 431 - ifthenelsestatementnoshortif : IF '(' expression ')' statementnoshortif ELSE statementnoshortif . (199) +state 459 + ifthenstatement : IF '(' . expression ')' statement (178) + ifthenelsestatement : IF '(' . expression ')' statementnoshortif ELSE statement (179) + ifthenelsestatementnoshortif : IF '(' . expression ')' statementnoshortif ELSE statementnoshortif (207) - . reduce 199 + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 470 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 + + +state 460 + whilestatement : WHILE '(' . expression ')' statement (180) + whilestatementnoshortif : WHILE '(' . expression ')' statementnoshortif (208) + + NEW shift 249 + THIS shift 188 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + '(' shift 250 + '+' shift 251 + '-' shift 252 + '!' shift 253 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 254 + unaryexpressionnotplusminus goto 255 + unaryexpression goto 256 + multiplicativeexpression goto 257 + additiveexpression goto 258 + shiftexpression goto 259 + relationalexpression goto 260 + equalityexpression goto 261 + andexpression goto 262 + exclusiveorexpression goto 263 + inclusiveorexpression goto 264 + conditionalandexpression goto 265 + conditionalorexpression goto 266 + conditionalexpression goto 267 + assignmentexpression goto 268 + lambdaexpression goto 218 + expression goto 471 + preincrementexpression goto 270 + predecrementexpression goto 271 + postincrementexpression goto 272 + postdecrementexpression goto 273 + classinstancecreationexpression goto 274 + assignment goto 275 + lefthandside goto 235 + methodinvocation goto 276 + castexpression goto 277 + + +state 461 + ifthenelsestatement : IF '(' expression ')' statementnoshortif ELSE . statement (179) + + FOR shift 185 + IF shift 186 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + statement goto 472 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 462 + methodinvocation : primary '.' IDENTIFIER '(' argumentlist ')' . (231) + + . reduce 231 + + +state 463 + forstatement : FOR '(' ';' ';' expression ')' statement . (187) + + . reduce 187 + + +state 464 + forstatement : FOR '(' ';' expression ';' ')' statement . (186) + + . reduce 186 + + +state 465 + forstatement : FOR '(' ';' expression ';' expression ')' . statement (184) + + FOR shift 185 + IF shift 186 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + statement goto 473 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 466 + forstatement : FOR '(' expression ';' ';' ')' statement . (185) + + . reduce 185 + + +state 467 + forstatement : FOR '(' expression ';' ';' expression ')' . statement (183) + + FOR shift 185 + IF shift 186 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + statement goto 474 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 468 + forstatement : FOR '(' expression ';' expression ';' ')' . statement (182) + + FOR shift 185 + IF shift 186 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + statement goto 475 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 469 + forstatement : FOR '(' expression ';' expression ';' expression . ')' statement (181) + + ')' shift 476 + . error + + +state 470 + ifthenstatement : IF '(' expression . ')' statement (178) + ifthenelsestatement : IF '(' expression . ')' statementnoshortif ELSE statement (179) + ifthenelsestatementnoshortif : IF '(' expression . ')' statementnoshortif ELSE statementnoshortif (207) + + ')' shift 477 + . error + + +state 471 + whilestatement : WHILE '(' expression . ')' statement (180) + whilestatementnoshortif : WHILE '(' expression . ')' statementnoshortif (208) + + ')' shift 478 + . error + + +state 472 + ifthenelsestatement : IF '(' expression ')' statementnoshortif ELSE statement . (179) + + . reduce 179 + + +state 473 + forstatement : FOR '(' ';' expression ';' expression ')' statement . (184) + + . reduce 184 + + +state 474 + forstatement : FOR '(' expression ';' ';' expression ')' statement . (183) + + . reduce 183 + + +state 475 + forstatement : FOR '(' expression ';' expression ';' ')' statement . (182) + + . reduce 182 + + +state 476 + forstatement : FOR '(' expression ';' expression ';' expression ')' . statement (181) + + FOR shift 185 + IF shift 186 + RETURN shift 187 + THIS shift 188 + WHILE shift 189 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 225 + statement goto 479 + whilestatement goto 228 + forstatement goto 229 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 477 + ifthenstatement : IF '(' expression ')' . statement (178) + ifthenelsestatement : IF '(' expression ')' . statementnoshortif ELSE statement (179) + ifthenelsestatementnoshortif : IF '(' expression ')' . statementnoshortif ELSE statementnoshortif (207) + + FOR shift 185 + IF shift 437 + RETURN shift 187 + THIS shift 188 + WHILE shift 438 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 439 + statement goto 440 + statementnoshortif goto 480 + whilestatement goto 228 + forstatement goto 229 + whilestatementnoshortif goto 442 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + ifthenelsestatementnoshortif goto 443 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 478 + whilestatement : WHILE '(' expression ')' . statement (180) + whilestatementnoshortif : WHILE '(' expression ')' . statementnoshortif (208) + + FOR shift 185 + IF shift 437 + RETURN shift 187 + THIS shift 188 + WHILE shift 438 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 439 + statement goto 444 + statementnoshortif goto 481 + whilestatement goto 228 + forstatement goto 229 + whilestatementnoshortif goto 442 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + ifthenelsestatementnoshortif goto 443 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 479 + forstatement : FOR '(' expression ';' expression ';' expression ')' statement . (181) + + . reduce 181 + + +state 480 + ifthenelsestatement : IF '(' expression ')' statementnoshortif . ELSE statement (179) + ifthenelsestatementnoshortif : IF '(' expression ')' statementnoshortif . ELSE statementnoshortif (207) + + ELSE shift 482 + . error + + +state 481 + whilestatementnoshortif : WHILE '(' expression ')' statementnoshortif . (208) + + . reduce 208 + + +state 482 + ifthenelsestatement : IF '(' expression ')' statementnoshortif ELSE . statement (179) + ifthenelsestatementnoshortif : IF '(' expression ')' statementnoshortif ELSE . statementnoshortif (207) + + FOR shift 185 + IF shift 437 + RETURN shift 187 + THIS shift 188 + WHILE shift 438 + INTLITERAL shift 190 + LONGLITERAL shift 191 + DOUBLELITERAL shift 192 + FLOATLITERAL shift 193 + BOOLLITERAL shift 194 + JNULL shift 195 + CHARLITERAL shift 196 + STRINGLITERAL shift 197 + IDENTIFIER shift 14 + INCREMENT shift 199 + DECREMENT shift 200 + ';' shift 201 + '{' shift 139 + '(' shift 203 + . error + + simplename goto 34 + qualifiedname goto 35 + name goto 207 + block goto 209 + lambdaexpressionparameter goto 213 + literal goto 214 + primarynonewarray goto 215 + primary goto 216 + postfixexpression goto 217 + lambdaexpression goto 218 + statementexpression goto 219 + preincrementexpression goto 220 + predecrementexpression goto 221 + postincrementexpression goto 222 + postdecrementexpression goto 223 + expressionstatement goto 224 + statementwithouttrailingsubstatement goto 439 + statement goto 472 + statementnoshortif goto 483 + whilestatement goto 228 + forstatement goto 229 + whilestatementnoshortif goto 442 + ifthenstatement goto 230 + ifthenelsestatement goto 231 + ifthenelsestatementnoshortif goto 443 + emptystatement goto 232 + returnstatement goto 233 + assignment goto 234 + lefthandside goto 235 + methodinvocation goto 236 + + +state 483 + ifthenelsestatementnoshortif : IF '(' expression ')' statementnoshortif ELSE statementnoshortif . (207) + + . reduce 207 Rules never reduced: - packagedeclaration : PACKAGE name ';' (2) - importdeclarations : importdeclaration (3) - importdeclarations : importdeclarations importdeclaration (4) - importdeclaration : IMPORT importqualifiedname ';' (5) - importqualifiedname : name '.' IDENTIFIER (12) - importqualifiedname : name '.' '*' (13) - interfaceidentifier : IDENTIFIER (23) - interfaceidentifier : IDENTIFIER '<' boundedClassParameters '>' (24) - interfacedeclaration : INTERFACE interfaceidentifier interfacebody (27) - interfacedeclaration : modifiers INTERFACE interfaceidentifier interfacebody (28) - interfacedeclaration : INTERFACE interfaceidentifier extendsinterfaces interfacebody (29) - interfacedeclaration : modifiers INTERFACE interfaceidentifier extendsinterfaces interfacebody (30) - interfacebody : '{' '}' (47) - interfacebody : '{' interfacememberdeclarations '}' (48) - extendsinterfaces : EXTENDS interfacetype (49) - extendsinterfaces : extendsinterfaces ',' interfacetype (50) - interfacememberdeclarations : interfacememberdeclaration (60) - interfacememberdeclarations : interfacememberdeclarations interfacememberdeclaration (61) - interfacememberdeclaration : constantdeclaration (69) - interfacememberdeclaration : abstractmethoddeclaration (70) - constantdeclaration : modifiers type IDENTIFIER '=' expression ';' (76) - abstractmethoddeclaration : methodheader ';' (77) - variableinitializer : expression (153) + paralist : IDENTIFIER (36) + paralist : IDENTIFIER '<' paralist '>' (37) + paralist : wildcardparameter (38) + paralist : paralist ',' IDENTIFIER (39) + paralist : paralist ',' IDENTIFIER '<' paralist '>' (40) + paralist : paralist ',' wildcardparameter (41) + wildcardparameter : '?' (42) + wildcardparameter : '?' EXTENDS referencetype (43) + wildcardparameter : '?' SUPER referencetype (44) + variableinitializer : expression (161) -State 32 contains 1 shift/reduce conflict. -State 42 contains 1 shift/reduce conflict. -State 104 contains 1 shift/reduce conflict. -State 146 contains 1 shift/reduce conflict. -State 155 contains 1 shift/reduce conflict. -State 194 contains 2 shift/reduce conflicts. -State 197 contains 3 shift/reduce conflicts. -State 198 contains 2 shift/reduce conflicts. -State 200 contains 5 shift/reduce conflicts. -State 201 contains 2 shift/reduce conflicts. -State 202 contains 1 shift/reduce conflict. -State 203 contains 1 shift/reduce conflict. -State 204 contains 1 shift/reduce conflict. -State 205 contains 1 shift/reduce conflict. -State 206 contains 1 shift/reduce conflict. -State 246 contains 1 shift/reduce conflict. -State 340 contains 3 shift/reduce conflicts. -State 341 contains 3 shift/reduce conflicts. -State 347 contains 5 shift/reduce conflicts. -State 348 contains 5 shift/reduce conflicts. -State 349 contains 2 shift/reduce conflicts. -State 350 contains 1 shift/reduce conflict. -State 351 contains 1 shift/reduce conflict. -State 352 contains 1 shift/reduce conflict. -State 353 contains 1 shift/reduce conflict. +State 18 contains 1 shift/reduce conflict. +State 88 contains 1 shift/reduce conflict. +State 117 contains 1 shift/reduce conflict. +State 207 contains 1 shift/reduce conflict. +State 216 contains 1 shift/reduce conflict. +State 254 contains 2 shift/reduce conflicts. +State 257 contains 3 shift/reduce conflicts. +State 258 contains 2 shift/reduce conflicts. +State 260 contains 5 shift/reduce conflicts. +State 261 contains 2 shift/reduce conflicts. +State 262 contains 1 shift/reduce conflict. +State 263 contains 1 shift/reduce conflict. +State 264 contains 1 shift/reduce conflict. +State 265 contains 1 shift/reduce conflict. +State 266 contains 1 shift/reduce conflict. +State 302 contains 1 shift/reduce conflict. +State 393 contains 3 shift/reduce conflicts. +State 394 contains 3 shift/reduce conflicts. +State 400 contains 5 shift/reduce conflicts. +State 401 contains 5 shift/reduce conflicts. +State 402 contains 2 shift/reduce conflicts. +State 403 contains 1 shift/reduce conflict. +State 404 contains 1 shift/reduce conflict. +State 405 contains 1 shift/reduce conflict. +State 406 contains 1 shift/reduce conflict. -97 terminals, 116 nonterminals -277 grammar rules, 432 states +97 terminals, 117 nonterminals +285 grammar rules, 484 states