From edfa85df7fdfb69162a866808dfe5e80248ba607 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Wed, 25 Jun 2014 17:30:31 +0200 Subject: [PATCH] =?UTF-8?q?Einsetzen=20von=20Generics=20ge=C3=A4ndert.=20U?= =?UTF-8?q?nvollst=C3=A4ndiger=20Zustand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .project | 6 +- bin/mycompiler/myparser/JavaParser.jay | 113 +- src/mycompiler/SyntaxTreeNode.java | 13 +- src/mycompiler/myclass/Class.java | 15 +- src/mycompiler/myclass/Field.java | 12 +- src/mycompiler/myclass/FieldDeclaration.java | 7 +- src/mycompiler/myclass/Generic.java | 10 +- src/mycompiler/myclass/Method.java | 5 +- src/mycompiler/myparser/JavaParser.java | 4049 ----------------- src/mycompiler/myparser/JavaParser.jay | 113 +- src/mycompiler/mytype/RefType.java | 10 + src/mycompiler/mytype/Type.java | 9 + src/mycompiler/mytype/TypePlaceholder.java | 9 +- src/typinferenz/JavaCodeResult.java | 1 + .../GenericTypeInsertPoint.java | 68 +- .../typedeployment/TypeInsertPoint.java | 20 +- .../typedeployment/TypeInsertSet.java | 26 +- 17 files changed, 246 insertions(+), 4240 deletions(-) rename src/typinferenz/{ => typedeployment}/GenericTypeInsertPoint.java (75%) diff --git a/.project b/.project index b6f2d7aaa..dcf58c69e 100755 --- a/.project +++ b/.project @@ -7,12 +7,16 @@ org.eclipse.ui.externaltools.ExternalToolBuilder - clean,incremental, + clean,full,incremental, LaunchConfigHandle <project>/.externalToolBuilders/JavaParserBuilder.launch + + incclean + true + diff --git a/bin/mycompiler/myparser/JavaParser.jay b/bin/mycompiler/myparser/JavaParser.jay index 702414c31..c485cd439 100755 --- a/bin/mycompiler/myparser/JavaParser.jay +++ b/bin/mycompiler/myparser/JavaParser.jay @@ -211,6 +211,7 @@ public Vector testPair = new Vector(); %type classidentifier %type interfaceidentifier %type constantdeclaration +%type genericdeclarationlist %type fielddeclaration %type methodheader %type methoddeclaration @@ -901,6 +902,14 @@ fielddeclarator : $$=ret; } + +genericdeclarationlist : '<' boundedMethodParameters '>' + { + GenericDeclarationList ret = new GenericDeclarationList($2); + ret.setOffset($3.getOffset()); + $$ = ret; + } + fielddeclaration : fielddeclarator ';' { $$=$1; @@ -910,11 +919,11 @@ fielddeclaration : fielddeclarator ';' $2.setType($1); $$=$2; } - | '<' boundedMethodParameters '>' type fielddeclarator ';' + | genericdeclarationlist type fielddeclarator ';' {//angefügt von Andreas Stadelmeier - $5.setType($4); - $5.setGenericParameter($2); - $$=$5; + $3.setType($2); + $3.setGenericParameter($1); + $$=$3; } | variabledeclarators ';' @@ -1063,13 +1072,13 @@ boundedMethodParameters : boundedMethodParameter $$=$1; } - + // returns Method -methodheader :'<' boundedMethodParameters '>' type methoddeclarator +methodheader :genericdeclarationlist type methoddeclarator { - $5.setType($4); - $5.setGenericMethodParameters($2); - $$=$5; + $3.setType($2); + $3.setGenericParameter($1); + $$=$3; } | type methoddeclarator { @@ -1082,12 +1091,12 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator $3.setType($2); $$=$3; } - | modifiers '<' boundedMethodParameters '>' type methoddeclarator + | modifiers genericdeclarationlist type methoddeclarator { - $6.set_Modifiers($1); - $6.setGenericMethodParameters($3); - $6.setType($5); - $$=$6; + $4.set_Modifiers($1); + $4.setGenericParameter($2); + $4.setType($3); + $$=$4; } | type methoddeclarator throws { @@ -1095,12 +1104,12 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator $2.set_ExceptionList($3); $$=$2; } - | '<' boundedMethodParameters '>' type methoddeclarator throws + | genericdeclarationlist type methoddeclarator throws { - $5.setGenericMethodParameters($2); - $5.setType($4); - $5.set_ExceptionList($6); - $$=$5; + $3.setGenericParameter($1); + $3.setType($2); + $3.set_ExceptionList($4); + $$=$3; } | modifiers type methoddeclarator throws { @@ -1109,13 +1118,13 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator $3.set_ExceptionList($4); $$=$3; } - | modifiers '<' boundedMethodParameters '>' type methoddeclarator throws + | modifiers genericdeclarationlist type methoddeclarator throws { - $6.set_Modifiers($1); - $6.setGenericMethodParameters($3); - $6.setType($5); - $6.set_ExceptionList($7); - $$=$6; + $4.set_Modifiers($1); + $4.setGenericParameter($2); + $4.setType($3); + $4.set_ExceptionList($5); + $$=$4; } | VOID methoddeclarator { @@ -1145,37 +1154,37 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator $3.set_ExceptionList($4); $$=$3; } - | '<' boundedMethodParameters '>' VOID methoddeclarator + | genericdeclarationlist VOID methoddeclarator { - Void Voit = new Void($4.getOffset()); - $5.setType(Voit); - $5.setGenericMethodParameters($2); - $$=$5; + Void Voit = new Void($2.getOffset()); + $3.setType(Voit); + $3.setGenericParameter($1); + $$=$3; } - | modifiers '<' boundedMethodParameters '>' VOID methoddeclarator + | modifiers genericdeclarationlist VOID methoddeclarator { - Void voit = new Void($5.getOffset()); - $6.set_Modifiers($1); - $6.setType(voit); - $6.setGenericMethodParameters($3); - $$=$6; + Void voit = new Void($3.getOffset()); + $4.set_Modifiers($1); + $4.setType(voit); + $4.setGenericParameter($2); + $$=$4; } - | '<' boundedMethodParameters '>' VOID methoddeclarator throws + | genericdeclarationlist VOID methoddeclarator throws { - Void voyt = new Void($4.getOffset()); - $5.setType(voyt); - $5.set_ExceptionList($6); - $5.setGenericMethodParameters($2); - $$=$5; + Void voyt = new Void($2.getOffset()); + $3.setType(voyt); + $3.set_ExceptionList($4); + $3.setGenericParameter($1); + $$=$3; } - | modifiers '<' boundedMethodParameters '>' VOID methoddeclarator throws + | modifiers genericdeclarationlist VOID methoddeclarator throws { - Void voyd = new Void($5.getOffset()); - $6.set_Modifiers($1); - $6.setType(voyd); - $6.set_ExceptionList($7); - $6.setGenericMethodParameters($3); - $$=$6; + Void voyd = new Void($3.getOffset()); + $4.set_Modifiers($1); + $4.setType(voyd); + $4.set_ExceptionList($5); + $4.setGenericParameter($2); + $$=$4; } | methoddeclarator @@ -1183,11 +1192,11 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator //auskommentiert von Andreas Stadelmeier (a10023) $1.setType(TypePlaceholder.fresh()); $$=$1; } - | '<' boundedMethodParameters '>' methoddeclarator + | genericdeclarationlist methoddeclarator { //auskommentiert von Andreas Stadelmeier (a10023) $4.setType(TypePlaceholder.fresh()); - $4.setGenericMethodParameters($2); - $$=$4; + $2.setGenericParameter($1); + $$=$2; } | modifiers methoddeclarator diff --git a/src/mycompiler/SyntaxTreeNode.java b/src/mycompiler/SyntaxTreeNode.java index 1b5cab308..108639bed 100644 --- a/src/mycompiler/SyntaxTreeNode.java +++ b/src/mycompiler/SyntaxTreeNode.java @@ -2,11 +2,11 @@ package mycompiler; import java.util.Vector; -import typinferenz.GenericTypeInsertPoint; import typinferenz.ResultSet; import typinferenz.TypeInsertable; import typinferenz.exceptions.DebugException; import typinferenz.exceptions.TypeinferenceException; +import typinferenz.typedeployment.GenericTypeInsertPoint; import typinferenz.typedeployment.TypeInsertPoint; import typinferenz.typedeployment.TypeInsertSet; import mycompiler.myclass.Class; @@ -86,17 +86,12 @@ public abstract class SyntaxTreeNode{ 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){ @@ -105,7 +100,7 @@ public abstract class SyntaxTreeNode{ } } } - + */ } diff --git a/src/mycompiler/myclass/Class.java b/src/mycompiler/myclass/Class.java index 4f87df8c5..62699f342 100755 --- a/src/mycompiler/myclass/Class.java +++ b/src/mycompiler/myclass/Class.java @@ -64,6 +64,7 @@ import org.apache.log4j.Logger; + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; @@ -162,7 +163,7 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit public static boolean isFirstLocalVarDecl; //Hilfsvariable fuer Offsets, hoth // ino.end - private Vector genericClassParameters=new Vector(); + //private Vector genericClassParameters=new Vector(); // ino.attribute.containedTypes.23032.decldescription type=line // PL 05-07-30 eingefuegt. Vektor aller Typdeklarationen, die in der Klasse @@ -183,6 +184,7 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit protected Logger typinferenzLog = Logger.getLogger("Typeinference"); private SyntaxTreeNode parent; private Vector fielddecl = new Vector(); + private GenericDeclarationList genericClassParameters; // ino.method.Class.23041.definition @@ -1218,7 +1220,7 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit * @param tphs : Alle übriggebliebenen TypePLaceholder */ private void createGenericTypeVars(Vector tphs){ - this.genericClassParameters = new Vector(); + this.genericClassParameters = new GenericDeclarationList(new Vector()); for(TypePlaceholder tph : tphs){ GenericTypeVar toAdd = new GenericTypeVar(tph,this.getOffset()); if(!this.genericClassParameters.contains(toAdd))this.genericClassParameters.add(toAdd); @@ -1362,10 +1364,17 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit // TODO Auto-generated method stub return 0; } + @Override - public void setGenericParameter(Vector params) { + public void setGenericParameter(GenericDeclarationList params) { this.genericClassParameters = params; } + @Override + public int getGenericDeclOffset() { + //TODO: Falls Generische Parameterliste vorhanden, hier Wert der Liste zurückgegebn + return -1; + } + } // ino.end diff --git a/src/mycompiler/myclass/Field.java b/src/mycompiler/myclass/Field.java index 234864039..86b6c1ee8 100644 --- a/src/mycompiler/myclass/Field.java +++ b/src/mycompiler/myclass/Field.java @@ -25,6 +25,8 @@ public abstract class Field extends SyntaxTreeNode implements TypeInsertable, Ty private Type typ; private int offset; + + private GenericDeclarationList genericParameters; public Field(int offset){ this.offset = offset; @@ -128,6 +130,14 @@ public abstract class Field extends SyntaxTreeNode implements TypeInsertable, Ty } + @Override + public int getGenericDeclOffset() { + //TODO: Falls Generische Parameterliste vorhanden, hier Wert der Liste zurückgegebn + return -1; + } - + @Override + public void setGenericParameter(GenericDeclarationList params) { + this.genericParameters = params; + } } diff --git a/src/mycompiler/myclass/FieldDeclaration.java b/src/mycompiler/myclass/FieldDeclaration.java index 667e9dfb8..ec8346004 100644 --- a/src/mycompiler/myclass/FieldDeclaration.java +++ b/src/mycompiler/myclass/FieldDeclaration.java @@ -30,7 +30,7 @@ public class FieldDeclaration extends Field{ private Expr wert; //private Type type; - private Vector parameter; + //private Vector parameter; /** * Dieser Konstruktor der FieldDeclaration erstellt den Syntaxknoten vollständig. @@ -164,9 +164,4 @@ public class FieldDeclaration extends Field{ 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/Generic.java b/src/mycompiler/myclass/Generic.java index 3c569b98e..ccc4bd188 100644 --- a/src/mycompiler/myclass/Generic.java +++ b/src/mycompiler/myclass/Generic.java @@ -10,6 +10,10 @@ import mycompiler.mytype.GenericTypeVar; * */ public interface Generic { - public void setGenericParameter(Vector params); - //public int getGenericParameterOffset(); -} + public void setGenericParameter(GenericDeclarationList params); + /** + * Gibt den Offset im Quellcode an, an dem neue Deklarationen von generischen Variablen eingesetzt werden können. + * @return + */ + public int getGenericDeclOffset(); +} \ No newline at end of file diff --git a/src/mycompiler/myclass/Method.java b/src/mycompiler/myclass/Method.java index 961dc25a5..69b9b4d13 100755 --- a/src/mycompiler/myclass/Method.java +++ b/src/mycompiler/myclass/Method.java @@ -753,10 +753,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable return super.equals(obj); } - @Override - public void setGenericParameter(Vector params) { - this.genericMethodParameters = params; - } + } // ino.end diff --git a/src/mycompiler/myparser/JavaParser.java b/src/mycompiler/myparser/JavaParser.java index b7f8a7982..e69de29bb 100644 --- a/src/mycompiler/myparser/JavaParser.java +++ b/src/mycompiler/myparser/JavaParser.java @@ -1,4049 +0,0 @@ -// created by jay 0.7 (c) 1998 Axel.Schreiner@informatik.uni-osnabrueck.de - - // line 2 "./../src/mycompiler/myparser/JavaParser.jay" - -/* -Backup von JavaParser.jay 10.April 17 Uhr -*/ - -package mycompiler.myparser; - -import mycompiler.myclass.FieldDeclaration; -import mycompiler.myclass.Field; -import java.util.Vector; -import mycompiler.SourceFile; -import mycompiler.AClassOrInterface; -import mycompiler.myclass.Class; -import mycompiler.myclass.ClassBody; -import mycompiler.myclass.Constructor; -import mycompiler.myclass.Constant; -import mycompiler.myclass.ImportDeclarations; -import mycompiler.myclass.DeclId; -import mycompiler.myclass.ExceptionList; -import mycompiler.myclass.FormalParameter; -import mycompiler.myclass.Method; -import mycompiler.myclass.ParameterList; -import mycompiler.myclass.UsedId; -import mycompiler.myinterface.Interface; -import mycompiler.myinterface.InterfaceBody; -import mycompiler.mymodifier.Abstract; -import mycompiler.mymodifier.Final; -import mycompiler.mymodifier.Modifier; -import mycompiler.mymodifier.Modifiers; -import mycompiler.mymodifier.Private; -import mycompiler.mymodifier.Protected; -import mycompiler.mymodifier.Public; -import mycompiler.mymodifier.Static; -import mycompiler.myoperator.AndOp; -import mycompiler.myoperator.DivideOp; -import mycompiler.myoperator.EqualOp; -import mycompiler.myoperator.GreaterEquOp; -import mycompiler.myoperator.GreaterOp; -import mycompiler.myoperator.LessEquOp; -import mycompiler.myoperator.LessOp; -import mycompiler.myoperator.MinusOp; -import mycompiler.myoperator.ModuloOp; -import mycompiler.myoperator.NotEqualOp; -import mycompiler.myoperator.Operator; -import mycompiler.myoperator.OrOp; -import mycompiler.myoperator.PlusOp; -import mycompiler.myoperator.TimesOp; -import mycompiler.mystatement.ArgumentList; -import mycompiler.mystatement.Assign; -import mycompiler.mystatement.Binary; -import mycompiler.mystatement.Block; -import mycompiler.mystatement.BoolLiteral; -import mycompiler.mystatement.FloatLiteral; -import mycompiler.mystatement.DoubleLiteral; -import mycompiler.mystatement.LongLiteral; -import mycompiler.mystatement.CastExpr; -import mycompiler.mystatement.CharLiteral; -import mycompiler.mystatement.EmptyStmt; -import mycompiler.mystatement.Expr; -import mycompiler.mystatement.ExprStmt; -import mycompiler.mystatement.IfStmt; -import mycompiler.mystatement.InstanceOf; -import mycompiler.mystatement.IntLiteral; -import mycompiler.mystatement.Literal; -import mycompiler.mystatement.InstVar; -import mycompiler.mystatement.LocalOrFieldVar; -import mycompiler.mystatement.LocalVarDecl; -import mycompiler.mystatement.MethodCall; -import mycompiler.mystatement.NegativeExpr; -import mycompiler.mystatement.NewClass; -import mycompiler.mystatement.NotExpr; -import mycompiler.mystatement.Null; -import mycompiler.mystatement.PositivExpr; -import mycompiler.mystatement.PostDecExpr; -import mycompiler.mystatement.PostIncExpr; -import mycompiler.mystatement.PreDecExpr; -import mycompiler.mystatement.PreIncExpr; -import mycompiler.mystatement.Receiver; -import mycompiler.mystatement.Return; -import mycompiler.mystatement.Statement; -import mycompiler.mystatement.StringLiteral; -import mycompiler.mystatement.This; -import mycompiler.mystatement.UnaryMinus; -import mycompiler.mystatement.UnaryNot; -import mycompiler.mystatement.UnaryPlus; -import mycompiler.mystatement.WhileStmt; -import mycompiler.mystatement.ForStmt; -import mycompiler.mystatement.LambdaExpression; -import mycompiler.mytype.BaseType; -import mycompiler.mytype.BooleanType; -import mycompiler.mytype.CharacterType; -import mycompiler.mytype.GenericTypeVar; -import mycompiler.mytype.BoundedGenericTypeVar; -import mycompiler.mytype.IntegerType; -import mycompiler.mytype.ParaList; -import mycompiler.mytype.RefType; -import mycompiler.mytype.Type; -import mycompiler.mytype.TypePlaceholder; -import mycompiler.mytype.Void; -import mycompiler.mytype.WildcardType; -import mycompiler.mytype.ExtendsWildcardType; -import mycompiler.mytype.SuperWildcardType; -import mycompiler.mytype.Pair; - -public class JavaParser{ -public Vector path = new Vector(); - -//PL 05-07-30 eingefuegt. ANFANG -private Vector containedTypes = new Vector(); -private Vector usedIdsToCheck = new Vector(); - //Vektor aller Typdeklarationen die in aktueller Klasse vorkommen. - //wird nach Beendigung der Klasse des Attributs der jeweiligen - //Klasse zugeordnet - //nach dem Parsen wird mit wandleGeneric2RefType die - //die RefTypes gesetzt. -void initContainedTypes() { - this.containedTypes = new Vector(); -} -void initUsedIdsToCheck() { - this.usedIdsToCheck = new Vector(); -} -//PL 05-07-30 eingefuegt. ENDE - -//LUAR 07-05-29 Anfang für Wildcard Test -public Vector testPair = new Vector(); -//LUAR 07-05-29 Ende - // line 131 "-" -// %token constants - //{ //ergaenzt PL 23.01.01 wieder entfernt 21.12.01 - public static final int ABSTRACT = 257; - public static final int BOOLEAN = 258; - public static final int BREAK = 259; - public static final int CASE = 260; - public static final int CATCH = 261; - public static final int CHAR = 262; - public static final int CLASS = 263; - public static final int CONTINUE = 264; - public static final int DEFAULT = 265; - public static final int DO = 266; - public static final int ELSE = 267; - public static final int EXTENDS = 268; - public static final int FINAL = 269; - public static final int FINALLY = 270; - public static final int FOR = 271; - public static final int IF = 272; - public static final int INSTANCEOF = 273; - public static final int INT = 274; - public static final int NEW = 275; - public static final int PRIVATE = 276; - public static final int PROTECTED = 277; - public static final int PUBLIC = 278; - public static final int PACKAGE = 279; - public static final int IMPORT = 280; - public static final int INTERFACE = 281; - public static final int IMPLEMENTS = 282; - public static final int RETURN = 283; - public static final int STATIC = 284; - public static final int SUPER = 285; - public static final int SWITCH = 286; - public static final int THIS = 287; - public static final int THROW = 288; - public static final int THROWS = 289; - public static final int TRY = 290; - public static final int VOID = 291; - public static final int WHILE = 292; - public static final int INTLITERAL = 293; - public static final int LONGLITERAL = 294; - public static final int DOUBLELITERAL = 295; - public static final int FLOATLITERAL = 296; - public static final int BOOLLITERAL = 297; - public static final int JNULL = 298; - public static final int CHARLITERAL = 299; - public static final int STRINGLITERAL = 300; - public static final int IDENTIFIER = 301; - public static final int EQUAL = 302; - public static final int LESSEQUAL = 303; - public static final int GREATEREQUAL = 304; - public static final int NOTEQUAL = 305; - public static final int LOGICALOR = 306; - public static final int LOGICALAND = 307; - public static final int INCREMENT = 308; - public static final int DECREMENT = 309; - public static final int SHIFTLEFT = 310; - public static final int SHIFTRIGHT = 311; - public static final int UNSIGNEDSHIFTRIGHT = 312; - public static final int SIGNEDSHIFTRIGHT = 313; - public static final int PLUSEQUAL = 314; - public static final int MINUSEQUAL = 315; - public static final int TIMESEQUAL = 316; - public static final int DIVIDEEQUAL = 317; - public static final int ANDEQUAL = 318; - public static final int OREQUAL = 319; - public static final int XOREQUAL = 320; - public static final int MODULOEQUAL = 321; - public static final int SHIFTLEFTEQUAL = 322; - public static final int SIGNEDSHIFTRIGHTEQUAL = 323; - public static final int UNSIGNEDSHIFTRIGHTEQUAL = 324; - public static final int BRACE = 325; - public static final int RELOP = 326; - public static final int OP = 327; - public static final int EOF = 328; - public static final int LAMBDAASSIGNMENT = 329; - public static final int yyErrorCode = 256; - - /** thrown for irrecoverable syntax errors and stack overflow. - */ - public static class yyException extends java.lang.Exception { - public Token token; - public yyException (String message, Token token) { - super(message); - this.token=token; - } - } - - /** must be implemented by a scanner object to supply input to the parser. - */ - public interface yyInput { - /** move on to next token. - @return false if positioned beyond tokens. - @throws IOException on input error. - */ - boolean advance () throws java.io.IOException; - /** classifies current token. - Should not be called if advance() returned false. - @return current %token or single character. - */ - int token (); - /** associated with current token. - Should not be called if advance() returned false. - @return value for token(). - */ - Object value (); - } - - /** simplified error message. - @see yyerror - */ - public void yyerror (String message) { - yyerror(message, null); - } - - /** (syntax) error message. - Can be overwritten to control message format. - @param message text to be displayed. - @param expected vector of acceptable tokens, if available. - */ - public String yyerror (String message, String[] expected) { - if (expected != null && expected.length > 0) { - System.err.print(message+", expecting"); - message+=", expecting"; - for (int n = 0; n < expected.length; ++ n){ - System.err.print(" "+expected[n]); - message+=" "+expected[n];} - System.err.println(); - return message; - } else{ - System.err.println(message); - return message;} - } - - /** debugging support, requires the package jay.yydebug. - Set to null to suppress debugging messages. - */ -//t protected jay.yydebug.yyDebug yydebug; - - 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", -//t "importdeclaration : IMPORT importqualifiedname ';'", -//t "typedeclarations : typedeclaration", -//t "typedeclarations : typedeclarations typedeclaration", -//t "name : qualifiedname", -//t "name : simplename", -//t "typedeclaration : classdeclaration", -//t "typedeclaration : interfacedeclaration", -//t "qualifiedname : name '.' IDENTIFIER", -//t "importqualifiedname : name '.' IDENTIFIER", -//t "importqualifiedname : name '.' '*'", -//t "simplename : IDENTIFIER", -//t "classdeclaration : CLASS classidentifier classbody", -//t "classdeclaration : modifiers CLASS classidentifier classbody", -//t "classdeclaration : CLASS classidentifier super classbody", -//t "classdeclaration : modifiers CLASS classidentifier super classbody", -//t "classdeclaration : CLASS classidentifier interfaces classbody", -//t "classdeclaration : modifiers CLASS classidentifier interfaces classbody", -//t "classdeclaration : CLASS classidentifier super interfaces classbody", -//t "classdeclaration : modifiers CLASS classidentifier super interfaces classbody", -//t "interfaceidentifier : IDENTIFIER", -//t "interfaceidentifier : IDENTIFIER '<' boundedClassParameters '>'", -//t "classidentifier : IDENTIFIER", -//t "classidentifier : IDENTIFIER '<' boundedClassParameters '>'", -//t "interfacedeclaration : INTERFACE interfaceidentifier interfacebody", -//t "interfacedeclaration : modifiers INTERFACE interfaceidentifier interfacebody", -//t "interfacedeclaration : INTERFACE interfaceidentifier extendsinterfaces interfacebody", -//t "interfacedeclaration : modifiers INTERFACE interfaceidentifier extendsinterfaces interfacebody", -//t "paralist : IDENTIFIER", -//t "paralist : IDENTIFIER '<' paralist '>'", -//t "paralist : wildcardparameter", -//t "paralist : paralist ',' IDENTIFIER", -//t "paralist : paralist ',' IDENTIFIER '<' paralist '>'", -//t "paralist : paralist ',' wildcardparameter", -//t "wildcardparameter : '?'", -//t "wildcardparameter : '?' EXTENDS referencetype", -//t "wildcardparameter : '?' SUPER referencetype", -//t "classbody : '{' '}'", -//t "classbody : '{' classbodydeclarations '}'", -//t "modifiers : modifier", -//t "modifiers : modifiers modifier", -//t "super : EXTENDS classtype", -//t "interfaces : IMPLEMENTS interfacetype", -//t "interfaces : interfaces ',' interfacetype", -//t "interfacebody : '{' '}'", -//t "interfacebody : '{' interfacememberdeclarations '}'", -//t "extendsinterfaces : EXTENDS interfacetype", -//t "extendsinterfaces : extendsinterfaces ',' interfacetype", -//t "classbodydeclarations : classbodydeclaration", -//t "classbodydeclarations : classbodydeclarations classbodydeclaration", -//t "modifier : PUBLIC", -//t "modifier : PROTECTED", -//t "modifier : PRIVATE", -//t "modifier : STATIC", -//t "modifier : ABSTRACT", -//t "modifier : FINAL", -//t "classtype : classorinterfacetype", -//t "interfacememberdeclarations : interfacememberdeclaration", -//t "interfacememberdeclarations : interfacememberdeclarations interfacememberdeclaration", -//t "interfacetype : classorinterfacetype", -//t "classbodydeclaration : classmemberdeclaration", -//t "classbodydeclaration : staticinitializer", -//t "classbodydeclaration : constructordeclaration", -//t "classorinterfacetype : simplename parameter", -//t "typelist : type", -//t "typelist : typelist ',' type", -//t "parameter :", -//t "parameter : '<' typelist '>'", -//t "interfacememberdeclaration : constantdeclaration", -//t "interfacememberdeclaration : abstractmethoddeclaration", -//t "classmemberdeclaration : fielddeclaration", -//t "classmemberdeclaration : methoddeclaration", -//t "staticinitializer : STATIC block", -//t "constructordeclaration : constructordeclarator constructorbody", -//t "constructordeclaration : modifiers constructordeclarator constructorbody", -//t "constantdeclaration : modifiers type IDENTIFIER '=' expression ';'", -//t "abstractmethoddeclaration : methodheader ';'", -//t "fielddeclarator : variabledeclarator '=' expression", -//t "fielddeclaration : fielddeclarator ';'", -//t "fielddeclaration : type fielddeclarator ';'", -//t "fielddeclaration : '<' boundedMethodParameters '>' type fielddeclarator ';'", -//t "fielddeclaration : variabledeclarators ';'", -//t "fielddeclaration : type variabledeclarators ';'", -//t "fielddeclaration : modifiers type variabledeclarators ';'", -//t "methoddeclaration : methodheader methodbody", -//t "block : '{' '}'", -//t "block : '{' blockstatements '}'", -//t "constructordeclarator : simplename '(' ')'", -//t "constructordeclarator : simplename '(' formalparameterlist ')'", -//t "constructorbody : '{' '}'", -//t "constructorbody : '{' explicitconstructorinvocation '}'", -//t "constructorbody : '{' blockstatements '}'", -//t "constructorbody : '{' explicitconstructorinvocation blockstatements '}'", -//t "throws : THROWS classtypelist", -//t "boundedClassParameter : boundedMethodParameter", -//t "boundedClassParameters : boundedClassParameter", -//t "boundedClassParameters : boundedClassParameters ',' boundedClassParameter", -//t "boundedMethodParameter : IDENTIFIER", -//t "boundedMethodParameter : IDENTIFIER EXTENDS boundedclassidentifierlist", -//t "boundedclassidentifierlist : referencetype", -//t "boundedclassidentifierlist : boundedclassidentifierlist '&' referencetype", -//t "boundedMethodParameters : boundedMethodParameter", -//t "boundedMethodParameters : boundedMethodParameters ',' boundedMethodParameter", -//t "methodheader : '<' boundedMethodParameters '>' type methoddeclarator", -//t "methodheader : type methoddeclarator", -//t "methodheader : modifiers type methoddeclarator", -//t "methodheader : modifiers '<' boundedMethodParameters '>' type methoddeclarator", -//t "methodheader : type methoddeclarator throws", -//t "methodheader : '<' boundedMethodParameters '>' type methoddeclarator throws", -//t "methodheader : modifiers type methoddeclarator throws", -//t "methodheader : modifiers '<' boundedMethodParameters '>' type methoddeclarator throws", -//t "methodheader : VOID methoddeclarator", -//t "methodheader : modifiers VOID methoddeclarator", -//t "methodheader : VOID methoddeclarator throws", -//t "methodheader : modifiers VOID methoddeclarator throws", -//t "methodheader : '<' boundedMethodParameters '>' VOID methoddeclarator", -//t "methodheader : modifiers '<' boundedMethodParameters '>' VOID methoddeclarator", -//t "methodheader : '<' boundedMethodParameters '>' VOID methoddeclarator throws", -//t "methodheader : modifiers '<' boundedMethodParameters '>' VOID methoddeclarator throws", -//t "methodheader : methoddeclarator", -//t "methodheader : '<' boundedMethodParameters '>' methoddeclarator", -//t "methodheader : modifiers methoddeclarator", -//t "methodheader : methoddeclarator throws", -//t "methodheader : modifiers methoddeclarator throws", -//t "type : primitivetype", -//t "type : primitivetype '[' ']'", -//t "type : referencetype", -//t "type : referencetype '[' ']'", -//t "variabledeclarators : variabledeclarator", -//t "variabledeclarators : variabledeclarators ',' variabledeclarator", -//t "methodbody : block", -//t "blockstatements : blockstatement", -//t "blockstatements : blockstatements blockstatement", -//t "formalparameterlist : formalparameter", -//t "formalparameterlist : formalparameterlist ',' formalparameter", -//t "explicitconstructorinvocation : THIS '(' ')' ';'", -//t "explicitconstructorinvocation : THIS '(' argumentlist ')' ';'", -//t "classtypelist : classtype", -//t "classtypelist : classtypelist ',' classtype", -//t "methoddeclarator : IDENTIFIER '(' ')'", -//t "methoddeclarator : IDENTIFIER '(' formalparameterlist ')'", -//t "primitivetype : BOOLEAN", -//t "primitivetype : numerictype", -//t "referencetype : classorinterfacetype", -//t "variabledeclarator : variabledeclaratorid", -//t "blockstatement : localvariabledeclarationstatement", -//t "blockstatement : statement", -//t "formalparameter : type variabledeclaratorid", -//t "formalparameter : variabledeclaratorid", -//t "argumentlist : expression", -//t "argumentlist : argumentlist ',' expression", -//t "numerictype : integraltype", -//t "variabledeclaratorid : IDENTIFIER", -//t "variableinitializer : expression", -//t "localvariabledeclarationstatement : localvariabledeclaration ';'", -//t "statement : statementwithouttrailingsubstatement", -//t "statement : ifthenstatement", -//t "statement : ifthenelsestatement", -//t "statement : whilestatement", -//t "statement : forstatement", -//t "expression : assignmentexpression", -//t "expression : classinstancecreationexpression", -//t "integraltype : INT", -//t "integraltype : CHAR", -//t "localvariabledeclaration : type variabledeclarators", -//t "localvariabledeclaration : variabledeclarators", -//t "statementwithouttrailingsubstatement : block", -//t "statementwithouttrailingsubstatement : emptystatement", -//t "statementwithouttrailingsubstatement : expressionstatement", -//t "statementwithouttrailingsubstatement : returnstatement", -//t "ifthenstatement : IF '(' expression ')' statement", -//t "ifthenelsestatement : IF '(' expression ')' statementnoshortif ELSE statement", -//t "whilestatement : WHILE '(' expression ')' statement", -//t "forstatement : FOR '(' expression ';' expression ';' expression ')' statement", -//t "forstatement : FOR '(' expression ';' expression ';' ')' statement", -//t "forstatement : FOR '(' expression ';' ';' expression ')' statement", -//t "forstatement : FOR '(' ';' expression ';' expression ')' statement", -//t "forstatement : FOR '(' expression ';' ';' ')' statement", -//t "forstatement : FOR '(' ';' expression ';' ')' statement", -//t "forstatement : FOR '(' ';' ';' expression ')' statement", -//t "forstatement : FOR '(' ';' ';' ')' statement", -//t "assignmentexpression : conditionalexpression", -//t "assignmentexpression : assignment", -//t "emptystatement : ';'", -//t "expressionstatement : statementexpression ';'", -//t "returnstatement : RETURN ';'", -//t "returnstatement : RETURN expression ';'", -//t "statementnoshortif : statementwithouttrailingsubstatement", -//t "statementnoshortif : ifthenelsestatementnoshortif", -//t "statementnoshortif : whilestatementnoshortif", -//t "conditionalexpression : conditionalorexpression", -//t "assignment : lefthandside assignmentoperator assignmentexpression", -//t "assignment : lefthandside assignmentoperator classinstancecreationexpression", -//t "statementexpression : assignment", -//t "statementexpression : preincrementexpression", -//t "statementexpression : predecrementexpression", -//t "statementexpression : postincrementexpression", -//t "statementexpression : postdecrementexpression", -//t "statementexpression : methodinvocation", -//t "ifthenelsestatementnoshortif : IF '(' expression ')' statementnoshortif ELSE statementnoshortif", -//t "whilestatementnoshortif : WHILE '(' expression ')' statementnoshortif", -//t "conditionalorexpression : conditionalandexpression", -//t "conditionalorexpression : conditionalorexpression LOGICALOR conditionalandexpression", -//t "lambdaassignmentoperator : LAMBDAASSIGNMENT", -//t "lambdabody : block", -//t "lambdabody : expression", -//t "lambdaexpressionparameter : '(' ')'", -//t "lambdaexpressionparameter : '(' formalparameterlist ')'", -//t "lambdaexpression : lambdaexpressionparameter lambdaassignmentoperator lambdabody", -//t "lefthandside : name", -//t "assignmentoperator : '='", -//t "assignmentoperator : TIMESEQUAL", -//t "assignmentoperator : DIVIDEEQUAL", -//t "assignmentoperator : MODULOEQUAL", -//t "assignmentoperator : PLUSEQUAL", -//t "assignmentoperator : MINUSEQUAL", -//t "preincrementexpression : INCREMENT unaryexpression", -//t "predecrementexpression : DECREMENT unaryexpression", -//t "postincrementexpression : postfixexpression INCREMENT", -//t "postdecrementexpression : postfixexpression DECREMENT", -//t "methodinvocation : name '(' ')'", -//t "methodinvocation : name '(' argumentlist ')'", -//t "methodinvocation : primary '.' IDENTIFIER '(' ')'", -//t "methodinvocation : primary '.' IDENTIFIER '(' argumentlist ')'", -//t "classinstancecreationexpression : NEW classtype '(' ')'", -//t "classinstancecreationexpression : NEW classtype '(' argumentlist ')'", -//t "conditionalandexpression : inclusiveorexpression", -//t "conditionalandexpression : conditionalandexpression LOGICALAND inclusiveorexpression", -//t "unaryexpression : preincrementexpression", -//t "unaryexpression : predecrementexpression", -//t "unaryexpression : '+' unaryexpression", -//t "unaryexpression : '-' unaryexpression", -//t "unaryexpression : unaryexpressionnotplusminus", -//t "postfixexpression : primary", -//t "postfixexpression : name", -//t "postfixexpression : postincrementexpression", -//t "postfixexpression : postdecrementexpression", -//t "primary : primarynonewarray", -//t "inclusiveorexpression : exclusiveorexpression", -//t "inclusiveorexpression : inclusiveorexpression '|' exclusiveorexpression", -//t "primarynonewarray : literal", -//t "primarynonewarray : THIS", -//t "primarynonewarray : methodinvocation", -//t "primarynonewarray : lambdaexpression", -//t "unaryexpressionnotplusminus : postfixexpression", -//t "unaryexpressionnotplusminus : '!' unaryexpression", -//t "unaryexpressionnotplusminus : castexpression", -//t "exclusiveorexpression : andexpression", -//t "exclusiveorexpression : exclusiveorexpression '^' andexpression", -//t "literal : INTLITERAL", -//t "literal : BOOLLITERAL", -//t "literal : CHARLITERAL", -//t "literal : STRINGLITERAL", -//t "literal : LONGLITERAL", -//t "literal : FLOATLITERAL", -//t "literal : DOUBLELITERAL", -//t "literal : JNULL", -//t "castexpression : '(' primitivetype ')' unaryexpression", -//t "andexpression : equalityexpression", -//t "andexpression : andexpression '&' equalityexpression", -//t "equalityexpression : relationalexpression", -//t "equalityexpression : equalityexpression EQUAL relationalexpression", -//t "equalityexpression : equalityexpression NOTEQUAL relationalexpression", -//t "relationalexpression : shiftexpression", -//t "relationalexpression : relationalexpression '<' shiftexpression", -//t "relationalexpression : relationalexpression '>' shiftexpression", -//t "relationalexpression : relationalexpression LESSEQUAL shiftexpression", -//t "relationalexpression : relationalexpression GREATEREQUAL shiftexpression", -//t "relationalexpression : relationalexpression INSTANCEOF referencetype", -//t "shiftexpression : additiveexpression", -//t "additiveexpression : multiplicativeexpression", -//t "additiveexpression : additiveexpression '+' multiplicativeexpression", -//t "additiveexpression : additiveexpression '-' multiplicativeexpression", -//t "multiplicativeexpression : unaryexpression", -//t "multiplicativeexpression : multiplicativeexpression '*' unaryexpression", -//t "multiplicativeexpression : multiplicativeexpression '/' unaryexpression", -//t "multiplicativeexpression : multiplicativeexpression '%' unaryexpression", -//t }; - protected static final String yyName [] = { - "end-of-file",null,null,null,null,null,null,null,null,null,null,null, - null,null,null,null,null,null,null,null,null,null,null,null,null,null, - null,null,null,null,null,null,null,"'!'",null,null,null,"'%'","'&'", - null,"'('","')'","'*'","'+'","','","'-'","'.'","'/'",null,null,null, - null,null,null,null,null,null,null,null,"';'","'<'","'='","'>'","'?'", - null,null,null,null,null,null,null,null,null,null,null,null,null,null, - null,null,null,null,null,null,null,null,null,null,null,null,null, - "'['",null,"']'","'^'",null,null,null,null,null,null,null,null,null, - null,null,null,null,null,null,null,null,null,null,null,null,null,null, - null,null,null,null,null,"'{'","'|'","'}'",null,null,null,null,null, - null,null,null,null,null,null,null,null,null,null,null,null,null,null, - null,null,null,null,null,null,null,null,null,null,null,null,null,null, - null,null,null,null,null,null,null,null,null,null,null,null,null,null, - null,null,null,null,null,null,null,null,null,null,null,null,null,null, - null,null,null,null,null,null,null,null,null,null,null,null,null,null, - null,null,null,null,null,null,null,null,null,null,null,null,null,null, - null,null,null,null,null,null,null,null,null,null,null,null,null,null, - null,null,null,null,null,null,null,null,null,null,null,null,null,null, - null,null,null,null,null,null,null,null,null,null,null,null,null,null, - "ABSTRACT","BOOLEAN","BREAK","CASE","CATCH","CHAR","CLASS","CONTINUE", - "DEFAULT","DO","ELSE","EXTENDS","FINAL","FINALLY","FOR","IF", - "INSTANCEOF","INT","NEW","PRIVATE","PROTECTED","PUBLIC","PACKAGE", - "IMPORT","INTERFACE","IMPLEMENTS","RETURN","STATIC","SUPER","SWITCH", - "THIS","THROW","THROWS","TRY","VOID","WHILE","INTLITERAL", - "LONGLITERAL","DOUBLELITERAL","FLOATLITERAL","BOOLLITERAL","JNULL", - "CHARLITERAL","STRINGLITERAL","IDENTIFIER","EQUAL","LESSEQUAL", - "GREATEREQUAL","NOTEQUAL","LOGICALOR","LOGICALAND","INCREMENT", - "DECREMENT","SHIFTLEFT","SHIFTRIGHT","UNSIGNEDSHIFTRIGHT", - "SIGNEDSHIFTRIGHT","PLUSEQUAL","MINUSEQUAL","TIMESEQUAL", - "DIVIDEEQUAL","ANDEQUAL","OREQUAL","XOREQUAL","MODULOEQUAL", - "SHIFTLEFTEQUAL","SIGNEDSHIFTRIGHTEQUAL","UNSIGNEDSHIFTRIGHTEQUAL", - "BRACE","RELOP","OP","EOF","LAMBDAASSIGNMENT", - }; - - /** index-checked interface to yyName[]. - @param token single character or %token value. - @return token name or [illegal] or [unknown]. - */ -//t public static final String yyname (int token) { -//t if (token < 0 || token > yyName.length) return "[illegal]"; -//t String name; -//t if ((name = yyName[token]) != null) return name; -//t return "[unknown]"; -//t } - - /** computes list of expected tokens on error by tracing the tables. - @param state for which to compute the list. - @return list of token names. - */ - protected String[] yyExpecting (int state) { - // yyCheck durch yyCheckInit.yyCheck; ersetzt PL 25.1.01 - int token, n, len = 0; - boolean[] ok = new boolean[yyName.length]; - - if ((n = yySindex[state]) != 0) - for (token = n < 0 ? -n : 0; - token < yyName.length && n+token < yyTable.length; ++ token) - if (yyCheckInit.yyCheck[n+token] == token && !ok[token] && yyName[token] != null) { - ++ len; - ok[token] = true; - } - if ((n = yyRindex[state]) != 0) - for (token = n < 0 ? -n : 0; - token < yyName.length && n+token < yyTable.length; ++ token) - if (yyCheckInit.yyCheck[n+token] == token && !ok[token] && yyName[token] != null) { - ++ len; - ok[token] = true; - } - - String result[] = new String[len]; - for (n = token = 0; n < len; ++ token) - if (ok[token]) result[n++] = yyName[token]; - return result; - } - - /** the generated parser, with debugging messages. - Maintains a state and a value stack, currently with fixed maximum size. - @param yyLex scanner. - @param yydebug debug message writer implementing yyDebug, or null. - @return result of the last reduction, if any. - @throws yyException on irrecoverable parse error. - */ - public Object yyparse (yyInput yyLex, Object yydebug) - throws java.io.IOException, yyException { -//t this.yydebug = (jay.yydebug.yyDebug)yydebug; - return yyparse(yyLex); - } - - /** initial size and increment of the state/value stack [default 256]. - This is not final so that it can be overwritten outside of invocations - of yyparse(). - */ - protected int yyMax; - - /** executed at the beginning of a reduce action. - Used as $$ = yyDefault($1), prior to the user-specified action, if any. - Can be overwritten to provide deep copy, etc. - @param first value for $1, or null. - @return first. - */ - protected Object yyDefault (Object first) { - return first; - } - - /** the generated parser. - Maintains a state and a value stack, currently with fixed maximum size. - @param yyLex scanner. - @return result of the last reduction, if any. - @throws yyException on irrecoverable parse error. - */ - public Object yyparse (yyInput yyLex) - throws java.io.IOException, yyException { - // yyCheck durch yyCheckInit.yyCheck; ersetzt PL 23.1.01 - yyCheckInit.yyCheckInit(); // initial yyCheck eingefuegt PL 25.1.01 - if (yyMax <= 0) yyMax = 256; // initial size - int yyState = 0, yyStates[] = new int[yyMax]; // state stack - Object yyVal = null, yyVals[] = new Object[yyMax]; // value stack - int yyToken = -1; // current input - int yyErrorFlag = 0; // #tks to shift - Scanner yyScanner = (Scanner)yyLex; - String yyErrorString = "irrecoverable syntax error"; - - yyLoop: for (int yyTop = 0;; ++ yyTop) { - if (yyTop >= yyStates.length) { // dynamically increase - int[] i = new int[yyStates.length+yyMax]; - System.arraycopy(yyStates, 0, i, 0, yyStates.length); - yyStates = i; - Object[] o = new Object[yyVals.length+yyMax]; - System.arraycopy(yyVals, 0, o, 0, yyVals.length); - yyVals = o; - } - yyStates[yyTop] = yyState; - yyVals[yyTop] = yyVal; -//t if (yydebug != null) yydebug.push(yyState, yyVal); - - yyDiscarded: for (;;) { // discarding a token does not change stack - int yyN; - if ((yyN = yyDefRed[yyState]) == 0) { // else [default] reduce (yyN) - if (yyToken < 0) { - yyToken = yyLex.advance() ? yyLex.token() : 0; -//t if (yydebug != null) -//t yydebug.lex(yyState, yyToken, yyname(yyToken), yyLex.value()); - } - if ((yyN = yySindex[yyState]) != 0 && (yyN += yyToken) >= 0 - && yyN < yyTable.length && yyCheckInit.yyCheck[yyN] == yyToken) { -//t if (yydebug != null) -//t yydebug.shift(yyState, yyTable[yyN], yyErrorFlag-1); - yyState = yyTable[yyN]; // shift to yyN - yyVal = yyLex.value(); - yyToken = -1; - if (yyErrorFlag > 0) -- yyErrorFlag; - continue yyLoop; - } - if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0 - && yyN < yyTable.length && yyCheckInit.yyCheck[yyN] == yyToken) - yyN = yyTable[yyN]; // reduce (yyN) - else - switch (yyErrorFlag) { - - case 0: - yyErrorString=yyerror("syntax error", yyExpecting(yyState)); -//t if (yydebug != null) yydebug.error("syntax error"); - - case 1: case 2: - yyErrorFlag = 3; - do { - if ((yyN = yySindex[yyStates[yyTop]]) != 0 - && (yyN += yyErrorCode) >= 0 && yyN < yyTable.length - && yyCheckInit.yyCheck[yyN] == yyErrorCode) { -//t if (yydebug != null) -//t yydebug.shift(yyStates[yyTop], yyTable[yyN], 3); - yyState = yyTable[yyN]; - yyVal = yyLex.value(); - continue yyLoop; - } -//t if (yydebug != null) yydebug.pop(yyStates[yyTop]); - } while (-- yyTop >= 0); -//t if (yydebug != null) yydebug.reject(); - throw new yyException(yyErrorString, yyScanner.token); - - case 3: - if (yyToken == 0) { -//t if (yydebug != null) yydebug.reject(); - throw new yyException(yyErrorString+"at end-of-file", yyScanner.token); - } -//t if (yydebug != null) -//t yydebug.discard(yyState, yyToken, yyname(yyToken), -//t yyLex.value()); - yyToken = -1; - continue yyDiscarded; // leave stack alone - } - } - int yyV = yyTop + 1-yyLen[yyN]; -//t if (yydebug != null) -//t yydebug.reduce(yyState, yyStates[yyV-1], yyN, yyRule[yyN], yyLen[yyN]); - yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]); - switch (yyN) { -case 1: - // line 323 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((SourceFile)yyVals[0+yyTop]); - } - break; -case 2: - // 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 7: - // line 357 "./../src/mycompiler/myparser/JavaParser.jay" - { - ImportDeclarations declarations=new ImportDeclarations(); - declarations.addElement(((UsedId)yyVals[0+yyTop])); - yyVal=declarations; - } - break; -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 9: - // line 369 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((UsedId)yyVals[-1+yyTop]); - } - break; -case 10: - // line 374 "./../src/mycompiler/myparser/JavaParser.jay" - { - SourceFile Scfile = new SourceFile(); - Scfile.addElement(((AClassOrInterface)yyVals[0+yyTop])); - yyVal=Scfile; - } - break; -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 12: - // line 386 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((UsedId)yyVals[0+yyTop]); - } - break; -case 13: - // line 390 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((UsedId)yyVals[0+yyTop]); - } - break; -case 14: - // line 395 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Class)yyVals[0+yyTop]); - } - break; -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 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 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 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() ); - UI.setOffset(((Token)yyVals[0+yyTop]).getOffset());/*hinzugef�gt hoth: 07.04.2006*/ - yyVal = UI; - } - break; -case 20: - // line 435 "./../src/mycompiler/myparser/JavaParser.jay" - { - /* SCJU: Um das hier uebersichtlicher zu halten,*/ - /* gibt es einen allumfassenden Konstruktor fuer Class*/ - /* Parameter:*/ - /* String name, */ - /* Modifiers mod,*/ - /* ClassBody classbody, */ - /* Vector containedtypes, */ - /* UsedId superclass, */ - /* Vector SuperInterfaces, */ - /* Vector Parameterliste*/ - - yyVal = new Class(((ClassAndParameter)yyVals[-1+yyTop]).getName(), null, ((ClassBody)yyVals[0+yyTop]), containedTypes, usedIdsToCheck, null, null, ((ClassAndParameter)yyVals[-1+yyTop]).getParaVector()); - this.initContainedTypes(); - this.initUsedIdsToCheck(); - } - break; -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 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 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 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 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 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 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 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 29: - // line 502 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal = new InterfaceAndParameter(((Token)yyVals[-3+yyTop]).getLexem(), ((ParaList)yyVals[-1+yyTop])); - } - break; -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 31: - // line 513 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal = new ClassAndParameter(((Token)yyVals[-3+yyTop]).getLexem(), ((ParaList)yyVals[-1+yyTop])); - } - break; -case 32: - // line 518 "./../src/mycompiler/myparser/JavaParser.jay" - { - /* SCJU: Interface*/ - Interface ic = new Interface(((InterfaceAndParameter)yyVals[-1+yyTop]).getName()); - ic.setParaList(((InterfaceAndParameter)yyVals[-1+yyTop]).getParaVector()); - ic.setInterfaceBody(((InterfaceBody)yyVals[0+yyTop])); - ic.setContainedTypes(containedTypes); - initContainedTypes(); - yyVal = ic; - } - break; -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])); - ic.setParaList(((InterfaceAndParameter)yyVals[-1+yyTop]).getParaVector()); - ic.setContainedTypes(containedTypes); - initContainedTypes(); - yyVal = ic; - } - break; -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()); - ic.setSuperInterfaces(((InterfaceList)yyVals[-1+yyTop]).getVector()); - ic.setInterfaceBody(((InterfaceBody)yyVals[0+yyTop])); - ic.setContainedTypes(containedTypes); - initContainedTypes(); - yyVal = ic; - } - break; -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()); - ic.setSuperInterfaces(((InterfaceList)yyVals[-1+yyTop]).getVector()); - ic.setInterfaceBody(((InterfaceBody)yyVals[0+yyTop])); - ic.setContainedTypes(containedTypes); - initContainedTypes(); - yyVal = ic; - } - break; -case 36: - // line 558 "./../src/mycompiler/myparser/JavaParser.jay" - { - ParaList pl = new ParaList(); - /* #JB# 05.04.2005 */ - /* ########################################################### */ - pl.getParalist().addElement(new GenericTypeVar(((Token)yyVals[0+yyTop]).getLexem(), ((Token)yyVals[0+yyTop]).getOffset())); - /*pl.getParalist().addElement( new TypePlaceholder($1.getLexem()) );*/ - /* ########################################################### */ - org.apache.log4j.Logger.getLogger("parser").debug( "IDENTIFIER --> Paralist f�r " + ((Token)yyVals[0+yyTop]).getLexem() + " TV"); - yyVal = pl; - } - break; -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() ); - t.set_ParaList( ((ParaList)yyVals[-1+yyTop]).get_ParaList() ); - pl.getParalist().addElement(t); - org.apache.log4j.Logger.getLogger("parser").debug( "IDENTIFIER '<' paralist '>' --> Paralist f�r " + ((Token)yyVals[-3+yyTop]).getLexem() + ": RefType"); - yyVal = pl; - } - break; -case 38: - // line 578 "./../src/mycompiler/myparser/JavaParser.jay" - { - ParaList pl = new ParaList(); - pl.getParalist().addElement(((WildcardType)yyVals[0+yyTop])); - yyVal = pl; - } - break; -case 39: - // line 584 "./../src/mycompiler/myparser/JavaParser.jay" - { - - /* #JB# 05.04.2005 */ - /* ########################################################### */ - ((ParaList)yyVals[-2+yyTop]).getParalist().addElement(new GenericTypeVar(((Token)yyVals[0+yyTop]).getLexem(),((Token)yyVals[0+yyTop]).getOffset())); - /*$1.getParalist().addElement(new TypePlaceholder($3.getLexem()));*/ - /* ########################################################### */ - org.apache.log4j.Logger.getLogger("parser").debug( "paralist ',' IDENTIFIER --> Paralist f�r " + ((Token)yyVals[0+yyTop]).getLexem() + ": TV"); - org.apache.log4j.Logger.getLogger("parser").debug( "paralist: " + ((ParaList)yyVals[-2+yyTop]).getParalist()); - yyVal=((ParaList)yyVals[-2+yyTop]); - } - break; -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() ); - ((ParaList)yyVals[-5+yyTop]).getParalist().addElement(t); - org.apache.log4j.Logger.getLogger("parser").debug( "paralist ',' IDENTIFIER '<' paralist '>' --> Paralist f�r " + ((Token)yyVals[-3+yyTop]).getLexem() + ": RefType"); - yyVal=((ParaList)yyVals[-5+yyTop]); - } - break; -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 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 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 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 45: - // line 628 "./../src/mycompiler/myparser/JavaParser.jay" - { - ClassBody CB = new ClassBody(); - yyVal = CB; - } - break; -case 46: - // line 634 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal = ((ClassBody)yyVals[-1+yyTop]); - } - break; -case 47: - // line 639 "./../src/mycompiler/myparser/JavaParser.jay" - { - Modifiers Mod = new Modifiers(); - Mod.addModifier(((Modifier)yyVals[0+yyTop])); - yyVal = Mod; - } - break; -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 49: - // line 651 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal = ((UsedId)yyVals[0+yyTop]); - } - break; -case 50: - // line 656 "./../src/mycompiler/myparser/JavaParser.jay" - { - /* SCJU: Interface*/ - InterfaceList il = new InterfaceList(); - il.addInterface(((UsedId)yyVals[0+yyTop])); - yyVal = il; - } - break; -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 52: - // line 669 "./../src/mycompiler/myparser/JavaParser.jay" - { - /* SCJU: Interface*/ - yyVal = new InterfaceBody(); - } - break; -case 53: - // line 674 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal = ((InterfaceBody)yyVals[-1+yyTop]); - } - break; -case 54: - // line 681 "./../src/mycompiler/myparser/JavaParser.jay" - { - /* SCJU: Interface*/ - InterfaceList il = new InterfaceList(); - il.addInterface(((UsedId)yyVals[0+yyTop])); - yyVal = il; - } - break; -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 56: - // line 695 "./../src/mycompiler/myparser/JavaParser.jay" - { - ClassBody CB = new ClassBody(); - CB.addField( ((Field)yyVals[0+yyTop]) ); - yyVal=CB; - } - break; -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 58: - // line 708 "./../src/mycompiler/myparser/JavaParser.jay" - { - Public Pub = new Public(); - yyVal=Pub; - } - break; -case 59: - // line 713 "./../src/mycompiler/myparser/JavaParser.jay" - { - Protected Pro = new Protected(); - yyVal=Pro; - } - break; -case 60: - // line 718 "./../src/mycompiler/myparser/JavaParser.jay" - { - Private Pri = new Private(); - yyVal=Pri; - } - break; -case 61: - // line 723 "./../src/mycompiler/myparser/JavaParser.jay" - { - Static Sta = new Static(); - yyVal=Sta; - } - break; -case 62: - // line 728 "./../src/mycompiler/myparser/JavaParser.jay" - { - Abstract Abs = new Abstract(); - yyVal=Abs; - } - break; -case 63: - // line 733 "./../src/mycompiler/myparser/JavaParser.jay" - { Final fin = new Final(); - yyVal = fin; - } - break; -case 64: - // line 739 "./../src/mycompiler/myparser/JavaParser.jay" - { - /*PL 05-07-30 eingefuegt containedTypes ANFANG*/ - RefType RT = new RefType(-1); - /*RT.set_UsedId($1);*/ - /*RT.setName(RT.get_UsedId().get_Name_1Element());*/ - RT.set_ParaList(((UsedId)yyVals[0+yyTop]).get_RealParaList()); - RT.setName(((UsedId)yyVals[0+yyTop]).get_Name_1Element()); - containedTypes.addElement(RT); - /*PL 05-07-30 eingefuegt containedTypes ENDE*/ - - yyVal = ((UsedId)yyVals[0+yyTop]); - } - break; -case 65: - // line 754 "./../src/mycompiler/myparser/JavaParser.jay" - { - /* SCJU: Interface*/ - InterfaceBody ib = new InterfaceBody(); - ib.addElement(((Field)yyVals[0+yyTop])); - yyVal = ib; - } - break; -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 67: - // line 767 "./../src/mycompiler/myparser/JavaParser.jay" - { - /* SCJU: Interfaces*/ - yyVal = ((UsedId)yyVals[0+yyTop]); - } - break; -case 68: - // line 773 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Field)yyVals[0+yyTop]); - } - break; -case 69: - // line 778 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Method)yyVals[0+yyTop]); - } - break; -case 70: - // line 782 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Field)yyVals[0+yyTop]); - } - break; -case 71: - // line 787 "./../src/mycompiler/myparser/JavaParser.jay" - { - 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)$1).vParaOrg = new Vector( $2.get_ParaList() );*/ - } - yyVal=((UsedId)yyVals[-1+yyTop]); - } - break; -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 75: - // line 813 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal = ((Vector)yyVals[-1+yyTop]); - } - break; -case 76: - // line 818 "./../src/mycompiler/myparser/JavaParser.jay" - { - /* SCJU: Interfaces, Spezialform Konstantendef.*/ - yyVal = ((Constant)yyVals[0+yyTop]); - } - break; -case 77: - // line 823 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal = ((Method)yyVals[0+yyTop]); - } - break; -case 78: - // line 828 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Field)yyVals[0+yyTop]); - } - break; -case 79: - // line 832 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Method)yyVals[0+yyTop]); - } - break; -case 80: - // line 837 "./../src/mycompiler/myparser/JavaParser.jay" - { - 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); - Static ST = new Static(); - Modifiers MOD = new Modifiers(); - MOD.addModifier(ST); - STAT.set_Modifiers(MOD); - STAT.set_Block(((Block)yyVals[0+yyTop])); - yyVal=STAT; - } - break; -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 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 83: - // line 863 "./../src/mycompiler/myparser/JavaParser.jay" - { - /* SCJU: Interface*/ - Constant c = new Constant(((Token)yyVals[-3+yyTop]).getLexem(), ((Modifiers)yyVals[-5+yyTop])); - c.setType(((Type)yyVals[-4+yyTop])); - c.setValue(((Expr)yyVals[-1+yyTop])); - yyVal = c; - } - break; -case 84: - // line 872 "./../src/mycompiler/myparser/JavaParser.jay" - { - /* SCJU: Interface*/ - yyVal = ((Method)yyVals[-1+yyTop]); - } - break; -case 85: - // line 897 "./../src/mycompiler/myparser/JavaParser.jay" - { - 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 86: - // line 905 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((FieldDeclaration)yyVals[-1+yyTop]); - } - break; -case 87: - // line 909 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((FieldDeclaration)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); - yyVal=((FieldDeclaration)yyVals[-1+yyTop]); - } - break; -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 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 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++) - { - ((FieldDeclaration)yyVals[-1+yyTop]).getDeclIdVector().elementAt(i).modifiers=((Modifiers)yyVals[-3+yyTop]); - } - yyVal = ((FieldDeclaration)yyVals[-1+yyTop]); - } - break; -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 93: - // line 950 "./../src/mycompiler/myparser/JavaParser.jay" - { - Block Bl = new Block(); - yyVal=Bl; - } - break; -case 94: - // line 956 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Block)yyVals[-1+yyTop]); - } - break; -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(); - DIDCon.set_Name(((UsedId)yyVals[-2+yyTop]).get_Name_1Element()); - CON.set_DeclId(DIDCon); - yyVal=CON; - } - break; -case 96: - // line 969 "./../src/mycompiler/myparser/JavaParser.jay" - { - Constructor CONpara = new Constructor(null); - DeclId DIconpara = new DeclId(); - DIconpara.set_Name(((UsedId)yyVals[-3+yyTop]).get_Name_1Element()); - CONpara.set_DeclId(DIconpara); - CONpara.setParameterList(((ParameterList)yyVals[-1+yyTop])); - yyVal=CONpara; - } - break; -case 97: - // line 979 "./../src/mycompiler/myparser/JavaParser.jay" - { - Block CBL = new Block(); - yyVal=CBL; - } - break; -case 98: - // line 984 "./../src/mycompiler/myparser/JavaParser.jay" - { - Block CBLexpl = new Block(); - CBLexpl.set_Statement(((Statement)yyVals[-1+yyTop])); - yyVal=CBLexpl; - } - break; -case 99: - // line 990 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Block)yyVals[-1+yyTop]); - } - break; -case 100: - // line 994 "./../src/mycompiler/myparser/JavaParser.jay" - { - Block CBes = new Block(); - CBes.set_Statement(((Statement)yyVals[-2+yyTop])); - for(int j=0;j<((Block)yyVals[-1+yyTop]).statements.size();j++) - { - CBes.set_Statement((Statement)((Block)yyVals[-1+yyTop]).statements.elementAt(j)); - } - yyVal=CBes; - } - break; -case 101: - // line 1005 "./../src/mycompiler/myparser/JavaParser.jay" - { - ExceptionList EL = new ExceptionList(); - EL.set_addElem(((RefType)yyVals[0+yyTop])); - yyVal=EL; - } - break; -case 102: - // line 1012 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal = ((GenericTypeVar)yyVals[0+yyTop]); - } - break; -case 103: - // line 1017 "./../src/mycompiler/myparser/JavaParser.jay" - { - ParaList p = new ParaList(); - p.add_ParaList(((GenericTypeVar)yyVals[0+yyTop])); - yyVal=p; - } - break; -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 105: - // line 1030 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=new GenericTypeVar(((Token)yyVals[0+yyTop]).getLexem(),((Token)yyVals[0+yyTop]).getOffset()); - } - break; -case 106: - // line 1034 "./../src/mycompiler/myparser/JavaParser.jay" - { - 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 107: - // line 1041 "./../src/mycompiler/myparser/JavaParser.jay" - { - Vector vec=new Vector(); - vec.addElement(((RefType)yyVals[0+yyTop])); - containedTypes.addElement(((RefType)yyVals[0+yyTop])); - yyVal=vec; - } - break; -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 109: - // line 1055 "./../src/mycompiler/myparser/JavaParser.jay" - { - Vector vec=new Vector(); - vec.addElement(((GenericTypeVar)yyVals[0+yyTop])); - yyVal=vec; - } - break; -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 111: - // line 1069 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((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 1075 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((Method)yyVals[0+yyTop]).setType(((Type)yyVals[-1+yyTop])); - yyVal=((Method)yyVals[0+yyTop]); - } - break; -case 113: - // line 1080 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((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 1086 "./../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]).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 116: - // line 1099 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((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 1106 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((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])); - yyVal=((Method)yyVals[-1+yyTop]); - } - break; -case 118: - // line 1113 "./../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]).setType(((Type)yyVals[-2+yyTop])); - ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); - yyVal=((Method)yyVals[-1+yyTop]); - } - break; -case 119: - // line 1121 "./../src/mycompiler/myparser/JavaParser.jay" - { - Void Voit = new Void(((Token)yyVals[-1+yyTop]).getOffset()); - ((Method)yyVals[0+yyTop]).setType(Voit); - yyVal=((Method)yyVals[0+yyTop]); - } - break; -case 120: - // line 1127 "./../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]).setType(voit); - yyVal=((Method)yyVals[0+yyTop]); - } - break; -case 121: - // line 1134 "./../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])); - yyVal=((Method)yyVals[-1+yyTop]); - } - break; -case 122: - // line 1141 "./../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]).setType(voyd); - ((Method)yyVals[-1+yyTop]).set_ExceptionList(((ExceptionList)yyVals[0+yyTop])); - yyVal=((Method)yyVals[-1+yyTop]); - } - break; -case 123: - // line 1149 "./../src/mycompiler/myparser/JavaParser.jay" - { - 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 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 133: - // line 1219 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((BaseType)yyVals[-2+yyTop]).setArray(true); - } - break; -case 134: - // line 1223 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((RefType)yyVals[0+yyTop]); - } - break; -case 135: - // line 1227 "./../src/mycompiler/myparser/JavaParser.jay" - { - ((RefType)yyVals[-2+yyTop]).setArray(true); - } - break; -case 136: - // line 1231 "./../src/mycompiler/myparser/JavaParser.jay" - { - 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 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 138: - // line 1244 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Block)yyVals[0+yyTop]); - } - break; -case 139: - // line 1249 "./../src/mycompiler/myparser/JavaParser.jay" - { - Block Blstat = new Block(); - Blstat.set_Statement(((Statement)yyVals[0+yyTop])); - yyVal=Blstat; - } - break; -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 141: - // line 1262 "./../src/mycompiler/myparser/JavaParser.jay" - { - ParameterList PL = new ParameterList(); - PL.set_AddParameter(((FormalParameter)yyVals[0+yyTop])); - yyVal = PL; - } - break; -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 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 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 145: - // line 1288 "./../src/mycompiler/myparser/JavaParser.jay" - { - RefType RT = new RefType(-1); - RT.set_UsedId(((UsedId)yyVals[0+yyTop])); - RT.setName(RT.get_UsedId().get_Name_1Element()); - yyVal=RT; - } - break; -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 147: - // line 1302 "./../src/mycompiler/myparser/JavaParser.jay" - { - Method met = new Method(((Token)yyVals[-2+yyTop]).getOffset()); - /* #JB# 10.04.2005 */ - /* ########################################################### */ - met.setLineNumber(((Token)yyVals[-2+yyTop]).getLineNumber()); - met.setOffset(((Token)yyVals[-2+yyTop]).getOffset());/*hinzugef�gt hoth: 07.04.2006*/ - /* ########################################################### */ - DeclId DImethod = new DeclId(); - DImethod.set_Name(((Token)yyVals[-2+yyTop]).getLexem()); - met.set_DeclId(DImethod); - yyVal = met; - } - break; -case 148: - // line 1315 "./../src/mycompiler/myparser/JavaParser.jay" - { - Method met_para = new Method(((Token)yyVals[-3+yyTop]).getOffset()); - /* #JB# 10.04.2005 */ - /* ########################################################### */ - met_para.setLineNumber(((Token)yyVals[-3+yyTop]).getLineNumber()); - met_para.setOffset(((Token)yyVals[-3+yyTop]).getOffset());/*hinzugef�gt hoth: 07.04.2006*/ - /* ########################################################### */ - DeclId Dimet_para = new DeclId(); - Dimet_para.set_Name(((Token)yyVals[-3+yyTop]).getLexem()); - met_para.set_DeclId(Dimet_para); - met_para.setParameterList(((ParameterList)yyVals[-1+yyTop])); - yyVal = met_para; - } - break; -case 149: - // line 1330 "./../src/mycompiler/myparser/JavaParser.jay" - { - BooleanType BT = new BooleanType(); - /* #JB# 05.04.2005 */ - /* ########################################################### */ - /*BT.setName($1.getLexem());*/ - /* ########################################################### */ - yyVal=BT; - } - break; -case 150: - // line 1339 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((BaseType)yyVals[0+yyTop]); - } - break; -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()); - - /*ausgetauscht PL 05-07-30*/ - /*RT.set_UsedId($1); */ - /*RT.setName(RT.get_UsedId().get_Name_1Element());*/ - RT.set_ParaList(((UsedId)yyVals[0+yyTop]).get_RealParaList()); - RT.setName(((UsedId)yyVals[0+yyTop]).getQualifiedName()); - - - /*PL 05-07-30 eingefuegt containedTypes ANFANG*/ - containedTypes.addElement(RT); - /*PL 05-07-30 eingefuegt containedTypes ENDE*/ - - yyVal=RT; - } - break; -case 152: - // line 1364 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((DeclId)yyVals[0+yyTop]); - } - break; -case 153: - // line 1385 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((LocalVarDecl)yyVals[0+yyTop]); - } - break; -case 154: - // line 1389 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Statement)yyVals[0+yyTop]); - } - break; -case 155: - // line 1394 "./../src/mycompiler/myparser/JavaParser.jay" - { - FormalParameter FP = new FormalParameter(((DeclId)yyVals[0+yyTop])); - FP.setType(((Type)yyVals[-1+yyTop])); - /*FP.set_DeclId($2); //auskommentiert von Andreas Stadelmeier. DeclId wird nun dem Konstruktor von FormalParameter übergeben.*/ - yyVal=FP; - } - break; -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(((DeclId)yyVals[0+yyTop])); - - /* #JB# 31.03.2005*/ - /* ###########################################################*/ - /*Type T = TypePlaceholder.fresh(); //auskommentiert von Andreas Stadelmeier*/ - /* Type T = new TypePlaceholder(""); /* otth: Name wird automatisch berechnet * /*/ - /* ###########################################################*/ - /*org.apache.log4j.Logger.getLogger("parser").debug("\n--> berechneter Name: " + T.getName());*/ - - /*auskommentiert von Andreas Stadelmeier (a10023) FP.setType( T );*/ - /*FP.set_DeclId($1);*/ - - yyVal=FP; - } - break; -case 157: - // line 1438 "./../src/mycompiler/myparser/JavaParser.jay" - { - ArgumentList AL = new ArgumentList(); - AL.expr.addElement(((Expr)yyVals[0+yyTop])); - yyVal=AL; - } - break; -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 159: - // line 1450 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((BaseType)yyVals[0+yyTop]); - } - break; -case 160: - // line 1455 "./../src/mycompiler/myparser/JavaParser.jay" - { - DeclId DI = new DeclId(); - /* #JB# 10.04.2005 */ - /* ########################################################### */ - DI.setLineNumber(((Token)yyVals[0+yyTop]).getLineNumber()); - DI.setOffset(((Token)yyVals[0+yyTop]).getOffset());/*hinzugef�gt hoth: 07.04.2006*/ - /* ########################################################### */ - DI.set_Name(((Token)yyVals[0+yyTop]).getLexem()); - yyVal=DI; - } - break; -case 161: - // line 1467 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 162: - // line 1472 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((LocalVarDecl)yyVals[-1+yyTop]); - } - break; -case 163: - // line 1477 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Statement)yyVals[0+yyTop]); - } - break; -case 164: - // line 1481 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((IfStmt)yyVals[0+yyTop]); - } - break; -case 165: - // line 1485 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((IfStmt)yyVals[0+yyTop]); - } - break; -case 166: - // line 1489 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((WhileStmt)yyVals[0+yyTop]); - } - break; -case 167: - // line 1493 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((ForStmt)yyVals[0+yyTop]); - } - break; -case 168: - // line 1498 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 169: - // line 1502 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((NewClass)yyVals[0+yyTop]); - } - break; -case 170: - // line 1507 "./../src/mycompiler/myparser/JavaParser.jay" - { - IntegerType IT = new IntegerType(); - /* #JB# 05.04.2005 */ - /* ########################################################### */ - /*IT.setName($1.getLexem());*/ - /* ########################################################### */ - yyVal=IT; - } - break; -case 171: - // line 1516 "./../src/mycompiler/myparser/JavaParser.jay" - { - CharacterType CT = new CharacterType(); - /* #JB# 05.04.2005 */ - /* ########################################################### */ - /*CT.setName($1.getLexem());*/ - /* ########################################################### */ - yyVal=CT; - } - break; -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()); - LVD.setType(((Type)yyVals[-1+yyTop])); - LVD.setDeclidVector(((FieldDeclaration)yyVals[0+yyTop]).getDeclIdVector()); - yyVal = LVD; - } - break; -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()); - /*auskommentiert von Andreas Stadelmeier (a10023) LVD.setType(TypePlaceholder.fresh());*/ - LVD.setDeclidVector(((FieldDeclaration)yyVals[0+yyTop]).getDeclIdVector()); - yyVal = LVD; - } - break; -case 174: - // line 1547 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Block)yyVals[0+yyTop]); - } - break; -case 175: - // line 1551 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((EmptyStmt)yyVals[0+yyTop]); - } - break; -case 176: - // line 1555 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((ExprStmt)yyVals[0+yyTop]); - } - break; -case 177: - // line 1559 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Return)yyVals[0+yyTop]); - } - break; -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])); - Ifst.set_Then_block(((Statement)yyVals[0+yyTop])); - yyVal=Ifst; - } - break; -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])); - IfstElst.set_Then_block(((Statement)yyVals[-2+yyTop])); - IfstElst.set_Else_block(((Statement)yyVals[0+yyTop])); - yyVal=IfstElst; - } - break; -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])); - Whlst.set_Loop_block(((Statement)yyVals[0+yyTop])); - yyVal=Whlst; - } - break; -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])); - Fst.set_head_Condition(((Expr)yyVals[-4+yyTop])); - Fst.set_head_Loop_expr(((Expr)yyVals[-2+yyTop])); - Fst.set_body_Loop_block(((Statement)yyVals[0+yyTop])); - - /*Typannahme*/ - yyVal = Fst; - } - break; -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])); - Fst.set_head_Condition(((Expr)yyVals[-3+yyTop])); - Fst.set_body_Loop_block(((Statement)yyVals[0+yyTop])); - - /*Typannahme*/ - yyVal = Fst; - } - break; -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])); - Fst.set_head_Loop_expr(((Expr)yyVals[-2+yyTop])); - Fst.set_body_Loop_block(((Statement)yyVals[0+yyTop])); - - /*Typannahme*/ - yyVal = Fst; - } - break; -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])); - Fst.set_head_Loop_expr(((Expr)yyVals[-2+yyTop])); - Fst.set_body_Loop_block(((Statement)yyVals[0+yyTop])); - - /*Typannahme*/ - yyVal = Fst; - } - break; -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])); - Fst.set_body_Loop_block(((Statement)yyVals[0+yyTop])); - - /*Typannahme*/ - yyVal = Fst; - } - break; -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])); - Fst.set_body_Loop_block(((Statement)yyVals[0+yyTop])); - - /*Typannahme*/ - yyVal = Fst; - } - break; -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])); - Fst.set_body_Loop_block(((Statement)yyVals[0+yyTop])); - - /*Typannahme*/ - yyVal = Fst; - } - break; -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])); - - /*Typannahme*/ - yyVal = Fst; - } - break; -case 189: - // line 1676 "./../src/mycompiler/myparser/JavaParser.jay" - { - org.apache.log4j.Logger.getLogger("parser").debug("conditionalexpression"); - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 190: - // line 1681 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Assign)yyVals[0+yyTop]); - } - break; -case 191: - // line 1687 "./../src/mycompiler/myparser/JavaParser.jay" - { - EmptyStmt Empst = new EmptyStmt(); - yyVal=Empst; - } - break; -case 192: - // line 1693 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[-1+yyTop]); - } - break; -case 193: - // line 1698 "./../src/mycompiler/myparser/JavaParser.jay" - { - Return ret = new Return(-1,-1); - yyVal= ret; - } - break; -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 195: - // line 1710 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Statement)yyVals[0+yyTop]); - } - break; -case 196: - // line 1714 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((IfStmt)yyVals[0+yyTop]); - } - break; -case 197: - // line 1718 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((WhileStmt)yyVals[0+yyTop]); - } - break; -case 198: - // line 1723 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -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()); - LocalOrFieldVar LOFV = new LocalOrFieldVar(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); - LOFV.set_UsedId(((UsedId)yyVals[-2+yyTop])); - /*auskommentiert von Andreas Stadelmeier (a10023) LOFV.setType(TypePlaceholder.fresh());*/ - /*auskommentiert von Andreas Stadelmeier (a10023) Ass.setType(TypePlaceholder.fresh());*/ - if( ((Operator)yyVals[-1+yyTop]) == null ) - { - org.apache.log4j.Logger.getLogger("parser").debug("\nParser --> Zuweisung1 --> " + ((Expr)yyVals[0+yyTop]) + " \n"); - Ass.set_Expr( LOFV,((Expr)yyVals[0+yyTop]) ); - } - else - { - Binary Bin = new Binary(((Expr)yyVals[0+yyTop]).getOffset(),((Expr)yyVals[0+yyTop]).getVariableLength()); - Bin.set_Expr1(LOFV); - Bin.set_Operator(((Operator)yyVals[-1+yyTop])); - Bin.set_Expr2(((Expr)yyVals[0+yyTop])); - org.apache.log4j.Logger.getLogger("parser").debug("\nParser --> Zuweisung1 --> Binary\n"); - /*auskommentiert von Andreas Stadelmeier (a10023) Bin.setType(TypePlaceholder.fresh());*/ - Ass.set_Expr( LOFV, Bin ); - } - yyVal=Ass; - } - break; -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()); - LOFV.set_UsedId(((UsedId)yyVals[-2+yyTop])); - /*auskommentiert von Andreas Stadelmeier (a10023) LOFV.setType(TypePlaceholder.fresh());*/ - /*auskommentiert von Andreas Stadelmeier (a10023) Ass.setType(TypePlaceholder.fresh());*/ - if(((Operator)yyVals[-1+yyTop])==null) - { - Ass.set_Expr(LOFV,((NewClass)yyVals[0+yyTop])); - } - else - { - Binary Bin = new Binary(((NewClass)yyVals[0+yyTop]).getOffset(),((NewClass)yyVals[0+yyTop]).getVariableLength()); - Bin.set_Expr1(LOFV); - Bin.set_Operator(((Operator)yyVals[-1+yyTop])); - /*auskommentiert von Andreas Stadelmeier (a10023) Bin.setType(TypePlaceholder.fresh());*/ - Bin.set_Expr2(((NewClass)yyVals[0+yyTop])); - Ass.set_Expr(LOFV,Bin); - } - yyVal=Ass; - } - break; -case 201: - // line 1777 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Assign)yyVals[0+yyTop]); - } - break; -case 202: - // line 1781 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 203: - // line 1785 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 204: - // line 1789 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 205: - // line 1793 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 206: - // line 1797 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((MethodCall)yyVals[0+yyTop]); - } - break; -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])); - IfElno.set_Then_block(((Statement)yyVals[-2+yyTop])); - IfElno.set_Else_block(((Statement)yyVals[0+yyTop])); - yyVal=IfElno; - } - break; -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])); - Whstno.set_Loop_block(((Statement)yyVals[0+yyTop])); - yyVal=Whstno; - } - break; -case 209: - // line 1825 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -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()); - LogOr.set_Expr1(((Expr)yyVals[-2+yyTop])); - LogOr.set_Expr2(((Expr)yyVals[0+yyTop])); - LogOr.set_Operator(OrO); - /*auskommentiert von Andreas Stadelmeier (a10023) LogOr.setType(TypePlaceholder.fresh());*/ - yyVal=LogOr; - } - break; -case 211: - // line 1842 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=null; - } - break; -case 212: - // line 1847 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Block)yyVals[0+yyTop]); - } - break; -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";}|*/ - Block ret=new Block(); - ret.statements.add((Statement)new Return(0,0).set_ReturnExpr(((Expr)yyVals[0+yyTop]))); - /*ret.statements.add((ExprStmt)$1);*/ - yyVal=ret; - } - break; -case 214: - // line 1861 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=null; - } - break; -case 215: - // line 1865 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((ParameterList)yyVals[-1+yyTop]); - } - break; -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])); - lambda.setBody((Block)((Block)yyVals[0+yyTop])); - yyVal=lambda; - } - break; -case 217: - // line 1889 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((UsedId)yyVals[0+yyTop]); - } - break; -case 218: - // line 1894 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=null; - } - break; -case 219: - // line 1898 "./../src/mycompiler/myparser/JavaParser.jay" - { - TimesOp TEO = new TimesOp(-1,-1); - yyVal=TEO; - } - break; -case 220: - // line 1903 "./../src/mycompiler/myparser/JavaParser.jay" - { - DivideOp DEO = new DivideOp(-1,-1); - yyVal=DEO; - } - break; -case 221: - // line 1908 "./../src/mycompiler/myparser/JavaParser.jay" - { - ModuloOp MEO = new ModuloOp(-1,-1); - yyVal=MEO; - } - break; -case 222: - // line 1913 "./../src/mycompiler/myparser/JavaParser.jay" - { - PlusOp PEO = new PlusOp(-1,-1); - yyVal=PEO; - } - break; -case 223: - // line 1918 "./../src/mycompiler/myparser/JavaParser.jay" - { - MinusOp MEO = new MinusOp(-1,-1); - yyVal=MEO; - } - break; -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 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 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 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 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()); - UsedId udidmeth = new UsedId(((UsedId)yyVals[-2+yyTop]).getOffset()); - udidmeth.set_Name((String)((((UsedId)yyVals[-2+yyTop]).get_Name()).elementAt(((UsedId)yyVals[-2+yyTop]).get_Name().size()-1))); - MC.set_UsedId(udidmeth); - Receiver rec = null; - if (((UsedId)yyVals[-2+yyTop]).get_Name().size() > 2) { - - ((UsedId)yyVals[-2+yyTop]).removeLast(); - - /*macht aus der Liste von Strings */ - /*in usedid.name einen InstVar */ - InstVar INSTVA = new InstVar(((UsedId)yyVals[-2+yyTop]),((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); - - /*auskommentiert von Andreas Stadelmeier (a10023) INSTVA.setType(TypePlaceholder.fresh());*/ - rec = new Receiver(INSTVA); - } - else if (((UsedId)yyVals[-2+yyTop]).get_Name().size() == 2) { - LocalOrFieldVar LOFV = new LocalOrFieldVar(((UsedId)yyVals[-2+yyTop]).getOffset(),((UsedId)yyVals[-2+yyTop]).getVariableLength()); - ((UsedId)yyVals[-2+yyTop]).removeLast(); - LOFV.set_UsedId(((UsedId)yyVals[-2+yyTop])); - /*auskommentiert von Andreas Stadelmeier (a10023) LOFV.setType(TypePlaceholder.fresh());*/ - rec = new Receiver(LOFV); - } - MC.set_Receiver(rec); - /*auskommentiert von Andreas Stadelmeier (a10023) MC.setType(TypePlaceholder.fresh());*/ - yyVal=MC; - } - break; -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()); - UsedId udidmeth = new UsedId(((UsedId)yyVals[-3+yyTop]).getOffset()); - udidmeth.set_Name((String)((((UsedId)yyVals[-3+yyTop]).get_Name()).elementAt(((UsedId)yyVals[-3+yyTop]).get_Name().size()-1))); - MCarg.set_UsedId(udidmeth); - Receiver rec = null; - if (((UsedId)yyVals[-3+yyTop]).get_Name().size() > 2) { - - ((UsedId)yyVals[-3+yyTop]).removeLast(); - - /*macht aus der Liste von Strings */ - /*in usedid.name einen InstVar */ - InstVar INSTVA = new InstVar(((UsedId)yyVals[-3+yyTop]),((UsedId)yyVals[-3+yyTop]).getOffset(),((UsedId)yyVals[-3+yyTop]).getVariableLength()); - - /*auskommentiert von Andreas Stadelmeier (a10023) INSTVA.setType(TypePlaceholder.fresh());*/ - rec = new Receiver(INSTVA); - } - else if (((UsedId)yyVals[-3+yyTop]).get_Name().size() == 2) { - LocalOrFieldVar LOFV = new LocalOrFieldVar(((UsedId)yyVals[-3+yyTop]).getOffset(),((UsedId)yyVals[-3+yyTop]).getVariableLength()); - ((UsedId)yyVals[-3+yyTop]).removeLast(); - LOFV.set_UsedId(((UsedId)yyVals[-3+yyTop])); - /*auskommentiert von Andreas Stadelmeier (a10023) LOFV.setType(TypePlaceholder.fresh());*/ - rec = new Receiver(LOFV); - } - MCarg.set_Receiver(rec); - MCarg.set_ArgumentList(((ArgumentList)yyVals[-1+yyTop])); - /*auskommentiert von Andreas Stadelmeier (a10023) MCarg.setType(TypePlaceholder.fresh());*/ - yyVal=MCarg; - } - break; -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()); - - /* PL 05-08-21 primary ist kein UsedId*/ - /*$1.usedid.set_Name($3.getLexem());*/ - /*MCpr.set_UsedId($1.get_UsedId());*/ - UsedId udidmeth = new UsedId(((Expr)yyVals[-4+yyTop]).getOffset()); - udidmeth.set_Name(((Token)yyVals[-2+yyTop]).getLexem()); - MCpr.set_UsedId(udidmeth); - - /* #JB# 04.06.2005 */ - /* ########################################################### */ - MCpr.set_Receiver(new Receiver(((Expr)yyVals[-4+yyTop]))); - /* ########################################################### */ - /*auskommentiert von Andreas Stadelmeier (a10023) MCpr.setType(TypePlaceholder.fresh());*/ - yyVal=MCpr; - } - break; -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()); - - /* PL 05-08-21 primary ist kein UsedId*/ - /*$1.usedid.set_Name($3.getLexem());*/ - /*MCPA.set_UsedId($1.get_UsedId());*/ - UsedId udidmeth = new UsedId(((Token)yyVals[-3+yyTop]).getOffset()); - udidmeth.set_Name(((Token)yyVals[-3+yyTop]).getLexem()); - MCPA.set_UsedId(udidmeth); - - /* #JB# 04.06.2005 */ - /* ########################################################### */ - MCPA.set_Receiver(new Receiver(((Expr)yyVals[-5+yyTop]))); - /* ########################################################### */ - MCPA.set_ArgumentList(((ArgumentList)yyVals[-1+yyTop])); - /*auskommentiert von Andreas Stadelmeier (a10023) MCPA.setType(TypePlaceholder.fresh());*/ - yyVal=MCPA; - } - break; -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])); - usedIdsToCheck.addElement(((UsedId)yyVals[-2+yyTop])); - /*auskommentiert von Andreas Stadelmeier (a10023) NC.setType(TypePlaceholder.fresh());*/ - yyVal=NC; - } - break; -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])); - usedIdsToCheck.addElement(((UsedId)yyVals[-3+yyTop])); - NCarg.set_ArgumentList(((ArgumentList)yyVals[-1+yyTop])); - /*auskommentiert von Andreas Stadelmeier (a10023) NCarg.setType(TypePlaceholder.fresh());*/ - yyVal=NCarg; - } - break; -case 234: - // line 2080 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -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()); - And.set_Expr1(((Expr)yyVals[-2+yyTop])); - And.set_Expr2(((Expr)yyVals[0+yyTop])); - And.set_Operator(AndO); - /*auskommentiert von Andreas Stadelmeier (a10023) And.setType(TypePlaceholder.fresh());*/ - yyVal=And; - } - break; -case 236: - // line 2100 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 237: - // line 2104 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -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(); - POSEX.set_UnaryPlus(UP); - POSEX.set_Expr(((Expr)yyVals[0+yyTop])); - yyVal=POSEX; - } - break; -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(); - NEGEX.set_UnaryMinus(UM); - NEGEX.set_Expr(((Expr)yyVals[0+yyTop])); - yyVal=NEGEX; - } - break; -case 240: - // line 2124 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 241: - // line 2129 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 242: - // line 2133 "./../src/mycompiler/myparser/JavaParser.jay" - { - if (((UsedId)yyVals[0+yyTop]).get_Name().size() > 1) { - - /*macht aus der Liste von Strings */ - /*in usedid.name einen InstVar */ - InstVar INSTVA = new InstVar(((UsedId)yyVals[0+yyTop]),((UsedId)yyVals[0+yyTop]).getOffset(),((UsedId)yyVals[0+yyTop]).getVariableLength()); - - /*auskommentiert von Andreas Stadelmeier (a10023) INSTVA.setType(TypePlaceholder.fresh());*/ - yyVal = INSTVA; - } - else { - LocalOrFieldVar Postincexpr = new LocalOrFieldVar(((UsedId)yyVals[0+yyTop]).getOffset(),((UsedId)yyVals[0+yyTop]).getVariableLength()); - Postincexpr.set_UsedId(((UsedId)yyVals[0+yyTop])); - /*auskommentiert von Andreas Stadelmeier (a10023) Postincexpr.setType(TypePlaceholder.fresh());*/ - yyVal=Postincexpr; - } - } - break; -case 243: - // line 2151 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 244: - // line 2155 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 245: - // line 2160 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 246: - // line 2165 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 248: - // line 2171 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Literal)yyVals[0+yyTop]); - } - break; -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()); - UT.set_Name(((Token)yyVals[0+yyTop]).getLexem()); - T.set_UsedId(UT); - yyVal=T; - } - break; -case 250: - // line 2196 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((MethodCall)yyVals[0+yyTop]); - } - break; -case 251: - // line 2200 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 252: - // line 2205 "./../src/mycompiler/myparser/JavaParser.jay" - {yyVal=((Expr)yyVals[0+yyTop]);} - break; -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); - NE.set_Expr(((Expr)yyVals[0+yyTop])); - yyVal=NE; - } - break; -case 254: - // line 2213 "./../src/mycompiler/myparser/JavaParser.jay" - {yyVal=((CastExpr)yyVals[0+yyTop]);} - break; -case 255: - // line 2215 "./../src/mycompiler/myparser/JavaParser.jay" - {yyVal=((Expr)yyVals[0+yyTop]);} - break; -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 258: - // line 2225 "./../src/mycompiler/myparser/JavaParser.jay" - {BoolLiteral BL = new BoolLiteral(); - BL.set_Bool(((Token)yyVals[0+yyTop]).String2Bool()); - yyVal = BL; - } - break; -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 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 261: - // line 2239 "./../src/mycompiler/myparser/JavaParser.jay" - { LongLiteral LL = new LongLiteral(); - LL.set_Long(((Token)yyVals[0+yyTop]).String2Long()); - yyVal = LL; - } - break; -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 263: - // line 2248 "./../src/mycompiler/myparser/JavaParser.jay" - { - DoubleLiteral DL = new DoubleLiteral(); - DL.set_Double(((Token)yyVals[0+yyTop]).String2Double()); - yyVal = DL; - } - break; -case 264: - // line 2254 "./../src/mycompiler/myparser/JavaParser.jay" - { - Null NN = new Null(); - yyVal=NN; - } - break; -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])); - CaEx.set_Expr(((Expr)yyVals[0+yyTop])); - yyVal=CaEx; - } - break; -case 266: - // line 2269 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 267: - // line 2273 "./../src/mycompiler/myparser/JavaParser.jay" - { - } - break; -case 268: - // line 2277 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -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()); - EQ.set_Expr1(((Expr)yyVals[-2+yyTop])); - EQ.set_Expr2(((Expr)yyVals[0+yyTop])); - EQ.set_Operator(EO); - /*auskommentiert von Andreas Stadelmeier (a10023) EQ.setType(TypePlaceholder.fresh());*/ - yyVal=EQ; - } - break; -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()); - NEQ.set_Expr1(((Expr)yyVals[-2+yyTop])); - NEQ.set_Expr2(((Expr)yyVals[0+yyTop])); - NEQ.set_Operator(NEO); - /*auskommentiert von Andreas Stadelmeier (a10023) NEQ.setType(TypePlaceholder.fresh());*/ - yyVal=NEQ; - } - break; -case 271: - // line 2302 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -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()); - LO.set_Expr1(((Expr)yyVals[-2+yyTop])); - LO.set_Expr2(((Expr)yyVals[0+yyTop])); - LO.set_Operator(LOO); - /*auskommentiert von Andreas Stadelmeier (a10023) LO.setType(TypePlaceholder.fresh());*/ - yyVal=LO; - } - break; -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()); - GO.set_Expr1(((Expr)yyVals[-2+yyTop])); - GO.set_Expr2(((Expr)yyVals[0+yyTop])); - GO.set_Operator( GOO ); - /*auskommentiert von Andreas Stadelmeier (a10023) GO.setType(TypePlaceholder.fresh());*/ - yyVal=GO; - } - break; -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()); - LE.set_Expr1(((Expr)yyVals[-2+yyTop])); - LE.set_Expr2(((Expr)yyVals[0+yyTop])); - LE.set_Operator(LEO); - /*auskommentiert von Andreas Stadelmeier (a10023) LE.setType(TypePlaceholder.fresh());*/ - yyVal=LE; - } - break; -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()); - GE.set_Expr1(((Expr)yyVals[-2+yyTop])); - GE.set_Expr2(((Expr)yyVals[0+yyTop])); - GE.set_Operator(GEO); - /*auskommentiert von Andreas Stadelmeier (a10023) GE.setType(TypePlaceholder.fresh());*/ - yyVal=GE; - } - break; -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])); - ISO.set_Type(((RefType)yyVals[0+yyTop])); - yyVal=ISO; - } - break; -case 277: - // line 2354 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -case 278: - // line 2359 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -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()); - AD.set_Expr1(((Expr)yyVals[-2+yyTop])); - AD.set_Expr2(((Expr)yyVals[0+yyTop])); - AD.set_Operator(PO); - /*auskommentiert von Andreas Stadelmeier (a10023) AD.setType(TypePlaceholder.fresh());*/ - yyVal=AD; - } - break; -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()); - MI.set_Expr1(((Expr)yyVals[-2+yyTop])); - MI.set_Expr2(((Expr)yyVals[0+yyTop])); - MI.set_Operator(MO); - /*auskommentiert von Andreas Stadelmeier (a10023) MI.setType(TypePlaceholder.fresh());*/ - yyVal=MI; - } - break; -case 281: - // line 2384 "./../src/mycompiler/myparser/JavaParser.jay" - { - yyVal=((Expr)yyVals[0+yyTop]); - } - break; -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()); - ML.set_Expr1(((Expr)yyVals[-2+yyTop])); - ML.set_Expr2(((Expr)yyVals[0+yyTop])); - ML.set_Operator(TO); - /*auskommentiert von Andreas Stadelmeier (a10023) ML.setType(TypePlaceholder.fresh());*/ - yyVal=ML; - } - break; -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()); - DV.set_Expr1(((Expr)yyVals[-2+yyTop])); - DV.set_Expr2(((Expr)yyVals[0+yyTop])); - DV.set_Operator(DO); - /*auskommentiert von Andreas Stadelmeier (a10023) DV.setType(TypePlaceholder.fresh());*/ - yyVal = DV; - } - break; -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()); - MD.set_Expr1(((Expr)yyVals[-2+yyTop])); - MD.set_Expr2(((Expr)yyVals[0+yyTop])); - MD.set_Operator(MO); - /*auskommentiert von Andreas Stadelmeier (a10023) MD.setType(TypePlaceholder.fresh());*/ - yyVal =MD; - } - break; - // line 3160 "-" - } - yyTop -= yyLen[yyN]; - yyState = yyStates[yyTop]; - int yyM = yyLhs[yyN]; - if (yyState == 0 && yyM == 0) { -//t if (yydebug != null) yydebug.shift(0, yyFinal); - yyState = yyFinal; - if (yyToken < 0) { - yyToken = yyLex.advance() ? yyLex.token() : 0; -//t if (yydebug != null) -//t yydebug.lex(yyState, yyToken,yyname(yyToken), yyLex.value()); - } - if (yyToken == 0) { -//t if (yydebug != null) yydebug.accept(yyVal); - return yyVal; - } - continue yyLoop; - } - if ((yyN = yyGindex[yyM]) != 0 && (yyN += yyState) >= 0 - && yyN < yyTable.length && yyCheckInit.yyCheck[yyN] == yyState) - yyState = yyTable[yyN]; - else - yyState = yyDgoto[yyM]; -//t if (yydebug != null) yydebug.shift(yyStates[yyTop], yyState); - continue yyLoop; - } - } - } - - protected static final short yyLhs [] = { -1, - 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, 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, 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, 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, - 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, 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, 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, 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, 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, 0, 76, 0, 0, 77, 0, 0, -28, 0, - 0, 0, 0, 0, 0, 0, 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, 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 [] = { 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 [] = { 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, 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[2881]; -} -class yyCheck0 { - 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, 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 [] = { 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, -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, - 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 [] = { 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, -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, 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, 60, -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, 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[2881]; - protected static void yyCheckInit () { - int numyycheck; - int yyCheckerun = 0; - for (numyycheck = 0; numyycheck <= 1000; numyycheck++) { - if (yyCheckerun < 2881) { - yyCheck[yyCheckerun] = yyCheck0.yyCheck0[numyycheck]; - yyCheckerun++; - } - } - for (numyycheck = 0; numyycheck <= 1000; numyycheck++) { - if (yyCheckerun < 2881) { - yyCheck[yyCheckerun] = yyCheck1.yyCheck1[numyycheck]; - yyCheckerun++; - } - } - for (numyycheck = 0; numyycheck <= 1000; numyycheck++) { - if (yyCheckerun < 2881) { - yyCheck[yyCheckerun] = yyCheck2.yyCheck2[numyycheck]; - yyCheckerun++; - } - } -} -} - diff --git a/src/mycompiler/myparser/JavaParser.jay b/src/mycompiler/myparser/JavaParser.jay index 702414c31..c485cd439 100755 --- a/src/mycompiler/myparser/JavaParser.jay +++ b/src/mycompiler/myparser/JavaParser.jay @@ -211,6 +211,7 @@ public Vector testPair = new Vector(); %type classidentifier %type interfaceidentifier %type constantdeclaration +%type genericdeclarationlist %type fielddeclaration %type methodheader %type methoddeclaration @@ -901,6 +902,14 @@ fielddeclarator : $$=ret; } + +genericdeclarationlist : '<' boundedMethodParameters '>' + { + GenericDeclarationList ret = new GenericDeclarationList($2); + ret.setOffset($3.getOffset()); + $$ = ret; + } + fielddeclaration : fielddeclarator ';' { $$=$1; @@ -910,11 +919,11 @@ fielddeclaration : fielddeclarator ';' $2.setType($1); $$=$2; } - | '<' boundedMethodParameters '>' type fielddeclarator ';' + | genericdeclarationlist type fielddeclarator ';' {//angefügt von Andreas Stadelmeier - $5.setType($4); - $5.setGenericParameter($2); - $$=$5; + $3.setType($2); + $3.setGenericParameter($1); + $$=$3; } | variabledeclarators ';' @@ -1063,13 +1072,13 @@ boundedMethodParameters : boundedMethodParameter $$=$1; } - + // returns Method -methodheader :'<' boundedMethodParameters '>' type methoddeclarator +methodheader :genericdeclarationlist type methoddeclarator { - $5.setType($4); - $5.setGenericMethodParameters($2); - $$=$5; + $3.setType($2); + $3.setGenericParameter($1); + $$=$3; } | type methoddeclarator { @@ -1082,12 +1091,12 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator $3.setType($2); $$=$3; } - | modifiers '<' boundedMethodParameters '>' type methoddeclarator + | modifiers genericdeclarationlist type methoddeclarator { - $6.set_Modifiers($1); - $6.setGenericMethodParameters($3); - $6.setType($5); - $$=$6; + $4.set_Modifiers($1); + $4.setGenericParameter($2); + $4.setType($3); + $$=$4; } | type methoddeclarator throws { @@ -1095,12 +1104,12 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator $2.set_ExceptionList($3); $$=$2; } - | '<' boundedMethodParameters '>' type methoddeclarator throws + | genericdeclarationlist type methoddeclarator throws { - $5.setGenericMethodParameters($2); - $5.setType($4); - $5.set_ExceptionList($6); - $$=$5; + $3.setGenericParameter($1); + $3.setType($2); + $3.set_ExceptionList($4); + $$=$3; } | modifiers type methoddeclarator throws { @@ -1109,13 +1118,13 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator $3.set_ExceptionList($4); $$=$3; } - | modifiers '<' boundedMethodParameters '>' type methoddeclarator throws + | modifiers genericdeclarationlist type methoddeclarator throws { - $6.set_Modifiers($1); - $6.setGenericMethodParameters($3); - $6.setType($5); - $6.set_ExceptionList($7); - $$=$6; + $4.set_Modifiers($1); + $4.setGenericParameter($2); + $4.setType($3); + $4.set_ExceptionList($5); + $$=$4; } | VOID methoddeclarator { @@ -1145,37 +1154,37 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator $3.set_ExceptionList($4); $$=$3; } - | '<' boundedMethodParameters '>' VOID methoddeclarator + | genericdeclarationlist VOID methoddeclarator { - Void Voit = new Void($4.getOffset()); - $5.setType(Voit); - $5.setGenericMethodParameters($2); - $$=$5; + Void Voit = new Void($2.getOffset()); + $3.setType(Voit); + $3.setGenericParameter($1); + $$=$3; } - | modifiers '<' boundedMethodParameters '>' VOID methoddeclarator + | modifiers genericdeclarationlist VOID methoddeclarator { - Void voit = new Void($5.getOffset()); - $6.set_Modifiers($1); - $6.setType(voit); - $6.setGenericMethodParameters($3); - $$=$6; + Void voit = new Void($3.getOffset()); + $4.set_Modifiers($1); + $4.setType(voit); + $4.setGenericParameter($2); + $$=$4; } - | '<' boundedMethodParameters '>' VOID methoddeclarator throws + | genericdeclarationlist VOID methoddeclarator throws { - Void voyt = new Void($4.getOffset()); - $5.setType(voyt); - $5.set_ExceptionList($6); - $5.setGenericMethodParameters($2); - $$=$5; + Void voyt = new Void($2.getOffset()); + $3.setType(voyt); + $3.set_ExceptionList($4); + $3.setGenericParameter($1); + $$=$3; } - | modifiers '<' boundedMethodParameters '>' VOID methoddeclarator throws + | modifiers genericdeclarationlist VOID methoddeclarator throws { - Void voyd = new Void($5.getOffset()); - $6.set_Modifiers($1); - $6.setType(voyd); - $6.set_ExceptionList($7); - $6.setGenericMethodParameters($3); - $$=$6; + Void voyd = new Void($3.getOffset()); + $4.set_Modifiers($1); + $4.setType(voyd); + $4.set_ExceptionList($5); + $4.setGenericParameter($2); + $$=$4; } | methoddeclarator @@ -1183,11 +1192,11 @@ methodheader :'<' boundedMethodParameters '>' type methoddeclarator //auskommentiert von Andreas Stadelmeier (a10023) $1.setType(TypePlaceholder.fresh()); $$=$1; } - | '<' boundedMethodParameters '>' methoddeclarator + | genericdeclarationlist methoddeclarator { //auskommentiert von Andreas Stadelmeier (a10023) $4.setType(TypePlaceholder.fresh()); - $4.setGenericMethodParameters($2); - $$=$4; + $2.setGenericParameter($1); + $$=$2; } | modifiers methoddeclarator diff --git a/src/mycompiler/mytype/RefType.java b/src/mycompiler/mytype/RefType.java index 0cbe76aaf..9c14cd5fe 100755 --- a/src/mycompiler/mytype/RefType.java +++ b/src/mycompiler/mytype/RefType.java @@ -20,6 +20,7 @@ import org.apache.log4j.Logger; + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; @@ -769,6 +770,15 @@ public class RefType extends Type implements IMatchable ret.addAll(this.printJavaCode(resultSet).getUnresolvedTPH()); return ret; } + + @Override + public Vector getInvolvedTypePlaceholder() { + Vector ret = super.getInvolvedTypePlaceholder(); + for(Type param : this.parameter){ + ret.addAll(param.getInvolvedTypePlaceholder()); + } + return ret; + } } // ino.end diff --git a/src/mycompiler/mytype/Type.java b/src/mycompiler/mytype/Type.java index 81f6efa59..7db9ba139 100755 --- a/src/mycompiler/mytype/Type.java +++ b/src/mycompiler/mytype/Type.java @@ -291,5 +291,14 @@ public class Type implements IItemWithOffset return t; } + /** + * Sammelt alle TypePlaceholder, welche in diesem Typ vorkommen. + * @return + */ + public Vector getInvolvedTypePlaceholder(){ + Vector ret = new Vector<>(); + return ret; + } + } // ino.end diff --git a/src/mycompiler/mytype/TypePlaceholder.java b/src/mycompiler/mytype/TypePlaceholder.java index a443aea67..c53974ab5 100755 --- a/src/mycompiler/mytype/TypePlaceholder.java +++ b/src/mycompiler/mytype/TypePlaceholder.java @@ -115,7 +115,14 @@ public class TypePlaceholder extends Type implements IReplaceTypeEventProvider return ret; } - // ino.method.makeNewName.26803.defdescription type=javadoc + @Override + public Vector getInvolvedTypePlaceholder() { + Vector ret = super.getInvolvedTypePlaceholder(); + ret.add(this); + return ret; + } + + // ino.method.makeNewName.26803.defdescription type=javadoc /** * Berechnet einen neuen, eindeutigen Namen f�r eine neue * TypePlaceholder.
Author: J�rg B�uerle diff --git a/src/typinferenz/JavaCodeResult.java b/src/typinferenz/JavaCodeResult.java index 4d7b9f9ee..4fa8ebac5 100755 --- a/src/typinferenz/JavaCodeResult.java +++ b/src/typinferenz/JavaCodeResult.java @@ -9,6 +9,7 @@ import mycompiler.mytype.TypePlaceholder; public class JavaCodeResult{ private String javaCode = ""; + //TODO: unresolvedTPHs entfernen. BROKEN! private Vector unresolvedTPHs = new Vector(); public JavaCodeResult(){ diff --git a/src/typinferenz/GenericTypeInsertPoint.java b/src/typinferenz/typedeployment/GenericTypeInsertPoint.java similarity index 75% rename from src/typinferenz/GenericTypeInsertPoint.java rename to src/typinferenz/typedeployment/GenericTypeInsertPoint.java index 0ca14fd76..cfa4f4029 100644 --- a/src/typinferenz/GenericTypeInsertPoint.java +++ b/src/typinferenz/typedeployment/GenericTypeInsertPoint.java @@ -1,10 +1,12 @@ -package typinferenz; +package typinferenz.typedeployment; import java.util.Iterator; import java.util.Vector; +import typinferenz.JavaCodeResult; +import typinferenz.ResultSet; +import typinferenz.TypeInsertable; import typinferenz.exceptions.DebugException; -import typinferenz.typedeployment.TypeInsertPoint; import mycompiler.IItemWithOffset; import mycompiler.SyntaxTreeNode; import mycompiler.mytype.GenericTypeVar; @@ -18,41 +20,38 @@ import mycompiler.mytype.TypePlaceholder; * @author janulrich * */ -public class GenericTypeInsertPoint extends TypeInsertPoint { +public class GenericTypeInsertPoint extends SourcePatchPoint { - private Vector genericPairs = new Vector(); - - public GenericTypeInsertPoint(TypeInsertPoint p) { - super(p.point, p.type, p.resultSet); - } + private GenericVarPatch patch; + /* + * TODO: Der Generic Type Insert Point sollte mit Generics konstruiert werden. + * Dabei hält jeder InsertPoint nur ein Generic. Die <>-Klammern fügt das insertSet in den Quellcode ein. + * Die Reihenfolge der GenericTIPs ist beim Einsetzen dann egal. + */ public GenericTypeInsertPoint(TypeInsertable syntaxTreeNode, - TypePlaceholder tph ,ResultSet resultSet) { - super(syntaxTreeNode, tph, resultSet); + GenericVarPatch gtv ,ResultSet resultSet) { + this.patch = gtv; + this.point = syntaxTreeNode; } + /* 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(); + return this.patch.getInsertString(); } + /* @Override protected Type getInsertType(){ if(genericPairs.size()==0){ @@ -83,6 +82,7 @@ public class GenericTypeInsertPoint extends TypeInsertPoint { this.type = new RefType(genericTypeParameters,0); return this.type; } + */ @Override public boolean equals(Object obj){ @@ -91,19 +91,15 @@ public class GenericTypeInsertPoint extends TypeInsertPoint { } @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())); - } - } + public int compareTo(SourcePatchPoint arg0) { + int ret = super.compareTo(arg0); + if(ret == 0)ret = -1;//Hack der dazu führt, dass GTIP vor anderen InsertTypes eingesetzt werden. return ret; } - @Override + public TypeInsertable getInsertNode(){ - return super.getGenericTypeVarInsertNode(); + return this.point; } /** @@ -111,7 +107,7 @@ public class GenericTypeInsertPoint extends TypeInsertPoint { * 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())){ @@ -123,14 +119,15 @@ public class GenericTypeInsertPoint extends TypeInsertPoint { } return ret; } - + */ @Override - public JavaCodeResult insertType(String fileContent, int additionalOffset) { + public JavaCodeResult patch(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); + return super.patch(fileContent, additionalOffset); } + /* public boolean associatedWith(TypeInsertPoint tip, ResultSet resultSet) { if((tip.type instanceof TypePlaceholder)){ Vector tphs = new Vector<>(); @@ -144,4 +141,9 @@ public class GenericTypeInsertPoint extends TypeInsertPoint { return false; } + */ + @Override + public int getOffset() { + return point.getOffset(); + } } diff --git a/src/typinferenz/typedeployment/TypeInsertPoint.java b/src/typinferenz/typedeployment/TypeInsertPoint.java index 33741cd9a..fc00d9c73 100644 --- a/src/typinferenz/typedeployment/TypeInsertPoint.java +++ b/src/typinferenz/typedeployment/TypeInsertPoint.java @@ -19,11 +19,10 @@ import mycompiler.mytypereconstruction.replacementlistener.ITypeReplacementListe * @author janulrich * */ -public class TypeInsertPoint implements Comparable{ +public class TypeInsertPoint extends SourcePatchPoint { - public TypeInsertable point; + public Type type; - public ResultSet resultSet; /** * Dieser Konstruktor erstellt einen TypInsertPoint @@ -44,7 +43,7 @@ public class TypeInsertPoint implements Comparable{ * @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) { + public JavaCodeResult patch(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); @@ -94,23 +93,16 @@ public class TypeInsertPoint implements Comparable{ 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.getResultSet().equals(this.getResultSet())))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; + SyntaxTreeNode ret = (SyntaxTreeNode)this.getTIP(); while(!(ret instanceof Field || ret instanceof Class)){ ret = ret.getParent(); if(ret == null){ diff --git a/src/typinferenz/typedeployment/TypeInsertSet.java b/src/typinferenz/typedeployment/TypeInsertSet.java index 91e30e65d..5ce2fd26e 100644 --- a/src/typinferenz/typedeployment/TypeInsertSet.java +++ b/src/typinferenz/typedeployment/TypeInsertSet.java @@ -5,7 +5,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Vector; -import typinferenz.GenericTypeInsertPoint; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; import typinferenz.TypeInsertable; @@ -19,8 +18,7 @@ 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. + * SyntaxTreeNode berechnet nicht die GenericInsertPoints. Das wird vom InsertSet übernommen. * 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. */ @@ -68,13 +66,16 @@ public class TypeInsertSet { */ public String insertType(TypeInsertPoint tip, String fileContent){ TypePatchJob tpj = new TypePatchJob(); + /* int additionalOffset = 0; String ret = fileContent; - JavaCodeResult unresolvedTPHs = tip.insertType(ret, additionalOffset); + JavaCodeResult unresolvedTPHs = tip.patch(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); @@ -86,12 +87,13 @@ public class TypeInsertSet { * @param tpj */ public void insertType(TypeInsertPoint tip, TypePatchJob tpj){ - for(GenericTypeInsertPoint gip : this.genericTypeInsertPoints){ - if(gip.associatedWith(tip, this.resultSet)){ - tpj.add(gip); - } + GenericVarPatch gPatch = new GenericVarPatch();//Set der Einzusetzenden generischen Variablendeklarationen + for(Pair pair : this.resultSet.getConstraintsFor(tip.getInsertType().getInvolvedTypePlaceholder())){ + gPatch.add(pair); } + GenericTypeInsertPoint gip = new GenericTypeInsertPoint(tip.getGenericTypeVarInsertNode(), gPatch, resultSet); tpj.add(tip); + tpj.add(gip); } @@ -208,17 +210,17 @@ public class TypeInsertSet { * Stellt eine Reihe von TypeInsertions dar */ class TypePatchJob{ - private Vector points = new Vector<>(); - void add(TypeInsertPoint tip){ + private Vector points = new Vector<>(); + void add(SourcePatchPoint tip){ points.add(tip); } String run(String fileContent){ //sortieren (nach dem Offset der InsertPoints): Collections.sort(points); int additionalOffset = 0; - for(TypeInsertPoint p : points){ + for(SourcePatchPoint p : points){ //Zuerst den Typ einsetzen - JavaCodeResult insertCode = p.insertType(fileContent, additionalOffset); + JavaCodeResult insertCode = p.patch(fileContent, additionalOffset); fileContent = insertCode.toString(); //Dann Additional Offset korrigieren: additionalOffset += p.getInsertLength();