diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index 70bbb4df6..83b729ef9 100755 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,5 +1,5 @@ eclipse.preferences.version=1 +encoding//src/de/dhbwstuttgart/core/MyCompiler.java=UTF-8 encoding//src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java=UTF-8 encoding//src/de/dhbwstuttgart/typeinference/SingleConstraint.java=UTF-8 encoding//src/de/dhbwstuttgart/typeinference/UndConstraint.java=UTF-8 -encoding/=ISO-8859-1 diff --git a/bin/bytecode/FieldTest.jav b/bin/bytecode/FieldTest.jav deleted file mode 100644 index 57f1614ab..000000000 --- a/bin/bytecode/FieldTest.jav +++ /dev/null @@ -1,6 +0,0 @@ -class FieldTest{ - String var; - String methode(String para1){ - return var; - } -} \ No newline at end of file diff --git a/bin/mycompiler/test/blocks/TestForStmt.jav b/bin/mycompiler/test/blocks/TestForStmt.jav deleted file mode 100755 index a12ba6c8e..000000000 --- a/bin/mycompiler/test/blocks/TestForStmt.jav +++ /dev/null @@ -1,32 +0,0 @@ - -public class TestForStmt { - - public void m1() { - - i; - for (i=0;i<5;i++) { - - } - } - - public void m2() { - i; - for (i=0;i<5;i++) { - j; - j="abc"; - } - j; - j=3; - } - - public m3() { - i; - for (i=0;i<5;i++) { - j; - for (j=0;j<5;j++) { - return i==j; - } - } - } - -} \ No newline at end of file diff --git a/bin/mycompiler/test/blocks/TestIfStmt.jav b/bin/mycompiler/test/blocks/TestIfStmt.jav deleted file mode 100755 index de6e7e120..000000000 --- a/bin/mycompiler/test/blocks/TestIfStmt.jav +++ /dev/null @@ -1,27 +0,0 @@ -import de.dhbwstuttgart.typeinference.Menge; - -public class TestIfStmt { - - public m1() { - a; - if (a) { - return a; - } - else - return false; - } - - public m2() { - a; - c; - a = new Menge(); - if (a.isEmpty()) { - c="empty"; - } - else if (a.size()==1) { - c="almost empty"; - } - else - return a; - } -} \ No newline at end of file diff --git a/bin/mycompiler/test/blocks/TestInferenceAcrossBlocks.jav b/bin/mycompiler/test/blocks/TestInferenceAcrossBlocks.jav deleted file mode 100755 index 508f0aaff..000000000 --- a/bin/mycompiler/test/blocks/TestInferenceAcrossBlocks.jav +++ /dev/null @@ -1,12 +0,0 @@ -public class TestInferenceAcrossBlocks{ - - public m(a){ - if(a==true){ - return 3; - } - else { - x; - return x; - } - } -} \ No newline at end of file diff --git a/bin/mycompiler/test/blocks/TestSimpleBlocks.jav b/bin/mycompiler/test/blocks/TestSimpleBlocks.jav deleted file mode 100755 index 25d97b971..000000000 --- a/bin/mycompiler/test/blocks/TestSimpleBlocks.jav +++ /dev/null @@ -1,18 +0,0 @@ -public class TestSimpleBlocks{ - - public m(a){ - { - d; - d = 'a'; - { - c; - c = d; - } - { - c; - c = d==a; - } - } - return a; - } -} \ No newline at end of file diff --git a/bin/mycompiler/test/blocks/TestSimpleVariable.jav b/bin/mycompiler/test/blocks/TestSimpleVariable.jav deleted file mode 100755 index b3d3ba248..000000000 --- a/bin/mycompiler/test/blocks/TestSimpleVariable.jav +++ /dev/null @@ -1,7 +0,0 @@ -public class TestSimpleVariable { - - public m() { - c; - } - -} \ No newline at end of file diff --git a/bin/mycompiler/test/blocks/TestSwitchStmt.jav b/bin/mycompiler/test/blocks/TestSwitchStmt.jav deleted file mode 100755 index 1b9f689bc..000000000 --- a/bin/mycompiler/test/blocks/TestSwitchStmt.jav +++ /dev/null @@ -1,11 +0,0 @@ -public class TestSwitchStmt { - - public m(a) { - switch (a) { - case 1: return a++; break; - case 2: return a--; break; - default: return a; - } - - -} \ No newline at end of file diff --git a/bin/mycompiler/test/blocks/TestTryCatchBlock.jav b/bin/mycompiler/test/blocks/TestTryCatchBlock.jav deleted file mode 100755 index 59951045a..000000000 --- a/bin/mycompiler/test/blocks/TestTryCatchBlock.jav +++ /dev/null @@ -1,14 +0,0 @@ -public class TestTryCatchBlock { - - public m() { - - try { - return new TestTryCatchBlock(); - } - catch (e) { - return null; - } - - } - -} \ No newline at end of file diff --git a/bin/mycompiler/test/blocks/TestUndeterminedReturnNegative.jav b/bin/mycompiler/test/blocks/TestUndeterminedReturnNegative.jav deleted file mode 100755 index 166cd9739..000000000 --- a/bin/mycompiler/test/blocks/TestUndeterminedReturnNegative.jav +++ /dev/null @@ -1,12 +0,0 @@ - -public class TestUndeterminedReturnNegative { - - public m1(a) { - if (a) { - a=false; - } - else - return false; - } - -} \ No newline at end of file diff --git a/bin/mycompiler/test/blocks/TestUninitializedVariable.jav b/bin/mycompiler/test/blocks/TestUninitializedVariable.jav deleted file mode 100755 index 793bbbe8c..000000000 --- a/bin/mycompiler/test/blocks/TestUninitializedVariable.jav +++ /dev/null @@ -1,11 +0,0 @@ -public class TestUninitializedVariable { - - public void m1() { - a; - a++; - } - - void m2(T a) { - } - -} \ No newline at end of file diff --git a/bin/mycompiler/test/blocks/TestWhileStmt.jav b/bin/mycompiler/test/blocks/TestWhileStmt.jav deleted file mode 100755 index 1debca80b..000000000 --- a/bin/mycompiler/test/blocks/TestWhileStmt.jav +++ /dev/null @@ -1,9 +0,0 @@ -public class TestWhileStmt { - - public m1() { - i; - while (true) - i++; - } - -} \ No newline at end of file diff --git a/bin/mycompiler/test/complexTypes/TestOwnClassMember.jav b/bin/mycompiler/test/complexTypes/TestOwnClassMember.jav deleted file mode 100755 index fa73127e8..000000000 --- a/bin/mycompiler/test/complexTypes/TestOwnClassMember.jav +++ /dev/null @@ -1,9 +0,0 @@ -public class TestOwnClassMember { - - Integer a; - - public void m1(b) { - b += a; - } - -} \ No newline at end of file diff --git a/bin/mycompiler/test/complexTypes/TestOwnClassMethod.jav b/bin/mycompiler/test/complexTypes/TestOwnClassMethod.jav deleted file mode 100755 index e3d2a9255..000000000 --- a/bin/mycompiler/test/complexTypes/TestOwnClassMethod.jav +++ /dev/null @@ -1,12 +0,0 @@ -public class TestOwnClassMethod { - - Integer a; - - public void m1(b) { - a += b; - } - - public void m2(c, d) { - c.m1(d); - } - } \ No newline at end of file diff --git a/bin/mycompiler/test/complexTypes/TestStandardLibInheritanceInference.jav b/bin/mycompiler/test/complexTypes/TestStandardLibInheritanceInference.jav deleted file mode 100755 index deafc13a6..000000000 --- a/bin/mycompiler/test/complexTypes/TestStandardLibInheritanceInference.jav +++ /dev/null @@ -1,12 +0,0 @@ -import java.io.OutputStream; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.io.BufferedOutputStream; -import java.sql.Connection; - - -class TestStandardLibInheritanceInference{ - foo(x){ - x.close(); - } -} \ No newline at end of file diff --git a/bin/mycompiler/test/complexTypes/TestStandardLibMember.jav b/bin/mycompiler/test/complexTypes/TestStandardLibMember.jav deleted file mode 100755 index c54b0b142..000000000 --- a/bin/mycompiler/test/complexTypes/TestStandardLibMember.jav +++ /dev/null @@ -1,11 +0,0 @@ -import java.lang.System; -import java.io.PrintStream; - -public class TestStandardLibMember { - - public m1() { - a; - a=System.out; - a.println(); - } -} \ No newline at end of file diff --git a/bin/mycompiler/test/complexTypes/TestStandardLibMethod.jav b/bin/mycompiler/test/complexTypes/TestStandardLibMethod.jav deleted file mode 100755 index 3f01ac70f..000000000 --- a/bin/mycompiler/test/complexTypes/TestStandardLibMethod.jav +++ /dev/null @@ -1,20 +0,0 @@ -import java.util.HashMap; -import de.dhbwstuttgart.typeinference.Menge; - -public class TestStandardLibMethod { - - public m1() { - a; - a = new HashMap(); - a.put("2",-1); - } - - public m2(Menge> m){ - k; - k = 0; - ret; - ret = m.elementAt(k).elementAt(k).intValue(); - return ret; - } - -} \ No newline at end of file diff --git a/src/de/dhbwstuttgart/JvmDisassembler/jvmDisassembler.java b/src/de/dhbwstuttgart/JvmDisassembler/jvmDisassembler.java index 61d6261b4..6497d5db9 100755 --- a/src/de/dhbwstuttgart/JvmDisassembler/jvmDisassembler.java +++ b/src/de/dhbwstuttgart/JvmDisassembler/jvmDisassembler.java @@ -3,6 +3,8 @@ package de.dhbwstuttgart.JvmDisassembler; import java.util.*; import java.io.*; +import de.dhbwstuttgart.typeinference.Menge; + //GenricsTest.java Testfile fuer jvmDisassembler class jvmDisassembler { @@ -133,7 +135,7 @@ class jvmDisassembler { int constant_pool_count = makePosShort(d.readShort()); System.out.println("constant_pool_count = " + constant_pool_count); - Menge const_pool = new Menge(constant_pool_count); + Menge const_pool = new Menge(); const_pool.addElement(""); // Konstatenpool beginnt bei 1, Stelle 0 auffuellen System.out.println("constant_pool =\n{"); diff --git a/src/de/dhbwstuttgart/antlr/.classpath b/src/de/dhbwstuttgart/antlr/.classpath deleted file mode 100644 index 27af59ee5..000000000 --- a/src/de/dhbwstuttgart/antlr/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/de/dhbwstuttgart/antlr/.gitignore b/src/de/dhbwstuttgart/antlr/.gitignore deleted file mode 100644 index 2561ed578..000000000 --- a/src/de/dhbwstuttgart/antlr/.gitignore +++ /dev/null @@ -1,107 +0,0 @@ -/Java8Parser$AnnotationConstantRestContext.class -/Java8Parser$AnnotationContext.class -/Java8Parser$AnnotationMethodRestContext.class -/Java8Parser$CatchClauseContext.class -/Java8Parser$CatchTypeContext.class -/Java8Parser$ClassBodyContext.class -/Java8Parser$ClassCreatorRestContext.class -/Java8Parser$ClassDeclarationContext.class -/Java8Parser$CompilationUnitContext.class -/Java8Parser$ConstantDeclaratorContext.class -/Java8Parser$ConstantExpressionContext.class -/Java8Parser$ConstructorDeclarationContext.class -/Java8Parser$ElementValuePairsContext.class -/Java8Parser$EnumDeclarationContext.class -/Java8Parser$ExpressionContext.class -/Java8Parser$ExpressionListContext.class -/Java8Parser$FieldDeclarationContext.class -/Java8Parser$ForControlContext.class -/Java8Parser$ForUpdateContext.class -/Java8Parser$FormalParameterListContext.class -/Java8Parser$GenericConstructorDeclarationContext.class -/Java8Parser$InnerCreatorContext.class -/Java8Parser$InterfaceBodyContext.class -/Java8Parser$InterfaceMemberDeclarationContext.class -/Java8Parser$InterfaceMethodDeclarationContext.class -/Java8Parser$LastFormalParameterContext.class -/Java8Parser$LiteralContext.class -/Java8Parser$LocalVariableDeclarationStatementContext.class -/Java8Parser$MethodDeclarationContext.class -/Java8Parser$ModifierContext.class -/Java8Parser$NonWildcardTypeArgumentsContext.class -/Java8Parser$PrimitiveTypeContext.class -/Java8Parser$ResourceSpecificationContext.class -/Java8Parser$ResourcesContext.class -/Java8Parser$SwitchBlockStatementGroupContext.class -/Java8Parser$TypeArgumentsOrDiamondContext.class -/Java8Parser$TypeBoundContext.class -/Java8Parser$TypeDeclarationContext.class -/Java8Parser$TypeListContext.class -/Java8Parser$TypeParametersContext.class -/Java8Parser$VariableDeclaratorIdContext.class -/Java8Parser$VariableInitializerContext.class -/Java8Parser$VariableModifierContext.class -/SyntaxTreeBuilder.class -/Test.class -/Java8BaseListener.class -/Java8Lexer.class -/Java8Listener.class -/Java8Parser$AnnotationMethodOrConstantRestContext.class -/Java8Parser$AnnotationNameContext.class -/Java8Parser$AnnotationTypeBodyContext.class -/Java8Parser$AnnotationTypeDeclarationContext.class -/Java8Parser$AnnotationTypeElementDeclarationContext.class -/Java8Parser$AnnotationTypeElementRestContext.class -/Java8Parser$ArgumentsContext.class -/Java8Parser$ArrayCreatorRestContext.class -/Java8Parser$ArrayInitializerContext.class -/Java8Parser$BlockContext.class -/Java8Parser$BlockStatementContext.class -/Java8Parser$ClassBodyDeclarationContext.class -/Java8Parser$ClassOrInterfaceModifierContext.class -/Java8Parser$ClassOrInterfaceTypeContext.class -/Java8Parser$ConstDeclarationContext.class -/Java8Parser$ConstructorBodyContext.class -/Java8Parser$CreatedNameContext.class -/Java8Parser$CreatorContext.class -/Java8Parser$DefaultValueContext.class -/Java8Parser$ElementValueArrayInitializerContext.class -/Java8Parser$ElementValueContext.class -/Java8Parser$ElementValuePairContext.class -/Java8Parser$EnhancedForControlContext.class -/Java8Parser$EnumBodyDeclarationsContext.class -/Java8Parser$EnumConstantContext.class -/Java8Parser$EnumConstantNameContext.class -/Java8Parser$EnumConstantsContext.class -/Java8Parser$ExplicitGenericInvocationContext.class -/Java8Parser$ExplicitGenericInvocationSuffixContext.class -/Java8Parser$FinallyBlockContext.class -/Java8Parser$ForInitContext.class -/Java8Parser$FormalParameterContext.class -/Java8Parser$FormalParametersContext.class -/Java8Parser$GenericInterfaceMethodDeclarationContext.class -/Java8Parser$GenericMethodDeclarationContext.class -/Java8Parser$ImportDeclarationContext.class -/Java8Parser$InterfaceBodyDeclarationContext.class -/Java8Parser$InterfaceDeclarationContext.class -/Java8Parser$LocalVariableDeclarationContext.class -/Java8Parser$MemberDeclarationContext.class -/Java8Parser$MethodBodyContext.class -/Java8Parser$NonWildcardTypeArgumentsOrDiamondContext.class -/Java8Parser$PackageDeclarationContext.class -/Java8Parser$ParExpressionContext.class -/Java8Parser$PrimaryContext.class -/Java8Parser$QualifiedNameContext.class -/Java8Parser$QualifiedNameListContext.class -/Java8Parser$ResourceContext.class -/Java8Parser$StatementContext.class -/Java8Parser$StatementExpressionContext.class -/Java8Parser$SuperSuffixContext.class -/Java8Parser$SwitchLabelContext.class -/Java8Parser$TypeArgumentContext.class -/Java8Parser$TypeArgumentsContext.class -/Java8Parser$TypeContext.class -/Java8Parser$TypeParameterContext.class -/Java8Parser$VariableDeclaratorContext.class -/Java8Parser$VariableDeclaratorsContext.class -/Java8Parser.class diff --git a/src/de/dhbwstuttgart/antlr/.idea/.name b/src/de/dhbwstuttgart/antlr/.idea/.name deleted file mode 100644 index b14313281..000000000 --- a/src/de/dhbwstuttgart/antlr/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -antlr \ No newline at end of file diff --git a/src/de/dhbwstuttgart/antlr/.idea/antlr.iml b/src/de/dhbwstuttgart/antlr/.idea/antlr.iml deleted file mode 100644 index b3a364e2e..000000000 --- a/src/de/dhbwstuttgart/antlr/.idea/antlr.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/src/de/dhbwstuttgart/antlr/.idea/compiler.xml b/src/de/dhbwstuttgart/antlr/.idea/compiler.xml deleted file mode 100644 index 217af471a..000000000 --- a/src/de/dhbwstuttgart/antlr/.idea/compiler.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/src/de/dhbwstuttgart/antlr/.idea/copyright/profiles_settings.xml b/src/de/dhbwstuttgart/antlr/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf337..000000000 --- a/src/de/dhbwstuttgart/antlr/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/de/dhbwstuttgart/antlr/.idea/encodings.xml b/src/de/dhbwstuttgart/antlr/.idea/encodings.xml deleted file mode 100644 index e206d70d8..000000000 --- a/src/de/dhbwstuttgart/antlr/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/de/dhbwstuttgart/antlr/.idea/libraries/antlr_4_4_complete.xml b/src/de/dhbwstuttgart/antlr/.idea/libraries/antlr_4_4_complete.xml deleted file mode 100644 index 698589c2f..000000000 --- a/src/de/dhbwstuttgart/antlr/.idea/libraries/antlr_4_4_complete.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/de/dhbwstuttgart/antlr/.idea/misc.xml b/src/de/dhbwstuttgart/antlr/.idea/misc.xml deleted file mode 100644 index 308776f16..000000000 --- a/src/de/dhbwstuttgart/antlr/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/de/dhbwstuttgart/antlr/.idea/modules.xml b/src/de/dhbwstuttgart/antlr/.idea/modules.xml deleted file mode 100644 index 240806a45..000000000 --- a/src/de/dhbwstuttgart/antlr/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/de/dhbwstuttgart/antlr/.idea/scopes/scope_settings.xml b/src/de/dhbwstuttgart/antlr/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b84..000000000 --- a/src/de/dhbwstuttgart/antlr/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/de/dhbwstuttgart/antlr/.idea/vcs.xml b/src/de/dhbwstuttgart/antlr/.idea/vcs.xml deleted file mode 100644 index 275077f82..000000000 --- a/src/de/dhbwstuttgart/antlr/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/de/dhbwstuttgart/antlr/.idea/workspace.xml b/src/de/dhbwstuttgart/antlr/.idea/workspace.xml deleted file mode 100644 index aa55e5810..000000000 --- a/src/de/dhbwstuttgart/antlr/.idea/workspace.xml +++ /dev/null @@ -1,572 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - localhost - 5050 - - - - - - - - - - 1409770188585 - 1409770188585 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No facets are configured - - - - - - - - - - - - - - - 1.8 - - - - - - - - antlr - - - - - - - - 1.8 - - - - - - - - antlr-4.4-complete - - - - - - - - - diff --git a/src/de/dhbwstuttgart/antlr/.project b/src/de/dhbwstuttgart/antlr/.project deleted file mode 100644 index 44689db85..000000000 --- a/src/de/dhbwstuttgart/antlr/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - AntlrTest - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/src/de/dhbwstuttgart/antlr/Java8.g4 b/src/de/dhbwstuttgart/antlr/Java8.g4 deleted file mode 100644 index 2b1c778a3..000000000 --- a/src/de/dhbwstuttgart/antlr/Java8.g4 +++ /dev/null @@ -1,1028 +0,0 @@ -/* - [The "BSD licence"] - Copyright (c) 2014 Terence Parr, Sam Harwell - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* A Java 8 grammar for ANTLR v4 derived from ANTLR v3 Java grammar. - * Follows syntax from spec: - * http://docs.oracle.com/javase/specs/jls/se8/html/jls-19.html - * Uses ANTLR v4's left-recursive expression notation. - * - * You can test with - * - * $ antlr4 Java.g4 - * $ javac *.java - * $ grun Java compilationUnit *.java - * - * Or, -~/antlr/code/grammars-v4/java8 $ j Test . -/Users/parrt/antlr/code/grammars-v4/java8/./Java8BaseListener.java -/Users/parrt/antlr/code/grammars-v4/java8/./Java8Lexer.java -/Users/parrt/antlr/code/grammars-v4/java8/./Java8Listener.java -/Users/parrt/antlr/code/grammars-v4/java8/./Java8Parser.java -/Users/parrt/antlr/code/grammars-v4/java8/./Test.java -Total lexer+parser time 384ms. - */ -grammar Java8; - -// starting point for parsing a java file -compilationUnit - : packageDeclaration? importDeclaration* typeDeclaration* EOF - ; - -packageDeclaration - : annotation* 'package' qualifiedName ';' - ; - -importDeclaration - : 'import' 'static'? qualifiedName ('.' '*')? ';' - ; - -typeDeclaration - : classOrInterfaceModifier* classDeclaration - | classOrInterfaceModifier* enumDeclaration - | classOrInterfaceModifier* interfaceDeclaration - | classOrInterfaceModifier* annotationTypeDeclaration - | ';' - ; - -modifier - : classOrInterfaceModifier - | ( 'native' - | 'synchronized' - | 'transient' - | 'volatile' - ) - ; - -classOrInterfaceModifier - : annotation // class or interface - | ( 'public' // class or interface - | 'protected' // class or interface - | 'private' // class or interface - | 'static' // class or interface - | 'abstract' // class or interface - | 'final' // class only -- does not apply to interfaces - | 'strictfp' // class or interface - ) - ; - -variableModifier - : 'final' - | annotation - ; - -classDeclaration - : 'class' Identifier typeParameters? - ('extends' type)? - ('implements' typeList)? - classBody - ; - -typeParameters - : '<' typeParameter (',' typeParameter)* '>' - ; - -typeParameter - : Identifier ('extends' typeBound)? - ; - -typeBound - : type ('&' type)* - ; - -enumDeclaration - : ENUM Identifier ('implements' typeList)? - '{' enumConstants? ','? enumBodyDeclarations? '}' - ; - -enumConstants - : enumConstant (',' enumConstant)* - ; - -enumConstant - : annotation* Identifier arguments? classBody? - ; - -enumBodyDeclarations - : ';' classBodyDeclaration* - ; - -interfaceDeclaration - : 'interface' Identifier typeParameters? ('extends' typeList)? interfaceBody - ; - -typeList - : type (',' type)* - ; - -classBody - : '{' classBodyDeclaration* '}' - ; - -interfaceBody - : '{' interfaceBodyDeclaration* '}' - ; - -classBodyDeclaration - : ';' - | 'static'? block - | modifier* memberDeclaration - ; - -memberDeclaration - : methodDeclaration - | genericMethodDeclaration - | fieldDeclaration - | constructorDeclaration - | genericConstructorDeclaration - | interfaceDeclaration - | annotationTypeDeclaration - | classDeclaration - | enumDeclaration - ; - -/* We use rule this even for void methods which cannot have [] after parameters. - This simplifies grammar and we can consider void to be a type, which - renders the [] matching as a context-sensitive issue or a semantic check - for invalid return type after parsing. - */ -methodDeclaration - : (type|'void') Identifier formalParameters ('[' ']')* - ('throws' qualifiedNameList)? - ( methodBody - | ';' - ) - ; - -genericMethodDeclaration - : typeParameters methodDeclaration - ; - -constructorDeclaration - : Identifier formalParameters ('throws' qualifiedNameList)? - constructorBody - ; - -genericConstructorDeclaration - : typeParameters constructorDeclaration - ; - -fieldDeclaration - : type variableDeclarators ';' - ; - -interfaceBodyDeclaration - : modifier* interfaceMemberDeclaration - | ';' - ; - -interfaceMemberDeclaration - : constDeclaration - | interfaceMethodDeclaration - | genericInterfaceMethodDeclaration - | interfaceDeclaration - | annotationTypeDeclaration - | classDeclaration - | enumDeclaration - ; - -constDeclaration - : type constantDeclarator (',' constantDeclarator)* ';' - ; - -constantDeclarator - : Identifier ('[' ']')* '=' variableInitializer - ; - -// see matching of [] comment in methodDeclaratorRest -interfaceMethodDeclaration - : (type|'void') Identifier formalParameters ('[' ']')* - ('throws' qualifiedNameList)? - ';' - ; - -genericInterfaceMethodDeclaration - : typeParameters interfaceMethodDeclaration - ; - -variableDeclarators - : variableDeclarator (',' variableDeclarator)* - ; - -variableDeclarator - : variableDeclaratorId ('=' variableInitializer)? - ; - -variableDeclaratorId - : Identifier ('[' ']')* - ; - -variableInitializer - : arrayInitializer - | expression - ; - -arrayInitializer - : '{' (variableInitializer (',' variableInitializer)* (',')? )? '}' - ; - -enumConstantName - : Identifier - ; - -type - : classOrInterfaceType ('[' ']')* - | primitiveType ('[' ']')* - ; - -classOrInterfaceType - : Identifier typeArguments? ('.' Identifier typeArguments? )* - ; - -primitiveType - : 'boolean' - | 'char' - | 'byte' - | 'short' - | 'int' - | 'long' - | 'float' - | 'double' - ; - -typeArguments - : '<' typeArgument (',' typeArgument)* '>' - ; - -typeArgument - : type - | '?' (('extends' | 'super') type)? - ; - -qualifiedNameList - : qualifiedName (',' qualifiedName)* - ; - -formalParameters - : '(' formalParameterList? ')' - ; - -formalParameterList - : formalParameter (',' formalParameter)* (',' lastFormalParameter)? - | lastFormalParameter - ; - -formalParameter - : variableModifier* type variableDeclaratorId - ; - -lastFormalParameter - : variableModifier* type '...' variableDeclaratorId - ; - -methodBody - : block - ; - -constructorBody - : block - ; - -qualifiedName - : Identifier ('.' Identifier)* - ; - -literal - : IntegerLiteral - | FloatingPointLiteral - | CharacterLiteral - | StringLiteral - | BooleanLiteral - | 'null' - ; - -// ANNOTATIONS - -annotation - : '@' annotationName ( '(' ( elementValuePairs | elementValue )? ')' )? - ; - -annotationName : qualifiedName ; - -elementValuePairs - : elementValuePair (',' elementValuePair)* - ; - -elementValuePair - : Identifier '=' elementValue - ; - -elementValue - : expression - | annotation - | elementValueArrayInitializer - ; - -elementValueArrayInitializer - : '{' (elementValue (',' elementValue)*)? (',')? '}' - ; - -annotationTypeDeclaration - : '@' 'interface' Identifier annotationTypeBody - ; - -annotationTypeBody - : '{' (annotationTypeElementDeclaration)* '}' - ; - -annotationTypeElementDeclaration - : modifier* annotationTypeElementRest - | ';' // this is not allowed by the grammar, but apparently allowed by the actual compiler - ; - -annotationTypeElementRest - : type annotationMethodOrConstantRest ';' - | classDeclaration ';'? - | interfaceDeclaration ';'? - | enumDeclaration ';'? - | annotationTypeDeclaration ';'? - ; - -annotationMethodOrConstantRest - : annotationMethodRest - | annotationConstantRest - ; - -annotationMethodRest - : Identifier '(' ')' defaultValue? - ; - -annotationConstantRest - : variableDeclarators - ; - -defaultValue - : 'default' elementValue - ; - -// STATEMENTS / BLOCKS - -block - : '{' blockStatement* '}' - ; - -blockStatement - : localVariableDeclarationStatement - | statement - | typeDeclaration - ; - -localVariableDeclarationStatement - : localVariableDeclaration ';' - ; - -localVariableDeclaration - : variableModifier* type variableDeclarators - ; - -statement - : block - | ASSERT expression (':' expression)? ';' - | 'if' parExpression statement ('else' statement)? - | 'for' '(' forControl ')' statement - | 'while' parExpression statement - | 'do' statement 'while' parExpression ';' - | 'try' block (catchClause+ finallyBlock? | finallyBlock) - | 'try' resourceSpecification block catchClause* finallyBlock? - | 'switch' parExpression '{' switchBlockStatementGroup* switchLabel* '}' - | 'synchronized' parExpression block - | 'return' expression? ';' - | 'throw' expression ';' - | 'break' Identifier? ';' - | 'continue' Identifier? ';' - | ';' - | statementExpression ';' - | Identifier ':' statement - ; - -catchClause - : 'catch' '(' variableModifier* catchType Identifier ')' block - ; - -catchType - : qualifiedName ('|' qualifiedName)* - ; - -finallyBlock - : 'finally' block - ; - -resourceSpecification - : '(' resources ';'? ')' - ; - -resources - : resource (';' resource)* - ; - -resource - : variableModifier* classOrInterfaceType variableDeclaratorId '=' expression - ; - -/** Matches cases then statements, both of which are mandatory. - * To handle empty cases at the end, we add switchLabel* to statement. - */ -switchBlockStatementGroup - : switchLabel+ blockStatement+ - ; - -switchLabel - : 'case' constantExpression ':' - | 'case' enumConstantName ':' - | 'default' ':' - ; - -forControl - : enhancedForControl - | forInit? ';' expression? ';' forUpdate? - ; - -forInit - : localVariableDeclaration - | expressionList - ; - -enhancedForControl - : variableModifier* type Identifier ':' expression - ; - -forUpdate - : expressionList - ; - -// EXPRESSIONS - -parExpression - : '(' expression ')' - ; - -expressionList - : expression (',' expression)* - ; - -statementExpression - : expression - ; - -constantExpression - : expression - ; - -expression - : primary - | expression '.' Identifier - | expression '.' 'this' - | expression '.' 'new' nonWildcardTypeArguments? innerCreator - | expression '.' 'super' superSuffix - | expression '.' explicitGenericInvocation - | expression '[' expression ']' - | expression '(' expressionList? ')' - | 'new' creator - | '(' type ')' expression - | expression ('++' | '--') - | ('+'|'-'|'++'|'--') expression - | ('~'|'!') expression - | expression ('*'|'/'|'%') expression - | expression ('+'|'-') expression - | expression ('<' '<' | '>' '>' '>' | '>' '>') expression - | expression ('<=' | '>=' | '>' | '<') expression - | expression 'instanceof' type - | expression ('==' | '!=') expression - | expression '&' expression - | expression '^' expression - | expression '|' expression - | expression '&&' expression - | expression '||' expression - | expression '?' expression ':' expression - | expression - ( '=' - | '+=' - | '-=' - | '*=' - | '/=' - | '&=' - | '|=' - | '^=' - | '>>=' - | '>>>=' - | '<<=' - | '%=' - ) - expression - ; - -primary - : '(' expression ')' - | 'this' - | 'super' - | literal - | Identifier - | type '.' 'class' - | 'void' '.' 'class' - | nonWildcardTypeArguments (explicitGenericInvocationSuffix | 'this' arguments) - ; - -creator - : nonWildcardTypeArguments createdName classCreatorRest - | createdName (arrayCreatorRest | classCreatorRest) - ; - -createdName - : Identifier typeArgumentsOrDiamond? ('.' Identifier typeArgumentsOrDiamond?)* - | primitiveType - ; - -innerCreator - : Identifier nonWildcardTypeArgumentsOrDiamond? classCreatorRest - ; - -arrayCreatorRest - : '[' - ( ']' ('[' ']')* arrayInitializer - | expression ']' ('[' expression ']')* ('[' ']')* - ) - ; - -classCreatorRest - : arguments classBody? - ; - -explicitGenericInvocation - : nonWildcardTypeArguments explicitGenericInvocationSuffix - ; - -nonWildcardTypeArguments - : '<' typeList '>' - ; - -typeArgumentsOrDiamond - : '<' '>' - | typeArguments - ; - -nonWildcardTypeArgumentsOrDiamond - : '<' '>' - | nonWildcardTypeArguments - ; - -superSuffix - : arguments - | '.' Identifier arguments? - ; - -explicitGenericInvocationSuffix - : 'super' superSuffix - | Identifier arguments - ; - -arguments - : '(' expressionList? ')' - ; - -// LEXER - -// §3.9 Keywords - -ABSTRACT : 'abstract'; -ASSERT : 'assert'; -BOOLEAN : 'boolean'; -BREAK : 'break'; -BYTE : 'byte'; -CASE : 'case'; -CATCH : 'catch'; -CHAR : 'char'; -CLASS : 'class'; -CONST : 'const'; -CONTINUE : 'continue'; -DEFAULT : 'default'; -DO : 'do'; -DOUBLE : 'double'; -ELSE : 'else'; -ENUM : 'enum'; -EXTENDS : 'extends'; -FINAL : 'final'; -FINALLY : 'finally'; -FLOAT : 'float'; -FOR : 'for'; -IF : 'if'; -GOTO : 'goto'; -IMPLEMENTS : 'implements'; -IMPORT : 'import'; -INSTANCEOF : 'instanceof'; -INT : 'int'; -INTERFACE : 'interface'; -LONG : 'long'; -NATIVE : 'native'; -NEW : 'new'; -PACKAGE : 'package'; -PRIVATE : 'private'; -PROTECTED : 'protected'; -PUBLIC : 'public'; -RETURN : 'return'; -SHORT : 'short'; -STATIC : 'static'; -STRICTFP : 'strictfp'; -SUPER : 'super'; -SWITCH : 'switch'; -SYNCHRONIZED : 'synchronized'; -THIS : 'this'; -THROW : 'throw'; -THROWS : 'throws'; -TRANSIENT : 'transient'; -TRY : 'try'; -VOID : 'void'; -VOLATILE : 'volatile'; -WHILE : 'while'; - -// §3.10.1 Integer Literals - -IntegerLiteral - : DecimalIntegerLiteral - | HexIntegerLiteral - | OctalIntegerLiteral - | BinaryIntegerLiteral - ; - -fragment -DecimalIntegerLiteral - : DecimalNumeral IntegerTypeSuffix? - ; - -fragment -HexIntegerLiteral - : HexNumeral IntegerTypeSuffix? - ; - -fragment -OctalIntegerLiteral - : OctalNumeral IntegerTypeSuffix? - ; - -fragment -BinaryIntegerLiteral - : BinaryNumeral IntegerTypeSuffix? - ; - -fragment -IntegerTypeSuffix - : [lL] - ; - -fragment -DecimalNumeral - : '0' - | NonZeroDigit (Digits? | Underscores Digits) - ; - -fragment -Digits - : Digit (DigitOrUnderscore* Digit)? - ; - -fragment -Digit - : '0' - | NonZeroDigit - ; - -fragment -NonZeroDigit - : [1-9] - ; - -fragment -DigitOrUnderscore - : Digit - | '_' - ; - -fragment -Underscores - : '_'+ - ; - -fragment -HexNumeral - : '0' [xX] HexDigits - ; - -fragment -HexDigits - : HexDigit (HexDigitOrUnderscore* HexDigit)? - ; - -fragment -HexDigit - : [0-9a-fA-F] - ; - -fragment -HexDigitOrUnderscore - : HexDigit - | '_' - ; - -fragment -OctalNumeral - : '0' Underscores? OctalDigits - ; - -fragment -OctalDigits - : OctalDigit (OctalDigitOrUnderscore* OctalDigit)? - ; - -fragment -OctalDigit - : [0-7] - ; - -fragment -OctalDigitOrUnderscore - : OctalDigit - | '_' - ; - -fragment -BinaryNumeral - : '0' [bB] BinaryDigits - ; - -fragment -BinaryDigits - : BinaryDigit (BinaryDigitOrUnderscore* BinaryDigit)? - ; - -fragment -BinaryDigit - : [01] - ; - -fragment -BinaryDigitOrUnderscore - : BinaryDigit - | '_' - ; - -// §3.10.2 Floating-Point Literals - -FloatingPointLiteral - : DecimalFloatingPointLiteral - | HexadecimalFloatingPointLiteral - ; - -fragment -DecimalFloatingPointLiteral - : Digits '.' Digits? ExponentPart? FloatTypeSuffix? - | '.' Digits ExponentPart? FloatTypeSuffix? - | Digits ExponentPart FloatTypeSuffix? - | Digits FloatTypeSuffix - ; - -fragment -ExponentPart - : ExponentIndicator SignedInteger - ; - -fragment -ExponentIndicator - : [eE] - ; - -fragment -SignedInteger - : Sign? Digits - ; - -fragment -Sign - : [+-] - ; - -fragment -FloatTypeSuffix - : [fFdD] - ; - -fragment -HexadecimalFloatingPointLiteral - : HexSignificand BinaryExponent FloatTypeSuffix? - ; - -fragment -HexSignificand - : HexNumeral '.'? - | '0' [xX] HexDigits? '.' HexDigits - ; - -fragment -BinaryExponent - : BinaryExponentIndicator SignedInteger - ; - -fragment -BinaryExponentIndicator - : [pP] - ; - -// §3.10.3 Boolean Literals - -BooleanLiteral - : 'true' - | 'false' - ; - -// §3.10.4 Character Literals - -CharacterLiteral - : '\'' SingleCharacter '\'' - | '\'' EscapeSequence '\'' - ; - -fragment -SingleCharacter - : ~['\\] - ; - -// §3.10.5 String Literals - -StringLiteral - : '"' StringCharacters? '"' - ; - -fragment -StringCharacters - : StringCharacter+ - ; - -fragment -StringCharacter - : ~["\\] - | EscapeSequence - ; - -// §3.10.6 Escape Sequences for Character and String Literals - -fragment -EscapeSequence - : '\\' [btnfr"'\\] - | OctalEscape - | UnicodeEscape - ; - -fragment -OctalEscape - : '\\' OctalDigit - | '\\' OctalDigit OctalDigit - | '\\' ZeroToThree OctalDigit OctalDigit - ; - -fragment -UnicodeEscape - : '\\' 'u' HexDigit HexDigit HexDigit HexDigit - ; - -fragment -ZeroToThree - : [0-3] - ; - -// §3.10.7 The Null Literal - -NullLiteral - : 'null' - ; - -// §3.11 Separators - -LPAREN : '('; -RPAREN : ')'; -LBRACE : '{'; -RBRACE : '}'; -LBRACK : '['; -RBRACK : ']'; -SEMI : ';'; -COMMA : ','; -DOT : '.'; - -// §3.12 Operators - -ASSIGN : '='; -GT : '>'; -LT : '<'; -BANG : '!'; -TILDE : '~'; -QUESTION : '?'; -COLON : ':'; -EQUAL : '=='; -LE : '<='; -GE : '>='; -NOTEQUAL : '!='; -AND : '&&'; -OR : '||'; -INC : '++'; -DEC : '--'; -ADD : '+'; -SUB : '-'; -MUL : '*'; -DIV : '/'; -BITAND : '&'; -BITOR : '|'; -CARET : '^'; -MOD : '%'; - -ADD_ASSIGN : '+='; -SUB_ASSIGN : '-='; -MUL_ASSIGN : '*='; -DIV_ASSIGN : '/='; -AND_ASSIGN : '&='; -OR_ASSIGN : '|='; -XOR_ASSIGN : '^='; -MOD_ASSIGN : '%='; -LSHIFT_ASSIGN : '<<='; -RSHIFT_ASSIGN : '>>='; -URSHIFT_ASSIGN : '>>>='; - -// §3.8 Identifiers (must appear after all keywords in the grammar) - -Identifier - : JavaLetter JavaLetterOrDigit* - ; - -fragment -JavaLetter - : [a-zA-Z$_] // these are the "java letters" below 0xFF - | // covers all characters above 0xFF which are not a surrogate - ~[\u0000-\u00FF\uD800-\uDBFF] - {Character.isJavaIdentifierStart(_input.LA(-1))}? - | // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF - [\uD800-\uDBFF] [\uDC00-\uDFFF] - {Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}? - ; - -fragment -JavaLetterOrDigit - : [a-zA-Z0-9$_] // these are the "java letters or digits" below 0xFF - | // covers all characters above 0xFF which are not a surrogate - ~[\u0000-\u00FF\uD800-\uDBFF] - {Character.isJavaIdentifierPart(_input.LA(-1))}? - | // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF - [\uD800-\uDBFF] [\uDC00-\uDFFF] - {Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}? - ; - -// -// Additional symbols not defined in the lexical specification -// - -AT : '@'; -ELLIPSIS : '...'; - -// -// Whitespace and comments -// - -WS : [ \t\r\n\u000C]+ -> skip - ; - -COMMENT - : '/*' .*? '*/' -> skip - ; - -LINE_COMMENT - : '//' ~[\r\n]* -> skip - ; diff --git a/src/de/dhbwstuttgart/antlr/Java8.tokens b/src/de/dhbwstuttgart/antlr/Java8.tokens deleted file mode 100644 index 3f62bddf3..000000000 --- a/src/de/dhbwstuttgart/antlr/Java8.tokens +++ /dev/null @@ -1,201 +0,0 @@ -THROW=44 -STATIC=38 -INTERFACE=28 -AND_ASSIGN=93 -BREAK=4 -BYTE=5 -ELSE=15 -IF=22 -ENUM=16 -SUB=82 -BANG=69 -LPAREN=57 -DOT=65 -CASE=6 -AT=101 -LINE_COMMENT=105 -StringLiteral=55 -ELLIPSIS=102 -LBRACK=61 -PUBLIC=35 -THROWS=45 -NullLiteral=56 -RSHIFT_ASSIGN=98 -LBRACE=59 -GOTO=23 -SUB_ASSIGN=90 -SEMI=63 -CHAR=8 -ASSIGN=66 -COMMENT=104 -IMPORT=25 -BITOR=86 -CATCH=7 -MUL_ASSIGN=91 -DOUBLE=14 -PROTECTED=34 -LONG=29 -COMMA=64 -BITAND=85 -PRIVATE=33 -CONTINUE=11 -DIV=84 -FloatingPointLiteral=52 -LE=74 -CharacterLiteral=54 -VOLATILE=49 -EXTENDS=17 -INSTANCEOF=26 -NEW=31 -ADD=81 -LT=68 -CLASS=9 -DO=13 -FINALLY=19 -Identifier=100 -CONST=10 -PACKAGE=32 -OR_ASSIGN=94 -TRY=47 -IntegerLiteral=51 -SYNCHRONIZED=42 -MUL=83 -FOR=21 -FINAL=18 -RPAREN=58 -CARET=87 -URSHIFT_ASSIGN=99 -BOOLEAN=3 -NOTEQUAL=76 -RBRACK=62 -RBRACE=60 -AND=77 -THIS=43 -SWITCH=41 -VOID=48 -TRANSIENT=46 -INC=79 -FLOAT=20 -NATIVE=30 -DIV_ASSIGN=92 -BooleanLiteral=53 -ABSTRACT=1 -STRICTFP=39 -INT=27 -QUESTION=71 -RETURN=36 -LSHIFT_ASSIGN=97 -ADD_ASSIGN=89 -WS=103 -GE=75 -SUPER=40 -OR=78 -DEC=80 -MOD=88 -XOR_ASSIGN=95 -ASSERT=2 -EQUAL=73 -IMPLEMENTS=24 -COLON=72 -GT=67 -SHORT=37 -MOD_ASSIGN=96 -WHILE=50 -TILDE=70 -DEFAULT=12 -'import'=25 -'-'=82 -')'=58 -'super'=40 -'else'=15 -'%'=88 -'!'=69 -'>'=67 -'public'=35 -'=='=73 -'--'=80 -'|'=86 -'['=61 -':'=72 -'...'=102 -'throw'=44 -'case'=6 -'.'=65 -'this'=43 -'*'=83 -'switch'=41 -'synchronized'=42 -'&'=85 -'double'=14 -'break'=4 -'short'=37 -'<='=74 -'enum'=16 -'try'=47 -'?'=71 -'if'=22 -'extends'=17 -'goto'=23 -'}'=60 -'instanceof'=26 -';'=63 -'||'=78 -'>>='=98 -'class'=9 -'return'=36 -'&='=93 -'catch'=7 -'native'=30 -'continue'=11 -'strictfp'=39 -'/'=84 -'*='=91 -'+'=81 -'final'=18 -'protected'=34 -'static'=38 -'@'=101 -'transient'=46 -'~'=70 -'assert'=2 -']'=62 -'<'=68 -'++'=79 -'>>>='=99 -'>='=75 -'long'=29 -'boolean'=3 -'const'=10 -'abstract'=1 -'implements'=24 -'volatile'=49 -'throws'=45 -'/='=92 -','=64 -'-='=90 -'do'=13 -'package'=32 -'('=57 -'null'=56 -'int'=27 -'|='=94 -'for'=21 -'^'=87 -'<<='=97 -'='=66 -'byte'=5 -'&&'=77 -'^='=95 -'void'=48 -'while'=50 -'{'=59 -'float'=20 -'!='=76 -'new'=31 -'char'=8 -'finally'=19 -'interface'=28 -'%='=96 -'private'=33 -'+='=89 -'default'=12 diff --git a/src/de/dhbwstuttgart/antlr/Java8BaseVisitor.java b/src/de/dhbwstuttgart/antlr/Java8BaseVisitor.java deleted file mode 100644 index 0050e6c7b..000000000 --- a/src/de/dhbwstuttgart/antlr/Java8BaseVisitor.java +++ /dev/null @@ -1,723 +0,0 @@ -package de.dhbwstuttgart.antlr; - -// Generated from Java8.g4 by ANTLR 4.4 -import org.antlr.v4.runtime.misc.NotNull; -import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; - -/** - * This class provides an empty implementation of {@link Java8Visitor}, - * which can be extended to create a visitor which only needs to handle a subset - * of the available methods. - * - * @param The return type of the visit operation. Use {@link Void} for - * operations with no return type. - */ -public class Java8BaseVisitor extends AbstractParseTreeVisitor implements Java8Visitor { - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitMemberDeclaration(@NotNull Java8Parser.MemberDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitDefaultValue(@NotNull Java8Parser.DefaultValueContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitAnnotationTypeElementDeclaration(@NotNull Java8Parser.AnnotationTypeElementDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitType(@NotNull Java8Parser.TypeContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitAnnotationTypeBody(@NotNull Java8Parser.AnnotationTypeBodyContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitGenericInterfaceMethodDeclaration(@NotNull Java8Parser.GenericInterfaceMethodDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitClassBodyDeclaration(@NotNull Java8Parser.ClassBodyDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitBlock(@NotNull Java8Parser.BlockContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitEnumBodyDeclarations(@NotNull Java8Parser.EnumBodyDeclarationsContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitForUpdate(@NotNull Java8Parser.ForUpdateContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitEnhancedForControl(@NotNull Java8Parser.EnhancedForControlContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitAnnotationConstantRest(@NotNull Java8Parser.AnnotationConstantRestContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitExplicitGenericInvocation(@NotNull Java8Parser.ExplicitGenericInvocationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitNonWildcardTypeArgumentsOrDiamond(@NotNull Java8Parser.NonWildcardTypeArgumentsOrDiamondContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitExpressionList(@NotNull Java8Parser.ExpressionListContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitAnnotationTypeElementRest(@NotNull Java8Parser.AnnotationTypeElementRestContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitClassOrInterfaceType(@NotNull Java8Parser.ClassOrInterfaceTypeContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitTypeBound(@NotNull Java8Parser.TypeBoundContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitVariableDeclaratorId(@NotNull Java8Parser.VariableDeclaratorIdContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitPrimary(@NotNull Java8Parser.PrimaryContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitClassCreatorRest(@NotNull Java8Parser.ClassCreatorRestContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitInterfaceBodyDeclaration(@NotNull Java8Parser.InterfaceBodyDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitTypeArguments(@NotNull Java8Parser.TypeArgumentsContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitAnnotationName(@NotNull Java8Parser.AnnotationNameContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitFinallyBlock(@NotNull Java8Parser.FinallyBlockContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitTypeParameters(@NotNull Java8Parser.TypeParametersContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitLastFormalParameter(@NotNull Java8Parser.LastFormalParameterContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitConstructorBody(@NotNull Java8Parser.ConstructorBodyContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitLiteral(@NotNull Java8Parser.LiteralContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitAnnotationMethodOrConstantRest(@NotNull Java8Parser.AnnotationMethodOrConstantRestContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitCatchClause(@NotNull Java8Parser.CatchClauseContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitVariableDeclarator(@NotNull Java8Parser.VariableDeclaratorContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitTypeList(@NotNull Java8Parser.TypeListContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitEnumConstants(@NotNull Java8Parser.EnumConstantsContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitClassBody(@NotNull Java8Parser.ClassBodyContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitCreatedName(@NotNull Java8Parser.CreatedNameContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitEnumDeclaration(@NotNull Java8Parser.EnumDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitFormalParameter(@NotNull Java8Parser.FormalParameterContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitParExpression(@NotNull Java8Parser.ParExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitAnnotation(@NotNull Java8Parser.AnnotationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitVariableInitializer(@NotNull Java8Parser.VariableInitializerContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitElementValueArrayInitializer(@NotNull Java8Parser.ElementValueArrayInitializerContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitCreator(@NotNull Java8Parser.CreatorContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitArrayCreatorRest(@NotNull Java8Parser.ArrayCreatorRestContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitExpression(@NotNull Java8Parser.ExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitConstantExpression(@NotNull Java8Parser.ConstantExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitQualifiedNameList(@NotNull Java8Parser.QualifiedNameListContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitConstructorDeclaration(@NotNull Java8Parser.ConstructorDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitForControl(@NotNull Java8Parser.ForControlContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitSuperSuffix(@NotNull Java8Parser.SuperSuffixContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitVariableDeclarators(@NotNull Java8Parser.VariableDeclaratorsContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitCatchType(@NotNull Java8Parser.CatchTypeContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitClassOrInterfaceModifier(@NotNull Java8Parser.ClassOrInterfaceModifierContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitEnumConstantName(@NotNull Java8Parser.EnumConstantNameContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitModifier(@NotNull Java8Parser.ModifierContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitInnerCreator(@NotNull Java8Parser.InnerCreatorContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitExplicitGenericInvocationSuffix(@NotNull Java8Parser.ExplicitGenericInvocationSuffixContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitVariableModifier(@NotNull Java8Parser.VariableModifierContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitElementValuePair(@NotNull Java8Parser.ElementValuePairContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitArrayInitializer(@NotNull Java8Parser.ArrayInitializerContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitElementValue(@NotNull Java8Parser.ElementValueContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitConstDeclaration(@NotNull Java8Parser.ConstDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitResource(@NotNull Java8Parser.ResourceContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitQualifiedName(@NotNull Java8Parser.QualifiedNameContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitResourceSpecification(@NotNull Java8Parser.ResourceSpecificationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitFormalParameterList(@NotNull Java8Parser.FormalParameterListContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitAnnotationTypeDeclaration(@NotNull Java8Parser.AnnotationTypeDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitCompilationUnit(@NotNull Java8Parser.CompilationUnitContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitAnnotationMethodRest(@NotNull Java8Parser.AnnotationMethodRestContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitSwitchBlockStatementGroup(@NotNull Java8Parser.SwitchBlockStatementGroupContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitTypeParameter(@NotNull Java8Parser.TypeParameterContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitInterfaceBody(@NotNull Java8Parser.InterfaceBodyContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitMethodDeclaration(@NotNull Java8Parser.MethodDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitMethodBody(@NotNull Java8Parser.MethodBodyContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitTypeArgument(@NotNull Java8Parser.TypeArgumentContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitTypeDeclaration(@NotNull Java8Parser.TypeDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitGenericConstructorDeclaration(@NotNull Java8Parser.GenericConstructorDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitClassDeclaration(@NotNull Java8Parser.ClassDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitEnumConstant(@NotNull Java8Parser.EnumConstantContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitStatement(@NotNull Java8Parser.StatementContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitImportDeclaration(@NotNull Java8Parser.ImportDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitPrimitiveType(@NotNull Java8Parser.PrimitiveTypeContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitInterfaceDeclaration(@NotNull Java8Parser.InterfaceDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitLocalVariableDeclarationStatement(@NotNull Java8Parser.LocalVariableDeclarationStatementContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitBlockStatement(@NotNull Java8Parser.BlockStatementContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitFieldDeclaration(@NotNull Java8Parser.FieldDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitConstantDeclarator(@NotNull Java8Parser.ConstantDeclaratorContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitResources(@NotNull Java8Parser.ResourcesContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitStatementExpression(@NotNull Java8Parser.StatementExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitInterfaceMethodDeclaration(@NotNull Java8Parser.InterfaceMethodDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitPackageDeclaration(@NotNull Java8Parser.PackageDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitElementValuePairs(@NotNull Java8Parser.ElementValuePairsContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitLocalVariableDeclaration(@NotNull Java8Parser.LocalVariableDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitNonWildcardTypeArguments(@NotNull Java8Parser.NonWildcardTypeArgumentsContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitInterfaceMemberDeclaration(@NotNull Java8Parser.InterfaceMemberDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitSwitchLabel(@NotNull Java8Parser.SwitchLabelContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitForInit(@NotNull Java8Parser.ForInitContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitFormalParameters(@NotNull Java8Parser.FormalParametersContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitArguments(@NotNull Java8Parser.ArgumentsContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitGenericMethodDeclaration(@NotNull Java8Parser.GenericMethodDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitTypeArgumentsOrDiamond(@NotNull Java8Parser.TypeArgumentsOrDiamondContext ctx) { return visitChildren(ctx); } -} \ No newline at end of file diff --git a/src/de/dhbwstuttgart/antlr/Java8Lexer.java b/src/de/dhbwstuttgart/antlr/Java8Lexer.java deleted file mode 100644 index 8af172451..000000000 --- a/src/de/dhbwstuttgart/antlr/Java8Lexer.java +++ /dev/null @@ -1,517 +0,0 @@ -package de.dhbwstuttgart.antlr; - -// Generated from Java8.g4 by ANTLR 4.4 -import org.antlr.v4.runtime.Lexer; -import org.antlr.v4.runtime.CharStream; -import org.antlr.v4.runtime.Token; -import org.antlr.v4.runtime.TokenStream; -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.DFA; -import org.antlr.v4.runtime.misc.*; - -@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) -public class Java8Lexer extends Lexer { - static { RuntimeMetaData.checkVersion("4.4", RuntimeMetaData.VERSION); } - - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - public static final int - ABSTRACT=1, ASSERT=2, BOOLEAN=3, BREAK=4, BYTE=5, CASE=6, CATCH=7, CHAR=8, - CLASS=9, CONST=10, CONTINUE=11, DEFAULT=12, DO=13, DOUBLE=14, ELSE=15, - ENUM=16, EXTENDS=17, FINAL=18, FINALLY=19, FLOAT=20, FOR=21, IF=22, GOTO=23, - IMPLEMENTS=24, IMPORT=25, INSTANCEOF=26, INT=27, INTERFACE=28, LONG=29, - NATIVE=30, NEW=31, PACKAGE=32, PRIVATE=33, PROTECTED=34, PUBLIC=35, RETURN=36, - SHORT=37, STATIC=38, STRICTFP=39, SUPER=40, SWITCH=41, SYNCHRONIZED=42, - THIS=43, THROW=44, THROWS=45, TRANSIENT=46, TRY=47, VOID=48, VOLATILE=49, - WHILE=50, IntegerLiteral=51, FloatingPointLiteral=52, BooleanLiteral=53, - CharacterLiteral=54, StringLiteral=55, NullLiteral=56, LPAREN=57, RPAREN=58, - LBRACE=59, RBRACE=60, LBRACK=61, RBRACK=62, SEMI=63, COMMA=64, DOT=65, - ASSIGN=66, GT=67, LT=68, BANG=69, TILDE=70, QUESTION=71, COLON=72, EQUAL=73, - LE=74, GE=75, NOTEQUAL=76, AND=77, OR=78, INC=79, DEC=80, ADD=81, SUB=82, - MUL=83, DIV=84, BITAND=85, BITOR=86, CARET=87, MOD=88, ADD_ASSIGN=89, - SUB_ASSIGN=90, MUL_ASSIGN=91, DIV_ASSIGN=92, AND_ASSIGN=93, OR_ASSIGN=94, - XOR_ASSIGN=95, MOD_ASSIGN=96, LSHIFT_ASSIGN=97, RSHIFT_ASSIGN=98, URSHIFT_ASSIGN=99, - Identifier=100, AT=101, ELLIPSIS=102, WS=103, COMMENT=104, LINE_COMMENT=105; - public static String[] modeNames = { - "DEFAULT_MODE" - }; - - public static final String[] tokenNames = { - "'\\u0000'", "'\\u0001'", "'\\u0002'", "'\\u0003'", "'\\u0004'", "'\\u0005'", - "'\\u0006'", "'\\u0007'", "'\b'", "'\t'", "'\n'", "'\\u000B'", "'\f'", - "'\r'", "'\\u000E'", "'\\u000F'", "'\\u0010'", "'\\u0011'", "'\\u0012'", - "'\\u0013'", "'\\u0014'", "'\\u0015'", "'\\u0016'", "'\\u0017'", "'\\u0018'", - "'\\u0019'", "'\\u001A'", "'\\u001B'", "'\\u001C'", "'\\u001D'", "'\\u001E'", - "'\\u001F'", "' '", "'!'", "'\"'", "'#'", "'$'", "'%'", "'&'", "'''", - "'('", "')'", "'*'", "'+'", "','", "'-'", "'.'", "'/'", "'0'", "'1'", - "'2'", "'3'", "'4'", "'5'", "'6'", "'7'", "'8'", "'9'", "':'", "';'", - "'<'", "'='", "'>'", "'?'", "'@'", "'A'", "'B'", "'C'", "'D'", "'E'", - "'F'", "'G'", "'H'", "'I'", "'J'", "'K'", "'L'", "'M'", "'N'", "'O'", - "'P'", "'Q'", "'R'", "'S'", "'T'", "'U'", "'V'", "'W'", "'X'", "'Y'", - "'Z'", "'['", "'\\'", "']'", "'^'", "'_'", "'`'", "'a'", "'b'", "'c'", - "'d'", "'e'", "'f'", "'g'", "'h'", "'i'" - }; - public static final String[] ruleNames = { - "ABSTRACT", "ASSERT", "BOOLEAN", "BREAK", "BYTE", "CASE", "CATCH", "CHAR", - "CLASS", "CONST", "CONTINUE", "DEFAULT", "DO", "DOUBLE", "ELSE", "ENUM", - "EXTENDS", "FINAL", "FINALLY", "FLOAT", "FOR", "IF", "GOTO", "IMPLEMENTS", - "IMPORT", "INSTANCEOF", "INT", "INTERFACE", "LONG", "NATIVE", "NEW", "PACKAGE", - "PRIVATE", "PROTECTED", "PUBLIC", "RETURN", "SHORT", "STATIC", "STRICTFP", - "SUPER", "SWITCH", "SYNCHRONIZED", "THIS", "THROW", "THROWS", "TRANSIENT", - "TRY", "VOID", "VOLATILE", "WHILE", "IntegerLiteral", "DecimalIntegerLiteral", - "HexIntegerLiteral", "OctalIntegerLiteral", "BinaryIntegerLiteral", "IntegerTypeSuffix", - "DecimalNumeral", "Digits", "Digit", "NonZeroDigit", "DigitOrUnderscore", - "Underscores", "HexNumeral", "HexDigits", "HexDigit", "HexDigitOrUnderscore", - "OctalNumeral", "OctalDigits", "OctalDigit", "OctalDigitOrUnderscore", - "BinaryNumeral", "BinaryDigits", "BinaryDigit", "BinaryDigitOrUnderscore", - "FloatingPointLiteral", "DecimalFloatingPointLiteral", "ExponentPart", - "ExponentIndicator", "SignedInteger", "Sign", "FloatTypeSuffix", "HexadecimalFloatingPointLiteral", - "HexSignificand", "BinaryExponent", "BinaryExponentIndicator", "BooleanLiteral", - "CharacterLiteral", "SingleCharacter", "StringLiteral", "StringCharacters", - "StringCharacter", "EscapeSequence", "OctalEscape", "UnicodeEscape", "ZeroToThree", - "NullLiteral", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", "RBRACK", - "SEMI", "COMMA", "DOT", "ASSIGN", "GT", "LT", "BANG", "TILDE", "QUESTION", - "COLON", "EQUAL", "LE", "GE", "NOTEQUAL", "AND", "OR", "INC", "DEC", "ADD", - "SUB", "MUL", "DIV", "BITAND", "BITOR", "CARET", "MOD", "ADD_ASSIGN", - "SUB_ASSIGN", "MUL_ASSIGN", "DIV_ASSIGN", "AND_ASSIGN", "OR_ASSIGN", "XOR_ASSIGN", - "MOD_ASSIGN", "LSHIFT_ASSIGN", "RSHIFT_ASSIGN", "URSHIFT_ASSIGN", "Identifier", - "JavaLetter", "JavaLetterOrDigit", "AT", "ELLIPSIS", "WS", "COMMENT", - "LINE_COMMENT" - }; - - - public Java8Lexer(CharStream input) { - super(input); - _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - - @Override - public String getGrammarFileName() { return "Java8.g4"; } - - @Override - public String[] getTokenNames() { return tokenNames; } - - @Override - public String[] getRuleNames() { return ruleNames; } - - @Override - public String getSerializedATN() { return _serializedATN; } - - @Override - public String[] getModeNames() { return modeNames; } - - @Override - public ATN getATN() { return _ATN; } - - @Override - public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { - switch (ruleIndex) { - case 140: return JavaLetter_sempred((RuleContext)_localctx, predIndex); - case 141: return JavaLetterOrDigit_sempred((RuleContext)_localctx, predIndex); - } - return true; - } - private boolean JavaLetterOrDigit_sempred(RuleContext _localctx, int predIndex) { - switch (predIndex) { - case 2: return Character.isJavaIdentifierPart(_input.LA(-1)); - case 3: return Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1))); - } - return true; - } - private boolean JavaLetter_sempred(RuleContext _localctx, int predIndex) { - switch (predIndex) { - case 0: return Character.isJavaIdentifierStart(_input.LA(-1)); - case 1: return Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1))); - } - return true; - } - - public static final String _serializedATN = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2k\u042e\b\1\4\2\t"+ - "\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ - "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ - "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ - "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+ - "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+ - ",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+ - "\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+ - "\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4I"+ - "\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\tT"+ - "\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\\4]\t]\4^\t^\4_\t_\4"+ - "`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\4g\tg\4h\th\4i\ti\4j\tj\4k\t"+ - "k\4l\tl\4m\tm\4n\tn\4o\to\4p\tp\4q\tq\4r\tr\4s\ts\4t\tt\4u\tu\4v\tv\4"+ - "w\tw\4x\tx\4y\ty\4z\tz\4{\t{\4|\t|\4}\t}\4~\t~\4\177\t\177\4\u0080\t\u0080"+ - "\4\u0081\t\u0081\4\u0082\t\u0082\4\u0083\t\u0083\4\u0084\t\u0084\4\u0085"+ - "\t\u0085\4\u0086\t\u0086\4\u0087\t\u0087\4\u0088\t\u0088\4\u0089\t\u0089"+ - "\4\u008a\t\u008a\4\u008b\t\u008b\4\u008c\t\u008c\4\u008d\t\u008d\4\u008e"+ - "\t\u008e\4\u008f\t\u008f\4\u0090\t\u0090\4\u0091\t\u0091\4\u0092\t\u0092"+ - "\4\u0093\t\u0093\4\u0094\t\u0094\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3"+ - "\3\3\3\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5"+ - "\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3"+ - "\b\3\b\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13"+ - "\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r"+ - "\3\r\3\r\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3"+ - "\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22\3\22\3\22\3"+ - "\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3"+ - "\24\3\24\3\25\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\26\3\26\3\27\3\27\3"+ - "\27\3\30\3\30\3\30\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3"+ - "\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\33\3\33\3\33\3\33\3"+ - "\33\3\33\3\33\3\33\3\33\3\33\3\33\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3"+ - "\35\3\35\3\35\3\35\3\35\3\35\3\35\3\36\3\36\3\36\3\36\3\36\3\37\3\37\3"+ - "\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3!\3!\3!\3!\3!\3!\3!\3!\3\"\3\"\3"+ - "\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\3#\3#\3#\3#\3#\3#\3#\3$\3$\3$\3$\3$\3"+ - "$\3$\3%\3%\3%\3%\3%\3%\3%\3&\3&\3&\3&\3&\3&\3\'\3\'\3\'\3\'\3\'\3\'\3"+ - "\'\3(\3(\3(\3(\3(\3(\3(\3(\3(\3)\3)\3)\3)\3)\3)\3*\3*\3*\3*\3*\3*\3*\3"+ - "+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3,\3,\3,\3,\3,\3-\3-\3-\3-\3-\3"+ - "-\3.\3.\3.\3.\3.\3.\3.\3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\3\60\3\60\3\60\3"+ - "\60\3\61\3\61\3\61\3\61\3\61\3\62\3\62\3\62\3\62\3\62\3\62\3\62\3\62\3"+ - "\62\3\63\3\63\3\63\3\63\3\63\3\63\3\64\3\64\3\64\3\64\5\64\u0281\n\64"+ - "\3\65\3\65\5\65\u0285\n\65\3\66\3\66\5\66\u0289\n\66\3\67\3\67\5\67\u028d"+ - "\n\67\38\38\58\u0291\n8\39\39\3:\3:\3:\5:\u0298\n:\3:\3:\3:\5:\u029d\n"+ - ":\5:\u029f\n:\3;\3;\7;\u02a3\n;\f;\16;\u02a6\13;\3;\5;\u02a9\n;\3<\3<"+ - "\5<\u02ad\n<\3=\3=\3>\3>\5>\u02b3\n>\3?\6?\u02b6\n?\r?\16?\u02b7\3@\3"+ - "@\3@\3@\3A\3A\7A\u02c0\nA\fA\16A\u02c3\13A\3A\5A\u02c6\nA\3B\3B\3C\3C"+ - "\5C\u02cc\nC\3D\3D\5D\u02d0\nD\3D\3D\3E\3E\7E\u02d6\nE\fE\16E\u02d9\13"+ - "E\3E\5E\u02dc\nE\3F\3F\3G\3G\5G\u02e2\nG\3H\3H\3H\3H\3I\3I\7I\u02ea\n"+ - "I\fI\16I\u02ed\13I\3I\5I\u02f0\nI\3J\3J\3K\3K\5K\u02f6\nK\3L\3L\5L\u02fa"+ - "\nL\3M\3M\3M\5M\u02ff\nM\3M\5M\u0302\nM\3M\5M\u0305\nM\3M\3M\3M\5M\u030a"+ - "\nM\3M\5M\u030d\nM\3M\3M\3M\5M\u0312\nM\3M\3M\3M\5M\u0317\nM\3N\3N\3N"+ - "\3O\3O\3P\5P\u031f\nP\3P\3P\3Q\3Q\3R\3R\3S\3S\3S\5S\u032a\nS\3T\3T\5T"+ - "\u032e\nT\3T\3T\3T\5T\u0333\nT\3T\3T\5T\u0337\nT\3U\3U\3U\3V\3V\3W\3W"+ - "\3W\3W\3W\3W\3W\3W\3W\5W\u0347\nW\3X\3X\3X\3X\3X\3X\3X\3X\5X\u0351\nX"+ - "\3Y\3Y\3Z\3Z\5Z\u0357\nZ\3Z\3Z\3[\6[\u035c\n[\r[\16[\u035d\3\\\3\\\5\\"+ - "\u0362\n\\\3]\3]\3]\3]\5]\u0368\n]\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\5"+ - "^\u0375\n^\3_\3_\3_\3_\3_\3_\3_\3`\3`\3a\3a\3a\3a\3a\3b\3b\3c\3c\3d\3"+ - "d\3e\3e\3f\3f\3g\3g\3h\3h\3i\3i\3j\3j\3k\3k\3l\3l\3m\3m\3n\3n\3o\3o\3"+ - "p\3p\3q\3q\3r\3r\3r\3s\3s\3s\3t\3t\3t\3u\3u\3u\3v\3v\3v\3w\3w\3w\3x\3"+ - "x\3x\3y\3y\3y\3z\3z\3{\3{\3|\3|\3}\3}\3~\3~\3\177\3\177\3\u0080\3\u0080"+ - "\3\u0081\3\u0081\3\u0082\3\u0082\3\u0082\3\u0083\3\u0083\3\u0083\3\u0084"+ - "\3\u0084\3\u0084\3\u0085\3\u0085\3\u0085\3\u0086\3\u0086\3\u0086\3\u0087"+ - "\3\u0087\3\u0087\3\u0088\3\u0088\3\u0088\3\u0089\3\u0089\3\u0089\3\u008a"+ - "\3\u008a\3\u008a\3\u008a\3\u008b\3\u008b\3\u008b\3\u008b\3\u008c\3\u008c"+ - "\3\u008c\3\u008c\3\u008c\3\u008d\3\u008d\7\u008d\u03f4\n\u008d\f\u008d"+ - "\16\u008d\u03f7\13\u008d\3\u008e\3\u008e\3\u008e\3\u008e\3\u008e\3\u008e"+ - "\5\u008e\u03ff\n\u008e\3\u008f\3\u008f\3\u008f\3\u008f\3\u008f\3\u008f"+ - "\5\u008f\u0407\n\u008f\3\u0090\3\u0090\3\u0091\3\u0091\3\u0091\3\u0091"+ - "\3\u0092\6\u0092\u0410\n\u0092\r\u0092\16\u0092\u0411\3\u0092\3\u0092"+ - "\3\u0093\3\u0093\3\u0093\3\u0093\7\u0093\u041a\n\u0093\f\u0093\16\u0093"+ - "\u041d\13\u0093\3\u0093\3\u0093\3\u0093\3\u0093\3\u0093\3\u0094\3\u0094"+ - "\3\u0094\3\u0094\7\u0094\u0428\n\u0094\f\u0094\16\u0094\u042b\13\u0094"+ - "\3\u0094\3\u0094\3\u041b\2\u0095\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23"+ - "\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31"+ - "\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/]\60"+ - "_\61a\62c\63e\64g\65i\2k\2m\2o\2q\2s\2u\2w\2y\2{\2}\2\177\2\u0081\2\u0083"+ - "\2\u0085\2\u0087\2\u0089\2\u008b\2\u008d\2\u008f\2\u0091\2\u0093\2\u0095"+ - "\2\u0097\66\u0099\2\u009b\2\u009d\2\u009f\2\u00a1\2\u00a3\2\u00a5\2\u00a7"+ - "\2\u00a9\2\u00ab\2\u00ad\67\u00af8\u00b1\2\u00b39\u00b5\2\u00b7\2\u00b9"+ - "\2\u00bb\2\u00bd\2\u00bf\2\u00c1:\u00c3;\u00c5<\u00c7=\u00c9>\u00cb?\u00cd"+ - "@\u00cfA\u00d1B\u00d3C\u00d5D\u00d7E\u00d9F\u00dbG\u00ddH\u00dfI\u00e1"+ - "J\u00e3K\u00e5L\u00e7M\u00e9N\u00ebO\u00edP\u00efQ\u00f1R\u00f3S\u00f5"+ - "T\u00f7U\u00f9V\u00fbW\u00fdX\u00ffY\u0101Z\u0103[\u0105\\\u0107]\u0109"+ - "^\u010b_\u010d`\u010fa\u0111b\u0113c\u0115d\u0117e\u0119f\u011b\2\u011d"+ - "\2\u011fg\u0121h\u0123i\u0125j\u0127k\3\2\30\4\2NNnn\3\2\63;\4\2ZZzz\5"+ - "\2\62;CHch\3\2\629\4\2DDdd\3\2\62\63\4\2GGgg\4\2--//\6\2FFHHffhh\4\2R"+ - "Rrr\4\2))^^\4\2$$^^\n\2$$))^^ddhhppttvv\3\2\62\65\6\2&&C\\aac|\4\2\2\u0101"+ - "\ud802\udc01\3\2\ud802\udc01\3\2\udc02\ue001\7\2&&\62;C\\aac|\5\2\13\f"+ - "\16\17\"\"\4\2\f\f\17\17\u043c\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t"+ - "\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2"+ - "\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2"+ - "\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2"+ - "+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2"+ - "\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2"+ - "C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3"+ - "\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3\2\2"+ - "\2\2]\3\2\2\2\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2\2\2e\3\2\2\2\2g\3\2\2\2\2"+ - "\u0097\3\2\2\2\2\u00ad\3\2\2\2\2\u00af\3\2\2\2\2\u00b3\3\2\2\2\2\u00c1"+ - "\3\2\2\2\2\u00c3\3\2\2\2\2\u00c5\3\2\2\2\2\u00c7\3\2\2\2\2\u00c9\3\2\2"+ - "\2\2\u00cb\3\2\2\2\2\u00cd\3\2\2\2\2\u00cf\3\2\2\2\2\u00d1\3\2\2\2\2\u00d3"+ - "\3\2\2\2\2\u00d5\3\2\2\2\2\u00d7\3\2\2\2\2\u00d9\3\2\2\2\2\u00db\3\2\2"+ - "\2\2\u00dd\3\2\2\2\2\u00df\3\2\2\2\2\u00e1\3\2\2\2\2\u00e3\3\2\2\2\2\u00e5"+ - "\3\2\2\2\2\u00e7\3\2\2\2\2\u00e9\3\2\2\2\2\u00eb\3\2\2\2\2\u00ed\3\2\2"+ - "\2\2\u00ef\3\2\2\2\2\u00f1\3\2\2\2\2\u00f3\3\2\2\2\2\u00f5\3\2\2\2\2\u00f7"+ - "\3\2\2\2\2\u00f9\3\2\2\2\2\u00fb\3\2\2\2\2\u00fd\3\2\2\2\2\u00ff\3\2\2"+ - "\2\2\u0101\3\2\2\2\2\u0103\3\2\2\2\2\u0105\3\2\2\2\2\u0107\3\2\2\2\2\u0109"+ - "\3\2\2\2\2\u010b\3\2\2\2\2\u010d\3\2\2\2\2\u010f\3\2\2\2\2\u0111\3\2\2"+ - "\2\2\u0113\3\2\2\2\2\u0115\3\2\2\2\2\u0117\3\2\2\2\2\u0119\3\2\2\2\2\u011f"+ - "\3\2\2\2\2\u0121\3\2\2\2\2\u0123\3\2\2\2\2\u0125\3\2\2\2\2\u0127\3\2\2"+ - "\2\3\u0129\3\2\2\2\5\u0132\3\2\2\2\7\u0139\3\2\2\2\t\u0141\3\2\2\2\13"+ - "\u0147\3\2\2\2\r\u014c\3\2\2\2\17\u0151\3\2\2\2\21\u0157\3\2\2\2\23\u015c"+ - "\3\2\2\2\25\u0162\3\2\2\2\27\u0168\3\2\2\2\31\u0171\3\2\2\2\33\u0179\3"+ - "\2\2\2\35\u017c\3\2\2\2\37\u0183\3\2\2\2!\u0188\3\2\2\2#\u018d\3\2\2\2"+ - "%\u0195\3\2\2\2\'\u019b\3\2\2\2)\u01a3\3\2\2\2+\u01a9\3\2\2\2-\u01ad\3"+ - "\2\2\2/\u01b0\3\2\2\2\61\u01b5\3\2\2\2\63\u01c0\3\2\2\2\65\u01c7\3\2\2"+ - "\2\67\u01d2\3\2\2\29\u01d6\3\2\2\2;\u01e0\3\2\2\2=\u01e5\3\2\2\2?\u01ec"+ - "\3\2\2\2A\u01f0\3\2\2\2C\u01f8\3\2\2\2E\u0200\3\2\2\2G\u020a\3\2\2\2I"+ - "\u0211\3\2\2\2K\u0218\3\2\2\2M\u021e\3\2\2\2O\u0225\3\2\2\2Q\u022e\3\2"+ - "\2\2S\u0234\3\2\2\2U\u023b\3\2\2\2W\u0248\3\2\2\2Y\u024d\3\2\2\2[\u0253"+ - "\3\2\2\2]\u025a\3\2\2\2_\u0264\3\2\2\2a\u0268\3\2\2\2c\u026d\3\2\2\2e"+ - "\u0276\3\2\2\2g\u0280\3\2\2\2i\u0282\3\2\2\2k\u0286\3\2\2\2m\u028a\3\2"+ - "\2\2o\u028e\3\2\2\2q\u0292\3\2\2\2s\u029e\3\2\2\2u\u02a0\3\2\2\2w\u02ac"+ - "\3\2\2\2y\u02ae\3\2\2\2{\u02b2\3\2\2\2}\u02b5\3\2\2\2\177\u02b9\3\2\2"+ - "\2\u0081\u02bd\3\2\2\2\u0083\u02c7\3\2\2\2\u0085\u02cb\3\2\2\2\u0087\u02cd"+ - "\3\2\2\2\u0089\u02d3\3\2\2\2\u008b\u02dd\3\2\2\2\u008d\u02e1\3\2\2\2\u008f"+ - "\u02e3\3\2\2\2\u0091\u02e7\3\2\2\2\u0093\u02f1\3\2\2\2\u0095\u02f5\3\2"+ - "\2\2\u0097\u02f9\3\2\2\2\u0099\u0316\3\2\2\2\u009b\u0318\3\2\2\2\u009d"+ - "\u031b\3\2\2\2\u009f\u031e\3\2\2\2\u00a1\u0322\3\2\2\2\u00a3\u0324\3\2"+ - "\2\2\u00a5\u0326\3\2\2\2\u00a7\u0336\3\2\2\2\u00a9\u0338\3\2\2\2\u00ab"+ - "\u033b\3\2\2\2\u00ad\u0346\3\2\2\2\u00af\u0350\3\2\2\2\u00b1\u0352\3\2"+ - "\2\2\u00b3\u0354\3\2\2\2\u00b5\u035b\3\2\2\2\u00b7\u0361\3\2\2\2\u00b9"+ - "\u0367\3\2\2\2\u00bb\u0374\3\2\2\2\u00bd\u0376\3\2\2\2\u00bf\u037d\3\2"+ - "\2\2\u00c1\u037f\3\2\2\2\u00c3\u0384\3\2\2\2\u00c5\u0386\3\2\2\2\u00c7"+ - "\u0388\3\2\2\2\u00c9\u038a\3\2\2\2\u00cb\u038c\3\2\2\2\u00cd\u038e\3\2"+ - "\2\2\u00cf\u0390\3\2\2\2\u00d1\u0392\3\2\2\2\u00d3\u0394\3\2\2\2\u00d5"+ - "\u0396\3\2\2\2\u00d7\u0398\3\2\2\2\u00d9\u039a\3\2\2\2\u00db\u039c\3\2"+ - "\2\2\u00dd\u039e\3\2\2\2\u00df\u03a0\3\2\2\2\u00e1\u03a2\3\2\2\2\u00e3"+ - "\u03a4\3\2\2\2\u00e5\u03a7\3\2\2\2\u00e7\u03aa\3\2\2\2\u00e9\u03ad\3\2"+ - "\2\2\u00eb\u03b0\3\2\2\2\u00ed\u03b3\3\2\2\2\u00ef\u03b6\3\2\2\2\u00f1"+ - "\u03b9\3\2\2\2\u00f3\u03bc\3\2\2\2\u00f5\u03be\3\2\2\2\u00f7\u03c0\3\2"+ - "\2\2\u00f9\u03c2\3\2\2\2\u00fb\u03c4\3\2\2\2\u00fd\u03c6\3\2\2\2\u00ff"+ - "\u03c8\3\2\2\2\u0101\u03ca\3\2\2\2\u0103\u03cc\3\2\2\2\u0105\u03cf\3\2"+ - "\2\2\u0107\u03d2\3\2\2\2\u0109\u03d5\3\2\2\2\u010b\u03d8\3\2\2\2\u010d"+ - "\u03db\3\2\2\2\u010f\u03de\3\2\2\2\u0111\u03e1\3\2\2\2\u0113\u03e4\3\2"+ - "\2\2\u0115\u03e8\3\2\2\2\u0117\u03ec\3\2\2\2\u0119\u03f1\3\2\2\2\u011b"+ - "\u03fe\3\2\2\2\u011d\u0406\3\2\2\2\u011f\u0408\3\2\2\2\u0121\u040a\3\2"+ - "\2\2\u0123\u040f\3\2\2\2\u0125\u0415\3\2\2\2\u0127\u0423\3\2\2\2\u0129"+ - "\u012a\7c\2\2\u012a\u012b\7d\2\2\u012b\u012c\7u\2\2\u012c\u012d\7v\2\2"+ - "\u012d\u012e\7t\2\2\u012e\u012f\7c\2\2\u012f\u0130\7e\2\2\u0130\u0131"+ - "\7v\2\2\u0131\4\3\2\2\2\u0132\u0133\7c\2\2\u0133\u0134\7u\2\2\u0134\u0135"+ - "\7u\2\2\u0135\u0136\7g\2\2\u0136\u0137\7t\2\2\u0137\u0138\7v\2\2\u0138"+ - "\6\3\2\2\2\u0139\u013a\7d\2\2\u013a\u013b\7q\2\2\u013b\u013c\7q\2\2\u013c"+ - "\u013d\7n\2\2\u013d\u013e\7g\2\2\u013e\u013f\7c\2\2\u013f\u0140\7p\2\2"+ - "\u0140\b\3\2\2\2\u0141\u0142\7d\2\2\u0142\u0143\7t\2\2\u0143\u0144\7g"+ - "\2\2\u0144\u0145\7c\2\2\u0145\u0146\7m\2\2\u0146\n\3\2\2\2\u0147\u0148"+ - "\7d\2\2\u0148\u0149\7{\2\2\u0149\u014a\7v\2\2\u014a\u014b\7g\2\2\u014b"+ - "\f\3\2\2\2\u014c\u014d\7e\2\2\u014d\u014e\7c\2\2\u014e\u014f\7u\2\2\u014f"+ - "\u0150\7g\2\2\u0150\16\3\2\2\2\u0151\u0152\7e\2\2\u0152\u0153\7c\2\2\u0153"+ - "\u0154\7v\2\2\u0154\u0155\7e\2\2\u0155\u0156\7j\2\2\u0156\20\3\2\2\2\u0157"+ - "\u0158\7e\2\2\u0158\u0159\7j\2\2\u0159\u015a\7c\2\2\u015a\u015b\7t\2\2"+ - "\u015b\22\3\2\2\2\u015c\u015d\7e\2\2\u015d\u015e\7n\2\2\u015e\u015f\7"+ - "c\2\2\u015f\u0160\7u\2\2\u0160\u0161\7u\2\2\u0161\24\3\2\2\2\u0162\u0163"+ - "\7e\2\2\u0163\u0164\7q\2\2\u0164\u0165\7p\2\2\u0165\u0166\7u\2\2\u0166"+ - "\u0167\7v\2\2\u0167\26\3\2\2\2\u0168\u0169\7e\2\2\u0169\u016a\7q\2\2\u016a"+ - "\u016b\7p\2\2\u016b\u016c\7v\2\2\u016c\u016d\7k\2\2\u016d\u016e\7p\2\2"+ - "\u016e\u016f\7w\2\2\u016f\u0170\7g\2\2\u0170\30\3\2\2\2\u0171\u0172\7"+ - "f\2\2\u0172\u0173\7g\2\2\u0173\u0174\7h\2\2\u0174\u0175\7c\2\2\u0175\u0176"+ - "\7w\2\2\u0176\u0177\7n\2\2\u0177\u0178\7v\2\2\u0178\32\3\2\2\2\u0179\u017a"+ - "\7f\2\2\u017a\u017b\7q\2\2\u017b\34\3\2\2\2\u017c\u017d\7f\2\2\u017d\u017e"+ - "\7q\2\2\u017e\u017f\7w\2\2\u017f\u0180\7d\2\2\u0180\u0181\7n\2\2\u0181"+ - "\u0182\7g\2\2\u0182\36\3\2\2\2\u0183\u0184\7g\2\2\u0184\u0185\7n\2\2\u0185"+ - "\u0186\7u\2\2\u0186\u0187\7g\2\2\u0187 \3\2\2\2\u0188\u0189\7g\2\2\u0189"+ - "\u018a\7p\2\2\u018a\u018b\7w\2\2\u018b\u018c\7o\2\2\u018c\"\3\2\2\2\u018d"+ - "\u018e\7g\2\2\u018e\u018f\7z\2\2\u018f\u0190\7v\2\2\u0190\u0191\7g\2\2"+ - "\u0191\u0192\7p\2\2\u0192\u0193\7f\2\2\u0193\u0194\7u\2\2\u0194$\3\2\2"+ - "\2\u0195\u0196\7h\2\2\u0196\u0197\7k\2\2\u0197\u0198\7p\2\2\u0198\u0199"+ - "\7c\2\2\u0199\u019a\7n\2\2\u019a&\3\2\2\2\u019b\u019c\7h\2\2\u019c\u019d"+ - "\7k\2\2\u019d\u019e\7p\2\2\u019e\u019f\7c\2\2\u019f\u01a0\7n\2\2\u01a0"+ - "\u01a1\7n\2\2\u01a1\u01a2\7{\2\2\u01a2(\3\2\2\2\u01a3\u01a4\7h\2\2\u01a4"+ - "\u01a5\7n\2\2\u01a5\u01a6\7q\2\2\u01a6\u01a7\7c\2\2\u01a7\u01a8\7v\2\2"+ - "\u01a8*\3\2\2\2\u01a9\u01aa\7h\2\2\u01aa\u01ab\7q\2\2\u01ab\u01ac\7t\2"+ - "\2\u01ac,\3\2\2\2\u01ad\u01ae\7k\2\2\u01ae\u01af\7h\2\2\u01af.\3\2\2\2"+ - "\u01b0\u01b1\7i\2\2\u01b1\u01b2\7q\2\2\u01b2\u01b3\7v\2\2\u01b3\u01b4"+ - "\7q\2\2\u01b4\60\3\2\2\2\u01b5\u01b6\7k\2\2\u01b6\u01b7\7o\2\2\u01b7\u01b8"+ - "\7r\2\2\u01b8\u01b9\7n\2\2\u01b9\u01ba\7g\2\2\u01ba\u01bb\7o\2\2\u01bb"+ - "\u01bc\7g\2\2\u01bc\u01bd\7p\2\2\u01bd\u01be\7v\2\2\u01be\u01bf\7u\2\2"+ - "\u01bf\62\3\2\2\2\u01c0\u01c1\7k\2\2\u01c1\u01c2\7o\2\2\u01c2\u01c3\7"+ - "r\2\2\u01c3\u01c4\7q\2\2\u01c4\u01c5\7t\2\2\u01c5\u01c6\7v\2\2\u01c6\64"+ - "\3\2\2\2\u01c7\u01c8\7k\2\2\u01c8\u01c9\7p\2\2\u01c9\u01ca\7u\2\2\u01ca"+ - "\u01cb\7v\2\2\u01cb\u01cc\7c\2\2\u01cc\u01cd\7p\2\2\u01cd\u01ce\7e\2\2"+ - "\u01ce\u01cf\7g\2\2\u01cf\u01d0\7q\2\2\u01d0\u01d1\7h\2\2\u01d1\66\3\2"+ - "\2\2\u01d2\u01d3\7k\2\2\u01d3\u01d4\7p\2\2\u01d4\u01d5\7v\2\2\u01d58\3"+ - "\2\2\2\u01d6\u01d7\7k\2\2\u01d7\u01d8\7p\2\2\u01d8\u01d9\7v\2\2\u01d9"+ - "\u01da\7g\2\2\u01da\u01db\7t\2\2\u01db\u01dc\7h\2\2\u01dc\u01dd\7c\2\2"+ - "\u01dd\u01de\7e\2\2\u01de\u01df\7g\2\2\u01df:\3\2\2\2\u01e0\u01e1\7n\2"+ - "\2\u01e1\u01e2\7q\2\2\u01e2\u01e3\7p\2\2\u01e3\u01e4\7i\2\2\u01e4<\3\2"+ - "\2\2\u01e5\u01e6\7p\2\2\u01e6\u01e7\7c\2\2\u01e7\u01e8\7v\2\2\u01e8\u01e9"+ - "\7k\2\2\u01e9\u01ea\7x\2\2\u01ea\u01eb\7g\2\2\u01eb>\3\2\2\2\u01ec\u01ed"+ - "\7p\2\2\u01ed\u01ee\7g\2\2\u01ee\u01ef\7y\2\2\u01ef@\3\2\2\2\u01f0\u01f1"+ - "\7r\2\2\u01f1\u01f2\7c\2\2\u01f2\u01f3\7e\2\2\u01f3\u01f4\7m\2\2\u01f4"+ - "\u01f5\7c\2\2\u01f5\u01f6\7i\2\2\u01f6\u01f7\7g\2\2\u01f7B\3\2\2\2\u01f8"+ - "\u01f9\7r\2\2\u01f9\u01fa\7t\2\2\u01fa\u01fb\7k\2\2\u01fb\u01fc\7x\2\2"+ - "\u01fc\u01fd\7c\2\2\u01fd\u01fe\7v\2\2\u01fe\u01ff\7g\2\2\u01ffD\3\2\2"+ - "\2\u0200\u0201\7r\2\2\u0201\u0202\7t\2\2\u0202\u0203\7q\2\2\u0203\u0204"+ - "\7v\2\2\u0204\u0205\7g\2\2\u0205\u0206\7e\2\2\u0206\u0207\7v\2\2\u0207"+ - "\u0208\7g\2\2\u0208\u0209\7f\2\2\u0209F\3\2\2\2\u020a\u020b\7r\2\2\u020b"+ - "\u020c\7w\2\2\u020c\u020d\7d\2\2\u020d\u020e\7n\2\2\u020e\u020f\7k\2\2"+ - "\u020f\u0210\7e\2\2\u0210H\3\2\2\2\u0211\u0212\7t\2\2\u0212\u0213\7g\2"+ - "\2\u0213\u0214\7v\2\2\u0214\u0215\7w\2\2\u0215\u0216\7t\2\2\u0216\u0217"+ - "\7p\2\2\u0217J\3\2\2\2\u0218\u0219\7u\2\2\u0219\u021a\7j\2\2\u021a\u021b"+ - "\7q\2\2\u021b\u021c\7t\2\2\u021c\u021d\7v\2\2\u021dL\3\2\2\2\u021e\u021f"+ - "\7u\2\2\u021f\u0220\7v\2\2\u0220\u0221\7c\2\2\u0221\u0222\7v\2\2\u0222"+ - "\u0223\7k\2\2\u0223\u0224\7e\2\2\u0224N\3\2\2\2\u0225\u0226\7u\2\2\u0226"+ - "\u0227\7v\2\2\u0227\u0228\7t\2\2\u0228\u0229\7k\2\2\u0229\u022a\7e\2\2"+ - "\u022a\u022b\7v\2\2\u022b\u022c\7h\2\2\u022c\u022d\7r\2\2\u022dP\3\2\2"+ - "\2\u022e\u022f\7u\2\2\u022f\u0230\7w\2\2\u0230\u0231\7r\2\2\u0231\u0232"+ - "\7g\2\2\u0232\u0233\7t\2\2\u0233R\3\2\2\2\u0234\u0235\7u\2\2\u0235\u0236"+ - "\7y\2\2\u0236\u0237\7k\2\2\u0237\u0238\7v\2\2\u0238\u0239\7e\2\2\u0239"+ - "\u023a\7j\2\2\u023aT\3\2\2\2\u023b\u023c\7u\2\2\u023c\u023d\7{\2\2\u023d"+ - "\u023e\7p\2\2\u023e\u023f\7e\2\2\u023f\u0240\7j\2\2\u0240\u0241\7t\2\2"+ - "\u0241\u0242\7q\2\2\u0242\u0243\7p\2\2\u0243\u0244\7k\2\2\u0244\u0245"+ - "\7|\2\2\u0245\u0246\7g\2\2\u0246\u0247\7f\2\2\u0247V\3\2\2\2\u0248\u0249"+ - "\7v\2\2\u0249\u024a\7j\2\2\u024a\u024b\7k\2\2\u024b\u024c\7u\2\2\u024c"+ - "X\3\2\2\2\u024d\u024e\7v\2\2\u024e\u024f\7j\2\2\u024f\u0250\7t\2\2\u0250"+ - "\u0251\7q\2\2\u0251\u0252\7y\2\2\u0252Z\3\2\2\2\u0253\u0254\7v\2\2\u0254"+ - "\u0255\7j\2\2\u0255\u0256\7t\2\2\u0256\u0257\7q\2\2\u0257\u0258\7y\2\2"+ - "\u0258\u0259\7u\2\2\u0259\\\3\2\2\2\u025a\u025b\7v\2\2\u025b\u025c\7t"+ - "\2\2\u025c\u025d\7c\2\2\u025d\u025e\7p\2\2\u025e\u025f\7u\2\2\u025f\u0260"+ - "\7k\2\2\u0260\u0261\7g\2\2\u0261\u0262\7p\2\2\u0262\u0263\7v\2\2\u0263"+ - "^\3\2\2\2\u0264\u0265\7v\2\2\u0265\u0266\7t\2\2\u0266\u0267\7{\2\2\u0267"+ - "`\3\2\2\2\u0268\u0269\7x\2\2\u0269\u026a\7q\2\2\u026a\u026b\7k\2\2\u026b"+ - "\u026c\7f\2\2\u026cb\3\2\2\2\u026d\u026e\7x\2\2\u026e\u026f\7q\2\2\u026f"+ - "\u0270\7n\2\2\u0270\u0271\7c\2\2\u0271\u0272\7v\2\2\u0272\u0273\7k\2\2"+ - "\u0273\u0274\7n\2\2\u0274\u0275\7g\2\2\u0275d\3\2\2\2\u0276\u0277\7y\2"+ - "\2\u0277\u0278\7j\2\2\u0278\u0279\7k\2\2\u0279\u027a\7n\2\2\u027a\u027b"+ - "\7g\2\2\u027bf\3\2\2\2\u027c\u0281\5i\65\2\u027d\u0281\5k\66\2\u027e\u0281"+ - "\5m\67\2\u027f\u0281\5o8\2\u0280\u027c\3\2\2\2\u0280\u027d\3\2\2\2\u0280"+ - "\u027e\3\2\2\2\u0280\u027f\3\2\2\2\u0281h\3\2\2\2\u0282\u0284\5s:\2\u0283"+ - "\u0285\5q9\2\u0284\u0283\3\2\2\2\u0284\u0285\3\2\2\2\u0285j\3\2\2\2\u0286"+ - "\u0288\5\177@\2\u0287\u0289\5q9\2\u0288\u0287\3\2\2\2\u0288\u0289\3\2"+ - "\2\2\u0289l\3\2\2\2\u028a\u028c\5\u0087D\2\u028b\u028d\5q9\2\u028c\u028b"+ - "\3\2\2\2\u028c\u028d\3\2\2\2\u028dn\3\2\2\2\u028e\u0290\5\u008fH\2\u028f"+ - "\u0291\5q9\2\u0290\u028f\3\2\2\2\u0290\u0291\3\2\2\2\u0291p\3\2\2\2\u0292"+ - "\u0293\t\2\2\2\u0293r\3\2\2\2\u0294\u029f\7\62\2\2\u0295\u029c\5y=\2\u0296"+ - "\u0298\5u;\2\u0297\u0296\3\2\2\2\u0297\u0298\3\2\2\2\u0298\u029d\3\2\2"+ - "\2\u0299\u029a\5}?\2\u029a\u029b\5u;\2\u029b\u029d\3\2\2\2\u029c\u0297"+ - "\3\2\2\2\u029c\u0299\3\2\2\2\u029d\u029f\3\2\2\2\u029e\u0294\3\2\2\2\u029e"+ - "\u0295\3\2\2\2\u029ft\3\2\2\2\u02a0\u02a8\5w<\2\u02a1\u02a3\5{>\2\u02a2"+ - "\u02a1\3\2\2\2\u02a3\u02a6\3\2\2\2\u02a4\u02a2\3\2\2\2\u02a4\u02a5\3\2"+ - "\2\2\u02a5\u02a7\3\2\2\2\u02a6\u02a4\3\2\2\2\u02a7\u02a9\5w<\2\u02a8\u02a4"+ - "\3\2\2\2\u02a8\u02a9\3\2\2\2\u02a9v\3\2\2\2\u02aa\u02ad\7\62\2\2\u02ab"+ - "\u02ad\5y=\2\u02ac\u02aa\3\2\2\2\u02ac\u02ab\3\2\2\2\u02adx\3\2\2\2\u02ae"+ - "\u02af\t\3\2\2\u02afz\3\2\2\2\u02b0\u02b3\5w<\2\u02b1\u02b3\7a\2\2\u02b2"+ - "\u02b0\3\2\2\2\u02b2\u02b1\3\2\2\2\u02b3|\3\2\2\2\u02b4\u02b6\7a\2\2\u02b5"+ - "\u02b4\3\2\2\2\u02b6\u02b7\3\2\2\2\u02b7\u02b5\3\2\2\2\u02b7\u02b8\3\2"+ - "\2\2\u02b8~\3\2\2\2\u02b9\u02ba\7\62\2\2\u02ba\u02bb\t\4\2\2\u02bb\u02bc"+ - "\5\u0081A\2\u02bc\u0080\3\2\2\2\u02bd\u02c5\5\u0083B\2\u02be\u02c0\5\u0085"+ - "C\2\u02bf\u02be\3\2\2\2\u02c0\u02c3\3\2\2\2\u02c1\u02bf\3\2\2\2\u02c1"+ - "\u02c2\3\2\2\2\u02c2\u02c4\3\2\2\2\u02c3\u02c1\3\2\2\2\u02c4\u02c6\5\u0083"+ - "B\2\u02c5\u02c1\3\2\2\2\u02c5\u02c6\3\2\2\2\u02c6\u0082\3\2\2\2\u02c7"+ - "\u02c8\t\5\2\2\u02c8\u0084\3\2\2\2\u02c9\u02cc\5\u0083B\2\u02ca\u02cc"+ - "\7a\2\2\u02cb\u02c9\3\2\2\2\u02cb\u02ca\3\2\2\2\u02cc\u0086\3\2\2\2\u02cd"+ - "\u02cf\7\62\2\2\u02ce\u02d0\5}?\2\u02cf\u02ce\3\2\2\2\u02cf\u02d0\3\2"+ - "\2\2\u02d0\u02d1\3\2\2\2\u02d1\u02d2\5\u0089E\2\u02d2\u0088\3\2\2\2\u02d3"+ - "\u02db\5\u008bF\2\u02d4\u02d6\5\u008dG\2\u02d5\u02d4\3\2\2\2\u02d6\u02d9"+ - "\3\2\2\2\u02d7\u02d5\3\2\2\2\u02d7\u02d8\3\2\2\2\u02d8\u02da\3\2\2\2\u02d9"+ - "\u02d7\3\2\2\2\u02da\u02dc\5\u008bF\2\u02db\u02d7\3\2\2\2\u02db\u02dc"+ - "\3\2\2\2\u02dc\u008a\3\2\2\2\u02dd\u02de\t\6\2\2\u02de\u008c\3\2\2\2\u02df"+ - "\u02e2\5\u008bF\2\u02e0\u02e2\7a\2\2\u02e1\u02df\3\2\2\2\u02e1\u02e0\3"+ - "\2\2\2\u02e2\u008e\3\2\2\2\u02e3\u02e4\7\62\2\2\u02e4\u02e5\t\7\2\2\u02e5"+ - "\u02e6\5\u0091I\2\u02e6\u0090\3\2\2\2\u02e7\u02ef\5\u0093J\2\u02e8\u02ea"+ - "\5\u0095K\2\u02e9\u02e8\3\2\2\2\u02ea\u02ed\3\2\2\2\u02eb\u02e9\3\2\2"+ - "\2\u02eb\u02ec\3\2\2\2\u02ec\u02ee\3\2\2\2\u02ed\u02eb\3\2\2\2\u02ee\u02f0"+ - "\5\u0093J\2\u02ef\u02eb\3\2\2\2\u02ef\u02f0\3\2\2\2\u02f0\u0092\3\2\2"+ - "\2\u02f1\u02f2\t\b\2\2\u02f2\u0094\3\2\2\2\u02f3\u02f6\5\u0093J\2\u02f4"+ - "\u02f6\7a\2\2\u02f5\u02f3\3\2\2\2\u02f5\u02f4\3\2\2\2\u02f6\u0096\3\2"+ - "\2\2\u02f7\u02fa\5\u0099M\2\u02f8\u02fa\5\u00a5S\2\u02f9\u02f7\3\2\2\2"+ - "\u02f9\u02f8\3\2\2\2\u02fa\u0098\3\2\2\2\u02fb\u02fc\5u;\2\u02fc\u02fe"+ - "\7\60\2\2\u02fd\u02ff\5u;\2\u02fe\u02fd\3\2\2\2\u02fe\u02ff\3\2\2\2\u02ff"+ - "\u0301\3\2\2\2\u0300\u0302\5\u009bN\2\u0301\u0300\3\2\2\2\u0301\u0302"+ - "\3\2\2\2\u0302\u0304\3\2\2\2\u0303\u0305\5\u00a3R\2\u0304\u0303\3\2\2"+ - "\2\u0304\u0305\3\2\2\2\u0305\u0317\3\2\2\2\u0306\u0307\7\60\2\2\u0307"+ - "\u0309\5u;\2\u0308\u030a\5\u009bN\2\u0309\u0308\3\2\2\2\u0309\u030a\3"+ - "\2\2\2\u030a\u030c\3\2\2\2\u030b\u030d\5\u00a3R\2\u030c\u030b\3\2\2\2"+ - "\u030c\u030d\3\2\2\2\u030d\u0317\3\2\2\2\u030e\u030f\5u;\2\u030f\u0311"+ - "\5\u009bN\2\u0310\u0312\5\u00a3R\2\u0311\u0310\3\2\2\2\u0311\u0312\3\2"+ - "\2\2\u0312\u0317\3\2\2\2\u0313\u0314\5u;\2\u0314\u0315\5\u00a3R\2\u0315"+ - "\u0317\3\2\2\2\u0316\u02fb\3\2\2\2\u0316\u0306\3\2\2\2\u0316\u030e\3\2"+ - "\2\2\u0316\u0313\3\2\2\2\u0317\u009a\3\2\2\2\u0318\u0319\5\u009dO\2\u0319"+ - "\u031a\5\u009fP\2\u031a\u009c\3\2\2\2\u031b\u031c\t\t\2\2\u031c\u009e"+ - "\3\2\2\2\u031d\u031f\5\u00a1Q\2\u031e\u031d\3\2\2\2\u031e\u031f\3\2\2"+ - "\2\u031f\u0320\3\2\2\2\u0320\u0321\5u;\2\u0321\u00a0\3\2\2\2\u0322\u0323"+ - "\t\n\2\2\u0323\u00a2\3\2\2\2\u0324\u0325\t\13\2\2\u0325\u00a4\3\2\2\2"+ - "\u0326\u0327\5\u00a7T\2\u0327\u0329\5\u00a9U\2\u0328\u032a\5\u00a3R\2"+ - "\u0329\u0328\3\2\2\2\u0329\u032a\3\2\2\2\u032a\u00a6\3\2\2\2\u032b\u032d"+ - "\5\177@\2\u032c\u032e\7\60\2\2\u032d\u032c\3\2\2\2\u032d\u032e\3\2\2\2"+ - "\u032e\u0337\3\2\2\2\u032f\u0330\7\62\2\2\u0330\u0332\t\4\2\2\u0331\u0333"+ - "\5\u0081A\2\u0332\u0331\3\2\2\2\u0332\u0333\3\2\2\2\u0333\u0334\3\2\2"+ - "\2\u0334\u0335\7\60\2\2\u0335\u0337\5\u0081A\2\u0336\u032b\3\2\2\2\u0336"+ - "\u032f\3\2\2\2\u0337\u00a8\3\2\2\2\u0338\u0339\5\u00abV\2\u0339\u033a"+ - "\5\u009fP\2\u033a\u00aa\3\2\2\2\u033b\u033c\t\f\2\2\u033c\u00ac\3\2\2"+ - "\2\u033d\u033e\7v\2\2\u033e\u033f\7t\2\2\u033f\u0340\7w\2\2\u0340\u0347"+ - "\7g\2\2\u0341\u0342\7h\2\2\u0342\u0343\7c\2\2\u0343\u0344\7n\2\2\u0344"+ - "\u0345\7u\2\2\u0345\u0347\7g\2\2\u0346\u033d\3\2\2\2\u0346\u0341\3\2\2"+ - "\2\u0347\u00ae\3\2\2\2\u0348\u0349\7)\2\2\u0349\u034a\5\u00b1Y\2\u034a"+ - "\u034b\7)\2\2\u034b\u0351\3\2\2\2\u034c\u034d\7)\2\2\u034d\u034e\5\u00b9"+ - "]\2\u034e\u034f\7)\2\2\u034f\u0351\3\2\2\2\u0350\u0348\3\2\2\2\u0350\u034c"+ - "\3\2\2\2\u0351\u00b0\3\2\2\2\u0352\u0353\n\r\2\2\u0353\u00b2\3\2\2\2\u0354"+ - "\u0356\7$\2\2\u0355\u0357\5\u00b5[\2\u0356\u0355\3\2\2\2\u0356\u0357\3"+ - "\2\2\2\u0357\u0358\3\2\2\2\u0358\u0359\7$\2\2\u0359\u00b4\3\2\2\2\u035a"+ - "\u035c\5\u00b7\\\2\u035b\u035a\3\2\2\2\u035c\u035d\3\2\2\2\u035d\u035b"+ - "\3\2\2\2\u035d\u035e\3\2\2\2\u035e\u00b6\3\2\2\2\u035f\u0362\n\16\2\2"+ - "\u0360\u0362\5\u00b9]\2\u0361\u035f\3\2\2\2\u0361\u0360\3\2\2\2\u0362"+ - "\u00b8\3\2\2\2\u0363\u0364\7^\2\2\u0364\u0368\t\17\2\2\u0365\u0368\5\u00bb"+ - "^\2\u0366\u0368\5\u00bd_\2\u0367\u0363\3\2\2\2\u0367\u0365\3\2\2\2\u0367"+ - "\u0366\3\2\2\2\u0368\u00ba\3\2\2\2\u0369\u036a\7^\2\2\u036a\u0375\5\u008b"+ - "F\2\u036b\u036c\7^\2\2\u036c\u036d\5\u008bF\2\u036d\u036e\5\u008bF\2\u036e"+ - "\u0375\3\2\2\2\u036f\u0370\7^\2\2\u0370\u0371\5\u00bf`\2\u0371\u0372\5"+ - "\u008bF\2\u0372\u0373\5\u008bF\2\u0373\u0375\3\2\2\2\u0374\u0369\3\2\2"+ - "\2\u0374\u036b\3\2\2\2\u0374\u036f\3\2\2\2\u0375\u00bc\3\2\2\2\u0376\u0377"+ - "\7^\2\2\u0377\u0378\7w\2\2\u0378\u0379\5\u0083B\2\u0379\u037a\5\u0083"+ - "B\2\u037a\u037b\5\u0083B\2\u037b\u037c\5\u0083B\2\u037c\u00be\3\2\2\2"+ - "\u037d\u037e\t\20\2\2\u037e\u00c0\3\2\2\2\u037f\u0380\7p\2\2\u0380\u0381"+ - "\7w\2\2\u0381\u0382\7n\2\2\u0382\u0383\7n\2\2\u0383\u00c2\3\2\2\2\u0384"+ - "\u0385\7*\2\2\u0385\u00c4\3\2\2\2\u0386\u0387\7+\2\2\u0387\u00c6\3\2\2"+ - "\2\u0388\u0389\7}\2\2\u0389\u00c8\3\2\2\2\u038a\u038b\7\177\2\2\u038b"+ - "\u00ca\3\2\2\2\u038c\u038d\7]\2\2\u038d\u00cc\3\2\2\2\u038e\u038f\7_\2"+ - "\2\u038f\u00ce\3\2\2\2\u0390\u0391\7=\2\2\u0391\u00d0\3\2\2\2\u0392\u0393"+ - "\7.\2\2\u0393\u00d2\3\2\2\2\u0394\u0395\7\60\2\2\u0395\u00d4\3\2\2\2\u0396"+ - "\u0397\7?\2\2\u0397\u00d6\3\2\2\2\u0398\u0399\7@\2\2\u0399\u00d8\3\2\2"+ - "\2\u039a\u039b\7>\2\2\u039b\u00da\3\2\2\2\u039c\u039d\7#\2\2\u039d\u00dc"+ - "\3\2\2\2\u039e\u039f\7\u0080\2\2\u039f\u00de\3\2\2\2\u03a0\u03a1\7A\2"+ - "\2\u03a1\u00e0\3\2\2\2\u03a2\u03a3\7<\2\2\u03a3\u00e2\3\2\2\2\u03a4\u03a5"+ - "\7?\2\2\u03a5\u03a6\7?\2\2\u03a6\u00e4\3\2\2\2\u03a7\u03a8\7>\2\2\u03a8"+ - "\u03a9\7?\2\2\u03a9\u00e6\3\2\2\2\u03aa\u03ab\7@\2\2\u03ab\u03ac\7?\2"+ - "\2\u03ac\u00e8\3\2\2\2\u03ad\u03ae\7#\2\2\u03ae\u03af\7?\2\2\u03af\u00ea"+ - "\3\2\2\2\u03b0\u03b1\7(\2\2\u03b1\u03b2\7(\2\2\u03b2\u00ec\3\2\2\2\u03b3"+ - "\u03b4\7~\2\2\u03b4\u03b5\7~\2\2\u03b5\u00ee\3\2\2\2\u03b6\u03b7\7-\2"+ - "\2\u03b7\u03b8\7-\2\2\u03b8\u00f0\3\2\2\2\u03b9\u03ba\7/\2\2\u03ba\u03bb"+ - "\7/\2\2\u03bb\u00f2\3\2\2\2\u03bc\u03bd\7-\2\2\u03bd\u00f4\3\2\2\2\u03be"+ - "\u03bf\7/\2\2\u03bf\u00f6\3\2\2\2\u03c0\u03c1\7,\2\2\u03c1\u00f8\3\2\2"+ - "\2\u03c2\u03c3\7\61\2\2\u03c3\u00fa\3\2\2\2\u03c4\u03c5\7(\2\2\u03c5\u00fc"+ - "\3\2\2\2\u03c6\u03c7\7~\2\2\u03c7\u00fe\3\2\2\2\u03c8\u03c9\7`\2\2\u03c9"+ - "\u0100\3\2\2\2\u03ca\u03cb\7\'\2\2\u03cb\u0102\3\2\2\2\u03cc\u03cd\7-"+ - "\2\2\u03cd\u03ce\7?\2\2\u03ce\u0104\3\2\2\2\u03cf\u03d0\7/\2\2\u03d0\u03d1"+ - "\7?\2\2\u03d1\u0106\3\2\2\2\u03d2\u03d3\7,\2\2\u03d3\u03d4\7?\2\2\u03d4"+ - "\u0108\3\2\2\2\u03d5\u03d6\7\61\2\2\u03d6\u03d7\7?\2\2\u03d7\u010a\3\2"+ - "\2\2\u03d8\u03d9\7(\2\2\u03d9\u03da\7?\2\2\u03da\u010c\3\2\2\2\u03db\u03dc"+ - "\7~\2\2\u03dc\u03dd\7?\2\2\u03dd\u010e\3\2\2\2\u03de\u03df\7`\2\2\u03df"+ - "\u03e0\7?\2\2\u03e0\u0110\3\2\2\2\u03e1\u03e2\7\'\2\2\u03e2\u03e3\7?\2"+ - "\2\u03e3\u0112\3\2\2\2\u03e4\u03e5\7>\2\2\u03e5\u03e6\7>\2\2\u03e6\u03e7"+ - "\7?\2\2\u03e7\u0114\3\2\2\2\u03e8\u03e9\7@\2\2\u03e9\u03ea\7@\2\2\u03ea"+ - "\u03eb\7?\2\2\u03eb\u0116\3\2\2\2\u03ec\u03ed\7@\2\2\u03ed\u03ee\7@\2"+ - "\2\u03ee\u03ef\7@\2\2\u03ef\u03f0\7?\2\2\u03f0\u0118\3\2\2\2\u03f1\u03f5"+ - "\5\u011b\u008e\2\u03f2\u03f4\5\u011d\u008f\2\u03f3\u03f2\3\2\2\2\u03f4"+ - "\u03f7\3\2\2\2\u03f5\u03f3\3\2\2\2\u03f5\u03f6\3\2\2\2\u03f6\u011a\3\2"+ - "\2\2\u03f7\u03f5\3\2\2\2\u03f8\u03ff\t\21\2\2\u03f9\u03fa\n\22\2\2\u03fa"+ - "\u03ff\6\u008e\2\2\u03fb\u03fc\t\23\2\2\u03fc\u03fd\t\24\2\2\u03fd\u03ff"+ - "\6\u008e\3\2\u03fe\u03f8\3\2\2\2\u03fe\u03f9\3\2\2\2\u03fe\u03fb\3\2\2"+ - "\2\u03ff\u011c\3\2\2\2\u0400\u0407\t\25\2\2\u0401\u0402\n\22\2\2\u0402"+ - "\u0407\6\u008f\4\2\u0403\u0404\t\23\2\2\u0404\u0405\t\24\2\2\u0405\u0407"+ - "\6\u008f\5\2\u0406\u0400\3\2\2\2\u0406\u0401\3\2\2\2\u0406\u0403\3\2\2"+ - "\2\u0407\u011e\3\2\2\2\u0408\u0409\7B\2\2\u0409\u0120\3\2\2\2\u040a\u040b"+ - "\7\60\2\2\u040b\u040c\7\60\2\2\u040c\u040d\7\60\2\2\u040d\u0122\3\2\2"+ - "\2\u040e\u0410\t\26\2\2\u040f\u040e\3\2\2\2\u0410\u0411\3\2\2\2\u0411"+ - "\u040f\3\2\2\2\u0411\u0412\3\2\2\2\u0412\u0413\3\2\2\2\u0413\u0414\b\u0092"+ - "\2\2\u0414\u0124\3\2\2\2\u0415\u0416\7\61\2\2\u0416\u0417\7,\2\2\u0417"+ - "\u041b\3\2\2\2\u0418\u041a\13\2\2\2\u0419\u0418\3\2\2\2\u041a\u041d\3"+ - "\2\2\2\u041b\u041c\3\2\2\2\u041b\u0419\3\2\2\2\u041c\u041e\3\2\2\2\u041d"+ - "\u041b\3\2\2\2\u041e\u041f\7,\2\2\u041f\u0420\7\61\2\2\u0420\u0421\3\2"+ - "\2\2\u0421\u0422\b\u0093\2\2\u0422\u0126\3\2\2\2\u0423\u0424\7\61\2\2"+ - "\u0424\u0425\7\61\2\2\u0425\u0429\3\2\2\2\u0426\u0428\n\27\2\2\u0427\u0426"+ - "\3\2\2\2\u0428\u042b\3\2\2\2\u0429\u0427\3\2\2\2\u0429\u042a\3\2\2\2\u042a"+ - "\u042c\3\2\2\2\u042b\u0429\3\2\2\2\u042c\u042d\b\u0094\2\2\u042d\u0128"+ - "\3\2\2\2\64\2\u0280\u0284\u0288\u028c\u0290\u0297\u029c\u029e\u02a4\u02a8"+ - "\u02ac\u02b2\u02b7\u02c1\u02c5\u02cb\u02cf\u02d7\u02db\u02e1\u02eb\u02ef"+ - "\u02f5\u02f9\u02fe\u0301\u0304\u0309\u030c\u0311\u0316\u031e\u0329\u032d"+ - "\u0332\u0336\u0346\u0350\u0356\u035d\u0361\u0367\u0374\u03f5\u03fe\u0406"+ - "\u0411\u041b\u0429\3\b\2\2"; - public static final ATN _ATN = - new ATNDeserializer().deserialize(_serializedATN.toCharArray()); - static { - _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; - for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { - _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); - } - } -} \ No newline at end of file diff --git a/src/de/dhbwstuttgart/antlr/Java8Lexer.tokens b/src/de/dhbwstuttgart/antlr/Java8Lexer.tokens deleted file mode 100644 index 3f62bddf3..000000000 --- a/src/de/dhbwstuttgart/antlr/Java8Lexer.tokens +++ /dev/null @@ -1,201 +0,0 @@ -THROW=44 -STATIC=38 -INTERFACE=28 -AND_ASSIGN=93 -BREAK=4 -BYTE=5 -ELSE=15 -IF=22 -ENUM=16 -SUB=82 -BANG=69 -LPAREN=57 -DOT=65 -CASE=6 -AT=101 -LINE_COMMENT=105 -StringLiteral=55 -ELLIPSIS=102 -LBRACK=61 -PUBLIC=35 -THROWS=45 -NullLiteral=56 -RSHIFT_ASSIGN=98 -LBRACE=59 -GOTO=23 -SUB_ASSIGN=90 -SEMI=63 -CHAR=8 -ASSIGN=66 -COMMENT=104 -IMPORT=25 -BITOR=86 -CATCH=7 -MUL_ASSIGN=91 -DOUBLE=14 -PROTECTED=34 -LONG=29 -COMMA=64 -BITAND=85 -PRIVATE=33 -CONTINUE=11 -DIV=84 -FloatingPointLiteral=52 -LE=74 -CharacterLiteral=54 -VOLATILE=49 -EXTENDS=17 -INSTANCEOF=26 -NEW=31 -ADD=81 -LT=68 -CLASS=9 -DO=13 -FINALLY=19 -Identifier=100 -CONST=10 -PACKAGE=32 -OR_ASSIGN=94 -TRY=47 -IntegerLiteral=51 -SYNCHRONIZED=42 -MUL=83 -FOR=21 -FINAL=18 -RPAREN=58 -CARET=87 -URSHIFT_ASSIGN=99 -BOOLEAN=3 -NOTEQUAL=76 -RBRACK=62 -RBRACE=60 -AND=77 -THIS=43 -SWITCH=41 -VOID=48 -TRANSIENT=46 -INC=79 -FLOAT=20 -NATIVE=30 -DIV_ASSIGN=92 -BooleanLiteral=53 -ABSTRACT=1 -STRICTFP=39 -INT=27 -QUESTION=71 -RETURN=36 -LSHIFT_ASSIGN=97 -ADD_ASSIGN=89 -WS=103 -GE=75 -SUPER=40 -OR=78 -DEC=80 -MOD=88 -XOR_ASSIGN=95 -ASSERT=2 -EQUAL=73 -IMPLEMENTS=24 -COLON=72 -GT=67 -SHORT=37 -MOD_ASSIGN=96 -WHILE=50 -TILDE=70 -DEFAULT=12 -'import'=25 -'-'=82 -')'=58 -'super'=40 -'else'=15 -'%'=88 -'!'=69 -'>'=67 -'public'=35 -'=='=73 -'--'=80 -'|'=86 -'['=61 -':'=72 -'...'=102 -'throw'=44 -'case'=6 -'.'=65 -'this'=43 -'*'=83 -'switch'=41 -'synchronized'=42 -'&'=85 -'double'=14 -'break'=4 -'short'=37 -'<='=74 -'enum'=16 -'try'=47 -'?'=71 -'if'=22 -'extends'=17 -'goto'=23 -'}'=60 -'instanceof'=26 -';'=63 -'||'=78 -'>>='=98 -'class'=9 -'return'=36 -'&='=93 -'catch'=7 -'native'=30 -'continue'=11 -'strictfp'=39 -'/'=84 -'*='=91 -'+'=81 -'final'=18 -'protected'=34 -'static'=38 -'@'=101 -'transient'=46 -'~'=70 -'assert'=2 -']'=62 -'<'=68 -'++'=79 -'>>>='=99 -'>='=75 -'long'=29 -'boolean'=3 -'const'=10 -'abstract'=1 -'implements'=24 -'volatile'=49 -'throws'=45 -'/='=92 -','=64 -'-='=90 -'do'=13 -'package'=32 -'('=57 -'null'=56 -'int'=27 -'|='=94 -'for'=21 -'^'=87 -'<<='=97 -'='=66 -'byte'=5 -'&&'=77 -'^='=95 -'void'=48 -'while'=50 -'{'=59 -'float'=20 -'!='=76 -'new'=31 -'char'=8 -'finally'=19 -'interface'=28 -'%='=96 -'private'=33 -'+='=89 -'default'=12 diff --git a/src/de/dhbwstuttgart/antlr/Java8Parser.java b/src/de/dhbwstuttgart/antlr/Java8Parser.java deleted file mode 100644 index 96aee9a37..000000000 --- a/src/de/dhbwstuttgart/antlr/Java8Parser.java +++ /dev/null @@ -1,7394 +0,0 @@ -package de.dhbwstuttgart.antlr; - -// Generated from Java8.g4 by ANTLR 4.4 -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.DFA; -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.misc.*; -import org.antlr.v4.runtime.tree.*; -import java.util.List; -import java.util.Iterator; -import java.util.ArrayList; - -@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) -public class Java8Parser extends Parser { - static { RuntimeMetaData.checkVersion("4.4", RuntimeMetaData.VERSION); } - - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - public static final int - ABSTRACT=1, ASSERT=2, BOOLEAN=3, BREAK=4, BYTE=5, CASE=6, CATCH=7, CHAR=8, - CLASS=9, CONST=10, CONTINUE=11, DEFAULT=12, DO=13, DOUBLE=14, ELSE=15, - ENUM=16, EXTENDS=17, FINAL=18, FINALLY=19, FLOAT=20, FOR=21, IF=22, GOTO=23, - IMPLEMENTS=24, IMPORT=25, INSTANCEOF=26, INT=27, INTERFACE=28, LONG=29, - NATIVE=30, NEW=31, PACKAGE=32, PRIVATE=33, PROTECTED=34, PUBLIC=35, RETURN=36, - SHORT=37, STATIC=38, STRICTFP=39, SUPER=40, SWITCH=41, SYNCHRONIZED=42, - THIS=43, THROW=44, THROWS=45, TRANSIENT=46, TRY=47, VOID=48, VOLATILE=49, - WHILE=50, IntegerLiteral=51, FloatingPointLiteral=52, BooleanLiteral=53, - CharacterLiteral=54, StringLiteral=55, NullLiteral=56, LPAREN=57, RPAREN=58, - LBRACE=59, RBRACE=60, LBRACK=61, RBRACK=62, SEMI=63, COMMA=64, DOT=65, - ASSIGN=66, GT=67, LT=68, BANG=69, TILDE=70, QUESTION=71, COLON=72, EQUAL=73, - LE=74, GE=75, NOTEQUAL=76, AND=77, OR=78, INC=79, DEC=80, ADD=81, SUB=82, - MUL=83, DIV=84, BITAND=85, BITOR=86, CARET=87, MOD=88, ADD_ASSIGN=89, - SUB_ASSIGN=90, MUL_ASSIGN=91, DIV_ASSIGN=92, AND_ASSIGN=93, OR_ASSIGN=94, - XOR_ASSIGN=95, MOD_ASSIGN=96, LSHIFT_ASSIGN=97, RSHIFT_ASSIGN=98, URSHIFT_ASSIGN=99, - Identifier=100, AT=101, ELLIPSIS=102, WS=103, COMMENT=104, LINE_COMMENT=105; - public static final String[] tokenNames = { - "", "'abstract'", "'assert'", "'boolean'", "'break'", "'byte'", - "'case'", "'catch'", "'char'", "'class'", "'const'", "'continue'", "'default'", - "'do'", "'double'", "'else'", "'enum'", "'extends'", "'final'", "'finally'", - "'float'", "'for'", "'if'", "'goto'", "'implements'", "'import'", "'instanceof'", - "'int'", "'interface'", "'long'", "'native'", "'new'", "'package'", "'private'", - "'protected'", "'public'", "'return'", "'short'", "'static'", "'strictfp'", - "'super'", "'switch'", "'synchronized'", "'this'", "'throw'", "'throws'", - "'transient'", "'try'", "'void'", "'volatile'", "'while'", "IntegerLiteral", - "FloatingPointLiteral", "BooleanLiteral", "CharacterLiteral", "StringLiteral", - "'null'", "'('", "')'", "'{'", "'}'", "'['", "']'", "';'", "','", "'.'", - "'='", "'>'", "'<'", "'!'", "'~'", "'?'", "':'", "'=='", "'<='", "'>='", - "'!='", "'&&'", "'||'", "'++'", "'--'", "'+'", "'-'", "'*'", "'/'", "'&'", - "'|'", "'^'", "'%'", "'+='", "'-='", "'*='", "'/='", "'&='", "'|='", "'^='", - "'%='", "'<<='", "'>>='", "'>>>='", "Identifier", "'@'", "'...'", "WS", - "COMMENT", "LINE_COMMENT" - }; - public static final int - RULE_compilationUnit = 0, RULE_packageDeclaration = 1, RULE_importDeclaration = 2, - RULE_typeDeclaration = 3, RULE_modifier = 4, RULE_classOrInterfaceModifier = 5, - RULE_variableModifier = 6, RULE_classDeclaration = 7, RULE_typeParameters = 8, - RULE_typeParameter = 9, RULE_typeBound = 10, RULE_enumDeclaration = 11, - RULE_enumConstants = 12, RULE_enumConstant = 13, RULE_enumBodyDeclarations = 14, - RULE_interfaceDeclaration = 15, RULE_typeList = 16, RULE_classBody = 17, - RULE_interfaceBody = 18, RULE_classBodyDeclaration = 19, RULE_memberDeclaration = 20, - RULE_methodDeclaration = 21, RULE_genericMethodDeclaration = 22, RULE_constructorDeclaration = 23, - RULE_genericConstructorDeclaration = 24, RULE_fieldDeclaration = 25, RULE_interfaceBodyDeclaration = 26, - RULE_interfaceMemberDeclaration = 27, RULE_constDeclaration = 28, RULE_constantDeclarator = 29, - RULE_interfaceMethodDeclaration = 30, RULE_genericInterfaceMethodDeclaration = 31, - RULE_variableDeclarators = 32, RULE_variableDeclarator = 33, RULE_variableDeclaratorId = 34, - RULE_variableInitializer = 35, RULE_arrayInitializer = 36, RULE_enumConstantName = 37, - RULE_type = 38, RULE_classOrInterfaceType = 39, RULE_primitiveType = 40, - RULE_typeArguments = 41, RULE_typeArgument = 42, RULE_qualifiedNameList = 43, - RULE_formalParameters = 44, RULE_formalParameterList = 45, RULE_formalParameter = 46, - RULE_lastFormalParameter = 47, RULE_methodBody = 48, RULE_constructorBody = 49, - RULE_qualifiedName = 50, RULE_literal = 51, RULE_annotation = 52, RULE_annotationName = 53, - RULE_elementValuePairs = 54, RULE_elementValuePair = 55, RULE_elementValue = 56, - RULE_elementValueArrayInitializer = 57, RULE_annotationTypeDeclaration = 58, - RULE_annotationTypeBody = 59, RULE_annotationTypeElementDeclaration = 60, - RULE_annotationTypeElementRest = 61, RULE_annotationMethodOrConstantRest = 62, - RULE_annotationMethodRest = 63, RULE_annotationConstantRest = 64, RULE_defaultValue = 65, - RULE_block = 66, RULE_blockStatement = 67, RULE_localVariableDeclarationStatement = 68, - RULE_localVariableDeclaration = 69, RULE_statement = 70, RULE_catchClause = 71, - RULE_catchType = 72, RULE_finallyBlock = 73, RULE_resourceSpecification = 74, - RULE_resources = 75, RULE_resource = 76, RULE_switchBlockStatementGroup = 77, - RULE_switchLabel = 78, RULE_forControl = 79, RULE_forInit = 80, RULE_enhancedForControl = 81, - RULE_forUpdate = 82, RULE_parExpression = 83, RULE_expressionList = 84, - RULE_statementExpression = 85, RULE_constantExpression = 86, RULE_expression = 87, - RULE_primary = 88, RULE_creator = 89, RULE_createdName = 90, RULE_innerCreator = 91, - RULE_arrayCreatorRest = 92, RULE_classCreatorRest = 93, RULE_explicitGenericInvocation = 94, - RULE_nonWildcardTypeArguments = 95, RULE_typeArgumentsOrDiamond = 96, - RULE_nonWildcardTypeArgumentsOrDiamond = 97, RULE_superSuffix = 98, RULE_explicitGenericInvocationSuffix = 99, - RULE_arguments = 100; - public static final String[] ruleNames = { - "compilationUnit", "packageDeclaration", "importDeclaration", "typeDeclaration", - "modifier", "classOrInterfaceModifier", "variableModifier", "classDeclaration", - "typeParameters", "typeParameter", "typeBound", "enumDeclaration", "enumConstants", - "enumConstant", "enumBodyDeclarations", "interfaceDeclaration", "typeList", - "classBody", "interfaceBody", "classBodyDeclaration", "memberDeclaration", - "methodDeclaration", "genericMethodDeclaration", "constructorDeclaration", - "genericConstructorDeclaration", "fieldDeclaration", "interfaceBodyDeclaration", - "interfaceMemberDeclaration", "constDeclaration", "constantDeclarator", - "interfaceMethodDeclaration", "genericInterfaceMethodDeclaration", "variableDeclarators", - "variableDeclarator", "variableDeclaratorId", "variableInitializer", "arrayInitializer", - "enumConstantName", "type", "classOrInterfaceType", "primitiveType", "typeArguments", - "typeArgument", "qualifiedNameList", "formalParameters", "formalParameterList", - "formalParameter", "lastFormalParameter", "methodBody", "constructorBody", - "qualifiedName", "literal", "annotation", "annotationName", "elementValuePairs", - "elementValuePair", "elementValue", "elementValueArrayInitializer", "annotationTypeDeclaration", - "annotationTypeBody", "annotationTypeElementDeclaration", "annotationTypeElementRest", - "annotationMethodOrConstantRest", "annotationMethodRest", "annotationConstantRest", - "defaultValue", "block", "blockStatement", "localVariableDeclarationStatement", - "localVariableDeclaration", "statement", "catchClause", "catchType", "finallyBlock", - "resourceSpecification", "resources", "resource", "switchBlockStatementGroup", - "switchLabel", "forControl", "forInit", "enhancedForControl", "forUpdate", - "parExpression", "expressionList", "statementExpression", "constantExpression", - "expression", "primary", "creator", "createdName", "innerCreator", "arrayCreatorRest", - "classCreatorRest", "explicitGenericInvocation", "nonWildcardTypeArguments", - "typeArgumentsOrDiamond", "nonWildcardTypeArgumentsOrDiamond", "superSuffix", - "explicitGenericInvocationSuffix", "arguments" - }; - - @Override - public String getGrammarFileName() { return "Java8.g4"; } - - @Override - public String[] getTokenNames() { return tokenNames; } - - @Override - public String[] getRuleNames() { return ruleNames; } - - @Override - public String getSerializedATN() { return _serializedATN; } - - @Override - public ATN getATN() { return _ATN; } - - public Java8Parser(TokenStream input) { - super(input); - _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - public static class CompilationUnitContext extends ParserRuleContext { - public TypeDeclarationContext typeDeclaration(int i) { - return getRuleContext(TypeDeclarationContext.class,i); - } - public ImportDeclarationContext importDeclaration(int i) { - return getRuleContext(ImportDeclarationContext.class,i); - } - public List importDeclaration() { - return getRuleContexts(ImportDeclarationContext.class); - } - public TerminalNode EOF() { return getToken(Java8Parser.EOF, 0); } - public PackageDeclarationContext packageDeclaration() { - return getRuleContext(PackageDeclarationContext.class,0); - } - public List typeDeclaration() { - return getRuleContexts(TypeDeclarationContext.class); - } - public CompilationUnitContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_compilationUnit; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitCompilationUnit(this); - else return visitor.visitChildren(this); - } - } - - public final CompilationUnitContext compilationUnit() throws RecognitionException { - CompilationUnitContext _localctx = new CompilationUnitContext(_ctx, getState()); - enterRule(_localctx, 0, RULE_compilationUnit); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(203); - switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) { - case 1: - { - setState(202); packageDeclaration(); - } - break; - } - setState(208); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==IMPORT) { - { - { - setState(205); importDeclaration(); - } - } - setState(210); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(214); - _errHandler.sync(this); - _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ABSTRACT) | (1L << CLASS) | (1L << ENUM) | (1L << FINAL) | (1L << INTERFACE) | (1L << PRIVATE) | (1L << PROTECTED) | (1L << PUBLIC) | (1L << STATIC) | (1L << STRICTFP) | (1L << SEMI))) != 0) || _la==AT) { - { - { - setState(211); typeDeclaration(); - } - } - setState(216); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(217); match(EOF); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class PackageDeclarationContext extends ParserRuleContext { - public List annotation() { - return getRuleContexts(AnnotationContext.class); - } - public QualifiedNameContext qualifiedName() { - return getRuleContext(QualifiedNameContext.class,0); - } - public AnnotationContext annotation(int i) { - return getRuleContext(AnnotationContext.class,i); - } - public PackageDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_packageDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitPackageDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final PackageDeclarationContext packageDeclaration() throws RecognitionException { - PackageDeclarationContext _localctx = new PackageDeclarationContext(_ctx, getState()); - enterRule(_localctx, 2, RULE_packageDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(222); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==AT) { - { - { - setState(219); annotation(); - } - } - setState(224); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(225); match(PACKAGE); - setState(226); qualifiedName(); - setState(227); match(SEMI); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ImportDeclarationContext extends ParserRuleContext { - public QualifiedNameContext qualifiedName() { - return getRuleContext(QualifiedNameContext.class,0); - } - public ImportDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_importDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitImportDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final ImportDeclarationContext importDeclaration() throws RecognitionException { - ImportDeclarationContext _localctx = new ImportDeclarationContext(_ctx, getState()); - enterRule(_localctx, 4, RULE_importDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(229); match(IMPORT); - setState(231); - _la = _input.LA(1); - if (_la==STATIC) { - { - setState(230); match(STATIC); - } - } - - setState(233); qualifiedName(); - setState(236); - _la = _input.LA(1); - if (_la==DOT) { - { - setState(234); match(DOT); - setState(235); match(MUL); - } - } - - setState(238); match(SEMI); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class TypeDeclarationContext extends ParserRuleContext { - public ClassOrInterfaceModifierContext classOrInterfaceModifier(int i) { - return getRuleContext(ClassOrInterfaceModifierContext.class,i); - } - public EnumDeclarationContext enumDeclaration() { - return getRuleContext(EnumDeclarationContext.class,0); - } - public ClassDeclarationContext classDeclaration() { - return getRuleContext(ClassDeclarationContext.class,0); - } - public AnnotationTypeDeclarationContext annotationTypeDeclaration() { - return getRuleContext(AnnotationTypeDeclarationContext.class,0); - } - public List classOrInterfaceModifier() { - return getRuleContexts(ClassOrInterfaceModifierContext.class); - } - public InterfaceDeclarationContext interfaceDeclaration() { - return getRuleContext(InterfaceDeclarationContext.class,0); - } - public TypeDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_typeDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitTypeDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final TypeDeclarationContext typeDeclaration() throws RecognitionException { - TypeDeclarationContext _localctx = new TypeDeclarationContext(_ctx, getState()); - enterRule(_localctx, 6, RULE_typeDeclaration); - int _la; - try { - int _alt; - setState(269); - switch ( getInterpreter().adaptivePredict(_input,10,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(243); - _errHandler.sync(this); - _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ABSTRACT) | (1L << FINAL) | (1L << PRIVATE) | (1L << PROTECTED) | (1L << PUBLIC) | (1L << STATIC) | (1L << STRICTFP))) != 0) || _la==AT) { - { - { - setState(240); classOrInterfaceModifier(); - } - } - setState(245); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(246); classDeclaration(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(250); - _errHandler.sync(this); - _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ABSTRACT) | (1L << FINAL) | (1L << PRIVATE) | (1L << PROTECTED) | (1L << PUBLIC) | (1L << STATIC) | (1L << STRICTFP))) != 0) || _la==AT) { - { - { - setState(247); classOrInterfaceModifier(); - } - } - setState(252); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(253); enumDeclaration(); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(257); - _errHandler.sync(this); - _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ABSTRACT) | (1L << FINAL) | (1L << PRIVATE) | (1L << PROTECTED) | (1L << PUBLIC) | (1L << STATIC) | (1L << STRICTFP))) != 0) || _la==AT) { - { - { - setState(254); classOrInterfaceModifier(); - } - } - setState(259); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(260); interfaceDeclaration(); - } - break; - case 4: - enterOuterAlt(_localctx, 4); - { - setState(264); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,9,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(261); classOrInterfaceModifier(); - } - } - } - setState(266); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,9,_ctx); - } - setState(267); annotationTypeDeclaration(); - } - break; - case 5: - enterOuterAlt(_localctx, 5); - { - setState(268); match(SEMI); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ModifierContext extends ParserRuleContext { - public ClassOrInterfaceModifierContext classOrInterfaceModifier() { - return getRuleContext(ClassOrInterfaceModifierContext.class,0); - } - public ModifierContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_modifier; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitModifier(this); - else return visitor.visitChildren(this); - } - } - - public final ModifierContext modifier() throws RecognitionException { - ModifierContext _localctx = new ModifierContext(_ctx, getState()); - enterRule(_localctx, 8, RULE_modifier); - int _la; - try { - setState(273); - switch (_input.LA(1)) { - case ABSTRACT: - case FINAL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case STATIC: - case STRICTFP: - case AT: - enterOuterAlt(_localctx, 1); - { - setState(271); classOrInterfaceModifier(); - } - break; - case NATIVE: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - enterOuterAlt(_localctx, 2); - { - setState(272); - _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NATIVE) | (1L << SYNCHRONIZED) | (1L << TRANSIENT) | (1L << VOLATILE))) != 0)) ) { - _errHandler.recoverInline(this); - } - consume(); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ClassOrInterfaceModifierContext extends ParserRuleContext { - public AnnotationContext annotation() { - return getRuleContext(AnnotationContext.class,0); - } - public ClassOrInterfaceModifierContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_classOrInterfaceModifier; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitClassOrInterfaceModifier(this); - else return visitor.visitChildren(this); - } - } - - public final ClassOrInterfaceModifierContext classOrInterfaceModifier() throws RecognitionException { - ClassOrInterfaceModifierContext _localctx = new ClassOrInterfaceModifierContext(_ctx, getState()); - enterRule(_localctx, 10, RULE_classOrInterfaceModifier); - int _la; - try { - setState(277); - switch (_input.LA(1)) { - case AT: - enterOuterAlt(_localctx, 1); - { - setState(275); annotation(); - } - break; - case ABSTRACT: - case FINAL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case STATIC: - case STRICTFP: - enterOuterAlt(_localctx, 2); - { - setState(276); - _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ABSTRACT) | (1L << FINAL) | (1L << PRIVATE) | (1L << PROTECTED) | (1L << PUBLIC) | (1L << STATIC) | (1L << STRICTFP))) != 0)) ) { - _errHandler.recoverInline(this); - } - consume(); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class VariableModifierContext extends ParserRuleContext { - public AnnotationContext annotation() { - return getRuleContext(AnnotationContext.class,0); - } - public VariableModifierContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_variableModifier; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitVariableModifier(this); - else return visitor.visitChildren(this); - } - } - - public final VariableModifierContext variableModifier() throws RecognitionException { - VariableModifierContext _localctx = new VariableModifierContext(_ctx, getState()); - enterRule(_localctx, 12, RULE_variableModifier); - try { - setState(281); - switch (_input.LA(1)) { - case FINAL: - enterOuterAlt(_localctx, 1); - { - setState(279); match(FINAL); - } - break; - case AT: - enterOuterAlt(_localctx, 2); - { - setState(280); annotation(); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ClassDeclarationContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public ClassBodyContext classBody() { - return getRuleContext(ClassBodyContext.class,0); - } - public TypeListContext typeList() { - return getRuleContext(TypeListContext.class,0); - } - public TypeParametersContext typeParameters() { - return getRuleContext(TypeParametersContext.class,0); - } - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public ClassDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_classDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitClassDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final ClassDeclarationContext classDeclaration() throws RecognitionException { - ClassDeclarationContext _localctx = new ClassDeclarationContext(_ctx, getState()); - enterRule(_localctx, 14, RULE_classDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(283); match(CLASS); - setState(284); match(Identifier); - setState(286); - _la = _input.LA(1); - if (_la==LT) { - { - setState(285); typeParameters(); - } - } - - setState(290); - _la = _input.LA(1); - if (_la==EXTENDS) { - { - setState(288); match(EXTENDS); - setState(289); type(); - } - } - - setState(294); - _la = _input.LA(1); - if (_la==IMPLEMENTS) { - { - setState(292); match(IMPLEMENTS); - setState(293); typeList(); - } - } - - setState(296); classBody(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class TypeParametersContext extends ParserRuleContext { - public List typeParameter() { - return getRuleContexts(TypeParameterContext.class); - } - public TypeParameterContext typeParameter(int i) { - return getRuleContext(TypeParameterContext.class,i); - } - public TypeParametersContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_typeParameters; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitTypeParameters(this); - else return visitor.visitChildren(this); - } - } - - public final TypeParametersContext typeParameters() throws RecognitionException { - TypeParametersContext _localctx = new TypeParametersContext(_ctx, getState()); - enterRule(_localctx, 16, RULE_typeParameters); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(298); match(LT); - setState(299); typeParameter(); - setState(304); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==COMMA) { - { - { - setState(300); match(COMMA); - setState(301); typeParameter(); - } - } - setState(306); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(307); match(GT); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class TypeParameterContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public TypeBoundContext typeBound() { - return getRuleContext(TypeBoundContext.class,0); - } - public TypeParameterContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_typeParameter; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitTypeParameter(this); - else return visitor.visitChildren(this); - } - } - - public final TypeParameterContext typeParameter() throws RecognitionException { - TypeParameterContext _localctx = new TypeParameterContext(_ctx, getState()); - enterRule(_localctx, 18, RULE_typeParameter); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(309); match(Identifier); - setState(312); - _la = _input.LA(1); - if (_la==EXTENDS) { - { - setState(310); match(EXTENDS); - setState(311); typeBound(); - } - } - - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class TypeBoundContext extends ParserRuleContext { - public TypeContext type(int i) { - return getRuleContext(TypeContext.class,i); - } - public List type() { - return getRuleContexts(TypeContext.class); - } - public TypeBoundContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_typeBound; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitTypeBound(this); - else return visitor.visitChildren(this); - } - } - - public final TypeBoundContext typeBound() throws RecognitionException { - TypeBoundContext _localctx = new TypeBoundContext(_ctx, getState()); - enterRule(_localctx, 20, RULE_typeBound); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(314); type(); - setState(319); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==BITAND) { - { - { - setState(315); match(BITAND); - setState(316); type(); - } - } - setState(321); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class EnumDeclarationContext extends ParserRuleContext { - public EnumBodyDeclarationsContext enumBodyDeclarations() { - return getRuleContext(EnumBodyDeclarationsContext.class,0); - } - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public TypeListContext typeList() { - return getRuleContext(TypeListContext.class,0); - } - public TerminalNode ENUM() { return getToken(Java8Parser.ENUM, 0); } - public EnumConstantsContext enumConstants() { - return getRuleContext(EnumConstantsContext.class,0); - } - public EnumDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_enumDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitEnumDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final EnumDeclarationContext enumDeclaration() throws RecognitionException { - EnumDeclarationContext _localctx = new EnumDeclarationContext(_ctx, getState()); - enterRule(_localctx, 22, RULE_enumDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(322); match(ENUM); - setState(323); match(Identifier); - setState(326); - _la = _input.LA(1); - if (_la==IMPLEMENTS) { - { - setState(324); match(IMPLEMENTS); - setState(325); typeList(); - } - } - - setState(328); match(LBRACE); - setState(330); - _la = _input.LA(1); - if (_la==Identifier || _la==AT) { - { - setState(329); enumConstants(); - } - } - - setState(333); - _la = _input.LA(1); - if (_la==COMMA) { - { - setState(332); match(COMMA); - } - } - - setState(336); - _la = _input.LA(1); - if (_la==SEMI) { - { - setState(335); enumBodyDeclarations(); - } - } - - setState(338); match(RBRACE); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class EnumConstantsContext extends ParserRuleContext { - public List enumConstant() { - return getRuleContexts(EnumConstantContext.class); - } - public EnumConstantContext enumConstant(int i) { - return getRuleContext(EnumConstantContext.class,i); - } - public EnumConstantsContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_enumConstants; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitEnumConstants(this); - else return visitor.visitChildren(this); - } - } - - public final EnumConstantsContext enumConstants() throws RecognitionException { - EnumConstantsContext _localctx = new EnumConstantsContext(_ctx, getState()); - enterRule(_localctx, 24, RULE_enumConstants); - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(340); enumConstant(); - setState(345); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,24,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(341); match(COMMA); - setState(342); enumConstant(); - } - } - } - setState(347); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,24,_ctx); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class EnumConstantContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public List annotation() { - return getRuleContexts(AnnotationContext.class); - } - public ClassBodyContext classBody() { - return getRuleContext(ClassBodyContext.class,0); - } - public AnnotationContext annotation(int i) { - return getRuleContext(AnnotationContext.class,i); - } - public ArgumentsContext arguments() { - return getRuleContext(ArgumentsContext.class,0); - } - public EnumConstantContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_enumConstant; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitEnumConstant(this); - else return visitor.visitChildren(this); - } - } - - public final EnumConstantContext enumConstant() throws RecognitionException { - EnumConstantContext _localctx = new EnumConstantContext(_ctx, getState()); - enterRule(_localctx, 26, RULE_enumConstant); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(351); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==AT) { - { - { - setState(348); annotation(); - } - } - setState(353); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(354); match(Identifier); - setState(356); - _la = _input.LA(1); - if (_la==LPAREN) { - { - setState(355); arguments(); - } - } - - setState(359); - _la = _input.LA(1); - if (_la==LBRACE) { - { - setState(358); classBody(); - } - } - - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class EnumBodyDeclarationsContext extends ParserRuleContext { - public List classBodyDeclaration() { - return getRuleContexts(ClassBodyDeclarationContext.class); - } - public ClassBodyDeclarationContext classBodyDeclaration(int i) { - return getRuleContext(ClassBodyDeclarationContext.class,i); - } - public EnumBodyDeclarationsContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_enumBodyDeclarations; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitEnumBodyDeclarations(this); - else return visitor.visitChildren(this); - } - } - - public final EnumBodyDeclarationsContext enumBodyDeclarations() throws RecognitionException { - EnumBodyDeclarationsContext _localctx = new EnumBodyDeclarationsContext(_ctx, getState()); - enterRule(_localctx, 28, RULE_enumBodyDeclarations); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(361); match(SEMI); - setState(365); - _errHandler.sync(this); - _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ABSTRACT) | (1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << CLASS) | (1L << DOUBLE) | (1L << ENUM) | (1L << FINAL) | (1L << FLOAT) | (1L << INT) | (1L << INTERFACE) | (1L << LONG) | (1L << NATIVE) | (1L << PRIVATE) | (1L << PROTECTED) | (1L << PUBLIC) | (1L << SHORT) | (1L << STATIC) | (1L << STRICTFP) | (1L << SYNCHRONIZED) | (1L << TRANSIENT) | (1L << VOID) | (1L << VOLATILE) | (1L << LBRACE) | (1L << SEMI))) != 0) || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (LT - 68)) | (1L << (Identifier - 68)) | (1L << (AT - 68)))) != 0)) { - { - { - setState(362); classBodyDeclaration(); - } - } - setState(367); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class InterfaceDeclarationContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public InterfaceBodyContext interfaceBody() { - return getRuleContext(InterfaceBodyContext.class,0); - } - public TypeListContext typeList() { - return getRuleContext(TypeListContext.class,0); - } - public TypeParametersContext typeParameters() { - return getRuleContext(TypeParametersContext.class,0); - } - public InterfaceDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_interfaceDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitInterfaceDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final InterfaceDeclarationContext interfaceDeclaration() throws RecognitionException { - InterfaceDeclarationContext _localctx = new InterfaceDeclarationContext(_ctx, getState()); - enterRule(_localctx, 30, RULE_interfaceDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(368); match(INTERFACE); - setState(369); match(Identifier); - setState(371); - _la = _input.LA(1); - if (_la==LT) { - { - setState(370); typeParameters(); - } - } - - setState(375); - _la = _input.LA(1); - if (_la==EXTENDS) { - { - setState(373); match(EXTENDS); - setState(374); typeList(); - } - } - - setState(377); interfaceBody(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class TypeListContext extends ParserRuleContext { - public TypeContext type(int i) { - return getRuleContext(TypeContext.class,i); - } - public List type() { - return getRuleContexts(TypeContext.class); - } - public TypeListContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_typeList; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitTypeList(this); - else return visitor.visitChildren(this); - } - } - - public final TypeListContext typeList() throws RecognitionException { - TypeListContext _localctx = new TypeListContext(_ctx, getState()); - enterRule(_localctx, 32, RULE_typeList); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(379); type(); - setState(384); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==COMMA) { - { - { - setState(380); match(COMMA); - setState(381); type(); - } - } - setState(386); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ClassBodyContext extends ParserRuleContext { - public List classBodyDeclaration() { - return getRuleContexts(ClassBodyDeclarationContext.class); - } - public ClassBodyDeclarationContext classBodyDeclaration(int i) { - return getRuleContext(ClassBodyDeclarationContext.class,i); - } - public ClassBodyContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_classBody; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitClassBody(this); - else return visitor.visitChildren(this); - } - } - - public final ClassBodyContext classBody() throws RecognitionException { - ClassBodyContext _localctx = new ClassBodyContext(_ctx, getState()); - enterRule(_localctx, 34, RULE_classBody); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(387); match(LBRACE); - setState(391); - _errHandler.sync(this); - _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ABSTRACT) | (1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << CLASS) | (1L << DOUBLE) | (1L << ENUM) | (1L << FINAL) | (1L << FLOAT) | (1L << INT) | (1L << INTERFACE) | (1L << LONG) | (1L << NATIVE) | (1L << PRIVATE) | (1L << PROTECTED) | (1L << PUBLIC) | (1L << SHORT) | (1L << STATIC) | (1L << STRICTFP) | (1L << SYNCHRONIZED) | (1L << TRANSIENT) | (1L << VOID) | (1L << VOLATILE) | (1L << LBRACE) | (1L << SEMI))) != 0) || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (LT - 68)) | (1L << (Identifier - 68)) | (1L << (AT - 68)))) != 0)) { - { - { - setState(388); classBodyDeclaration(); - } - } - setState(393); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(394); match(RBRACE); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class InterfaceBodyContext extends ParserRuleContext { - public List interfaceBodyDeclaration() { - return getRuleContexts(InterfaceBodyDeclarationContext.class); - } - public InterfaceBodyDeclarationContext interfaceBodyDeclaration(int i) { - return getRuleContext(InterfaceBodyDeclarationContext.class,i); - } - public InterfaceBodyContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_interfaceBody; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitInterfaceBody(this); - else return visitor.visitChildren(this); - } - } - - public final InterfaceBodyContext interfaceBody() throws RecognitionException { - InterfaceBodyContext _localctx = new InterfaceBodyContext(_ctx, getState()); - enterRule(_localctx, 36, RULE_interfaceBody); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(396); match(LBRACE); - setState(400); - _errHandler.sync(this); - _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ABSTRACT) | (1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << CLASS) | (1L << DOUBLE) | (1L << ENUM) | (1L << FINAL) | (1L << FLOAT) | (1L << INT) | (1L << INTERFACE) | (1L << LONG) | (1L << NATIVE) | (1L << PRIVATE) | (1L << PROTECTED) | (1L << PUBLIC) | (1L << SHORT) | (1L << STATIC) | (1L << STRICTFP) | (1L << SYNCHRONIZED) | (1L << TRANSIENT) | (1L << VOID) | (1L << VOLATILE) | (1L << SEMI))) != 0) || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (LT - 68)) | (1L << (Identifier - 68)) | (1L << (AT - 68)))) != 0)) { - { - { - setState(397); interfaceBodyDeclaration(); - } - } - setState(402); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(403); match(RBRACE); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ClassBodyDeclarationContext extends ParserRuleContext { - public List modifier() { - return getRuleContexts(ModifierContext.class); - } - public MemberDeclarationContext memberDeclaration() { - return getRuleContext(MemberDeclarationContext.class,0); - } - public ModifierContext modifier(int i) { - return getRuleContext(ModifierContext.class,i); - } - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public ClassBodyDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_classBodyDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitClassBodyDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final ClassBodyDeclarationContext classBodyDeclaration() throws RecognitionException { - ClassBodyDeclarationContext _localctx = new ClassBodyDeclarationContext(_ctx, getState()); - enterRule(_localctx, 38, RULE_classBodyDeclaration); - int _la; - try { - int _alt; - setState(417); - switch ( getInterpreter().adaptivePredict(_input,36,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(405); match(SEMI); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(407); - _la = _input.LA(1); - if (_la==STATIC) { - { - setState(406); match(STATIC); - } - } - - setState(409); block(); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(413); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,35,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(410); modifier(); - } - } - } - setState(415); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,35,_ctx); - } - setState(416); memberDeclaration(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class MemberDeclarationContext extends ParserRuleContext { - public GenericMethodDeclarationContext genericMethodDeclaration() { - return getRuleContext(GenericMethodDeclarationContext.class,0); - } - public MethodDeclarationContext methodDeclaration() { - return getRuleContext(MethodDeclarationContext.class,0); - } - public EnumDeclarationContext enumDeclaration() { - return getRuleContext(EnumDeclarationContext.class,0); - } - public ClassDeclarationContext classDeclaration() { - return getRuleContext(ClassDeclarationContext.class,0); - } - public AnnotationTypeDeclarationContext annotationTypeDeclaration() { - return getRuleContext(AnnotationTypeDeclarationContext.class,0); - } - public GenericConstructorDeclarationContext genericConstructorDeclaration() { - return getRuleContext(GenericConstructorDeclarationContext.class,0); - } - public InterfaceDeclarationContext interfaceDeclaration() { - return getRuleContext(InterfaceDeclarationContext.class,0); - } - public ConstructorDeclarationContext constructorDeclaration() { - return getRuleContext(ConstructorDeclarationContext.class,0); - } - public FieldDeclarationContext fieldDeclaration() { - return getRuleContext(FieldDeclarationContext.class,0); - } - public MemberDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_memberDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitMemberDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final MemberDeclarationContext memberDeclaration() throws RecognitionException { - MemberDeclarationContext _localctx = new MemberDeclarationContext(_ctx, getState()); - enterRule(_localctx, 40, RULE_memberDeclaration); - try { - setState(428); - switch ( getInterpreter().adaptivePredict(_input,37,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(419); methodDeclaration(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(420); genericMethodDeclaration(); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(421); fieldDeclaration(); - } - break; - case 4: - enterOuterAlt(_localctx, 4); - { - setState(422); constructorDeclaration(); - } - break; - case 5: - enterOuterAlt(_localctx, 5); - { - setState(423); genericConstructorDeclaration(); - } - break; - case 6: - enterOuterAlt(_localctx, 6); - { - setState(424); interfaceDeclaration(); - } - break; - case 7: - enterOuterAlt(_localctx, 7); - { - setState(425); annotationTypeDeclaration(); - } - break; - case 8: - enterOuterAlt(_localctx, 8); - { - setState(426); classDeclaration(); - } - break; - case 9: - enterOuterAlt(_localctx, 9); - { - setState(427); enumDeclaration(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class MethodDeclarationContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public MethodBodyContext methodBody() { - return getRuleContext(MethodBodyContext.class,0); - } - public QualifiedNameListContext qualifiedNameList() { - return getRuleContext(QualifiedNameListContext.class,0); - } - public FormalParametersContext formalParameters() { - return getRuleContext(FormalParametersContext.class,0); - } - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public MethodDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_methodDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitMethodDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final MethodDeclarationContext methodDeclaration() throws RecognitionException { - MethodDeclarationContext _localctx = new MethodDeclarationContext(_ctx, getState()); - enterRule(_localctx, 42, RULE_methodDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(432); - switch (_input.LA(1)) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case Identifier: - { - setState(430); type(); - } - break; - case VOID: - { - setState(431); match(VOID); - } - break; - default: - throw new NoViableAltException(this); - } - setState(434); match(Identifier); - setState(435); formalParameters(); - setState(440); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==LBRACK) { - { - { - setState(436); match(LBRACK); - setState(437); match(RBRACK); - } - } - setState(442); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(445); - _la = _input.LA(1); - if (_la==THROWS) { - { - setState(443); match(THROWS); - setState(444); qualifiedNameList(); - } - } - - setState(449); - switch (_input.LA(1)) { - case LBRACE: - { - setState(447); methodBody(); - } - break; - case SEMI: - { - setState(448); match(SEMI); - } - break; - default: - throw new NoViableAltException(this); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class GenericMethodDeclarationContext extends ParserRuleContext { - public MethodDeclarationContext methodDeclaration() { - return getRuleContext(MethodDeclarationContext.class,0); - } - public TypeParametersContext typeParameters() { - return getRuleContext(TypeParametersContext.class,0); - } - public GenericMethodDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_genericMethodDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitGenericMethodDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final GenericMethodDeclarationContext genericMethodDeclaration() throws RecognitionException { - GenericMethodDeclarationContext _localctx = new GenericMethodDeclarationContext(_ctx, getState()); - enterRule(_localctx, 44, RULE_genericMethodDeclaration); - try { - enterOuterAlt(_localctx, 1); - { - setState(451); typeParameters(); - setState(452); methodDeclaration(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ConstructorDeclarationContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public ConstructorBodyContext constructorBody() { - return getRuleContext(ConstructorBodyContext.class,0); - } - public QualifiedNameListContext qualifiedNameList() { - return getRuleContext(QualifiedNameListContext.class,0); - } - public FormalParametersContext formalParameters() { - return getRuleContext(FormalParametersContext.class,0); - } - public ConstructorDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_constructorDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitConstructorDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final ConstructorDeclarationContext constructorDeclaration() throws RecognitionException { - ConstructorDeclarationContext _localctx = new ConstructorDeclarationContext(_ctx, getState()); - enterRule(_localctx, 46, RULE_constructorDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(454); match(Identifier); - setState(455); formalParameters(); - setState(458); - _la = _input.LA(1); - if (_la==THROWS) { - { - setState(456); match(THROWS); - setState(457); qualifiedNameList(); - } - } - - setState(460); constructorBody(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class GenericConstructorDeclarationContext extends ParserRuleContext { - public TypeParametersContext typeParameters() { - return getRuleContext(TypeParametersContext.class,0); - } - public ConstructorDeclarationContext constructorDeclaration() { - return getRuleContext(ConstructorDeclarationContext.class,0); - } - public GenericConstructorDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_genericConstructorDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitGenericConstructorDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final GenericConstructorDeclarationContext genericConstructorDeclaration() throws RecognitionException { - GenericConstructorDeclarationContext _localctx = new GenericConstructorDeclarationContext(_ctx, getState()); - enterRule(_localctx, 48, RULE_genericConstructorDeclaration); - try { - enterOuterAlt(_localctx, 1); - { - setState(462); typeParameters(); - setState(463); constructorDeclaration(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class FieldDeclarationContext extends ParserRuleContext { - public VariableDeclaratorsContext variableDeclarators() { - return getRuleContext(VariableDeclaratorsContext.class,0); - } - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public FieldDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_fieldDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitFieldDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final FieldDeclarationContext fieldDeclaration() throws RecognitionException { - FieldDeclarationContext _localctx = new FieldDeclarationContext(_ctx, getState()); - enterRule(_localctx, 50, RULE_fieldDeclaration); - try { - enterOuterAlt(_localctx, 1); - { - setState(465); type(); - setState(466); variableDeclarators(); - setState(467); match(SEMI); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class InterfaceBodyDeclarationContext extends ParserRuleContext { - public List modifier() { - return getRuleContexts(ModifierContext.class); - } - public ModifierContext modifier(int i) { - return getRuleContext(ModifierContext.class,i); - } - public InterfaceMemberDeclarationContext interfaceMemberDeclaration() { - return getRuleContext(InterfaceMemberDeclarationContext.class,0); - } - public InterfaceBodyDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_interfaceBodyDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitInterfaceBodyDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final InterfaceBodyDeclarationContext interfaceBodyDeclaration() throws RecognitionException { - InterfaceBodyDeclarationContext _localctx = new InterfaceBodyDeclarationContext(_ctx, getState()); - enterRule(_localctx, 52, RULE_interfaceBodyDeclaration); - try { - int _alt; - setState(477); - switch (_input.LA(1)) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOID: - case VOLATILE: - case LT: - case Identifier: - case AT: - enterOuterAlt(_localctx, 1); - { - setState(472); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,43,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(469); modifier(); - } - } - } - setState(474); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,43,_ctx); - } - setState(475); interfaceMemberDeclaration(); - } - break; - case SEMI: - enterOuterAlt(_localctx, 2); - { - setState(476); match(SEMI); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class InterfaceMemberDeclarationContext extends ParserRuleContext { - public EnumDeclarationContext enumDeclaration() { - return getRuleContext(EnumDeclarationContext.class,0); - } - public ClassDeclarationContext classDeclaration() { - return getRuleContext(ClassDeclarationContext.class,0); - } - public GenericInterfaceMethodDeclarationContext genericInterfaceMethodDeclaration() { - return getRuleContext(GenericInterfaceMethodDeclarationContext.class,0); - } - public AnnotationTypeDeclarationContext annotationTypeDeclaration() { - return getRuleContext(AnnotationTypeDeclarationContext.class,0); - } - public InterfaceDeclarationContext interfaceDeclaration() { - return getRuleContext(InterfaceDeclarationContext.class,0); - } - public ConstDeclarationContext constDeclaration() { - return getRuleContext(ConstDeclarationContext.class,0); - } - public InterfaceMethodDeclarationContext interfaceMethodDeclaration() { - return getRuleContext(InterfaceMethodDeclarationContext.class,0); - } - public InterfaceMemberDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_interfaceMemberDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitInterfaceMemberDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final InterfaceMemberDeclarationContext interfaceMemberDeclaration() throws RecognitionException { - InterfaceMemberDeclarationContext _localctx = new InterfaceMemberDeclarationContext(_ctx, getState()); - enterRule(_localctx, 54, RULE_interfaceMemberDeclaration); - try { - setState(486); - switch ( getInterpreter().adaptivePredict(_input,45,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(479); constDeclaration(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(480); interfaceMethodDeclaration(); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(481); genericInterfaceMethodDeclaration(); - } - break; - case 4: - enterOuterAlt(_localctx, 4); - { - setState(482); interfaceDeclaration(); - } - break; - case 5: - enterOuterAlt(_localctx, 5); - { - setState(483); annotationTypeDeclaration(); - } - break; - case 6: - enterOuterAlt(_localctx, 6); - { - setState(484); classDeclaration(); - } - break; - case 7: - enterOuterAlt(_localctx, 7); - { - setState(485); enumDeclaration(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ConstDeclarationContext extends ParserRuleContext { - public ConstantDeclaratorContext constantDeclarator(int i) { - return getRuleContext(ConstantDeclaratorContext.class,i); - } - public List constantDeclarator() { - return getRuleContexts(ConstantDeclaratorContext.class); - } - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public ConstDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_constDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitConstDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final ConstDeclarationContext constDeclaration() throws RecognitionException { - ConstDeclarationContext _localctx = new ConstDeclarationContext(_ctx, getState()); - enterRule(_localctx, 56, RULE_constDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(488); type(); - setState(489); constantDeclarator(); - setState(494); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==COMMA) { - { - { - setState(490); match(COMMA); - setState(491); constantDeclarator(); - } - } - setState(496); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(497); match(SEMI); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ConstantDeclaratorContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public VariableInitializerContext variableInitializer() { - return getRuleContext(VariableInitializerContext.class,0); - } - public ConstantDeclaratorContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_constantDeclarator; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitConstantDeclarator(this); - else return visitor.visitChildren(this); - } - } - - public final ConstantDeclaratorContext constantDeclarator() throws RecognitionException { - ConstantDeclaratorContext _localctx = new ConstantDeclaratorContext(_ctx, getState()); - enterRule(_localctx, 58, RULE_constantDeclarator); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(499); match(Identifier); - setState(504); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==LBRACK) { - { - { - setState(500); match(LBRACK); - setState(501); match(RBRACK); - } - } - setState(506); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(507); match(ASSIGN); - setState(508); variableInitializer(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class InterfaceMethodDeclarationContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public QualifiedNameListContext qualifiedNameList() { - return getRuleContext(QualifiedNameListContext.class,0); - } - public FormalParametersContext formalParameters() { - return getRuleContext(FormalParametersContext.class,0); - } - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public InterfaceMethodDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_interfaceMethodDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitInterfaceMethodDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final InterfaceMethodDeclarationContext interfaceMethodDeclaration() throws RecognitionException { - InterfaceMethodDeclarationContext _localctx = new InterfaceMethodDeclarationContext(_ctx, getState()); - enterRule(_localctx, 60, RULE_interfaceMethodDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(512); - switch (_input.LA(1)) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case Identifier: - { - setState(510); type(); - } - break; - case VOID: - { - setState(511); match(VOID); - } - break; - default: - throw new NoViableAltException(this); - } - setState(514); match(Identifier); - setState(515); formalParameters(); - setState(520); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==LBRACK) { - { - { - setState(516); match(LBRACK); - setState(517); match(RBRACK); - } - } - setState(522); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(525); - _la = _input.LA(1); - if (_la==THROWS) { - { - setState(523); match(THROWS); - setState(524); qualifiedNameList(); - } - } - - setState(527); match(SEMI); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class GenericInterfaceMethodDeclarationContext extends ParserRuleContext { - public TypeParametersContext typeParameters() { - return getRuleContext(TypeParametersContext.class,0); - } - public InterfaceMethodDeclarationContext interfaceMethodDeclaration() { - return getRuleContext(InterfaceMethodDeclarationContext.class,0); - } - public GenericInterfaceMethodDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_genericInterfaceMethodDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitGenericInterfaceMethodDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final GenericInterfaceMethodDeclarationContext genericInterfaceMethodDeclaration() throws RecognitionException { - GenericInterfaceMethodDeclarationContext _localctx = new GenericInterfaceMethodDeclarationContext(_ctx, getState()); - enterRule(_localctx, 62, RULE_genericInterfaceMethodDeclaration); - try { - enterOuterAlt(_localctx, 1); - { - setState(529); typeParameters(); - setState(530); interfaceMethodDeclaration(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class VariableDeclaratorsContext extends ParserRuleContext { - public List variableDeclarator() { - return getRuleContexts(VariableDeclaratorContext.class); - } - public VariableDeclaratorContext variableDeclarator(int i) { - return getRuleContext(VariableDeclaratorContext.class,i); - } - public VariableDeclaratorsContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_variableDeclarators; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitVariableDeclarators(this); - else return visitor.visitChildren(this); - } - } - - public final VariableDeclaratorsContext variableDeclarators() throws RecognitionException { - VariableDeclaratorsContext _localctx = new VariableDeclaratorsContext(_ctx, getState()); - enterRule(_localctx, 64, RULE_variableDeclarators); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(532); variableDeclarator(); - setState(537); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==COMMA) { - { - { - setState(533); match(COMMA); - setState(534); variableDeclarator(); - } - } - setState(539); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class VariableDeclaratorContext extends ParserRuleContext { - public VariableInitializerContext variableInitializer() { - return getRuleContext(VariableInitializerContext.class,0); - } - public VariableDeclaratorIdContext variableDeclaratorId() { - return getRuleContext(VariableDeclaratorIdContext.class,0); - } - public VariableDeclaratorContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_variableDeclarator; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitVariableDeclarator(this); - else return visitor.visitChildren(this); - } - } - - public final VariableDeclaratorContext variableDeclarator() throws RecognitionException { - VariableDeclaratorContext _localctx = new VariableDeclaratorContext(_ctx, getState()); - enterRule(_localctx, 66, RULE_variableDeclarator); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(540); variableDeclaratorId(); - setState(543); - _la = _input.LA(1); - if (_la==ASSIGN) { - { - setState(541); match(ASSIGN); - setState(542); variableInitializer(); - } - } - - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class VariableDeclaratorIdContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public VariableDeclaratorIdContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_variableDeclaratorId; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitVariableDeclaratorId(this); - else return visitor.visitChildren(this); - } - } - - public final VariableDeclaratorIdContext variableDeclaratorId() throws RecognitionException { - VariableDeclaratorIdContext _localctx = new VariableDeclaratorIdContext(_ctx, getState()); - enterRule(_localctx, 68, RULE_variableDeclaratorId); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(545); match(Identifier); - setState(550); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==LBRACK) { - { - { - setState(546); match(LBRACK); - setState(547); match(RBRACK); - } - } - setState(552); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class VariableInitializerContext extends ParserRuleContext { - public ArrayInitializerContext arrayInitializer() { - return getRuleContext(ArrayInitializerContext.class,0); - } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public VariableInitializerContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_variableInitializer; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitVariableInitializer(this); - else return visitor.visitChildren(this); - } - } - - public final VariableInitializerContext variableInitializer() throws RecognitionException { - VariableInitializerContext _localctx = new VariableInitializerContext(_ctx, getState()); - enterRule(_localctx, 70, RULE_variableInitializer); - try { - setState(555); - switch (_input.LA(1)) { - case LBRACE: - enterOuterAlt(_localctx, 1); - { - setState(553); arrayInitializer(); - } - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case NEW: - case SHORT: - case SUPER: - case THIS: - case VOID: - case IntegerLiteral: - case FloatingPointLiteral: - case BooleanLiteral: - case CharacterLiteral: - case StringLiteral: - case NullLiteral: - case LPAREN: - case LT: - case BANG: - case TILDE: - case INC: - case DEC: - case ADD: - case SUB: - case Identifier: - enterOuterAlt(_localctx, 2); - { - setState(554); expression(0); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ArrayInitializerContext extends ParserRuleContext { - public List variableInitializer() { - return getRuleContexts(VariableInitializerContext.class); - } - public VariableInitializerContext variableInitializer(int i) { - return getRuleContext(VariableInitializerContext.class,i); - } - public ArrayInitializerContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_arrayInitializer; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitArrayInitializer(this); - else return visitor.visitChildren(this); - } - } - - public final ArrayInitializerContext arrayInitializer() throws RecognitionException { - ArrayInitializerContext _localctx = new ArrayInitializerContext(_ctx, getState()); - enterRule(_localctx, 72, RULE_arrayInitializer); - int _la; - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(557); match(LBRACE); - setState(569); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << DOUBLE) | (1L << FLOAT) | (1L << INT) | (1L << LONG) | (1L << NEW) | (1L << SHORT) | (1L << SUPER) | (1L << THIS) | (1L << VOID) | (1L << IntegerLiteral) | (1L << FloatingPointLiteral) | (1L << BooleanLiteral) | (1L << CharacterLiteral) | (1L << StringLiteral) | (1L << NullLiteral) | (1L << LPAREN) | (1L << LBRACE))) != 0) || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (LT - 68)) | (1L << (BANG - 68)) | (1L << (TILDE - 68)) | (1L << (INC - 68)) | (1L << (DEC - 68)) | (1L << (ADD - 68)) | (1L << (SUB - 68)) | (1L << (Identifier - 68)))) != 0)) { - { - setState(558); variableInitializer(); - setState(563); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,55,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(559); match(COMMA); - setState(560); variableInitializer(); - } - } - } - setState(565); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,55,_ctx); - } - setState(567); - _la = _input.LA(1); - if (_la==COMMA) { - { - setState(566); match(COMMA); - } - } - - } - } - - setState(571); match(RBRACE); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class EnumConstantNameContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public EnumConstantNameContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_enumConstantName; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitEnumConstantName(this); - else return visitor.visitChildren(this); - } - } - - public final EnumConstantNameContext enumConstantName() throws RecognitionException { - EnumConstantNameContext _localctx = new EnumConstantNameContext(_ctx, getState()); - enterRule(_localctx, 74, RULE_enumConstantName); - try { - enterOuterAlt(_localctx, 1); - { - setState(573); match(Identifier); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class TypeContext extends ParserRuleContext { - public PrimitiveTypeContext primitiveType() { - return getRuleContext(PrimitiveTypeContext.class,0); - } - public ClassOrInterfaceTypeContext classOrInterfaceType() { - return getRuleContext(ClassOrInterfaceTypeContext.class,0); - } - public TypeContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_type; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitType(this); - else return visitor.visitChildren(this); - } - } - - public final TypeContext type() throws RecognitionException { - TypeContext _localctx = new TypeContext(_ctx, getState()); - enterRule(_localctx, 76, RULE_type); - try { - int _alt; - setState(591); - switch (_input.LA(1)) { - case Identifier: - enterOuterAlt(_localctx, 1); - { - setState(575); classOrInterfaceType(); - setState(580); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,58,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(576); match(LBRACK); - setState(577); match(RBRACK); - } - } - } - setState(582); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,58,_ctx); - } - } - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - enterOuterAlt(_localctx, 2); - { - setState(583); primitiveType(); - setState(588); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,59,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(584); match(LBRACK); - setState(585); match(RBRACK); - } - } - } - setState(590); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,59,_ctx); - } - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ClassOrInterfaceTypeContext extends ParserRuleContext { - public List typeArguments() { - return getRuleContexts(TypeArgumentsContext.class); - } - public List Identifier() { return getTokens(Java8Parser.Identifier); } - public TerminalNode Identifier(int i) { - return getToken(Java8Parser.Identifier, i); - } - public TypeArgumentsContext typeArguments(int i) { - return getRuleContext(TypeArgumentsContext.class,i); - } - public ClassOrInterfaceTypeContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_classOrInterfaceType; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitClassOrInterfaceType(this); - else return visitor.visitChildren(this); - } - } - - public final ClassOrInterfaceTypeContext classOrInterfaceType() throws RecognitionException { - ClassOrInterfaceTypeContext _localctx = new ClassOrInterfaceTypeContext(_ctx, getState()); - enterRule(_localctx, 78, RULE_classOrInterfaceType); - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(593); match(Identifier); - setState(595); - switch ( getInterpreter().adaptivePredict(_input,61,_ctx) ) { - case 1: - { - setState(594); typeArguments(); - } - break; - } - setState(604); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,63,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(597); match(DOT); - setState(598); match(Identifier); - setState(600); - switch ( getInterpreter().adaptivePredict(_input,62,_ctx) ) { - case 1: - { - setState(599); typeArguments(); - } - break; - } - } - } - } - setState(606); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,63,_ctx); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class PrimitiveTypeContext extends ParserRuleContext { - public PrimitiveTypeContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_primitiveType; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitPrimitiveType(this); - else return visitor.visitChildren(this); - } - } - - public final PrimitiveTypeContext primitiveType() throws RecognitionException { - PrimitiveTypeContext _localctx = new PrimitiveTypeContext(_ctx, getState()); - enterRule(_localctx, 80, RULE_primitiveType); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(607); - _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << DOUBLE) | (1L << FLOAT) | (1L << INT) | (1L << LONG) | (1L << SHORT))) != 0)) ) { - _errHandler.recoverInline(this); - } - consume(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class TypeArgumentsContext extends ParserRuleContext { - public List typeArgument() { - return getRuleContexts(TypeArgumentContext.class); - } - public TypeArgumentContext typeArgument(int i) { - return getRuleContext(TypeArgumentContext.class,i); - } - public TypeArgumentsContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_typeArguments; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitTypeArguments(this); - else return visitor.visitChildren(this); - } - } - - public final TypeArgumentsContext typeArguments() throws RecognitionException { - TypeArgumentsContext _localctx = new TypeArgumentsContext(_ctx, getState()); - enterRule(_localctx, 82, RULE_typeArguments); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(609); match(LT); - setState(610); typeArgument(); - setState(615); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==COMMA) { - { - { - setState(611); match(COMMA); - setState(612); typeArgument(); - } - } - setState(617); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(618); match(GT); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class TypeArgumentContext extends ParserRuleContext { - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public TypeArgumentContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_typeArgument; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitTypeArgument(this); - else return visitor.visitChildren(this); - } - } - - public final TypeArgumentContext typeArgument() throws RecognitionException { - TypeArgumentContext _localctx = new TypeArgumentContext(_ctx, getState()); - enterRule(_localctx, 84, RULE_typeArgument); - int _la; - try { - setState(626); - switch (_input.LA(1)) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case Identifier: - enterOuterAlt(_localctx, 1); - { - setState(620); type(); - } - break; - case QUESTION: - enterOuterAlt(_localctx, 2); - { - setState(621); match(QUESTION); - setState(624); - _la = _input.LA(1); - if (_la==EXTENDS || _la==SUPER) { - { - setState(622); - _la = _input.LA(1); - if ( !(_la==EXTENDS || _la==SUPER) ) { - _errHandler.recoverInline(this); - } - consume(); - setState(623); type(); - } - } - - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class QualifiedNameListContext extends ParserRuleContext { - public List qualifiedName() { - return getRuleContexts(QualifiedNameContext.class); - } - public QualifiedNameContext qualifiedName(int i) { - return getRuleContext(QualifiedNameContext.class,i); - } - public QualifiedNameListContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_qualifiedNameList; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitQualifiedNameList(this); - else return visitor.visitChildren(this); - } - } - - public final QualifiedNameListContext qualifiedNameList() throws RecognitionException { - QualifiedNameListContext _localctx = new QualifiedNameListContext(_ctx, getState()); - enterRule(_localctx, 86, RULE_qualifiedNameList); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(628); qualifiedName(); - setState(633); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==COMMA) { - { - { - setState(629); match(COMMA); - setState(630); qualifiedName(); - } - } - setState(635); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class FormalParametersContext extends ParserRuleContext { - public FormalParameterListContext formalParameterList() { - return getRuleContext(FormalParameterListContext.class,0); - } - public FormalParametersContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_formalParameters; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitFormalParameters(this); - else return visitor.visitChildren(this); - } - } - - public final FormalParametersContext formalParameters() throws RecognitionException { - FormalParametersContext _localctx = new FormalParametersContext(_ctx, getState()); - enterRule(_localctx, 88, RULE_formalParameters); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(636); match(LPAREN); - setState(638); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << DOUBLE) | (1L << FINAL) | (1L << FLOAT) | (1L << INT) | (1L << LONG) | (1L << SHORT))) != 0) || _la==Identifier || _la==AT) { - { - setState(637); formalParameterList(); - } - } - - setState(640); match(RPAREN); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class FormalParameterListContext extends ParserRuleContext { - public List formalParameter() { - return getRuleContexts(FormalParameterContext.class); - } - public LastFormalParameterContext lastFormalParameter() { - return getRuleContext(LastFormalParameterContext.class,0); - } - public FormalParameterContext formalParameter(int i) { - return getRuleContext(FormalParameterContext.class,i); - } - public FormalParameterListContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_formalParameterList; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitFormalParameterList(this); - else return visitor.visitChildren(this); - } - } - - public final FormalParameterListContext formalParameterList() throws RecognitionException { - FormalParameterListContext _localctx = new FormalParameterListContext(_ctx, getState()); - enterRule(_localctx, 90, RULE_formalParameterList); - int _la; - try { - int _alt; - setState(655); - switch ( getInterpreter().adaptivePredict(_input,71,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(642); formalParameter(); - setState(647); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,69,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(643); match(COMMA); - setState(644); formalParameter(); - } - } - } - setState(649); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,69,_ctx); - } - setState(652); - _la = _input.LA(1); - if (_la==COMMA) { - { - setState(650); match(COMMA); - setState(651); lastFormalParameter(); - } - } - - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(654); lastFormalParameter(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class FormalParameterContext extends ParserRuleContext { - public VariableModifierContext variableModifier(int i) { - return getRuleContext(VariableModifierContext.class,i); - } - public List variableModifier() { - return getRuleContexts(VariableModifierContext.class); - } - public VariableDeclaratorIdContext variableDeclaratorId() { - return getRuleContext(VariableDeclaratorIdContext.class,0); - } - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public FormalParameterContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_formalParameter; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitFormalParameter(this); - else return visitor.visitChildren(this); - } - } - - public final FormalParameterContext formalParameter() throws RecognitionException { - FormalParameterContext _localctx = new FormalParameterContext(_ctx, getState()); - enterRule(_localctx, 92, RULE_formalParameter); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(660); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==FINAL || _la==AT) { - { - { - setState(657); variableModifier(); - } - } - setState(662); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(663); type(); - setState(664); variableDeclaratorId(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class LastFormalParameterContext extends ParserRuleContext { - public VariableModifierContext variableModifier(int i) { - return getRuleContext(VariableModifierContext.class,i); - } - public List variableModifier() { - return getRuleContexts(VariableModifierContext.class); - } - public VariableDeclaratorIdContext variableDeclaratorId() { - return getRuleContext(VariableDeclaratorIdContext.class,0); - } - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public LastFormalParameterContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_lastFormalParameter; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitLastFormalParameter(this); - else return visitor.visitChildren(this); - } - } - - public final LastFormalParameterContext lastFormalParameter() throws RecognitionException { - LastFormalParameterContext _localctx = new LastFormalParameterContext(_ctx, getState()); - enterRule(_localctx, 94, RULE_lastFormalParameter); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(669); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==FINAL || _la==AT) { - { - { - setState(666); variableModifier(); - } - } - setState(671); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(672); type(); - setState(673); match(ELLIPSIS); - setState(674); variableDeclaratorId(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class MethodBodyContext extends ParserRuleContext { - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public MethodBodyContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_methodBody; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitMethodBody(this); - else return visitor.visitChildren(this); - } - } - - public final MethodBodyContext methodBody() throws RecognitionException { - MethodBodyContext _localctx = new MethodBodyContext(_ctx, getState()); - enterRule(_localctx, 96, RULE_methodBody); - try { - enterOuterAlt(_localctx, 1); - { - setState(676); block(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ConstructorBodyContext extends ParserRuleContext { - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public ConstructorBodyContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_constructorBody; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitConstructorBody(this); - else return visitor.visitChildren(this); - } - } - - public final ConstructorBodyContext constructorBody() throws RecognitionException { - ConstructorBodyContext _localctx = new ConstructorBodyContext(_ctx, getState()); - enterRule(_localctx, 98, RULE_constructorBody); - try { - enterOuterAlt(_localctx, 1); - { - setState(678); block(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class QualifiedNameContext extends ParserRuleContext { - public List Identifier() { return getTokens(Java8Parser.Identifier); } - public TerminalNode Identifier(int i) { - return getToken(Java8Parser.Identifier, i); - } - public QualifiedNameContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_qualifiedName; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitQualifiedName(this); - else return visitor.visitChildren(this); - } - } - - public final QualifiedNameContext qualifiedName() throws RecognitionException { - QualifiedNameContext _localctx = new QualifiedNameContext(_ctx, getState()); - enterRule(_localctx, 100, RULE_qualifiedName); - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(680); match(Identifier); - setState(685); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,74,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(681); match(DOT); - setState(682); match(Identifier); - } - } - } - setState(687); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,74,_ctx); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class LiteralContext extends ParserRuleContext { - public TerminalNode StringLiteral() { return getToken(Java8Parser.StringLiteral, 0); } - public TerminalNode IntegerLiteral() { return getToken(Java8Parser.IntegerLiteral, 0); } - public TerminalNode FloatingPointLiteral() { return getToken(Java8Parser.FloatingPointLiteral, 0); } - public TerminalNode BooleanLiteral() { return getToken(Java8Parser.BooleanLiteral, 0); } - public TerminalNode CharacterLiteral() { return getToken(Java8Parser.CharacterLiteral, 0); } - public LiteralContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_literal; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitLiteral(this); - else return visitor.visitChildren(this); - } - } - - public final LiteralContext literal() throws RecognitionException { - LiteralContext _localctx = new LiteralContext(_ctx, getState()); - enterRule(_localctx, 102, RULE_literal); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(688); - _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << IntegerLiteral) | (1L << FloatingPointLiteral) | (1L << BooleanLiteral) | (1L << CharacterLiteral) | (1L << StringLiteral) | (1L << NullLiteral))) != 0)) ) { - _errHandler.recoverInline(this); - } - consume(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class AnnotationContext extends ParserRuleContext { - public ElementValuePairsContext elementValuePairs() { - return getRuleContext(ElementValuePairsContext.class,0); - } - public AnnotationNameContext annotationName() { - return getRuleContext(AnnotationNameContext.class,0); - } - public ElementValueContext elementValue() { - return getRuleContext(ElementValueContext.class,0); - } - public AnnotationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_annotation; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitAnnotation(this); - else return visitor.visitChildren(this); - } - } - - public final AnnotationContext annotation() throws RecognitionException { - AnnotationContext _localctx = new AnnotationContext(_ctx, getState()); - enterRule(_localctx, 104, RULE_annotation); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(690); match(AT); - setState(691); annotationName(); - setState(698); - _la = _input.LA(1); - if (_la==LPAREN) { - { - setState(692); match(LPAREN); - setState(695); - switch ( getInterpreter().adaptivePredict(_input,75,_ctx) ) { - case 1: - { - setState(693); elementValuePairs(); - } - break; - case 2: - { - setState(694); elementValue(); - } - break; - } - setState(697); match(RPAREN); - } - } - - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class AnnotationNameContext extends ParserRuleContext { - public QualifiedNameContext qualifiedName() { - return getRuleContext(QualifiedNameContext.class,0); - } - public AnnotationNameContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_annotationName; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitAnnotationName(this); - else return visitor.visitChildren(this); - } - } - - public final AnnotationNameContext annotationName() throws RecognitionException { - AnnotationNameContext _localctx = new AnnotationNameContext(_ctx, getState()); - enterRule(_localctx, 106, RULE_annotationName); - try { - enterOuterAlt(_localctx, 1); - { - setState(700); qualifiedName(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ElementValuePairsContext extends ParserRuleContext { - public ElementValuePairContext elementValuePair(int i) { - return getRuleContext(ElementValuePairContext.class,i); - } - public List elementValuePair() { - return getRuleContexts(ElementValuePairContext.class); - } - public ElementValuePairsContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_elementValuePairs; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitElementValuePairs(this); - else return visitor.visitChildren(this); - } - } - - public final ElementValuePairsContext elementValuePairs() throws RecognitionException { - ElementValuePairsContext _localctx = new ElementValuePairsContext(_ctx, getState()); - enterRule(_localctx, 108, RULE_elementValuePairs); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(702); elementValuePair(); - setState(707); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==COMMA) { - { - { - setState(703); match(COMMA); - setState(704); elementValuePair(); - } - } - setState(709); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ElementValuePairContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public ElementValueContext elementValue() { - return getRuleContext(ElementValueContext.class,0); - } - public ElementValuePairContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_elementValuePair; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitElementValuePair(this); - else return visitor.visitChildren(this); - } - } - - public final ElementValuePairContext elementValuePair() throws RecognitionException { - ElementValuePairContext _localctx = new ElementValuePairContext(_ctx, getState()); - enterRule(_localctx, 110, RULE_elementValuePair); - try { - enterOuterAlt(_localctx, 1); - { - setState(710); match(Identifier); - setState(711); match(ASSIGN); - setState(712); elementValue(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ElementValueContext extends ParserRuleContext { - public ElementValueArrayInitializerContext elementValueArrayInitializer() { - return getRuleContext(ElementValueArrayInitializerContext.class,0); - } - public AnnotationContext annotation() { - return getRuleContext(AnnotationContext.class,0); - } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public ElementValueContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_elementValue; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitElementValue(this); - else return visitor.visitChildren(this); - } - } - - public final ElementValueContext elementValue() throws RecognitionException { - ElementValueContext _localctx = new ElementValueContext(_ctx, getState()); - enterRule(_localctx, 112, RULE_elementValue); - try { - setState(717); - switch (_input.LA(1)) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case NEW: - case SHORT: - case SUPER: - case THIS: - case VOID: - case IntegerLiteral: - case FloatingPointLiteral: - case BooleanLiteral: - case CharacterLiteral: - case StringLiteral: - case NullLiteral: - case LPAREN: - case LT: - case BANG: - case TILDE: - case INC: - case DEC: - case ADD: - case SUB: - case Identifier: - enterOuterAlt(_localctx, 1); - { - setState(714); expression(0); - } - break; - case AT: - enterOuterAlt(_localctx, 2); - { - setState(715); annotation(); - } - break; - case LBRACE: - enterOuterAlt(_localctx, 3); - { - setState(716); elementValueArrayInitializer(); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ElementValueArrayInitializerContext extends ParserRuleContext { - public ElementValueContext elementValue(int i) { - return getRuleContext(ElementValueContext.class,i); - } - public List elementValue() { - return getRuleContexts(ElementValueContext.class); - } - public ElementValueArrayInitializerContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_elementValueArrayInitializer; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitElementValueArrayInitializer(this); - else return visitor.visitChildren(this); - } - } - - public final ElementValueArrayInitializerContext elementValueArrayInitializer() throws RecognitionException { - ElementValueArrayInitializerContext _localctx = new ElementValueArrayInitializerContext(_ctx, getState()); - enterRule(_localctx, 114, RULE_elementValueArrayInitializer); - int _la; - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(719); match(LBRACE); - setState(728); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << DOUBLE) | (1L << FLOAT) | (1L << INT) | (1L << LONG) | (1L << NEW) | (1L << SHORT) | (1L << SUPER) | (1L << THIS) | (1L << VOID) | (1L << IntegerLiteral) | (1L << FloatingPointLiteral) | (1L << BooleanLiteral) | (1L << CharacterLiteral) | (1L << StringLiteral) | (1L << NullLiteral) | (1L << LPAREN) | (1L << LBRACE))) != 0) || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (LT - 68)) | (1L << (BANG - 68)) | (1L << (TILDE - 68)) | (1L << (INC - 68)) | (1L << (DEC - 68)) | (1L << (ADD - 68)) | (1L << (SUB - 68)) | (1L << (Identifier - 68)) | (1L << (AT - 68)))) != 0)) { - { - setState(720); elementValue(); - setState(725); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,79,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(721); match(COMMA); - setState(722); elementValue(); - } - } - } - setState(727); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,79,_ctx); - } - } - } - - setState(731); - _la = _input.LA(1); - if (_la==COMMA) { - { - setState(730); match(COMMA); - } - } - - setState(733); match(RBRACE); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class AnnotationTypeDeclarationContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public AnnotationTypeBodyContext annotationTypeBody() { - return getRuleContext(AnnotationTypeBodyContext.class,0); - } - public AnnotationTypeDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_annotationTypeDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitAnnotationTypeDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final AnnotationTypeDeclarationContext annotationTypeDeclaration() throws RecognitionException { - AnnotationTypeDeclarationContext _localctx = new AnnotationTypeDeclarationContext(_ctx, getState()); - enterRule(_localctx, 116, RULE_annotationTypeDeclaration); - try { - enterOuterAlt(_localctx, 1); - { - setState(735); match(AT); - setState(736); match(INTERFACE); - setState(737); match(Identifier); - setState(738); annotationTypeBody(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class AnnotationTypeBodyContext extends ParserRuleContext { - public List annotationTypeElementDeclaration() { - return getRuleContexts(AnnotationTypeElementDeclarationContext.class); - } - public AnnotationTypeElementDeclarationContext annotationTypeElementDeclaration(int i) { - return getRuleContext(AnnotationTypeElementDeclarationContext.class,i); - } - public AnnotationTypeBodyContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_annotationTypeBody; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitAnnotationTypeBody(this); - else return visitor.visitChildren(this); - } - } - - public final AnnotationTypeBodyContext annotationTypeBody() throws RecognitionException { - AnnotationTypeBodyContext _localctx = new AnnotationTypeBodyContext(_ctx, getState()); - enterRule(_localctx, 118, RULE_annotationTypeBody); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(740); match(LBRACE); - setState(744); - _errHandler.sync(this); - _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ABSTRACT) | (1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << CLASS) | (1L << DOUBLE) | (1L << ENUM) | (1L << FINAL) | (1L << FLOAT) | (1L << INT) | (1L << INTERFACE) | (1L << LONG) | (1L << NATIVE) | (1L << PRIVATE) | (1L << PROTECTED) | (1L << PUBLIC) | (1L << SHORT) | (1L << STATIC) | (1L << STRICTFP) | (1L << SYNCHRONIZED) | (1L << TRANSIENT) | (1L << VOLATILE) | (1L << SEMI))) != 0) || _la==Identifier || _la==AT) { - { - { - setState(741); annotationTypeElementDeclaration(); - } - } - setState(746); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(747); match(RBRACE); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class AnnotationTypeElementDeclarationContext extends ParserRuleContext { - public List modifier() { - return getRuleContexts(ModifierContext.class); - } - public AnnotationTypeElementRestContext annotationTypeElementRest() { - return getRuleContext(AnnotationTypeElementRestContext.class,0); - } - public ModifierContext modifier(int i) { - return getRuleContext(ModifierContext.class,i); - } - public AnnotationTypeElementDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_annotationTypeElementDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitAnnotationTypeElementDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final AnnotationTypeElementDeclarationContext annotationTypeElementDeclaration() throws RecognitionException { - AnnotationTypeElementDeclarationContext _localctx = new AnnotationTypeElementDeclarationContext(_ctx, getState()); - enterRule(_localctx, 120, RULE_annotationTypeElementDeclaration); - try { - int _alt; - setState(757); - switch (_input.LA(1)) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case Identifier: - case AT: - enterOuterAlt(_localctx, 1); - { - setState(752); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,83,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(749); modifier(); - } - } - } - setState(754); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,83,_ctx); - } - setState(755); annotationTypeElementRest(); - } - break; - case SEMI: - enterOuterAlt(_localctx, 2); - { - setState(756); match(SEMI); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class AnnotationTypeElementRestContext extends ParserRuleContext { - public EnumDeclarationContext enumDeclaration() { - return getRuleContext(EnumDeclarationContext.class,0); - } - public ClassDeclarationContext classDeclaration() { - return getRuleContext(ClassDeclarationContext.class,0); - } - public AnnotationMethodOrConstantRestContext annotationMethodOrConstantRest() { - return getRuleContext(AnnotationMethodOrConstantRestContext.class,0); - } - public AnnotationTypeDeclarationContext annotationTypeDeclaration() { - return getRuleContext(AnnotationTypeDeclarationContext.class,0); - } - public InterfaceDeclarationContext interfaceDeclaration() { - return getRuleContext(InterfaceDeclarationContext.class,0); - } - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public AnnotationTypeElementRestContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_annotationTypeElementRest; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitAnnotationTypeElementRest(this); - else return visitor.visitChildren(this); - } - } - - public final AnnotationTypeElementRestContext annotationTypeElementRest() throws RecognitionException { - AnnotationTypeElementRestContext _localctx = new AnnotationTypeElementRestContext(_ctx, getState()); - enterRule(_localctx, 122, RULE_annotationTypeElementRest); - try { - setState(779); - switch (_input.LA(1)) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case Identifier: - enterOuterAlt(_localctx, 1); - { - setState(759); type(); - setState(760); annotationMethodOrConstantRest(); - setState(761); match(SEMI); - } - break; - case CLASS: - enterOuterAlt(_localctx, 2); - { - setState(763); classDeclaration(); - setState(765); - switch ( getInterpreter().adaptivePredict(_input,85,_ctx) ) { - case 1: - { - setState(764); match(SEMI); - } - break; - } - } - break; - case INTERFACE: - enterOuterAlt(_localctx, 3); - { - setState(767); interfaceDeclaration(); - setState(769); - switch ( getInterpreter().adaptivePredict(_input,86,_ctx) ) { - case 1: - { - setState(768); match(SEMI); - } - break; - } - } - break; - case ENUM: - enterOuterAlt(_localctx, 4); - { - setState(771); enumDeclaration(); - setState(773); - switch ( getInterpreter().adaptivePredict(_input,87,_ctx) ) { - case 1: - { - setState(772); match(SEMI); - } - break; - } - } - break; - case AT: - enterOuterAlt(_localctx, 5); - { - setState(775); annotationTypeDeclaration(); - setState(777); - switch ( getInterpreter().adaptivePredict(_input,88,_ctx) ) { - case 1: - { - setState(776); match(SEMI); - } - break; - } - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class AnnotationMethodOrConstantRestContext extends ParserRuleContext { - public AnnotationMethodRestContext annotationMethodRest() { - return getRuleContext(AnnotationMethodRestContext.class,0); - } - public AnnotationConstantRestContext annotationConstantRest() { - return getRuleContext(AnnotationConstantRestContext.class,0); - } - public AnnotationMethodOrConstantRestContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_annotationMethodOrConstantRest; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitAnnotationMethodOrConstantRest(this); - else return visitor.visitChildren(this); - } - } - - public final AnnotationMethodOrConstantRestContext annotationMethodOrConstantRest() throws RecognitionException { - AnnotationMethodOrConstantRestContext _localctx = new AnnotationMethodOrConstantRestContext(_ctx, getState()); - enterRule(_localctx, 124, RULE_annotationMethodOrConstantRest); - try { - setState(783); - switch ( getInterpreter().adaptivePredict(_input,90,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(781); annotationMethodRest(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(782); annotationConstantRest(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class AnnotationMethodRestContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public DefaultValueContext defaultValue() { - return getRuleContext(DefaultValueContext.class,0); - } - public AnnotationMethodRestContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_annotationMethodRest; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitAnnotationMethodRest(this); - else return visitor.visitChildren(this); - } - } - - public final AnnotationMethodRestContext annotationMethodRest() throws RecognitionException { - AnnotationMethodRestContext _localctx = new AnnotationMethodRestContext(_ctx, getState()); - enterRule(_localctx, 126, RULE_annotationMethodRest); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(785); match(Identifier); - setState(786); match(LPAREN); - setState(787); match(RPAREN); - setState(789); - _la = _input.LA(1); - if (_la==DEFAULT) { - { - setState(788); defaultValue(); - } - } - - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class AnnotationConstantRestContext extends ParserRuleContext { - public VariableDeclaratorsContext variableDeclarators() { - return getRuleContext(VariableDeclaratorsContext.class,0); - } - public AnnotationConstantRestContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_annotationConstantRest; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitAnnotationConstantRest(this); - else return visitor.visitChildren(this); - } - } - - public final AnnotationConstantRestContext annotationConstantRest() throws RecognitionException { - AnnotationConstantRestContext _localctx = new AnnotationConstantRestContext(_ctx, getState()); - enterRule(_localctx, 128, RULE_annotationConstantRest); - try { - enterOuterAlt(_localctx, 1); - { - setState(791); variableDeclarators(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class DefaultValueContext extends ParserRuleContext { - public ElementValueContext elementValue() { - return getRuleContext(ElementValueContext.class,0); - } - public DefaultValueContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_defaultValue; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitDefaultValue(this); - else return visitor.visitChildren(this); - } - } - - public final DefaultValueContext defaultValue() throws RecognitionException { - DefaultValueContext _localctx = new DefaultValueContext(_ctx, getState()); - enterRule(_localctx, 130, RULE_defaultValue); - try { - enterOuterAlt(_localctx, 1); - { - setState(793); match(DEFAULT); - setState(794); elementValue(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class BlockContext extends ParserRuleContext { - public List blockStatement() { - return getRuleContexts(BlockStatementContext.class); - } - public BlockStatementContext blockStatement(int i) { - return getRuleContext(BlockStatementContext.class,i); - } - public BlockContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_block; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitBlock(this); - else return visitor.visitChildren(this); - } - } - - public final BlockContext block() throws RecognitionException { - BlockContext _localctx = new BlockContext(_ctx, getState()); - enterRule(_localctx, 132, RULE_block); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(796); match(LBRACE); - setState(800); - _errHandler.sync(this); - _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ABSTRACT) | (1L << ASSERT) | (1L << BOOLEAN) | (1L << BREAK) | (1L << BYTE) | (1L << CHAR) | (1L << CLASS) | (1L << CONTINUE) | (1L << DO) | (1L << DOUBLE) | (1L << ENUM) | (1L << FINAL) | (1L << FLOAT) | (1L << FOR) | (1L << IF) | (1L << INT) | (1L << INTERFACE) | (1L << LONG) | (1L << NEW) | (1L << PRIVATE) | (1L << PROTECTED) | (1L << PUBLIC) | (1L << RETURN) | (1L << SHORT) | (1L << STATIC) | (1L << STRICTFP) | (1L << SUPER) | (1L << SWITCH) | (1L << SYNCHRONIZED) | (1L << THIS) | (1L << THROW) | (1L << TRY) | (1L << VOID) | (1L << WHILE) | (1L << IntegerLiteral) | (1L << FloatingPointLiteral) | (1L << BooleanLiteral) | (1L << CharacterLiteral) | (1L << StringLiteral) | (1L << NullLiteral) | (1L << LPAREN) | (1L << LBRACE) | (1L << SEMI))) != 0) || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (LT - 68)) | (1L << (BANG - 68)) | (1L << (TILDE - 68)) | (1L << (INC - 68)) | (1L << (DEC - 68)) | (1L << (ADD - 68)) | (1L << (SUB - 68)) | (1L << (Identifier - 68)) | (1L << (AT - 68)))) != 0)) { - { - { - setState(797); blockStatement(); - } - } - setState(802); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(803); match(RBRACE); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class BlockStatementContext extends ParserRuleContext { - public TypeDeclarationContext typeDeclaration() { - return getRuleContext(TypeDeclarationContext.class,0); - } - public StatementContext statement() { - return getRuleContext(StatementContext.class,0); - } - public LocalVariableDeclarationStatementContext localVariableDeclarationStatement() { - return getRuleContext(LocalVariableDeclarationStatementContext.class,0); - } - public BlockStatementContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_blockStatement; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitBlockStatement(this); - else return visitor.visitChildren(this); - } - } - - public final BlockStatementContext blockStatement() throws RecognitionException { - BlockStatementContext _localctx = new BlockStatementContext(_ctx, getState()); - enterRule(_localctx, 134, RULE_blockStatement); - try { - setState(808); - switch ( getInterpreter().adaptivePredict(_input,93,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(805); localVariableDeclarationStatement(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(806); statement(); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(807); typeDeclaration(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class LocalVariableDeclarationStatementContext extends ParserRuleContext { - public LocalVariableDeclarationContext localVariableDeclaration() { - return getRuleContext(LocalVariableDeclarationContext.class,0); - } - public LocalVariableDeclarationStatementContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_localVariableDeclarationStatement; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitLocalVariableDeclarationStatement(this); - else return visitor.visitChildren(this); - } - } - - public final LocalVariableDeclarationStatementContext localVariableDeclarationStatement() throws RecognitionException { - LocalVariableDeclarationStatementContext _localctx = new LocalVariableDeclarationStatementContext(_ctx, getState()); - enterRule(_localctx, 136, RULE_localVariableDeclarationStatement); - try { - enterOuterAlt(_localctx, 1); - { - setState(810); localVariableDeclaration(); - setState(811); match(SEMI); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class LocalVariableDeclarationContext extends ParserRuleContext { - public VariableModifierContext variableModifier(int i) { - return getRuleContext(VariableModifierContext.class,i); - } - public List variableModifier() { - return getRuleContexts(VariableModifierContext.class); - } - public VariableDeclaratorsContext variableDeclarators() { - return getRuleContext(VariableDeclaratorsContext.class,0); - } - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public LocalVariableDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_localVariableDeclaration; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitLocalVariableDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final LocalVariableDeclarationContext localVariableDeclaration() throws RecognitionException { - LocalVariableDeclarationContext _localctx = new LocalVariableDeclarationContext(_ctx, getState()); - enterRule(_localctx, 138, RULE_localVariableDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(816); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==FINAL || _la==AT) { - { - { - setState(813); variableModifier(); - } - } - setState(818); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(819); type(); - setState(820); variableDeclarators(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class StatementContext extends ParserRuleContext { - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public StatementExpressionContext statementExpression() { - return getRuleContext(StatementExpressionContext.class,0); - } - public StatementContext statement(int i) { - return getRuleContext(StatementContext.class,i); - } - public List switchLabel() { - return getRuleContexts(SwitchLabelContext.class); - } - public List switchBlockStatementGroup() { - return getRuleContexts(SwitchBlockStatementGroupContext.class); - } - public ParExpressionContext parExpression() { - return getRuleContext(ParExpressionContext.class,0); - } - public List catchClause() { - return getRuleContexts(CatchClauseContext.class); - } - public CatchClauseContext catchClause(int i) { - return getRuleContext(CatchClauseContext.class,i); - } - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public FinallyBlockContext finallyBlock() { - return getRuleContext(FinallyBlockContext.class,0); - } - public SwitchBlockStatementGroupContext switchBlockStatementGroup(int i) { - return getRuleContext(SwitchBlockStatementGroupContext.class,i); - } - public ForControlContext forControl() { - return getRuleContext(ForControlContext.class,0); - } - public TerminalNode ASSERT() { return getToken(Java8Parser.ASSERT, 0); } - public ResourceSpecificationContext resourceSpecification() { - return getRuleContext(ResourceSpecificationContext.class,0); - } - public List statement() { - return getRuleContexts(StatementContext.class); - } - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public SwitchLabelContext switchLabel(int i) { - return getRuleContext(SwitchLabelContext.class,i); - } - public StatementContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_statement; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitStatement(this); - else return visitor.visitChildren(this); - } - } - - public final StatementContext statement() throws RecognitionException { - StatementContext _localctx = new StatementContext(_ctx, getState()); - enterRule(_localctx, 140, RULE_statement); - int _la; - try { - int _alt; - setState(926); - switch ( getInterpreter().adaptivePredict(_input,107,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(822); block(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(823); match(ASSERT); - setState(824); expression(0); - setState(827); - _la = _input.LA(1); - if (_la==COLON) { - { - setState(825); match(COLON); - setState(826); expression(0); - } - } - - setState(829); match(SEMI); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(831); match(IF); - setState(832); parExpression(); - setState(833); statement(); - setState(836); - switch ( getInterpreter().adaptivePredict(_input,96,_ctx) ) { - case 1: - { - setState(834); match(ELSE); - setState(835); statement(); - } - break; - } - } - break; - case 4: - enterOuterAlt(_localctx, 4); - { - setState(838); match(FOR); - setState(839); match(LPAREN); - setState(840); forControl(); - setState(841); match(RPAREN); - setState(842); statement(); - } - break; - case 5: - enterOuterAlt(_localctx, 5); - { - setState(844); match(WHILE); - setState(845); parExpression(); - setState(846); statement(); - } - break; - case 6: - enterOuterAlt(_localctx, 6); - { - setState(848); match(DO); - setState(849); statement(); - setState(850); match(WHILE); - setState(851); parExpression(); - setState(852); match(SEMI); - } - break; - case 7: - enterOuterAlt(_localctx, 7); - { - setState(854); match(TRY); - setState(855); block(); - setState(865); - switch (_input.LA(1)) { - case CATCH: - { - setState(857); - _errHandler.sync(this); - _la = _input.LA(1); - do { - { - { - setState(856); catchClause(); - } - } - setState(859); - _errHandler.sync(this); - _la = _input.LA(1); - } while ( _la==CATCH ); - setState(862); - _la = _input.LA(1); - if (_la==FINALLY) { - { - setState(861); finallyBlock(); - } - } - - } - break; - case FINALLY: - { - setState(864); finallyBlock(); - } - break; - default: - throw new NoViableAltException(this); - } - } - break; - case 8: - enterOuterAlt(_localctx, 8); - { - setState(867); match(TRY); - setState(868); resourceSpecification(); - setState(869); block(); - setState(873); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==CATCH) { - { - { - setState(870); catchClause(); - } - } - setState(875); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(877); - _la = _input.LA(1); - if (_la==FINALLY) { - { - setState(876); finallyBlock(); - } - } - - } - break; - case 9: - enterOuterAlt(_localctx, 9); - { - setState(879); match(SWITCH); - setState(880); parExpression(); - setState(881); match(LBRACE); - setState(885); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,102,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(882); switchBlockStatementGroup(); - } - } - } - setState(887); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,102,_ctx); - } - setState(891); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==CASE || _la==DEFAULT) { - { - { - setState(888); switchLabel(); - } - } - setState(893); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(894); match(RBRACE); - } - break; - case 10: - enterOuterAlt(_localctx, 10); - { - setState(896); match(SYNCHRONIZED); - setState(897); parExpression(); - setState(898); block(); - } - break; - case 11: - enterOuterAlt(_localctx, 11); - { - setState(900); match(RETURN); - setState(902); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << DOUBLE) | (1L << FLOAT) | (1L << INT) | (1L << LONG) | (1L << NEW) | (1L << SHORT) | (1L << SUPER) | (1L << THIS) | (1L << VOID) | (1L << IntegerLiteral) | (1L << FloatingPointLiteral) | (1L << BooleanLiteral) | (1L << CharacterLiteral) | (1L << StringLiteral) | (1L << NullLiteral) | (1L << LPAREN))) != 0) || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (LT - 68)) | (1L << (BANG - 68)) | (1L << (TILDE - 68)) | (1L << (INC - 68)) | (1L << (DEC - 68)) | (1L << (ADD - 68)) | (1L << (SUB - 68)) | (1L << (Identifier - 68)))) != 0)) { - { - setState(901); expression(0); - } - } - - setState(904); match(SEMI); - } - break; - case 12: - enterOuterAlt(_localctx, 12); - { - setState(905); match(THROW); - setState(906); expression(0); - setState(907); match(SEMI); - } - break; - case 13: - enterOuterAlt(_localctx, 13); - { - setState(909); match(BREAK); - setState(911); - _la = _input.LA(1); - if (_la==Identifier) { - { - setState(910); match(Identifier); - } - } - - setState(913); match(SEMI); - } - break; - case 14: - enterOuterAlt(_localctx, 14); - { - setState(914); match(CONTINUE); - setState(916); - _la = _input.LA(1); - if (_la==Identifier) { - { - setState(915); match(Identifier); - } - } - - setState(918); match(SEMI); - } - break; - case 15: - enterOuterAlt(_localctx, 15); - { - setState(919); match(SEMI); - } - break; - case 16: - enterOuterAlt(_localctx, 16); - { - setState(920); statementExpression(); - setState(921); match(SEMI); - } - break; - case 17: - enterOuterAlt(_localctx, 17); - { - setState(923); match(Identifier); - setState(924); match(COLON); - setState(925); statement(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class CatchClauseContext extends ParserRuleContext { - public CatchTypeContext catchType() { - return getRuleContext(CatchTypeContext.class,0); - } - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public VariableModifierContext variableModifier(int i) { - return getRuleContext(VariableModifierContext.class,i); - } - public List variableModifier() { - return getRuleContexts(VariableModifierContext.class); - } - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public CatchClauseContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_catchClause; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitCatchClause(this); - else return visitor.visitChildren(this); - } - } - - public final CatchClauseContext catchClause() throws RecognitionException { - CatchClauseContext _localctx = new CatchClauseContext(_ctx, getState()); - enterRule(_localctx, 142, RULE_catchClause); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(928); match(CATCH); - setState(929); match(LPAREN); - setState(933); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==FINAL || _la==AT) { - { - { - setState(930); variableModifier(); - } - } - setState(935); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(936); catchType(); - setState(937); match(Identifier); - setState(938); match(RPAREN); - setState(939); block(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class CatchTypeContext extends ParserRuleContext { - public List qualifiedName() { - return getRuleContexts(QualifiedNameContext.class); - } - public QualifiedNameContext qualifiedName(int i) { - return getRuleContext(QualifiedNameContext.class,i); - } - public CatchTypeContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_catchType; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitCatchType(this); - else return visitor.visitChildren(this); - } - } - - public final CatchTypeContext catchType() throws RecognitionException { - CatchTypeContext _localctx = new CatchTypeContext(_ctx, getState()); - enterRule(_localctx, 144, RULE_catchType); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(941); qualifiedName(); - setState(946); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==BITOR) { - { - { - setState(942); match(BITOR); - setState(943); qualifiedName(); - } - } - setState(948); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class FinallyBlockContext extends ParserRuleContext { - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public FinallyBlockContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_finallyBlock; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitFinallyBlock(this); - else return visitor.visitChildren(this); - } - } - - public final FinallyBlockContext finallyBlock() throws RecognitionException { - FinallyBlockContext _localctx = new FinallyBlockContext(_ctx, getState()); - enterRule(_localctx, 146, RULE_finallyBlock); - try { - enterOuterAlt(_localctx, 1); - { - setState(949); match(FINALLY); - setState(950); block(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ResourceSpecificationContext extends ParserRuleContext { - public ResourcesContext resources() { - return getRuleContext(ResourcesContext.class,0); - } - public ResourceSpecificationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_resourceSpecification; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitResourceSpecification(this); - else return visitor.visitChildren(this); - } - } - - public final ResourceSpecificationContext resourceSpecification() throws RecognitionException { - ResourceSpecificationContext _localctx = new ResourceSpecificationContext(_ctx, getState()); - enterRule(_localctx, 148, RULE_resourceSpecification); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(952); match(LPAREN); - setState(953); resources(); - setState(955); - _la = _input.LA(1); - if (_la==SEMI) { - { - setState(954); match(SEMI); - } - } - - setState(957); match(RPAREN); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ResourcesContext extends ParserRuleContext { - public ResourceContext resource(int i) { - return getRuleContext(ResourceContext.class,i); - } - public List resource() { - return getRuleContexts(ResourceContext.class); - } - public ResourcesContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_resources; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitResources(this); - else return visitor.visitChildren(this); - } - } - - public final ResourcesContext resources() throws RecognitionException { - ResourcesContext _localctx = new ResourcesContext(_ctx, getState()); - enterRule(_localctx, 150, RULE_resources); - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(959); resource(); - setState(964); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,111,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(960); match(SEMI); - setState(961); resource(); - } - } - } - setState(966); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,111,_ctx); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ResourceContext extends ParserRuleContext { - public VariableModifierContext variableModifier(int i) { - return getRuleContext(VariableModifierContext.class,i); - } - public List variableModifier() { - return getRuleContexts(VariableModifierContext.class); - } - public ClassOrInterfaceTypeContext classOrInterfaceType() { - return getRuleContext(ClassOrInterfaceTypeContext.class,0); - } - public VariableDeclaratorIdContext variableDeclaratorId() { - return getRuleContext(VariableDeclaratorIdContext.class,0); - } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public ResourceContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_resource; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitResource(this); - else return visitor.visitChildren(this); - } - } - - public final ResourceContext resource() throws RecognitionException { - ResourceContext _localctx = new ResourceContext(_ctx, getState()); - enterRule(_localctx, 152, RULE_resource); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(970); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==FINAL || _la==AT) { - { - { - setState(967); variableModifier(); - } - } - setState(972); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(973); classOrInterfaceType(); - setState(974); variableDeclaratorId(); - setState(975); match(ASSIGN); - setState(976); expression(0); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class SwitchBlockStatementGroupContext extends ParserRuleContext { - public List blockStatement() { - return getRuleContexts(BlockStatementContext.class); - } - public List switchLabel() { - return getRuleContexts(SwitchLabelContext.class); - } - public BlockStatementContext blockStatement(int i) { - return getRuleContext(BlockStatementContext.class,i); - } - public SwitchLabelContext switchLabel(int i) { - return getRuleContext(SwitchLabelContext.class,i); - } - public SwitchBlockStatementGroupContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_switchBlockStatementGroup; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitSwitchBlockStatementGroup(this); - else return visitor.visitChildren(this); - } - } - - public final SwitchBlockStatementGroupContext switchBlockStatementGroup() throws RecognitionException { - SwitchBlockStatementGroupContext _localctx = new SwitchBlockStatementGroupContext(_ctx, getState()); - enterRule(_localctx, 154, RULE_switchBlockStatementGroup); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(979); - _errHandler.sync(this); - _la = _input.LA(1); - do { - { - { - setState(978); switchLabel(); - } - } - setState(981); - _errHandler.sync(this); - _la = _input.LA(1); - } while ( _la==CASE || _la==DEFAULT ); - setState(984); - _errHandler.sync(this); - _la = _input.LA(1); - do { - { - { - setState(983); blockStatement(); - } - } - setState(986); - _errHandler.sync(this); - _la = _input.LA(1); - } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ABSTRACT) | (1L << ASSERT) | (1L << BOOLEAN) | (1L << BREAK) | (1L << BYTE) | (1L << CHAR) | (1L << CLASS) | (1L << CONTINUE) | (1L << DO) | (1L << DOUBLE) | (1L << ENUM) | (1L << FINAL) | (1L << FLOAT) | (1L << FOR) | (1L << IF) | (1L << INT) | (1L << INTERFACE) | (1L << LONG) | (1L << NEW) | (1L << PRIVATE) | (1L << PROTECTED) | (1L << PUBLIC) | (1L << RETURN) | (1L << SHORT) | (1L << STATIC) | (1L << STRICTFP) | (1L << SUPER) | (1L << SWITCH) | (1L << SYNCHRONIZED) | (1L << THIS) | (1L << THROW) | (1L << TRY) | (1L << VOID) | (1L << WHILE) | (1L << IntegerLiteral) | (1L << FloatingPointLiteral) | (1L << BooleanLiteral) | (1L << CharacterLiteral) | (1L << StringLiteral) | (1L << NullLiteral) | (1L << LPAREN) | (1L << LBRACE) | (1L << SEMI))) != 0) || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (LT - 68)) | (1L << (BANG - 68)) | (1L << (TILDE - 68)) | (1L << (INC - 68)) | (1L << (DEC - 68)) | (1L << (ADD - 68)) | (1L << (SUB - 68)) | (1L << (Identifier - 68)) | (1L << (AT - 68)))) != 0) ); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class SwitchLabelContext extends ParserRuleContext { - public ConstantExpressionContext constantExpression() { - return getRuleContext(ConstantExpressionContext.class,0); - } - public EnumConstantNameContext enumConstantName() { - return getRuleContext(EnumConstantNameContext.class,0); - } - public SwitchLabelContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_switchLabel; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitSwitchLabel(this); - else return visitor.visitChildren(this); - } - } - - public final SwitchLabelContext switchLabel() throws RecognitionException { - SwitchLabelContext _localctx = new SwitchLabelContext(_ctx, getState()); - enterRule(_localctx, 156, RULE_switchLabel); - try { - setState(998); - switch ( getInterpreter().adaptivePredict(_input,115,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(988); match(CASE); - setState(989); constantExpression(); - setState(990); match(COLON); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(992); match(CASE); - setState(993); enumConstantName(); - setState(994); match(COLON); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(996); match(DEFAULT); - setState(997); match(COLON); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ForControlContext extends ParserRuleContext { - public ForUpdateContext forUpdate() { - return getRuleContext(ForUpdateContext.class,0); - } - public ForInitContext forInit() { - return getRuleContext(ForInitContext.class,0); - } - public EnhancedForControlContext enhancedForControl() { - return getRuleContext(EnhancedForControlContext.class,0); - } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public ForControlContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_forControl; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitForControl(this); - else return visitor.visitChildren(this); - } - } - - public final ForControlContext forControl() throws RecognitionException { - ForControlContext _localctx = new ForControlContext(_ctx, getState()); - enterRule(_localctx, 158, RULE_forControl); - int _la; - try { - setState(1012); - switch ( getInterpreter().adaptivePredict(_input,119,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(1000); enhancedForControl(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(1002); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << DOUBLE) | (1L << FINAL) | (1L << FLOAT) | (1L << INT) | (1L << LONG) | (1L << NEW) | (1L << SHORT) | (1L << SUPER) | (1L << THIS) | (1L << VOID) | (1L << IntegerLiteral) | (1L << FloatingPointLiteral) | (1L << BooleanLiteral) | (1L << CharacterLiteral) | (1L << StringLiteral) | (1L << NullLiteral) | (1L << LPAREN))) != 0) || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (LT - 68)) | (1L << (BANG - 68)) | (1L << (TILDE - 68)) | (1L << (INC - 68)) | (1L << (DEC - 68)) | (1L << (ADD - 68)) | (1L << (SUB - 68)) | (1L << (Identifier - 68)) | (1L << (AT - 68)))) != 0)) { - { - setState(1001); forInit(); - } - } - - setState(1004); match(SEMI); - setState(1006); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << DOUBLE) | (1L << FLOAT) | (1L << INT) | (1L << LONG) | (1L << NEW) | (1L << SHORT) | (1L << SUPER) | (1L << THIS) | (1L << VOID) | (1L << IntegerLiteral) | (1L << FloatingPointLiteral) | (1L << BooleanLiteral) | (1L << CharacterLiteral) | (1L << StringLiteral) | (1L << NullLiteral) | (1L << LPAREN))) != 0) || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (LT - 68)) | (1L << (BANG - 68)) | (1L << (TILDE - 68)) | (1L << (INC - 68)) | (1L << (DEC - 68)) | (1L << (ADD - 68)) | (1L << (SUB - 68)) | (1L << (Identifier - 68)))) != 0)) { - { - setState(1005); expression(0); - } - } - - setState(1008); match(SEMI); - setState(1010); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << DOUBLE) | (1L << FLOAT) | (1L << INT) | (1L << LONG) | (1L << NEW) | (1L << SHORT) | (1L << SUPER) | (1L << THIS) | (1L << VOID) | (1L << IntegerLiteral) | (1L << FloatingPointLiteral) | (1L << BooleanLiteral) | (1L << CharacterLiteral) | (1L << StringLiteral) | (1L << NullLiteral) | (1L << LPAREN))) != 0) || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (LT - 68)) | (1L << (BANG - 68)) | (1L << (TILDE - 68)) | (1L << (INC - 68)) | (1L << (DEC - 68)) | (1L << (ADD - 68)) | (1L << (SUB - 68)) | (1L << (Identifier - 68)))) != 0)) { - { - setState(1009); forUpdate(); - } - } - - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ForInitContext extends ParserRuleContext { - public LocalVariableDeclarationContext localVariableDeclaration() { - return getRuleContext(LocalVariableDeclarationContext.class,0); - } - public ExpressionListContext expressionList() { - return getRuleContext(ExpressionListContext.class,0); - } - public ForInitContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_forInit; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitForInit(this); - else return visitor.visitChildren(this); - } - } - - public final ForInitContext forInit() throws RecognitionException { - ForInitContext _localctx = new ForInitContext(_ctx, getState()); - enterRule(_localctx, 160, RULE_forInit); - try { - setState(1016); - switch ( getInterpreter().adaptivePredict(_input,120,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(1014); localVariableDeclaration(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(1015); expressionList(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class EnhancedForControlContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public VariableModifierContext variableModifier(int i) { - return getRuleContext(VariableModifierContext.class,i); - } - public List variableModifier() { - return getRuleContexts(VariableModifierContext.class); - } - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public EnhancedForControlContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_enhancedForControl; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitEnhancedForControl(this); - else return visitor.visitChildren(this); - } - } - - public final EnhancedForControlContext enhancedForControl() throws RecognitionException { - EnhancedForControlContext _localctx = new EnhancedForControlContext(_ctx, getState()); - enterRule(_localctx, 162, RULE_enhancedForControl); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(1021); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==FINAL || _la==AT) { - { - { - setState(1018); variableModifier(); - } - } - setState(1023); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(1024); type(); - setState(1025); match(Identifier); - setState(1026); match(COLON); - setState(1027); expression(0); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ForUpdateContext extends ParserRuleContext { - public ExpressionListContext expressionList() { - return getRuleContext(ExpressionListContext.class,0); - } - public ForUpdateContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_forUpdate; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitForUpdate(this); - else return visitor.visitChildren(this); - } - } - - public final ForUpdateContext forUpdate() throws RecognitionException { - ForUpdateContext _localctx = new ForUpdateContext(_ctx, getState()); - enterRule(_localctx, 164, RULE_forUpdate); - try { - enterOuterAlt(_localctx, 1); - { - setState(1029); expressionList(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ParExpressionContext extends ParserRuleContext { - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public ParExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_parExpression; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitParExpression(this); - else return visitor.visitChildren(this); - } - } - - public final ParExpressionContext parExpression() throws RecognitionException { - ParExpressionContext _localctx = new ParExpressionContext(_ctx, getState()); - enterRule(_localctx, 166, RULE_parExpression); - try { - enterOuterAlt(_localctx, 1); - { - setState(1031); match(LPAREN); - setState(1032); expression(0); - setState(1033); match(RPAREN); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ExpressionListContext extends ParserRuleContext { - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionListContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_expressionList; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitExpressionList(this); - else return visitor.visitChildren(this); - } - } - - public final ExpressionListContext expressionList() throws RecognitionException { - ExpressionListContext _localctx = new ExpressionListContext(_ctx, getState()); - enterRule(_localctx, 168, RULE_expressionList); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(1035); expression(0); - setState(1040); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==COMMA) { - { - { - setState(1036); match(COMMA); - setState(1037); expression(0); - } - } - setState(1042); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class StatementExpressionContext extends ParserRuleContext { - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public StatementExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_statementExpression; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitStatementExpression(this); - else return visitor.visitChildren(this); - } - } - - public final StatementExpressionContext statementExpression() throws RecognitionException { - StatementExpressionContext _localctx = new StatementExpressionContext(_ctx, getState()); - enterRule(_localctx, 170, RULE_statementExpression); - try { - enterOuterAlt(_localctx, 1); - { - setState(1043); expression(0); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ConstantExpressionContext extends ParserRuleContext { - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public ConstantExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_constantExpression; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitConstantExpression(this); - else return visitor.visitChildren(this); - } - } - - public final ConstantExpressionContext constantExpression() throws RecognitionException { - ConstantExpressionContext _localctx = new ConstantExpressionContext(_ctx, getState()); - enterRule(_localctx, 172, RULE_constantExpression); - try { - enterOuterAlt(_localctx, 1); - { - setState(1045); expression(0); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ExpressionContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public NonWildcardTypeArgumentsContext nonWildcardTypeArguments() { - return getRuleContext(NonWildcardTypeArgumentsContext.class,0); - } - public ExplicitGenericInvocationContext explicitGenericInvocation() { - return getRuleContext(ExplicitGenericInvocationContext.class,0); - } - public ExpressionListContext expressionList() { - return getRuleContext(ExpressionListContext.class,0); - } - public InnerCreatorContext innerCreator() { - return getRuleContext(InnerCreatorContext.class,0); - } - public SuperSuffixContext superSuffix() { - return getRuleContext(SuperSuffixContext.class,0); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public PrimaryContext primary() { - return getRuleContext(PrimaryContext.class,0); - } - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public CreatorContext creator() { - return getRuleContext(CreatorContext.class,0); - } - public ExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_expression; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitExpression(this); - else return visitor.visitChildren(this); - } - } - - public final ExpressionContext expression() throws RecognitionException { - return expression(0); - } - - private ExpressionContext expression(int _p) throws RecognitionException { - ParserRuleContext _parentctx = _ctx; - int _parentState = getState(); - ExpressionContext _localctx = new ExpressionContext(_ctx, _parentState); - ExpressionContext _prevctx = _localctx; - int _startState = 174; - enterRecursionRule(_localctx, 174, RULE_expression, _p); - int _la; - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(1060); - switch ( getInterpreter().adaptivePredict(_input,123,_ctx) ) { - case 1: - { - setState(1048); match(LPAREN); - setState(1049); type(); - setState(1050); match(RPAREN); - setState(1051); expression(17); - } - break; - case 2: - { - setState(1053); - _la = _input.LA(1); - if ( !(((((_la - 79)) & ~0x3f) == 0 && ((1L << (_la - 79)) & ((1L << (INC - 79)) | (1L << (DEC - 79)) | (1L << (ADD - 79)) | (1L << (SUB - 79)))) != 0)) ) { - _errHandler.recoverInline(this); - } - consume(); - setState(1054); expression(15); - } - break; - case 3: - { - setState(1055); - _la = _input.LA(1); - if ( !(_la==BANG || _la==TILDE) ) { - _errHandler.recoverInline(this); - } - consume(); - setState(1056); expression(14); - } - break; - case 4: - { - setState(1057); primary(); - } - break; - case 5: - { - setState(1058); match(NEW); - setState(1059); creator(); - } - break; - } - _ctx.stop = _input.LT(-1); - setState(1147); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,128,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - if ( _parseListeners!=null ) triggerExitRuleEvent(); - _prevctx = _localctx; - { - setState(1145); - switch ( getInterpreter().adaptivePredict(_input,127,_ctx) ) { - case 1: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1062); - if (!(precpred(_ctx, 13))) throw new FailedPredicateException(this, "precpred(_ctx, 13)"); - setState(1063); - _la = _input.LA(1); - if ( !(((((_la - 83)) & ~0x3f) == 0 && ((1L << (_la - 83)) & ((1L << (MUL - 83)) | (1L << (DIV - 83)) | (1L << (MOD - 83)))) != 0)) ) { - _errHandler.recoverInline(this); - } - consume(); - setState(1064); expression(14); - } - break; - case 2: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1065); - if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)"); - setState(1066); - _la = _input.LA(1); - if ( !(_la==ADD || _la==SUB) ) { - _errHandler.recoverInline(this); - } - consume(); - setState(1067); expression(13); - } - break; - case 3: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1068); - if (!(precpred(_ctx, 11))) throw new FailedPredicateException(this, "precpred(_ctx, 11)"); - setState(1076); - switch ( getInterpreter().adaptivePredict(_input,124,_ctx) ) { - case 1: - { - setState(1069); match(LT); - setState(1070); match(LT); - } - break; - case 2: - { - setState(1071); match(GT); - setState(1072); match(GT); - setState(1073); match(GT); - } - break; - case 3: - { - setState(1074); match(GT); - setState(1075); match(GT); - } - break; - } - setState(1078); expression(12); - } - break; - case 4: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1079); - if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); - setState(1080); - _la = _input.LA(1); - if ( !(((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (GT - 67)) | (1L << (LT - 67)) | (1L << (LE - 67)) | (1L << (GE - 67)))) != 0)) ) { - _errHandler.recoverInline(this); - } - consume(); - setState(1081); expression(11); - } - break; - case 5: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1082); - if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); - setState(1083); - _la = _input.LA(1); - if ( !(_la==EQUAL || _la==NOTEQUAL) ) { - _errHandler.recoverInline(this); - } - consume(); - setState(1084); expression(9); - } - break; - case 6: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1085); - if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); - setState(1086); match(BITAND); - setState(1087); expression(8); - } - break; - case 7: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1088); - if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); - setState(1089); match(CARET); - setState(1090); expression(7); - } - break; - case 8: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1091); - if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)"); - setState(1092); match(BITOR); - setState(1093); expression(6); - } - break; - case 9: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1094); - if (!(precpred(_ctx, 4))) throw new FailedPredicateException(this, "precpred(_ctx, 4)"); - setState(1095); match(AND); - setState(1096); expression(5); - } - break; - case 10: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1097); - if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); - setState(1098); match(OR); - setState(1099); expression(4); - } - break; - case 11: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1100); - if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(1101); match(QUESTION); - setState(1102); expression(0); - setState(1103); match(COLON); - setState(1104); expression(3); - } - break; - case 12: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1106); - if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(1107); - _la = _input.LA(1); - if ( !(((((_la - 66)) & ~0x3f) == 0 && ((1L << (_la - 66)) & ((1L << (ASSIGN - 66)) | (1L << (ADD_ASSIGN - 66)) | (1L << (SUB_ASSIGN - 66)) | (1L << (MUL_ASSIGN - 66)) | (1L << (DIV_ASSIGN - 66)) | (1L << (AND_ASSIGN - 66)) | (1L << (OR_ASSIGN - 66)) | (1L << (XOR_ASSIGN - 66)) | (1L << (MOD_ASSIGN - 66)) | (1L << (LSHIFT_ASSIGN - 66)) | (1L << (RSHIFT_ASSIGN - 66)) | (1L << (URSHIFT_ASSIGN - 66)))) != 0)) ) { - _errHandler.recoverInline(this); - } - consume(); - setState(1108); expression(2); - } - break; - case 13: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1109); - if (!(precpred(_ctx, 25))) throw new FailedPredicateException(this, "precpred(_ctx, 25)"); - setState(1110); match(DOT); - setState(1111); match(Identifier); - } - break; - case 14: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1112); - if (!(precpred(_ctx, 24))) throw new FailedPredicateException(this, "precpred(_ctx, 24)"); - setState(1113); match(DOT); - setState(1114); match(THIS); - } - break; - case 15: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1115); - if (!(precpred(_ctx, 23))) throw new FailedPredicateException(this, "precpred(_ctx, 23)"); - setState(1116); match(DOT); - setState(1117); match(NEW); - setState(1119); - _la = _input.LA(1); - if (_la==LT) { - { - setState(1118); nonWildcardTypeArguments(); - } - } - - setState(1121); innerCreator(); - } - break; - case 16: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1122); - if (!(precpred(_ctx, 22))) throw new FailedPredicateException(this, "precpred(_ctx, 22)"); - setState(1123); match(DOT); - setState(1124); match(SUPER); - setState(1125); superSuffix(); - } - break; - case 17: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1126); - if (!(precpred(_ctx, 21))) throw new FailedPredicateException(this, "precpred(_ctx, 21)"); - setState(1127); match(DOT); - setState(1128); explicitGenericInvocation(); - } - break; - case 18: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1129); - if (!(precpred(_ctx, 20))) throw new FailedPredicateException(this, "precpred(_ctx, 20)"); - setState(1130); match(LBRACK); - setState(1131); expression(0); - setState(1132); match(RBRACK); - } - break; - case 19: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1134); - if (!(precpred(_ctx, 19))) throw new FailedPredicateException(this, "precpred(_ctx, 19)"); - setState(1135); match(LPAREN); - setState(1137); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << DOUBLE) | (1L << FLOAT) | (1L << INT) | (1L << LONG) | (1L << NEW) | (1L << SHORT) | (1L << SUPER) | (1L << THIS) | (1L << VOID) | (1L << IntegerLiteral) | (1L << FloatingPointLiteral) | (1L << BooleanLiteral) | (1L << CharacterLiteral) | (1L << StringLiteral) | (1L << NullLiteral) | (1L << LPAREN))) != 0) || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (LT - 68)) | (1L << (BANG - 68)) | (1L << (TILDE - 68)) | (1L << (INC - 68)) | (1L << (DEC - 68)) | (1L << (ADD - 68)) | (1L << (SUB - 68)) | (1L << (Identifier - 68)))) != 0)) { - { - setState(1136); expressionList(); - } - } - - setState(1139); match(RPAREN); - } - break; - case 20: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1140); - if (!(precpred(_ctx, 16))) throw new FailedPredicateException(this, "precpred(_ctx, 16)"); - setState(1141); - _la = _input.LA(1); - if ( !(_la==INC || _la==DEC) ) { - _errHandler.recoverInline(this); - } - consume(); - } - break; - case 21: - { - _localctx = new ExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1142); - if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); - setState(1143); match(INSTANCEOF); - setState(1144); type(); - } - break; - } - } - } - setState(1149); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,128,_ctx); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - unrollRecursionContexts(_parentctx); - } - return _localctx; - } - - public static class PrimaryContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public NonWildcardTypeArgumentsContext nonWildcardTypeArguments() { - return getRuleContext(NonWildcardTypeArgumentsContext.class,0); - } - public ExplicitGenericInvocationSuffixContext explicitGenericInvocationSuffix() { - return getRuleContext(ExplicitGenericInvocationSuffixContext.class,0); - } - public LiteralContext literal() { - return getRuleContext(LiteralContext.class,0); - } - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public ArgumentsContext arguments() { - return getRuleContext(ArgumentsContext.class,0); - } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public PrimaryContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_primary; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitPrimary(this); - else return visitor.visitChildren(this); - } - } - - public final PrimaryContext primary() throws RecognitionException { - PrimaryContext _localctx = new PrimaryContext(_ctx, getState()); - enterRule(_localctx, 176, RULE_primary); - try { - setState(1171); - switch ( getInterpreter().adaptivePredict(_input,130,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(1150); match(LPAREN); - setState(1151); expression(0); - setState(1152); match(RPAREN); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(1154); match(THIS); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(1155); match(SUPER); - } - break; - case 4: - enterOuterAlt(_localctx, 4); - { - setState(1156); literal(); - } - break; - case 5: - enterOuterAlt(_localctx, 5); - { - setState(1157); match(Identifier); - } - break; - case 6: - enterOuterAlt(_localctx, 6); - { - setState(1158); type(); - setState(1159); match(DOT); - setState(1160); match(CLASS); - } - break; - case 7: - enterOuterAlt(_localctx, 7); - { - setState(1162); match(VOID); - setState(1163); match(DOT); - setState(1164); match(CLASS); - } - break; - case 8: - enterOuterAlt(_localctx, 8); - { - setState(1165); nonWildcardTypeArguments(); - setState(1169); - switch (_input.LA(1)) { - case SUPER: - case Identifier: - { - setState(1166); explicitGenericInvocationSuffix(); - } - break; - case THIS: - { - setState(1167); match(THIS); - setState(1168); arguments(); - } - break; - default: - throw new NoViableAltException(this); - } - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class CreatorContext extends ParserRuleContext { - public ArrayCreatorRestContext arrayCreatorRest() { - return getRuleContext(ArrayCreatorRestContext.class,0); - } - public NonWildcardTypeArgumentsContext nonWildcardTypeArguments() { - return getRuleContext(NonWildcardTypeArgumentsContext.class,0); - } - public ClassCreatorRestContext classCreatorRest() { - return getRuleContext(ClassCreatorRestContext.class,0); - } - public CreatedNameContext createdName() { - return getRuleContext(CreatedNameContext.class,0); - } - public CreatorContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_creator; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitCreator(this); - else return visitor.visitChildren(this); - } - } - - public final CreatorContext creator() throws RecognitionException { - CreatorContext _localctx = new CreatorContext(_ctx, getState()); - enterRule(_localctx, 178, RULE_creator); - try { - setState(1182); - switch (_input.LA(1)) { - case LT: - enterOuterAlt(_localctx, 1); - { - setState(1173); nonWildcardTypeArguments(); - setState(1174); createdName(); - setState(1175); classCreatorRest(); - } - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case Identifier: - enterOuterAlt(_localctx, 2); - { - setState(1177); createdName(); - setState(1180); - switch (_input.LA(1)) { - case LBRACK: - { - setState(1178); arrayCreatorRest(); - } - break; - case LPAREN: - { - setState(1179); classCreatorRest(); - } - break; - default: - throw new NoViableAltException(this); - } - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class CreatedNameContext extends ParserRuleContext { - public List Identifier() { return getTokens(Java8Parser.Identifier); } - public TerminalNode Identifier(int i) { - return getToken(Java8Parser.Identifier, i); - } - public List typeArgumentsOrDiamond() { - return getRuleContexts(TypeArgumentsOrDiamondContext.class); - } - public PrimitiveTypeContext primitiveType() { - return getRuleContext(PrimitiveTypeContext.class,0); - } - public TypeArgumentsOrDiamondContext typeArgumentsOrDiamond(int i) { - return getRuleContext(TypeArgumentsOrDiamondContext.class,i); - } - public CreatedNameContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_createdName; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitCreatedName(this); - else return visitor.visitChildren(this); - } - } - - public final CreatedNameContext createdName() throws RecognitionException { - CreatedNameContext _localctx = new CreatedNameContext(_ctx, getState()); - enterRule(_localctx, 180, RULE_createdName); - int _la; - try { - setState(1199); - switch (_input.LA(1)) { - case Identifier: - enterOuterAlt(_localctx, 1); - { - setState(1184); match(Identifier); - setState(1186); - _la = _input.LA(1); - if (_la==LT) { - { - setState(1185); typeArgumentsOrDiamond(); - } - } - - setState(1195); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==DOT) { - { - { - setState(1188); match(DOT); - setState(1189); match(Identifier); - setState(1191); - _la = _input.LA(1); - if (_la==LT) { - { - setState(1190); typeArgumentsOrDiamond(); - } - } - - } - } - setState(1197); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - enterOuterAlt(_localctx, 2); - { - setState(1198); primitiveType(); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class InnerCreatorContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public ClassCreatorRestContext classCreatorRest() { - return getRuleContext(ClassCreatorRestContext.class,0); - } - public NonWildcardTypeArgumentsOrDiamondContext nonWildcardTypeArgumentsOrDiamond() { - return getRuleContext(NonWildcardTypeArgumentsOrDiamondContext.class,0); - } - public InnerCreatorContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_innerCreator; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitInnerCreator(this); - else return visitor.visitChildren(this); - } - } - - public final InnerCreatorContext innerCreator() throws RecognitionException { - InnerCreatorContext _localctx = new InnerCreatorContext(_ctx, getState()); - enterRule(_localctx, 182, RULE_innerCreator); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(1201); match(Identifier); - setState(1203); - _la = _input.LA(1); - if (_la==LT) { - { - setState(1202); nonWildcardTypeArgumentsOrDiamond(); - } - } - - setState(1205); classCreatorRest(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ArrayCreatorRestContext extends ParserRuleContext { - public ArrayInitializerContext arrayInitializer() { - return getRuleContext(ArrayInitializerContext.class,0); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ArrayCreatorRestContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_arrayCreatorRest; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitArrayCreatorRest(this); - else return visitor.visitChildren(this); - } - } - - public final ArrayCreatorRestContext arrayCreatorRest() throws RecognitionException { - ArrayCreatorRestContext _localctx = new ArrayCreatorRestContext(_ctx, getState()); - enterRule(_localctx, 184, RULE_arrayCreatorRest); - int _la; - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(1207); match(LBRACK); - setState(1235); - switch (_input.LA(1)) { - case RBRACK: - { - setState(1208); match(RBRACK); - setState(1213); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==LBRACK) { - { - { - setState(1209); match(LBRACK); - setState(1210); match(RBRACK); - } - } - setState(1215); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(1216); arrayInitializer(); - } - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case NEW: - case SHORT: - case SUPER: - case THIS: - case VOID: - case IntegerLiteral: - case FloatingPointLiteral: - case BooleanLiteral: - case CharacterLiteral: - case StringLiteral: - case NullLiteral: - case LPAREN: - case LT: - case BANG: - case TILDE: - case INC: - case DEC: - case ADD: - case SUB: - case Identifier: - { - setState(1217); expression(0); - setState(1218); match(RBRACK); - setState(1225); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,139,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(1219); match(LBRACK); - setState(1220); expression(0); - setState(1221); match(RBRACK); - } - } - } - setState(1227); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,139,_ctx); - } - setState(1232); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,140,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(1228); match(LBRACK); - setState(1229); match(RBRACK); - } - } - } - setState(1234); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,140,_ctx); - } - } - break; - default: - throw new NoViableAltException(this); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ClassCreatorRestContext extends ParserRuleContext { - public ClassBodyContext classBody() { - return getRuleContext(ClassBodyContext.class,0); - } - public ArgumentsContext arguments() { - return getRuleContext(ArgumentsContext.class,0); - } - public ClassCreatorRestContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_classCreatorRest; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitClassCreatorRest(this); - else return visitor.visitChildren(this); - } - } - - public final ClassCreatorRestContext classCreatorRest() throws RecognitionException { - ClassCreatorRestContext _localctx = new ClassCreatorRestContext(_ctx, getState()); - enterRule(_localctx, 186, RULE_classCreatorRest); - try { - enterOuterAlt(_localctx, 1); - { - setState(1237); arguments(); - setState(1239); - switch ( getInterpreter().adaptivePredict(_input,142,_ctx) ) { - case 1: - { - setState(1238); classBody(); - } - break; - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ExplicitGenericInvocationContext extends ParserRuleContext { - public NonWildcardTypeArgumentsContext nonWildcardTypeArguments() { - return getRuleContext(NonWildcardTypeArgumentsContext.class,0); - } - public ExplicitGenericInvocationSuffixContext explicitGenericInvocationSuffix() { - return getRuleContext(ExplicitGenericInvocationSuffixContext.class,0); - } - public ExplicitGenericInvocationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_explicitGenericInvocation; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitExplicitGenericInvocation(this); - else return visitor.visitChildren(this); - } - } - - public final ExplicitGenericInvocationContext explicitGenericInvocation() throws RecognitionException { - ExplicitGenericInvocationContext _localctx = new ExplicitGenericInvocationContext(_ctx, getState()); - enterRule(_localctx, 188, RULE_explicitGenericInvocation); - try { - enterOuterAlt(_localctx, 1); - { - setState(1241); nonWildcardTypeArguments(); - setState(1242); explicitGenericInvocationSuffix(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class NonWildcardTypeArgumentsContext extends ParserRuleContext { - public TypeListContext typeList() { - return getRuleContext(TypeListContext.class,0); - } - public NonWildcardTypeArgumentsContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_nonWildcardTypeArguments; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitNonWildcardTypeArguments(this); - else return visitor.visitChildren(this); - } - } - - public final NonWildcardTypeArgumentsContext nonWildcardTypeArguments() throws RecognitionException { - NonWildcardTypeArgumentsContext _localctx = new NonWildcardTypeArgumentsContext(_ctx, getState()); - enterRule(_localctx, 190, RULE_nonWildcardTypeArguments); - try { - enterOuterAlt(_localctx, 1); - { - setState(1244); match(LT); - setState(1245); typeList(); - setState(1246); match(GT); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class TypeArgumentsOrDiamondContext extends ParserRuleContext { - public TypeArgumentsContext typeArguments() { - return getRuleContext(TypeArgumentsContext.class,0); - } - public TypeArgumentsOrDiamondContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_typeArgumentsOrDiamond; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitTypeArgumentsOrDiamond(this); - else return visitor.visitChildren(this); - } - } - - public final TypeArgumentsOrDiamondContext typeArgumentsOrDiamond() throws RecognitionException { - TypeArgumentsOrDiamondContext _localctx = new TypeArgumentsOrDiamondContext(_ctx, getState()); - enterRule(_localctx, 192, RULE_typeArgumentsOrDiamond); - try { - setState(1251); - switch ( getInterpreter().adaptivePredict(_input,143,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(1248); match(LT); - setState(1249); match(GT); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(1250); typeArguments(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class NonWildcardTypeArgumentsOrDiamondContext extends ParserRuleContext { - public NonWildcardTypeArgumentsContext nonWildcardTypeArguments() { - return getRuleContext(NonWildcardTypeArgumentsContext.class,0); - } - public NonWildcardTypeArgumentsOrDiamondContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_nonWildcardTypeArgumentsOrDiamond; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitNonWildcardTypeArgumentsOrDiamond(this); - else return visitor.visitChildren(this); - } - } - - public final NonWildcardTypeArgumentsOrDiamondContext nonWildcardTypeArgumentsOrDiamond() throws RecognitionException { - NonWildcardTypeArgumentsOrDiamondContext _localctx = new NonWildcardTypeArgumentsOrDiamondContext(_ctx, getState()); - enterRule(_localctx, 194, RULE_nonWildcardTypeArgumentsOrDiamond); - try { - setState(1256); - switch ( getInterpreter().adaptivePredict(_input,144,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(1253); match(LT); - setState(1254); match(GT); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(1255); nonWildcardTypeArguments(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class SuperSuffixContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public ArgumentsContext arguments() { - return getRuleContext(ArgumentsContext.class,0); - } - public SuperSuffixContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_superSuffix; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitSuperSuffix(this); - else return visitor.visitChildren(this); - } - } - - public final SuperSuffixContext superSuffix() throws RecognitionException { - SuperSuffixContext _localctx = new SuperSuffixContext(_ctx, getState()); - enterRule(_localctx, 196, RULE_superSuffix); - try { - setState(1264); - switch (_input.LA(1)) { - case LPAREN: - enterOuterAlt(_localctx, 1); - { - setState(1258); arguments(); - } - break; - case DOT: - enterOuterAlt(_localctx, 2); - { - setState(1259); match(DOT); - setState(1260); match(Identifier); - setState(1262); - switch ( getInterpreter().adaptivePredict(_input,145,_ctx) ) { - case 1: - { - setState(1261); arguments(); - } - break; - } - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ExplicitGenericInvocationSuffixContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(Java8Parser.Identifier, 0); } - public SuperSuffixContext superSuffix() { - return getRuleContext(SuperSuffixContext.class,0); - } - public ArgumentsContext arguments() { - return getRuleContext(ArgumentsContext.class,0); - } - public ExplicitGenericInvocationSuffixContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_explicitGenericInvocationSuffix; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitExplicitGenericInvocationSuffix(this); - else return visitor.visitChildren(this); - } - } - - public final ExplicitGenericInvocationSuffixContext explicitGenericInvocationSuffix() throws RecognitionException { - ExplicitGenericInvocationSuffixContext _localctx = new ExplicitGenericInvocationSuffixContext(_ctx, getState()); - enterRule(_localctx, 198, RULE_explicitGenericInvocationSuffix); - try { - setState(1270); - switch (_input.LA(1)) { - case SUPER: - enterOuterAlt(_localctx, 1); - { - setState(1266); match(SUPER); - setState(1267); superSuffix(); - } - break; - case Identifier: - enterOuterAlt(_localctx, 2); - { - setState(1268); match(Identifier); - setState(1269); arguments(); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ArgumentsContext extends ParserRuleContext { - public ExpressionListContext expressionList() { - return getRuleContext(ExpressionListContext.class,0); - } - public ArgumentsContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_arguments; } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof Java8Visitor ) return ((Java8Visitor)visitor).visitArguments(this); - else return visitor.visitChildren(this); - } - } - - public final ArgumentsContext arguments() throws RecognitionException { - ArgumentsContext _localctx = new ArgumentsContext(_ctx, getState()); - enterRule(_localctx, 200, RULE_arguments); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(1272); match(LPAREN); - setState(1274); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLEAN) | (1L << BYTE) | (1L << CHAR) | (1L << DOUBLE) | (1L << FLOAT) | (1L << INT) | (1L << LONG) | (1L << NEW) | (1L << SHORT) | (1L << SUPER) | (1L << THIS) | (1L << VOID) | (1L << IntegerLiteral) | (1L << FloatingPointLiteral) | (1L << BooleanLiteral) | (1L << CharacterLiteral) | (1L << StringLiteral) | (1L << NullLiteral) | (1L << LPAREN))) != 0) || ((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (LT - 68)) | (1L << (BANG - 68)) | (1L << (TILDE - 68)) | (1L << (INC - 68)) | (1L << (DEC - 68)) | (1L << (ADD - 68)) | (1L << (SUB - 68)) | (1L << (Identifier - 68)))) != 0)) { - { - setState(1273); expressionList(); - } - } - - setState(1276); match(RPAREN); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { - switch (ruleIndex) { - case 87: return expression_sempred((ExpressionContext)_localctx, predIndex); - } - return true; - } - private boolean expression_sempred(ExpressionContext _localctx, int predIndex) { - switch (predIndex) { - case 0: return precpred(_ctx, 13); - case 1: return precpred(_ctx, 12); - case 2: return precpred(_ctx, 11); - case 3: return precpred(_ctx, 10); - case 4: return precpred(_ctx, 8); - case 5: return precpred(_ctx, 7); - case 6: return precpred(_ctx, 6); - case 7: return precpred(_ctx, 5); - case 8: return precpred(_ctx, 4); - case 9: return precpred(_ctx, 3); - case 10: return precpred(_ctx, 2); - case 11: return precpred(_ctx, 1); - case 12: return precpred(_ctx, 25); - case 13: return precpred(_ctx, 24); - case 14: return precpred(_ctx, 23); - case 15: return precpred(_ctx, 22); - case 16: return precpred(_ctx, 21); - case 17: return precpred(_ctx, 20); - case 18: return precpred(_ctx, 19); - case 19: return precpred(_ctx, 16); - case 20: return precpred(_ctx, 9); - } - return true; - } - - public static final String _serializedATN = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3k\u0501\4\2\t\2\4"+ - "\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+ - "\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ - "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ - "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+ - "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+ - ",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+ - "\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+ - "\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4I"+ - "\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\tT"+ - "\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\\4]\t]\4^\t^\4_\t_\4"+ - "`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\3\2\5\2\u00ce\n\2\3\2\7\2\u00d1"+ - "\n\2\f\2\16\2\u00d4\13\2\3\2\7\2\u00d7\n\2\f\2\16\2\u00da\13\2\3\2\3\2"+ - "\3\3\7\3\u00df\n\3\f\3\16\3\u00e2\13\3\3\3\3\3\3\3\3\3\3\4\3\4\5\4\u00ea"+ - "\n\4\3\4\3\4\3\4\5\4\u00ef\n\4\3\4\3\4\3\5\7\5\u00f4\n\5\f\5\16\5\u00f7"+ - "\13\5\3\5\3\5\7\5\u00fb\n\5\f\5\16\5\u00fe\13\5\3\5\3\5\7\5\u0102\n\5"+ - "\f\5\16\5\u0105\13\5\3\5\3\5\7\5\u0109\n\5\f\5\16\5\u010c\13\5\3\5\3\5"+ - "\5\5\u0110\n\5\3\6\3\6\5\6\u0114\n\6\3\7\3\7\5\7\u0118\n\7\3\b\3\b\5\b"+ - "\u011c\n\b\3\t\3\t\3\t\5\t\u0121\n\t\3\t\3\t\5\t\u0125\n\t\3\t\3\t\5\t"+ - "\u0129\n\t\3\t\3\t\3\n\3\n\3\n\3\n\7\n\u0131\n\n\f\n\16\n\u0134\13\n\3"+ - "\n\3\n\3\13\3\13\3\13\5\13\u013b\n\13\3\f\3\f\3\f\7\f\u0140\n\f\f\f\16"+ - "\f\u0143\13\f\3\r\3\r\3\r\3\r\5\r\u0149\n\r\3\r\3\r\5\r\u014d\n\r\3\r"+ - "\5\r\u0150\n\r\3\r\5\r\u0153\n\r\3\r\3\r\3\16\3\16\3\16\7\16\u015a\n\16"+ - "\f\16\16\16\u015d\13\16\3\17\7\17\u0160\n\17\f\17\16\17\u0163\13\17\3"+ - "\17\3\17\5\17\u0167\n\17\3\17\5\17\u016a\n\17\3\20\3\20\7\20\u016e\n\20"+ - "\f\20\16\20\u0171\13\20\3\21\3\21\3\21\5\21\u0176\n\21\3\21\3\21\5\21"+ - "\u017a\n\21\3\21\3\21\3\22\3\22\3\22\7\22\u0181\n\22\f\22\16\22\u0184"+ - "\13\22\3\23\3\23\7\23\u0188\n\23\f\23\16\23\u018b\13\23\3\23\3\23\3\24"+ - "\3\24\7\24\u0191\n\24\f\24\16\24\u0194\13\24\3\24\3\24\3\25\3\25\5\25"+ - "\u019a\n\25\3\25\3\25\7\25\u019e\n\25\f\25\16\25\u01a1\13\25\3\25\5\25"+ - "\u01a4\n\25\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\5\26\u01af\n"+ - "\26\3\27\3\27\5\27\u01b3\n\27\3\27\3\27\3\27\3\27\7\27\u01b9\n\27\f\27"+ - "\16\27\u01bc\13\27\3\27\3\27\5\27\u01c0\n\27\3\27\3\27\5\27\u01c4\n\27"+ - "\3\30\3\30\3\30\3\31\3\31\3\31\3\31\5\31\u01cd\n\31\3\31\3\31\3\32\3\32"+ - "\3\32\3\33\3\33\3\33\3\33\3\34\7\34\u01d9\n\34\f\34\16\34\u01dc\13\34"+ - "\3\34\3\34\5\34\u01e0\n\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\5\35\u01e9"+ - "\n\35\3\36\3\36\3\36\3\36\7\36\u01ef\n\36\f\36\16\36\u01f2\13\36\3\36"+ - "\3\36\3\37\3\37\3\37\7\37\u01f9\n\37\f\37\16\37\u01fc\13\37\3\37\3\37"+ - "\3\37\3 \3 \5 \u0203\n \3 \3 \3 \3 \7 \u0209\n \f \16 \u020c\13 \3 \3"+ - " \5 \u0210\n \3 \3 \3!\3!\3!\3\"\3\"\3\"\7\"\u021a\n\"\f\"\16\"\u021d"+ - "\13\"\3#\3#\3#\5#\u0222\n#\3$\3$\3$\7$\u0227\n$\f$\16$\u022a\13$\3%\3"+ - "%\5%\u022e\n%\3&\3&\3&\3&\7&\u0234\n&\f&\16&\u0237\13&\3&\5&\u023a\n&"+ - "\5&\u023c\n&\3&\3&\3\'\3\'\3(\3(\3(\7(\u0245\n(\f(\16(\u0248\13(\3(\3"+ - "(\3(\7(\u024d\n(\f(\16(\u0250\13(\5(\u0252\n(\3)\3)\5)\u0256\n)\3)\3)"+ - "\3)\5)\u025b\n)\7)\u025d\n)\f)\16)\u0260\13)\3*\3*\3+\3+\3+\3+\7+\u0268"+ - "\n+\f+\16+\u026b\13+\3+\3+\3,\3,\3,\3,\5,\u0273\n,\5,\u0275\n,\3-\3-\3"+ - "-\7-\u027a\n-\f-\16-\u027d\13-\3.\3.\5.\u0281\n.\3.\3.\3/\3/\3/\7/\u0288"+ - "\n/\f/\16/\u028b\13/\3/\3/\5/\u028f\n/\3/\5/\u0292\n/\3\60\7\60\u0295"+ - "\n\60\f\60\16\60\u0298\13\60\3\60\3\60\3\60\3\61\7\61\u029e\n\61\f\61"+ - "\16\61\u02a1\13\61\3\61\3\61\3\61\3\61\3\62\3\62\3\63\3\63\3\64\3\64\3"+ - "\64\7\64\u02ae\n\64\f\64\16\64\u02b1\13\64\3\65\3\65\3\66\3\66\3\66\3"+ - "\66\3\66\5\66\u02ba\n\66\3\66\5\66\u02bd\n\66\3\67\3\67\38\38\38\78\u02c4"+ - "\n8\f8\168\u02c7\138\39\39\39\39\3:\3:\3:\5:\u02d0\n:\3;\3;\3;\3;\7;\u02d6"+ - "\n;\f;\16;\u02d9\13;\5;\u02db\n;\3;\5;\u02de\n;\3;\3;\3<\3<\3<\3<\3<\3"+ - "=\3=\7=\u02e9\n=\f=\16=\u02ec\13=\3=\3=\3>\7>\u02f1\n>\f>\16>\u02f4\13"+ - ">\3>\3>\5>\u02f8\n>\3?\3?\3?\3?\3?\3?\5?\u0300\n?\3?\3?\5?\u0304\n?\3"+ - "?\3?\5?\u0308\n?\3?\3?\5?\u030c\n?\5?\u030e\n?\3@\3@\5@\u0312\n@\3A\3"+ - "A\3A\3A\5A\u0318\nA\3B\3B\3C\3C\3C\3D\3D\7D\u0321\nD\fD\16D\u0324\13D"+ - "\3D\3D\3E\3E\3E\5E\u032b\nE\3F\3F\3F\3G\7G\u0331\nG\fG\16G\u0334\13G\3"+ - "G\3G\3G\3H\3H\3H\3H\3H\5H\u033e\nH\3H\3H\3H\3H\3H\3H\3H\5H\u0347\nH\3"+ - "H\3H\3H\3H\3H\3H\3H\3H\3H\3H\3H\3H\3H\3H\3H\3H\3H\3H\3H\6H\u035c\nH\r"+ - "H\16H\u035d\3H\5H\u0361\nH\3H\5H\u0364\nH\3H\3H\3H\3H\7H\u036a\nH\fH\16"+ - "H\u036d\13H\3H\5H\u0370\nH\3H\3H\3H\3H\7H\u0376\nH\fH\16H\u0379\13H\3"+ - "H\7H\u037c\nH\fH\16H\u037f\13H\3H\3H\3H\3H\3H\3H\3H\3H\5H\u0389\nH\3H"+ - "\3H\3H\3H\3H\3H\3H\5H\u0392\nH\3H\3H\3H\5H\u0397\nH\3H\3H\3H\3H\3H\3H"+ - "\3H\3H\5H\u03a1\nH\3I\3I\3I\7I\u03a6\nI\fI\16I\u03a9\13I\3I\3I\3I\3I\3"+ - "I\3J\3J\3J\7J\u03b3\nJ\fJ\16J\u03b6\13J\3K\3K\3K\3L\3L\3L\5L\u03be\nL"+ - "\3L\3L\3M\3M\3M\7M\u03c5\nM\fM\16M\u03c8\13M\3N\7N\u03cb\nN\fN\16N\u03ce"+ - "\13N\3N\3N\3N\3N\3N\3O\6O\u03d6\nO\rO\16O\u03d7\3O\6O\u03db\nO\rO\16O"+ - "\u03dc\3P\3P\3P\3P\3P\3P\3P\3P\3P\3P\5P\u03e9\nP\3Q\3Q\5Q\u03ed\nQ\3Q"+ - "\3Q\5Q\u03f1\nQ\3Q\3Q\5Q\u03f5\nQ\5Q\u03f7\nQ\3R\3R\5R\u03fb\nR\3S\7S"+ - "\u03fe\nS\fS\16S\u0401\13S\3S\3S\3S\3S\3S\3T\3T\3U\3U\3U\3U\3V\3V\3V\7"+ - "V\u0411\nV\fV\16V\u0414\13V\3W\3W\3X\3X\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y"+ - "\3Y\3Y\3Y\5Y\u0427\nY\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\5Y\u0437"+ - "\nY\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y"+ - "\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\5Y\u0462\nY"+ - "\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\5Y\u0474\nY\3Y\3Y\3Y"+ - "\3Y\3Y\3Y\7Y\u047c\nY\fY\16Y\u047f\13Y\3Z\3Z\3Z\3Z\3Z\3Z\3Z\3Z\3Z\3Z\3"+ - "Z\3Z\3Z\3Z\3Z\3Z\3Z\3Z\3Z\5Z\u0494\nZ\5Z\u0496\nZ\3[\3[\3[\3[\3[\3[\3"+ - "[\5[\u049f\n[\5[\u04a1\n[\3\\\3\\\5\\\u04a5\n\\\3\\\3\\\3\\\5\\\u04aa"+ - "\n\\\7\\\u04ac\n\\\f\\\16\\\u04af\13\\\3\\\5\\\u04b2\n\\\3]\3]\5]\u04b6"+ - "\n]\3]\3]\3^\3^\3^\3^\7^\u04be\n^\f^\16^\u04c1\13^\3^\3^\3^\3^\3^\3^\3"+ - "^\7^\u04ca\n^\f^\16^\u04cd\13^\3^\3^\7^\u04d1\n^\f^\16^\u04d4\13^\5^\u04d6"+ - "\n^\3_\3_\5_\u04da\n_\3`\3`\3`\3a\3a\3a\3a\3b\3b\3b\5b\u04e6\nb\3c\3c"+ - "\3c\5c\u04eb\nc\3d\3d\3d\3d\5d\u04f1\nd\5d\u04f3\nd\3e\3e\3e\3e\5e\u04f9"+ - "\ne\3f\3f\5f\u04fd\nf\3f\3f\3f\2\3\u00b0g\2\4\6\b\n\f\16\20\22\24\26\30"+ - "\32\34\36 \"$&(*,.\60\62\64\668:<>@BDFHJLNPRTVXZ\\^`bdfhjlnprtvxz|~\u0080"+ - "\u0082\u0084\u0086\u0088\u008a\u008c\u008e\u0090\u0092\u0094\u0096\u0098"+ - "\u009a\u009c\u009e\u00a0\u00a2\u00a4\u00a6\u00a8\u00aa\u00ac\u00ae\u00b0"+ - "\u00b2\u00b4\u00b6\u00b8\u00ba\u00bc\u00be\u00c0\u00c2\u00c4\u00c6\u00c8"+ - "\u00ca\2\17\6\2 ,,\60\60\63\63\6\2\3\3\24\24#%()\n\2\5\5\7\7\n\n\20\20"+ - "\26\26\35\35\37\37\'\'\4\2\23\23**\3\2\65:\3\2QT\3\2GH\4\2UVZZ\3\2ST\4"+ - "\2EFLM\4\2KKNN\4\2DD[e\3\2QR\u0573\2\u00cd\3\2\2\2\4\u00e0\3\2\2\2\6\u00e7"+ - "\3\2\2\2\b\u010f\3\2\2\2\n\u0113\3\2\2\2\f\u0117\3\2\2\2\16\u011b\3\2"+ - "\2\2\20\u011d\3\2\2\2\22\u012c\3\2\2\2\24\u0137\3\2\2\2\26\u013c\3\2\2"+ - "\2\30\u0144\3\2\2\2\32\u0156\3\2\2\2\34\u0161\3\2\2\2\36\u016b\3\2\2\2"+ - " \u0172\3\2\2\2\"\u017d\3\2\2\2$\u0185\3\2\2\2&\u018e\3\2\2\2(\u01a3\3"+ - "\2\2\2*\u01ae\3\2\2\2,\u01b2\3\2\2\2.\u01c5\3\2\2\2\60\u01c8\3\2\2\2\62"+ - "\u01d0\3\2\2\2\64\u01d3\3\2\2\2\66\u01df\3\2\2\28\u01e8\3\2\2\2:\u01ea"+ - "\3\2\2\2<\u01f5\3\2\2\2>\u0202\3\2\2\2@\u0213\3\2\2\2B\u0216\3\2\2\2D"+ - "\u021e\3\2\2\2F\u0223\3\2\2\2H\u022d\3\2\2\2J\u022f\3\2\2\2L\u023f\3\2"+ - "\2\2N\u0251\3\2\2\2P\u0253\3\2\2\2R\u0261\3\2\2\2T\u0263\3\2\2\2V\u0274"+ - "\3\2\2\2X\u0276\3\2\2\2Z\u027e\3\2\2\2\\\u0291\3\2\2\2^\u0296\3\2\2\2"+ - "`\u029f\3\2\2\2b\u02a6\3\2\2\2d\u02a8\3\2\2\2f\u02aa\3\2\2\2h\u02b2\3"+ - "\2\2\2j\u02b4\3\2\2\2l\u02be\3\2\2\2n\u02c0\3\2\2\2p\u02c8\3\2\2\2r\u02cf"+ - "\3\2\2\2t\u02d1\3\2\2\2v\u02e1\3\2\2\2x\u02e6\3\2\2\2z\u02f7\3\2\2\2|"+ - "\u030d\3\2\2\2~\u0311\3\2\2\2\u0080\u0313\3\2\2\2\u0082\u0319\3\2\2\2"+ - "\u0084\u031b\3\2\2\2\u0086\u031e\3\2\2\2\u0088\u032a\3\2\2\2\u008a\u032c"+ - "\3\2\2\2\u008c\u0332\3\2\2\2\u008e\u03a0\3\2\2\2\u0090\u03a2\3\2\2\2\u0092"+ - "\u03af\3\2\2\2\u0094\u03b7\3\2\2\2\u0096\u03ba\3\2\2\2\u0098\u03c1\3\2"+ - "\2\2\u009a\u03cc\3\2\2\2\u009c\u03d5\3\2\2\2\u009e\u03e8\3\2\2\2\u00a0"+ - "\u03f6\3\2\2\2\u00a2\u03fa\3\2\2\2\u00a4\u03ff\3\2\2\2\u00a6\u0407\3\2"+ - "\2\2\u00a8\u0409\3\2\2\2\u00aa\u040d\3\2\2\2\u00ac\u0415\3\2\2\2\u00ae"+ - "\u0417\3\2\2\2\u00b0\u0426\3\2\2\2\u00b2\u0495\3\2\2\2\u00b4\u04a0\3\2"+ - "\2\2\u00b6\u04b1\3\2\2\2\u00b8\u04b3\3\2\2\2\u00ba\u04b9\3\2\2\2\u00bc"+ - "\u04d7\3\2\2\2\u00be\u04db\3\2\2\2\u00c0\u04de\3\2\2\2\u00c2\u04e5\3\2"+ - "\2\2\u00c4\u04ea\3\2\2\2\u00c6\u04f2\3\2\2\2\u00c8\u04f8\3\2\2\2\u00ca"+ - "\u04fa\3\2\2\2\u00cc\u00ce\5\4\3\2\u00cd\u00cc\3\2\2\2\u00cd\u00ce\3\2"+ - "\2\2\u00ce\u00d2\3\2\2\2\u00cf\u00d1\5\6\4\2\u00d0\u00cf\3\2\2\2\u00d1"+ - "\u00d4\3\2\2\2\u00d2\u00d0\3\2\2\2\u00d2\u00d3\3\2\2\2\u00d3\u00d8\3\2"+ - "\2\2\u00d4\u00d2\3\2\2\2\u00d5\u00d7\5\b\5\2\u00d6\u00d5\3\2\2\2\u00d7"+ - "\u00da\3\2\2\2\u00d8\u00d6\3\2\2\2\u00d8\u00d9\3\2\2\2\u00d9\u00db\3\2"+ - "\2\2\u00da\u00d8\3\2\2\2\u00db\u00dc\7\2\2\3\u00dc\3\3\2\2\2\u00dd\u00df"+ - "\5j\66\2\u00de\u00dd\3\2\2\2\u00df\u00e2\3\2\2\2\u00e0\u00de\3\2\2\2\u00e0"+ - "\u00e1\3\2\2\2\u00e1\u00e3\3\2\2\2\u00e2\u00e0\3\2\2\2\u00e3\u00e4\7\""+ - "\2\2\u00e4\u00e5\5f\64\2\u00e5\u00e6\7A\2\2\u00e6\5\3\2\2\2\u00e7\u00e9"+ - "\7\33\2\2\u00e8\u00ea\7(\2\2\u00e9\u00e8\3\2\2\2\u00e9\u00ea\3\2\2\2\u00ea"+ - "\u00eb\3\2\2\2\u00eb\u00ee\5f\64\2\u00ec\u00ed\7C\2\2\u00ed\u00ef\7U\2"+ - "\2\u00ee\u00ec\3\2\2\2\u00ee\u00ef\3\2\2\2\u00ef\u00f0\3\2\2\2\u00f0\u00f1"+ - "\7A\2\2\u00f1\7\3\2\2\2\u00f2\u00f4\5\f\7\2\u00f3\u00f2\3\2\2\2\u00f4"+ - "\u00f7\3\2\2\2\u00f5\u00f3\3\2\2\2\u00f5\u00f6\3\2\2\2\u00f6\u00f8\3\2"+ - "\2\2\u00f7\u00f5\3\2\2\2\u00f8\u0110\5\20\t\2\u00f9\u00fb\5\f\7\2\u00fa"+ - "\u00f9\3\2\2\2\u00fb\u00fe\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fc\u00fd\3\2"+ - "\2\2\u00fd\u00ff\3\2\2\2\u00fe\u00fc\3\2\2\2\u00ff\u0110\5\30\r\2\u0100"+ - "\u0102\5\f\7\2\u0101\u0100\3\2\2\2\u0102\u0105\3\2\2\2\u0103\u0101\3\2"+ - "\2\2\u0103\u0104\3\2\2\2\u0104\u0106\3\2\2\2\u0105\u0103\3\2\2\2\u0106"+ - "\u0110\5 \21\2\u0107\u0109\5\f\7\2\u0108\u0107\3\2\2\2\u0109\u010c\3\2"+ - "\2\2\u010a\u0108\3\2\2\2\u010a\u010b\3\2\2\2\u010b\u010d\3\2\2\2\u010c"+ - "\u010a\3\2\2\2\u010d\u0110\5v<\2\u010e\u0110\7A\2\2\u010f\u00f5\3\2\2"+ - "\2\u010f\u00fc\3\2\2\2\u010f\u0103\3\2\2\2\u010f\u010a\3\2\2\2\u010f\u010e"+ - "\3\2\2\2\u0110\t\3\2\2\2\u0111\u0114\5\f\7\2\u0112\u0114\t\2\2\2\u0113"+ - "\u0111\3\2\2\2\u0113\u0112\3\2\2\2\u0114\13\3\2\2\2\u0115\u0118\5j\66"+ - "\2\u0116\u0118\t\3\2\2\u0117\u0115\3\2\2\2\u0117\u0116\3\2\2\2\u0118\r"+ - "\3\2\2\2\u0119\u011c\7\24\2\2\u011a\u011c\5j\66\2\u011b\u0119\3\2\2\2"+ - "\u011b\u011a\3\2\2\2\u011c\17\3\2\2\2\u011d\u011e\7\13\2\2\u011e\u0120"+ - "\7f\2\2\u011f\u0121\5\22\n\2\u0120\u011f\3\2\2\2\u0120\u0121\3\2\2\2\u0121"+ - "\u0124\3\2\2\2\u0122\u0123\7\23\2\2\u0123\u0125\5N(\2\u0124\u0122\3\2"+ - "\2\2\u0124\u0125\3\2\2\2\u0125\u0128\3\2\2\2\u0126\u0127\7\32\2\2\u0127"+ - "\u0129\5\"\22\2\u0128\u0126\3\2\2\2\u0128\u0129\3\2\2\2\u0129\u012a\3"+ - "\2\2\2\u012a\u012b\5$\23\2\u012b\21\3\2\2\2\u012c\u012d\7F\2\2\u012d\u0132"+ - "\5\24\13\2\u012e\u012f\7B\2\2\u012f\u0131\5\24\13\2\u0130\u012e\3\2\2"+ - "\2\u0131\u0134\3\2\2\2\u0132\u0130\3\2\2\2\u0132\u0133\3\2\2\2\u0133\u0135"+ - "\3\2\2\2\u0134\u0132\3\2\2\2\u0135\u0136\7E\2\2\u0136\23\3\2\2\2\u0137"+ - "\u013a\7f\2\2\u0138\u0139\7\23\2\2\u0139\u013b\5\26\f\2\u013a\u0138\3"+ - "\2\2\2\u013a\u013b\3\2\2\2\u013b\25\3\2\2\2\u013c\u0141\5N(\2\u013d\u013e"+ - "\7W\2\2\u013e\u0140\5N(\2\u013f\u013d\3\2\2\2\u0140\u0143\3\2\2\2\u0141"+ - "\u013f\3\2\2\2\u0141\u0142\3\2\2\2\u0142\27\3\2\2\2\u0143\u0141\3\2\2"+ - "\2\u0144\u0145\7\22\2\2\u0145\u0148\7f\2\2\u0146\u0147\7\32\2\2\u0147"+ - "\u0149\5\"\22\2\u0148\u0146\3\2\2\2\u0148\u0149\3\2\2\2\u0149\u014a\3"+ - "\2\2\2\u014a\u014c\7=\2\2\u014b\u014d\5\32\16\2\u014c\u014b\3\2\2\2\u014c"+ - "\u014d\3\2\2\2\u014d\u014f\3\2\2\2\u014e\u0150\7B\2\2\u014f\u014e\3\2"+ - "\2\2\u014f\u0150\3\2\2\2\u0150\u0152\3\2\2\2\u0151\u0153\5\36\20\2\u0152"+ - "\u0151\3\2\2\2\u0152\u0153\3\2\2\2\u0153\u0154\3\2\2\2\u0154\u0155\7>"+ - "\2\2\u0155\31\3\2\2\2\u0156\u015b\5\34\17\2\u0157\u0158\7B\2\2\u0158\u015a"+ - "\5\34\17\2\u0159\u0157\3\2\2\2\u015a\u015d\3\2\2\2\u015b\u0159\3\2\2\2"+ - "\u015b\u015c\3\2\2\2\u015c\33\3\2\2\2\u015d\u015b\3\2\2\2\u015e\u0160"+ - "\5j\66\2\u015f\u015e\3\2\2\2\u0160\u0163\3\2\2\2\u0161\u015f\3\2\2\2\u0161"+ - "\u0162\3\2\2\2\u0162\u0164\3\2\2\2\u0163\u0161\3\2\2\2\u0164\u0166\7f"+ - "\2\2\u0165\u0167\5\u00caf\2\u0166\u0165\3\2\2\2\u0166\u0167\3\2\2\2\u0167"+ - "\u0169\3\2\2\2\u0168\u016a\5$\23\2\u0169\u0168\3\2\2\2\u0169\u016a\3\2"+ - "\2\2\u016a\35\3\2\2\2\u016b\u016f\7A\2\2\u016c\u016e\5(\25\2\u016d\u016c"+ - "\3\2\2\2\u016e\u0171\3\2\2\2\u016f\u016d\3\2\2\2\u016f\u0170\3\2\2\2\u0170"+ - "\37\3\2\2\2\u0171\u016f\3\2\2\2\u0172\u0173\7\36\2\2\u0173\u0175\7f\2"+ - "\2\u0174\u0176\5\22\n\2\u0175\u0174\3\2\2\2\u0175\u0176\3\2\2\2\u0176"+ - "\u0179\3\2\2\2\u0177\u0178\7\23\2\2\u0178\u017a\5\"\22\2\u0179\u0177\3"+ - "\2\2\2\u0179\u017a\3\2\2\2\u017a\u017b\3\2\2\2\u017b\u017c\5&\24\2\u017c"+ - "!\3\2\2\2\u017d\u0182\5N(\2\u017e\u017f\7B\2\2\u017f\u0181\5N(\2\u0180"+ - "\u017e\3\2\2\2\u0181\u0184\3\2\2\2\u0182\u0180\3\2\2\2\u0182\u0183\3\2"+ - "\2\2\u0183#\3\2\2\2\u0184\u0182\3\2\2\2\u0185\u0189\7=\2\2\u0186\u0188"+ - "\5(\25\2\u0187\u0186\3\2\2\2\u0188\u018b\3\2\2\2\u0189\u0187\3\2\2\2\u0189"+ - "\u018a\3\2\2\2\u018a\u018c\3\2\2\2\u018b\u0189\3\2\2\2\u018c\u018d\7>"+ - "\2\2\u018d%\3\2\2\2\u018e\u0192\7=\2\2\u018f\u0191\5\66\34\2\u0190\u018f"+ - "\3\2\2\2\u0191\u0194\3\2\2\2\u0192\u0190\3\2\2\2\u0192\u0193\3\2\2\2\u0193"+ - "\u0195\3\2\2\2\u0194\u0192\3\2\2\2\u0195\u0196\7>\2\2\u0196\'\3\2\2\2"+ - "\u0197\u01a4\7A\2\2\u0198\u019a\7(\2\2\u0199\u0198\3\2\2\2\u0199\u019a"+ - "\3\2\2\2\u019a\u019b\3\2\2\2\u019b\u01a4\5\u0086D\2\u019c\u019e\5\n\6"+ - "\2\u019d\u019c\3\2\2\2\u019e\u01a1\3\2\2\2\u019f\u019d\3\2\2\2\u019f\u01a0"+ - "\3\2\2\2\u01a0\u01a2\3\2\2\2\u01a1\u019f\3\2\2\2\u01a2\u01a4\5*\26\2\u01a3"+ - "\u0197\3\2\2\2\u01a3\u0199\3\2\2\2\u01a3\u019f\3\2\2\2\u01a4)\3\2\2\2"+ - "\u01a5\u01af\5,\27\2\u01a6\u01af\5.\30\2\u01a7\u01af\5\64\33\2\u01a8\u01af"+ - "\5\60\31\2\u01a9\u01af\5\62\32\2\u01aa\u01af\5 \21\2\u01ab\u01af\5v<\2"+ - "\u01ac\u01af\5\20\t\2\u01ad\u01af\5\30\r\2\u01ae\u01a5\3\2\2\2\u01ae\u01a6"+ - "\3\2\2\2\u01ae\u01a7\3\2\2\2\u01ae\u01a8\3\2\2\2\u01ae\u01a9\3\2\2\2\u01ae"+ - "\u01aa\3\2\2\2\u01ae\u01ab\3\2\2\2\u01ae\u01ac\3\2\2\2\u01ae\u01ad\3\2"+ - "\2\2\u01af+\3\2\2\2\u01b0\u01b3\5N(\2\u01b1\u01b3\7\62\2\2\u01b2\u01b0"+ - "\3\2\2\2\u01b2\u01b1\3\2\2\2\u01b3\u01b4\3\2\2\2\u01b4\u01b5\7f\2\2\u01b5"+ - "\u01ba\5Z.\2\u01b6\u01b7\7?\2\2\u01b7\u01b9\7@\2\2\u01b8\u01b6\3\2\2\2"+ - "\u01b9\u01bc\3\2\2\2\u01ba\u01b8\3\2\2\2\u01ba\u01bb\3\2\2\2\u01bb\u01bf"+ - "\3\2\2\2\u01bc\u01ba\3\2\2\2\u01bd\u01be\7/\2\2\u01be\u01c0\5X-\2\u01bf"+ - "\u01bd\3\2\2\2\u01bf\u01c0\3\2\2\2\u01c0\u01c3\3\2\2\2\u01c1\u01c4\5b"+ - "\62\2\u01c2\u01c4\7A\2\2\u01c3\u01c1\3\2\2\2\u01c3\u01c2\3\2\2\2\u01c4"+ - "-\3\2\2\2\u01c5\u01c6\5\22\n\2\u01c6\u01c7\5,\27\2\u01c7/\3\2\2\2\u01c8"+ - "\u01c9\7f\2\2\u01c9\u01cc\5Z.\2\u01ca\u01cb\7/\2\2\u01cb\u01cd\5X-\2\u01cc"+ - "\u01ca\3\2\2\2\u01cc\u01cd\3\2\2\2\u01cd\u01ce\3\2\2\2\u01ce\u01cf\5d"+ - "\63\2\u01cf\61\3\2\2\2\u01d0\u01d1\5\22\n\2\u01d1\u01d2\5\60\31\2\u01d2"+ - "\63\3\2\2\2\u01d3\u01d4\5N(\2\u01d4\u01d5\5B\"\2\u01d5\u01d6\7A\2\2\u01d6"+ - "\65\3\2\2\2\u01d7\u01d9\5\n\6\2\u01d8\u01d7\3\2\2\2\u01d9\u01dc\3\2\2"+ - "\2\u01da\u01d8\3\2\2\2\u01da\u01db\3\2\2\2\u01db\u01dd\3\2\2\2\u01dc\u01da"+ - "\3\2\2\2\u01dd\u01e0\58\35\2\u01de\u01e0\7A\2\2\u01df\u01da\3\2\2\2\u01df"+ - "\u01de\3\2\2\2\u01e0\67\3\2\2\2\u01e1\u01e9\5:\36\2\u01e2\u01e9\5> \2"+ - "\u01e3\u01e9\5@!\2\u01e4\u01e9\5 \21\2\u01e5\u01e9\5v<\2\u01e6\u01e9\5"+ - "\20\t\2\u01e7\u01e9\5\30\r\2\u01e8\u01e1\3\2\2\2\u01e8\u01e2\3\2\2\2\u01e8"+ - "\u01e3\3\2\2\2\u01e8\u01e4\3\2\2\2\u01e8\u01e5\3\2\2\2\u01e8\u01e6\3\2"+ - "\2\2\u01e8\u01e7\3\2\2\2\u01e99\3\2\2\2\u01ea\u01eb\5N(\2\u01eb\u01f0"+ - "\5<\37\2\u01ec\u01ed\7B\2\2\u01ed\u01ef\5<\37\2\u01ee\u01ec\3\2\2\2\u01ef"+ - "\u01f2\3\2\2\2\u01f0\u01ee\3\2\2\2\u01f0\u01f1\3\2\2\2\u01f1\u01f3\3\2"+ - "\2\2\u01f2\u01f0\3\2\2\2\u01f3\u01f4\7A\2\2\u01f4;\3\2\2\2\u01f5\u01fa"+ - "\7f\2\2\u01f6\u01f7\7?\2\2\u01f7\u01f9\7@\2\2\u01f8\u01f6\3\2\2\2\u01f9"+ - "\u01fc\3\2\2\2\u01fa\u01f8\3\2\2\2\u01fa\u01fb\3\2\2\2\u01fb\u01fd\3\2"+ - "\2\2\u01fc\u01fa\3\2\2\2\u01fd\u01fe\7D\2\2\u01fe\u01ff\5H%\2\u01ff=\3"+ - "\2\2\2\u0200\u0203\5N(\2\u0201\u0203\7\62\2\2\u0202\u0200\3\2\2\2\u0202"+ - "\u0201\3\2\2\2\u0203\u0204\3\2\2\2\u0204\u0205\7f\2\2\u0205\u020a\5Z."+ - "\2\u0206\u0207\7?\2\2\u0207\u0209\7@\2\2\u0208\u0206\3\2\2\2\u0209\u020c"+ - "\3\2\2\2\u020a\u0208\3\2\2\2\u020a\u020b\3\2\2\2\u020b\u020f\3\2\2\2\u020c"+ - "\u020a\3\2\2\2\u020d\u020e\7/\2\2\u020e\u0210\5X-\2\u020f\u020d\3\2\2"+ - "\2\u020f\u0210\3\2\2\2\u0210\u0211\3\2\2\2\u0211\u0212\7A\2\2\u0212?\3"+ - "\2\2\2\u0213\u0214\5\22\n\2\u0214\u0215\5> \2\u0215A\3\2\2\2\u0216\u021b"+ - "\5D#\2\u0217\u0218\7B\2\2\u0218\u021a\5D#\2\u0219\u0217\3\2\2\2\u021a"+ - "\u021d\3\2\2\2\u021b\u0219\3\2\2\2\u021b\u021c\3\2\2\2\u021cC\3\2\2\2"+ - "\u021d\u021b\3\2\2\2\u021e\u0221\5F$\2\u021f\u0220\7D\2\2\u0220\u0222"+ - "\5H%\2\u0221\u021f\3\2\2\2\u0221\u0222\3\2\2\2\u0222E\3\2\2\2\u0223\u0228"+ - "\7f\2\2\u0224\u0225\7?\2\2\u0225\u0227\7@\2\2\u0226\u0224\3\2\2\2\u0227"+ - "\u022a\3\2\2\2\u0228\u0226\3\2\2\2\u0228\u0229\3\2\2\2\u0229G\3\2\2\2"+ - "\u022a\u0228\3\2\2\2\u022b\u022e\5J&\2\u022c\u022e\5\u00b0Y\2\u022d\u022b"+ - "\3\2\2\2\u022d\u022c\3\2\2\2\u022eI\3\2\2\2\u022f\u023b\7=\2\2\u0230\u0235"+ - "\5H%\2\u0231\u0232\7B\2\2\u0232\u0234\5H%\2\u0233\u0231\3\2\2\2\u0234"+ - "\u0237\3\2\2\2\u0235\u0233\3\2\2\2\u0235\u0236\3\2\2\2\u0236\u0239\3\2"+ - "\2\2\u0237\u0235\3\2\2\2\u0238\u023a\7B\2\2\u0239\u0238\3\2\2\2\u0239"+ - "\u023a\3\2\2\2\u023a\u023c\3\2\2\2\u023b\u0230\3\2\2\2\u023b\u023c\3\2"+ - "\2\2\u023c\u023d\3\2\2\2\u023d\u023e\7>\2\2\u023eK\3\2\2\2\u023f\u0240"+ - "\7f\2\2\u0240M\3\2\2\2\u0241\u0246\5P)\2\u0242\u0243\7?\2\2\u0243\u0245"+ - "\7@\2\2\u0244\u0242\3\2\2\2\u0245\u0248\3\2\2\2\u0246\u0244\3\2\2\2\u0246"+ - "\u0247\3\2\2\2\u0247\u0252\3\2\2\2\u0248\u0246\3\2\2\2\u0249\u024e\5R"+ - "*\2\u024a\u024b\7?\2\2\u024b\u024d\7@\2\2\u024c\u024a\3\2\2\2\u024d\u0250"+ - "\3\2\2\2\u024e\u024c\3\2\2\2\u024e\u024f\3\2\2\2\u024f\u0252\3\2\2\2\u0250"+ - "\u024e\3\2\2\2\u0251\u0241\3\2\2\2\u0251\u0249\3\2\2\2\u0252O\3\2\2\2"+ - "\u0253\u0255\7f\2\2\u0254\u0256\5T+\2\u0255\u0254\3\2\2\2\u0255\u0256"+ - "\3\2\2\2\u0256\u025e\3\2\2\2\u0257\u0258\7C\2\2\u0258\u025a\7f\2\2\u0259"+ - "\u025b\5T+\2\u025a\u0259\3\2\2\2\u025a\u025b\3\2\2\2\u025b\u025d\3\2\2"+ - "\2\u025c\u0257\3\2\2\2\u025d\u0260\3\2\2\2\u025e\u025c\3\2\2\2\u025e\u025f"+ - "\3\2\2\2\u025fQ\3\2\2\2\u0260\u025e\3\2\2\2\u0261\u0262\t\4\2\2\u0262"+ - "S\3\2\2\2\u0263\u0264\7F\2\2\u0264\u0269\5V,\2\u0265\u0266\7B\2\2\u0266"+ - "\u0268\5V,\2\u0267\u0265\3\2\2\2\u0268\u026b\3\2\2\2\u0269\u0267\3\2\2"+ - "\2\u0269\u026a\3\2\2\2\u026a\u026c\3\2\2\2\u026b\u0269\3\2\2\2\u026c\u026d"+ - "\7E\2\2\u026dU\3\2\2\2\u026e\u0275\5N(\2\u026f\u0272\7I\2\2\u0270\u0271"+ - "\t\5\2\2\u0271\u0273\5N(\2\u0272\u0270\3\2\2\2\u0272\u0273\3\2\2\2\u0273"+ - "\u0275\3\2\2\2\u0274\u026e\3\2\2\2\u0274\u026f\3\2\2\2\u0275W\3\2\2\2"+ - "\u0276\u027b\5f\64\2\u0277\u0278\7B\2\2\u0278\u027a\5f\64\2\u0279\u0277"+ - "\3\2\2\2\u027a\u027d\3\2\2\2\u027b\u0279\3\2\2\2\u027b\u027c\3\2\2\2\u027c"+ - "Y\3\2\2\2\u027d\u027b\3\2\2\2\u027e\u0280\7;\2\2\u027f\u0281\5\\/\2\u0280"+ - "\u027f\3\2\2\2\u0280\u0281\3\2\2\2\u0281\u0282\3\2\2\2\u0282\u0283\7<"+ - "\2\2\u0283[\3\2\2\2\u0284\u0289\5^\60\2\u0285\u0286\7B\2\2\u0286\u0288"+ - "\5^\60\2\u0287\u0285\3\2\2\2\u0288\u028b\3\2\2\2\u0289\u0287\3\2\2\2\u0289"+ - "\u028a\3\2\2\2\u028a\u028e\3\2\2\2\u028b\u0289\3\2\2\2\u028c\u028d\7B"+ - "\2\2\u028d\u028f\5`\61\2\u028e\u028c\3\2\2\2\u028e\u028f\3\2\2\2\u028f"+ - "\u0292\3\2\2\2\u0290\u0292\5`\61\2\u0291\u0284\3\2\2\2\u0291\u0290\3\2"+ - "\2\2\u0292]\3\2\2\2\u0293\u0295\5\16\b\2\u0294\u0293\3\2\2\2\u0295\u0298"+ - "\3\2\2\2\u0296\u0294\3\2\2\2\u0296\u0297\3\2\2\2\u0297\u0299\3\2\2\2\u0298"+ - "\u0296\3\2\2\2\u0299\u029a\5N(\2\u029a\u029b\5F$\2\u029b_\3\2\2\2\u029c"+ - "\u029e\5\16\b\2\u029d\u029c\3\2\2\2\u029e\u02a1\3\2\2\2\u029f\u029d\3"+ - "\2\2\2\u029f\u02a0\3\2\2\2\u02a0\u02a2\3\2\2\2\u02a1\u029f\3\2\2\2\u02a2"+ - "\u02a3\5N(\2\u02a3\u02a4\7h\2\2\u02a4\u02a5\5F$\2\u02a5a\3\2\2\2\u02a6"+ - "\u02a7\5\u0086D\2\u02a7c\3\2\2\2\u02a8\u02a9\5\u0086D\2\u02a9e\3\2\2\2"+ - "\u02aa\u02af\7f\2\2\u02ab\u02ac\7C\2\2\u02ac\u02ae\7f\2\2\u02ad\u02ab"+ - "\3\2\2\2\u02ae\u02b1\3\2\2\2\u02af\u02ad\3\2\2\2\u02af\u02b0\3\2\2\2\u02b0"+ - "g\3\2\2\2\u02b1\u02af\3\2\2\2\u02b2\u02b3\t\6\2\2\u02b3i\3\2\2\2\u02b4"+ - "\u02b5\7g\2\2\u02b5\u02bc\5l\67\2\u02b6\u02b9\7;\2\2\u02b7\u02ba\5n8\2"+ - "\u02b8\u02ba\5r:\2\u02b9\u02b7\3\2\2\2\u02b9\u02b8\3\2\2\2\u02b9\u02ba"+ - "\3\2\2\2\u02ba\u02bb\3\2\2\2\u02bb\u02bd\7<\2\2\u02bc\u02b6\3\2\2\2\u02bc"+ - "\u02bd\3\2\2\2\u02bdk\3\2\2\2\u02be\u02bf\5f\64\2\u02bfm\3\2\2\2\u02c0"+ - "\u02c5\5p9\2\u02c1\u02c2\7B\2\2\u02c2\u02c4\5p9\2\u02c3\u02c1\3\2\2\2"+ - "\u02c4\u02c7\3\2\2\2\u02c5\u02c3\3\2\2\2\u02c5\u02c6\3\2\2\2\u02c6o\3"+ - "\2\2\2\u02c7\u02c5\3\2\2\2\u02c8\u02c9\7f\2\2\u02c9\u02ca\7D\2\2\u02ca"+ - "\u02cb\5r:\2\u02cbq\3\2\2\2\u02cc\u02d0\5\u00b0Y\2\u02cd\u02d0\5j\66\2"+ - "\u02ce\u02d0\5t;\2\u02cf\u02cc\3\2\2\2\u02cf\u02cd\3\2\2\2\u02cf\u02ce"+ - "\3\2\2\2\u02d0s\3\2\2\2\u02d1\u02da\7=\2\2\u02d2\u02d7\5r:\2\u02d3\u02d4"+ - "\7B\2\2\u02d4\u02d6\5r:\2\u02d5\u02d3\3\2\2\2\u02d6\u02d9\3\2\2\2\u02d7"+ - "\u02d5\3\2\2\2\u02d7\u02d8\3\2\2\2\u02d8\u02db\3\2\2\2\u02d9\u02d7\3\2"+ - "\2\2\u02da\u02d2\3\2\2\2\u02da\u02db\3\2\2\2\u02db\u02dd\3\2\2\2\u02dc"+ - "\u02de\7B\2\2\u02dd\u02dc\3\2\2\2\u02dd\u02de\3\2\2\2\u02de\u02df\3\2"+ - "\2\2\u02df\u02e0\7>\2\2\u02e0u\3\2\2\2\u02e1\u02e2\7g\2\2\u02e2\u02e3"+ - "\7\36\2\2\u02e3\u02e4\7f\2\2\u02e4\u02e5\5x=\2\u02e5w\3\2\2\2\u02e6\u02ea"+ - "\7=\2\2\u02e7\u02e9\5z>\2\u02e8\u02e7\3\2\2\2\u02e9\u02ec\3\2\2\2\u02ea"+ - "\u02e8\3\2\2\2\u02ea\u02eb\3\2\2\2\u02eb\u02ed\3\2\2\2\u02ec\u02ea\3\2"+ - "\2\2\u02ed\u02ee\7>\2\2\u02eey\3\2\2\2\u02ef\u02f1\5\n\6\2\u02f0\u02ef"+ - "\3\2\2\2\u02f1\u02f4\3\2\2\2\u02f2\u02f0\3\2\2\2\u02f2\u02f3\3\2\2\2\u02f3"+ - "\u02f5\3\2\2\2\u02f4\u02f2\3\2\2\2\u02f5\u02f8\5|?\2\u02f6\u02f8\7A\2"+ - "\2\u02f7\u02f2\3\2\2\2\u02f7\u02f6\3\2\2\2\u02f8{\3\2\2\2\u02f9\u02fa"+ - "\5N(\2\u02fa\u02fb\5~@\2\u02fb\u02fc\7A\2\2\u02fc\u030e\3\2\2\2\u02fd"+ - "\u02ff\5\20\t\2\u02fe\u0300\7A\2\2\u02ff\u02fe\3\2\2\2\u02ff\u0300\3\2"+ - "\2\2\u0300\u030e\3\2\2\2\u0301\u0303\5 \21\2\u0302\u0304\7A\2\2\u0303"+ - "\u0302\3\2\2\2\u0303\u0304\3\2\2\2\u0304\u030e\3\2\2\2\u0305\u0307\5\30"+ - "\r\2\u0306\u0308\7A\2\2\u0307\u0306\3\2\2\2\u0307\u0308\3\2\2\2\u0308"+ - "\u030e\3\2\2\2\u0309\u030b\5v<\2\u030a\u030c\7A\2\2\u030b\u030a\3\2\2"+ - "\2\u030b\u030c\3\2\2\2\u030c\u030e\3\2\2\2\u030d\u02f9\3\2\2\2\u030d\u02fd"+ - "\3\2\2\2\u030d\u0301\3\2\2\2\u030d\u0305\3\2\2\2\u030d\u0309\3\2\2\2\u030e"+ - "}\3\2\2\2\u030f\u0312\5\u0080A\2\u0310\u0312\5\u0082B\2\u0311\u030f\3"+ - "\2\2\2\u0311\u0310\3\2\2\2\u0312\177\3\2\2\2\u0313\u0314\7f\2\2\u0314"+ - "\u0315\7;\2\2\u0315\u0317\7<\2\2\u0316\u0318\5\u0084C\2\u0317\u0316\3"+ - "\2\2\2\u0317\u0318\3\2\2\2\u0318\u0081\3\2\2\2\u0319\u031a\5B\"\2\u031a"+ - "\u0083\3\2\2\2\u031b\u031c\7\16\2\2\u031c\u031d\5r:\2\u031d\u0085\3\2"+ - "\2\2\u031e\u0322\7=\2\2\u031f\u0321\5\u0088E\2\u0320\u031f\3\2\2\2\u0321"+ - "\u0324\3\2\2\2\u0322\u0320\3\2\2\2\u0322\u0323\3\2\2\2\u0323\u0325\3\2"+ - "\2\2\u0324\u0322\3\2\2\2\u0325\u0326\7>\2\2\u0326\u0087\3\2\2\2\u0327"+ - "\u032b\5\u008aF\2\u0328\u032b\5\u008eH\2\u0329\u032b\5\b\5\2\u032a\u0327"+ - "\3\2\2\2\u032a\u0328\3\2\2\2\u032a\u0329\3\2\2\2\u032b\u0089\3\2\2\2\u032c"+ - "\u032d\5\u008cG\2\u032d\u032e\7A\2\2\u032e\u008b\3\2\2\2\u032f\u0331\5"+ - "\16\b\2\u0330\u032f\3\2\2\2\u0331\u0334\3\2\2\2\u0332\u0330\3\2\2\2\u0332"+ - "\u0333\3\2\2\2\u0333\u0335\3\2\2\2\u0334\u0332\3\2\2\2\u0335\u0336\5N"+ - "(\2\u0336\u0337\5B\"\2\u0337\u008d\3\2\2\2\u0338\u03a1\5\u0086D\2\u0339"+ - "\u033a\7\4\2\2\u033a\u033d\5\u00b0Y\2\u033b\u033c\7J\2\2\u033c\u033e\5"+ - "\u00b0Y\2\u033d\u033b\3\2\2\2\u033d\u033e\3\2\2\2\u033e\u033f\3\2\2\2"+ - "\u033f\u0340\7A\2\2\u0340\u03a1\3\2\2\2\u0341\u0342\7\30\2\2\u0342\u0343"+ - "\5\u00a8U\2\u0343\u0346\5\u008eH\2\u0344\u0345\7\21\2\2\u0345\u0347\5"+ - "\u008eH\2\u0346\u0344\3\2\2\2\u0346\u0347\3\2\2\2\u0347\u03a1\3\2\2\2"+ - "\u0348\u0349\7\27\2\2\u0349\u034a\7;\2\2\u034a\u034b\5\u00a0Q\2\u034b"+ - "\u034c\7<\2\2\u034c\u034d\5\u008eH\2\u034d\u03a1\3\2\2\2\u034e\u034f\7"+ - "\64\2\2\u034f\u0350\5\u00a8U\2\u0350\u0351\5\u008eH\2\u0351\u03a1\3\2"+ - "\2\2\u0352\u0353\7\17\2\2\u0353\u0354\5\u008eH\2\u0354\u0355\7\64\2\2"+ - "\u0355\u0356\5\u00a8U\2\u0356\u0357\7A\2\2\u0357\u03a1\3\2\2\2\u0358\u0359"+ - "\7\61\2\2\u0359\u0363\5\u0086D\2\u035a\u035c\5\u0090I\2\u035b\u035a\3"+ - "\2\2\2\u035c\u035d\3\2\2\2\u035d\u035b\3\2\2\2\u035d\u035e\3\2\2\2\u035e"+ - "\u0360\3\2\2\2\u035f\u0361\5\u0094K\2\u0360\u035f\3\2\2\2\u0360\u0361"+ - "\3\2\2\2\u0361\u0364\3\2\2\2\u0362\u0364\5\u0094K\2\u0363\u035b\3\2\2"+ - "\2\u0363\u0362\3\2\2\2\u0364\u03a1\3\2\2\2\u0365\u0366\7\61\2\2\u0366"+ - "\u0367\5\u0096L\2\u0367\u036b\5\u0086D\2\u0368\u036a\5\u0090I\2\u0369"+ - "\u0368\3\2\2\2\u036a\u036d\3\2\2\2\u036b\u0369\3\2\2\2\u036b\u036c\3\2"+ - "\2\2\u036c\u036f\3\2\2\2\u036d\u036b\3\2\2\2\u036e\u0370\5\u0094K\2\u036f"+ - "\u036e\3\2\2\2\u036f\u0370\3\2\2\2\u0370\u03a1\3\2\2\2\u0371\u0372\7+"+ - "\2\2\u0372\u0373\5\u00a8U\2\u0373\u0377\7=\2\2\u0374\u0376\5\u009cO\2"+ - "\u0375\u0374\3\2\2\2\u0376\u0379\3\2\2\2\u0377\u0375\3\2\2\2\u0377\u0378"+ - "\3\2\2\2\u0378\u037d\3\2\2\2\u0379\u0377\3\2\2\2\u037a\u037c\5\u009eP"+ - "\2\u037b\u037a\3\2\2\2\u037c\u037f\3\2\2\2\u037d\u037b\3\2\2\2\u037d\u037e"+ - "\3\2\2\2\u037e\u0380\3\2\2\2\u037f\u037d\3\2\2\2\u0380\u0381\7>\2\2\u0381"+ - "\u03a1\3\2\2\2\u0382\u0383\7,\2\2\u0383\u0384\5\u00a8U\2\u0384\u0385\5"+ - "\u0086D\2\u0385\u03a1\3\2\2\2\u0386\u0388\7&\2\2\u0387\u0389\5\u00b0Y"+ - "\2\u0388\u0387\3\2\2\2\u0388\u0389\3\2\2\2\u0389\u038a\3\2\2\2\u038a\u03a1"+ - "\7A\2\2\u038b\u038c\7.\2\2\u038c\u038d\5\u00b0Y\2\u038d\u038e\7A\2\2\u038e"+ - "\u03a1\3\2\2\2\u038f\u0391\7\6\2\2\u0390\u0392\7f\2\2\u0391\u0390\3\2"+ - "\2\2\u0391\u0392\3\2\2\2\u0392\u0393\3\2\2\2\u0393\u03a1\7A\2\2\u0394"+ - "\u0396\7\r\2\2\u0395\u0397\7f\2\2\u0396\u0395\3\2\2\2\u0396\u0397\3\2"+ - "\2\2\u0397\u0398\3\2\2\2\u0398\u03a1\7A\2\2\u0399\u03a1\7A\2\2\u039a\u039b"+ - "\5\u00acW\2\u039b\u039c\7A\2\2\u039c\u03a1\3\2\2\2\u039d\u039e\7f\2\2"+ - "\u039e\u039f\7J\2\2\u039f\u03a1\5\u008eH\2\u03a0\u0338\3\2\2\2\u03a0\u0339"+ - "\3\2\2\2\u03a0\u0341\3\2\2\2\u03a0\u0348\3\2\2\2\u03a0\u034e\3\2\2\2\u03a0"+ - "\u0352\3\2\2\2\u03a0\u0358\3\2\2\2\u03a0\u0365\3\2\2\2\u03a0\u0371\3\2"+ - "\2\2\u03a0\u0382\3\2\2\2\u03a0\u0386\3\2\2\2\u03a0\u038b\3\2\2\2\u03a0"+ - "\u038f\3\2\2\2\u03a0\u0394\3\2\2\2\u03a0\u0399\3\2\2\2\u03a0\u039a\3\2"+ - "\2\2\u03a0\u039d\3\2\2\2\u03a1\u008f\3\2\2\2\u03a2\u03a3\7\t\2\2\u03a3"+ - "\u03a7\7;\2\2\u03a4\u03a6\5\16\b\2\u03a5\u03a4\3\2\2\2\u03a6\u03a9\3\2"+ - "\2\2\u03a7\u03a5\3\2\2\2\u03a7\u03a8\3\2\2\2\u03a8\u03aa\3\2\2\2\u03a9"+ - "\u03a7\3\2\2\2\u03aa\u03ab\5\u0092J\2\u03ab\u03ac\7f\2\2\u03ac\u03ad\7"+ - "<\2\2\u03ad\u03ae\5\u0086D\2\u03ae\u0091\3\2\2\2\u03af\u03b4\5f\64\2\u03b0"+ - "\u03b1\7X\2\2\u03b1\u03b3\5f\64\2\u03b2\u03b0\3\2\2\2\u03b3\u03b6\3\2"+ - "\2\2\u03b4\u03b2\3\2\2\2\u03b4\u03b5\3\2\2\2\u03b5\u0093\3\2\2\2\u03b6"+ - "\u03b4\3\2\2\2\u03b7\u03b8\7\25\2\2\u03b8\u03b9\5\u0086D\2\u03b9\u0095"+ - "\3\2\2\2\u03ba\u03bb\7;\2\2\u03bb\u03bd\5\u0098M\2\u03bc\u03be\7A\2\2"+ - "\u03bd\u03bc\3\2\2\2\u03bd\u03be\3\2\2\2\u03be\u03bf\3\2\2\2\u03bf\u03c0"+ - "\7<\2\2\u03c0\u0097\3\2\2\2\u03c1\u03c6\5\u009aN\2\u03c2\u03c3\7A\2\2"+ - "\u03c3\u03c5\5\u009aN\2\u03c4\u03c2\3\2\2\2\u03c5\u03c8\3\2\2\2\u03c6"+ - "\u03c4\3\2\2\2\u03c6\u03c7\3\2\2\2\u03c7\u0099\3\2\2\2\u03c8\u03c6\3\2"+ - "\2\2\u03c9\u03cb\5\16\b\2\u03ca\u03c9\3\2\2\2\u03cb\u03ce\3\2\2\2\u03cc"+ - "\u03ca\3\2\2\2\u03cc\u03cd\3\2\2\2\u03cd\u03cf\3\2\2\2\u03ce\u03cc\3\2"+ - "\2\2\u03cf\u03d0\5P)\2\u03d0\u03d1\5F$\2\u03d1\u03d2\7D\2\2\u03d2\u03d3"+ - "\5\u00b0Y\2\u03d3\u009b\3\2\2\2\u03d4\u03d6\5\u009eP\2\u03d5\u03d4\3\2"+ - "\2\2\u03d6\u03d7\3\2\2\2\u03d7\u03d5\3\2\2\2\u03d7\u03d8\3\2\2\2\u03d8"+ - "\u03da\3\2\2\2\u03d9\u03db\5\u0088E\2\u03da\u03d9\3\2\2\2\u03db\u03dc"+ - "\3\2\2\2\u03dc\u03da\3\2\2\2\u03dc\u03dd\3\2\2\2\u03dd\u009d\3\2\2\2\u03de"+ - "\u03df\7\b\2\2\u03df\u03e0\5\u00aeX\2\u03e0\u03e1\7J\2\2\u03e1\u03e9\3"+ - "\2\2\2\u03e2\u03e3\7\b\2\2\u03e3\u03e4\5L\'\2\u03e4\u03e5\7J\2\2\u03e5"+ - "\u03e9\3\2\2\2\u03e6\u03e7\7\16\2\2\u03e7\u03e9\7J\2\2\u03e8\u03de\3\2"+ - "\2\2\u03e8\u03e2\3\2\2\2\u03e8\u03e6\3\2\2\2\u03e9\u009f\3\2\2\2\u03ea"+ - "\u03f7\5\u00a4S\2\u03eb\u03ed\5\u00a2R\2\u03ec\u03eb\3\2\2\2\u03ec\u03ed"+ - "\3\2\2\2\u03ed\u03ee\3\2\2\2\u03ee\u03f0\7A\2\2\u03ef\u03f1\5\u00b0Y\2"+ - "\u03f0\u03ef\3\2\2\2\u03f0\u03f1\3\2\2\2\u03f1\u03f2\3\2\2\2\u03f2\u03f4"+ - "\7A\2\2\u03f3\u03f5\5\u00a6T\2\u03f4\u03f3\3\2\2\2\u03f4\u03f5\3\2\2\2"+ - "\u03f5\u03f7\3\2\2\2\u03f6\u03ea\3\2\2\2\u03f6\u03ec\3\2\2\2\u03f7\u00a1"+ - "\3\2\2\2\u03f8\u03fb\5\u008cG\2\u03f9\u03fb\5\u00aaV\2\u03fa\u03f8\3\2"+ - "\2\2\u03fa\u03f9\3\2\2\2\u03fb\u00a3\3\2\2\2\u03fc\u03fe\5\16\b\2\u03fd"+ - "\u03fc\3\2\2\2\u03fe\u0401\3\2\2\2\u03ff\u03fd\3\2\2\2\u03ff\u0400\3\2"+ - "\2\2\u0400\u0402\3\2\2\2\u0401\u03ff\3\2\2\2\u0402\u0403\5N(\2\u0403\u0404"+ - "\7f\2\2\u0404\u0405\7J\2\2\u0405\u0406\5\u00b0Y\2\u0406\u00a5\3\2\2\2"+ - "\u0407\u0408\5\u00aaV\2\u0408\u00a7\3\2\2\2\u0409\u040a\7;\2\2\u040a\u040b"+ - "\5\u00b0Y\2\u040b\u040c\7<\2\2\u040c\u00a9\3\2\2\2\u040d\u0412\5\u00b0"+ - "Y\2\u040e\u040f\7B\2\2\u040f\u0411\5\u00b0Y\2\u0410\u040e\3\2\2\2\u0411"+ - "\u0414\3\2\2\2\u0412\u0410\3\2\2\2\u0412\u0413\3\2\2\2\u0413\u00ab\3\2"+ - "\2\2\u0414\u0412\3\2\2\2\u0415\u0416\5\u00b0Y\2\u0416\u00ad\3\2\2\2\u0417"+ - "\u0418\5\u00b0Y\2\u0418\u00af\3\2\2\2\u0419\u041a\bY\1\2\u041a\u041b\7"+ - ";\2\2\u041b\u041c\5N(\2\u041c\u041d\7<\2\2\u041d\u041e\5\u00b0Y\23\u041e"+ - "\u0427\3\2\2\2\u041f\u0420\t\7\2\2\u0420\u0427\5\u00b0Y\21\u0421\u0422"+ - "\t\b\2\2\u0422\u0427\5\u00b0Y\20\u0423\u0427\5\u00b2Z\2\u0424\u0425\7"+ - "!\2\2\u0425\u0427\5\u00b4[\2\u0426\u0419\3\2\2\2\u0426\u041f\3\2\2\2\u0426"+ - "\u0421\3\2\2\2\u0426\u0423\3\2\2\2\u0426\u0424\3\2\2\2\u0427\u047d\3\2"+ - "\2\2\u0428\u0429\f\17\2\2\u0429\u042a\t\t\2\2\u042a\u047c\5\u00b0Y\20"+ - "\u042b\u042c\f\16\2\2\u042c\u042d\t\n\2\2\u042d\u047c\5\u00b0Y\17\u042e"+ - "\u0436\f\r\2\2\u042f\u0430\7F\2\2\u0430\u0437\7F\2\2\u0431\u0432\7E\2"+ - "\2\u0432\u0433\7E\2\2\u0433\u0437\7E\2\2\u0434\u0435\7E\2\2\u0435\u0437"+ - "\7E\2\2\u0436\u042f\3\2\2\2\u0436\u0431\3\2\2\2\u0436\u0434\3\2\2\2\u0437"+ - "\u0438\3\2\2\2\u0438\u047c\5\u00b0Y\16\u0439\u043a\f\f\2\2\u043a\u043b"+ - "\t\13\2\2\u043b\u047c\5\u00b0Y\r\u043c\u043d\f\n\2\2\u043d\u043e\t\f\2"+ - "\2\u043e\u047c\5\u00b0Y\13\u043f\u0440\f\t\2\2\u0440\u0441\7W\2\2\u0441"+ - "\u047c\5\u00b0Y\n\u0442\u0443\f\b\2\2\u0443\u0444\7Y\2\2\u0444\u047c\5"+ - "\u00b0Y\t\u0445\u0446\f\7\2\2\u0446\u0447\7X\2\2\u0447\u047c\5\u00b0Y"+ - "\b\u0448\u0449\f\6\2\2\u0449\u044a\7O\2\2\u044a\u047c\5\u00b0Y\7\u044b"+ - "\u044c\f\5\2\2\u044c\u044d\7P\2\2\u044d\u047c\5\u00b0Y\6\u044e\u044f\f"+ - "\4\2\2\u044f\u0450\7I\2\2\u0450\u0451\5\u00b0Y\2\u0451\u0452\7J\2\2\u0452"+ - "\u0453\5\u00b0Y\5\u0453\u047c\3\2\2\2\u0454\u0455\f\3\2\2\u0455\u0456"+ - "\t\r\2\2\u0456\u047c\5\u00b0Y\4\u0457\u0458\f\33\2\2\u0458\u0459\7C\2"+ - "\2\u0459\u047c\7f\2\2\u045a\u045b\f\32\2\2\u045b\u045c\7C\2\2\u045c\u047c"+ - "\7-\2\2\u045d\u045e\f\31\2\2\u045e\u045f\7C\2\2\u045f\u0461\7!\2\2\u0460"+ - "\u0462\5\u00c0a\2\u0461\u0460\3\2\2\2\u0461\u0462\3\2\2\2\u0462\u0463"+ - "\3\2\2\2\u0463\u047c\5\u00b8]\2\u0464\u0465\f\30\2\2\u0465\u0466\7C\2"+ - "\2\u0466\u0467\7*\2\2\u0467\u047c\5\u00c6d\2\u0468\u0469\f\27\2\2\u0469"+ - "\u046a\7C\2\2\u046a\u047c\5\u00be`\2\u046b\u046c\f\26\2\2\u046c\u046d"+ - "\7?\2\2\u046d\u046e\5\u00b0Y\2\u046e\u046f\7@\2\2\u046f\u047c\3\2\2\2"+ - "\u0470\u0471\f\25\2\2\u0471\u0473\7;\2\2\u0472\u0474\5\u00aaV\2\u0473"+ - "\u0472\3\2\2\2\u0473\u0474\3\2\2\2\u0474\u0475\3\2\2\2\u0475\u047c\7<"+ - "\2\2\u0476\u0477\f\22\2\2\u0477\u047c\t\16\2\2\u0478\u0479\f\13\2\2\u0479"+ - "\u047a\7\34\2\2\u047a\u047c\5N(\2\u047b\u0428\3\2\2\2\u047b\u042b\3\2"+ - "\2\2\u047b\u042e\3\2\2\2\u047b\u0439\3\2\2\2\u047b\u043c\3\2\2\2\u047b"+ - "\u043f\3\2\2\2\u047b\u0442\3\2\2\2\u047b\u0445\3\2\2\2\u047b\u0448\3\2"+ - "\2\2\u047b\u044b\3\2\2\2\u047b\u044e\3\2\2\2\u047b\u0454\3\2\2\2\u047b"+ - "\u0457\3\2\2\2\u047b\u045a\3\2\2\2\u047b\u045d\3\2\2\2\u047b\u0464\3\2"+ - "\2\2\u047b\u0468\3\2\2\2\u047b\u046b\3\2\2\2\u047b\u0470\3\2\2\2\u047b"+ - "\u0476\3\2\2\2\u047b\u0478\3\2\2\2\u047c\u047f\3\2\2\2\u047d\u047b\3\2"+ - "\2\2\u047d\u047e\3\2\2\2\u047e\u00b1\3\2\2\2\u047f\u047d\3\2\2\2\u0480"+ - "\u0481\7;\2\2\u0481\u0482\5\u00b0Y\2\u0482\u0483\7<\2\2\u0483\u0496\3"+ - "\2\2\2\u0484\u0496\7-\2\2\u0485\u0496\7*\2\2\u0486\u0496\5h\65\2\u0487"+ - "\u0496\7f\2\2\u0488\u0489\5N(\2\u0489\u048a\7C\2\2\u048a\u048b\7\13\2"+ - "\2\u048b\u0496\3\2\2\2\u048c\u048d\7\62\2\2\u048d\u048e\7C\2\2\u048e\u0496"+ - "\7\13\2\2\u048f\u0493\5\u00c0a\2\u0490\u0494\5\u00c8e\2\u0491\u0492\7"+ - "-\2\2\u0492\u0494\5\u00caf\2\u0493\u0490\3\2\2\2\u0493\u0491\3\2\2\2\u0494"+ - "\u0496\3\2\2\2\u0495\u0480\3\2\2\2\u0495\u0484\3\2\2\2\u0495\u0485\3\2"+ - "\2\2\u0495\u0486\3\2\2\2\u0495\u0487\3\2\2\2\u0495\u0488\3\2\2\2\u0495"+ - "\u048c\3\2\2\2\u0495\u048f\3\2\2\2\u0496\u00b3\3\2\2\2\u0497\u0498\5\u00c0"+ - "a\2\u0498\u0499\5\u00b6\\\2\u0499\u049a\5\u00bc_\2\u049a\u04a1\3\2\2\2"+ - "\u049b\u049e\5\u00b6\\\2\u049c\u049f\5\u00ba^\2\u049d\u049f\5\u00bc_\2"+ - "\u049e\u049c\3\2\2\2\u049e\u049d\3\2\2\2\u049f\u04a1\3\2\2\2\u04a0\u0497"+ - "\3\2\2\2\u04a0\u049b\3\2\2\2\u04a1\u00b5\3\2\2\2\u04a2\u04a4\7f\2\2\u04a3"+ - "\u04a5\5\u00c2b\2\u04a4\u04a3\3\2\2\2\u04a4\u04a5\3\2\2\2\u04a5\u04ad"+ - "\3\2\2\2\u04a6\u04a7\7C\2\2\u04a7\u04a9\7f\2\2\u04a8\u04aa\5\u00c2b\2"+ - "\u04a9\u04a8\3\2\2\2\u04a9\u04aa\3\2\2\2\u04aa\u04ac\3\2\2\2\u04ab\u04a6"+ - "\3\2\2\2\u04ac\u04af\3\2\2\2\u04ad\u04ab\3\2\2\2\u04ad\u04ae\3\2\2\2\u04ae"+ - "\u04b2\3\2\2\2\u04af\u04ad\3\2\2\2\u04b0\u04b2\5R*\2\u04b1\u04a2\3\2\2"+ - "\2\u04b1\u04b0\3\2\2\2\u04b2\u00b7\3\2\2\2\u04b3\u04b5\7f\2\2\u04b4\u04b6"+ - "\5\u00c4c\2\u04b5\u04b4\3\2\2\2\u04b5\u04b6\3\2\2\2\u04b6\u04b7\3\2\2"+ - "\2\u04b7\u04b8\5\u00bc_\2\u04b8\u00b9\3\2\2\2\u04b9\u04d5\7?\2\2\u04ba"+ - "\u04bf\7@\2\2\u04bb\u04bc\7?\2\2\u04bc\u04be\7@\2\2\u04bd\u04bb\3\2\2"+ - "\2\u04be\u04c1\3\2\2\2\u04bf\u04bd\3\2\2\2\u04bf\u04c0\3\2\2\2\u04c0\u04c2"+ - "\3\2\2\2\u04c1\u04bf\3\2\2\2\u04c2\u04d6\5J&\2\u04c3\u04c4\5\u00b0Y\2"+ - "\u04c4\u04cb\7@\2\2\u04c5\u04c6\7?\2\2\u04c6\u04c7\5\u00b0Y\2\u04c7\u04c8"+ - "\7@\2\2\u04c8\u04ca\3\2\2\2\u04c9\u04c5\3\2\2\2\u04ca\u04cd\3\2\2\2\u04cb"+ - "\u04c9\3\2\2\2\u04cb\u04cc\3\2\2\2\u04cc\u04d2\3\2\2\2\u04cd\u04cb\3\2"+ - "\2\2\u04ce\u04cf\7?\2\2\u04cf\u04d1\7@\2\2\u04d0\u04ce\3\2\2\2\u04d1\u04d4"+ - "\3\2\2\2\u04d2\u04d0\3\2\2\2\u04d2\u04d3\3\2\2\2\u04d3\u04d6\3\2\2\2\u04d4"+ - "\u04d2\3\2\2\2\u04d5\u04ba\3\2\2\2\u04d5\u04c3\3\2\2\2\u04d6\u00bb\3\2"+ - "\2\2\u04d7\u04d9\5\u00caf\2\u04d8\u04da\5$\23\2\u04d9\u04d8\3\2\2\2\u04d9"+ - "\u04da\3\2\2\2\u04da\u00bd\3\2\2\2\u04db\u04dc\5\u00c0a\2\u04dc\u04dd"+ - "\5\u00c8e\2\u04dd\u00bf\3\2\2\2\u04de\u04df\7F\2\2\u04df\u04e0\5\"\22"+ - "\2\u04e0\u04e1\7E\2\2\u04e1\u00c1\3\2\2\2\u04e2\u04e3\7F\2\2\u04e3\u04e6"+ - "\7E\2\2\u04e4\u04e6\5T+\2\u04e5\u04e2\3\2\2\2\u04e5\u04e4\3\2\2\2\u04e6"+ - "\u00c3\3\2\2\2\u04e7\u04e8\7F\2\2\u04e8\u04eb\7E\2\2\u04e9\u04eb\5\u00c0"+ - "a\2\u04ea\u04e7\3\2\2\2\u04ea\u04e9\3\2\2\2\u04eb\u00c5\3\2\2\2\u04ec"+ - "\u04f3\5\u00caf\2\u04ed\u04ee\7C\2\2\u04ee\u04f0\7f\2\2\u04ef\u04f1\5"+ - "\u00caf\2\u04f0\u04ef\3\2\2\2\u04f0\u04f1\3\2\2\2\u04f1\u04f3\3\2\2\2"+ - "\u04f2\u04ec\3\2\2\2\u04f2\u04ed\3\2\2\2\u04f3\u00c7\3\2\2\2\u04f4\u04f5"+ - "\7*\2\2\u04f5\u04f9\5\u00c6d\2\u04f6\u04f7\7f\2\2\u04f7\u04f9\5\u00ca"+ - "f\2\u04f8\u04f4\3\2\2\2\u04f8\u04f6\3\2\2\2\u04f9\u00c9\3\2\2\2\u04fa"+ - "\u04fc\7;\2\2\u04fb\u04fd\5\u00aaV\2\u04fc\u04fb\3\2\2\2\u04fc\u04fd\3"+ - "\2\2\2\u04fd\u04fe\3\2\2\2\u04fe\u04ff\7<\2\2\u04ff\u00cb\3\2\2\2\u0097"+ - "\u00cd\u00d2\u00d8\u00e0\u00e9\u00ee\u00f5\u00fc\u0103\u010a\u010f\u0113"+ - "\u0117\u011b\u0120\u0124\u0128\u0132\u013a\u0141\u0148\u014c\u014f\u0152"+ - "\u015b\u0161\u0166\u0169\u016f\u0175\u0179\u0182\u0189\u0192\u0199\u019f"+ - "\u01a3\u01ae\u01b2\u01ba\u01bf\u01c3\u01cc\u01da\u01df\u01e8\u01f0\u01fa"+ - "\u0202\u020a\u020f\u021b\u0221\u0228\u022d\u0235\u0239\u023b\u0246\u024e"+ - "\u0251\u0255\u025a\u025e\u0269\u0272\u0274\u027b\u0280\u0289\u028e\u0291"+ - "\u0296\u029f\u02af\u02b9\u02bc\u02c5\u02cf\u02d7\u02da\u02dd\u02ea\u02f2"+ - "\u02f7\u02ff\u0303\u0307\u030b\u030d\u0311\u0317\u0322\u032a\u0332\u033d"+ - "\u0346\u035d\u0360\u0363\u036b\u036f\u0377\u037d\u0388\u0391\u0396\u03a0"+ - "\u03a7\u03b4\u03bd\u03c6\u03cc\u03d7\u03dc\u03e8\u03ec\u03f0\u03f4\u03f6"+ - "\u03fa\u03ff\u0412\u0426\u0436\u0461\u0473\u047b\u047d\u0493\u0495\u049e"+ - "\u04a0\u04a4\u04a9\u04ad\u04b1\u04b5\u04bf\u04cb\u04d2\u04d5\u04d9\u04e5"+ - "\u04ea\u04f0\u04f2\u04f8\u04fc"; - public static final ATN _ATN = - new ATNDeserializer().deserialize(_serializedATN.toCharArray()); - static { - _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; - for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { - _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); - } - } -} \ No newline at end of file diff --git a/src/de/dhbwstuttgart/antlr/Java8Visitor.java b/src/de/dhbwstuttgart/antlr/Java8Visitor.java deleted file mode 100644 index c54536250..000000000 --- a/src/de/dhbwstuttgart/antlr/Java8Visitor.java +++ /dev/null @@ -1,621 +0,0 @@ -package de.dhbwstuttgart.antlr; - -// Generated from Java8.g4 by ANTLR 4.4 -import org.antlr.v4.runtime.misc.NotNull; -import org.antlr.v4.runtime.tree.ParseTreeVisitor; - -/** - * This interface defines a complete generic visitor for a parse tree produced - * by {@link Java8Parser}. - * - * @param The return type of the visit operation. Use {@link Void} for - * operations with no return type. - */ -public interface Java8Visitor extends ParseTreeVisitor { - /** - * Visit a parse tree produced by {@link Java8Parser#memberDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitMemberDeclaration(@NotNull Java8Parser.MemberDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#defaultValue}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitDefaultValue(@NotNull Java8Parser.DefaultValueContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#annotationTypeElementDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitAnnotationTypeElementDeclaration(@NotNull Java8Parser.AnnotationTypeElementDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#type}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitType(@NotNull Java8Parser.TypeContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#annotationTypeBody}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitAnnotationTypeBody(@NotNull Java8Parser.AnnotationTypeBodyContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#genericInterfaceMethodDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitGenericInterfaceMethodDeclaration(@NotNull Java8Parser.GenericInterfaceMethodDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#classBodyDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitClassBodyDeclaration(@NotNull Java8Parser.ClassBodyDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#block}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitBlock(@NotNull Java8Parser.BlockContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#enumBodyDeclarations}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitEnumBodyDeclarations(@NotNull Java8Parser.EnumBodyDeclarationsContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#forUpdate}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitForUpdate(@NotNull Java8Parser.ForUpdateContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#enhancedForControl}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitEnhancedForControl(@NotNull Java8Parser.EnhancedForControlContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#annotationConstantRest}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitAnnotationConstantRest(@NotNull Java8Parser.AnnotationConstantRestContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#explicitGenericInvocation}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitExplicitGenericInvocation(@NotNull Java8Parser.ExplicitGenericInvocationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#nonWildcardTypeArgumentsOrDiamond}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitNonWildcardTypeArgumentsOrDiamond(@NotNull Java8Parser.NonWildcardTypeArgumentsOrDiamondContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#expressionList}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitExpressionList(@NotNull Java8Parser.ExpressionListContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#annotationTypeElementRest}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitAnnotationTypeElementRest(@NotNull Java8Parser.AnnotationTypeElementRestContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#classOrInterfaceType}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitClassOrInterfaceType(@NotNull Java8Parser.ClassOrInterfaceTypeContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#typeBound}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitTypeBound(@NotNull Java8Parser.TypeBoundContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#variableDeclaratorId}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitVariableDeclaratorId(@NotNull Java8Parser.VariableDeclaratorIdContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#primary}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitPrimary(@NotNull Java8Parser.PrimaryContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#classCreatorRest}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitClassCreatorRest(@NotNull Java8Parser.ClassCreatorRestContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#interfaceBodyDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitInterfaceBodyDeclaration(@NotNull Java8Parser.InterfaceBodyDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#typeArguments}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitTypeArguments(@NotNull Java8Parser.TypeArgumentsContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#annotationName}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitAnnotationName(@NotNull Java8Parser.AnnotationNameContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#finallyBlock}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitFinallyBlock(@NotNull Java8Parser.FinallyBlockContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#typeParameters}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitTypeParameters(@NotNull Java8Parser.TypeParametersContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#lastFormalParameter}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitLastFormalParameter(@NotNull Java8Parser.LastFormalParameterContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#constructorBody}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitConstructorBody(@NotNull Java8Parser.ConstructorBodyContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#literal}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitLiteral(@NotNull Java8Parser.LiteralContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#annotationMethodOrConstantRest}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitAnnotationMethodOrConstantRest(@NotNull Java8Parser.AnnotationMethodOrConstantRestContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#catchClause}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitCatchClause(@NotNull Java8Parser.CatchClauseContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#variableDeclarator}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitVariableDeclarator(@NotNull Java8Parser.VariableDeclaratorContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#typeList}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitTypeList(@NotNull Java8Parser.TypeListContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#enumConstants}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitEnumConstants(@NotNull Java8Parser.EnumConstantsContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#classBody}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitClassBody(@NotNull Java8Parser.ClassBodyContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#createdName}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitCreatedName(@NotNull Java8Parser.CreatedNameContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#enumDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitEnumDeclaration(@NotNull Java8Parser.EnumDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#formalParameter}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitFormalParameter(@NotNull Java8Parser.FormalParameterContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#parExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitParExpression(@NotNull Java8Parser.ParExpressionContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#annotation}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitAnnotation(@NotNull Java8Parser.AnnotationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#variableInitializer}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitVariableInitializer(@NotNull Java8Parser.VariableInitializerContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#elementValueArrayInitializer}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitElementValueArrayInitializer(@NotNull Java8Parser.ElementValueArrayInitializerContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#creator}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitCreator(@NotNull Java8Parser.CreatorContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#arrayCreatorRest}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitArrayCreatorRest(@NotNull Java8Parser.ArrayCreatorRestContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#expression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitExpression(@NotNull Java8Parser.ExpressionContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#constantExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitConstantExpression(@NotNull Java8Parser.ConstantExpressionContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#qualifiedNameList}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitQualifiedNameList(@NotNull Java8Parser.QualifiedNameListContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#constructorDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitConstructorDeclaration(@NotNull Java8Parser.ConstructorDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#forControl}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitForControl(@NotNull Java8Parser.ForControlContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#superSuffix}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitSuperSuffix(@NotNull Java8Parser.SuperSuffixContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#variableDeclarators}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitVariableDeclarators(@NotNull Java8Parser.VariableDeclaratorsContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#catchType}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitCatchType(@NotNull Java8Parser.CatchTypeContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#classOrInterfaceModifier}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitClassOrInterfaceModifier(@NotNull Java8Parser.ClassOrInterfaceModifierContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#enumConstantName}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitEnumConstantName(@NotNull Java8Parser.EnumConstantNameContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#modifier}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitModifier(@NotNull Java8Parser.ModifierContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#innerCreator}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitInnerCreator(@NotNull Java8Parser.InnerCreatorContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#explicitGenericInvocationSuffix}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitExplicitGenericInvocationSuffix(@NotNull Java8Parser.ExplicitGenericInvocationSuffixContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#variableModifier}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitVariableModifier(@NotNull Java8Parser.VariableModifierContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#elementValuePair}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitElementValuePair(@NotNull Java8Parser.ElementValuePairContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#arrayInitializer}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitArrayInitializer(@NotNull Java8Parser.ArrayInitializerContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#elementValue}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitElementValue(@NotNull Java8Parser.ElementValueContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#constDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitConstDeclaration(@NotNull Java8Parser.ConstDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#resource}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitResource(@NotNull Java8Parser.ResourceContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#qualifiedName}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitQualifiedName(@NotNull Java8Parser.QualifiedNameContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#resourceSpecification}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitResourceSpecification(@NotNull Java8Parser.ResourceSpecificationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#formalParameterList}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitFormalParameterList(@NotNull Java8Parser.FormalParameterListContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#annotationTypeDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitAnnotationTypeDeclaration(@NotNull Java8Parser.AnnotationTypeDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#compilationUnit}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitCompilationUnit(@NotNull Java8Parser.CompilationUnitContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#annotationMethodRest}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitAnnotationMethodRest(@NotNull Java8Parser.AnnotationMethodRestContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#switchBlockStatementGroup}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitSwitchBlockStatementGroup(@NotNull Java8Parser.SwitchBlockStatementGroupContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#typeParameter}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitTypeParameter(@NotNull Java8Parser.TypeParameterContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#interfaceBody}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitInterfaceBody(@NotNull Java8Parser.InterfaceBodyContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#methodDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitMethodDeclaration(@NotNull Java8Parser.MethodDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#methodBody}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitMethodBody(@NotNull Java8Parser.MethodBodyContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#typeArgument}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitTypeArgument(@NotNull Java8Parser.TypeArgumentContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#typeDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitTypeDeclaration(@NotNull Java8Parser.TypeDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#genericConstructorDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitGenericConstructorDeclaration(@NotNull Java8Parser.GenericConstructorDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#classDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitClassDeclaration(@NotNull Java8Parser.ClassDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#enumConstant}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitEnumConstant(@NotNull Java8Parser.EnumConstantContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#statement}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitStatement(@NotNull Java8Parser.StatementContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#importDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitImportDeclaration(@NotNull Java8Parser.ImportDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#primitiveType}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitPrimitiveType(@NotNull Java8Parser.PrimitiveTypeContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#interfaceDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitInterfaceDeclaration(@NotNull Java8Parser.InterfaceDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#localVariableDeclarationStatement}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitLocalVariableDeclarationStatement(@NotNull Java8Parser.LocalVariableDeclarationStatementContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#blockStatement}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitBlockStatement(@NotNull Java8Parser.BlockStatementContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#fieldDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitFieldDeclaration(@NotNull Java8Parser.FieldDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#constantDeclarator}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitConstantDeclarator(@NotNull Java8Parser.ConstantDeclaratorContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#resources}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitResources(@NotNull Java8Parser.ResourcesContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#statementExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitStatementExpression(@NotNull Java8Parser.StatementExpressionContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#interfaceMethodDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitInterfaceMethodDeclaration(@NotNull Java8Parser.InterfaceMethodDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#packageDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitPackageDeclaration(@NotNull Java8Parser.PackageDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#elementValuePairs}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitElementValuePairs(@NotNull Java8Parser.ElementValuePairsContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#localVariableDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitLocalVariableDeclaration(@NotNull Java8Parser.LocalVariableDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#nonWildcardTypeArguments}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitNonWildcardTypeArguments(@NotNull Java8Parser.NonWildcardTypeArgumentsContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#interfaceMemberDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitInterfaceMemberDeclaration(@NotNull Java8Parser.InterfaceMemberDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#switchLabel}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitSwitchLabel(@NotNull Java8Parser.SwitchLabelContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#forInit}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitForInit(@NotNull Java8Parser.ForInitContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#formalParameters}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitFormalParameters(@NotNull Java8Parser.FormalParametersContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#arguments}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitArguments(@NotNull Java8Parser.ArgumentsContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#genericMethodDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitGenericMethodDeclaration(@NotNull Java8Parser.GenericMethodDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link Java8Parser#typeArgumentsOrDiamond}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitTypeArgumentsOrDiamond(@NotNull Java8Parser.TypeArgumentsOrDiamondContext ctx); -} \ No newline at end of file diff --git a/src/de/dhbwstuttgart/antlr/VisitorTest.java b/src/de/dhbwstuttgart/antlr/VisitorTest.java deleted file mode 100644 index 99dcd0e39..000000000 --- a/src/de/dhbwstuttgart/antlr/VisitorTest.java +++ /dev/null @@ -1,93 +0,0 @@ -package de.dhbwstuttgart.antlr; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import de.dhbwstuttgart.typeinference.Menge; - -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.tree.*; -import org.junit.Test; - -import de.dhbwstuttgart.antlr.Java8Parser.ClassDeclarationContext; -import de.dhbwstuttgart.antlr.Java8Parser.CompilationUnitContext; -import de.dhbwstuttgart.antlr.Java8Parser.TypeDeclarationContext; -import de.dhbwstuttgart.antlr.Java8Parser.TypeParameterContext; -import de.dhbwstuttgart.antlr.Java8Parser.TypeParametersContext; -import de.dhbwstuttgart.syntaxtree.GenericDeclarationList; -import de.dhbwstuttgart.syntaxtree.SourceFile; -import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; -import de.dhbwstuttgart.syntaxtree.Class; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; - - -public class VisitorTest { - - private final static String testFile = System.getProperty("user.dir")+"/test/parser/AntlrTest.jav"; - - @Test - public void test() throws IOException{ - - ANTLRInputStream input = new ANTLRInputStream(new FileInputStream(testFile)); - Java8Lexer lexer = new Java8Lexer(input); - CommonTokenStream tokens = new CommonTokenStream(lexer); - Java8Parser parser = new Java8Parser(tokens); - ParseTree tree = parser.compilationUnit(); // begin parsing at init rule - System.out.println(tree.toStringTree(parser)); // print LISP-style tree - //VISITOR: - EvalVisitor visitor = new EvalVisitor(); - SyntaxTreeNode sourceFile = visitor.visit(tree); - System.out.println(sourceFile); - // Create a generic parse tree walker that can trigger callbacks - // ParseTreeWalker walker = new ParseTreeWalker(); - } -} - -class EvalVisitor extends Java8BaseVisitor { - - @Override - public SyntaxTreeNode visitCompilationUnit(CompilationUnitContext ctx) { - Menge classDefinitions = new Menge<>(); - for(TypeDeclarationContext tDecl : ctx.typeDeclaration()){ - Class cl = (Class) visit(tDecl); - classDefinitions.add(cl); - } - - return new SourceFile(classDefinitions); - } - - @Override - public Class visitTypeDeclaration(TypeDeclarationContext ctx) { - Class ret = (Class) visit(ctx.classDeclaration()); - return ret; - } - - @Override - public Class visitClassDeclaration(ClassDeclarationContext ctx) { - String name = ctx.Identifier().getText(); - int offset = ctx.Identifier().getSymbol().getStartIndex(); - TypeParametersContext tpctx = ctx.typeParameters(); - GenericDeclarationList gtvList = (GenericDeclarationList) visit(tpctx); - - return new Class(name, offset); - } - - @Override - public GenericDeclarationList visitTypeParameters(TypeParametersContext ctx) { - Menge list = new Menge<>(); - int endOffset = 0; - for(TypeParameterContext tpctx : ctx.typeParameter()){ - tpctx.Identifier(); - } - GenericDeclarationList ret = new GenericDeclarationList(list, endOffset); - return ret; - } - - @Override - public GenericTypeVar visitTypeParameter(TypeParameterContext ctx) { - GenericTypeVar ret = null;//new GenericTypeVar(name, parent, offset); - return ret; - } - - -} diff --git a/src/de/dhbwstuttgart/antlr/makefile b/src/de/dhbwstuttgart/antlr/makefile deleted file mode 100644 index 0adefcb8b..000000000 --- a/src/de/dhbwstuttgart/antlr/makefile +++ /dev/null @@ -1,3 +0,0 @@ -all: - java -jar ./antlr-4.4-complete.jar -no-listener -visitor Java8.g4 - diff --git a/src/de/dhbwstuttgart/bytecode/Attribute.java b/src/de/dhbwstuttgart/bytecode/Attribute.java deleted file mode 100755 index a7e339720..000000000 --- a/src/de/dhbwstuttgart/bytecode/Attribute.java +++ /dev/null @@ -1,61 +0,0 @@ -// ino.module.Attribute.8529.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.Attribute.8529.import -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -// ino.end - - -import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.myexception.JVMCodeException; - -// ino.class.Attribute.21446.declaration -public abstract class Attribute implements ClassFileMember -// ino.end -// ino.class.Attribute.21446.body -{ - // ino.attribute.codegenlog.21449.decldescription type=line - // Logger fuer Code-Gen - // ino.end - // ino.attribute.codegenlog.21449.declaration - protected static Logger codegenlog = Logger.getLogger("codegen"); - // ino.end - - // ino.attribute.attribute_name_index.21452.declaration - private short attribute_name_index; - // ino.end - - // ino.method.get_attribute_name_index.21455.definition - public short get_attribute_name_index() - // ino.end - // ino.method.get_attribute_name_index.21455.body - { - return this.attribute_name_index; - } - // ino.end - - // ino.method.set_attribute_name_index.21458.definition - public void set_attribute_name_index(short t) - // ino.end - // ino.method.set_attribute_name_index.21458.body - { - this.attribute_name_index = t; - } - // ino.end - - // ino.method.codegen.21461.declaration - @Override - public abstract void codegen(ClassFile classfile, OutputStream f) - throws JVMCodeException, IOException; - // ino.end - - // ino.method.get_attributes_length.21464.declaration - public abstract int get_attributes_length(); - // ino.end - -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/AttributeInfo.java b/src/de/dhbwstuttgart/bytecode/AttributeInfo.java deleted file mode 100755 index 01b700c0e..000000000 --- a/src/de/dhbwstuttgart/bytecode/AttributeInfo.java +++ /dev/null @@ -1,91 +0,0 @@ -// ino.module.AttributeInfo.8530.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.AttributeInfo.8530.import -import java.io.FileOutputStream; -import java.io.OutputStream; -import java.lang.reflect.Array; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.myexception.JVMCodeException; - -// ino.class.AttributeInfo.21467.declaration -public class AttributeInfo extends Attribute -// ino.end -// ino.class.AttributeInfo.21467.body -{ - // ino.attribute.info.21471.declaration - private byte[] info = {}; - // ino.end - - // ino.method.get_info.21474.definition - public byte[] get_info() - // ino.end - // ino.method.get_info.21474.body - { - return this.info; - } - // ino.end - - // ino.method.get_info_Menge.21477.definition - public Menge get_info_Menge() - // ino.end - // ino.method.get_info_Menge.21477.body - { - Menge ret = new Menge(); - for (int i = 0; i < Array.getLength(info); i++) - ret.addElement(new Byte(info[i])); - return ret; - } - // ino.end - - // ino.method.get_attributes_length.21480.definition - public int get_attributes_length() - // ino.end - // ino.method.get_attributes_length.21480.body - { - return Array.getLength(info); - } - // ino.end - - // ino.method.set_info.21483.definition - public void set_info(byte[] t) - // ino.end - // ino.method.set_info.21483.body - { - this.info = t; - } - // ino.end - - // ino.method.set_info.21486.definition - public void set_info(Menge t) - // ino.end - // ino.method.set_info.21486.body - { - byte[] set = new byte[t.size()]; - for (int i = 0; i < t.size(); i++) - Array.setByte(set, i, ((Byte) t.elementAt(i)).byteValue()); - this.info = set; - } - // ino.end - - // ino.method.codegen.21489.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws JVMCodeException, java.io.IOException - // ino.end -// ino.method.codegen.21489.body -{ - - classfile.writeShort(f, get_attribute_name_index()); - classfile.writeInt(f, Array.getLength(info)); - if (info != null) classfile.writeByteArray(f, info); - - codegenlog.debug("Attribute_Name_Index= " + get_attribute_name_index() - + ", Length= " + Array.getLength(info) + " "); - } -// ino.end - -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/CONSTANT_Class_info.java b/src/de/dhbwstuttgart/bytecode/CONSTANT_Class_info.java deleted file mode 100755 index 046fbe93f..000000000 --- a/src/de/dhbwstuttgart/bytecode/CONSTANT_Class_info.java +++ /dev/null @@ -1,60 +0,0 @@ -// ino.module.CONSTANT_Class_info.8533.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.CONSTANT_Class_info.8533.import -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -// ino.end - -// ino.class.CONSTANT_Class_info.21763.declaration -public class CONSTANT_Class_info extends CPInfo -// ino.end -// ino.class.CONSTANT_Class_info.21763.body -{ - // ino.attribute.name_index.21767.declaration - private short name_index; - // ino.end - - // ino.method.get_name_index.21770.definition - public short get_name_index() - // ino.end - // ino.method.get_name_index.21770.body - { - return this.name_index; - } - // ino.end - - // ino.method.set_name_index.21773.definition - public void set_name_index(short i) - // ino.end - // ino.method.set_name_index.21773.body - { - this.name_index = i; - } - // ino.end - - // ino.method.codegen.21776.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws IOException - // ino.end - // ino.method.codegen.21776.body - { - classfile.writeByte(f, get_tag()); - classfile.writeShort(f, name_index); - } - // ino.end - - // ino.method.toString.21779.definition - public String toString() - // ino.end - // ino.method.toString.21779.body - { - return "ClassInfo: name_index=" + name_index; - } - // ino.end - -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/CONSTANT_Double_info.java b/src/de/dhbwstuttgart/bytecode/CONSTANT_Double_info.java deleted file mode 100755 index af632c3ab..000000000 --- a/src/de/dhbwstuttgart/bytecode/CONSTANT_Double_info.java +++ /dev/null @@ -1,71 +0,0 @@ -// ino.module.CONSTANT_Double_info.8534.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.CONSTANT_Double_info.8534.import -import java.io.FileOutputStream; -import java.io.IOException; -// ino.end -import java.io.OutputStream; - -// ino.class.CONSTANT_Double_info.21782.declaration -public class CONSTANT_Double_info extends CPInfo -// ino.end -// ino.class.CONSTANT_Double_info.21782.body -{ - // ino.attribute.high_bytes.21786.declaration - private int high_bytes; - // ino.end - // ino.attribute.low_bytes.21789.declaration - private int low_bytes; - // ino.end - - // ino.method.get_high_bytes.21792.definition - public int get_high_bytes() - // ino.end - // ino.method.get_high_bytes.21792.body - { return this.high_bytes; } - // ino.end - // ino.method.get_low_bytes.21795.definition - public int get_low_bytes() - // ino.end - // ino.method.get_low_bytes.21795.body - { return this.low_bytes; } - // ino.end - - // ino.method.set_high_bytes.21798.definition - public void set_high_bytes(int t) - // ino.end - // ino.method.set_high_bytes.21798.body - { this.high_bytes = t; } - // ino.end - // ino.method.set_low_bytes.21801.definition - public void set_low_bytes(int t) - // ino.end - // ino.method.set_low_bytes.21801.body - { this.low_bytes = t; } - // ino.end - - // ino.method.codegen.21804.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws IOException - // ino.end - // ino.method.codegen.21804.body - { - classfile.writeByte(f, get_tag()); - classfile.writeInt(f, high_bytes); - classfile.writeInt(f, low_bytes); - } - // ino.end - - // ino.method.toString.21807.definition - public String toString() - // ino.end - // ino.method.toString.21807.body - { - return "Double_Info: high_bytes=" + high_bytes + ", low_bytes=" + low_bytes; - } - // ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/CONSTANT_Fieldref_info.java b/src/de/dhbwstuttgart/bytecode/CONSTANT_Fieldref_info.java deleted file mode 100755 index 0f82f3a30..000000000 --- a/src/de/dhbwstuttgart/bytecode/CONSTANT_Fieldref_info.java +++ /dev/null @@ -1,83 +0,0 @@ -// ino.module.CONSTANT_Fieldref_info.8535.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.CONSTANT_Fieldref_info.8535.import -import java.io.FileOutputStream; -import java.io.IOException; -// ino.end -import java.io.OutputStream; - -// ino.class.CONSTANT_Fieldref_info.21810.declaration -public class CONSTANT_Fieldref_info extends CPInfo -// ino.end -// ino.class.CONSTANT_Fieldref_info.21810.body -{ - // ino.attribute.class_index.21814.declaration - private short class_index; - // ino.end - - // ino.attribute.name_and_type_index.21817.declaration - private short name_and_type_index; - // ino.end - - // ino.method.get_class_index.21820.definition - public short get_class_index() - // ino.end - // ino.method.get_class_index.21820.body - { - return this.class_index; - } - // ino.end - - // ino.method.get_name_and_type_index.21823.definition - public short get_name_and_type_index() - // ino.end - // ino.method.get_name_and_type_index.21823.body - { - return this.name_and_type_index; - } - // ino.end - - // ino.method.set_class_index.21826.definition - public void set_class_index(short i) - // ino.end - // ino.method.set_class_index.21826.body - { - this.class_index = i; - } - // ino.end - - // ino.method.set_name_and_type_index.21829.definition - public void set_name_and_type_index(short i) - // ino.end - // ino.method.set_name_and_type_index.21829.body - { - this.name_and_type_index = i; - } - // ino.end - - // ino.method.codegen.21832.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws IOException - // ino.end - // ino.method.codegen.21832.body - { - classfile.writeByte(f, get_tag()); - classfile.writeShort(f, class_index); - classfile.writeShort(f, name_and_type_index); - } - // ino.end - - // ino.method.toString.21835.definition - public String toString() - // ino.end - // ino.method.toString.21835.body - { - return "Fieldref_info: Class_index="+ class_index - + ", Name_and_type_index=" + name_and_type_index; - } - // ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/CONSTANT_Float_info.java b/src/de/dhbwstuttgart/bytecode/CONSTANT_Float_info.java deleted file mode 100755 index 4a7e8582a..000000000 --- a/src/de/dhbwstuttgart/bytecode/CONSTANT_Float_info.java +++ /dev/null @@ -1,52 +0,0 @@ -// ino.module.CONSTANT_Float_info.8536.package -package de.dhbwstuttgart.bytecode; -// ino.end -// ino.module.CONSTANT_Float_info.8536.import -import java.io.IOException; -// ino.end -import java.io.OutputStream; - -// ino.class.CONSTANT_Float_info.21838.declaration -public class CONSTANT_Float_info extends CPInfo -// ino.end -// ino.class.CONSTANT_Float_info.21838.body -{ - // ino.attribute.bytes.21842.declaration - private int bytes; - // ino.end - - // ino.method.get_bytes.21845.definition - public int get_bytes() - // ino.end - // ino.method.get_bytes.21845.body - { return this.bytes; } - // ino.end - // ino.method.set_bytes.21848.definition - public void set_bytes(int t) - // ino.end - // ino.method.set_bytes.21848.body - { this.bytes = t; } - // ino.end - - // ino.method.codegen.21851.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws IOException - // ino.end - // ino.method.codegen.21851.body - { - classfile.writeByte(f, get_tag()); - classfile.writeInt(f, bytes); - } - // ino.end - - // ino.method.toString.21854.definition - public String toString() - // ino.end - // ino.method.toString.21854.body - { - return "Float_Info: size=" + bytes; - } - // ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/CONSTANT_Integer_info.java b/src/de/dhbwstuttgart/bytecode/CONSTANT_Integer_info.java deleted file mode 100755 index 1747ab73b..000000000 --- a/src/de/dhbwstuttgart/bytecode/CONSTANT_Integer_info.java +++ /dev/null @@ -1,56 +0,0 @@ -// ino.module.CONSTANT_Integer_info.8537.package -package de.dhbwstuttgart.bytecode; -// ino.end -// ino.module.CONSTANT_Integer_info.8537.import -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -// ino.end - - - - -// ino.class.CONSTANT_Integer_info.21857.declaration -public class CONSTANT_Integer_info extends CPInfo -// ino.end -// ino.class.CONSTANT_Integer_info.21857.body -{ - // ino.attribute.bytes.21861.declaration - private int bytes; - // ino.end - - // ino.method.get_bytes.21864.definition - public int get_bytes() - // ino.end - // ino.method.get_bytes.21864.body - { return this.bytes; } - // ino.end - // ino.method.set_bytes.21867.definition - public void set_bytes(int t) - // ino.end - // ino.method.set_bytes.21867.body - { this.bytes = t; } - // ino.end - - // ino.method.codegen.21870.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws IOException - // ino.end - // ino.method.codegen.21870.body - { - classfile.writeByte(f, get_tag()); - classfile.writeInt(f, bytes); - } - // ino.end - - // ino.method.toString.21873.definition - public String toString() - // ino.end - // ino.method.toString.21873.body - { - return "Integer_Info: bytes=" + bytes; - } - // ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/CONSTANT_InterfaceMethodref_info.java b/src/de/dhbwstuttgart/bytecode/CONSTANT_InterfaceMethodref_info.java deleted file mode 100755 index 70555a58a..000000000 --- a/src/de/dhbwstuttgart/bytecode/CONSTANT_InterfaceMethodref_info.java +++ /dev/null @@ -1,84 +0,0 @@ -// ino.module.CONSTANT_InterfaceMethodref_info.8538.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.CONSTANT_InterfaceMethodref_info.8538.import -import java.io.FileOutputStream; -import java.io.IOException; -// ino.end -import java.io.OutputStream; - -// ino.class.CONSTANT_InterfaceMethodref_info.21876.declaration -public class CONSTANT_InterfaceMethodref_info extends CPInfo -// ino.end -// ino.class.CONSTANT_InterfaceMethodref_info.21876.body -{ - // ino.attribute.class_index.21880.declaration - private short class_index; - // ino.end - - // ino.attribute.name_and_type_index.21883.declaration - private short name_and_type_index; - // ino.end - - // ino.method.get_class_index.21886.definition - public short get_class_index() - // ino.end - // ino.method.get_class_index.21886.body - { - return this.class_index; - } - // ino.end - - // ino.method.get_name_and_type_index.21889.definition - public short get_name_and_type_index() - // ino.end - // ino.method.get_name_and_type_index.21889.body - { - return this.name_and_type_index; - } - // ino.end - - // ino.method.set_class_index.21892.definition - public void set_class_index(short t) - // ino.end - // ino.method.set_class_index.21892.body - { - this.class_index = t; - } - // ino.end - - // ino.method.set_name_and_type_index.21895.definition - public void set_name_and_type_index(short t) - // ino.end - // ino.method.set_name_and_type_index.21895.body - { - this.name_and_type_index = t; - } - // ino.end - - // ino.method.codegen.21898.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws IOException - // ino.end - // ino.method.codegen.21898.body - { - classfile.writeByte(f, get_tag()); - classfile.writeShort(f, class_index); - classfile.writeShort(f, name_and_type_index); - } - // ino.end - - @Override - // ino.method.toString.21901.definition - public String toString() - // ino.end - // ino.method.toString.21901.body - { - return "InterfaceMethodRef_info: class_index=" + class_index - + ", name_and_type_index=" + name_and_type_index; - } - // ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/CONSTANT_Long_info.java b/src/de/dhbwstuttgart/bytecode/CONSTANT_Long_info.java deleted file mode 100755 index 493529287..000000000 --- a/src/de/dhbwstuttgart/bytecode/CONSTANT_Long_info.java +++ /dev/null @@ -1,83 +0,0 @@ -// ino.module.CONSTANT_Long_info.8539.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.CONSTANT_Long_info.8539.import -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -// ino.end - -// ino.class.CONSTANT_Long_info.21904.declaration -public class CONSTANT_Long_info extends CPInfo -// ino.end -// ino.class.CONSTANT_Long_info.21904.body -{ - // ino.attribute.high_bytes.21908.declaration - private int high_bytes; - // ino.end - - // ino.attribute.low_bytes.21911.declaration - private int low_bytes; - // ino.end - - // ino.method.get_high_bytes.21914.definition - public int get_high_bytes() - // ino.end - // ino.method.get_high_bytes.21914.body - { - return this.high_bytes; - } - // ino.end - - // ino.method.get_low_bytes.21917.definition - public int get_low_bytes() - // ino.end - // ino.method.get_low_bytes.21917.body - { - return this.low_bytes; - } - // ino.end - - // ino.method.set_high_bytes.21920.definition - public void set_high_bytes(int t) - // ino.end - // ino.method.set_high_bytes.21920.body - { - this.high_bytes = t; - } - // ino.end - - // ino.method.set_low_bytes.21923.definition - public void set_low_bytes(int t) - // ino.end - // ino.method.set_low_bytes.21923.body - { - this.low_bytes = t; - } - // ino.end - - // ino.method.codegen.21926.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws IOException - // ino.end - // ino.method.codegen.21926.body - { - classfile.writeByte(f, get_tag()); - classfile.writeInt(f, high_bytes); - classfile.writeInt(f, low_bytes); - } - // ino.end - - // ino.method.toString.21929.definition - public String toString() - // ino.end - // ino.method.toString.21929.body - { - return "Long_Info: high_bytes=" + high_bytes - + ", low_bytes=" + low_bytes; - } - // ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/CONSTANT_Methodref_info.java b/src/de/dhbwstuttgart/bytecode/CONSTANT_Methodref_info.java deleted file mode 100755 index b1b261640..000000000 --- a/src/de/dhbwstuttgart/bytecode/CONSTANT_Methodref_info.java +++ /dev/null @@ -1,83 +0,0 @@ -// ino.module.CONSTANT_Methodref_info.8540.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.CONSTANT_Methodref_info.8540.import -import java.io.FileOutputStream; -import java.io.IOException; -// ino.end -import java.io.OutputStream; - -// ino.class.CONSTANT_Methodref_info.21932.declaration -public class CONSTANT_Methodref_info extends CPInfo -// ino.end -// ino.class.CONSTANT_Methodref_info.21932.body -{ - // ino.attribute.class_index.21936.declaration - private short class_index; - // ino.end - - // ino.attribute.name_and_type_index.21939.declaration - private short name_and_type_index; - // ino.end - - // ino.method.get_class_index.21942.definition - public short get_class_index() - // ino.end - // ino.method.get_class_index.21942.body - { - return this.class_index; - } - // ino.end - - // ino.method.get_name_and_type_index.21945.definition - public short get_name_and_type_index() - // ino.end - // ino.method.get_name_and_type_index.21945.body - { - return this.name_and_type_index; - } - // ino.end - - // ino.method.set_class_index.21948.definition - public void set_class_index(short t) - // ino.end - // ino.method.set_class_index.21948.body - { - this.class_index = t; - } - // ino.end - - // ino.method.set_name_and_type_index.21951.definition - public void set_name_and_type_index(short t) - // ino.end - // ino.method.set_name_and_type_index.21951.body - { - this.name_and_type_index = t; - } - // ino.end - - // ino.method.codegen.21954.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws IOException - // ino.end - // ino.method.codegen.21954.body - { - classfile.writeByte(f, get_tag()); - classfile.writeShort(f, class_index); - classfile.writeShort(f, name_and_type_index); - } - // ino.end - - // ino.method.toString.21957.definition - public String toString() - // ino.end - // ino.method.toString.21957.body - { - return "MethodRef_Info: class_index=" + class_index - + ", name_and_type_index=" + name_and_type_index; - } - // ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/CONSTANT_NameAndType_info.java b/src/de/dhbwstuttgart/bytecode/CONSTANT_NameAndType_info.java deleted file mode 100755 index d91151670..000000000 --- a/src/de/dhbwstuttgart/bytecode/CONSTANT_NameAndType_info.java +++ /dev/null @@ -1,83 +0,0 @@ -// ino.module.CONSTANT_NameAndType_info.8541.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.CONSTANT_NameAndType_info.8541.import -import java.io.FileOutputStream; -import java.io.IOException; -// ino.end -import java.io.OutputStream; - -// ino.class.CONSTANT_NameAndType_info.21960.declaration -public class CONSTANT_NameAndType_info extends CPInfo -// ino.end -// ino.class.CONSTANT_NameAndType_info.21960.body -{ - // ino.attribute.name_index.21964.declaration - private short name_index; - // ino.end - - // ino.attribute.descriptor_index.21967.declaration - private short descriptor_index; - // ino.end - - // ino.method.get_name_index.21970.definition - public short get_name_index() - // ino.end - // ino.method.get_name_index.21970.body - { - return this.name_index; - } - // ino.end - - // ino.method.get_descriptor_index.21973.definition - public short get_descriptor_index() - // ino.end - // ino.method.get_descriptor_index.21973.body - { - return this.descriptor_index; - } - // ino.end - - // ino.method.set_name_index.21976.definition - public void set_name_index(short t) - // ino.end - // ino.method.set_name_index.21976.body - { - this.name_index = t; - } - // ino.end - - // ino.method.set_descriptor_index.21979.definition - public void set_descriptor_index(short t) - // ino.end - // ino.method.set_descriptor_index.21979.body - { - this.descriptor_index = t; - } - // ino.end - - // ino.method.codegen.21982.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws IOException - // ino.end - // ino.method.codegen.21982.body - { - classfile.writeByte(f, get_tag()); - classfile.writeShort(f, name_index); - classfile.writeShort(f, descriptor_index); - } - // ino.end - - // ino.method.toString.21985.definition - public String toString() - // ino.end - // ino.method.toString.21985.body - { - return "NameAndType_Info: name_index=" + name_index - + ", descriptor_index=" + descriptor_index; - } - // ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/CONSTANT_String_info.java b/src/de/dhbwstuttgart/bytecode/CONSTANT_String_info.java deleted file mode 100755 index 4d1c70462..000000000 --- a/src/de/dhbwstuttgart/bytecode/CONSTANT_String_info.java +++ /dev/null @@ -1,59 +0,0 @@ -// ino.module.CONSTANT_String_info.8542.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.CONSTANT_String_info.8542.import -import java.io.FileOutputStream; -import java.io.IOException; -// ino.end -import java.io.OutputStream; - -// ino.class.CONSTANT_String_info.21988.declaration -public class CONSTANT_String_info extends CPInfo -// ino.end -// ino.class.CONSTANT_String_info.21988.body -{ - // ino.attribute.string_index.21992.declaration - private short string_index; - // ino.end - - // ino.method.get_string_index.21995.definition - public short get_string_index() - // ino.end - // ino.method.get_string_index.21995.body - { - return this.string_index; - } - // ino.end - - // ino.method.set_string_index.21998.definition - public void set_string_index(short t) - // ino.end - // ino.method.set_string_index.21998.body - { - this.string_index = t; - } - // ino.end - - // ino.method.codegen.22001.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws IOException - // ino.end - // ino.method.codegen.22001.body - { - classfile.writeByte(f, get_tag()); - classfile.writeShort(f, string_index); - } - // ino.end - - // ino.method.toString.22004.definition - public String toString() - // ino.end - // ino.method.toString.22004.body - { - return "StringInfo: string_index="+ string_index; - } - // ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/CONSTANT_Utf8_info.java b/src/de/dhbwstuttgart/bytecode/CONSTANT_Utf8_info.java deleted file mode 100755 index df9d2ef2b..000000000 --- a/src/de/dhbwstuttgart/bytecode/CONSTANT_Utf8_info.java +++ /dev/null @@ -1,65 +0,0 @@ -// ino.module.CONSTANT_Utf8_info.8543.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.CONSTANT_Utf8_info.8543.import -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.lang.reflect.Array; -// ino.end - -// ino.class.CONSTANT_Utf8_info.22007.declaration -public class CONSTANT_Utf8_info extends CPInfo -// ino.end -// ino.class.CONSTANT_Utf8_info.22007.body -{ - // ino.attribute.bytes.22011.declaration - private byte[] bytes; - // ino.end - - // ino.method.get_bytes.22014.definition - public byte[] get_bytes() - // ino.end - // ino.method.get_bytes.22014.body - { - return this.bytes; - } - // ino.end - - // ino.method.set_bytes.22017.definition - public void set_bytes(byte[] t) - // ino.end - // ino.method.set_bytes.22017.body - { - this.bytes = t; - } - // ino.end - - // ino.method.codegen.22020.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws IOException - // ino.end - // ino.method.codegen.22020.body - { - classfile.writeByte(f, get_tag()); - classfile.writeShort(f, (short) Array.getLength(bytes)); - if (bytes != null) classfile.writeByteArray(f, bytes); - - } - // ino.end - - // ino.method.toString.22023.definition - public String toString() - // ino.end - // ino.method.toString.22023.body - { - if (bytes == null) - return "UTF-8 Konstante: size="+ Array.getLength(bytes) ; - else - return "UTF-8 Konstante: " + new String(bytes); - } - // ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/CPInfo.java b/src/de/dhbwstuttgart/bytecode/CPInfo.java deleted file mode 100755 index 425011a2b..000000000 --- a/src/de/dhbwstuttgart/bytecode/CPInfo.java +++ /dev/null @@ -1,58 +0,0 @@ -// ino.module.CPInfo.8544.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.CPInfo.8544.import -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -import de.dhbwstuttgart.logger.Logger; - -// ino.end - -// ino.class.CPInfo.22026.declaration -public abstract class CPInfo implements ClassFileMember -// ino.end -// ino.class.CPInfo.22026.body -{ - // ino.attribute.codegenlog.22029.decldescription type=line - // Logger fuer Code-Gen - // ino.end - // ino.attribute.codegenlog.22029.declaration - protected static Logger codegenlog = Logger.getLogger("codegen"); - // ino.end - - // ino.attribute.tag.22032.declaration - private byte tag; - // ino.end - - // ino.method.get_tag.22035.definition - public byte get_tag() - // ino.end - // ino.method.get_tag.22035.body - { - return this.tag; - } - // ino.end - - // ino.method.set_tag.22038.definition - public void set_tag(byte t) - // ino.end - // ino.method.set_tag.22038.body - { - this.tag = t; - } - // ino.end - - // ino.method.codegen.22041.declaration - @Override - public abstract void codegen(ClassFile classfile, OutputStream f) - throws IOException; - // ino.end - - // ino.method.toString.22044.declaration - public abstract String toString(); - // ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/ClassFile.java b/src/de/dhbwstuttgart/bytecode/ClassFile.java deleted file mode 100755 index 2ace94621..000000000 --- a/src/de/dhbwstuttgart/bytecode/ClassFile.java +++ /dev/null @@ -1,862 +0,0 @@ -//key_Menge funktioniert nicht PL 14-03-21 -//muss angeschaut werden - - -// ino.module.ClassFile.8531.package -package de.dhbwstuttgart.bytecode; -// ino.end -// ino.module.ClassFile.8531.import -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.lang.reflect.Array; -import de.dhbwstuttgart.typeinference.Menge; -// ino.end - - - - - - - - - -import de.dhbwstuttgart.core.MyCompiler; -import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.myexception.JVMCodeException; -import de.dhbwstuttgart.syntaxtree.Interface; -import de.dhbwstuttgart.syntaxtree.ParameterList; -import de.dhbwstuttgart.syntaxtree.SourceFile; -import de.dhbwstuttgart.syntaxtree.misc.UsedId; -import de.dhbwstuttgart.syntaxtree.statement.Assign; -import de.dhbwstuttgart.syntaxtree.statement.Block; -import de.dhbwstuttgart.syntaxtree.type.Type; - - -// ino.class.ClassFile.21492.description type=javadoc -/** - * Darstellung einer Klassendatei aus Sicht fuer die JVM. - * Generiert bei der Bytegenerierung Header, Constantenpool, usw. - * - * @author hama, scju - * - */ -// ino.end -// ino.class.ClassFile.21492.declaration -public class ClassFile -// ino.end -// ino.class.ClassFile.21492.body -{ - public boolean hamaAload0 = false; //hama: f�gt in Konstruktor und set Methode ein aload_0 ein wird f�r StoreSomethingParmCon ben�tigt - - // ino.attribute.codegenlog.21495.decldescription type=line - // Logger fuer Code-Gen - // ino.end - // ino.attribute.codegenlog.21495.declaration - protected static Logger codegenlog = Logger.getLogger("codegen"); - // ino.end - - // ino.attribute.magic.21498.decldescription type=line - // Header fuer Java Version 1.5.0_05 - // ino.end - // ino.attribute.magic.21498.declaration - private static int magic = 0xcafebabe; - // ino.end - // ino.attribute.minor_version.21501.declaration - public static short minor_version = 0; - // ino.end - // ino.attribute.major_version.21504.declaration - public static short major_version = 0x31; - // ino.end - - // ino.attribute.constant_pool.21507.declaration - private Menge constant_pool = new Menge(); - // ino.end - // ino.attribute.access_flags.21510.declaration - private short access_flags; - // ino.end - // ino.attribute.this_class.21513.declaration - private short this_class; - // ino.end - // ino.attribute.super_class.21516.declaration - private short super_class; - // ino.end - // ino.attribute.fields.21519.declaration - private Menge fields = new Menge(); - // ino.end - // ino.attribute.methods.21522.declaration - private Menge methods = new Menge(); - // ino.end - // ino.attribute.attributes.21525.declaration - private Menge attributes = new Menge(); - // ino.end - // ino.attribute.interfaces.21528.declaration - private Menge interfaces = new Menge(); - // ino.end - // ino.attribute.key_Menge.21531.declaration - private Menge key_Menge = new Menge(); - // ino.end - // ino.attribute.class_block.21534.declaration - private Menge class_block = new Menge(); - // ino.end - // ino.attribute.class_name.21537.declaration - private String class_name = new String("OUTPUT");//DEFAULTWERT PL 14-03-21 eingefuegt - // ino.end - // ino.attribute.super_class_name.21540.declaration - private String super_class_name = new String(); - // ino.end - // ino.attribute.constructor_founded.21543.declaration - private boolean constructor_founded = false; - // ino.end - - // ino.attribute.ConstantValueID.21546.decldescription type=line - // Wird fuer Konstante benoetigt (UTF-8 Eintrag mit - // "ConstantValue"), lediglich ein Mal pro Klasse - // ino.end - // ino.attribute.ConstantValueID.21546.declaration - private short ConstantValueID = 0; - // ino.end - - // ino.attribute.SignatureID.21549.decldescription type=line - // Wird fuer Signaturen (Generics) benoetigt - // Wiederrum nur ein UTF-8 Eintrag in der - // Konstantentabelle ("Signature") - // ino.end - // ino.attribute.SignatureID.21549.declaration - private short SignatureID = 0; - // ino.end - - - // ino.method.ClassFile.21552.defdescription type=javadoc - /** - * Default Konstruktor - */ - // ino.end - // ino.method.ClassFile.21552.definition - public ClassFile() - // ino.end - // ino.method.ClassFile.21552.body - { - - } - // ino.end - - // ino.method.ClassFile.21555.defdescription type=javadoc - /** - * Konstruktor, um Klasseninfos direkt aus dem Interface zu laden - */ - // ino.end - // ino.method.ClassFile.21555.definition - public ClassFile(Interface ic, SourceFile sf) - // ino.end - // ino.method.ClassFile.21555.body - { - // Modifier wird auf den Wert 0x601 festgelegt (INTERFACE+ABSTRACT+PUBLIC) - // Andere Werte machen hier keinen Sinn! - String pkgName = ""; - - if (sf.getPackageName() != null) { - pkgName = sf.getPackageName().get_codegen_UsedId() + "/"; - } - - this.add_interface(ic.getName(), pkgName, "java/lang/Object", (short) 0x601); - } - // ino.end - - // ino.method.add_CONSTANT_Utf8_info.21558.definition - public int add_CONSTANT_Utf8_info(String name) - // ino.end - // ino.method.add_CONSTANT_Utf8_info.21558.body - { - Key utf8_key = new Key(JVMCode.CONSTANT_Utf8, name); - if(!this.key_Menge.contains(utf8_key)) { - CONSTANT_Utf8_info utf8_info = new CONSTANT_Utf8_info(); - utf8_info.set_tag(JVMCode.CONSTANT_Utf8); - utf8_info.set_bytes(name.getBytes()); - this.key_Menge.addElement(utf8_key); - this.constant_pool.addElement(utf8_info); - } - return (this.key_Menge.indexOf(utf8_key)+1); - } - // ino.end - - // ino.method.add_CONSTANT_Class_info.21561.definition - public int add_CONSTANT_Class_info(String name) - // ino.end - // ino.method.add_CONSTANT_Class_info.21561.body - { - Key class_key = new Key(JVMCode.CONSTANT_Class, name); - if(!this.key_Menge.contains(class_key)) { - CONSTANT_Class_info class_info = new CONSTANT_Class_info(); - class_info.set_tag(JVMCode.CONSTANT_Class); - class_info.set_name_index((short)this.add_CONSTANT_Utf8_info(name)); - this.key_Menge.addElement(class_key); - this.constant_pool.addElement(class_info); - } - return (this.key_Menge.indexOf(class_key)+1); - } - // ino.end - - // ino.method.add_CONSTANT_NameAndType_info.21564.definition - public int add_CONSTANT_NameAndType_info(String name, String param_type) - // ino.end - // ino.method.add_CONSTANT_NameAndType_info.21564.body - { - Key name_type_key = new Key(JVMCode.CONSTANT_NameAndType, name + param_type); - if(!this.key_Menge.contains(name_type_key)) - { - CONSTANT_NameAndType_info name_type = new CONSTANT_NameAndType_info(); - name_type.set_tag(JVMCode.CONSTANT_NameAndType); - name_type.set_name_index((short)this.add_CONSTANT_Utf8_info(name)); - name_type.set_descriptor_index((short)this.add_CONSTANT_Utf8_info(param_type)); - this.key_Menge.addElement(name_type_key); - this.constant_pool.addElement(name_type); - } - return this.key_Menge.indexOf(name_type_key) + 1; - } - // ino.end - - // ino.method.add_CONSTANT_Integer_info.21567.definition - public int add_CONSTANT_Integer_info(int i) - // ino.end - // ino.method.add_CONSTANT_Integer_info.21567.body - { - Key key = new Key(JVMCode.CONSTANT_Integer, "" + i); - if(!this.key_Menge.contains(key)) { - CONSTANT_Integer_info info = new CONSTANT_Integer_info(); - info.set_tag(JVMCode.CONSTANT_Integer); - info.set_bytes(i); - this.key_Menge.addElement(key); - this.constant_pool.addElement(info); - } - return (this.key_Menge.indexOf(key)+1); - } - // ino.end - - // ino.method.add_CONSTANT_String_info.21570.definition - public int add_CONSTANT_String_info(String s) - // ino.end - // ino.method.add_CONSTANT_String_info.21570.body - { - Key key = new Key(JVMCode.CONSTANT_String, s); - if(!this.key_Menge.contains(key)) { - CONSTANT_String_info info = new CONSTANT_String_info(); - info.set_tag(JVMCode.CONSTANT_String); - info.set_string_index((short)this.add_CONSTANT_Utf8_info(s)); - this.key_Menge.addElement(key); - this.constant_pool.addElement(info); - } - return (this.key_Menge.indexOf(key)+1); - } - // ino.end - - // ino.method.add_class.21573.defdescription type=javadoc - /** - * Fuegt Informationen ueber eine neue Klasse ein. Gleichzeitig - * wird ein Default-Konstruktor angelegt. - */ - // ino.end - // ino.method.add_class.21573.definition - public void add_class(String name, String pkgName, String super_name, short acc_flag) - // ino.end - // ino.method.add_class.21573.body - { - codegenlog.debug("Klasse hinzugefuegt: " + name + ", Package: " + pkgName - + ", Superklasse: " + super_name + ", Accessflags: " + acc_flag); - addClassInfo(name, pkgName, super_name, acc_flag); - this.add_method_ref(super_name, "", "()V"); - } - // ino.end - - // ino.method.add_interface.21576.defdescription type=javadoc - /** - * Fuegt Informationen ueber ein neues Interface ein. - */ - // ino.end - // ino.method.add_interface.21576.definition - public void add_interface(String name, String pkgName, String super_name, short acc_flag) - // ino.end - // ino.method.add_interface.21576.body - { - codegenlog.debug("Interface hinzugefuegt: " + name + ", Package: " + pkgName - + ", Superklasse: " + super_name + ", Accessflags: " + acc_flag); - addClassInfo(name, pkgName, super_name, acc_flag); - } - // ino.end - - // ino.method.addClassInfo.21579.defdescription type=javadoc - /** - * Fuegt Informationen ueber Access-Flags, Superklasse usw. ein - */ - // ino.end - // ino.method.addClassInfo.21579.definition - private void addClassInfo(String name, String pkgName, String super_name, short acc_flag) - // ino.end - // ino.method.addClassInfo.21579.body - { - //feda 15.05.2007 - //Eine Klasse hat immer den Access Modifier Super 0x0020 - short tempAcc_super = 32; - acc_flag +=tempAcc_super; - - access_flags = acc_flag; - class_name = name; - super_class_name = super_name; - this.this_class = (short)add_CONSTANT_Class_info(pkgName+name); - this.super_class = (short)add_CONSTANT_Class_info(super_name); - } - // ino.end - - // ino.method.addSuperInterfaces.21582.defdescription type=javadoc - /** - * Fuegt die erweiterten (bei Interfaces) implementierten (bei Klassen) - * Interfaces ein. - */ - // ino.end - // ino.method.addSuperInterfaces.21582.definition - public void addSuperInterfaces(Menge superif) - // ino.end - // ino.method.addSuperInterfaces.21582.body - { - if (superif == null) return; - - for (int i=0; i< superif.size(); i++) { - UsedId uid = superif.elementAt(i); - - interfaces.addElement((short) add_CONSTANT_Class_info(uid.get_codegen_UsedId())); - } - } - // ino.end - - // ino.method.addGenerics.21585.defdescription type=javadoc - /** - * Fuegt ggf. Generics in den Klassendefintion selbst - * hinzu. - */ - // ino.end - // ino.method.addGenerics.21585.definition - public void addGenerics(Menge para, UsedId superClass, Menge superIf) - // ino.end - // ino.method.addGenerics.21585.body - { - if (para == null || para.size() == 0) return; - - SignatureInfo si = new SignatureInfo(para, superClass, superIf, this); - - attributes.addElement(si); - - } - // ino.end - - - // ino.method.add_method.21588.definition - public void add_method(String name, String param_type, ParameterList param, - Type type, Block block, short acc_flag, Menge paralist, boolean isAbstract) - throws JVMCodeException - // ino.end - // ino.method.add_method.21588.body - { - Menge method_attributes = new Menge(); - - - - // Sofern eine Signatur (Generic) in der Beschreibung der Methode vorkommt, - // Signatur generieren. - if(SignatureInfo.needsSignature( param, type)) - method_attributes.addElement(new SignatureInfo(param, type, this)); - - - codegenlog.debug("Methode hinzugefuegt: " + name + ", Parameter-Typ: " + param_type - + ", Accessflags: " + acc_flag); - - - CodeAttribute code = new CodeAttribute(class_name, acc_flag); - code.set_attribute_name_index((short)this.add_CONSTANT_Utf8_info("Code")); - if(name.equals("")) - { - code.add_code(JVMCode.aload_0); - code.add_code(JVMCode.invokespecial); - //hama: habe die obere original Zeile auskommentiert. - //Ich bekomme mit der obigen Zeile ein Fehler in der Verlinkung des - //ConstantPool (mit der unteren Zeile nicht) - //code.add_code_short(this.add_method_ref(super_class_name, name, param_type)); - code.add_code_short(this.add_method_ref(super_class_name, name, "()V")); - for(int i = 0; i < class_block.size(); i++) - { - class_block.elementAt(i).codegen(this, code, paralist); - } - if(param != null) param.codegen(this, code); - //hama: in dem Use Case StoreSomething wird vom Compiler ein - //aload_0 zuwening im Konstruktor erzeugt. Deshalb schreibe ich - //es hier hard rein. - //Test Workaround: Das eigentliche Problem: "Warum fehlt das aload_0" ist - //noch nicht behoben. Au�erdem stimmt das hier nur f�r den einen Use Case - //in allen anderen F�llen wird f�lschlicher Weise das aload_0 einef�gt. - if(this.hamaAload0 == true) - { - byte b2 = 42; - Byte b1 = new Byte(b2); - code.add_code(b1); - - codegenlog.warn("hama: Class ClassFile: !!!!!!!!!!!!!!!!!!!!ACHTUNG experimentell aload_0 in Konstrukor eingef�gt!!!"); - } - //hama: bis hier experimentell - if(block != null) - { - block.codegen(this, code, paralist); - } - code.add_code(JVMCode.return_); - } - else - { - if(param != null) - { - param.codegen(this, code); - } - //hama: in dem Use Case StoreSomething wird vom Compiler ein - //aload_0 zuwening in der set Methode erzeugt. Deshalb schreibe ich - //es hier hard rein. - //Test Workaround: Das eigentliche Problem: "Warum fehlt das aload_0" ist - //noch nicht behoben. Au�erdem stimmt das hier nur f�r den einen Use Case - //in allen anderen F�llen einer Set Methode wird f�lschlicher Weise das - //aload_0 einef�gt. - if(this.hamaAload0 == true) - { - if(name.equals("set")) - { - byte b2 = 42; - Byte b1 = new Byte(b2); - code.add_code(b1); - - codegenlog.warn("hama: Class ClassFile: !!!!!!!!!!!!!!!!!!!!ACHTUNG experimentell aload_0 in die set Methode eingef�gt!!!"); - } - } - //hama: bis hier experimentell. - if(block != null) - { - block.codegen(this, code, paralist); - } - if(type != null && type.getName().equals("void")) - { - code.add_code(JVMCode.return_); - } - } - - // Code nur hinzufuegen, wenn nicht abstract (Interface!) - if (!isAbstract) method_attributes.addElement(code); - - // Methodeninformationen zusammenstellen - MethodInfo method = new MethodInfo(); - - //feda Accessflag muss beim 1 = Public sein. - if(name.equals("")) - { - acc_flag = 1; - } - method.set_access_flags(acc_flag); - method.set_name_index((short)add_CONSTANT_Utf8_info(name)); - method.set_descriptor_index((short)add_CONSTANT_Utf8_info(param_type)); - method.set_attributes(method_attributes); - - if(!this.methods.contains(method)) - { - methods.addElement(method); - } - } - // ino.end - - - - // ino.method.add_method_ref.21591.definition - public int add_method_ref(String cl_name, String name, String param_type) - // ino.end - // ino.method.add_method_ref.21591.body - { - - // Bei fully qualified names wichtig! - if (cl_name.contains(".")) cl_name = cl_name.replace(".", "/"); - - - codegenlog.debug("Methodenreferenz hinzugefuegt: " + name + ", Klasse: " + cl_name - + ", Paramter-Typ: " + param_type); - Key methodref_key = new Key(JVMCode.CONSTANT_Methodref, cl_name + name + param_type); - if(!this.key_Menge.contains(methodref_key)) - { - CONSTANT_Methodref_info methodref = new CONSTANT_Methodref_info(); - methodref.set_tag(JVMCode.CONSTANT_Methodref); - methodref.set_class_index((short)this.add_CONSTANT_Class_info(cl_name)); - methodref.set_name_and_type_index((short)this.add_CONSTANT_NameAndType_info(name, param_type)); - this.key_Menge.addElement(methodref_key); - this.constant_pool.addElement(methodref); - } - return this.key_Menge.indexOf(methodref_key)+1; - } - // ino.end - - // ino.method.getConstantValueID.21594.defdescription type=javadoc - /** - * Gibt den NameIndex auf die UTF-8 Konstante "ConstantValue" zurueck, - * der fuer die Definition von Konstanten benoetigt wird. - */ - // ino.end - // ino.method.getConstantValueID.21594.definition - public short getConstantValueID() - // ino.end - // ino.method.getConstantValueID.21594.body - { - if (ConstantValueID == 0) { - ConstantValueID = (short) add_CONSTANT_Utf8_info("ConstantValue"); - } - - return ConstantValueID; - } - // ino.end - - // ino.method.getSignatureID.21597.defdescription type=javadoc - /** - * Gibt den NameIndex auf die UTF-8 Konstante "Signature" zurueck, - * der fuer die Definition von Konstanten benoetigt wird. - */ - // ino.end - // ino.method.getSignatureID.21597.definition - public short getSignatureID() - // ino.end - // ino.method.getSignatureID.21597.body - { - if (SignatureID == 0) { - SignatureID = (short) add_CONSTANT_Utf8_info("Signature"); - } - - return SignatureID; - } - // ino.end - - - - // ino.method.add_field.21600.definition - public void add_field(String name, String type, short acc_flag, Attribute attr) - // ino.end - // ino.method.add_field.21600.body - { - codegenlog.debug("Field hinzugefuegt: " + name + ", Typ: " + type + " ," + - "Accessflags: " + acc_flag); - FieldInfo field = new FieldInfo(); - field.set_Name(name); - field.set_Type(type); - field.set_Class_Name(class_name); - field.set_access_flags(acc_flag); - field.set_name_index((short)this.add_CONSTANT_Utf8_info(name)); - field.set_descriptor_index((short)this.add_CONSTANT_Utf8_info(type)); - if (attr != null) { - Menge vec = new Menge(); - vec.addElement(attr); - field.set_attributes(vec); - } - fields.addElement(field); - } - // ino.end - - // ino.method.add_field_ref.21603.definition - public int add_field_ref(String name, String cl_name, String type) - throws JVMCodeException - // ino.end - // ino.method.add_field_ref.21603.body - { - if(cl_name==null) cl_name = class_name; - if(type==null) { - int index = -1; - for(int i=0; i < fields.size();i++) - if(name.equals(fields.elementAt(i).get_Name())) { index = i; break; } - - if(index == -1) throw new JVMCodeException("JVMCodeException: ClassFile: int add_field_ref(String name, String cla_name, String atype)"); - - FieldInfo field = fields.elementAt(index); - type = field.get_Type(); - cl_name = field.get_Class_Name(); - - codegenlog.debug("Fieldref hinzugefuegt: " + name + ", Klassenname: " + cl_name - + ", Accessflags: " + field.get_access_flags()); - Key fieldref_key = new Key(JVMCode.CONSTANT_Fieldref, cl_name + name + type); - if(!this.key_Menge.contains(fieldref_key)) { - CONSTANT_Fieldref_info fieldref = new CONSTANT_Fieldref_info(); - fieldref.set_tag(JVMCode.CONSTANT_Fieldref); - fieldref.set_class_index((short)this.add_CONSTANT_Class_info(cl_name)); - fieldref.set_name_and_type_index((short)this.add_CONSTANT_NameAndType_info(name, type)); - this.key_Menge.addElement(fieldref_key); - this.constant_pool.addElement(fieldref); - } - return (this.key_Menge.indexOf(fieldref_key)+1); - } - else { - codegenlog.debug("Fieldref hinzugefuegt: " + name + ", Klassenname: " + cl_name - + ", Typ: " + type); - Key fieldref_key = new Key(JVMCode.CONSTANT_Fieldref, cl_name + name + type); - if(!this.key_Menge.contains(fieldref_key)) { - CONSTANT_Fieldref_info fieldref = new CONSTANT_Fieldref_info(); - fieldref.set_tag(JVMCode.CONSTANT_Fieldref); - fieldref.set_class_index((short)this.add_CONSTANT_Class_info(cl_name)); - fieldref.set_name_and_type_index((short)this.add_CONSTANT_NameAndType_info(name, type)); - this.key_Menge.addElement(fieldref_key); - this.constant_pool.addElement(fieldref); - } - return (this.key_Menge.indexOf(fieldref_key)+1); - } - } - // ino.end - - // ino.method.set_constant_pool.21606.definition - public void set_constant_pool(Menge t) - // ino.end - // ino.method.set_constant_pool.21606.body - { this.constant_pool = t; } - // ino.end - // ino.method.set_access_flags.21609.definition - public void set_access_flags(short t) - // ino.end - // ino.method.set_access_flags.21609.body - { this.access_flags = t; } - // ino.end - // ino.method.set_this_class.21612.definition - public void set_this_class(short t) - // ino.end - // ino.method.set_this_class.21612.body - { this.this_class = t; } - // ino.end - // ino.method.set_super_class.21615.definition - public void set_super_class(short t) - // ino.end - // ino.method.set_super_class.21615.body - { this.super_class = t; } - // ino.end - // ino.method.set_fields.21618.definition - public void set_fields(Menge t) - // ino.end - // ino.method.set_fields.21618.body - { this.fields = t; } - // ino.end - // ino.method.set_methods.21621.definition - public void set_methods(Menge t) - // ino.end - // ino.method.set_methods.21621.body - { this.methods = t; } - // ino.end - // ino.method.set_attributes.21624.definition - public void set_attributes(Menge t) - // ino.end - // ino.method.set_attributes.21624.body - { this.attributes = t; } - // ino.end - - public void set_class_name(String cn) { - this.class_name = cn; - } - - // ino.method.set_constructor_founded.21627.definition - public void set_constructor_founded(boolean t) - // ino.end - // ino.method.set_constructor_founded.21627.body - { this.constructor_founded = t; } - // ino.end - // ino.method.add_classblock_Element.21630.definition - public void add_classblock_Element(Assign a) - // ino.end - // ino.method.add_classblock_Element.21630.body - { class_block.addElement(a); } - // ino.end - - // ino.method.get_constant_pool.21633.definition - public Menge get_constant_pool() - // ino.end - // ino.method.get_constant_pool.21633.body - { return this.constant_pool; } - // ino.end - // ino.method.get_access_flags.21636.definition - public short get_access_flags() - // ino.end - // ino.method.get_access_flags.21636.body - { return this.access_flags; } - // ino.end - // ino.method.get_this_class.21639.definition - public short get_this_class() - // ino.end - // ino.method.get_this_class.21639.body - { return this.this_class; } - // ino.end - // ino.method.get_super_class.21642.definition - public short get_super_class() - // ino.end - // ino.method.get_super_class.21642.body - { return this.super_class; } - // ino.end - // ino.method.get_fields.21645.definition - public Menge get_fields() - // ino.end - // ino.method.get_fields.21645.body - { return this.fields; } - // ino.end - // ino.method.get_methods.21648.definition - public Menge get_methods() - // ino.end - // ino.method.get_methods.21648.body - { return this.methods; } - // ino.end - // ino.method.get_attributes.21651.definition - public Menge get_attributes() - // ino.end - // ino.method.get_attributes.21651.body - { return this.attributes; } - // ino.end - // ino.method.get_key_Menge.21654.definition - public Menge get_key_Menge() - // ino.end - // ino.method.get_key_Menge.21654.body - { return this.key_Menge; } - // ino.end - // ino.method.get_constructor_founded.21657.definition - public boolean get_constructor_founded() - // ino.end - // ino.method.get_constructor_founded.21657.body - { return this.constructor_founded; } - // ino.end - // ino.method.get_constant_pool_element.21660.definition - public short get_constant_pool_element(byte b, String id) - // ino.end - // ino.method.get_constant_pool_element.21660.body - { return (short)this.key_Menge.indexOf(new Key(b, id)); } - // ino.end - // ino.method.get_class_block.21663.definition - public Menge get_class_block() - // ino.end - // ino.method.get_class_block.21663.body - { return this.class_block; } - // ino.end - - // ino.method.codegen.21666.definition - public void codegen() - throws JVMCodeException - // ino.end - // ino.method.codegen.21666.body - { - try - { - codegenlog.info("Generieren der Klasse: " + class_name); - - // Datei vorbereiten - //File file = new File(MyCompiler.getAPI().getOutputDir() - File file = new File ("/Users/pl/ResearchPapers/PIZZA+/Intersection_Types/" - //File file = new File ("/Users/pl/ResearchPapers/PIZZA+/JVM_Generics/Testfiles/" - + class_name + ".class"); - FileOutputStream f = new FileOutputStream(file); - - // Schreiben der Header-Infos - writeInt(f, magic); - writeShort(f, minor_version); - writeShort(f, major_version); - codegenlog.debug("Header: magic=" + Integer.toHexString(magic)); - codegenlog.debug("Header: minor_version=" + minor_version); - codegenlog.debug("Header: major_version=" + major_version); - codegenlog.info("Verarbeite Konstanten-Pool: " + (constant_pool.size()+1)); - - // Constant-Pool verarbeiten - writeShort(f, (short)(constant_pool.size() + 1)); - for(int i = 0; i < constant_pool.size(); i++) - { - codegenlog.debug((i+1) +". " + - constant_pool.elementAt(i).toString()); - constant_pool.elementAt(i).codegen(this, f); - } - - // Informationen ueber die Klasse selbst verarbeiten - writeShort(f, access_flags); - writeShort(f, this_class); - writeShort(f, super_class); - codegenlog.debug("Klasseninfos: access_flags=" + access_flags); - codegenlog.debug("Klasseninfos: this_class=" + this_class); - codegenlog.debug("Klasseninfos: super_class=" + super_class); - - // Interfaces verarbeiten - codegenlog.info("Verarbeite Interfaces: " + interfaces.size()); - writeShort(f, (short)interfaces.size()); - for (int i=0; i>> 24) & 255)); - f.write(((i >>> 16) & 255)); - f.write(((i >>> 8) & 255)); - f.write((i & 255)); - } - // ino.end - - // ino.method.writeShort.21672.definition - public void writeShort(OutputStream f, short i) - throws IOException - // ino.end - // ino.method.writeShort.21672.body - { - f.write((i >>> 8) & 255); - f.write(i & 255); - } - // ino.end - - // ino.method.writeByte.21675.definition - public void writeByte(OutputStream f, byte i) - throws IOException - // ino.end - // ino.method.writeByte.21675.body - { - f.write(i); - } - // ino.end - - // ino.method.writeByteArray.21678.definition - public void writeByteArray(OutputStream f, byte[] b) - throws IOException - // ino.end - // ino.method.writeByteArray.21678.body - { - for(int i = 0; i < Array.getLength(b); i++) f.write(b[i]); - } - // ino.end - -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/ClassFileMember.java b/src/de/dhbwstuttgart/bytecode/ClassFileMember.java deleted file mode 100644 index 85d628b74..000000000 --- a/src/de/dhbwstuttgart/bytecode/ClassFileMember.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.dhbwstuttgart.bytecode; - -import java.io.IOException; -import java.io.OutputStream; - -import de.dhbwstuttgart.myexception.JVMCodeException; - -public interface ClassFileMember { - public void codegen(ClassFile cf, OutputStream out) throws JVMCodeException, IOException; -} diff --git a/src/de/dhbwstuttgart/bytecode/CodeAttribute.java b/src/de/dhbwstuttgart/bytecode/CodeAttribute.java deleted file mode 100755 index 8cff67c45..000000000 --- a/src/de/dhbwstuttgart/bytecode/CodeAttribute.java +++ /dev/null @@ -1,1098 +0,0 @@ -//PL 14-03-21: calculate_max_stack() duerfte nicht stimmen -//vorübergehend max_stack und set_max_stack eingeführt -//in codegen "short max_stack = calculate_max_stack();" auskommentiert -//muss wieder einkommentiert werden - -// ino.module.CodeAttribute.8532.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.CodeAttribute.8532.import -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.lang.reflect.Array; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.myexception.JVMCodeException; -import de.dhbwstuttgart.syntaxtree.type.Type; - -// ino.class.CodeAttribute.21681.declaration -public class CodeAttribute extends Attribute -// ino.end -// ino.class.CodeAttribute.21681.body -{ - // ino.attribute.code_Menge.21685.declaration - private Menge code_Menge = new Menge(); - // ino.end - // ino.attribute.exception_tables.21688.declaration - private Menge exception_tables = new Menge(); - // ino.end - // ino.attribute.attributes.21691.declaration - private Menge attributes = new Menge(); - // ino.end - // ino.attribute.local_name_Menge.21694.declaration - private Menge local_name_Menge = new Menge(); - // ino.end - // ino.attribute.local_type_Menge.21697.declaration - private Menge local_type_Menge = new Menge(); - // ino.end - - short max_stack; - - public CodeAttribute() { - super(); - } - - // ino.method.CodeAttribute.21700.definition - public CodeAttribute(String class_name, short acc_flags) - // ino.end - // ino.method.CodeAttribute.21700.body - { - if ((acc_flags & 8) == 0) - add_local(class_name, new Type("void",-1)); - } - // ino.end - - // ino.method.get_code_Menge.21703.definition - public Menge get_code_Menge() - // ino.end - // ino.method.get_code_Menge.21703.body - { - return this.code_Menge; - } - // ino.end - - // ino.method.get_exception_table_Menge.21706.definition - public Menge get_exception_table_Menge() - // ino.end - // ino.method.get_exception_table_Menge.21706.body - { - return this.exception_tables; - } - // ino.end - - // ino.method.get_attributes_Menge.21709.definition - public Menge get_attributes_Menge() - // ino.end - // ino.method.get_attributes_Menge.21709.body - { - return this.attributes; - } - // ino.end - - // ino.method.get_local_Menge.21712.definition - public Menge get_local_Menge() - // ino.end - // ino.method.get_local_Menge.21712.body - { - return this.local_name_Menge; - } - // ino.end - - // ino.method.get_code_length.21715.definition - public int get_code_length() - // ino.end - // ino.method.get_code_length.21715.body - { - return this.code_Menge.size(); - } - // ino.end - - // ino.method.add_local.21718.definition - public void add_local(String s, Type t) - // ino.end - // ino.method.add_local.21718.body - { - local_name_Menge.addElement(s); - local_type_Menge.addElement(t); - String type = t.getName(); - if (type.equals("double") || type.equals("long")) { - local_name_Menge.addElement(s); - local_type_Menge.addElement(t); - } - } - // ino.end - - // ino.method.add_code.21721.definition - public void add_code(Byte b) - // ino.end - // ino.method.add_code.21721.body - { - code_Menge.addElement(b); - } - // ino.end - - // ino.method.set_code.21724.definition - public void set_code(Byte b, int i) - // ino.end - // ino.method.set_code.21724.body - { - code_Menge.setElementAt(b, i); - } - // ino.end - - // ino.method.add_code_int.21727.definition - public void add_code_int(int i) - // ino.end - // ino.method.add_code_int.21727.body - { - code_Menge.addElement(new Byte((byte) ((i >> 24) & 255))); - code_Menge.addElement(new Byte((byte) ((i >> 16) & 255))); - code_Menge.addElement(new Byte((byte) ((i >> 8) & 255))); - code_Menge.addElement(new Byte((byte) (i & 255))); - } - // ino.end - - // ino.method.add_code_short.21730.definition - public void add_code_short(int s) - // ino.end - // ino.method.add_code_short.21730.body - { - code_Menge.addElement(new Byte((byte) ((s >> 8) & 255))); - code_Menge.addElement(new Byte((byte) (s & 255))); - } - // ino.end - - // ino.method.set_code_short.21733.definition - public void set_code_short(int s, int i) - // ino.end - // ino.method.set_code_short.21733.body - { - code_Menge.setElementAt(new Byte((byte) ((s >> 8) & 255)), i); - code_Menge.setElementAt(new Byte((byte) (s & 255)), i + 1); - } - // ino.end - - // ino.method.add_code_byte.21736.definition - public void add_code_byte(int b) - // ino.end - // ino.method.add_code_byte.21736.body - { - code_Menge.addElement(new Byte((byte) (b & 255))); - } - // ino.end - - // ino.method.add_code_byte_array.21739.definition - public void add_code_byte_array(byte[] b) - // ino.end - // ino.method.add_code_byte_array.21739.body - { - for (int i = 0; i < Array.getLength(b); i++) - code_Menge.addElement(new Byte(b[i])); - } - // ino.end - - // ino.method.get_indexOf_Var.21742.definition - public int get_indexOf_Var(String name) - // ino.end - // ino.method.get_indexOf_Var.21742.body - { - for (int i = 0; i < local_name_Menge.size(); i++) - if (name.equals((String) local_name_Menge.elementAt(i))) - return i; - return -1; - } - // ino.end - - // ino.method.get_TypeOf_Var.21745.definition - public Type get_TypeOf_Var(String name) - throws JVMCodeException - // ino.end - // ino.method.get_TypeOf_Var.21745.body - { - int index = get_indexOf_Var(name); - if (index != -1) - return (Type) local_type_Menge.elementAt(index); - throw new JVMCodeException( - "JVMCodeException: Code_attribute: Type get_TypeOf_Var(String name)"); - } - // ino.end - - // ino.method.get_attributes_length.21748.definition - public int get_attributes_length() - // ino.end - // ino.method.get_attributes_length.21748.body - { - int ret = 8;//2(max_stack)+2(max_locals)+4(code_length) - ret += code_Menge.size(); - ret += 2; //exception table length - ret += (exception_tables.size() * 8); - ret += 2; //Attribute_count - for (int i = 0; i < attributes.size(); i++) - ret += attributes.elementAt(i) - .get_attributes_length(); - return ret; - } - // ino.end - - // ino.method.set_exception_table_Menge.21751.definition - public void set_exception_table_Menge(Menge t) - // ino.end - // ino.method.set_exception_table_Menge.21751.body - { - this.exception_tables = t; - } - // ino.end - - // ino.method.set_attributes_Menge.21754.definition - public void set_attributes_Menge(Menge t) - // ino.end - // ino.method.set_attributes_Menge.21754.body - { - this.attributes = t; - } - // ino.end - - public void set_max_stack(short ms) { - max_stack = ms; - } - - - // ino.method.codegen.21757.definition - public void codegen(ClassFile classfile, OutputStream f) - throws JVMCodeException, IOException - // ino.end - // ino.method.codegen.21757.body - { - int attributes_length = this.get_attributes_length(); - //PL 14-03-21: muss wieder einkommentiert werden - //short max_stack = calculate_max_stack(); - classfile.writeShort(f, get_attribute_name_index()); - classfile.writeInt(f, attributes_length); - classfile.writeShort(f, max_stack); - classfile.writeShort(f, (short) local_name_Menge.size()); - classfile.writeInt(f, code_Menge.size()); - - codegenlog.debug("Code_attribute_name_index=" + get_attribute_name_index() - + ", Length=" + attributes_length + ", Max_Stack=" + max_stack - + ", Max_Locals=" + (short) local_name_Menge.size() - + ", Code_Length=" + code_Menge.size()); - - for (int i = 0; i < code_Menge.size(); i++) { // code_Menge - classfile.writeByte(f, (code_Menge.elementAt(i)).byteValue()); - } - - // Verarbeitung der Exception-Table - JVMCode.get_Command(code_Menge); - codegenlog.debug("Groesse der Exception-Table: " + exception_tables.size()); - classfile.writeShort(f, (short) exception_tables.size()); - for (int i = 0; i < exception_tables.size(); i++) { - exception_tables.elementAt(i).codegen(classfile,f); - } - - // Verarbeitung der Attribute - codegenlog.debug("Anzahl der Attribute: " + attributes.size()); - classfile.writeShort(f, (short) attributes.size()); - for (int i = 0; i < attributes.size(); i++) { // attributes - attributes.elementAt(i).codegen(classfile, f); - } - /* - * if(classfile.get_system_out()) { System.out.println(" locals:"); - * for(int i = 0; i < local_name_Menge.size(); i++) // locals - * System.out.println(" " + i +" " + - * (String)local_name_Menge.elementAt(i) + - * ((Type)local_type_Menge.elementAt(i)).get_Type()); } - */ - } - // ino.end - - // ino.method.calculate_max_stack.21760.definition - //PL 14-03-21: Diese Methode duerfte nicht stimmen - private short calculate_max_stack() - throws JVMCodeException - // ino.end - // ino.method.calculate_max_stack.21760.body - { - short max_stack = 0; - short stack = 0; - for (int y = 0; y < code_Menge.size(); y++) { - int x = JVMCode.bytes_to_int(code_Menge.elementAt(y)); - switch (x) { - case 0: { - break; - } - case 1: { - stack++; - break; - } - case 2: { - stack++; - break; - } - case 3: { - stack++; - break; - } - case 4: { - stack++; - break; - } - case 5: { - stack++; - break; - } - case 6: { - stack++; - break; - } - case 7: { - stack++; - break; - } - case 8: { - stack++; - break; - } - case 9: { - stack++; - break; - } - case 10: { - stack++; - break; - } - case 11: { - stack++; - break; - } - case 12: { - stack++; - break; - } - case 13: { - stack++; - break; - } - case 14: { - stack++; - break; - } - case 15: { - stack++; - break; - } - case 16: { - stack++; - y++; - break; - } - case 17: { - stack++; - y += 2; - break; - } - case 18: { - stack++; - y++; - break; - } - case 19: { - stack++; - y += 2; - break; - } - case 20: { - stack++; - y += 2; - break; - } - case 21: { - stack++; - y++; - break; - } - case 22: { - stack++; - y++; - break; - } - case 23: { - stack++; - y++; - break; - } - case 24: { - stack++; - y++; - break; - } - case 25: { - stack++; - y++; - break; - } - case 26: { - stack++; - break; - } - case 27: { - stack++; - break; - } - case 28: { - stack++; - break; - } - case 29: { - stack++; - break; - } - case 30: { - stack++; - break; - } - case 31: { - stack++; - break; - } - case 32: { - stack++; - break; - } - case 33: { - stack++; - break; - } - case 34: { - stack++; - break; - } - case 35: { - stack++; - break; - } - case 36: { - stack++; - break; - } - case 37: { - stack++; - break; - } - case 38: { - stack++; - break; - } - case 39: { - stack++; - break; - } - case 40: { - stack++; - break; - } - case 41: { - stack++; - break; - } - case 42: { - stack++; - break; - } - case 43: { - stack++; - break; - } - case 44: { - stack++; - break; - } - case 45: { - stack++; - break; - } - /* - * case 46: { System.out.print("iaload"); break; } case 47: { - * System.out.print("laload"); break; } case 48: { - * System.out.print("faload"); break; } case 49: { - * System.out.print("daload"); break; } case 50: { - * System.out.print("aaload"); break; } case 51: { - * System.out.print("baload"); break; } case 52: { - * System.out.print("caload"); break; } case 53: { - * System.out.print("saload"); break; } - */ - case 54: { - stack--; - y++; - break; - } - case 55: { - stack--; - y++; - break; - } - case 56: { - stack--; - y++; - break; - } - case 57: { - stack--; - y++; - break; - } - case 58: { - stack--; - y++; - break; - } - case 59: { - stack--; - break; - } - case 60: { - stack--; - break; - } - case 61: { - stack--; - break; - } - case 62: { - stack--; - break; - } - case 63: { - stack--; - break; - } - case 64: { - stack--; - break; - } - case 65: { - stack--; - break; - } - case 66: { - stack--; - break; - } - case 67: { - stack--; - break; - } - case 68: { - stack--; - break; - } - case 69: { - stack--; - break; - } - case 70: { - stack--; - break; - } - case 71: { - stack--; - break; - } - case 72: { - stack--; - break; - } - case 73: { - stack--; - break; - } - case 74: { - stack--; - break; - } - case 75: { - stack--; - break; - } - case 76: { - stack--; - break; - } - case 77: { - stack--; - break; - } - case 78: { - stack--; - break; - } - /* - * case 79: { System.out.print("iastore"); break; } case 80: { - * System.out.print("lastore"); break; } case 81: { - * System.out.print("fastore"); break; } case 82: { - * System.out.print("dastore"); break; } case 83: { - * System.out.print("aastore"); break; } case 84: { - * System.out.print("bastore"); break; } case 85: { - * System.out.print("castore"); break; } case 86: { - * System.out.print("sastore"); break; } - */ - case 87: { - stack--; - break; - } - case 88: { - stack -= 2; - break; - } - case 89: { - stack++; - break; - } - case 90: { - stack++; - break; - } - case 91: { - stack++; - break; - } - case 92: { - stack += 2; - break; - } - case 93: { - stack += 2; - break; - } - case 94: { - stack += 2; - break; - } - case 95: { - break; - } - case 96: { - stack--; - break; - } - case 97: { - stack--; - break; - } - case 98: { - stack--; - break; - } - case 99: { - stack--; - break; - } - case 100: { - stack--; - break; - } - case 101: { - stack--; - break; - } - case 102: { - stack--; - break; - } - case 103: { - stack--; - break; - } - case 104: { - stack--; - break; - } - case 105: { - stack--; - break; - } - case 106: { - stack--; - break; - } - case 107: { - stack--; - break; - } - case 108: { - stack--; - break; - } - case 109: { - stack--; - break; - } - case 110: { - stack--; - break; - } - case 111: { - stack--; - break; - } - case 112: { - stack--; - break; - } - case 113: { - stack--; - break; - } - case 114: { - stack--; - break; - } - case 115: { - stack--; - break; - } - case 116: { - break; - } - case 117: { - break; - } - case 118: { - break; - } - case 119: { - break; - } - case 120: { - stack--; - break; - } - case 121: { - stack--; - break; - } - case 122: { - stack--; - break; - } - case 123: { - stack--; - break; - } - case 124: { - stack--; - break; - } - case 125: { - stack--; - break; - } - case 126: { - stack--; - break; - } - case 127: { - stack--; - break; - } - case 128: { - stack--; - break; - } - case 129: { - stack--; - break; - } - case 130: { - stack--; - break; - } - case 131: { - stack--; - break; - } - case 132: { - y += 2; - break; - } - case 133: { - break; - } - case 134: { - break; - } - case 135: { - break; - } - case 136: { - break; - } - case 137: { - break; - } - case 138: { - break; - } - case 139: { - break; - } - case 140: { - break; - } - case 141: { - break; - } - case 142: { - break; - } - case 143: { - break; - } - case 144: { - break; - } - case 145: { - break; - } - case 146: { - break; - } - case 147: { - break; - } - case 148: { - stack--; - break; - } - case 149: { - stack--; - break; - } - case 150: { - stack--; - break; - } - case 151: { - stack--; - break; - } - case 152: { - stack--; - break; - } - case 153: { - stack--; - y += 2; - break; - } - case 154: { - stack--; - y += 2; - break; - } - case 155: { - stack--; - y += 2; - break; - } - case 156: { - stack--; - y += 2; - break; - } - case 157: { - stack--; - y += 2; - break; - } - case 158: { - stack--; - y += 2; - break; - } - case 159: { - stack -= 2; - y += 2; - break; - } - case 160: { - stack -= 2; - y += 2; - break; - } - case 161: { - stack -= 2; - y += 2; - break; - } - case 162: { - stack -= 2; - y += 2; - break; - } - case 163: { - stack -= 2; - y += 2; - break; - } - case 164: { - stack -= 2; - y += 2; - break; - } - case 165: { - stack -= 2; - y += 2; - break; - } - case 166: { - stack -= 2; - y += 2; - break; - } - case 167: { - y += 2; - break; - } - case 168: { - stack++; - y += 2; - break; - } - case 169: { - y++; - break; - } - // case 170: { System.out.print("tableswitch"); break; } - // case 171: { System.out.print("lookupswitch"); break; } - case 172: { - stack = 0; - break; - } - case 173: { - stack = 0; - break; - } - case 174: { - stack = 0; - break; - } - case 175: { - stack = 0; - break; - } - case 176: { - stack = 0; - break; - } - case 177: { - stack = 0; - break; - } - case 178: { - stack++; - y += 2; - break; - } - case 179: { - stack++; - y += 2; - break; - } - case 180: { - y += 2; - break; - } - case 181: { - stack += 2; - y += 2; - break; - } - case 182: { - y += 2; - stack = 0; - break; - } // invokevirtual - case 183: { - y += 2; - stack = 0; - break; - } // invokespecial - case 184: { - y += 2; - stack = 0; - break; - } // invokestatic - // case 185: { System.out.print("invokeinterface"); y+=4; break; } - case 187: { - stack++; - y += 2; - break; - } - case 188: { - y++; - break; - } - case 189: { - y += 2; - break; - } - case 190: { - break; - } - case 191: { - break; - } - case 192: { - y += 2; - break; - } - case 193: { - y += 2; - break; - } - case 194: { - stack--; - break; - } - case 195: { - stack--; - break; - } - // case 196: { System.out.print("wide"); break; } - case 197: { - y += 3; - break; - } - case 198: { - stack--; - y += 2; - break; - } - case 199: { - stack--; - y += 2; - break; - } - case 200: { - y += 4; - break; - } - case 201: { - stack++; - y += 4; - break; - } - // case 202: { System.out.print("breakpoint"); break; } - // case 254: { System.out.print("impdep1"); break; } - default: { - throw new JVMCodeException( - "JVMCodeException: Code_attribute: short calculate_max_stack()"); - } - } - if (stack > max_stack) - max_stack = stack; - } - return max_stack; - } - // ino.end - -// @Override -// public void codegen(ClassFile classfile, OutputStream f) -// throws JVMCodeException, IOException { -// throw new NotImplementedException(); -// } - -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/ExceptionTable.java b/src/de/dhbwstuttgart/bytecode/ExceptionTable.java deleted file mode 100755 index 7d22e35ff..000000000 --- a/src/de/dhbwstuttgart/bytecode/ExceptionTable.java +++ /dev/null @@ -1,58 +0,0 @@ -// ino.module.ExceptionTable.8545.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.ExceptionTable.8545.import -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -import de.dhbwstuttgart.logger.Logger; -// ino.end - -// ino.class.ExceptionTable.22047.declaration -public class ExceptionTable implements ClassFileMember -// ino.end -// ino.class.ExceptionTable.22047.body -{ - // ino.attribute.codegenlog.22050.decldescription type=line - // Logger fuer Code-Gen - // ino.end - // ino.attribute.codegenlog.22050.declaration - protected static Logger codegenlog = Logger.getLogger("codegen"); - // ino.end - // ino.attribute.start_pc.22053.declaration - private short start_pc; - // ino.end - - // ino.attribute.end_pc.22056.declaration - private short end_pc; - // ino.end - - // ino.attribute.handler_pc.22059.declaration - private short handler_pc; - // ino.end - - // ino.attribute.catch_type.22062.declaration - private short catch_type; - // ino.end - - // ino.method.codegen.22065.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws IOException - // ino.end - // ino.method.codegen.22065.body - { - classfile.writeShort(f, start_pc); - classfile.writeShort(f, end_pc); - classfile.writeShort(f, handler_pc); - classfile.writeShort(f, catch_type); - codegenlog.debug("Exception-Table: start_pc=" + start_pc - + ", end_pc=" + end_pc + ", handler_pc=" + handler_pc - + ", catch_type=" + catch_type); - } - // ino.end - -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/FieldInfo.java b/src/de/dhbwstuttgart/bytecode/FieldInfo.java deleted file mode 100755 index 84a568c47..000000000 --- a/src/de/dhbwstuttgart/bytecode/FieldInfo.java +++ /dev/null @@ -1,203 +0,0 @@ -// ino.module.FieldInfo.8546.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.FieldInfo.8546.import -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.logger.Logger; -// ino.end - -import de.dhbwstuttgart.myexception.JVMCodeException; - -// ino.class.FieldInfo.22068.declaration -public class FieldInfo implements ClassFileMember -// ino.end -// ino.class.FieldInfo.22068.body -{ - // ino.attribute.codegenlog.22071.decldescription type=line - // Logger fuer Code-Gen - // ino.end - // ino.attribute.codegenlog.22071.declaration - protected static Logger codegenlog = Logger.getLogger("codegen"); - // ino.end - - // ino.attribute.name.22074.declaration - private String name; - // ino.end - - // ino.attribute.type.22077.declaration - private String type; - // ino.end - - // ino.attribute.class_name.22080.declaration - private String class_name; - // ino.end - - // ino.attribute.access_flags.22083.declaration - private short access_flags; - // ino.end - - // ino.attribute.name_index.22086.declaration - private short name_index; - // ino.end - - // ino.attribute.descriptor_index.22089.declaration - private short descriptor_index; - // ino.end - - // ino.attribute.attributes.22092.declaration - private Menge attributes = new Menge(); // attribute - // ino.end - - // ino.method.get_Name.22095.definition - public String get_Name() - // ino.end - // ino.method.get_Name.22095.body - { - return this.name; - } - // ino.end - - // ino.method.get_Type.22098.definition - public String get_Type() - // ino.end - // ino.method.get_Type.22098.body - { - return this.type; - } - // ino.end - - // ino.method.get_Class_Name.22101.definition - public String get_Class_Name() - // ino.end - // ino.method.get_Class_Name.22101.body - { - return this.class_name; - } - // ino.end - - // ino.method.get_access_flags.22104.definition - public short get_access_flags() - // ino.end - // ino.method.get_access_flags.22104.body - { - return this.access_flags; - } - // ino.end - - // ino.method.get_name_index.22107.definition - public short get_name_index() - // ino.end - // ino.method.get_name_index.22107.body - { - return this.name_index; - } - // ino.end - - // ino.method.get_descriptor_index.22110.definition - public short get_descriptor_index() - // ino.end - // ino.method.get_descriptor_index.22110.body - { - return this.descriptor_index; - } - // ino.end - - // ino.method.get_attributes.22113.definition - public Menge get_attributes() - // ino.end - // ino.method.get_attributes.22113.body - { - return this.attributes; - } - // ino.end - - // ino.method.set_Name.22116.definition - public void set_Name(String t) - // ino.end - // ino.method.set_Name.22116.body - { - this.name = t; - } - // ino.end - - // ino.method.set_Type.22119.definition - public void set_Type(String t) - // ino.end - // ino.method.set_Type.22119.body - { - this.type = t; - } - // ino.end - - // ino.method.set_Class_Name.22122.definition - public void set_Class_Name(String t) - // ino.end - // ino.method.set_Class_Name.22122.body - { - this.class_name = t; - } - // ino.end - - // ino.method.set_access_flags.22125.definition - public void set_access_flags(short t) - // ino.end - // ino.method.set_access_flags.22125.body - { - this.access_flags = t; - } - // ino.end - - // ino.method.set_name_index.22128.definition - public void set_name_index(short t) - // ino.end - // ino.method.set_name_index.22128.body - { - this.name_index = t; - } - // ino.end - - // ino.method.set_descriptor_index.22131.definition - public void set_descriptor_index(short t) - // ino.end - // ino.method.set_descriptor_index.22131.body - { - this.descriptor_index = t; - } - // ino.end - - // ino.method.set_attributes.22134.definition - public void set_attributes(Menge t) - // ino.end - // ino.method.set_attributes.22134.body - { - this.attributes = t; - } - // ino.end - - // ino.method.codegen.22137.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - throws IOException, JVMCodeException - // ino.end - // ino.method.codegen.22137.body - { - classfile.writeShort(f, access_flags); - classfile.writeShort(f, name_index); - classfile.writeShort(f, descriptor_index); - codegenlog.debug("FieldInfo: acc_flag=" + access_flags - + ", name_index=" + name_index + ", descriptor_index=" - + descriptor_index + ", attributes_count=" + attributes.size()); - - classfile.writeShort(f, (short) attributes.size()); // attributes_count=0 - for (int i = 0; i < attributes.size(); i++) { // attributes - attributes.elementAt(i).codegen(classfile, f); - } - } - // ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/JVMCode.java b/src/de/dhbwstuttgart/bytecode/JVMCode.java deleted file mode 100755 index a1df3da47..000000000 --- a/src/de/dhbwstuttgart/bytecode/JVMCode.java +++ /dev/null @@ -1,1392 +0,0 @@ -// ino.module.JVMCode.8547.package -package de.dhbwstuttgart.bytecode; -// ino.end -// ino.module.JVMCode.8547.import -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.logger.Logger; -// ino.end - - -import de.dhbwstuttgart.myexception.JVMCodeException; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; - -// ino.class.JVMCode.22140.description type=javadoc -/** - * Enthaelt die Befehle fuer die Umsetzung in JVM-Code und - * Konstantendefinitionen. - */ -// ino.end -// ino.class.JVMCode.22140.declaration -public class JVMCode -// ino.end -// ino.class.JVMCode.22140.body -{ - // ino.attribute.codegenlog.22143.decldescription type=line - // Logger fuer Code-Gen - // ino.end - // ino.attribute.codegenlog.22143.declaration - protected static Logger codegenlog = Logger.getLogger("codegen"); - // ino.end - // ino.attribute.bytecodelog.22146.decldescription type=line - // Logger fuer JVM Befehle - // ino.end - // ino.attribute.bytecodelog.22146.declaration - protected static Logger bytecodelog = Logger.getLogger("bytecode"); - // ino.end - - // ino.attribute.CONSTANT_Utf8.22149.decldescription type=line - // Konstanten fuer Items im Konstantenpool - // ino.end - // ino.attribute.CONSTANT_Utf8.22149.declaration - public static byte CONSTANT_Utf8 = 1; - // ino.end - // ino.attribute.CONSTANT_Integer.22152.declaration - public static byte CONSTANT_Integer = 3; - // ino.end - // ino.attribute.CONSTANT_Float.22155.declaration - public static byte CONSTANT_Float = 4; - // ino.end - // ino.attribute.CONSTANT_Long.22158.declaration - public static byte CONSTANT_Long = 5; - // ino.end - // ino.attribute.CONSTANT_Double.22161.declaration - public static byte CONSTANT_Double = 6; - // ino.end - // ino.attribute.CONSTANT_Class.22164.declaration - public static byte CONSTANT_Class = 7; - // ino.end - // ino.attribute.CONSTANT_String.22167.declaration - public static byte CONSTANT_String = 8; - // ino.end - // ino.attribute.CONSTANT_Fieldref.22170.declaration - public static byte CONSTANT_Fieldref = 9; - // ino.end - // ino.attribute.CONSTANT_Methodref.22173.declaration - public static byte CONSTANT_Methodref = 10; - // ino.end - // ino.attribute.CONSTANT_InterfaceMethodref.22176.declaration - public static byte CONSTANT_InterfaceMethodref = 11; - // ino.end - // ino.attribute.CONSTANT_NameAndType.22179.declaration - public static byte CONSTANT_NameAndType = 12; - // ino.end - - // ino.attribute.nop.22182.decldescription type=line - // Opcodes - // ino.end - // ino.attribute.nop.22182.declaration - public static Byte nop = new Byte((byte)0); - // ino.end - // ino.attribute.aconst_null.22185.declaration - public static Byte aconst_null = new Byte((byte)1); - // ino.end - // ino.attribute.iconst_m1.22188.declaration - public static Byte iconst_m1 = new Byte((byte)2); - // ino.end - // ino.attribute.iconst_0.22191.declaration - public static Byte iconst_0 = new Byte((byte)3); - // ino.end - // ino.attribute.iconst_1.22194.declaration - public static Byte iconst_1 = new Byte((byte)4); - // ino.end - // ino.attribute.iconst_2.22197.declaration - public static Byte iconst_2 = new Byte((byte)5); - // ino.end - // ino.attribute.iconst_3.22200.declaration - public static Byte iconst_3 = new Byte((byte)6); - // ino.end - // ino.attribute.iconst_4.22203.declaration - public static Byte iconst_4 = new Byte((byte)7); - // ino.end - // ino.attribute.iconst_5.22206.declaration - public static Byte iconst_5 = new Byte((byte)8); - // ino.end - // ino.attribute.lconst_0.22209.declaration - public static Byte lconst_0 = new Byte((byte)9); - // ino.end - // ino.attribute.lconst_1.22212.declaration - public static Byte lconst_1 = new Byte((byte)10); - // ino.end - // ino.attribute.fconst_0.22215.declaration - public static Byte fconst_0 = new Byte((byte)11); - // ino.end - // ino.attribute.fconst_1.22218.declaration - public static Byte fconst_1 = new Byte((byte)12); - // ino.end - // ino.attribute.fconst_2.22221.declaration - public static Byte fconst_2 = new Byte((byte)13); - // ino.end - // ino.attribute.dconst_0.22224.declaration - public static Byte dconst_0 = new Byte((byte)14); - // ino.end - // ino.attribute.dconst_1.22227.declaration - public static Byte dconst_1 = new Byte((byte)15); - // ino.end - // ino.attribute.bipush.22230.declaration - public static Byte bipush = new Byte((byte)16); - // ino.end - // ino.attribute.sipush.22233.declaration - public static Byte sipush = new Byte((byte)17); - // ino.end - // ino.attribute.ldc.22236.declaration - public static Byte ldc = new Byte((byte)18); - // ino.end - // ino.attribute.ldc_w.22239.declaration - public static Byte ldc_w = new Byte((byte)19); - // ino.end - // ino.attribute.ldc2_w.22242.declaration - public static Byte ldc2_w = new Byte((byte)20); - // ino.end - // ino.attribute.iload.22245.declaration - public static Byte iload = new Byte((byte)21); - // ino.end - // ino.attribute.lload.22248.declaration - public static Byte lload = new Byte((byte)22); - // ino.end - // ino.attribute.fload.22251.declaration - public static Byte fload = new Byte((byte)23); - // ino.end - // ino.attribute.dload.22254.declaration - public static Byte dload = new Byte((byte)24); - // ino.end - // ino.attribute.aload.22257.declaration - public static Byte aload = new Byte((byte)25); - // ino.end - // ino.attribute.iload_0.22260.declaration - public static Byte iload_0 = new Byte((byte)26); - // ino.end - // ino.attribute.iload_1.22263.declaration - public static Byte iload_1 = new Byte((byte)27); - // ino.end - // ino.attribute.iload_2.22266.declaration - public static Byte iload_2 = new Byte((byte)28); - // ino.end - // ino.attribute.iload_3.22269.declaration - public static Byte iload_3 = new Byte((byte)29); - // ino.end - // ino.attribute.lload_0.22272.declaration - public static Byte lload_0 = new Byte((byte)30); - // ino.end - // ino.attribute.lload_1.22275.declaration - public static Byte lload_1 = new Byte((byte)31); - // ino.end - // ino.attribute.lload_2.22278.declaration - public static Byte lload_2 = new Byte((byte)32); - // ino.end - // ino.attribute.lload_3.22281.declaration - public static Byte lload_3 = new Byte((byte)33); - // ino.end - // ino.attribute.fload_0.22284.declaration - public static Byte fload_0 = new Byte((byte)34); - // ino.end - // ino.attribute.fload_1.22287.declaration - public static Byte fload_1 = new Byte((byte)35); - // ino.end - // ino.attribute.fload_2.22290.declaration - public static Byte fload_2 = new Byte((byte)36); - // ino.end - // ino.attribute.fload_3.22293.declaration - public static Byte fload_3 = new Byte((byte)37); - // ino.end - // ino.attribute.dload_0.22296.declaration - public static Byte dload_0 = new Byte((byte)38); - // ino.end - // ino.attribute.dload_1.22299.declaration - public static Byte dload_1 = new Byte((byte)39); - // ino.end - // ino.attribute.dload_2.22302.declaration - public static Byte dload_2 = new Byte((byte)40); - // ino.end - // ino.attribute.dload_3.22305.declaration - public static Byte dload_3 = new Byte((byte)41); - // ino.end - // ino.attribute.aload_0.22308.declaration - public static Byte aload_0 = new Byte((byte)42); - // ino.end - // ino.attribute.aload_1.22311.declaration - public static Byte aload_1 = new Byte((byte)43); - // ino.end - // ino.attribute.aload_2.22314.declaration - public static Byte aload_2 = new Byte((byte)44); - // ino.end - // ino.attribute.aload_3.22317.declaration - public static Byte aload_3 = new Byte((byte)45); - // ino.end - // ino.attribute.iaload.22320.declaration - public static Byte iaload = new Byte((byte)46); - // ino.end - // ino.attribute.laload.22323.declaration - public static Byte laload = new Byte((byte)47); - // ino.end - // ino.attribute.faload.22326.declaration - public static Byte faload = new Byte((byte)48); - // ino.end - // ino.attribute.daload.22329.declaration - public static Byte daload = new Byte((byte)49); - // ino.end - // ino.attribute.aaload.22332.declaration - public static Byte aaload = new Byte((byte)50); - // ino.end - // ino.attribute.baload.22335.declaration - public static Byte baload = new Byte((byte)51); - // ino.end - // ino.attribute.caload.22338.declaration - public static Byte caload = new Byte((byte)52); - // ino.end - // ino.attribute.saload.22341.declaration - public static Byte saload = new Byte((byte)53); - // ino.end - // ino.attribute.istore.22344.declaration - public static Byte istore = new Byte((byte)54); - // ino.end - // ino.attribute.lstore.22347.declaration - public static Byte lstore = new Byte((byte)55); - // ino.end - // ino.attribute.fstore.22350.declaration - public static Byte fstore = new Byte((byte)56); - // ino.end - // ino.attribute.dstore.22353.declaration - public static Byte dstore = new Byte((byte)57); - // ino.end - // ino.attribute.astore.22356.declaration - public static Byte astore = new Byte((byte)58); - // ino.end - // ino.attribute.istore_0.22359.declaration - public static Byte istore_0 = new Byte((byte)59); - // ino.end - // ino.attribute.istore_1.22362.declaration - public static Byte istore_1 = new Byte((byte)60); - // ino.end - // ino.attribute.istore_2.22365.declaration - public static Byte istore_2 = new Byte((byte)61); - // ino.end - // ino.attribute.istore_3.22368.declaration - public static Byte istore_3 = new Byte((byte)62); - // ino.end - // ino.attribute.lstore_0.22371.declaration - public static Byte lstore_0 = new Byte((byte)63); - // ino.end - // ino.attribute.lstore_1.22374.declaration - public static Byte lstore_1 = new Byte((byte)64); - // ino.end - // ino.attribute.lstore_2.22377.declaration - public static Byte lstore_2 = new Byte((byte)65); - // ino.end - // ino.attribute.lstore_3.22380.declaration - public static Byte lstore_3 = new Byte((byte)66); - // ino.end - // ino.attribute.fstore_0.22383.declaration - public static Byte fstore_0 = new Byte((byte)67); - // ino.end - // ino.attribute.fstore_1.22386.declaration - public static Byte fstore_1 = new Byte((byte)68); - // ino.end - // ino.attribute.fstore_2.22389.declaration - public static Byte fstore_2 = new Byte((byte)69); - // ino.end - // ino.attribute.fstore_3.22392.declaration - public static Byte fstore_3 = new Byte((byte)70); - // ino.end - // ino.attribute.dstore_0.22395.declaration - public static Byte dstore_0 = new Byte((byte)71); - // ino.end - // ino.attribute.dstore_1.22398.declaration - public static Byte dstore_1 = new Byte((byte)72); - // ino.end - // ino.attribute.dstore_2.22401.declaration - public static Byte dstore_2 = new Byte((byte)73); - // ino.end - // ino.attribute.dstore_3.22404.declaration - public static Byte dstore_3 = new Byte((byte)74); - // ino.end - // ino.attribute.astore_0.22407.declaration - public static Byte astore_0 = new Byte((byte)75); - // ino.end - // ino.attribute.astore_1.22410.declaration - public static Byte astore_1 = new Byte((byte)76); - // ino.end - // ino.attribute.astore_2.22413.declaration - public static Byte astore_2 = new Byte((byte)77); - // ino.end - // ino.attribute.astore_3.22416.declaration - public static Byte astore_3 = new Byte((byte)78); - // ino.end - // ino.attribute.iastore.22419.declaration - public static Byte iastore = new Byte((byte)79); - // ino.end - // ino.attribute.lastore.22422.declaration - public static Byte lastore = new Byte((byte)80); - // ino.end - // ino.attribute.fastore.22425.declaration - public static Byte fastore = new Byte((byte)81); - // ino.end - // ino.attribute.dastore.22428.declaration - public static Byte dastore = new Byte((byte)82); - // ino.end - // ino.attribute.aastore.22431.declaration - public static Byte aastore = new Byte((byte)83); - // ino.end - // ino.attribute.bastore.22434.declaration - public static Byte bastore = new Byte((byte)84); - // ino.end - // ino.attribute.castore.22437.declaration - public static Byte castore = new Byte((byte)85); - // ino.end - // ino.attribute.sastore.22440.declaration - public static Byte sastore = new Byte((byte)86); - // ino.end - // ino.attribute.pop.22443.declaration - public static Byte pop = new Byte((byte)87); - // ino.end - // ino.attribute.pop2.22446.declaration - public static Byte pop2 = new Byte((byte)88); - // ino.end - // ino.attribute.dup.22449.declaration - public static Byte dup = new Byte((byte)89); - // ino.end - // ino.attribute.dup_x1.22452.declaration - public static Byte dup_x1 = new Byte((byte)90); - // ino.end - // ino.attribute.dup_x2.22455.declaration - public static Byte dup_x2 = new Byte((byte)91); - // ino.end - // ino.attribute.dup2.22458.declaration - public static Byte dup2 = new Byte((byte)92); - // ino.end - // ino.attribute.dup2_x1.22461.declaration - public static Byte dup2_x1 = new Byte((byte)93); - // ino.end - // ino.attribute.dup2_x2.22464.declaration - public static Byte dup2_x2 = new Byte((byte)94); - // ino.end - // ino.attribute.swap.22467.declaration - public static Byte swap = new Byte((byte)95); - // ino.end - // ino.attribute.iadd.22470.declaration - public static Byte iadd = new Byte((byte)96); - // ino.end - // ino.attribute.ladd.22473.declaration - public static Byte ladd = new Byte((byte)97); - // ino.end - // ino.attribute.fadd.22476.declaration - public static Byte fadd = new Byte((byte)98); - // ino.end - // ino.attribute.dadd.22479.declaration - public static Byte dadd = new Byte((byte)99); - // ino.end - // ino.attribute.isub.22482.declaration - public static Byte isub = new Byte((byte)100); - // ino.end - // ino.attribute.lsub.22485.declaration - public static Byte lsub = new Byte((byte)101); - // ino.end - // ino.attribute.fsub.22488.declaration - public static Byte fsub = new Byte((byte)102); - // ino.end - // ino.attribute.dsub.22491.declaration - public static Byte dsub = new Byte((byte)103); - // ino.end - // ino.attribute.imul.22494.declaration - public static Byte imul = new Byte((byte)104); - // ino.end - // ino.attribute.lmul.22497.declaration - public static Byte lmul = new Byte((byte)105); - // ino.end - // ino.attribute.fmul.22500.declaration - public static Byte fmul = new Byte((byte)106); - // ino.end - // ino.attribute.dmul.22503.declaration - public static Byte dmul = new Byte((byte)107); - // ino.end - // ino.attribute.idiv.22506.declaration - public static Byte idiv = new Byte((byte)108); - // ino.end - // ino.attribute.ldiv.22509.declaration - public static Byte ldiv = new Byte((byte)109); - // ino.end - // ino.attribute.fdiv.22512.declaration - public static Byte fdiv = new Byte((byte)110); - // ino.end - // ino.attribute.ddiv.22515.declaration - public static Byte ddiv = new Byte((byte)111); - // ino.end - // ino.attribute.irem.22518.declaration - public static Byte irem = new Byte((byte)112); - // ino.end - // ino.attribute.lrem.22521.declaration - public static Byte lrem = new Byte((byte)113); - // ino.end - // ino.attribute.frem.22524.declaration - public static Byte frem = new Byte((byte)114); - // ino.end - // ino.attribute.drem.22527.declaration - public static Byte drem = new Byte((byte)115); - // ino.end - // ino.attribute.ineg.22530.declaration - public static Byte ineg = new Byte((byte)116); - // ino.end - // ino.attribute.lneg.22533.declaration - public static Byte lneg = new Byte((byte)117); - // ino.end - // ino.attribute.fneg.22536.declaration - public static Byte fneg = new Byte((byte)118); - // ino.end - // ino.attribute.dneg.22539.declaration - public static Byte dneg = new Byte((byte)119); - // ino.end - // ino.attribute.ishl.22542.declaration - public static Byte ishl = new Byte((byte)120); - // ino.end - // ino.attribute.lshl.22545.declaration - public static Byte lshl = new Byte((byte)121); - // ino.end - // ino.attribute.ishr.22548.declaration - public static Byte ishr = new Byte((byte)122); - // ino.end - // ino.attribute.lshr.22551.declaration - public static Byte lshr = new Byte((byte)123); - // ino.end - // ino.attribute.iushr.22554.declaration - public static Byte iushr = new Byte((byte)124); - // ino.end - // ino.attribute.lushr.22557.declaration - public static Byte lushr = new Byte((byte)125); - // ino.end - // ino.attribute.iand.22560.declaration - public static Byte iand = new Byte((byte)126); - // ino.end - // ino.attribute.land.22563.declaration - public static Byte land = new Byte((byte)127); - // ino.end - // ino.attribute.ior.22566.declaration - public static Byte ior = new Byte((byte)128); - // ino.end - // ino.attribute.lor.22569.declaration - public static Byte lor = new Byte((byte)129); - // ino.end - // ino.attribute.ixor.22572.declaration - public static Byte ixor = new Byte((byte)130); - // ino.end - // ino.attribute.lxor.22575.declaration - public static Byte lxor = new Byte((byte)131); - // ino.end - // ino.attribute.iinc.22578.declaration - public static Byte iinc = new Byte((byte)132); - // ino.end - // ino.attribute.i2l.22581.declaration - public static Byte i2l = new Byte((byte)133); - // ino.end - // ino.attribute.i2f.22584.declaration - public static Byte i2f = new Byte((byte)134); - // ino.end - // ino.attribute.i2d.22587.declaration - public static Byte i2d = new Byte((byte)135); - // ino.end - // ino.attribute.l2i.22590.declaration - public static Byte l2i = new Byte((byte)136); - // ino.end - // ino.attribute.l2f.22593.declaration - public static Byte l2f = new Byte((byte)137); - // ino.end - // ino.attribute.l2d.22596.declaration - public static Byte l2d = new Byte((byte)138); - // ino.end - // ino.attribute.f2i.22599.declaration - public static Byte f2i = new Byte((byte)139); - // ino.end - // ino.attribute.f2l.22602.declaration - public static Byte f2l = new Byte((byte)140); - // ino.end - // ino.attribute.f2d.22605.declaration - public static Byte f2d = new Byte((byte)141); - // ino.end - // ino.attribute.d2i.22608.declaration - public static Byte d2i = new Byte((byte)142); - // ino.end - // ino.attribute.d2l.22611.declaration - public static Byte d2l = new Byte((byte)143); - // ino.end - // ino.attribute.d2f.22614.declaration - public static Byte d2f = new Byte((byte)144); - // ino.end - // ino.attribute.i2b.22617.declaration - public static Byte i2b = new Byte((byte)145); - // ino.end - // ino.attribute.i2c.22620.declaration - public static Byte i2c = new Byte((byte)146); - // ino.end - // ino.attribute.i2s.22623.declaration - public static Byte i2s = new Byte((byte)147); - // ino.end - // ino.attribute.lcmp.22626.declaration - public static Byte lcmp = new Byte((byte)148); - // ino.end - // ino.attribute.fcmpl.22629.declaration - public static Byte fcmpl = new Byte((byte)149); - // ino.end - // ino.attribute.fcmpg.22632.declaration - public static Byte fcmpg = new Byte((byte)150); - // ino.end - // ino.attribute.dcmpl.22635.declaration - public static Byte dcmpl = new Byte((byte)151); - // ino.end - // ino.attribute.dcmpg.22638.declaration - public static Byte dcmpg = new Byte((byte)152); - // ino.end - // ino.attribute.ifeq.22641.declaration - public static Byte ifeq = new Byte((byte)153); - // ino.end - // ino.attribute.ifne.22644.declaration - public static Byte ifne = new Byte((byte)154); - // ino.end - // ino.attribute.iflt.22647.declaration - public static Byte iflt = new Byte((byte)155); - // ino.end - // ino.attribute.ifge.22650.declaration - public static Byte ifge = new Byte((byte)156); - // ino.end - // ino.attribute.ifgt.22653.declaration - public static Byte ifgt = new Byte((byte)157); - // ino.end - // ino.attribute.ifle.22656.declaration - public static Byte ifle = new Byte((byte)158); - // ino.end - // ino.attribute.if_icmpeq.22659.declaration - public static Byte if_icmpeq = new Byte((byte)159); - // ino.end - // ino.attribute.if_icmpne.22662.declaration - public static Byte if_icmpne = new Byte((byte)160); - // ino.end - // ino.attribute.if_icmplt.22665.declaration - public static Byte if_icmplt = new Byte((byte)161); - // ino.end - // ino.attribute.if_icmpge.22668.declaration - public static Byte if_icmpge = new Byte((byte)162); - // ino.end - // ino.attribute.if_icmpgt.22671.declaration - public static Byte if_icmpgt = new Byte((byte)163); - // ino.end - // ino.attribute.if_icmple.22674.declaration - public static Byte if_icmple = new Byte((byte)164); - // ino.end - // ino.attribute.if_acmpeq.22677.declaration - public static Byte if_acmpeq = new Byte((byte)165); - // ino.end - // ino.attribute.if_acmpne.22680.declaration - public static Byte if_acmpne = new Byte((byte)166); - // ino.end - // ino.attribute.goto_.22683.declaration - public static Byte goto_ = new Byte((byte)167); - // ino.end - // ino.attribute.jsr.22686.declaration - public static Byte jsr = new Byte((byte)168); - // ino.end - // ino.attribute.ret.22689.declaration - public static Byte ret = new Byte((byte)169); - // ino.end - // ino.attribute.tableswitch.22692.declaration - public static Byte tableswitch = new Byte((byte)170); - // ino.end - // ino.attribute.lookupswitch.22695.declaration - public static Byte lookupswitch = new Byte((byte)171); - // ino.end - // ino.attribute.ireturn.22698.declaration - public static Byte ireturn = new Byte((byte)172); - // ino.end - // ino.attribute.lreturn.22701.declaration - public static Byte lreturn = new Byte((byte)173); - // ino.end - // ino.attribute.freturn.22704.declaration - public static Byte freturn = new Byte((byte)174); - // ino.end - // ino.attribute.dreturn.22707.declaration - public static Byte dreturn = new Byte((byte)175); - // ino.end - // ino.attribute.areturn.22710.declaration - public static Byte areturn = new Byte((byte)176); - // ino.end - // ino.attribute.return_.22713.declaration - public static Byte return_ = new Byte((byte)177); - // ino.end - // ino.attribute.getstatic.22716.declaration - public static Byte getstatic = new Byte((byte)178); - // ino.end - // ino.attribute.putstatic.22719.declaration - public static Byte putstatic = new Byte((byte)179); - // ino.end - // ino.attribute.getfield.22722.declaration - public static Byte getfield = new Byte((byte)180); - // ino.end - // ino.attribute.putfield.22725.declaration - public static Byte putfield = new Byte((byte)181); - // ino.end - // ino.attribute.invokevirtual.22728.declaration - public static Byte invokevirtual = new Byte((byte)182); - // ino.end - // ino.attribute.invokespecial.22731.declaration - public static Byte invokespecial = new Byte((byte)183); - // ino.end - // ino.attribute.invokestatic.22734.declaration - public static Byte invokestatic = new Byte((byte)184); - // ino.end - // ino.attribute.invokeinterface.22737.declaration - public static Byte invokeinterface = new Byte((byte)185); - // ino.end - // ino.attribute.new_.22740.declaration - public static Byte new_ = new Byte((byte)187); - // ino.end - // ino.attribute.newarray.22743.declaration - public static Byte newarray = new Byte((byte)188); - // ino.end - // ino.attribute.anewarray.22746.declaration - public static Byte anewarray = new Byte((byte)189); - // ino.end - // ino.attribute.arraylength.22749.declaration - public static Byte arraylength = new Byte((byte)190); - // ino.end - // ino.attribute.athrow.22752.declaration - public static Byte athrow = new Byte((byte)191); - // ino.end - // ino.attribute.checkcast.22755.declaration - public static Byte checkcast = new Byte((byte)192); - // ino.end - // ino.attribute.instanceof_.22758.declaration - public static Byte instanceof_ = new Byte((byte)193); - // ino.end - // ino.attribute.monitorenter.22761.declaration - public static Byte monitorenter = new Byte((byte)194); - // ino.end - // ino.attribute.monitorexit.22764.declaration - public static Byte monitorexit = new Byte((byte)195); - // ino.end - // ino.attribute.wide.22767.declaration - public static Byte wide = new Byte((byte)196); - // ino.end - // ino.attribute.multianewarray.22770.declaration - public static Byte multianewarray = new Byte((byte)197); - // ino.end - // ino.attribute.ifnull.22773.declaration - public static Byte ifnull = new Byte((byte)198); - // ino.end - // ino.attribute.ifnonnull.22776.declaration - public static Byte ifnonnull = new Byte((byte)199); - // ino.end - // ino.attribute.goto_w.22779.declaration - public static Byte goto_w = new Byte((byte)200); - // ino.end - // ino.attribute.jsr_w.22782.declaration - public static Byte jsr_w = new Byte((byte)201); - // ino.end - // ino.attribute.breakpoint.22785.declaration - public static Byte breakpoint = new Byte((byte)202); - // ino.end - // ino.attribute.impdep1.22788.declaration - public static Byte impdep1 = new Byte((byte)254); - // ino.end - // ino.attribute.impdep2.22791.declaration - public static Byte impdep2 = new Byte((byte)255); - // ino.end - - - - // ino.method.nconst_n.22794.definition - public static Byte nconst_n(String s1, int n2) - throws JVMCodeException - // ino.end - // ino.method.nconst_n.22794.body - { - int n1 = get_nType(s1); - switch(n1) { - case 0: { - if (n2 >= 0 && n2 <= 5) return new Byte((byte)(3 + n2)); - else break; - } - case 1: { - if (n2 >= 0 && n2 <= 2) return new Byte((byte)(9 + n2)); - else break; - } - case 2: { - if (n2 >= 0 && n2 <= 3) return new Byte((byte)(11 + n2)); - else break; - } - case 3: { - if (n2 >= 0 && n2 <= 2) return new Byte((byte)(14 + n2)); - else break; - } - } - throw new JVMCodeException("JVMCodeException: jvmCode: Byte nconst_n(String s1, int n2)"); - } - // ino.end - - // ino.method.nload.22797.definition - public static Byte nload(String s) - // ino.end - // ino.method.nload.22797.body - { - int n = get_nType(s); - if (n >= 0 && n <= 4) return new Byte((byte)(21 + n)); - else return new Byte((byte)21); - } - // ino.end - - // ino.method.nload_n.22800.definition - public static Byte nload_n(String s1, int n2) - throws JVMCodeException - // ino.end - // ino.method.nload_n.22800.body - { - int n1 = get_nType(s1); - if(n2 >= 0 && n2 <= 3) { - if (n1 >= 0 && n1 <= 4) return new Byte((byte)(26 + (n1*4) + n2)); - else return new Byte((byte)(26 + n2)); - } - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte nload_n(String s1, int n2)"); - } - // ino.end - - // ino.method.naload.22803.definition - public static Byte naload(String s) - throws JVMCodeException - // ino.end - // ino.method.naload.22803.body - { - int n = get_nType(s); - if (n >= 0 && n <= 7) return new Byte((byte)(46 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte naload(String s)"); - } - // ino.end - - // ino.method.nstore.22806.definition - public static Byte nstore(String s) - // ino.end - // ino.method.nstore.22806.body - { - int n = get_nType(s); - if (n >= 0 && n <= 4) return new Byte((byte)(54 + n)); - else return new Byte((byte)54); - } - // ino.end - - // ino.method.nstore_n.22809.definition - public static Byte nstore_n(String s1, int n2) - throws JVMCodeException - // ino.end - // ino.method.nstore_n.22809.body - { - int n1 = get_nType(s1); - if(n2 >= 0 && n2 <= 3) { - if (n1 >= 0 && n1 <= 4) return new Byte((byte)(59 + (n1*4) + n2)); - else return new Byte((byte)(59 + n2)); - } - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte nstore_n(String s1, int n2)"); - } - // ino.end - - // ino.method.nastore.22812.definition - public static Byte nastore(String s) - throws JVMCodeException - // ino.end - // ino.method.nastore.22812.body - { - int n = get_nType(s); - if (n >= 0 && n <= 7) return new Byte((byte)(79 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte nastore(String s)"); - } - // ino.end - - // ino.method.nadd.22815.definition - public static Byte nadd(String s) - throws JVMCodeException - // ino.end - // ino.method.nadd.22815.body - { - int n = get_nType(s); - if (n >= 0 && n <= 3) return new Byte((byte)(96 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte nadd(String s)"); - } - // ino.end - - // ino.method.nsub.22818.definition - public static Byte nsub(String s) - throws JVMCodeException - // ino.end - // ino.method.nsub.22818.body - { - int n = get_nType(s); - if (n >= 0 && n <= 3) return new Byte((byte)(100 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte nsub(String s)"); - } - // ino.end - - // ino.method.nmul.22821.definition - public static Byte nmul(String s) - throws JVMCodeException - // ino.end - // ino.method.nmul.22821.body - { - int n = get_nType(s); - if (n >= 0 && n <= 3) return new Byte((byte)(104 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte nmul(String s)"); - } - // ino.end - - // ino.method.ndiv.22824.definition - public static Byte ndiv(String s) - throws JVMCodeException - // ino.end - // ino.method.ndiv.22824.body - { - int n = get_nType(s); - if (n >= 0 && n <= 3) return new Byte((byte)(108 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte ndiv(String s)"); - } - // ino.end - - // ino.method.nrem.22827.definition - public static Byte nrem(String s) - throws JVMCodeException - // ino.end - // ino.method.nrem.22827.body - { - int n = get_nType(s); - if (n >= 0 && n <= 3) return new Byte((byte)(112 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte nrem(String s)"); - } - // ino.end - - // ino.method.nneg.22830.definition - public static Byte nneg(String s) - throws JVMCodeException - // ino.end - // ino.method.nneg.22830.body - { - int n = get_nType(s); - if (n >= 0 && n <= 3) return new Byte((byte)(116 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte nneg(String s)"); - } - // ino.end - - // ino.method.nshl.22833.definition - public static Byte nshl(String s) - throws JVMCodeException - // ino.end - // ino.method.nshl.22833.body - { - int n = get_nType(s); - if (n == 0 || n == 1) return new Byte((byte)(120 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte nshl(String s)"); - } - // ino.end - - // ino.method.nshr.22836.definition - public static Byte nshr(String s) - throws JVMCodeException - // ino.end - // ino.method.nshr.22836.body - { - int n = get_nType(s); - if (n == 0 || n == 1) return new Byte((byte)(122 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte nshr(String s)"); - } - // ino.end - - // ino.method.nushr.22839.definition - public static Byte nushr(String s) - throws JVMCodeException - // ino.end - // ino.method.nushr.22839.body - { - int n = get_nType(s); - if (n == 0 || n == 1) return new Byte((byte)(124 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte nushr(String s)"); - } - // ino.end - - // ino.method.nand.22842.definition - public static Byte nand(String s) - throws JVMCodeException - // ino.end - // ino.method.nand.22842.body - { - int n = get_nType(s); - if (n == 0 || n == 1) return new Byte((byte)(126 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte nand(String s)"); - } - // ino.end - - // ino.method.nor.22845.definition - public static Byte nor(String s) - throws JVMCodeException - // ino.end - // ino.method.nor.22845.body - { - int n = get_nType(s); - if (n == 0 || n == 1) return new Byte((byte)(128 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte nor(String s)"); - } - // ino.end - - // ino.method.nxor.22848.definition - public static Byte nxor(String s) - throws JVMCodeException - // ino.end - // ino.method.nxor.22848.body - { - int n = get_nType(s); - if (n == 0 || n == 1) return new Byte((byte)(130 + n)); - else throw new JVMCodeException("JVMCodeException: jvmCode: nxor(String s)"); - } - // ino.end - - // ino.method.n2n.22851.definition - public static Byte n2n(String s1, String s2) - throws JVMCodeException - // ino.end - // ino.method.n2n.22851.body - { - int n1 = get_nType(s1); - int n2 = get_nType(s2); - switch(n1) { - case 0: { - if (n2 >= 1 && n2 <= 3) return new Byte((byte)(132 + n2)); - if (n2 >= 5 && n2 <= 7) return new Byte((byte)(140 + n2)); - else break; - } - case 1: { - if (n2 == 0) return new Byte((byte)136); - else if (n2 == 2) return new Byte((byte)137); - else if (n2 == 3) return new Byte((byte)138); - else break; - } - case 2: { - if (n2 == 0) return new Byte((byte)139); - else if (n2 == 1) return new Byte((byte)140); - else if (n2 == 3) return new Byte((byte)141); - else break; - } - case 3: { - if (n2 >= 0 && n2 <= 2) return new Byte((byte)(142 + n2)); - else break; - } - } - throw new JVMCodeException("JVMCodeException: jvmCode: Byte n2n(String s1, String s2)"); - } - // ino.end - - // ino.method.ncmpl.22854.definition - public static Byte ncmpl(String s) - throws JVMCodeException - // ino.end - // ino.method.ncmpl.22854.body - { - int n = get_nType(s); - if (n == 2) return new Byte((byte)149); - else if (n == 3) return new Byte((byte)151); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte ncmpl(String s)"); - } - // ino.end - - // ino.method.ncmpg.22857.definition - public static Byte ncmpg(String s) - throws JVMCodeException - // ino.end - // ino.method.ncmpg.22857.body - { - int n = get_nType(s); - if (n == 2) return new Byte((byte)150); - else if (n == 3) return new Byte((byte)152); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte ncmpg(String s)"); - } - // ino.end - - // ino.method.if_ncmpeq.22860.definition - public static Byte if_ncmpeq(String s) - throws JVMCodeException - // ino.end - // ino.method.if_ncmpeq.22860.body - { - int n = get_nType(s); - if (n == 0) return new Byte((byte)159); - else if (n == 4) return new Byte((byte)165); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte if_ncmpeq(String s)"); - } - // ino.end - - // ino.method.if_ncmpne.22863.definition - public static Byte if_ncmpne(String s) - throws JVMCodeException - // ino.end - // ino.method.if_ncmpne.22863.body - { - int n = get_nType(s); - if (n == 0) return new Byte((byte)160); - else if (n == 4) return new Byte((byte)166); - else throw new JVMCodeException("JVMCodeException: jvmCode: Byte if_ncmpne(String s)"); - } - // ino.end - - // ino.method.nreturn.22866.definition - public static Byte nreturn(String s) - // ino.end - // ino.method.nreturn.22866.body - { - int n = get_nType(s); - if (n >= 0 && n <= 4) return new Byte((byte)(172 + n)); - else return new Byte((byte)(177)); - } - // ino.end - - // ino.method.get_nType.22869.definition - public static int get_nType(String type) - // ino.end - // ino.method.get_nType.22869.body - { - if(type.equals("void")) return 8; - else if(type.equals("int") || type.equals("boolean")) return 0; - else if(type.equals("long")) return 1; - else if(type.equals("float")) return 2; - else if(type.equals("double")) return 3; - else if(type.equals("byte")) return 5; - else if(type.equals("char")) return 6; - else if(type.equals("short")) return 7; - else return 4; - } - // ino.end - - - - // ino.method.get_codegen_Type.22872.defdescription type=javadoc - /** - * Liefert zu dem angegebenen Typ die entsprechende Repraesentation - * im Bytecode zurueck. Fuer integer bspw. I, fuer String Ljava/lang/String;. - * Wird im Menge paralist ein Objekt mit gleichen Namen gefunden, - * wird der Typ in Objekt geaendert (Typisierbare Klassen, hama). - */ - // ino.end - // ino.method.get_codegen_Type.22872.definition - public static String get_codegen_Type(String type, Menge paralist) - // ino.end - // ino.method.get_codegen_Type.22872.body - { - //hama: Hier wird geschaut, ob es im Menge paralist - //einen Eintrag mit gleichem Namen wie in dem type String gibt. - //Wenn dies der Fall ist, bedeute es, dass es sich um einen Typparameter - //handelt (bzw. handeln kann). Dann wird in type - //anstatt dem alten Namen - Object hineingeschieben. - //Dies ist fuer Codeerzeugung bei Typparametern erforderlich. - - if(paralist != null && !paralist.isEmpty()) - { - for(int i=0 ; i b) - throws JVMCodeException - // ino.end - // ino.method.get_Command.22875.body - { - StringBuffer sb = new StringBuffer(); - - sb.append(" {\n"); - for(int i=0; i < b.size(); i++) { - int x = bytes_to_int(b.elementAt(i)); - sb.append(" " + i + " "); - switch(x) { - case 0: { sb.append("nop"); break; } - case 1: { sb.append("aconst_null"); break; } - case 2: { sb.append("iconst_m1"); break; } - case 3: { sb.append("iconst_0"); break; } - case 4: { sb.append("iconst_1"); break; } - case 5: { sb.append("iconst_2"); break; } - case 6: { sb.append("iconst_3"); break; } - case 7: { sb.append("iconst_4"); break; } - case 8: { sb.append("iconst_5"); break; } - case 9: { sb.append("lconst_0"); break; } - case 10: { sb.append("lconst_1"); break; } - case 11: { sb.append("fconst_0"); break; } - case 12: { sb.append("fconst_1"); break; } - case 13: { sb.append("fconst_2"); break; } - case 14: { sb.append("dconst_0"); break; } - case 15: { sb.append("dconst_1"); break; } - case 16: { sb.append("bipush " + bytes_to_int(b.elementAt(++i))); break; } - case 17: { sb.append("sipush #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 18: { sb.append("ldc " + bytes_to_int(b.elementAt(++i))); break; } - case 19: { sb.append("ldc_w #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 20: { sb.append("ldc2_w #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 21: { sb.append("iload " + bytes_to_int(b.elementAt(++i))); break; } - case 22: { sb.append("lload " + bytes_to_int(b.elementAt(++i))); break; } - case 23: { sb.append("fload " + bytes_to_int(b.elementAt(++i))); break; } - case 24: { sb.append("dload " + bytes_to_int(b.elementAt(++i))); break; } - case 25: { sb.append("aload " + bytes_to_int(b.elementAt(++i))); break; } - case 26: { sb.append("iload_0"); break; } - case 27: { sb.append("iload_1"); break; } - case 28: { sb.append("iload_2"); break; } - case 29: { sb.append("iload_3"); break; } - case 30: { sb.append("lload_0"); break; } - case 31: { sb.append("lload_1"); break; } - case 32: { sb.append("lload_2"); break; } - case 33: { sb.append("lload_3"); break; } - case 34: { sb.append("fload_0"); break; } - case 35: { sb.append("fload_1"); break; } - case 36: { sb.append("fload_2"); break; } - case 37: { sb.append("fload_3"); break; } - case 38: { sb.append("dload_0"); break; } - case 39: { sb.append("dload_1"); break; } - case 40: { sb.append("dload_2"); break; } - case 41: { sb.append("dload_3"); break; } - case 42: { sb.append("aload_0"); break; } - case 43: { sb.append("aload_1"); break; } - case 44: { sb.append("aload_2"); break; } - case 45: { sb.append("aload_3"); break; } - case 46: { sb.append("iaload"); break; } - case 47: { sb.append("laload"); break; } - case 48: { sb.append("faload"); break; } - case 49: { sb.append("daload"); break; } - case 50: { sb.append("aaload"); break; } - case 51: { sb.append("baload"); break; } - case 52: { sb.append("caload"); break; } - case 53: { sb.append("saload"); break; } - case 54: { sb.append("istore " + bytes_to_int(b.elementAt(++i))); break; } - case 55: { sb.append("lstore " + bytes_to_int(b.elementAt(++i))); break; } - case 56: { sb.append("fstore " + bytes_to_int(b.elementAt(++i))); break; } - case 57: { sb.append("dstore " + bytes_to_int(b.elementAt(++i))); break; } - case 58: { sb.append("astore " + bytes_to_int(b.elementAt(++i))); break; } - case 59: { sb.append("istore_0"); break; } - case 60: { sb.append("istore_1"); break; } - case 61: { sb.append("istore_2"); break; } - case 62: { sb.append("istore_3"); break; } - case 63: { sb.append("lstore_0"); break; } - case 64: { sb.append("lstore_1"); break; } - case 65: { sb.append("lstore_2"); break; } - case 66: { sb.append("lstore_3"); break; } - case 67: { sb.append("fstore_0"); break; } - case 68: { sb.append("fstore_1"); break; } - case 69: { sb.append("fstore_2"); break; } - case 70: { sb.append("fstore_3"); break; } - case 71: { sb.append("dstore_0"); break; } - case 72: { sb.append("dstore_1"); break; } - case 73: { sb.append("dstore_2"); break; } - case 74: { sb.append("dstore_3"); break; } - case 75: { sb.append("astore_0"); break; } - case 76: { sb.append("astore_1"); break; } - case 77: { sb.append("astore_2"); break; } - case 78: { sb.append("astore_3"); break; } - case 79: { sb.append("iastore"); break; } - case 80: { sb.append("lastore"); break; } - case 81: { sb.append("fastore"); break; } - case 82: { sb.append("dastore"); break; } - case 83: { sb.append("aastore"); break; } - case 84: { sb.append("bastore"); break; } - case 85: { sb.append("castore"); break; } - case 86: { sb.append("sastore"); break; } - case 87: { sb.append("pop"); break; } - case 88: { sb.append("pop2"); break; } - case 89: { sb.append("dup"); break; } - case 90: { sb.append("dup_x1"); break; } - case 91: { sb.append("dup_x2"); break; } - case 92: { sb.append("dup2"); break; } - case 93: { sb.append("dup2_x1"); break; } - case 94: { sb.append("dup2_x2"); break; } - case 95: { sb.append("swap"); break; } - case 96: { sb.append("iadd"); break; } - case 97: { sb.append("ladd"); break; } - case 98: { sb.append("fadd"); break; } - case 99: { sb.append("dadd"); break; } - case 100: { sb.append("isub"); break; } - case 101: { sb.append("lsub"); break; } - case 102: { sb.append("fsub"); break; } - case 103: { sb.append("dsub"); break; } - case 104: { sb.append("imul"); break; } - case 105: { sb.append("lmul"); break; } - case 106: { sb.append("fmul"); break; } - case 107: { sb.append("dmul"); break; } - case 108: { sb.append("idiv"); break; } - case 109: { sb.append("ldiv"); break; } - case 110: { sb.append("fdiv"); break; } - case 111: { sb.append("ddiv"); break; } - case 112: { sb.append("irem"); break; } - case 113: { sb.append("lrem"); break; } - case 114: { sb.append("frem"); break; } - case 115: { sb.append("drem"); break; } - case 116: { sb.append("ineg"); break; } - case 117: { sb.append("lneg"); break; } - case 118: { sb.append("fneg"); break; } - case 119: { sb.append("dneg"); break; } - case 120: { sb.append("ishl"); break; } - case 121: { sb.append("lshl"); break; } - case 122: { sb.append("ishr"); break; } - case 123: { sb.append("lshr"); break; } - case 124: { sb.append("iushr"); break; } - case 125: { sb.append("lushr"); break; } - case 126: { sb.append("iand"); break; } - case 127: { sb.append("land"); break; } - case 128: { sb.append("ior"); break; } - case 129: { sb.append("lor"); break; } - case 130: { sb.append("ixor"); break; } - case 131: { sb.append("lxor"); break; } - case 132: { sb.append("iinc " + bytes_to_int(b.elementAt(++i)) + " " + bytes_to_int(b.elementAt(++i))); break; } - case 133: { sb.append("i2l"); break; } - case 134: { sb.append("i2f"); break; } - case 135: { sb.append("i2d"); break; } - case 136: { sb.append("l2i"); break; } - case 137: { sb.append("l2f"); break; } - case 138: { sb.append("l2d"); break; } - case 139: { sb.append("f2i"); break; } - case 140: { sb.append("f2l"); break; } - case 141: { sb.append("f2d"); break; } - case 142: { sb.append("d2i"); break; } - case 143: { sb.append("d2l"); break; } - case 144: { sb.append("d2f"); break; } - case 145: { sb.append("i2b"); break; } - case 146: { sb.append("i2c"); break; } - case 147: { sb.append("i2s"); break; } - case 148: { sb.append("lcmp"); break; } - case 149: { sb.append("fcmpl"); break; } - case 150: { sb.append("fcmpg"); break; } - case 151: { sb.append("dcmpl"); break; } - case 152: { sb.append("dcmpg"); break; } - case 153: { sb.append("ifeq #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 154: { sb.append("ifne #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 155: { sb.append("iflt #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 156: { sb.append("ifge #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 157: { sb.append("ifgt #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 158: { sb.append("ifle #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 159: { sb.append("if_icmpeq #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 160: { sb.append("if_icmpne #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 161: { sb.append("if_icmplt #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 162: { sb.append("if_icmpge #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 163: { sb.append("if_icmpgt #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 164: { sb.append("if_icmple #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 165: { sb.append("if_acmpeq #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 166: { sb.append("if_acmpne #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 167: { sb.append("goto #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 168: { sb.append("jsr #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 169: { sb.append("ret " + bytes_to_int(b.elementAt(++i))); break; } - // case 170: { sb.append("tableswitch"); break; } - // case 171: { sb.append("lookupswitch"); break; } - case 172: { sb.append("ireturn"); break; } - case 173: { sb.append("lreturn"); break; } - case 174: { sb.append("freturn"); break; } - case 175: { sb.append("dreturn"); break; } - case 176: { sb.append("areturn"); break; } - case 177: { sb.append("return"); break; } - case 178: { sb.append("getstatic #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 179: { sb.append("putstatic #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 180: { sb.append("getfield #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 181: { sb.append("putfield #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 182: { sb.append("invokevirtual #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 183: { sb.append("invokespecial #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 184: { sb.append("invokestatic #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 185: { sb.append("invokeinterface #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i)) + " " + bytes_to_int(b.elementAt(++i)) + " " + bytes_to_int(b.elementAt(++i))); break; } - case 187: { sb.append("new " + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 188: { sb.append("newarray " + bytes_to_int(b.elementAt(++i))); break; } - case 189: { sb.append("anewarray #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 190: { sb.append("arraylength"); break; } - case 191: { sb.append("athrow"); break; } - case 192: { sb.append("checkcast #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 193: { sb.append("instanceof #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 194: { sb.append("monitorenter"); break; } - case 195: { sb.append("monitorexit"); break; } - // case 196: { sb.append("wide"); break; } - case 197: { sb.append("multianewarray #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i)) + " " + bytes_to_int(b.elementAt(++i))); break; } - case 198: { sb.append("ifnull #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 199: { sb.append("ifnonnull #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i))); break; } - case 200: { sb.append("goto_w #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i), b.elementAt(++i), b.elementAt(++i))); break; } - case 201: { sb.append("jsr_w #" + bytes_to_int(b.elementAt(++i), b.elementAt(++i), b.elementAt(++i), b.elementAt(++i))); break; } - case 202: { sb.append("breakpoint"); break; } - case 254: { sb.append("impdep1"); break; } - default: { throw new JVMCodeException("JVMCodeException: jvmCode: void get_Command(Menge b)"); } - } - sb.append("\n"); - } - sb.append(" }"); - bytecodelog.debug("Bytecode der Methode: \n" + sb.toString()); - } - // ino.end - - // ino.method.bytes_to_int.22878.definition - public static int bytes_to_int(Byte b3, Byte b2, Byte b1, Byte b0) - // ino.end - // ino.method.bytes_to_int.22878.body - { - int x3 = b3.intValue(); if(x3 < 0) x3 = 256 + x3; - int x2 = b2.intValue(); if(x2 < 0) x2 = 256 + x2; - int x1 = b1.intValue(); if(x1 < 0) x1 = 256 + x1; - int x0 = b0.intValue(); if(x0 < 0) x0 = 256 + x0; - return (x3 << 24) + (x2 << 16) + (x1 << 8) + x0; - } - // ino.end - - // ino.method.bytes_to_int.22881.definition - public static int bytes_to_int(Byte b1, Byte b0) - // ino.end - // ino.method.bytes_to_int.22881.body - { - int x1 = b1.intValue(); if(x1 < 0) x1 = 256 + x1; - int x0 = b0.intValue(); if(x0 < 0) x0 = 256 + x0; - return (x1 << 8) + x0; - } - // ino.end - - // ino.method.bytes_to_int.22884.definition - public static int bytes_to_int(Byte b) - // ino.end - // ino.method.bytes_to_int.22884.body - { - int x = b.intValue(); if(x < 0) x = 256 + x; - return x; - } - // ino.end - - // ino.method.shortToBytes.22887.definition - public static byte[] shortToBytes(short i) - // ino.end - // ino.method.shortToBytes.22887.body - { - byte[] wert = new byte[2]; - wert[0] = (byte) ((i >>> 8) & 255); - wert[1] = (byte) ((i & 255)); - - return wert; - } - // ino.end - - - -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/Key.java b/src/de/dhbwstuttgart/bytecode/Key.java deleted file mode 100755 index 6f4eee5bf..000000000 --- a/src/de/dhbwstuttgart/bytecode/Key.java +++ /dev/null @@ -1,125 +0,0 @@ -// ino.module.Key.8548.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.Key.8548.import -import java.io.FileOutputStream; -import java.io.OutputStream; - -import de.dhbwstuttgart.logger.Logger; -// ino.end - -// ino.class.Key.22890.declaration -public class Key implements ClassFileMember -// ino.end -// ino.class.Key.22890.body -{ - // ino.attribute.tag.22893.declaration - private byte tag; - // ino.end - // ino.attribute.a.22896.declaration - private String a; - // ino.end - // ino.attribute.codegenlog.22899.decldescription type=line - // Logger fuer Code-Gen - // ino.end - // ino.attribute.codegenlog.22899.declaration - protected static Logger codegenlog = Logger.getLogger("codegen"); - // ino.end - - // ino.method.Key.22902.definition - public Key(byte t, String a) - // ino.end - // ino.method.Key.22902.body - { - this.tag = t; - this.a = a; - } - // ino.end - - // ino.method.equals.22905.definition - public boolean equals(Object obj) - // ino.end - // ino.method.equals.22905.body - { - if (obj instanceof Key) { - Key key_object = (Key) obj; - if (this.tag == key_object.get_tag() - && this.a.equals(key_object.get_a())) - return true; - } - return false; - } - // ino.end - - // ino.method.get_tag.22908.definition - public byte get_tag() - // ino.end - // ino.method.get_tag.22908.body - { - return tag; - } - // ino.end - - // ino.method.get_a.22911.definition - public String get_a() - // ino.end - // ino.method.get_a.22911.body - { - return a; - } - // ino.end - - // ino.method.set_tag.22914.definition - public void set_tag(byte t) - // ino.end - // ino.method.set_tag.22914.body - { - this.tag = t; - } - // ino.end - - // ino.method.set_a.22917.definition - public void set_a(String s) - // ino.end - // ino.method.set_a.22917.body - { - this.a = s; - } - // ino.end - - // ino.method.codegen.22920.definition - @Override - public void codegen(ClassFile classfile, OutputStream f) - // ino.end - // ino.method.codegen.22920.body - { - String tag_string = new String(); - if (tag == (byte) 1) - tag_string = "CONSTANT_Utf8"; - else if (tag == JVMCode.CONSTANT_Integer) - tag_string = "CONSTANT_Integer"; - else if (tag == JVMCode.CONSTANT_Float) - tag_string = "CONSTANT_Float"; - else if (tag == JVMCode.CONSTANT_Long) - tag_string = "CONSTANT_Long"; - else if (tag == JVMCode.CONSTANT_Double) - tag_string = "CONSTANT_Double"; - else if (tag == JVMCode.CONSTANT_Class) - tag_string = "CONSTANT_Class"; - else if (tag == JVMCode.CONSTANT_String) - tag_string = "CONSTANT_String"; - else if (tag == JVMCode.CONSTANT_Fieldref) - tag_string = "CONSTANT_Fieldref"; - else if (tag == JVMCode.CONSTANT_Methodref) - tag_string = "CONSTANT_Methodref"; - else if (tag == JVMCode.CONSTANT_InterfaceMethodref) - tag_string = "CONSTANT_InterfaceMethodref"; - else if (tag == JVMCode.CONSTANT_NameAndType) - tag_string = "CONSTANT_NameAndType"; - - codegenlog.debug(tag_string + " " + a); - } - // ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/MethodInfo.java b/src/de/dhbwstuttgart/bytecode/MethodInfo.java deleted file mode 100755 index 1733a93fa..000000000 --- a/src/de/dhbwstuttgart/bytecode/MethodInfo.java +++ /dev/null @@ -1,138 +0,0 @@ -// ino.module.MethodInfo.8549.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.MethodInfo.8549.import -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.logger.Logger; -// ino.end - -import de.dhbwstuttgart.myexception.JVMCodeException; - -// ino.class.MethodInfo.22923.declaration -public class MethodInfo implements ClassFileMember -// ino.end -// ino.class.MethodInfo.22923.body -{ - // ino.attribute.codegenlog.22926.decldescription type=line - // Logger fuer Code-Gen - // ino.end - // ino.attribute.codegenlog.22926.declaration - protected static Logger codegenlog = Logger.getLogger("codegen"); - // ino.end - - // ino.attribute.access_flags.22929.declaration - private short access_flags; - // ino.end - - // ino.attribute.name_index.22932.declaration - private short name_index; - // ino.end - - // ino.attribute.descriptor_index.22935.declaration - private short descriptor_index; - // ino.end - - // ino.attribute.attributes.22938.declaration - private Menge attributes = new Menge(); - // ino.end - - // ino.method.get_access_flags.22941.definition - public short get_access_flags() - // ino.end - // ino.method.get_access_flags.22941.body - { - return this.access_flags; - } - // ino.end - - // ino.method.get_name_index.22944.definition - public short get_name_index() - // ino.end - // ino.method.get_name_index.22944.body - { - return this.name_index; - } - // ino.end - - // ino.method.get_descriptor_index.22947.definition - public short get_descriptor_index() - // ino.end - // ino.method.get_descriptor_index.22947.body - { - return this.descriptor_index; - } - // ino.end - - // ino.method.get_attributes.22950.definition - public Menge get_attributes() - // ino.end - // ino.method.get_attributes.22950.body - { - return this.attributes; - } - // ino.end - - // ino.method.set_access_flags.22953.definition - public void set_access_flags(short t) - // ino.end - // ino.method.set_access_flags.22953.body - { - this.access_flags = t; - } - // ino.end - - // ino.method.set_name_index.22956.definition - public void set_name_index(short t) - // ino.end - // ino.method.set_name_index.22956.body - { - this.name_index = t; - } - // ino.end - - // ino.method.set_descriptor_index.22959.definition - public void set_descriptor_index(short t) - // ino.end - // ino.method.set_descriptor_index.22959.body - { - this.descriptor_index = t; - } - // ino.end - - // ino.method.set_attributes.22962.definition - public void set_attributes(Menge t) - // ino.end - // ino.method.set_attributes.22962.body - { - this.attributes = t; - } - // ino.end - - // ino.method.codegen.22965.definition - public void codegen(ClassFile classfile, OutputStream f) - throws JVMCodeException, IOException - // ino.end -// ino.method.codegen.22965.body -{ - classfile.writeShort(f, access_flags); - classfile.writeShort(f, name_index); - classfile.writeShort(f, descriptor_index); - classfile.writeShort(f, (short) attributes.size()); - - codegenlog.debug("MethodInfo: acc_flag=" + access_flags - + ", name_index=" + name_index + ", descriptor_index=" - + descriptor_index + ", attributes_count=" + attributes.size()); - - if (attributes != null) - for (int i = 0; i < attributes.size(); i++) { - attributes.elementAt(i).codegen(classfile, f); - } - } -// ino.end -} -// ino.end diff --git a/src/de/dhbwstuttgart/bytecode/SignatureInfo.java b/src/de/dhbwstuttgart/bytecode/SignatureInfo.java deleted file mode 100755 index 11d57d233..000000000 --- a/src/de/dhbwstuttgart/bytecode/SignatureInfo.java +++ /dev/null @@ -1,276 +0,0 @@ -// ino.module.SignatureInfo.8550.package -package de.dhbwstuttgart.bytecode; -// ino.end - -// ino.module.SignatureInfo.8550.import -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.logger.Logger; -// ino.end - - - - - -import de.dhbwstuttgart.myexception.JVMCodeException; -import de.dhbwstuttgart.syntaxtree.ParameterList; -import de.dhbwstuttgart.syntaxtree.misc.UsedId; -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import sun.reflect.generics.reflectiveObjects.NotImplementedException; - -// ino.class.SignatureInfo.22968.description type=javadoc -/** - * Generiert die Attribute eines Fields, einer Methode oder einer Klasse/Interface - * zur Integration der Signatur (Generics). - * @author SCJU - */ -// ino.end -// ino.class.SignatureInfo.22968.declaration -public class SignatureInfo extends Attribute -// ino.end -// ino.class.SignatureInfo.22968.body -{ - // ino.attribute.signatureID.22972.decldescription type=line - // UTF-8 Konstante mit der Signatur selbst - // ino.end - // ino.attribute.signatureID.22972.declaration - private short signatureID = 0; - // ino.end - - // ino.attribute.codegenlog.22975.decldescription type=line - // Logger fuer Code-Gen - // ino.end - // ino.attribute.codegenlog.22975.declaration - protected static Logger codegenlog = Logger.getLogger("codegen"); - // ino.end - - - public SignatureInfo(short sid) { - signatureID = sid; - } - // ino.method.SignatureInfo.22978.defdescription type=javadoc - /** - * Konstruktor fuer die Signatur einer Klasse bzw. eines Interfaces. - */ - // ino.end - // ino.method.SignatureInfo.22978.definition - public SignatureInfo(Menge vec, UsedId superclass, Menge superIf, ClassFile cf) - // ino.end - // ino.method.SignatureInfo.22978.body - { - StringBuffer sb = new StringBuffer(); - sb.append("<"); - set_attribute_name_index(cf.getSignatureID()); - - // Parameterliste verarbeiten, falls vorhanden - Type type; - for (int i=0; i"); - - - if (superclass == null && (superIf == null || superIf.size() == 0)) { - // Falls keine Superclassen oder Interfaces angegeben wurden, - // wird per Definition wird nochmals "Ljava/lang/Object;" angehaengt - sb.append(JVMCode.get_codegen_Type("Object", null)); - } else { - if (superclass != null) sb.append(superclass.getSignatureUsedId()); - - if (superIf != null && superIf.size() > 0) { - for (int i=0; i"); - } - - sig.append("("); - - // Parameterliste verarbeiten, falls vorhanden - if (param != null) { - for (int i=0; i filenames){ Menge resultSet = null; - MyCompilerAPI compiler = MyCompiler.getAPI(); + MyCompilerAPI compiler = MyCompiler.getAPI(new LoggerConfiguration()); try{ ///////////////////////// // Parsen: @@ -47,7 +48,7 @@ public class ConsoleInterface { /////////////////////// // Ausgabe: /////////////////////// - if(resultSet == null)System.out.println("Keine Lösung!"); + if(resultSet == null)System.out.println("Keine Lösung!"); ArrayList resultJavaCodes = new ArrayList(); for(TypeinferenceResultSet result : resultSet){ String javaCode = result.getInterferedClass().printJavaCode(result); @@ -55,7 +56,7 @@ public class ConsoleInterface { } for(String out : resultJavaCodes){ - System.out.println("\nMögliche Typisierung:\n\n"); + System.out.println("\nMögliche Typisierung:\n\n"); System.out.println(out); } }catch(Exception e){ diff --git a/src/de/dhbwstuttgart/core/MyCompiler.java b/src/de/dhbwstuttgart/core/MyCompiler.java index 3866e2aac..4304e55a0 100755 --- a/src/de/dhbwstuttgart/core/MyCompiler.java +++ b/src/de/dhbwstuttgart/core/MyCompiler.java @@ -16,7 +16,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; import de.dhbwstuttgart.logger.LoggerConfiguration; import de.dhbwstuttgart.logger.Section; -import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.parser.JavaParser; @@ -83,7 +82,7 @@ public class MyCompiler implements MyCompilerAPI // ino.attribute.m_AbstractSyntaxTree.21280.decldescription type=javadoc /** * Der abstrake Syntaxbaum - *
Autor: J�rg B�uerle + *
Autor: J�rg B�uerle */ // ino.end // ino.attribute.m_AbstractSyntaxTree.21280.declaration @@ -92,10 +91,10 @@ public class MyCompiler implements MyCompilerAPI // ino.method.MyCompiler.21283.defdescription type=javadoc /** - * Author: J�rg B�uerle
- * Der private Konstruktor. Es soll von au�en kein Compiler angelegt werden - * k�nnen, sondern nur eine API zur Verf�gung gestellt werden. - * @param logger Konfiguration für Debug Ausgabe TODO + * Author: J�rg B�uerle
+ * Der private Konstruktor. Es soll von au�en kein Compiler angelegt werden + * k�nnen, sondern nur eine API zur Verf�gung gestellt werden. + * @param logger Konfiguration für Debug Ausgabe TODO */ // ino.end // ino.method.MyCompiler.21283.definition @@ -109,8 +108,8 @@ public class MyCompiler implements MyCompilerAPI // ino.method.getAPI.21286.defdescription type=javadoc /** - * Author: J�rg B�uerle
- * Stellt eine neue Instanz der CompilerAPI zur Verf�gung. + * Author: Jörg Bäuerle
+ * Stellt eine neue Instanz der CompilerAPI zur Verf�gung. * Diese Methode sollte von der IDE aus aufgerufen werden, * um eine Quellcode-Datei zu kompilieren. * @return Die Compiler-API @@ -132,8 +131,8 @@ public class MyCompiler implements MyCompilerAPI /** * Author: Thomas Ott
* Ersetzt in der Superklassenparameterliste einer Klasse, diejenigen - * GenericTypeVars, zu denen es eine Klasse gibt, die gleich hei�t. - * Beim Parsen werden n�mlich vom Jay nur GenericTypeVars erzeugt und keine + * GenericTypeVars, zu denen es eine Klasse gibt, die gleich hei�t. + * Beim Parsen werden n�mlich vom Jay nur GenericTypeVars erzeugt und keine * RefTypes. Dies wird durch diese Methode nachgeholt.
* Bsp.: class JoergsTolleKlasse extends MartinsSuperklasse *
Wie man an diesem Beispiel sieht, kann nur eine Superklasse instantiierte @@ -153,7 +152,7 @@ public class MyCompiler implements MyCompilerAPI //wandleGeneric2RefType SOLLTE NICHT NUR FUER LISTEN //VON TYPEN FUNKTIONIEREN PL 05-01-19 // otth: GenericTypeVar in Superklassenparameterlisten in RefTypes mit Parameterlsite = NULL umwandeln, - // falls: f�r GenericTypeVar existiert eine gleichnamige Klasse + // falls: f�r GenericTypeVar existiert eine gleichnamige Klasse if(Parameter == null) return; for( int i = 0; i < Parameter.size(); i++) @@ -165,7 +164,7 @@ public class MyCompiler implements MyCompilerAPI if ( TempParameter instanceof GenericTypeVar) { inferencelog.debug("Generic, WANDLE: " + TempParameter.getName()); - // existiert f�r GenericTypeVar eine deklarierte Klasse + // existiert f�r GenericTypeVar eine deklarierte Klasse for( int k = 0; k < KlassenVektor.size(); k++) { if( KlassenVektor.elementAt(k).getSimpleName().equals(TempParameter.getSimpleName()) ) @@ -228,9 +227,9 @@ public class MyCompiler implements MyCompilerAPI /** * Parst den Quellcode und baut den abstrakten Syntaxbaum auf. Danach wird * automatisch der von Thomas Ott implementierte Algorithmus - * NewTVar(jclass) (siehe Algorithmus 5.17 TRProg, Martin Pl�micke) + * NewTVar(jclass) (siehe Algorithmus 5.17 TRProg, Martin Pl�micke) * aufgerufen. - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @param reader * @throws IOException * @throws JavaParser.yyException @@ -248,7 +247,7 @@ public class MyCompiler implements MyCompilerAPI parserlog.info("#########################################\n"); ////////////////////////////////////// - // Alte Daten l�schen: + // Alte Daten l�schen: ////////////////////////////////////// m_AbstractSyntaxTree = null; @@ -268,7 +267,7 @@ public class MyCompiler implements MyCompilerAPI //PL 05-07-31 verschoben nach SourceFile.java in Methode typeReconstruction // otth: TypePlaceholders in Superklassenparameterlisten in RefTypes mit Parameterlsite = NULL umwandeln, - // falls: f�r TypePlaceholder existiert eine gleichnamige Klasse + // falls: f�r TypePlaceholder existiert eine gleichnamige Klasse // Superklasse suchen //for( int i = 0; i < srcFile.KlassenVektor.size(); i++ ) //{ @@ -309,10 +308,10 @@ public class MyCompiler implements MyCompilerAPI if ( tempKlassBody != null ) { strKlasse = tempKlasse.getName(); - parserlog.debug("T->Felddeklarationen f�r die Klasse:" + strKlasse); + parserlog.debug("T->Felddeklarationen f�r die Klasse:" + strKlasse); parserlog.debug( "------------------------------------"); - // Schleife �ber alle fielddeclarations + // Schleife �ber alle fielddeclarations tempMengeFieldDecl = tempKlassBody.getFields(); for( int k = 0; k < tempMengeFieldDecl.size(); k++ ) { @@ -321,7 +320,7 @@ public class MyCompiler implements MyCompilerAPI { //parserlog.debug("T->Konstruktor: " + ((DeclId)tempFieldDecl.get_Name().elementAt(0)).get_Name() + " - ReturnType: " + tempFieldDecl.getTypeName()); - // pr�fen, ob Construktorname == Klassenname - falls nein: Construktor in Methode umwandeln !!! + // pr�fen, ob Construktorname == Klassenname - falls nein: Construktor in Methode umwandeln !!! String strConstName = ((DeclId)tempFieldDecl.get_Name().elementAt(0)).get_Name(); // Konstruktorname if ( !strConstName.equals( strKlasse ) ) { @@ -336,9 +335,9 @@ public class MyCompiler implements MyCompilerAPI Methode.set_ExceptionList( Konstruktor.get_ExceptionList() ); Methode.setReturnType( Konstruktor.getReturnType() ); Methode.setDeclIdMenge( Konstruktor.getDeclIdMenge() ); - // types_in_parameterlist wird wohl erst sp�ter und intern gef�llt + // types_in_parameterlist wird wohl erst sp�ter und intern gef�llt - // R�ckgabetyp = Objekt der Klasse 'TypePlaceholder' + // R�ckgabetyp = Objekt der Klasse 'TypePlaceholder' // #JB# 31.03.2005 // ########################################################### @@ -359,7 +358,7 @@ public class MyCompiler implements MyCompilerAPI // Debugg-Infos parserlog.debug(""); - parserlog.debug("T->NEUE Felddeklarationen f�r die Klasse:" + strKlasse); + parserlog.debug("T->NEUE Felddeklarationen f�r die Klasse:" + strKlasse); parserlog.debug( "-----------------------------------------"); for( int k = 0; k < tempMengeFieldDecl.size(); k++ ) { @@ -389,14 +388,14 @@ public class MyCompiler implements MyCompilerAPI tempMethod = (Method)tempFieldDecl; tempReturn = tempMethod.getReturnType(); - // Funktionen ohne definierten R�ckgabetyp suchen!!! + // Funktionen ohne definierten R�ckgabetyp suchen!!! if( tempReturn instanceof TypePlaceholder ) { - // Methode mit nicht-definiertem R�ckgabetyp gefunden! + // Methode mit nicht-definiertem R�ckgabetyp gefunden! // #JB# 31.03.2005 // ########################################################### - // Wird bereits �ber fresh() gemacht!! + // Wird bereits �ber fresh() gemacht!! //tempReturn.setName( TypePlaceholder.makeNewName() ); // ########################################################### parserlog.debug(""); @@ -425,7 +424,7 @@ public class MyCompiler implements MyCompilerAPI // #JB# 31.03.2005 // ########################################################### - // Wird bereits �ber fresh() gemacht!! + // Wird bereits �ber fresh() gemacht!! //tempType.setName( TypePlaceholder.makeNewName() ); // ########################################################### } @@ -458,7 +457,7 @@ public class MyCompiler implements MyCompilerAPI ///////////////////////////////////////////////////////////////////////////////////////////////// // ino.method.init.21295.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* Initialisiert den Compiler */ // ino.end @@ -476,11 +475,11 @@ public class MyCompiler implements MyCompilerAPI // ino.method.parse.21298.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* Ruft die Parse-Methode. * @param file Die Quellcode-Datei * @throws FileNotFoundException Wenn die Quellcode-Datei nicht existiert. - * @throws IOException Wenn was schief l�uft. + * @throws IOException Wenn was schief l�uft. * @throws JavaParser.yyException Wenn ein Fehler beim Parsen auftritt. */ // ino.end @@ -500,9 +499,9 @@ public class MyCompiler implements MyCompilerAPI // ino.method.typeReconstruction.21304.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* Ruft den Typrekonstruktionsalgorithmus auf. - * @return Die Menge aller m�glichen Typkombinationen + * @return Die Menge aller m�glichen Typkombinationen * @throws NullPointerException Wenn noch kein abstrakter Syntaxbaum vorhanden * ist. @throws CTypeReconstructionException Wenn ein Fehler bei der * Typrekonstruktion auftritt. @@ -538,13 +537,13 @@ public class MyCompiler implements MyCompilerAPI /** * Erstellt die FunN-Assumptions - * Fun0-FunN (momentan für N = 6) + * Fun0-FunN (momentan für N = 6) * @return */ private TypeAssumptions makeFunNAssumptions(){ TypeAssumptions ret = new TypeAssumptions(); - //Basic Assumptions für die FunN Interfaces: + //Basic Assumptions für die FunN Interfaces: //TODO: Hier mehr als Fun1-Fun5 implementieren for(int i = 0; i<6; i++){ FunNInterface funN = new FunNInterface(i); @@ -556,8 +555,8 @@ public class MyCompiler implements MyCompilerAPI } /** - * Author: J�rg B�uerle
- * Generiert den Bytecode und das Class-File f�r den Syntaxbaum. + * Author: J�rg B�uerle
+ * Generiert den Bytecode und das Class-File f�r den Syntaxbaum. * @throws NullPointerException Wenn noch kein abstrakter Syntaxbaum vorhanden * ist. @@ -583,7 +582,7 @@ public class MyCompiler implements MyCompilerAPI // ino.method.main.21313.defdescription type=javadoc /** - * Die Main-Funktion, �ber die der Compiler auch per Konsole gestartet + * Die Main-Funktion, �ber die der Compiler auch per Konsole gestartet * werden kann. * @param args Klassendatei */ @@ -696,7 +695,7 @@ public class MyCompiler implements MyCompilerAPI for( int i = 0; i < containedTypes.size(); i++) { Type tempParameter = (Type)(containedTypes.elementAt(i)); - // Nat�rlich nur RefTypes updaten + // Nat�rlich nur RefTypes updaten if(tempParameter instanceof RefType){ RefType typ=(RefType)tempParameter; UsedId fullyQualifiedName=UsedId.createFromQualifiedName(typ.getTypeName(),typ.getOffset()); @@ -717,9 +716,9 @@ public class MyCompiler implements MyCompilerAPI // ino.end */ /** - * @author Arne Lüdtke + * @author Arne Lüdtke * Ersetzt alle GTVs durch TPHs mit gleichem Namen. Arbeitet Rekursiv. - * ACHTUNG: BACKDOOR CREATE!!! Nur für Testzwecke verwenden. + * ACHTUNG: BACKDOOR CREATE!!! Nur für Testzwecke verwenden. * @param T - Typ, bei welchem die GTVs ersetzt werden sollen. */ public static Type makeGenericTypeVars2TypePlaceHolders(Type T) @@ -811,12 +810,12 @@ public class MyCompiler implements MyCompilerAPI StringReader srcreader = new StringReader(fileData.toString()); //Den aus der Datei ausgelesenen Quellcode zu einem Syntaxbaum parsen: - this.m_AbstractSyntaxTree.add(parse2SyntaxTree(srcreader)); // Alle Dateien nacheinander hintereinander anhängen... + this.m_AbstractSyntaxTree.add(parse2SyntaxTree(srcreader)); // Alle Dateien nacheinander hintereinander anhängen... } /* String gesamterSrc = ""; - //Hier werden alle übergebenen Dateinamen abgearbeitet: + //Hier werden alle übergebenen Dateinamen abgearbeitet: for(String filename : filenames){ try { StringBuffer fileData = new StringBuffer(); @@ -829,15 +828,15 @@ public class MyCompiler implements MyCompilerAPI fileData.append(readData); } reader.close(); - gesamterSrc += fileData.toString() + "\n"; // Alle Dateien nacheinander hintereinander anhängen... + gesamterSrc += fileData.toString() + "\n"; // Alle Dateien nacheinander hintereinander anhängen... } catch (Exception e) { e.printStackTrace(); - throw new TypinferenzException("Die übergebenen Dateien konnten nicht zum Parsen eingelesen werden."); + throw new TypinferenzException("Die übergebenen Dateien konnten nicht zum Parsen eingelesen werden."); } } try { - // und anschließend zum Parsen übergeben. + // und anschließend zum Parsen übergeben. this.parse(gesamterSrc.toString()); } catch (Exception e) { e.printStackTrace(); @@ -853,12 +852,5 @@ public class MyCompiler implements MyCompilerAPI this.m_AbstractSyntaxTree.add(ret); return ret; } - - @Override - public Menge codeGeneration(ResultSet result) - throws NullPointerException, JVMCodeException { - // TODO Auto-generated method stub - return null; - } } // ino.end diff --git a/src/de/dhbwstuttgart/core/MyCompilerAPI.java b/src/de/dhbwstuttgart/core/MyCompilerAPI.java index 16fc0bd86..760c19297 100755 --- a/src/de/dhbwstuttgart/core/MyCompilerAPI.java +++ b/src/de/dhbwstuttgart/core/MyCompilerAPI.java @@ -8,7 +8,6 @@ import java.io.FileNotFoundException; import java.io.IOException; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.parser.JavaParser; @@ -24,7 +23,7 @@ import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException; * IDE als Compiler-API zum Kompilieren einer Quellcode-Datei * dienen und stellt somit die Schnittstelle zur Studienarbeit * von Markus Melzer (Eclipse-Plugin) dar. - * @author Jörg Bäuerle + * @author Jörg Bäuerle * @version $Date: 2013/09/09 11:04:24 $ */ // ino.end @@ -36,7 +35,7 @@ public interface MyCompilerAPI // ino.method.init.21331.decldescription type=javadoc /** - * Author: Jörg Bäuerle
+ * Author: Jörg Bäuerle
* Initialisiert den Compiler */ // ino.end @@ -46,11 +45,11 @@ public interface MyCompilerAPI // ino.method.parse.21334.decldescription type=javadoc /** - * Author: Jörg Bäuerle
+ * Author: Jörg Bäuerle
* Parst eine Quellcodedatei und baut den abstrakten Syntaxbaum auf. * @param file Die Quellcode-Datei * @throws FileNotFoundException Wenn die Quellcode-Datei nicht existiert. - * @throws IOException Wenn was schief läuft. + * @throws IOException Wenn was schief läuft. * @throws JavaParser.yyException Wenn ein Fehler beim Parsen auftritt. */ // ino.end @@ -61,10 +60,10 @@ public interface MyCompilerAPI // ino.method.parse.21337.decldescription type=javadoc /** - * Author: Jörg Bäuerle
+ * Author: Jörg Bäuerle
* Parst einen String und baut den abstrakten Syntaxbaum auf. * @param srcCode Der zu parsende Quellcode - * @throws IOException Wenn was schief läuft. + * @throws IOException Wenn was schief läuft. * @throws JavaParser.yyException Wenn ein Fehler beim Parsen auftritt. // ino.end @@ -76,9 +75,9 @@ public interface MyCompilerAPI // ino.method.typeReconstruction.21340.decldescription type=javadoc /** - * Author: Jörg Bäuerle
+ * Author: Jörg Bäuerle
* Ruft den Typrekonstruktionsalgorithmus auf. - * @return Die Menge aller möglichen Typkombinationen + * @return Die Menge aller möglichen Typkombinationen * @throws NullPointerException Wenn noch kein abstrakter Syntaxbaum vorhanden * ist. @throws CTypeReconstructionException Wenn ein Fehler bei der * Typrekonstruktion auftritt. @@ -89,20 +88,6 @@ public interface MyCompilerAPI throws NullPointerException, TypeinferenceException; // ino.end - // ino.method.codeGeneration.21346.decldescription type=javadoc - /** - * Author: Jörg Bäuerle
- * Generiert den Bytecode und das Class-File für den Syntaxbaum. - * @param syntaxTree Der Syntaxbaum - * @throws NullPointerException Wenn noch kein abstrakter Syntaxbaum vorhanden - * ist. @throws JVMCodeException - */ - // ino.end - // ino.method.codeGeneration.21346.declaration - public Menge codeGeneration(ResultSet result) - throws NullPointerException, JVMCodeException; - // ino.end - // ino.method.setOutputDir.21349.decldescription type=javadoc /** * Author: Juergen Schmiing
@@ -124,7 +109,7 @@ public interface MyCompilerAPI // ino.end /** - * Parst zusammenhängende JavaKlassen in verschiedenen Dateien. + * Parst zusammenhängende JavaKlassen in verschiedenen Dateien. * @param filenames - Eine Liste von Quellcodedateien, welche gseparst werden sollen */ public void parse(Menge filenames) throws ParserError; diff --git a/src/de/dhbwstuttgart/logger/Logger.java b/src/de/dhbwstuttgart/logger/Logger.java index 981079880..dd8709068 100755 --- a/src/de/dhbwstuttgart/logger/Logger.java +++ b/src/de/dhbwstuttgart/logger/Logger.java @@ -34,8 +34,8 @@ public class Logger { */ /** - * Logt eine Debug Message, welche zusätzlich einer bestimmten Section zugewiesen wird. - * Dadurch lässt sich die DEBUG ausgabe übersichtlicher gestalten. + * Logt eine Debug Message, welche zusätzlich einer bestimmten Section zugewiesen wird. + * Dadurch lässt sich die DEBUG ausgabe übersichtlicher gestalten. * @param message * @param section */ @@ -45,7 +45,7 @@ public class Logger { /** * Liefert den Logger mit dem angegebenen Namen. - * Üblicherweise wird diese Methode mit dem Namen der Klasse aufgerufen, in welcher der Logger tätig ist. + * Üblicherweise wird diese Methode mit dem Namen der Klasse aufgerufen, in welcher der Logger tätig ist. * @param name - Name der Klasse ( Ermittelbar mittels .class.getName() ) * @return */ @@ -94,7 +94,7 @@ public class Logger { } /** - * wird hier null übergeben, so wird sämtliches Logging unterdrückt. + * wird hier null übergeben, so wird sämtliches Logging unterdrückt. */ public static void setStandardConfiguration(LoggerConfiguration config) { Logger.standardConfiguration = config; diff --git a/src/de/dhbwstuttgart/logger/LoggerConfiguration.java b/src/de/dhbwstuttgart/logger/LoggerConfiguration.java index 275c68a36..ce601fbc3 100644 --- a/src/de/dhbwstuttgart/logger/LoggerConfiguration.java +++ b/src/de/dhbwstuttgart/logger/LoggerConfiguration.java @@ -12,7 +12,7 @@ public class LoggerConfiguration{ public LoggerConfiguration setOutput(Section forSection, PrintStream output){ if(outputs.containsKey(forSection)){ - //throw new DebugException("Eine outputStream für Section "+forSection+" ist bereits vorhanden"); + //throw new DebugException("Eine outputStream für Section "+forSection+" ist bereits vorhanden"); if(outputs.get(forSection).equals(output)){ //do nothing }else{ diff --git a/src/de/dhbwstuttgart/logger/SectionLogger.java b/src/de/dhbwstuttgart/logger/SectionLogger.java index 66fbbd800..15d36289f 100644 --- a/src/de/dhbwstuttgart/logger/SectionLogger.java +++ b/src/de/dhbwstuttgart/logger/SectionLogger.java @@ -3,7 +3,7 @@ package de.dhbwstuttgart.logger; import java.util.logging.Level; /** - * Sämtliche Logging Ausgaben werden in die bei der Erstellung des Loggers übergebene Section eingeteilt + * Sämtliche Logging Ausgaben werden in die bei der Erstellung des Loggers übergebene Section eingeteilt * @author janulrich * */ diff --git a/src/de/dhbwstuttgart/myexception/CTypeReconstructionException.java b/src/de/dhbwstuttgart/myexception/CTypeReconstructionException.java index 3ca780a79..335426631 100755 --- a/src/de/dhbwstuttgart/myexception/CTypeReconstructionException.java +++ b/src/de/dhbwstuttgart/myexception/CTypeReconstructionException.java @@ -9,7 +9,7 @@ import de.dhbwstuttgart.core.IItemWithOffset; // ino.class.CTypeReconstructionException.23746.description type=javadoc /** - * @author J�rg B�uerle + * @author J�rg B�uerle * @version $Date: 2006/06/13 10:37:31 $ */ // ino.end diff --git a/src/de/dhbwstuttgart/parser/JavaClassName.java b/src/de/dhbwstuttgart/parser/JavaClassName.java index 352437c45..140055607 100644 --- a/src/de/dhbwstuttgart/parser/JavaClassName.java +++ b/src/de/dhbwstuttgart/parser/JavaClassName.java @@ -66,7 +66,7 @@ public class JavaClassName { return false; if (packageName != null && other.packageName != null) { if (!packageName.equals(other.packageName)) - return false;//Spezialfall, nicht beide Typen müssen eindeutig mit Packagenamen angegeben werden + return false;//Spezialfall, nicht beide Typen müssen eindeutig mit Packagenamen angegeben werden } return true; } diff --git a/src/de/dhbwstuttgart/parser/JavaLexer.java b/src/de/dhbwstuttgart/parser/JavaLexer.java index 2479f279d..242246066 100644 --- a/src/de/dhbwstuttgart/parser/JavaLexer.java +++ b/src/de/dhbwstuttgart/parser/JavaLexer.java @@ -1,7 +1,7 @@ /******************************************** * file: JavaLexer.lex * * * - * enth�lt die JLex-Spezifikation f�r die * + * enth�lt die JLex-Spezifikation f�r die * * Generierung des lexical analyzers * * * ********************************************/ diff --git a/src/de/dhbwstuttgart/parser/JavaParser.java b/src/de/dhbwstuttgart/parser/JavaParser.java index 5f023cb05..00e3854aa 100644 --- a/src/de/dhbwstuttgart/parser/JavaParser.java +++ b/src/de/dhbwstuttgart/parser/JavaParser.java @@ -46,7 +46,7 @@ void initUsedIdsToCheck() { } //PL 05-07-30 eingefuegt. ENDE -//LUAR 07-05-29 Anfang für Wildcard Test +//LUAR 07-05-29 Anfang für Wildcard Test public Menge testPair = new Menge(); //LUAR 07-05-29 Ende // line 53 "-" @@ -817,7 +817,7 @@ case 19: { 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*/ + UI.setOffset(((Token)yyVals[0+yyTop]).getOffset());/*hinzugef�gt hoth: 07.04.2006*/ yyVal = UI; } break; @@ -980,7 +980,7 @@ case 36: pl.getParalist().addElement(new GenericTypeVar(((Token)yyVals[0+yyTop]).getLexem(),null, ((Token)yyVals[0+yyTop]).getOffset())); /*pl.getParalist().addElement( new TypePlaceholder($1.getLexem()) );*/ /* ########################################################### */ - de.dhbwstuttgart.logger.Logger.getLogger("parser").debug( "IDENTIFIER --> Paralist f�r " + ((Token)yyVals[0+yyTop]).getLexem() + " TV", Section.PARSER); + de.dhbwstuttgart.logger.Logger.getLogger("parser").debug( "IDENTIFIER --> Paralist f�r " + ((Token)yyVals[0+yyTop]).getLexem() + " TV", Section.PARSER); yyVal = pl; } break; @@ -991,7 +991,7 @@ case 37: RefType t = new RefType( ((Token)yyVals[-3+yyTop]).getLexem(),null,((Token)yyVals[-3+yyTop]).getOffset() ); t.set_ParaList( ((ParaList)yyVals[-1+yyTop]).get_ParaList() ); pl.getParalist().addElement(t); - de.dhbwstuttgart.logger.Logger.getLogger("parser").debug( "IDENTIFIER '<' paralist '>' --> Paralist f�r " + ((Token)yyVals[-3+yyTop]).getLexem() + ": RefType", Section.PARSER); + de.dhbwstuttgart.logger.Logger.getLogger("parser").debug( "IDENTIFIER '<' paralist '>' --> Paralist f�r " + ((Token)yyVals[-3+yyTop]).getLexem() + ": RefType", Section.PARSER); yyVal = pl; } break; @@ -1012,7 +1012,7 @@ case 39: ((ParaList)yyVals[-2+yyTop]).getParalist().addElement(new GenericTypeVar(((Token)yyVals[0+yyTop]).getLexem(), null,((Token)yyVals[0+yyTop]).getOffset())); /*$1.getParalist().addElement(new TypePlaceholder($3.getLexem()));*/ /* ########################################################### */ - de.dhbwstuttgart.logger.Logger.getLogger("parser").debug( "paralist ',' IDENTIFIER --> Paralist f�r " + ((Token)yyVals[0+yyTop]).getLexem() + ": TV", Section.PARSER); + de.dhbwstuttgart.logger.Logger.getLogger("parser").debug( "paralist ',' IDENTIFIER --> Paralist f�r " + ((Token)yyVals[0+yyTop]).getLexem() + ": TV", Section.PARSER); de.dhbwstuttgart.logger.Logger.getLogger("parser").debug( "paralist: " + ((ParaList)yyVals[-2+yyTop]).getParalist(), Section.PARSER); yyVal=((ParaList)yyVals[-2+yyTop]); } @@ -1023,7 +1023,7 @@ case 40: RefType t = new RefType( ((Token)yyVals[-3+yyTop]).getLexem(),null ,((Token)yyVals[-3+yyTop]).getOffset() ); t.set_ParaList( ((ParaList)yyVals[-1+yyTop]).get_ParaList() ); ((ParaList)yyVals[-5+yyTop]).getParalist().addElement(t); - de.dhbwstuttgart.logger.Logger.getLogger("parser").debug( "paralist ',' IDENTIFIER '<' paralist '>' --> Paralist f�r " + ((Token)yyVals[-3+yyTop]).getLexem() + ": RefType", Section.PARSER); + de.dhbwstuttgart.logger.Logger.getLogger("parser").debug( "paralist ',' IDENTIFIER '<' paralist '>' --> Paralist f�r " + ((Token)yyVals[-3+yyTop]).getLexem() + ": RefType", Section.PARSER); yyVal=((ParaList)yyVals[-5+yyTop]); } break; @@ -1252,7 +1252,7 @@ case 71: { if (((Menge)yyVals[0+yyTop]) != null) { /*$1.set_ParaList($2.get_ParaList());*/ - ((UsedId)yyVals[-1+yyTop]).set_ParaList(((Menge)yyVals[0+yyTop]));/*Änderung von Andreas Stadelmeier. Type statt GenericVarType*/ + ((UsedId)yyVals[-1+yyTop]).set_ParaList(((Menge)yyVals[0+yyTop]));/*Änderung von Andreas Stadelmeier. Type statt GenericVarType*/ /* otth: originale (also diese) Parameterliste retten */ /*((UsedId)$1).vParaOrg = new Menge( $2.get_ParaList() );*/ } @@ -1410,7 +1410,7 @@ case 91: break; case 92: // line 863 "./../src/de/dhbwstuttgart/parser/JavaParser.jay" - {/*angefügt von Andreas Stadelmeier*/ + {/*angefügt von Andreas Stadelmeier*/ ((FieldDeclaration)yyVals[-1+yyTop]).setType(((Type)yyVals[-2+yyTop])); ((FieldDeclaration)yyVals[-1+yyTop]).setGenericParameter(((GenericDeclarationList)yyVals[-3+yyTop])); yyVal=((FieldDeclaration)yyVals[-1+yyTop]); @@ -1906,7 +1906,7 @@ case 153: /* #JB# 10.04.2005 */ /* ########################################################### */ met.setLineNumber(((Token)yyVals[-2+yyTop]).getLineNumber()); - met.setOffset(((Token)yyVals[-2+yyTop]).getOffset());/*hinzugef�gt hoth: 07.04.2006*/ + 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()); @@ -1921,7 +1921,7 @@ case 154: /* #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*/ + 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()); @@ -1990,7 +1990,7 @@ case 161: { 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.*/ + /*FP.set_DeclId($2); //auskommentiert von Andreas Stadelmeier. DeclId wird nun dem Konstruktor von FormalParameter übergeben.*/ yyVal=FP; } break; @@ -2042,7 +2042,7 @@ case 166: /* #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.setOffset(((Token)yyVals[0+yyTop]).getOffset());/*hinzugef�gt hoth: 07.04.2006*/ /* ########################################################### */ DI.set_Name(((Token)yyVals[0+yyTop]).getLexem()); yyVal=DI; diff --git a/src/de/dhbwstuttgart/parser/Token.java b/src/de/dhbwstuttgart/parser/Token.java index 7e6f005ce..86c9dd095 100755 --- a/src/de/dhbwstuttgart/parser/Token.java +++ b/src/de/dhbwstuttgart/parser/Token.java @@ -16,7 +16,7 @@ public class Token private int m_LineNumber; // ino.end // ino.attribute.m_Offset.24871.declaration - private int m_Offset;//hinzugefügt hoth: 14.04.2006 + private int m_Offset;//hinzugefügt hoth: 14.04.2006 // ino.end @@ -54,7 +54,7 @@ public class Token // ino.end // ino.method.Token.24883.defdescription type=line - // hinzugefügt hoth: 14.04.2006 + // hinzugefügt hoth: 14.04.2006 // ino.end // ino.method.Token.24883.definition Token (int tok, String s, int lineNumber, int charOffset) @@ -69,7 +69,7 @@ public class Token // ino.end // ino.method.Token.24886.defdescription type=line - // hinzugefügt hoth: 14.04.2006 + // hinzugefügt hoth: 14.04.2006 // ino.end // ino.method.Token.24886.definition Token (int tok, char c, int lineNumber, int charOffset) diff --git a/src/de/dhbwstuttgart/syntaxtree/Class.java b/src/de/dhbwstuttgart/syntaxtree/Class.java index b93e7df93..09d447975 100755 --- a/src/de/dhbwstuttgart/syntaxtree/Class.java +++ b/src/de/dhbwstuttgart/syntaxtree/Class.java @@ -125,7 +125,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I // ino.attribute.containedTypes.23032.decldescription type=line // PL 05-07-30 eingefuegt. Vektor aller Typdeklarationen, die in der Klasse - // vorkommen. Wird in der Studienarbeit von Andreas Stadelmeier nur für Verifizierung der Tests eingesetzt. + // vorkommen. Wird in der Studienarbeit von Andreas Stadelmeier nur für Verifizierung der Tests eingesetzt. // ino.end // ino.attribute.containedTypes.23032.declaration private Menge containedTypes = new Menge(); @@ -134,7 +134,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I private Menge usedIdsToCheck = new Menge(); // ino.end - private TypeAssumptions typeAssumptions = null;//muss mit null Initialisiert werden. Darf nur über getTypeAssumptions abgerufen werden. + private TypeAssumptions typeAssumptions = null;//muss mit null Initialisiert werden. Darf nur über getTypeAssumptions abgerufen werden. // ino.attribute.parserlog.23038.declaration //protected Logger parselog = Logger.getLogger("parser"); @@ -157,14 +157,14 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I superclassid=null; } this.offset = offset; - if(!name.equals("Object"))//Alle Klassen außer Object erben von Object: + if(!name.equals("Object"))//Alle Klassen außer Object erben von Object: this.superClass = new Class("Object", -1).getType(); } // ino.end /** - * Erstellt eine Klasse, welche nur für die Assumptions verwendet wird. - * Sie enthält keine unnötigen Informationen, wie Offset oder ClassBody. + * Erstellt eine Klasse, welche nur für die Assumptions verwendet wird. + * Sie enthält keine unnötigen Informationen, wie Offset oder ClassBody. * @param name * @param superClass * @param modifiers @@ -285,8 +285,8 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I /** * @author Andreas Stadelmeier, a10023 - * Fügt der Klasse eine Feld hinzu. - * Prüft dabei, ob es sich um einen Constructor handelt und wandelt diesen direkt um. + * Fügt der Klasse eine Feld hinzu. + * Prüft dabei, ob es sich um einen Constructor handelt und wandelt diesen direkt um. * @param feld */ public void addField(Field i) @@ -328,7 +328,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I // ino.method.complete_paralist.23062.body { - //Diese Funktion vervollt�ndigt die Parameterliste f�r vererbte Klassen + //Diese Funktion vervollt�ndigt die Parameterliste f�r vererbte Klassen Menge child = paralist; paralist = (Menge)superclassid.get_ParaList(); @@ -344,7 +344,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I /** - * Generiert die ClassFile für diese Klasse. + * Generiert die ClassFile für diese Klasse. * @param typeinferenceResult - Das ResultSet einer Typinferierung oder null, falls alle Typen eindeutig feststehen. * @return * @throws JVMCodeException @@ -371,7 +371,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I // pkgName = sf.getPackageName().get_codegen_UsedId() + "/"; //} - //geändert von Andreas Stadelmeier: pkgName wird nicht mehr aus dem SourceFile ausgelesen: + //geändert von Andreas Stadelmeier: pkgName wird nicht mehr aus dem SourceFile ausgelesen: String packageName = ""; if(pkgName != null) packageName = pkgName.get_Name_1Element(); classfile.add_class(getName(), superClass, getAccessFlags()); @@ -409,36 +409,36 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I // ino.end /** - * Setzt den ClassBody dieser Klasse. Wird zum Parsen benötigt. - * Der ClassBody enthält sämtliche Felder dieser Klasse. - * Mit dem Aufruf dieser Methode werden alle Felder des ClassBody in diese Class übertragen. - * (Nur einmal während des Parsens aufrufen!) + * Setzt den ClassBody dieser Klasse. Wird zum Parsen benötigt. + * Der ClassBody enthält sämtliche Felder dieser Klasse. + * Mit dem Aufruf dieser Methode werden alle Felder des ClassBody in diese Class übertragen. + * (Nur einmal während des Parsens aufrufen!) */ public void set_ClassBody(ClassBody body) { Menge tempFields=body.getFields(); for(Field f : this.getFields()){ - if(f instanceof Method){ //Wenn es sich um eine Methode handelt ist eine zusätzliche Prüfung erfoderlich: (Ist es ein Konstruktor?) + if(f instanceof Method){ //Wenn es sich um eine Methode handelt ist eine zusätzliche Prüfung erfoderlich: (Ist es ein Konstruktor?) Method m = (Method)f; /* * Ermitteln ob es sich bei der Methode um einen Konstruktor handelt: * (Parser kann nicht zwischen Methode und Konstruktor unterscheiden. - * Denn für einen Konstruktor gelten besondere Regeln: + * Denn für einen Konstruktor gelten besondere Regeln: * -Typ des Blocks eines Konstruktor ist void (kein Return-Statement) - * -Rückgabetyp der Methode/Konstruktors ist der Typ der Klasse + * -Rückgabetyp der Methode/Konstruktors ist der Typ der Klasse * -Ein Konstruktor kann nicht aufgerufen werden (nur mit new) */ - if(m.get_Method_Name().equals(""))throw new TypeinferenceException(" ist kein gültiger Methodenname", m); + if(m.get_Method_Name().equals(""))throw new TypeinferenceException(" ist kein gültiger Methodenname", m); if((m.get_Method_Name().equals(this.getName()))) { Constructor constructor = new Constructor(m); - tempFields.add(constructor); //Den Konstruktor anstatt der Methode anfügen + tempFields.add(constructor); //Den Konstruktor anstatt der Methode anfügen }else{ - //Handelt es sich um keinen Konstruktor, dann die Methode unverändert den Feldern hinzufügen: + //Handelt es sich um keinen Konstruktor, dann die Methode unverändert den Feldern hinzufügen: tempFields.add(m); } }else{ - tempFields.add(f); //Ansonsten das Feld anfügen... + tempFields.add(f); //Ansonsten das Feld anfügen... } } @@ -640,14 +640,14 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I ///////////////////////////////////////////////////////////////////////// // ino.method.TRProg.23110.defdescription type=javadoc /** - * Ausgangspunkt f�r den Typrekonstruktionsalgorithmus. Hier werden zun�chst + * Ausgangspunkt f�r den Typrekonstruktionsalgorithmus. Hier werden zun�chst * die Mengen von Typannahmen V_fields_methods und V_i erstellt, die als Eingabe - * f�r den Algorithmus dienen.
- * (siehe Algorithmus 5.17 TRProg, Martin Pl�micke) - *
Author: J�rg B�uerle + * f�r den Algorithmus dienen.
+ * (siehe Algorithmus 5.17 TRProg, Martin Pl�micke) + *
Author: J�rg B�uerle * @param supportData * @param globalAssumptions - * @return Liste aller bisher berechneten, m�glichen Typkombinationen + * @return Liste aller bisher berechneten, m�glichen Typkombinationen * @throws CTypeReconstructionException */ // ino.end @@ -671,16 +671,16 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I ////////////////////////////// //Erzeuge Assumptions: TypeAssumptions assumptions = this.getPrivateFieldAssumptions(); - //Globale Assumptions anfügen: + //Globale Assumptions anfügen: assumptions.add(globalAssumptions); ConstraintsSet oderConstraints = new ConstraintsSet(); for(Type gparam : this.get_ParaList()){ - if(gparam instanceof GenericTypeVar)assumptions.add(((GenericTypeVar)gparam).createAssumptions()); //Constraints für die Generischen Variablen erstellen und diese dem AssumptionsSet hinzufügen + if(gparam instanceof GenericTypeVar)assumptions.add(((GenericTypeVar)gparam).createAssumptions()); //Constraints für die Generischen Variablen erstellen und diese dem AssumptionsSet hinzufügen } for(Type gparam : this.get_ParaList()){ - if(gparam instanceof GenericTypeVar)oderConstraints.add(((GenericTypeVar)gparam).TYPE(assumptions)); //Constraints für die Generischen Variablen erstellen und diese dem AssumptionsSet hinzufügen + if(gparam instanceof GenericTypeVar)oderConstraints.add(((GenericTypeVar)gparam).TYPE(assumptions)); //Constraints für die Generischen Variablen erstellen und diese dem AssumptionsSet hinzufügen } typinferenzLog.debug("Erstellte Assumptions: "+assumptions, Section.TYPEINFERENCE); @@ -709,7 +709,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I /* CReconstructionTupleSet retTupleSet = this.TRStart(methodList, V, V_fields_methods, supportData); - inferencelog.debug("Bin aus TRStart() zur�ck in TRProg()."); + inferencelog.debug("Bin aus TRStart() zur�ck in TRProg()."); ////////////////////////////// // Neu Ergebnismenge A aller // Typannahmen erzeugen: @@ -717,12 +717,12 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I inferencelog.debug("Erstelle Ergebnismenge..."); Menge newA = new Menge(); - // Alle bisherigen M�glichkeiten an Typkombinationen durchgehen: + // Alle bisherigen M�glichkeiten an Typkombinationen durchgehen: Menge oldA = supportData.getA(); for(int i=0; i retTupleIt = retTupleSet.getIterator(); while(retTupleIt.hasNext()){ CReconstructionTuple possibleTuple = retTupleIt.next(); @@ -745,7 +745,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I } newReconResult.addGenericTypeVars(this.getName(), genericsList); - //Hinzuf�gen: + //Hinzuf�gen: newA.addElement(newReconResult); } } @@ -761,7 +761,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I if(this.methodList != null) return this.methodList; - //TODO: Unnötige Berechnungen im folgenden Code rauskürzen: + //TODO: Unnötige Berechnungen im folgenden Code rauskürzen: ////////////////////////////// // Die Eingabedaten bauen: ////////////////////////////// @@ -774,7 +774,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I ////////////////////////////// // Alle Felder durchgehen: // Zuerst alle Attribute, dann Methoden - // ge�ndert: hoth 06.04.2006 + // ge�ndert: hoth 06.04.2006 ////////////////////////////// for(Field field : this.getFields()) @@ -813,7 +813,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I methodList.addElement(method); - // F�r V_fields_methods: + // F�r V_fields_methods: CMethodTypeAssumption methodAssum = new CMethodTypeAssumption(this.getType(), method.get_Method_Name(), method.getReturnType(), method.getParameterCount(),method.getLineNumber(),method.getOffset(),new Menge(),method.getGenericMethodParameters()); // Typannahme bauen... @@ -826,7 +826,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I method.setOverloadedID(methodAssum.getHashSetKey().getOverloadedMethodID()); - // F�r die V_i: + // F�r die V_i: CTypeAssumptionSet localAssum = new CTypeAssumptionSet(); // Bauen... @@ -834,7 +834,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I if(parameterList!=null){ for(int i=0; i()); //fuege Offsets fuer Parameter hinzu, hoth: 06.04.2006 Class.isFirstLocalVarDecl=false; @@ -847,13 +847,13 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I - // F�r die V_i: + // F�r die V_i: CLocalVarTypeAssumption varAssum = new CLocalVarTypeAssumption(this.getName(), method.get_Method_Name(), method.getParameterCount(), method.getOverloadedID(),"1", para.getIdentifier(),para.getType(), para.getLineNumber(),para.getOffset(),new Menge()); localAssum.addElement(varAssum); rememberLocals.addElement(varAssum); } } - // ...und hinzuf�gen: + // ...und hinzuf�gen: V.addElement(localAssum); } @@ -866,15 +866,15 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I */ /** - * Ermittelt alle privaten Felder und Methoden der Klasse und Erstellt eine Assumption für diese. - * Bemerkung: Momentan werden noch alle Felder dieser Klasse zurückgegeben. + * Ermittelt alle privaten Felder und Methoden der Klasse und Erstellt eine Assumption für diese. + * Bemerkung: Momentan werden noch alle Felder dieser Klasse zurückgegeben. * @return Die erstellten TypeAssumptions */ private TypeAssumptions getPrivateFieldAssumptions() { - if(this.typeAssumptions != null)return this.typeAssumptions; //Das sorgt dafür, dass die Assumptions nur einmalig generiert werden. + if(this.typeAssumptions != null)return this.typeAssumptions; //Das sorgt dafür, dass die Assumptions nur einmalig generiert werden. TypeAssumptions assumptions = new TypeAssumptions(this.getName()); - //this.getMethodList(); //Diese Funktion muss zuerst ausgeführt werden. - //Assumption für this, also die aktuelle Klasse: (ist nicht mehr nötig, da jedes AssumptionSet einer Klasse (dem namen einer Klasse) zugewiesen ist. + //this.getMethodList(); //Diese Funktion muss zuerst ausgeführt werden. + //Assumption für this, also die aktuelle Klasse: (ist nicht mehr nötig, da jedes AssumptionSet einer Klasse (dem namen einer Klasse) zugewiesen ist. //CLocalVarTypeAssumption thisAssumption = new CLocalVarTypeAssumption(this.name, name, 0, 0, name, "this", new RefType(name,0), 0, 0, null); //assumptions.setThisV(thisAssumption); @@ -882,20 +882,20 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I if(!field.isPublic())assumptions.add(field.createTypeAssumptions(this)); } - //Eine Assumption für den Standardkonstruktor: - // (Ein Standardkonstruktor wird immer angefügt, da es momentan keine statischen Klassen gibt) - //auskommentiert, da der Standardkonstruktor beim Parser-Postprocessing angefügt wird. - //if(assumptions.getMethodAssumptions(this.getName(), "").size()==0){ //Falls kein Konstruktor für diese Klasse definiert wurde: + //Eine Assumption für den Standardkonstruktor: + // (Ein Standardkonstruktor wird immer angefügt, da es momentan keine statischen Klassen gibt) + //auskommentiert, da der Standardkonstruktor beim Parser-Postprocessing angefügt wird. + //if(assumptions.getMethodAssumptions(this.getName(), "").size()==0){ //Falls kein Konstruktor für diese Klasse definiert wurde: // assumptions.addMethodAssumption(new RefType(this.getName(),0), "", new RefType(this.getName(),0), new Menge()); //} - this.typeAssumptions = assumptions; //Diese müssen anschließend nicht wieder generiert werden. + this.typeAssumptions = assumptions; //Diese müssen anschließend nicht wieder generiert werden. return assumptions; } /* public ConstraintsSet TYPE(Menge methodList, Menge fielddeclarationList, TypeAssumptions assumptions){ ConstraintsSet ret = new ConstraintsSet(); - // Die Felddeklarationen werden zu den Assumptions hinzugefügt und gelten danach für jede Methode. + // Die Felddeklarationen werden zu den Assumptions hinzugefügt und gelten danach für jede Methode. //TypeAssumptions assumptionsPlusFieldAssumptions = new TypeAssumptions(assumptions); for(Expr expr : fielddeclarationList){ //ret.add(expr.TYPEStmt(assumptionsPlusFieldAssumptions)); @@ -912,9 +912,9 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I // ino.method.RetType.23119.defdescription type=javadoc /** - * Liefert den berechneten R�ckgabetyp f�r die �bergebene Methode zur�ck.
- * (siehe Algorithmus RetType, Martin Pl�micke) - *
Author: J�rg B�uerle + * Liefert den berechneten R�ckgabetyp f�r die �bergebene Methode zur�ck.
+ * (siehe Algorithmus RetType, Martin Pl�micke) + *
Author: J�rg B�uerle * @param me * @param V * @return @@ -936,7 +936,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I */ // ino.method.toString.23125.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end @@ -954,7 +954,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I // ino.method.wandleRefTypeAttributes2GenericAttributes.23128.defdescription type=javadoc /** - * Alle Methoden der Klassen überprüfen, ob sie als + * Alle Methoden der Klassen überprüfen, ob sie als * RefType deklarierte Attribute haben, die aber GenericTypeVars sind * und ggf. ersetzen * @@ -1043,7 +1043,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I /** - * Generiert den JavaCode dieser Klasse im Falle für das übergebene resultSet. + * Generiert den JavaCode dieser Klasse im Falle für das übergebene resultSet. * Dem ResultSet entsprechend werden in diesem Java-Code die TypePlaceholder durch die in ResultSet stehenden Typen ersetzt. * @return Java-Sourcefile */ @@ -1073,7 +1073,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I classBodyCode.attach(bodyString); - //Zuerst die generischen Parameter für diese Klasse berechnen: + //Zuerst die generischen Parameter für diese Klasse berechnen: //this.createGenericTypeVars(classBodyCode.getUnresolvedTPH()); if(this.genericClassParameters != null && this.genericClassParameters.size()>0){ @@ -1094,9 +1094,9 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I } /** - * Errechnet die Generischen Parameter der Klasse für diese Klasse. - * Die berechneten Variablen werden anschließend in die this.genericTypeVars eingesetzt. Dabei werden alte genericTypeVars überschrieben. - * @param tphs : Alle übriggebliebenen TypePLaceholder + * Errechnet die Generischen Parameter der Klasse für diese Klasse. + * Die berechneten Variablen werden anschließend in die this.genericTypeVars eingesetzt. Dabei werden alte genericTypeVars überschrieben. + * @param tphs : Alle übriggebliebenen TypePLaceholder private void createGenericTypeVars(Menge tphs){ this.genericClassParameters = new GenericDeclarationList(new Menge()); @@ -1107,8 +1107,8 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I } */ /** - * Errechnet die Generischen Parameter der Klasse für diese Klasse. - * Die berechneten Variablen werden anschließend in die this.genericTypeVars eingesetzt. Dabei werden alte genericTypeVars überschrieben. + * Errechnet die Generischen Parameter der Klasse für diese Klasse. + * Die berechneten Variablen werden anschließend in die this.genericTypeVars eingesetzt. Dabei werden alte genericTypeVars überschrieben. * @param reconstructionResult public void createGenericTypeVars(TypeinferenceResultSet reconstructionResult){ @@ -1193,7 +1193,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I } this.fielddecl = tempFields; - //Prüfen ob ein Konstruktor vorhanden ist: + //Prüfen ob ein Konstruktor vorhanden ist: boolean constructorVorhanden = false; for(Field f : this.getFields()){ if(f instanceof Constructor){ @@ -1201,7 +1201,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I break; } } - if(!constructorVorhanden){//Falls kein Konstruktor vorhanden ist, muss noch der Standardkonstruktor angefügt werden: + if(!constructorVorhanden){//Falls kein Konstruktor vorhanden ist, muss noch der Standardkonstruktor angefügt werden: Constructor standardKonstruktor = new Constructor(Method.createEmptyMethod(this.getName().toString(), this)); this.addField(standardKonstruktor); } @@ -1289,7 +1289,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I @Override public int getGenericVarDeclarationOffset(){ - // Falls Generische Parameterliste vorhanden, hier Wert der Liste zurückgegebn + // Falls Generische Parameterliste vorhanden, hier Wert der Liste zurückgegebn if(this.genericClassParameters != null){ return this.genericClassParameters.getEndOffset(); }else{ @@ -1299,7 +1299,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I /** * Die Super Klasse dieser Klasse. - * @return null für Klasse Object + * @return null für Klasse Object */ public Type getSuperClass(){ return this.superClass; diff --git a/src/de/dhbwstuttgart/syntaxtree/ClassBody.java b/src/de/dhbwstuttgart/syntaxtree/ClassBody.java index e0b36c8fd..cbac8f9f8 100755 --- a/src/de/dhbwstuttgart/syntaxtree/ClassBody.java +++ b/src/de/dhbwstuttgart/syntaxtree/ClassBody.java @@ -10,11 +10,6 @@ import de.dhbwstuttgart.logger.Logger; // ino.end - - - - -import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCClassBodyException; import de.dhbwstuttgart.myexception.SCExcept; @@ -72,27 +67,6 @@ Paratyp gesetzt."); } */ // ino.end - // ino.method.codegen.23176.definition - public void codegen(ClassFile classfile, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.23176.body - { - for(int i=0 ; i < fielddecl.size() ; i++) - { - /* - * if(this.fielddecl.elementAt(i) instanceof InstVarDecl) - { - ((InstVarDecl)this.fielddecl.elementAt(i)).codegen(classfile, paralist); - } - else - */ - { - this.fielddecl.elementAt(i).codegen(classfile, paralist); - } - } - } - // ino.end @@ -103,7 +77,7 @@ Paratyp gesetzt."); } /** * @author Andreas Stadelmeier, a10023 - * Fügt der Klasse eine Feld hinzu. + * Fügt der Klasse eine Feld hinzu. * @param feld */ public void addField(Field i) @@ -305,7 +279,7 @@ public void istParameterOK( Menge Parameter, Menge KlassenVektor ) { if( ((RefType)TempParameter).get_ParaList().size() != KlassenVektor.elementAt(k).get_ParaList().size() ) { - parserlog.error( "SEMANTIK-CHECK-FEHLER: Parameteranzahl von\n" + TempParameter.getName() + " stimmt mit der Klassendefinition\n" + KlassenVektor.elementAt(k).getName() + " nicht �berein.", Section.OLD ); + parserlog.error( "SEMANTIK-CHECK-FEHLER: Parameteranzahl von\n" + TempParameter.getName() + " stimmt mit der Klassendefinition\n" + KlassenVektor.elementAt(k).getName() + " nicht �berein.", Section.OLD ); System.exit( 1 ); } else @@ -332,7 +306,7 @@ public void istParameterOK( Menge Parameter, Menge KlassenVektor ) } else { - // Tylose Variablen d�rfen nicht deklariert sein + // Tylose Variablen d�rfen nicht deklariert sein for( int k = 0; k < KlassenVektor.size(); k++) { if( KlassenVektor.elementAt(k).getName().equals(TempParameter.getName()) ) @@ -350,7 +324,7 @@ public void istParameterOK( Menge Parameter, Menge KlassenVektor ) // ino.method.toString.23203.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/ClassHelper.java b/src/de/dhbwstuttgart/syntaxtree/ClassHelper.java index 36560d7ee..ec7c20b15 100755 --- a/src/de/dhbwstuttgart/syntaxtree/ClassHelper.java +++ b/src/de/dhbwstuttgart/syntaxtree/ClassHelper.java @@ -18,8 +18,8 @@ public class ClassHelper /** * HOTI * Diese Methode sucht in der Klassendefinition nach einen GTV, die - * so heißt wie die im RefType definierte Variable. Wenn sie diese gefunden - * hat, wird sie zurückgeben. Wenn dies nicht der Fall war, schaut sie, falls + * so heißt wie die im RefType definierte Variable. Wenn sie diese gefunden + * hat, wird sie zurückgeben. Wenn dies nicht der Fall war, schaut sie, falls * angegeben in den Methodenparametern nach. Findet sie dort auch nichts, liefert * die Methode null. * @param type diff --git a/src/de/dhbwstuttgart/syntaxtree/Constant.java b/src/de/dhbwstuttgart/syntaxtree/Constant.java index b1be13aa9..1c9bc2f2a 100755 --- a/src/de/dhbwstuttgart/syntaxtree/Constant.java +++ b/src/de/dhbwstuttgart/syntaxtree/Constant.java @@ -4,10 +4,6 @@ package de.dhbwstuttgart.syntaxtree; // ino.module.Constant.8556.import import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.bytecode.AttributeInfo; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.core.MyCompiler; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.parser.JavaClassName; @@ -18,7 +14,7 @@ import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.typeinference.JavaCodeResult; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; -import sun.reflect.generics.reflectiveObjects.NotImplementedException; +import de.dhbwstuttgart.typeinference.exceptions.NotImplementedException; // ino.class.Constant.23212.description type=javadoc /** @@ -159,32 +155,7 @@ public class Constant extends Method this.mod = modifiers; } // ino.end - - // ino.method.codegen.23258.definition - public void codegen(ClassFile classfile, Menge paralist) - throws JVMCodeException - // ino.end -// ino.method.codegen.23258.body -{ - // Zugehoerigen Typ (I, Z, C, Ljava/lang/String;) fuer den Typ ermitteln - String bcgType = JVMCode.get_codegen_Type(typ.getName().toString(), paralist); - - if (getValue() == null || !(getValue() instanceof Literal) ) { - throw new JVMCodeException("Die Generierung der Konstante wird nicht unterstuetzt!"); - } - - // Attribut fuer Wertzuweisung erstellen - short index = (short) ((Literal)getValue()).ConstantCodegen(classfile); - AttributeInfo attrinfo = new AttributeInfo(); - attrinfo.set_attribute_name_index(classfile.getConstantValueID()); - attrinfo.set_info(JVMCode.shortToBytes(index)); - - - // Field hinzufuegen - classfile.add_field(name, bcgType, mod.calculate_access_flags(), attrinfo); - } -// ino.end // ino.method.getOffset.23261.definition public int getOffset() diff --git a/src/de/dhbwstuttgart/syntaxtree/Constructor.java b/src/de/dhbwstuttgart/syntaxtree/Constructor.java index 859b2c029..e7b295698 100644 --- a/src/de/dhbwstuttgart/syntaxtree/Constructor.java +++ b/src/de/dhbwstuttgart/syntaxtree/Constructor.java @@ -2,7 +2,6 @@ package de.dhbwstuttgart.syntaxtree; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.parser.JavaClassName; import de.dhbwstuttgart.syntaxtree.misc.DeclId; diff --git a/src/de/dhbwstuttgart/syntaxtree/Field.java b/src/de/dhbwstuttgart/syntaxtree/Field.java index 0437b44cc..2b40a0859 100644 --- a/src/de/dhbwstuttgart/syntaxtree/Field.java +++ b/src/de/dhbwstuttgart/syntaxtree/Field.java @@ -2,7 +2,6 @@ package de.dhbwstuttgart.syntaxtree; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.misc.DeclId; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; @@ -50,8 +49,6 @@ public abstract class Field extends GTVDeclarationContext implements TypeInserta return typ; } - public abstract void codegen(ClassFile classfile, Menge paralist) - throws JVMCodeException; @Override public Menge getGenericParameter() { @@ -79,7 +76,7 @@ public abstract class Field extends GTVDeclarationContext implements TypeInserta public Menge getDeclIdMenge() { - // otth: ganzer Vektor zur�ckgeben, um ihn zu kopieren (vgl. MyCompiler - Konstruktor in Methode umwandeln) + // otth: ganzer Vektor zur�ckgeben, um ihn zu kopieren (vgl. MyCompiler - Konstruktor in Methode umwandeln) return declid; } @@ -95,7 +92,7 @@ public abstract class Field extends GTVDeclarationContext implements TypeInserta public abstract JavaCodeResult printJavaCode(ResultSet resultSet); /** - * Diese Methode generiert die Assumptions für dieses Feld der Klasse classmember + * Diese Methode generiert die Assumptions für dieses Feld der Klasse classmember * @param classmember * @return */ @@ -150,7 +147,7 @@ public abstract class Field extends GTVDeclarationContext implements TypeInserta @Override public int getGenericVarDeclarationOffset(){ - // Falls Generische Parameterliste vorhanden, hier Wert der Liste zurückgegebn + // Falls Generische Parameterliste vorhanden, hier Wert der Liste zurückgegebn if(this.genericParameters != null){ return this.genericParameters.getEndOffset(); }else{ diff --git a/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java b/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java index 5eef3adea..b452e3fc4 100644 --- a/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java +++ b/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java @@ -2,7 +2,6 @@ package de.dhbwstuttgart.syntaxtree; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.misc.DeclId; import de.dhbwstuttgart.syntaxtree.statement.Expr; @@ -21,7 +20,7 @@ import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException; /** - * Eine Feldinitialisation steht für eine Felddeklaration mit gleichzeitiger Wertzuweisung + * Eine Feldinitialisation steht für eine Felddeklaration mit gleichzeitiger Wertzuweisung * Beispiel: 'public Feld FeldVar = FeldWert;' * @author janulrich * @@ -33,8 +32,8 @@ public class FieldDeclaration extends Field{ //private Menge parameter; /** - * Dieser Konstruktor der FieldDeclaration erstellt den Syntaxknoten vollständig. - * Kein nachträgliches hinzfügen von Informationen oder aufrufen von parserPostProcessing ist notwendig. + * Dieser Konstruktor der FieldDeclaration erstellt den Syntaxknoten vollständig. + * Kein nachträgliches hinzfügen von Informationen oder aufrufen von parserPostProcessing ist notwendig. */ public FieldDeclaration(String name, Type typ){ super(0);//Dieser Deklarator wird nicht vom Parser aufgerufen. Dadurch gibt es auch keinen Offset @@ -57,12 +56,6 @@ public class FieldDeclaration extends Field{ return this.get_Name().elementAt(0).name; } - @Override - public void codegen(ClassFile classfile, Menge paralist) - throws JVMCodeException { - // TODO Auto-generated method stub - - } @Override public String toString() @@ -88,7 +81,7 @@ public class FieldDeclaration extends Field{ ////////////////////////////// TypeAssumptions assumptions = new TypeAssumptions(); /* - * Der Feld-Assumption muss ein TPH als Typ hinzugefügt werden, falls er Typlos initialisiert wurde. Dies kann auch der Type-Algorithmus der Inst/FieldVar - Klasse machen. + * Der Feld-Assumption muss ein TPH als Typ hinzugefügt werden, falls er Typlos initialisiert wurde. Dies kann auch der Type-Algorithmus der Inst/FieldVar - Klasse machen. * Wird das Feld mit einem Typ initialisiert so muss dieser auch in die Assumptions. */ if(this.getType() == null)throw new TypeinferenceException("Der Typ eines Feldes darf nicht null sein", this); @@ -117,7 +110,7 @@ public class FieldDeclaration extends Field{ @Override public ConstraintsSet TYPE(TypeAssumptions publicAssumptions) { if(this.wert == null && (this.getType() == null || this.getType() instanceof TypePlaceholder)) - throw new TypeinferenceException("Typlose Felder müssen mit Wert initialisiert werden", this); + throw new TypeinferenceException("Typlose Felder müssen mit Wert initialisiert werden", this); ConstraintsSet ret = new ConstraintsSet(); TypeAssumptions localAssumptions = publicAssumptions.clone(); @@ -151,7 +144,7 @@ public class FieldDeclaration extends Field{ ret.add(c1); //Damit die TypVariable des Felds in den Constraints auftaucht if(this.wert!=null){ - //Falls bei der Deklaration ein Wert zugewiesen wird, verhält sich das Constraintserzeugen wie bei dem Assign-Statement: + //Falls bei der Deklaration ein Wert zugewiesen wird, verhält sich das Constraintserzeugen wie bei dem Assign-Statement: ret.add(this.wert.TYPEExpr(localAssumptions)); ret.add(new SingleConstraint(this.wert.getType().TYPE(localAssumptions,this), thisType)); } @@ -161,7 +154,7 @@ public class FieldDeclaration extends Field{ @Override public void wandleRefTypeAttributes2GenericAttributes(Menge paralist){ super.wandleRefTypeAttributes2GenericAttributes(paralist); - if(this.getWert()!=null)this.getWert().wandleRefTypeAttributes2GenericAttributes(paralist, new Menge()); //FieldDeclaration hat keine Generischen Variablen, daher leere Liste übergeben + if(this.getWert()!=null)this.getWert().wandleRefTypeAttributes2GenericAttributes(paralist, new Menge()); //FieldDeclaration hat keine Generischen Variablen, daher leere Liste übergeben } } diff --git a/src/de/dhbwstuttgart/syntaxtree/FormalParameter.java b/src/de/dhbwstuttgart/syntaxtree/FormalParameter.java index c4115bc49..e410bd57c 100755 --- a/src/de/dhbwstuttgart/syntaxtree/FormalParameter.java +++ b/src/de/dhbwstuttgart/syntaxtree/FormalParameter.java @@ -7,8 +7,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.syntaxtree.misc.DeclId; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; @@ -43,7 +41,7 @@ public class FormalParameter extends SyntaxTreeNode implements Typeable, TypeIns @Override public boolean equals(Object object) { - //if(!super.equals(object))return false; //Nicht die Position im SyntaxBaum prüfen. + //if(!super.equals(object))return false; //Nicht die Position im SyntaxBaum prüfen. if(!(object instanceof FormalParameter))return false; FormalParameter equals = (FormalParameter)object; if((this.type==null)!=(equals.type == null))return false; @@ -56,7 +54,7 @@ public class FormalParameter extends SyntaxTreeNode implements Typeable, TypeIns // ino.method.setType.23404.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @param t */ // ino.end @@ -115,16 +113,6 @@ public class FormalParameter extends SyntaxTreeNode implements Typeable, TypeIns // ino.end - - // ino.method.codegen.23419.definition - public void codegen(ClassFile classfile, CodeAttribute code) - // ino.end - // ino.method.codegen.23419.body - { - code.add_local(declid.get_Name(), this.getType()); - } - // ino.end - // ino.method.getOffset.23422.defdescription type=javadoc /** *
Author: Thomas Hornberger 09.04.2006 @@ -142,7 +130,7 @@ public class FormalParameter extends SyntaxTreeNode implements Typeable, TypeIns // ino.method.getLineNumber.23425.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end @@ -158,7 +146,7 @@ public class FormalParameter extends SyntaxTreeNode implements Typeable, TypeIns // ino.method.getTypeLineNumber.23431.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/Generic.java b/src/de/dhbwstuttgart/syntaxtree/Generic.java index bcd366115..90d636488 100644 --- a/src/de/dhbwstuttgart/syntaxtree/Generic.java +++ b/src/de/dhbwstuttgart/syntaxtree/Generic.java @@ -6,7 +6,7 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; /** - * Wird von allen Klassen implementiert, welche generische Parameter halten können. (Class, Method und Field) + * Wird von allen Klassen implementiert, welche generische Parameter halten können. (Class, Method und Field) * @author janulrich * */ diff --git a/src/de/dhbwstuttgart/syntaxtree/ImportDeclarations.java b/src/de/dhbwstuttgart/syntaxtree/ImportDeclarations.java index a25efc009..28bc26da2 100755 --- a/src/de/dhbwstuttgart/syntaxtree/ImportDeclarations.java +++ b/src/de/dhbwstuttgart/syntaxtree/ImportDeclarations.java @@ -14,7 +14,7 @@ import de.dhbwstuttgart.syntaxtree.misc.UsedId; * HOTI 4.5.06 * Auch wenn es nicht so aussieht, hat diese Klasse einen Sinn :-) * Der Parser kann keine Generischen Typen darstellen, damit trotzdem - * an amap Stellen die Typsicherheit gewährleistet ist, hier eine Kapselung... + * an amap Stellen die Typsicherheit gewährleistet ist, hier eine Kapselung... */ // ino.end // ino.class.ImportDeclarations.23434.declaration diff --git a/src/de/dhbwstuttgart/syntaxtree/Interface.java b/src/de/dhbwstuttgart/syntaxtree/Interface.java index 194297d6c..eb5aff6ae 100755 --- a/src/de/dhbwstuttgart/syntaxtree/Interface.java +++ b/src/de/dhbwstuttgart/syntaxtree/Interface.java @@ -5,7 +5,6 @@ package de.dhbwstuttgart.syntaxtree; // ino.module.Interface.8582.import import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.core.AClassOrInterface; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.misc.UsedId; diff --git a/src/de/dhbwstuttgart/syntaxtree/InterfaceBody.java b/src/de/dhbwstuttgart/syntaxtree/InterfaceBody.java index ea79a3f5e..986eabd11 100755 --- a/src/de/dhbwstuttgart/syntaxtree/InterfaceBody.java +++ b/src/de/dhbwstuttgart/syntaxtree/InterfaceBody.java @@ -5,7 +5,6 @@ package de.dhbwstuttgart.syntaxtree; // ino.module.InterfaceBody.8583.import import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.modifier.Modifiers; @@ -98,43 +97,6 @@ public class InterfaceBody } // ino.end - // ino.method.codegen.24011.definition - public void codegen(ClassFile cf, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.24011.body - { - - // Constanten verarbeiten - for (int i=0; i < ConstantVektor.size(); i++) { - ConstantVektor.elementAt(i).codegen(cf, paralist); - } - - // Methodenheader verarbeiten - for (int i=0; i < MethodVektor.size(); i++) { - Method m = MethodVektor.elementAt(i); - - Modifiers mod = m.getDeclIdMenge().elementAt(0).get_Modifiers(); - - if (mod != null){ - mod.ensureAbstract(); - mod.ensurePublic(); - } else { - mod = new Modifiers(); - mod.ensureAbstract(); - mod.ensurePublic(); - m.getDeclIdMenge().elementAt(0).set_Modifiers(mod); - } - - - // Sicherstellen, dass kein Bytecode innerhalb - // der Methode generiert wird. - m.setAbstract(true); - m.codegen(cf, paralist); - } - } - // ino.end - } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/Method.java b/src/de/dhbwstuttgart/syntaxtree/Method.java index f068ab67f..a288aa98a 100755 --- a/src/de/dhbwstuttgart/syntaxtree/Method.java +++ b/src/de/dhbwstuttgart/syntaxtree/Method.java @@ -9,7 +9,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.core.MyCompiler; import de.dhbwstuttgart.myexception.JVMCodeException; @@ -86,7 +85,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable // ino.attribute.m_LineNumber.23512.declaration private int m_LineNumber = MyCompiler.NO_LINENUMBER; // ino.end - private int m_Offset = -1; //hinzugef�gt hoth: 07.04.2006 + private int m_Offset = -1; //hinzugef�gt hoth: 07.04.2006 // ino.attribute.inferencelog.23515.declaration protected static Logger inferencelog = Logger.getLogger("inference"); // ino.end @@ -311,33 +310,6 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable - // ino.method.get_codegen_Param_Type.23572.definition - public String get_codegen_Param_Type(Menge paralist) - // ino.end - // ino.method.get_codegen_Param_Type.23572.body - { - String ret = new String(); - if(this.getParameterList() == null) - { - ret += "()"; - } - else - { - ret += this.getParameterList().get_codegen_ParameterList(paralist); - } - if(this.getType() == null) - { - ret += "V"; - } - else - { - ret += this.getType().get_codegen_Type(paralist); - } - return ret; - } - // ino.end - - // ino.method.get_Method_Name.23575.definition public String get_Method_Name() @@ -359,16 +331,6 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable // ino.end - - // ino.method.codegen.23581.definition - public void codegen(ClassFile classfile, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.23581.body - { - classfile.add_method(declid.firstElement().get_Name(), this.get_codegen_Param_Type(paralist), this.getParameterList(), this.getType(), block, declid.firstElement().get_access_flags(), paralist, isAbstract); - } - // ino.end // ino.method.getLineNumber.23584.definition public int getLineNumber() @@ -389,7 +351,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable // ino.end // ino.method.getOffset.23590.defdescription type=line - // hinzugef�gt hoth: 07.04.2006 + // hinzugef�gt hoth: 07.04.2006 // ino.end // ino.method.getOffset.23590.definition public int getOffset() @@ -410,7 +372,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable // ino.end // ino.method.setOffset.23596.defdescription type=line - // hinzugef�gt hoth: 07.04.2006 + // hinzugef�gt hoth: 07.04.2006 // ino.end // ino.method.setOffset.23596.definition public void setOffset(int Offset) @@ -439,7 +401,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable // ino.method.toString.23605.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end @@ -529,8 +491,8 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable public ConstraintsSet TYPE(TypeAssumptions ass) { ConstraintsSet ret = new ConstraintsSet(); TypeAssumptions localAss = new TypeAssumptions(); - localAss.add(ass); //Die globalen Assumptions anhängen - //Generische Parameterdeklarationen den Assumptions anfügen: + localAss.add(ass); //Die globalen Assumptions anhängen + //Generische Parameterdeklarationen den Assumptions anfügen: for(GenericTypeVar gtv : this.getGenericParameter()){ localAss.add(gtv.createAssumptions()); } @@ -549,7 +511,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable this.returntype = replaceType; } */ - //Die Parameter zu den Assumptions hinzufügen: + //Die Parameter zu den Assumptions hinzufügen: if(this.parameterlist!=null)for(FormalParameter param : this.parameterlist){ param.setType(param.getType().checkTYPE(localAss, this)); @@ -567,7 +529,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable localAss.addAssumption(new ParameterAssumption(param)); } ret.add(this.block.TYPEStmt(localAss)); - //eine Verknüpfung mit der Type Assumption aus dem Assumption Set und dem ermittelten Typ der Methode: + //eine Verknüpfung mit der Type Assumption aus dem Assumption Set und dem ermittelten Typ der Methode: ret.add(new SingleConstraint(this.block.getType().TYPE(localAss, this), this.returntype.TYPE(localAss, this))); return ret; } @@ -629,7 +591,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable //methodList.addElement(method); - //F�r V_fields_methods: + //F�r V_fields_methods: CMethodTypeAssumption methodAssum = new CMethodTypeAssumption(classmember.getType(), this.get_Method_Name(), this.getType(), this.getParameterCount(),this.getLineNumber(),this.getOffset(),new Menge(),this.getGenericMethodParameters()); // Typannahme bauen... @@ -642,7 +604,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable this.setOverloadedID(methodAssum.getHashSetKey().getOverloadedMethodID()); - //F�r die V_i: + //F�r die V_i: CTypeAssumptionSet localAssum = new CTypeAssumptionSet(); //Bauen... @@ -650,7 +612,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable if(parameterList!=null){ for(int i=0; i()); //fuege Offsets fuer Parameter hinzu, hoth: 06.04.2006 Class.isFirstLocalVarDecl=false; @@ -660,15 +622,15 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable methodAssum.addParaAssumption(paraAssum); - // F�r die V_i: + // F�r die V_i: CLocalVarTypeAssumption varAssum = new CLocalVarTypeAssumption(classmember.getName(), this.get_Method_Name(), this.getParameterCount(), this.getOverloadedID(),"1", para.get_Name(),para.getType(), para.getLineNumber(),para.getOffset(),new Menge()); localAssum.addElement(varAssum); //rememberLocals.addElement(varAssum); } } - //...und hinzuf�gen: + //...und hinzuf�gen: - assumptions.add(localAssum);//Assumptions für lokale Variablen den Assumptions hinzufügen + assumptions.add(localAssum);//Assumptions für lokale Variablen den Assumptions hinzufügen //Hier wird der Typ der als Assumption eingetragen wird in die Variable assumedType dieser Klasse geschrieben: if(this.assumedType == null) // Falls der Typ nicht schon gesetzt ist. Das ist der Fall, falls die Methode ein Konstruktor ist @@ -682,7 +644,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable @Override public void parserPostProcessing(SyntaxTreeNode parent){ if(this.getType()==null)this.setType(TypePlaceholder.fresh(this)); - //Bei dem Elterntyp der Methode darf es sich nur um eine Klasse handeln, daher Cast ohne Prüfung: + //Bei dem Elterntyp der Methode darf es sich nur um eine Klasse handeln, daher Cast ohne Prüfung: //Class parentClass = (Class)parent; if(this.returntype == null)this.returntype = TypePlaceholder.fresh(this); super.parserPostProcessing(parent); @@ -714,7 +676,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable // Methode und Block teilen sich einen ReturnType: //this.block.setType(t); this.returntype = t; - this.returntype.parent = this; //TODO: Dieser Hack sollte nicht nötig sein. (Parser ändern) + this.returntype.parent = this; //TODO: Dieser Hack sollte nicht nötig sein. (Parser ändern) } /** diff --git a/src/de/dhbwstuttgart/syntaxtree/ParameterList.java b/src/de/dhbwstuttgart/syntaxtree/ParameterList.java index 7839e55d7..a19889d05 100755 --- a/src/de/dhbwstuttgart/syntaxtree/ParameterList.java +++ b/src/de/dhbwstuttgart/syntaxtree/ParameterList.java @@ -7,8 +7,6 @@ import de.dhbwstuttgart.typeinference.Menge; import java.util.Iterator; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.syntaxtree.type.BaseType; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.typeinference.JavaCodeResult; @@ -39,39 +37,6 @@ public class ParameterList extends SyntaxTreeNode implements Iterable + * Author: J�rg B�uerle
* @return Die Anzahl der Parameter */ // ino.end @@ -132,7 +88,7 @@ public class ParameterList extends SyntaxTreeNode implements Iterabletrue gesetzt ist, wird immer als Superklasse Object - * mit rein geladen. Dies hat natürlich zur Folge, dass man in der GUI jeden Typ - * auswählen muss, weil ALLES in Java von Object erbt. Sobald die GUI das über eine - * Checkbox o.ä. ausblendbar macht kann es aktiviert werden. Ebenso beeinflusst es + * mit rein geladen. Dies hat natürlich zur Folge, dass man in der GUI jeden Typ + * auswählen muss, weil ALLES in Java von Object erbt. Sobald die GUI das über eine + * Checkbox o.ä. ausblendbar macht kann es aktiviert werden. Ebenso beeinflusst es * die superclass von allen Class-Objekten. (Wenn true ist jede Class automatisch * wenn nicht anders eingegeben Subclass von Object (Wie es sein muss)) */ @@ -87,7 +86,7 @@ public class SourceFile // ino.attribute.READ_BASE_TYPE_SUPERCLASSES_FROM_JRE.21364.decldescription type=javadoc /** - * Wenn dieses Flag auf false ist, werden für alle Basisklassen (definiert + * Wenn dieses Flag auf false ist, werden für alle Basisklassen (definiert * durch die Hashtable baseTypeTranslationTable) KEINE Superklassen geladen. D.h. * Integer hat bspw. nicht die Superklasse Number sondern OBJECT. * Dies verursacht bei den Int-Operationen ein Problem @@ -100,7 +99,7 @@ public class SourceFile /** * @autor PL - * Wenn dieses Flag auf false ist, werden für alle importierten Klassen + * Wenn dieses Flag auf false ist, werden für alle importierten Klassen * KEINE Superklassen geladen. */ private static final boolean READ_IMPORTED_SUPERCLASSES_FROM_JRE = false; @@ -128,7 +127,7 @@ public class SourceFile // ino.end /** - * Die SourceFile repräsntiert eine zu einem Syntaxbaum eingelesene Java-Datei. + * Die SourceFile repräsntiert eine zu einem Syntaxbaum eingelesene Java-Datei. * SourceFile stellt dabei den Wurzelknoten des Syntaxbaumes dar. */ public SourceFile(){ @@ -178,12 +177,12 @@ public class SourceFile // ino.end // ino.attribute.baseTypeTranslationTable.21385.decldescription type=javadoc /** - * Table zum Übersetzen der nicht implementierten Base-Types: - * Überall im Compiler wird statt bspw. int Integer verwendet + * Table zum Übersetzen der nicht implementierten Base-Types: + * Überall im Compiler wird statt bspw. int Integer verwendet * d.h. 1+2 liefert ein Integer - * Deshalb benötigen wir hier eine Tabelle, mit der man die von + * Deshalb benötigen wir hier eine Tabelle, mit der man die von * der JRE gelieferten Base-Typen (int,char, etc) und die Objekt- - * Typen umwandeln können + * Typen umwandeln können */ // ino.end // ino.attribute.baseTypeTranslationTable.21385.declaration @@ -295,7 +294,7 @@ public class SourceFile // ino.method.makeFC.21403.defdescription type=javadoc /** * Erstellt die Finite Closure - * @return FC_TTO-Object, welches die Finite Closure repräsentiert + * @return FC_TTO-Object, welches die Finite Closure repräsentiert */ // ino.end // ino.method.makeFC.21403.definition @@ -311,7 +310,7 @@ public class SourceFile globalAssumptions.add(this.getPublicFieldAssumptions()); // 1. Menge <= in FC aufnehmen --> Iteration ueber alle Klassen - Menge ignoreTypes = new Menge<>(); //Enthält die Typen, welche nicht in der FC als Supertypen enthalten sein sollen. + Menge ignoreTypes = new Menge<>(); //Enthält die Typen, welche nicht in der FC als Supertypen enthalten sein sollen. ignoreTypes.add(new RefType("Long",null,-1).TYPE(globalAssumptions, parent).getType()); ignoreTypes.add(new RefType("Float",null,-1).TYPE(globalAssumptions, parent).getType()); ignoreTypes.add(new RefType("Double",null,-1).TYPE(globalAssumptions, parent).getType()); @@ -327,10 +326,10 @@ public class SourceFile //System.out.println("FCPair: "+p); if(! t1.equals(t2)){//Um FC_TTO darf kein T <. T stehen. Type superTypeFromAssumptions = ass.getTypeFor(t2, t2).getType(); //In den Assumptions den SuperTyp nachschlagen - if(superTypeFromAssumptions != null && ! ignoreTypes.contains(superTypeFromAssumptions)){//Die Superklasse eines Typs nur anfügen, wenn er auch in den Assumptions vorkommt. + if(superTypeFromAssumptions != null && ! ignoreTypes.contains(superTypeFromAssumptions)){//Die Superklasse eines Typs nur anfügen, wenn er auch in den Assumptions vorkommt. vFC.add(p); } - basicAssumptionsClassMenge.add(cAss.getAssumedClass());//Klasse ohne die Superklasse anfügen + basicAssumptionsClassMenge.add(cAss.getAssumedClass());//Klasse ohne die Superklasse anfügen }else{ //System.out.println("Wurde nicht aufgenommen"); } @@ -403,7 +402,7 @@ public class SourceFile // konkret: rechte Seite von FC nach Typkonstruktoren in der Parameterliste durchsuchen for( int n = 0; n < vFC.size(); n++ ) { - // Elemente in FC k�nnen nur Pair's sein --> Cast ohne Abfrage + // Elemente in FC k�nnen nur Pair's sein --> Cast ohne Abfrage Pair PTypKonst = vFC.elementAt(n); // Parameter des rechten Typausdrucks des betrachteten Paars extrahieren @@ -445,7 +444,7 @@ public class SourceFile { inferencelog.debug(" gefundener Typ links: " + ((RefType)(PSuchen.TA1)).getName(), Section.FINITECLOSURE ); inferencelog.debug(" gefundener Typ rechts: " + ((RefType)(PSuchen.TA2)).getName() , Section.FINITECLOSURE); - // Paar gefunden, das als linken Typ den gleichen Typen enth�lt, der als Parameter einen Typkonstruktor hat + // Paar gefunden, das als linken Typ den gleichen Typen enth�lt, der als Parameter einen Typkonstruktor hat // Substitution //Pair P = new Pair( PSuchen.getTA1Copy( ), PSuchen.getTA2Copy( ) ); //linker Typterm bleibt gleich @@ -498,7 +497,7 @@ public class SourceFile // new RefType( (RefType)vPara.elementAt(u) ), // false ); // rechte Seite substituieren //Es genuegt die rechte Seite zu substituieren, da - //die linke Seite ein Typterm ausschlie�lich mit + //die linke Seite ein Typterm ausschlie�lich mit //Typvariablen ist } //Unify.SubstHashtableGeneric(((RefType)P.TA1), hts); //funktioniert nicht @@ -597,7 +596,7 @@ public class SourceFile } } // end for: linke Seite suchen } // end if: Element ist RefType - } // end for: Transitivit�ten berechnen + } // end for: Transitivit�ten berechnen //PL HIER REFLEXIVE HUELLE EINFUEGEN // 05-01-07 @@ -658,13 +657,13 @@ public class SourceFile ///////////////////////////////////////////////////////////////////////// // ino.method.typeReconstruction.21406.defdescription type=javadoc /** - * Tyrekonstruktionsalgorithmus: ruft f�r jede Klasse den Algorithmus TRProg auf. - * Dessen Ergebnismenge A, die Menge aller Typannahmen, f�r eine Klasse dient als - * Eingabe f�r TRProg der n�chsten Klasse. Am Ende enth�lt A alle m�glichen - * Typkombinationen f�r alle Klassen zusammen. - *
Author: J�rg B�uerle - * @return Liste aller m�glichen Typkombinationen - * @throws CTypeReconstructionException Wenn was schief l�uft + * Tyrekonstruktionsalgorithmus: ruft f�r jede Klasse den Algorithmus TRProg auf. + * Dessen Ergebnismenge A, die Menge aller Typannahmen, f�r eine Klasse dient als + * Eingabe f�r TRProg der n�chsten Klasse. Am Ende enth�lt A alle m�glichen + * Typkombinationen f�r alle Klassen zusammen. + *
Author: J�rg B�uerle + * @return Liste aller m�glichen Typkombinationen + * @throws CTypeReconstructionException Wenn was schief l�uft */ // ino.end // ino.method.typeReconstruction.21406.definition @@ -678,7 +677,7 @@ public class SourceFile //Logger initialisieren: Logger typinferenzLog = Logger.getLogger("Typeinference"); - //Alle Assumptions für diese SourceFile sammeln: + //Alle Assumptions für diese SourceFile sammeln: for(Class klasse : this.KlassenVektor){ globalAssumptions.add(klasse.getPublicFieldAssumptions()); } @@ -703,14 +702,14 @@ public class SourceFile //Karthesisches Produkt bilden: //////////////// - //Unmögliche ConstraintsSets aussortieren durch Unifizierung + //Unmögliche ConstraintsSets aussortieren durch Unifizierung Unifier unifier = (pairs)->{ Menge> retValue = new Menge<>(); retValue = Unify.unify(pairs, finiteClosure); return retValue;}; //oderConstraints.filterWrongConstraints(unifier); oderConstraints.unifyUndConstraints(unifier); - typinferenzLog.debug("Übriggebliebene Konstraints:\n"+oderConstraints+"\n", Section.TYPEINFERENCE); + typinferenzLog.debug("Übriggebliebene Konstraints:\n"+oderConstraints+"\n", Section.TYPEINFERENCE); //Die Constraints in Pair's umwandeln (Karthesisches Produkt bilden): Menge> xConstraints = oderConstraints.cartesianProduct(); /* @@ -731,10 +730,10 @@ public class SourceFile ////////////////////////////// boolean unifyFail = true; for(Menge constraints : xConstraints){ - //Alle durch das Karthesische Produkt entstandenen Möglichkeiten durchgehen: + //Alle durch das Karthesische Produkt entstandenen Möglichkeiten durchgehen: Menge> result = new Menge>(); - //Alle FunN-Typen werden per clone-methode in RefTypes verwandelt. (Die clone Methode in FunN darf nicht überschrieben werden. + //Alle FunN-Typen werden per clone-methode in RefTypes verwandelt. (Die clone Methode in FunN darf nicht überschrieben werden. for(Pair p : constraints){ if(p.TA1 instanceof FunN){ p.TA1 = p.TA1.clone(); @@ -802,7 +801,7 @@ public class SourceFile ).collect(Menge::new, Menge::add, Menge::addAll); //Schritt 2: Schnittmengen jedes Elements mit jedem Elememt von vars bilden und dann index zusammenfassen - //in indexset sind dann die Mengen von Indizes enthalten, die gemeisam unifiziert wreden müssen + //in indexset sind dann die Mengen von Indizes enthalten, die gemeisam unifiziert wreden müssen Menge> indexeset = new Menge<>(); if (constraintsclonevars != null && constraintsclonevars.size()>0) { indexeset = Unify.schnitt(constraintsclonevars); @@ -880,7 +879,7 @@ public class SourceFile }); //Menge> unifyResult = Unify.unify(constraintsClone, finiteClosure); - //Dann den Ergebnissen anfügen + //Dann den Ergebnissen anfügen result.addAll(unifyResult); // Debugoutput:Menge> @@ -888,10 +887,10 @@ public class SourceFile //typinferenzLog.debug("Unifiziertes Ergebnis: "+result, Section.TYPEINFERENCE); /* - // Prüfe ob eindeutige Lösung: + // Prüfe ob eindeutige Lösung: if(result.size()>1 && !Unify.hasSolvedForm(result.elementAt(0))){ - typinferenzLog.debug("Keine eindeutige Lösung!"); + typinferenzLog.debug("Keine eindeutige Lösung!"); }else if(result.size()>1){ @@ -912,9 +911,9 @@ public class SourceFile //typinferenzLog.debug(this.printJavaCode(new ResultSet(new Menge()))); - //Für jede Klasse in diesem SourceFile gilt das selbe ResultSet: + //Für jede Klasse in diesem SourceFile gilt das selbe ResultSet: for(Class klasse : this.KlassenVektor){ - //Der Unifikationsalgorithmus kann wiederum auch mehrere Lösungen errechnen, diese werden im folgenden durchlaufen: + //Der Unifikationsalgorithmus kann wiederum auch mehrere Lösungen errechnen, diese werden im folgenden durchlaufen: for(Menge resultSet : result){ unifyFail = false; //Ein Unifiziertes Ergebnis ist entstanden (es kann auch leer sein, das bedeutet nur, dass die Constraints mindestens in einem Fall Sinn ergaben) //Add Result set as a new ReconstructionResult to ret: @@ -922,7 +921,7 @@ public class SourceFile ret.add(reconstructionResult); //ResultSet res = new ResultSet(resultSet); - typinferenzLog.debug("JavaFile für ResultSet "+reconstructionResult+"\n", Section.TYPEINFERENCE); + typinferenzLog.debug("JavaFile für ResultSet "+reconstructionResult+"\n", Section.TYPEINFERENCE); typinferenzLog.debug(klasse.printJavaCode(reconstructionResult), Section.TYPEINFERENCE); } @@ -934,8 +933,8 @@ public class SourceFile return ret; /* // HOTI: Nur zur Info.Ich habe den Loglevel auf Info geschaltet, damit - // in der GUI (Eclipse-Plugin) die Console nicht zugemüllt wird. - // Wers braucht kanns natürlich ausschalten + // in der GUI (Eclipse-Plugin) die Console nicht zugemüllt wird. + // Wers braucht kanns natürlich ausschalten // inferencelog.setLevel(Level.INFO); @@ -966,7 +965,7 @@ public class SourceFile this.KlassenVektor); } - // HOTI 04-13-06 Alle Methoden der Klassen überprüfen, ob sie als + // HOTI 04-13-06 Alle Methoden der Klassen überprüfen, ob sie als // RefType deklarierte Attribute haben, die aber GenericTypeVars sind // Bsp.: // bei public E elementAt(i){...} wird E vorerst als RefType erkannt @@ -1014,10 +1013,10 @@ public class SourceFile inferencelog.info("Rufe \"SourceFile.makeFC()\"..."); - inferencelog.info("������������������������������������"); + inferencelog.info("������������������������������������"); FC_TTO finiteClosure = this.makeFC(); - inferencelog.info("������������������������������������"); - inferencelog.info("Bin aus \"SourceFile.makeFC()\" zur�ck."); + inferencelog.info("������������������������������������"); + inferencelog.info("Bin aus \"SourceFile.makeFC()\" zur�ck."); this.removeBasicAssumptions(); // PL 05-08-02 @@ -1031,19 +1030,19 @@ public class SourceFile Interface intf = intf_it.next(); // HOTI In diesem Moment gibt es nur _eine_ potentielle CTypeReconstructionResult, d.h. - // dort können die Definitionen der Interfaces (Methodintersectiontypes, FieldDecls) abgelegt werden + // dort können die Definitionen der Interfaces (Methodintersectiontypes, FieldDecls) abgelegt werden //intf.addThisToAssumptions(basics); } - // Fuer jede Klasse die Assumptions der öffentlichen Felder zusammentragen: + // Fuer jede Klasse die Assumptions der öffentlichen Felder zusammentragen: TypeAssumptions publicFieldsAssumptions = new TypeAssumptions(); for(Class cl : KlassenVektor){ publicFieldsAssumptions.add(cl.getPublicFieldAssumptions()); } - // Die BasicAssumptions anfügen: + // Die BasicAssumptions anfügen: publicFieldsAssumptions.add(this.getBasicAssumptions()); // Fuer jede Klasse separat den TRA aufrufen @@ -1064,7 +1063,7 @@ public class SourceFile * Erstellt die Basic Assumptions (siehe MakeBasicAssumptions) als AssumptionSet * @return - @Deprecated //angefügt von Andreas Stadelmeier. Grund: Die Funktion wurde neu als makeBasicAssumptionsFromJRE angelegt + @Deprecated //angefügt von Andreas Stadelmeier. Grund: Die Funktion wurde neu als makeBasicAssumptionsFromJRE angelegt private TypeAssumptions getBasicAssumptions() { TypeAssumptions ret = new TypeAssumptions(null); @@ -1077,7 +1076,7 @@ public class SourceFile mod.addModifier(new Public()); - // Für jede einzelne Klasse + // Für jede einzelne Klasse while (imports.size()>0) { UsedId importDecl = imports.get(0); @@ -1209,9 +1208,9 @@ public class SourceFile }*/ /** - * Erstellt die Assumptions der standardmäßig importierten Packages (java.lang.) sowie der von imports übergebenen Klassen zusammen. + * Erstellt die Assumptions der standardmäßig importierten Packages (java.lang.) sowie der von imports übergebenen Klassen zusammen. * @param imports - * @param withSuptypes - Gibt an, ob auch die subklassen der Packages den Assumptions angefügt werden sollen. + * @param withSuptypes - Gibt an, ob auch die subklassen der Packages den Assumptions angefügt werden sollen. * @return */ private TypeAssumptions makeBasicAssumptionsFromJRE(Menge imports, boolean withSubtypes) @@ -1228,10 +1227,10 @@ public class SourceFile Modifiers mod = new Modifiers(); mod.addModifier(new Public()); - //Für Object: + //Für Object: imports.add(new UsedId("java.lang.Object",-1)); - // Für jede einzelne Klasse + // Für jede einzelne Klasse while (imports.size()>0) { UsedId importDecl = imports.get(0); @@ -1394,7 +1393,7 @@ public class SourceFile return new Class("java.lang.Object",new Modifiers(), 0); } - Menge supertypeGenPara = new Menge<>();//Die Generischen Parameter für die Superklasse berechnen: + Menge supertypeGenPara = new Menge<>();//Die Generischen Parameter für die Superklasse berechnen: java.lang.reflect.TypeVariable[] superclassTVS=s.getTypeParameters(); for(int tvi=0;tviAchtung Workaround: Die RefTypes m�ssen sp�ter noch durch BaseTypes + * Erzeugt die Anfangsinformationen �ber bereits bekannte Klassen. + *
Achtung Workaround: Die RefTypes m�ssen sp�ter noch durch BaseTypes * ersetzt werden.
- * Author: J�rg B�uerle + * Author: J�rg B�uerle * * @return A priori Typinformationen * @throws ClassNotFoundException @@ -1599,7 +1598,7 @@ public class SourceFile // Menge bauen: //------------------------ foo.addClassName("java.lang.Menge"); //PL 05-08-01 eingefuegt - TypePlaceholder E = TypePlaceholder.fresh(); // Sp�ter ersetzen durch GenericTypeVar + TypePlaceholder E = TypePlaceholder.fresh(); // Sp�ter ersetzen durch GenericTypeVar Menge typeGenPara = new Menge(); typeGenPara.addElement(new GenericTypeVar(E.getName(),-1)); foo.addGenericTypeVars("java.lang.Menge", typeGenPara); @@ -1641,7 +1640,7 @@ public class SourceFile */ TypeAssumptions ret = new TypeAssumptions(); - //Basic Assumptions für die FunN Interfaces: + //Basic Assumptions für die FunN Interfaces: //TODO: Hier mehr als Fun1-Fun5 implementieren for(int i = 0; i<6; i++){ FunNInterface funN = new FunNInterface(i); @@ -1649,7 +1648,7 @@ public class SourceFile } - return ret; //TODO: Diese TypeAssumptions mit basic-Assumptions füllen + return ret; //TODO: Diese TypeAssumptions mit basic-Assumptions füllen } // ino.end @@ -1666,8 +1665,8 @@ public class SourceFile // ino.method.removeBasicAssumptions.21424.defdescription type=javadoc /** - * L�scht die Anfangsinformation wieder aus dem Klassenvektor - *
Author: J�rg B�uerle + * L�scht die Anfangsinformation wieder aus dem Klassenvektor + *
Author: J�rg B�uerle */ // ino.end // ino.method.removeBasicAssumptions.21424.definition @@ -1687,11 +1686,11 @@ public class SourceFile // ino.method.getPackageName.21427.defdescription type=javadoc /** - * Erzeugt f�r jede Klasse einen Menge, in den Referenzen auf die GenericTypeVars + * Erzeugt f�r jede Klasse einen Menge, in den Referenzen auf die GenericTypeVars * dieser Klasse gespeichert werden. Diese Mengeen werden unter den Klassennamen * in der - * Ergebnisdatenstruktur abgelegt. Au�erdem werden alle Klassennamen gespeichert. - *
Author: J�rg B�uerle + * Ergebnisdatenstruktur abgelegt. Au�erdem werden alle Klassennamen gespeichert. + *
Author: J�rg B�uerle * @param res * / * /*private void addClassNamesAndGenericsToRR(CTypeReconstructionResult res){ diff --git a/src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java b/src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java index e263adc36..5a8e494a2 100644 --- a/src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java +++ b/src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java @@ -21,11 +21,11 @@ public abstract class SyntaxTreeNode implements IItemWithOffset{ /** * Wird nach dem Parsen aufgerufen. - * Erfüllt folgenden Aufgaben: - * 1. Füllt fehlende Typangaben mit TPHs auf. - * 2. Verknüpft die Knoten des Syntaxbaums. (setzt Parent) + * Erfüllt folgenden Aufgaben: + * 1. Füllt fehlende Typangaben mit TPHs auf. + * 2. Verknüpft die Knoten des Syntaxbaums. (setzt Parent) * 3. Wechselt RefTypes gegebenenfalls mit GenericTypeVars aus. - * 4. Führt einen Teil des Syntaxckecks durch. + * 4. Führt einen Teil des Syntaxckecks durch. * */ public void parserPostProcessing(SyntaxTreeNode parent) { @@ -63,13 +63,13 @@ public abstract class SyntaxTreeNode implements IItemWithOffset{ SyntaxTreeNode equal = (SyntaxTreeNode)object; if(!equal.getDescription().equals(this.getDescription()))return false; if(this.getParent()!=null) - if(!this.getParent().equals(equal.getParent()))return false; //auch das Elternelement überprüfen. + if(!this.getParent().equals(equal.getParent()))return false; //auch das Elternelement überprüfen. return true; } /** * Methode zur Generierung der TypeInsertPoints - * @param insertSet - Generierte InsertPoints werden dem insertSet angefügt + * @param insertSet - Generierte InsertPoints werden dem insertSet angefügt * @param result - Das ResultSet auf dessen Basis die InsertPoints generiert werden */ public void addTypeInsertPoints(TypeInsertSet insertSet,ResultSet result) { @@ -77,7 +77,7 @@ public abstract class SyntaxTreeNode implements IItemWithOffset{ node.addTypeInsertPoints(insertSet, result); } - TypeInsertPoint tip = null; //Der TypInsertPoint für diesen Knoten + TypeInsertPoint tip = null; //Der TypInsertPoint für diesen Knoten //Fall der Knoten ein TypeInsertable ist, kann direkt der TypeInsertPoint generiert werden. if(this instanceof TypeInsertable){ TypeInsertable that = (TypeInsertable)this; @@ -87,7 +87,7 @@ public abstract class SyntaxTreeNode implements IItemWithOffset{ insertSet.add(tip);//ret.addAll(((TypePlaceholder)t).getTypeInsertPoints(result)); } /* - //Für den Fall, dass dieser Knoten Generische Variablen halten kann. + //Für den Fall, dass dieser Knoten Generische Variablen halten kann. if(that instanceof Generic && that.getOffset()>=0){ //Alle unresolvedTPHs ermitteln und GenericTypeVarInsertPoints bilden: Menge uTPHs = insertSet.getUnresolvedTPHs(); diff --git a/src/de/dhbwstuttgart/syntaxtree/misc/DeclId.java b/src/de/dhbwstuttgart/syntaxtree/misc/DeclId.java index 679125eda..e7c5ec0a1 100755 --- a/src/de/dhbwstuttgart/syntaxtree/misc/DeclId.java +++ b/src/de/dhbwstuttgart/syntaxtree/misc/DeclId.java @@ -7,17 +7,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; // ino.end - - - - - - -import de.dhbwstuttgart.bytecode.Attribute; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; -import de.dhbwstuttgart.bytecode.SignatureInfo; import de.dhbwstuttgart.core.MyCompiler; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Constant; @@ -54,7 +43,7 @@ public class DeclId // ino.attribute.m_LineNumber.23295.declaration private int m_LineNumber = MyCompiler.NO_LINENUMBER; // ino.end - private int m_Offset = -1; //hinzugef�gt hoth: 07.04.2006 + private int m_Offset = -1; //hinzugef�gt hoth: 07.04.2006 // ino.attribute.codegenlog.23298.decldescription type=line // Logger fuer Code-Gen // ino.end @@ -177,87 +166,7 @@ public class DeclId - // ino.method.codegen_InstVarDecl.23337.defdescription type=javadoc - /** - * Generieren einer Instanzvariable im Bytecode. - * Fuegt ggf. eine Signatur hinzu (Generics). - */ - // ino.end - // ino.method.codegen_InstVarDecl.23337.definition - public void codegen_InstVarDecl(ClassFile classfile, Type type, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen_InstVarDecl.23337.body - { - String codegen_type; - Attribute attr = null; - - // Spezialbehandlung fuer Konstanten .... - // Eine Unterscheidung im Parser wuerde Konflikte erzeugen - // da die Definition von Fields und Konstanten sehr aehnlich ist. - if (modifiers != null && modifiers.includesModifier(new Final())) { - Constant ct = new Constant(name, modifiers); - ct.setType(type); - if (!(wert instanceof Expr)) - throw new JVMCodeException("Das Generieren einer Konstante dieses Typs wird nicht unterstützt!"); - ct.setValue((Expr) wert); - - ct.codegen( classfile, paralist); - - return; - } - - - // Ueberpruefung auf Generics (Signaturen!) - if (SignatureInfo.needsSignature(type)) attr = new SignatureInfo(type, classfile); - - if (type instanceof RefType) - codegen_type = ((RefType)type).get_codegen_Type(null); - else - codegen_type = JVMCode.get_codegen_Type(type.getName().toString(), paralist); - - - // Instanzvariable genenerieren - classfile.add_field(name, codegen_type, get_access_flags(), attr); - - // Wertzuweisung ggf. hinzufuegen - if(wert != null) { - if(wert instanceof Expr) { - classfile.add_field_ref(name, null, codegen_type); - Assign assign = new Assign(getOffset(),name.length()); - assign.set_Expr(new InstVar(name, type.getName().toString(),getOffset()), (Expr)wert); - classfile.add_classblock_Element(assign); - } - else throw new JVMCodeException("Wertzuweisung der Instanzvariable kann nicht uebersetzt werden!"); - } - } - // ino.end - - - - // ino.method.codegen_LocalVarDecl.23340.definition - public void codegen_LocalVarDecl(ClassFile classfile, CodeAttribute code, Type type, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen_LocalVarDecl.23340.body - { - code.add_local(name, type); - if(wert != null) - { - if(wert instanceof Expr) - { - Assign assign = new Assign(getOffset(),name.length()); - assign.set_Expr(new LocalOrFieldVar(name,getOffset()), (Expr)wert); - assign.codegen(classfile, code, paralist); - } - else - { - throw new JVMCodeException("JVMCodeException: DeclId: void codegen(ClassFile classfile, Type type)"); - } - } - } - // ino.end - + // ino.method.getLineNumber.23343.definition public int getLineNumber() // ino.end @@ -277,7 +186,7 @@ public class DeclId // ino.end // ino.method.getOffset.23349.defdescription type=line - // hinzugef�gt hoth: 07.04.2006 + // hinzugef�gt hoth: 07.04.2006 // ino.end // ino.method.getOffset.23349.definition public int getOffset() @@ -289,7 +198,7 @@ public class DeclId // ino.end // ino.method.setOffset.23352.defdescription type=line - // hinzugef�gt hoth: 07.04.2006 + // hinzugef�gt hoth: 07.04.2006 // ino.end // ino.method.setOffset.23352.definition public void setOffset(int Offset) @@ -302,7 +211,7 @@ public class DeclId // ino.method.toString.23355.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/misc/UsedId.java b/src/de/dhbwstuttgart/syntaxtree/misc/UsedId.java index e02d0cb3c..6ee71dee4 100755 --- a/src/de/dhbwstuttgart/syntaxtree/misc/UsedId.java +++ b/src/de/dhbwstuttgart/syntaxtree/misc/UsedId.java @@ -5,7 +5,6 @@ package de.dhbwstuttgart.syntaxtree.misc; import java.util.Iterator; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.parser.JavaClassName; import de.dhbwstuttgart.syntaxtree.type.Type; @@ -31,7 +30,7 @@ public class UsedId implements IItemWithOffset // ino.attribute.vParaOrg.23672.declaration public Menge vParaOrg = null; // otth: originale Parameterliste // ino.end - private int m_Offset = -1; //hinzugef�gt hoth: 07.04.2006 + private int m_Offset = -1; //hinzugef�gt hoth: 07.04.2006 // ino.method.UsedId.23675.definition public UsedId(int offset) @@ -49,7 +48,7 @@ public class UsedId implements IItemWithOffset } // ino.method.getOffset.23678.defdescription type=line - // hinzugef�gt hoth: 07.04.2006 + // hinzugef�gt hoth: 07.04.2006 // ino.end // ino.method.getOffset.23678.definition public int getOffset() @@ -70,7 +69,7 @@ public class UsedId implements IItemWithOffset // ino.end // ino.method.setOffset.23684.defdescription type=line - // hinzugef�gt hoth: 07.04.2006 + // hinzugef�gt hoth: 07.04.2006 // ino.end // ino.method.setOffset.23684.definition public void setOffset(int Offset) @@ -178,34 +177,6 @@ public class UsedId implements IItemWithOffset } // ino.end - // ino.method.getSignatureUsedId.23717.definition - public String getSignatureUsedId() - // ino.end - // ino.method.getSignatureUsedId.23717.body - { - String basis = JVMCode.get_codegen_Type(getQualifiedName().toString(),null); - - if (paralist == null || paralist.size() ==0) - return basis; - - StringBuffer sb = new StringBuffer(); - - // Basistyp, ; entfernen - basis = basis.substring(0, basis.length() -1); - sb.append(basis); - - sb.append("<"); - - for(int i = 0; i< paralist.size(); i++) { - - sb.append(paralist.elementAt(i).get_codegen_Type(null)); - } - - sb.append(">;"); - - return sb.toString(); - } - // ino.end // ino.method.removeLast.23720.definition @@ -219,7 +190,7 @@ public class UsedId implements IItemWithOffset // ino.method.toString.23723.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end @@ -228,7 +199,7 @@ public class UsedId implements IItemWithOffset // ino.end // ino.method.toString.23723.body { - return this.get_Name_1Element();//name.toString(); //geändert von Andreas Stadelmeier + return this.get_Name_1Element();//name.toString(); //geändert von Andreas Stadelmeier /*String s = ""; for(int i = 0; i getOperatorTypes() { Hashtable types = new Hashtable(); diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/DivideOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/DivideOp.java index bd04f9502..4442e7a99 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/DivideOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/DivideOp.java @@ -4,9 +4,6 @@ package de.dhbwstuttgart.syntaxtree.operator; // ino.module.DivideOp.8596.import import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.statement.Binary; @@ -29,19 +26,6 @@ public class DivideOp extends MulOp } // ino.end - // ino.method.codegen.24115.definition - public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean neg, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.24115.body - { - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - expr1.codegen(classfile, code, paralist); - expr2.codegen(classfile, code, paralist); - code.add_code(JVMCode.ndiv(expr1.getTypeName())); - } - // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/EqualOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/EqualOp.java index 8dcd630fb..184a85012 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/EqualOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/EqualOp.java @@ -5,9 +5,6 @@ package de.dhbwstuttgart.syntaxtree.operator; import java.util.Iterator; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; @@ -34,50 +31,6 @@ public class EqualOp extends RelOp super(offset, variableLength); } // ino.end - - // ino.method.codegen.24125.definition - public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean not, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.24125.body - { - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - int type1 = JVMCode.get_nType(expr1.getTypeName()); - int type2 = JVMCode.get_nType(expr2.getTypeName()); - expr1.codegen(classfile, code, paralist); - expr2.codegen(classfile, code, paralist); - if((expr1 instanceof Null) || (expr2 instanceof Null)) - if(type1==4 || type2==4) - if(!not) code.add_code(JVMCode.ifnonnull); - else code.add_code(JVMCode.ifnull); - else throw new JVMCodeException("JVMCodeException: EqualOp: void codegen(ClassFile classfile, Code_attribute code, Expr expr, boolean not)"); - else if(!not) code.add_code(JVMCode.if_ncmpne(expr1.getTypeName())); - else code.add_code(JVMCode.if_ncmpeq(expr1.getTypeName())); - code.add_code_short((short)7); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.goto_); - code.add_code_short((short)4); - code.add_code(JVMCode.iconst_0); - } - // ino.end - - // ino.method.if_codegen.24128.definition - public void if_codegen(ClassFile classfile, CodeAttribute code, String type, boolean not) - throws JVMCodeException - // ino.end - // ino.method.if_codegen.24128.body - { - if(type.equals("null")) - if(!not) code.add_code(JVMCode.ifnonnull); - else code.add_code(JVMCode.ifnull); - else - if(!not) code.add_code(JVMCode.if_ncmpne(type)); - else code.add_code(JVMCode.if_ncmpeq(type)); - } - // ino.end - - } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/GreaterEquOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/GreaterEquOp.java index 7225deee4..a01e1285f 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/GreaterEquOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/GreaterEquOp.java @@ -4,9 +4,6 @@ package de.dhbwstuttgart.syntaxtree.operator; // ino.module.GreaterEquOp.8598.import import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.statement.Binary; @@ -28,38 +25,6 @@ public class GreaterEquOp extends RelOp super(offset,variableLength); } // ino.end - - // ino.method.codegen.24141.definition - public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean not, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.24141.body - { - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - expr1.codegen(classfile, code, paralist); - expr2.codegen(classfile, code, paralist); - if(!not) code.add_code(JVMCode.if_icmplt); - else code.add_code(JVMCode.if_icmpge); - code.add_code_short((short)7); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.goto_); - code.add_code_short((short)4); - code.add_code(JVMCode.iconst_0); - } - // ino.end - - // ino.method.if_codegen.24144.definition - public void if_codegen(ClassFile classfile, CodeAttribute code, String type, boolean not) - throws JVMCodeException - // ino.end - // ino.method.if_codegen.24144.body - { - if(!not) code.add_code(JVMCode.if_icmplt); - else code.add_code(JVMCode.if_icmpge); - } - // ino.end - } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/GreaterOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/GreaterOp.java index 332361e83..97a668249 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/GreaterOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/GreaterOp.java @@ -4,9 +4,6 @@ package de.dhbwstuttgart.syntaxtree.operator; // ino.module.GreaterOp.8599.import import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.statement.Binary; import de.dhbwstuttgart.syntaxtree.statement.Expr; @@ -28,36 +25,5 @@ public class GreaterOp extends RelOp } // ino.end -// ino.method.codegen.24154.definition -public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean not, Menge paralist) -throws JVMCodeException -// ino.end -// ino.method.codegen.24154.body -{ - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - expr1.codegen(classfile, code, paralist); - expr2.codegen(classfile, code, paralist); - if(!not) code.add_code(JVMCode.if_icmple); - else code.add_code(JVMCode.if_icmpgt); - code.add_code_short(7); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.goto_); - code.add_code_short(4); - code.add_code(JVMCode.iconst_0); - } -// ino.end - - // ino.method.if_codegen.24157.definition - public void if_codegen(ClassFile classfile, CodeAttribute code, String type, boolean not) - throws JVMCodeException - // ino.end - // ino.method.if_codegen.24157.body - { - if(!not) code.add_code(JVMCode.if_icmple); - else code.add_code(JVMCode.if_icmpgt); - } - // ino.end - } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/LessEquOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/LessEquOp.java index 2ed325ab9..cff4e5044 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/LessEquOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/LessEquOp.java @@ -4,9 +4,6 @@ package de.dhbwstuttgart.syntaxtree.operator; // ino.module.LessEquOp.8600.import import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.statement.Binary; import de.dhbwstuttgart.syntaxtree.statement.Expr; @@ -28,36 +25,5 @@ public class LessEquOp extends RelOp } // ino.end - // ino.method.codegen.24167.definition - public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean not, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.24167.body - { - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - expr1.codegen(classfile, code, paralist); - expr2.codegen(classfile, code , paralist); - if(!not) code.add_code(JVMCode.if_icmpgt); - else code.add_code(JVMCode.if_icmple); - code.add_code_short((short)7); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.goto_); - code.add_code_short((short)4); - code.add_code(JVMCode.iconst_0); - } - // ino.end - - // ino.method.if_codegen.24170.definition - public void if_codegen(ClassFile classfile, CodeAttribute code, String type, boolean not) - throws JVMCodeException - // ino.end - // ino.method.if_codegen.24170.body - { - if(!not) code.add_code(JVMCode.if_icmpgt); - else code.add_code(JVMCode.if_icmple); - } - // ino.end - } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/LessOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/LessOp.java index 56243808d..2fcc7f11a 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/LessOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/LessOp.java @@ -4,9 +4,6 @@ package de.dhbwstuttgart.syntaxtree.operator; // ino.module.LessOp.8601.import import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.statement.Binary; import de.dhbwstuttgart.syntaxtree.statement.Expr; @@ -28,36 +25,5 @@ public class LessOp extends RelOp } // ino.end - // ino.method.codegen.24180.definition - public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean not, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.24180.body - { - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - expr1.codegen(classfile, code, paralist); - expr2.codegen(classfile, code, paralist); - if(!not) code.add_code(JVMCode.if_icmpge); - else code.add_code(JVMCode.if_icmplt); - code.add_code_short((short)7); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.goto_); - code.add_code_short((short)4); - code.add_code(JVMCode.iconst_0); - } - // ino.end - - // ino.method.if_codegen.24183.definition - public void if_codegen(ClassFile classfile, CodeAttribute code, String type, boolean not) - throws JVMCodeException - // ino.end - // ino.method.if_codegen.24183.body - { - if(!not) code.add_code(JVMCode.if_icmpge); - else code.add_code(JVMCode.if_icmplt); - } - // ino.end - } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/LogOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/LogOp.java index 621b049ac..7f1c421f7 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/LogOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/LogOp.java @@ -7,9 +7,6 @@ import java.util.Hashtable; import java.util.Iterator; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.statement.Binary; @@ -46,179 +43,7 @@ public abstract class LogOp extends Operator } // ino.end - // ino.method.codegen.24193.definition - public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean not, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.24193.body - { - Menge indices = new Menge(); - Operator op = ((Binary)expr).get_Operator(); - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - boolean and; - - if(op instanceof OrOp) and = false; - else if(op instanceof AndOp) and = true; - else throw new JVMCodeException("JVMCodeException: LogOp: void codegen(ClassFile classfile, Code_attribute code, Expr expr, boolean not)"); - - build(classfile, code, expr1, indices, not, false, and, paralist); - build(classfile, code, expr2, indices, not, true, and, paralist); - - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.goto_); - code.add_code_short(4); - code.add_code(JVMCode.iconst_0); - int code_length = code.get_code_length(); - replace_index(code, indices, code_length - 1, code_length - 5); - } - // ino.end - - // ino.method.if_codegen.24196.definition - public void if_codegen(ClassFile classfile, CodeAttribute code, boolean not, Expr expr, Statement then_block, Statement else_block, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.if_codegen.24196.body - { - Menge indices = new Menge(); - Operator op = ((Binary)expr).get_Operator(); - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - boolean and; - - if(op instanceof OrOp) and = false; - else if(op instanceof AndOp) and = true; - else throw new JVMCodeException("JVMCodeException: LogOp: if_codegen(ClassFile classfile, Code_attribute code, boolean not, Expr expr, Statement then_block, Statement else_block)"); - - build(classfile, code, expr1, indices, not, false, and, paralist); - build(classfile, code, expr2, indices, not, true, and, paralist); - - int breakpoint1 = code.get_code_length(); - if(then_block != null) then_block.codegen(classfile, code, paralist); - - int breakpoint2 = code.get_code_length(); - if(else_block != null) { - code.add_code(JVMCode.goto_); - breakpoint2 = code.get_code_length(); - code.add_code_short(0); - else_block.codegen(classfile, code, paralist); - code.set_code_short(code.get_code_length() + 1 - breakpoint2, breakpoint2); - } - replace_index(code, indices, breakpoint2 + 2 , breakpoint1); - } - // ino.end - - // ino.method.loop_codegen.24199.definition - public void loop_codegen(ClassFile classfile, CodeAttribute code, Expr expr, int breakpoint, boolean not, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.loop_codegen.24199.body - { - Menge indices = new Menge(); - Operator op = ((Binary)expr).get_Operator(); - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - boolean and; - - if(op instanceof OrOp) and = false; - else if(op instanceof AndOp) and = true; - else throw new JVMCodeException("JVMCodeException: LogOp: void loop_codegen(ClassFile classfile, Code_attribute code, Expr expr, int breakpoint, boolean not)"); - - build(classfile, code, expr1, indices, not, false, and, paralist); - build(classfile, code, expr2, indices, not, true, and, paralist); - - replace_index(code, indices, breakpoint + 2, code.get_code_length()); - } - // ino.end - - // ino.method.build.24202.definition - public static void build(ClassFile classfile, CodeAttribute code, Expr expr, Menge indices, boolean not, boolean ex2, boolean and, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.build.24202.body - { - if(expr instanceof NotExpr) - build(classfile, code, ((NotExpr)expr).get_Expr(), indices, !not, ex2, and, paralist); - else if(expr instanceof Binary) { - Operator op = ((Binary)expr).get_Operator(); - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - - if(op instanceof LogOp) { - boolean and2; - if(op instanceof OrOp) and2 = false; - else if(op instanceof AndOp) and2 = true; - else throw new JVMCodeException("JVMCodeException: LogOp: void build(ClassFile classfile, Code_attribute code, Expr expr, Menge indices, boolean not, boolean ex2, boolean and)"); - - if((and != and2) && !ex2) { - Menge indices2 = new Menge(); - build(classfile, code, expr1, indices2, not, false, and2, paralist); - build(classfile, code, expr2, indices, not, ex2, and, paralist); - int breakpoint = code.get_code_length(); - replace_index(code, indices2, breakpoint, breakpoint); - } - else { - build(classfile, code, expr1, indices, not, false, and2, paralist); - build(classfile, code, expr2, indices, not, ex2, and, paralist); - } - } - else if(op instanceof RelOp) { - expr1.codegen(classfile, code, paralist); - expr2.codegen(classfile, code, paralist); - - if(expr1 instanceof Null || expr2 instanceof Null) ((RelOp)op).if_codegen(classfile, code, "null", not); - else ((RelOp)op).if_codegen(classfile, code, expr.getTypeName(), not); - - indices.addElement(new Integer(code.get_code_length())); - - if(and) { - if(not && !ex2) code.add_code_short(1); - else code.add_code_short(0); - } - else { - if(not || ex2) code.add_code_short(0); - else code.add_code_short(1); - } - } - else throw new JVMCodeException("JVMCodeException: LogOp: void build(ClassFile classfile, Code_attribute code, Expr expr, Menge indices, boolean not, boolean ex2, boolean and)"); - } - else { - expr.codegen(classfile, code, paralist); - indices.addElement(new Integer(code.get_code_length() + 1)); - if(and) { - if(not && ex2) code.add_code(JVMCode.ifne); - else code.add_code(JVMCode.ifeq); - if(not && !ex2) code.add_code_short(1); - else code.add_code_short(0); - } - else { - if(!not && ex2) code.add_code(JVMCode.ifeq); - else code.add_code(JVMCode.ifne); - if(not || ex2) code.add_code_short(0); - else code.add_code_short(1); - } - } - } - // ino.end - - // ino.method.replace_index.24205.definition - public static void replace_index(CodeAttribute code, Menge indices, int else_index, int then_index) - throws JVMCodeException - // ino.end - // ino.method.replace_index.24205.body - { - Menge b = code.get_code_Menge(); - for(int i = 0; i < indices.size(); i++) { - int y = indices.elementAt(i).intValue(); - int high = JVMCode.bytes_to_int((Byte)b.elementAt(y)); - int low = JVMCode.bytes_to_int((Byte)b.elementAt(y+1)); - int x = (high << 8) + low; - if(x == 0) code.set_code_short(else_index + 1 - y, y); - else if(x == 1) code.set_code_short(then_index + 1 - y, y); - else throw new JVMCodeException("JVMCodeException: LogOp: replace_index(Code_attribute code, Menge indices, int else_index, int then_index)"); - } - } - // ino.end + @Override protected Hashtable getOperatorTypes() { diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/MinusOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/MinusOp.java index a4e87cbd9..3cd233ad3 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/MinusOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/MinusOp.java @@ -4,9 +4,6 @@ package de.dhbwstuttgart.syntaxtree.operator; // ino.module.MinusOp.8603.import import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.statement.Binary; import de.dhbwstuttgart.syntaxtree.statement.Expr; @@ -28,19 +25,6 @@ public class MinusOp extends AddOp } // ino.end - // ino.method.codegen.24218.definition - public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean neg, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.24218.body - { - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - expr1.codegen(classfile, code, paralist); - expr2.codegen(classfile, code, paralist); - if(!neg) code.add_code(JVMCode.nsub(expr1.getTypeName())); - else code.add_code(JVMCode.nadd(expr1.getTypeName())); - } - // ino.end + } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/ModuloOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/ModuloOp.java index c4347325d..57465f011 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/ModuloOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/ModuloOp.java @@ -4,9 +4,6 @@ package de.dhbwstuttgart.syntaxtree.operator; // ino.module.ModuloOp.8604.import import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.statement.Binary; import de.dhbwstuttgart.syntaxtree.statement.Expr; @@ -28,18 +25,5 @@ public class ModuloOp extends MulOp } // ino.end - // ino.method.codegen.24228.definition - public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean neg, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.24228.body - { - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - expr1.codegen(classfile, code, paralist); - expr2.codegen(classfile, code, paralist); - code.add_code(JVMCode.nrem(expr1.getTypeName())); - } - // ino.end } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/NotEqualOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/NotEqualOp.java index 249a4ee3f..7cbe39364 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/NotEqualOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/NotEqualOp.java @@ -5,9 +5,6 @@ package de.dhbwstuttgart.syntaxtree.operator; import java.util.Iterator; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.statement.Binary; @@ -31,47 +28,5 @@ public class NotEqualOp extends RelOp } // ino.end - // ino.method.codegen.24248.definition - public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean not, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.24248.body - { - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - int type1 = JVMCode.get_nType(expr1.getTypeName()); - int type2 = JVMCode.get_nType(expr2.getTypeName()); - expr1.codegen(classfile, code, paralist); - expr2.codegen(classfile, code, paralist); - if((expr1 instanceof Null) || (expr2 instanceof Null)) - if(type1==4 || type2==4) - if(!not) code.add_code(JVMCode.ifnull); - else code.add_code(JVMCode.ifnonnull); - else throw new JVMCodeException("JVMCodeException: NotEqualOp: void codegen(ClassFile classfile, Code_attribute code, Expr expr, boolean not)"); - else if(!not) code.add_code(JVMCode.if_ncmpeq(expr1.getTypeName())); - else code.add_code(JVMCode.if_ncmpne(expr1.getTypeName())); - code.add_code_short((short)7); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.goto_); - code.add_code_short((short)4); - code.add_code(JVMCode.iconst_0); - } - // ino.end - - // ino.method.if_codegen.24251.definition - public void if_codegen(ClassFile classfile, CodeAttribute code, String type, boolean not) - throws JVMCodeException - // ino.end - // ino.method.if_codegen.24251.body - { - if(type.equals("null")) - if(!not) code.add_code(JVMCode.ifnull); - else code.add_code(JVMCode.ifnonnull); - else - if(!not) code.add_code(JVMCode.if_ncmpeq(type)); - else code.add_code(JVMCode.if_ncmpne(type)); - } - // ino.end - } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/Operator.java b/src/de/dhbwstuttgart/syntaxtree/operator/Operator.java index 953b11e02..dd1559ecc 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/Operator.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/Operator.java @@ -7,9 +7,6 @@ import java.util.Hashtable; import java.util.Iterator; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; @@ -72,11 +69,7 @@ public abstract class Operator extends SyntaxTreeNode } // ino.end - // ino.method.codegen.24276.declaration - public abstract void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean neg_not, Menge paralist) - throws JVMCodeException; - // ino.end - + /** * @author timo * This is cool: @@ -86,36 +79,6 @@ public abstract class Operator extends SyntaxTreeNode */ protected abstract Hashtable getOperatorTypes( ); - - // ino.method.makePrimitive.29391.defdescription type=line - // Unter der Annahme, dass sich ein Integer-Objekt auf dem Stack - // befindet, wird dieses in den primitiven Typ int umgewandelt. - // ino.end - // ino.method.makePrimitive.29391.definition - public void makePrimitive(ClassFile classfile, CodeAttribute code) - // ino.end - // ino.method.makePrimitive.29391.body - { - code.add_code(JVMCode.invokevirtual); - code.add_code_short(classfile.add_method_ref("java/lang/Integer", "intValue", "()I")); - } - // ino.end - - // ino.method.makeWrapper.29394.defdescription type=line - // Unter der Annahame, dass ein primitiver int-Typ auf dem Stack liegt, - // wird dieser in den Wrapper-Typ Integer umgewandelt. - // ino.end - - // ino.method.makeWrapper.29394.definition - public void makeWrapper(ClassFile classfile, CodeAttribute code) - // ino.end - // ino.method.makeWrapper.29394.body - { - code.add_code(JVMCode.invokestatic); - code.add_code_short(classfile.add_method_ref("java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;")); - } - // ino.end - /** * Liefert eine HashMap der Form: HashMap diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/PlusOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/PlusOp.java index d4b5b4022..e7d828231 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/PlusOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/PlusOp.java @@ -4,9 +4,6 @@ package de.dhbwstuttgart.syntaxtree.operator; // ino.module.PlusOp.8609.import import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.statement.Binary; import de.dhbwstuttgart.syntaxtree.statement.Expr; @@ -28,19 +25,5 @@ public class PlusOp extends AddOp } // ino.end - // ino.method.codegen.24296.definition - public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean neg, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.24296.body - { - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - expr1.codegen(classfile, code, paralist); - expr2.codegen(classfile, code, paralist); - if(!neg) code.add_code(JVMCode.nadd(expr1.getTypeName())); - else code.add_code(JVMCode.nsub(expr1.getTypeName())); - } - // ino.end } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/RelOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/RelOp.java index 952b53132..64a07c17e 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/RelOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/RelOp.java @@ -8,8 +8,6 @@ import java.util.Hashtable; import java.util.Iterator; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.statement.Binary; @@ -34,11 +32,6 @@ public abstract class RelOp extends Operator } // ino.end - // ino.method.if_codegen.24306.declaration - public abstract void if_codegen(ClassFile classfile, CodeAttribute code, String type, boolean not) - throws JVMCodeException; - // ino.end - protected Hashtable getOperatorTypes() { Hashtable types = new Hashtable(); diff --git a/src/de/dhbwstuttgart/syntaxtree/operator/TimesOp.java b/src/de/dhbwstuttgart/syntaxtree/operator/TimesOp.java index 3a66c28a9..6f47068d5 100755 --- a/src/de/dhbwstuttgart/syntaxtree/operator/TimesOp.java +++ b/src/de/dhbwstuttgart/syntaxtree/operator/TimesOp.java @@ -5,9 +5,6 @@ package de.dhbwstuttgart.syntaxtree.operator; // ino.module.TimesOp.8611.import import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.statement.Binary; import de.dhbwstuttgart.syntaxtree.statement.Expr; @@ -26,30 +23,5 @@ public class TimesOp extends MulOp } // ino.end - // ino.method.codegen.24319.definition - public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, - boolean neg, Menge paralist) - throws JVMCodeException - // ino.end -// ino.method.codegen.24319.body -{ - Expr expr1 = ((Binary) expr).get_Expr1(); - Expr expr2 = ((Binary) expr).get_Expr2(); - - expr1.codegen(classfile, code, paralist); - // unboxing - makePrimitive( classfile, code); - - expr2.codegen(classfile, code, paralist); - // unboxing - makePrimitive( classfile, code); - - // Die Multiplikation - code.add_code(JVMCode.imul); - - // Boxing des Typs - makeWrapper(classfile, code); - } -// ino.end } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java b/src/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java index 9757926fc..3644ec301 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java @@ -5,9 +5,6 @@ package de.dhbwstuttgart.syntaxtree.statement; import java.util.Iterator; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.FormalParameter; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; @@ -27,38 +24,6 @@ public class ArgumentList extends SyntaxTreeNode // ino.end - - // ino.method.codegen.24917.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.24917.body - { - for(int i = 0; i < expr.size(); i++) - { - expr.elementAt(i).codegen(classfile, code, paralist); - } - } - // ino.end - - - - // ino.method.get_codegen_ArgumentList.24920.definition - public String get_codegen_ArgumentList(Menge paralist) - // ino.end - // ino.method.get_codegen_ArgumentList.24920.body - { - String ret = "("; - for(int i = 0; i < expr.size(); i++) - { - ret += JVMCode.get_codegen_Type(expr.elementAt(i).getTypeName(), paralist); - } - return ret + ")"; - } - // ino.end - - - // ino.method.get_firstElement.24923.definition public Object get_firstElement() // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java b/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java index 329c6d88f..03551933c 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java @@ -9,9 +9,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -89,94 +86,6 @@ public class Assign extends Expr } // ino.end - - - // ino.method.codegen.24951.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.24951.body - { - // AutoBoxing-Feature: Literale koennen nur als Objekt zugewiesen werden - if (expr2 instanceof Literal) ((Literal)expr2).setPrimitiveFlag(false); - - - if(expr1 instanceof LocalOrFieldVar) - { - LocalOrFieldVar local = (LocalOrFieldVar)expr1; - Menge name_Menge = local.get_Name_Menge(); - Menge type_Menge = local.get_Type_Menge(); - String local_name = null; - String class_name = null; - String type = null; - for(int i=0; i < name_Menge.size()-1; i++) - { - local_name = (String)name_Menge.elementAt(i); - type = JVMCode.get_codegen_Type((String)type_Menge.elementAt(i), paralist); - int index = code.get_indexOf_Var(local_name); - if(index != -1) - { - // LocalVar - try - { - JavaClassName local_type = code.get_TypeOf_Var(local_name).getName(); - code.add_code(JVMCode.nload_n(local_type.toString(), index)); - } - catch(JVMCodeException e) - { - // out of nload_n - String local_type = code.get_TypeOf_Var(local_name).getName().toString(); - code.add_code(JVMCode.nload(local_type)); - code.add_code_byte((byte)index); - } - } - else - { - // FieldVar - code.add_code(JVMCode.aload_0); - code.add_code(JVMCode.getfield); - code.add_code_short(classfile.add_field_ref(local_name, class_name, type)); - } - class_name = (String)type_Menge.elementAt(i); - } - expr2.codegen(classfile, code, paralist); - local_name = (String)name_Menge.lastElement(); - int index = code.get_indexOf_Var(local_name); - if(index != -1) - { - // LocalVar - try - { - String local_type = code.get_TypeOf_Var(local_name).getName().toString(); - code.add_code(JVMCode.nstore_n(local_type, index)); - } - catch(JVMCodeException e) - { - // out of nstore_n - String local_type = code.get_TypeOf_Var(local_name).getName().toString(); - code.add_code(JVMCode.nstore(local_type)); - code.add_code_byte((byte)index); - } - } - else - { - // FieldVar - code.add_code(JVMCode.putfield); - code.add_code_short(classfile.add_field_ref(local_name, class_name, JVMCode.get_codegen_Type(expr2.getTypeName(), paralist))); - } - } - else if(expr1 instanceof InstVar) - { - InstVar instvar = (InstVar)expr1; - String instvar_name = instvar.get_codegen_UsedId(); - code.add_code(JVMCode.aload_0); - expr2.codegen(classfile, code, paralist); - code.add_code(JVMCode.putfield); - code.add_code_short(classfile.add_field_ref(instvar_name, null, null)); - } - else throw new JVMCodeException("JVMCodeException: Assign: void test codegen(ClassFile classfile, Code_attribute code)"); - } - // ino.end /** * @author AI10023 - Andreas Stadelmeier @@ -210,7 +119,7 @@ public class Assign extends Expr // ino.method.toString.24960.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Binary.java b/src/de/dhbwstuttgart/syntaxtree/statement/Binary.java index c86f7c517..2283b0da3 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Binary.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Binary.java @@ -9,9 +9,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -152,85 +149,7 @@ public class Binary extends BinaryExpr return expr2; } // ino.end - - - - // ino.method.codegen.25009.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25009.body - { - if(type_check(code)) - { - op.codegen(classfile, code, this, false, paralist); - } - else - { - throw new JVMCodeException("JVMCodeException: Binary: void codegen(ClassFile classfile, Code_attribute code)"); - } - } - // ino.end - - - - // ino.method.not_codegen.25012.definition - public void not_codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.not_codegen.25012.body - { - if(((op instanceof RelOp) || (op instanceof LogOp)) && type_check(code)) - { - op.codegen(classfile, code, this, true, paralist); - } - else - { - throw new JVMCodeException("JVMCodeException: Binary: void not_codegen(ClassFile classfile, Code_attribute code)"); - } - } - // ino.end - - - - // ino.method.neg_codegen.25015.definition - public void neg_codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.neg_codegen.25015.body - { - if(((op instanceof AddOp) || (op instanceof MulOp)) && type_check(code)) - { - op.codegen(classfile, code, this, true, paralist); - } - else - { - throw new JVMCodeException("JVMCodeException: Binary: void neg_codegen(ClassFile classfile, Code_attribute code)"); - } - } - // ino.end - - - - // ino.method.type_check.25018.definition - public boolean type_check(CodeAttribute code) - throws JVMCodeException - // ino.end - // ino.method.type_check.25018.body - { - int type1 = JVMCode.get_nType(expr1.getTypeName()); - int type2 = JVMCode.get_nType(expr2.getTypeName()); - if((type1 < type2) || ((type1==0 || type1==1) && (type2==2 || type2==3))) - { - return false; - } - if(type1 != type2) - { - code.add_code(JVMCode.n2n(expr2.getTypeName(), expr1.getTypeName())); - } - return true; - } - // ino.end + @@ -251,8 +170,8 @@ public class Binary extends BinaryExpr ret.add(this.expr1.TYPEExpr(assumptions)); ret.add(this.expr2.TYPEExpr(assumptions)); /** - * Berechnet die Constraints dieses Operators für die 2 gegebenen Parameter - * Die Operatoren sind meistens überladen. Es entstehen mehrere Oder-Verknüpfte Constraints. + * Berechnet die Constraints dieses Operators für die 2 gegebenen Parameter + * Die Operatoren sind meistens überladen. Es entstehen mehrere Oder-Verknüpfte Constraints. * @param expr1 * @param expr2 * @return diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Block.java b/src/de/dhbwstuttgart/syntaxtree/statement/Block.java index 18275a7e4..639a98c2c 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Block.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Block.java @@ -9,8 +9,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; import de.dhbwstuttgart.logger.Section; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -103,21 +101,6 @@ public class Block extends Statement } // ino.end - - - // ino.method.codegen.25074.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25074.body - { - for(int i = 0; i < statements.size(); i++) - { - statements.elementAt(i).codegen(classfile, code, paralist); - } - } - // ino.end - ///////////////////////////////////////////////////////////////////////// @@ -128,7 +111,7 @@ public class Block extends Statement // ino.method.toString.25083.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end @@ -174,7 +157,7 @@ public class Block extends Statement typinferenceLog.debug("Prozessing statement: "+stmt, Section.TYPEINFERENCE); ret.add(stmt.TYPEStmt(assumptions)); /* if((stmt instanceof Return)){ - ret.add(new Constraint(stmt.getTypeVariable(), this.getTypeVariable()));//TODO: Dies nochmal prüfen. + ret.add(new Constraint(stmt.getTypeVariable(), this.getTypeVariable()));//TODO: Dies nochmal prüfen. } */ } @@ -188,7 +171,7 @@ public class Block extends Statement if (!(stmt.getReturnType() instanceof Void)) if (this.getReturnType() instanceof Void) { //this.setTypeVariable(stmt.getTypeVariable()); - throw new TypeinferenceException("Block besitzt falschen Rückgabetyp (fehlendes return-stmt)", this); + throw new TypeinferenceException("Block besitzt falschen Rückgabetyp (fehlendes return-stmt)", this); } else { TypePlaceholder tph = TypePlaceholder.fresh(this); @@ -212,7 +195,7 @@ public class Block extends Statement typinferenceLog.debug("Prozessing statement: "+stmt); ret.add(stmt.TYPEStmt(assumptions)); if((stmt instanceof Return)){ - ret.add(new Constraint(stmt.getTypeVariable(), this.getTypeVariable()));//TODO: Dies nochmal prüfen. + ret.add(new Constraint(stmt.getTypeVariable(), this.getTypeVariable()));//TODO: Dies nochmal prüfen. } } return ret; diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/BoolLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/BoolLiteral.java index e5f3a45d8..c2a7eb925 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/BoolLiteral.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/BoolLiteral.java @@ -6,9 +6,6 @@ import java.util.Hashtable; import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Class; @@ -91,37 +88,6 @@ public class BoolLiteral extends Literal - // ino.method.codegen.25111.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25111.body - { - if(Bool) - code.add_code(JVMCode.iconst_1); - else - code.add_code(JVMCode.iconst_0); - - // Auto-Boxing des Typs in Boolean - code.add_code(JVMCode.invokestatic); - code.add_code_short(classfile.add_method_ref("java/lang/Boolean", "valueOf", "(Z)Ljava/lang/Boolean;")); - } - // ino.end - - // ino.method.ConstantCodegen.25114.definition - public short ConstantCodegen(ClassFile classfile) - throws JVMCodeException - // ino.end - // ino.method.ConstantCodegen.25114.body - { - if (Bool) - return (short) classfile.add_CONSTANT_Integer_info(1); - else - return (short) classfile.add_CONSTANT_Integer_info(0); - } - // ino.end - - @Override diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/CastExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/CastExpr.java index e2212b52d..d2b0fedd3 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/CastExpr.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/CastExpr.java @@ -7,9 +7,6 @@ import java.util.Iterator; import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -88,31 +85,6 @@ public class CastExpr extends UnaryExpr - // ino.method.codegen.25154.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25154.body - { - int itype = JVMCode.get_nType(type.getName().toString()); - int iexpr = JVMCode.get_nType(expr.getTypeName()); - if(itype != iexpr) - { - if((itype == 4) || (iexpr == 4)) - { - throw new JVMCodeException("JVMCodeException: CastExpr: void codegen(ClassFile classfile, Code_attribute code)"); - } - else - { - expr.set_Type(type); - code.add_code(JVMCode.n2n(expr.getTypeName(), type.getName().toString())); - } - } - else if(itype == 4) expr.set_Type(type); - } - // ino.end - - // ino.method.wandleRefTypeAttributes2GenericAttributes.25163.definition public void wandleRefTypeAttributes2GenericAttributes(Menge paralist, Menge genericMethodParameters) // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/CharLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/CharLiteral.java index 9d0e6f468..b0aa0568b 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/CharLiteral.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/CharLiteral.java @@ -5,9 +5,6 @@ package de.dhbwstuttgart.syntaxtree.statement; import java.util.Hashtable; import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Class; @@ -84,33 +81,6 @@ public class CharLiteral extends Literal } // ino.end - - - // ino.method.codegen.25188.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25188.body - { - // Wert des chars auf den Stack laden - code.add_code(JVMCode.bipush); - code.add_code_byte((byte)Char); - - // Auto-Boxing des Typs in Character - code.add_code(JVMCode.invokestatic); - code.add_code_short(classfile.add_method_ref("java/lang/Character", "valueOf", "(C)Ljava/lang/Character;")); - } - // ino.end - - // ino.method.ConstantCodegen.25191.definition - public short ConstantCodegen(ClassFile classfile) - throws JVMCodeException - // ino.end - // ino.method.ConstantCodegen.25191.body - { - return (short) classfile.add_CONSTANT_Integer_info(Char); - } - // ino.end @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/DoubleLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/DoubleLiteral.java index 8b5ce9014..ca888b976 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/DoubleLiteral.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/DoubleLiteral.java @@ -8,9 +8,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Class; @@ -79,7 +76,7 @@ public class DoubleLiteral extends Literal // ino.end // ino.method.sc_check.25466.body { - parserlog.debug("SC -> Semantik-Check f�r DoubleLiteral wurde aufgerufen --> nichts zu tun!"); + parserlog.debug("SC -> Semantik-Check f�r DoubleLiteral wurde aufgerufen --> nichts zu tun!"); } // ino.end */ @@ -93,56 +90,10 @@ public class DoubleLiteral extends Literal } // ino.end - // ino.method.codegen.25472.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end -// ino.method.codegen.25472.body -{ - /*if (Int >= 0 && Int <= 5) // Kleine Werte lassen sich direkt realisieren - code.add_code(JVMCode.nconst_n("int", Int)); - else if (Int >= -128 && Int <= 127) { // Aenderung des Codes fuer etwas groessere Werte - code.add_code(JVMCode.bipush); - code.add_code_byte((byte) Int); - } else if (Int >= -32768 && Int <= 32767) { // Aenderung des Codes fuer groessere Werte - code.add_code(JVMCode.sipush); - code.add_code_short((short) Int); - } else { // Ablage als Konstante - int index = classfile.add_CONSTANT_Integer_info(Int); - if (index < 256) { - code.add_code(JVMCode.ldc); - code.add_code_byte((byte) index); - } else { - code.add_code(JVMCode.ldc_w); - code.add_code_short((short) index); - } - } - - // Auto-Boxing: Da int nicht so nicht weiterverwendet werden kann, - // in Integer umwandeln. - if (!getPrimitiveFlag()) { - code.add_code(JVMCode.invokestatic); - code.add_code_short(classfile.add_method_ref("java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;")); - }*/ - throw new JVMCodeException("Bytecode nicht implementiert"); - } -// ino.end - - // ino.method.ConstantCodegen.25475.definition - public short ConstantCodegen(ClassFile classfile) - throws JVMCodeException - // ino.end - // ino.method.ConstantCodegen.25475.body - { - //return (short) classfile.add_CONSTANT_Integer_info(get_Int()); - throw new JVMCodeException("Bytecode nicht implementiert"); - } - // ino.end - // ino.method.toString.25484.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/EmptyStmt.java b/src/de/dhbwstuttgart/syntaxtree/statement/EmptyStmt.java index 7138eb277..67c80dc70 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/EmptyStmt.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/EmptyStmt.java @@ -7,8 +7,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Class; @@ -55,13 +53,6 @@ public class EmptyStmt extends Statement // ino.end */ - // ino.method.codegen.25216.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25216.body - { } - // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.25222.definition diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Expr.java b/src/de/dhbwstuttgart/syntaxtree/statement/Expr.java index 57bffa6db..e62b9c533 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Expr.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Expr.java @@ -95,15 +95,15 @@ public abstract class Expr extends ExprStmt /** * @author AI10023 - Andreas Stadelmeier - * Implementierung des Java 8 - Typinferenzalgorithmus von Martin Plümicke + * Implementierung des Java 8 - Typinferenzalgorithmus von Martin Plümicke * Jede Expression wird im Zuge des Algorithmus durch die TYPEExpr-Funktion angesprochen. */ public abstract ConstraintsSet TYPEExpr(TypeAssumptions assumptions); /** * @author AI10023 - Andreas Stadelmeier - * Die Funktion überschreiben, damit sie von Expressions nicht mehr spezifiziert werden muss. - * Denn Expressions müssen diese Funktion nicht implementieren. + * Die Funktion überschreiben, damit sie von Expressions nicht mehr spezifiziert werden muss. + * Denn Expressions müssen diese Funktion nicht implementieren. */ @Override public ConstraintsSet TYPEStmt(TypeAssumptions assumptions){ diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ExprStmt.java b/src/de/dhbwstuttgart/syntaxtree/statement/ExprStmt.java index abdda8266..ec7afd190 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/ExprStmt.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/ExprStmt.java @@ -52,7 +52,7 @@ public abstract class ExprStmt extends Statement // ino.method.getTypeLineNumber.25291.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/FloatLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/FloatLiteral.java index 68671710a..ed809fab5 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/FloatLiteral.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/FloatLiteral.java @@ -7,8 +7,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Class; @@ -74,7 +72,7 @@ public class FloatLiteral extends Literal // ino.end // ino.method.sc_check.25466.body { - parserlog.debug("SC -> Semantik-Check f�r FloatLiteral wurde aufgerufen --> nichts zu tun!"); + parserlog.debug("SC -> Semantik-Check f�r FloatLiteral wurde aufgerufen --> nichts zu tun!"); } // ino.end */ @@ -88,57 +86,11 @@ public class FloatLiteral extends Literal } // ino.end - // ino.method.codegen.25472.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end -// ino.method.codegen.25472.body -{ - /*if (Int >= 0 && Int <= 5) // Kleine Werte lassen sich direkt realisieren - code.add_code(JVMCode.nconst_n("int", Int)); - else if (Int >= -128 && Int <= 127) { // Aenderung des Codes fuer etwas groessere Werte - code.add_code(JVMCode.bipush); - code.add_code_byte((byte) Int); - } else if (Int >= -32768 && Int <= 32767) { // Aenderung des Codes fuer groessere Werte - code.add_code(JVMCode.sipush); - code.add_code_short((short) Int); - } else { // Ablage als Konstante - int index = classfile.add_CONSTANT_Integer_info(Int); - if (index < 256) { - code.add_code(JVMCode.ldc); - code.add_code_byte((byte) index); - } else { - code.add_code(JVMCode.ldc_w); - code.add_code_short((short) index); - } - } - - // Auto-Boxing: Da int nicht so nicht weiterverwendet werden kann, - // in Integer umwandeln. - if (!getPrimitiveFlag()) { - code.add_code(JVMCode.invokestatic); - code.add_code_short(classfile.add_method_ref("java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;")); - }*/ - throw new JVMCodeException("Bytecode nicht implementiert"); - } -// ino.end - - // ino.method.ConstantCodegen.25475.definition - public short ConstantCodegen(ClassFile classfile) - throws JVMCodeException - // ino.end - // ino.method.ConstantCodegen.25475.body - { - //return (short) classfile.add_CONSTANT_Integer_info(get_Int()); - throw new JVMCodeException("Bytecode nicht implementiert"); - } - // ino.end - // ino.method.toString.25484.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java b/src/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java index 9f16e8b59..cbbb7075f 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java @@ -7,9 +7,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -56,13 +53,6 @@ public class ForStmt extends Statement } - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - { - - } - - public String toString() { return "FOR "; diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java b/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java index b0e798f9b..5e23f141a 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java @@ -9,9 +9,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -103,134 +100,6 @@ public class IfStmt extends Statement } // ino.end - - - // ino.method.codegen.25334.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25334.body - { - if_codegen(classfile, code, false, paralist); - } - // ino.end - - - - // ino.method.if_codegen.25337.definition - public void if_codegen(ClassFile classfile, CodeAttribute code, boolean not, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.if_codegen.25337.body - { - if(expr instanceof NotExpr) - { - expr = ((NotExpr)expr).get_Expr(); - if_codegen(classfile, code, !not, paralist); - } - else - { - if(expr instanceof Binary) - { - Operator op = ((Binary)expr).get_Operator(); - if(op instanceof LogOp) - { - ((LogOp)op).if_codegen(classfile, code, not, expr, then_block, else_block, paralist); - } - else - { - if(op instanceof RelOp) - { - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - expr1.codegen(classfile, code, paralist); - expr2.codegen(classfile, code, paralist); - if(expr1 instanceof Null || expr2 instanceof Null) - { - ((RelOp)op).if_codegen(classfile, code, "null", not); - } - else - { - ((RelOp)op).if_codegen(classfile, code, expr1.getTypeName(), not); - } - int breakpoint1 = code.get_code_length(); - code.add_code_short(0); - if(then_block!=null) - { - then_block.codegen(classfile, code, paralist); - code.set_code_short(code.get_code_length() + 1 - breakpoint1, breakpoint1); - } - int breakpoint2 = code.get_code_length(); - if(else_block != null) - { - code.add_code(JVMCode.goto_); - code.add_code_short(0); // replaced later - else_block.codegen(classfile, code, paralist); - code.set_code_short(breakpoint2 + 4 - breakpoint1, breakpoint1); - code.set_code_short(code.get_code_length() - breakpoint2, breakpoint2 + 1); - } - } - else - { - throw new JVMCodeException("JVMCodeException: IfStmt: void if_codegen(ClassFile classfile, Code_attribute code, boolean not)"); - } - } - } - else - { - expr.codegen(classfile, code, paralist); - if(!not) - { - code.add_code(JVMCode.ifeq); - } - else - { - code.add_code(JVMCode.ifne); - } - int breakpoint1 = code.get_code_length(); - code.add_code_short(0); - if(then_block!=null) - { - then_block.codegen(classfile, code, paralist); - code.set_code_short(code.get_code_length() + 1 - breakpoint1, breakpoint1); - } - int breakpoint2 = code.get_code_length(); - if(!(else_block==null || else_block instanceof EmptyStmt)) - { - //hama: Die zwei folgenen if-Abfragen wurden eingef�gt und beheben den Bug, - //der zuerst im Use Case Toggle1 bemerkt wurde. Hier wird nun gepr�ft ob der - //letzte Befehl in einem if-Block ein return war. Trifft dieser Fall zu, - //so wird kein goto Befehl (f�r das �berspringen des else-Blocks eingef�gt) - //-> das verlangt die vm ->der code w�re nicht erreichbar. - //Allerdings k�nnte das return-Statement nat�rlich auch an einer anderen - //Stelle (nicht als letzter Befehl) stehen, f�r diesen Fall d�rfte die - //Codegenerierung noch nicht funktionieren. Hab versucht diesen Fall mit - //Toggle3 zu erzeugen - wird aber richtig generiert. - //letztes Statement im Menge in s schreiben - //Statement s = (Statement)(((Block)this.then_block).statements.lastElement()); - //Instanz von Return zum pr�fen anlegen - Return r = new Return(getOffset(),getVariableLength()); - - if( !(((Block)this.then_block).statements.lastElement()).getClass().equals(r.getClass()) ) - { - code.add_code(JVMCode.goto_); - code.add_code_short(0); - } - else_block.codegen(classfile, code, paralist); - if( !(((Block)this.then_block).statements.lastElement()).getClass().equals(r.getClass()) ) - { - code.set_code_short(breakpoint2 + 4 - breakpoint1, breakpoint1); - code.set_code_short(code.get_code_length()-breakpoint2, breakpoint2 + 1); - } - } - } - } - } - // ino.end - - - - // ino.method.wandleRefTypeAttributes2GenericAttributes.25349.definition public void wandleRefTypeAttributes2GenericAttributes(Menge paralist, Menge genericMethodParameters) // ino.end @@ -252,7 +121,7 @@ public class IfStmt extends Statement ConstraintsSet ret = new ConstraintsSet(); this.setType(TypePlaceholder.fresh(this)); - ret.add(expr.TYPEExpr(assumptions)); // die Constraints für (expressionDesIfStmt) + ret.add(expr.TYPEExpr(assumptions)); // die Constraints für (expressionDesIfStmt) ret.add(this.then_block.TYPEStmt(assumptions)); if(else_block!=null){ ret.add(this.else_block.TYPEStmt(assumptions)); diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/InstVar.java b/src/de/dhbwstuttgart/syntaxtree/statement/InstVar.java index c6a254c82..a223621db 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/InstVar.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/InstVar.java @@ -9,9 +9,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Class; @@ -80,7 +77,7 @@ public class InstVar extends Expr // ino.method.InstVar.25414.defdescription type=javadoc /** * macht aus einem UsedId mit einem Menge von Strings eine InstVar - *
Author: Martin Pl�micke PL 05-08-17 + *
Author: Martin Pl�micke PL 05-08-17 * @param ui * @return */ @@ -160,27 +157,9 @@ public class InstVar extends Expr { return usedid.get_codegen_UsedId(); } // ino.end - // ino.method.codegen.25426.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25426.body - { - String instvar_name = usedid.get_codegen_UsedId(); - - code.add_code(JVMCode.aload_0); - code.add_code(JVMCode.getfield); - code.add_code_short(classfile.add_field_ref(instvar_name, null, null)); - } - // ino.end - - - - - // ino.method.toString.25441.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/InstanceOf.java b/src/de/dhbwstuttgart/syntaxtree/statement/InstanceOf.java index b8764fc40..e000fe247 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/InstanceOf.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/InstanceOf.java @@ -8,10 +8,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; - -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCStatementException; @@ -89,18 +85,7 @@ public class InstanceOf extends BinaryExpr return null; } // ino.end - - // ino.method.codegen.25380.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25380.body - { - expr.codegen(classfile, code, paralist); - code.add_code(JVMCode.instanceof_); - code.add_code_short(classfile.add_CONSTANT_Class_info(reftype.getName().toString())); - } - // ino.end + // ino.method.wandleRefTypeAttributes2GenericAttributes.25389.definition public void wandleRefTypeAttributes2GenericAttributes(Menge paralist, Menge genericMethodParameters) diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/IntLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/IntLiteral.java index 7a4c15ad5..e9632e9bd 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/IntLiteral.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/IntLiteral.java @@ -6,9 +6,6 @@ import java.util.Hashtable; import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Class; @@ -77,7 +74,7 @@ public class IntLiteral extends Literal // ino.end // ino.method.sc_check.25466.body { - parserlog.debug("SC -> Semantik-Check f�r IntLiteral wurde aufgerufen --> nichts zu tun!"); + parserlog.debug("SC -> Semantik-Check f�r IntLiteral wurde aufgerufen --> nichts zu tun!"); } // ino.end */ @@ -91,54 +88,10 @@ public class IntLiteral extends Literal } // ino.end - // ino.method.codegen.25472.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end -// ino.method.codegen.25472.body -{ - if (Int >= 0 && Int <= 5) // Kleine Werte lassen sich direkt realisieren - code.add_code(JVMCode.nconst_n("int", Int)); - else if (Int >= -128 && Int <= 127) { // Aenderung des Codes fuer etwas groessere Werte - code.add_code(JVMCode.bipush); - code.add_code_byte((byte) Int); - } else if (Int >= -32768 && Int <= 32767) { // Aenderung des Codes fuer groessere Werte - code.add_code(JVMCode.sipush); - code.add_code_short((short) Int); - } else { // Ablage als Konstante - int index = classfile.add_CONSTANT_Integer_info(Int); - if (index < 256) { - code.add_code(JVMCode.ldc); - code.add_code_byte((byte) index); - } else { - code.add_code(JVMCode.ldc_w); - code.add_code_short((short) index); - } - } - - // Auto-Boxing: Da int nicht so nicht weiterverwendet werden kann, - // in Integer umwandeln. - if (!getPrimitiveFlag()) { - code.add_code(JVMCode.invokestatic); - code.add_code_short(classfile.add_method_ref("java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;")); - } - } -// ino.end - - // ino.method.ConstantCodegen.25475.definition - public short ConstantCodegen(ClassFile classfile) - throws JVMCodeException - // ino.end - // ino.method.ConstantCodegen.25475.body - { - return (short) classfile.add_CONSTANT_Integer_info(get_Int()); - } - // ino.end - // ino.method.toString.25484.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java b/src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java index fc66ae381..133fe6d0f 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java @@ -3,8 +3,6 @@ package de.dhbwstuttgart.syntaxtree.statement; import java.util.Hashtable; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCStatementException; @@ -72,15 +70,6 @@ public class LambdaExpression extends Expr{ this.params = lambdaParameter; } - - @Override - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException { - // TODO Auto-generated method stub - - } - - @Override public void wandleRefTypeAttributes2GenericAttributes( Menge paralist, @@ -129,32 +118,32 @@ public class LambdaExpression extends Expr{ * TYPEExpr( Ass, Lambda( (x1 , . . . , xN ), expr|stmt ) ) = * let * AssArgs = { xi : ai | ai fresh type variables } - * (exprt : rty, ConS) = TYPEExpr( Ass ∪ AssArgs, expr ) + * (exprt : rty, ConS) = TYPEExpr( Ass ∪ AssArgs, expr ) * | (stmtt : rty, ConS) = TYPEStmt( Ass u AssArgs, stmt ) * in * (Lambda( (x1 : a1 , . . . , xN : aN ), exprt : rty|stmtt : rty ) : a, - * ConS ∪ { (FunN a) }), + * ConS ∪ { (FunN a) }), * where a is a fresh type variable */ @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { ConstraintsSet ret = new ConstraintsSet(); - //Die Assumptions für die Parameter der LambdaExpression + //Die Assumptions für die Parameter der LambdaExpression TypeAssumptions ArgumentAssumptions = new TypeAssumptions(this.getParentClass().getName()); Menge paramTypes = new Menge(); for(FormalParameter param : params.formalparameter){ if(param.getType()==null)param.setType(TypePlaceholder.fresh(this)); int offset = 0; - //Jeder Parameter der LambdaExpression wird als CParaTypeAssumption der Assumption liste hinzugefügt: + //Jeder Parameter der LambdaExpression wird als CParaTypeAssumption der Assumption liste hinzugefügt: ArgumentAssumptions.addAssumption(new ParameterAssumption(param)); paramTypes.add(param.getType()); } this.setType(TypePlaceholder.fresh(this)); - //ArgumentAssumptions + assumptions ergeben die Assumptions für die Statements innerhalb des Lambda-Bodys: + //ArgumentAssumptions + assumptions ergeben die Assumptions für die Statements innerhalb des Lambda-Bodys: ret.add(method_body.TYPEStmt(ArgumentAssumptions.add(assumptions))); //Es gibt die LambdaExpression nur mit einem Block als Method Body, nicht mit einer einzelnen Expression - //Die Constraints für ParameterTypen und Ret Typ erstellen: + //Die Constraints für ParameterTypen und Ret Typ erstellen: Menge modifiedParamTypes = new Menge<>(); for(Type pT : paramTypes){ if(pT instanceof WildcardType){ @@ -175,7 +164,7 @@ public class LambdaExpression extends Expr{ if(retType instanceof SuperWildcardType){ throw new TypeinferenceException("Typfehler von Parametertyp "+retType,this); }else{ - //retType bleibt unverändert + //retType bleibt unverändert } }else{ retType = new ExtendsWildcardType((ObjectType) retType); diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Literal.java b/src/de/dhbwstuttgart/syntaxtree/statement/Literal.java index f83c1c369..bee299fe9 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Literal.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Literal.java @@ -2,8 +2,6 @@ package de.dhbwstuttgart.syntaxtree.statement; // ino.end -// ino.module.Literal.8636.import -import de.dhbwstuttgart.bytecode.ClassFile; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet; @@ -49,23 +47,5 @@ public abstract class Literal extends Expr } // ino.end - - // ino.method.ConstantCodegen.25500.defdescription type=javadoc - /** - * Erzeugt die benoetigten Konstanteneintraege, die den Wert - * des Literals darstellen. - */ - // ino.end - // ino.method.ConstantCodegen.25500.definition - public short ConstantCodegen(ClassFile cf) - throws JVMCodeException - // ino.end - // ino.method.ConstantCodegen.25500.body - { - throw new JVMCodeException("Bytecodegenerierung fuer das Literal " + this.getClass().toString() - + " wurde nicht implementiert!"); - } - // ino.end - } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/LocalOrFieldVar.java b/src/de/dhbwstuttgart/syntaxtree/statement/LocalOrFieldVar.java index 2a3f38b66..23ada8aac 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/LocalOrFieldVar.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/LocalOrFieldVar.java @@ -7,9 +7,6 @@ import java.util.Hashtable; import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -82,73 +79,11 @@ public class LocalOrFieldVar extends Expr } // ino.end - - - // ino.method.codegen.25525.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25525.body - { - Menge name_Menge = get_Name_Menge(); - Menge type_Menge = get_Type_Menge(); - String local_name = null; - String class_name = null; - String type = null; - - for(int i=0; i < name_Menge.size(); i++) - { - local_name = (String)name_Menge.elementAt(i); - try {// TEST SCJU. ArrayIndexoutofBounds umgehen! - type = JVMCode.get_codegen_Type((String)type_Menge.elementAt(i), paralist); - } catch (Throwable e) {type = null; } - - int index = code.get_indexOf_Var(local_name); - if(index != -1) - { - // LocalVar - try - { - String local_type = code.get_TypeOf_Var(local_name).getName().toString(); - code.add_code(JVMCode.nload_n(local_type, index)); - } - catch(JVMCodeException e) - { - // out of nstore_n - String local_type = code.get_TypeOf_Var(local_name).getName().toString(); - code.add_code(JVMCode.nload(local_type)); - code.add_code_byte((byte)index); - } - } - else - { - // FieldVar - code.add_code(JVMCode.aload_0); - code.add_code(JVMCode.getfield); - code.add_code_short(classfile.add_field_ref(local_name, class_name, type)); - } - try { - // TEST SCJU. ArrayIndexoutofBounds umgehen! - class_name = (String)type_Menge.elementAt(i); - } catch (Throwable e) { } - } - - // Falls noetig, Unboxing auf primitiven Typ! - if (this.getType() instanceof RefType) { - RefType rt = (RefType) this.getType(); - if (! rt.getPrimitiveFlag()) return; - - if (rt.getName().toString().equalsIgnoreCase("java.lang.Integer")) { // Int Unboxen - code.add_code(JVMCode.invokevirtual); - code.add_code_short(classfile.add_method_ref("java/lang/Integer", "intValue", "()I")); - } - } - } - // ino.end + // ino.method.toString.25534.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end @@ -174,7 +109,7 @@ public class LocalOrFieldVar extends Expr @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { ConstraintsSet ret = new ConstraintsSet(); - //gibt es eine Assumption für den die LocalOrFieldVar-Variablen, dann folgendes ausführen: + //gibt es eine Assumption für den die LocalOrFieldVar-Variablen, dann folgendes ausführen: Type thisTypeAssumption = assumptions.getVarType(this.get_Name(), this.getParentClass()); if(thisTypeAssumption == null)throw new TypeinferenceException("Eine Variable "+this.get_Name()+" ist in den Assumptions nicht vorhanden",this); Type thisType = thisTypeAssumption.checkTYPE(assumptions, this); diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java b/src/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java index 0b7a283d0..14b7e3fe2 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java @@ -8,8 +8,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.core.MyCompiler; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -214,7 +212,7 @@ public class LocalVarDecl extends Statement implements TypeInsertable parserlog.debug(c.getName()+" "+c.get_ParaList().size()); SCStatementException ex = new SCStatementException(); SCExcept e = new SCExcept(); - e.set_error("Klasse "+c.getName()+" �berhaupt garnicht parametrisiert!"); + e.set_error("Klasse "+c.getName()+" �berhaupt garnicht parametrisiert!"); e.set_function("complete_parahashtable() --> check_anz()"); e.set_statement(type.getName().toString()); ex.addException(e); @@ -245,22 +243,7 @@ public class LocalVarDecl extends Statement implements TypeInsertable } // ino.end */ - - - - // ino.method.codegen.25593.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25593.body - { - if(declid != null) - for(int i = 0; i < declid.size(); i++) - declid.elementAt(i).codegen_LocalVarDecl(classfile, code, this.getType(), paralist); - } - // ino.end - // ino.method.getDeclidMenge.25596.definition public Menge getDeclidMenge() // ino.end // ino.method.getDeclidMenge.25596.body @@ -279,7 +262,7 @@ public class LocalVarDecl extends Statement implements TypeInsertable // ino.method.getLineNumber.25602.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end @@ -319,7 +302,7 @@ public class LocalVarDecl extends Statement implements TypeInsertable // ino.method.getTypeLineNumber.25611.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end @@ -335,7 +318,7 @@ public class LocalVarDecl extends Statement implements TypeInsertable // ino.method.toString.25617.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end @@ -371,8 +354,8 @@ public class LocalVarDecl extends Statement implements TypeInsertable /** * @author Andreas Stadelmeier, a10023 - * Der Typ der Variablendeklaration wird den Assumptions angefügt. - * Bei einer Deklaration ohne Typangabe wird ein TypePlaceholder den Assumptions hinzugefügt. + * Der Typ der Variablendeklaration wird den Assumptions angefügt. + * Bei einer Deklaration ohne Typangabe wird ein TypePlaceholder den Assumptions hinzugefügt. */ @Override public ConstraintsSet TYPEStmt(TypeAssumptions assumptions) { diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/LongLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/LongLiteral.java index 157234a3a..cb9f4272e 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/LongLiteral.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/LongLiteral.java @@ -8,9 +8,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Class; @@ -78,7 +75,7 @@ public class LongLiteral extends Literal // ino.end // ino.method.sc_check.25466.body { - parserlog.debug("SC -> Semantik-Check f�r LongLiteral wurde aufgerufen --> nichts zu tun!"); + parserlog.debug("SC -> Semantik-Check f�r LongLiteral wurde aufgerufen --> nichts zu tun!"); } // ino.end */ @@ -90,57 +87,9 @@ public class LongLiteral extends Literal { return null; } - // ino.end - - // ino.method.codegen.25472.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end -// ino.method.codegen.25472.body -{ - /*if (Int >= 0 && Int <= 5) // Kleine Werte lassen sich direkt realisieren - code.add_code(JVMCode.nconst_n("int", Int)); - else if (Int >= -128 && Int <= 127) { // Aenderung des Codes fuer etwas groessere Werte - code.add_code(JVMCode.bipush); - code.add_code_byte((byte) Int); - } else if (Int >= -32768 && Int <= 32767) { // Aenderung des Codes fuer groessere Werte - code.add_code(JVMCode.sipush); - code.add_code_short((short) Int); - } else { // Ablage als Konstante - int index = classfile.add_CONSTANT_Integer_info(Int); - if (index < 256) { - code.add_code(JVMCode.ldc); - code.add_code_byte((byte) index); - } else { - code.add_code(JVMCode.ldc_w); - code.add_code_short((short) index); - } - } - - // Auto-Boxing: Da int nicht so nicht weiterverwendet werden kann, - // in Integer umwandeln. - if (!getPrimitiveFlag()) { - code.add_code(JVMCode.invokestatic); - code.add_code_short(classfile.add_method_ref("java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;")); - }*/ - throw new JVMCodeException("Bytecode nicht implementiert"); - } -// ino.end - - // ino.method.ConstantCodegen.25475.definition - public short ConstantCodegen(ClassFile classfile) - throws JVMCodeException - // ino.end - // ino.method.ConstantCodegen.25475.body - { - //return (short) classfile.add_CONSTANT_Integer_info(get_Int()); - throw new JVMCodeException("Bytecode nicht implementiert"); - } - // ino.end - - // ino.method.toString.25484.defdescription type=javadoc + /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java b/src/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java index 398ab68bd..764618598 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java @@ -6,8 +6,6 @@ import java.util.Hashtable; import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Method; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; @@ -149,7 +147,7 @@ public class MethodCall extends Expr // ino.method.toString.25738.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end @@ -182,16 +180,16 @@ public class MethodCall extends Expr /** * @author AI10023 - Andreas Stadelmeier * - * Mögliche Probleme: + * Mögliche Probleme: * Wenn die Methode ohne Angabe eines Receivers im Quelltext steht: * methodCall(param); -> (bedeutet:) this.methodCall(param); - * Parser möglicherweise anpassen (siehe JavaParser.jay Zeile 1858 ff) + * Parser möglicherweise anpassen (siehe JavaParser.jay Zeile 1858 ff) */ @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { - //Hier der Ablauf für einen Methodenaufruf: + //Hier der Ablauf für einen Methodenaufruf: ConstraintsSet ret = new ConstraintsSet(); - //Der Return-Type des MEthodenaufrufs ist zunächst unbekannt: + //Der Return-Type des MEthodenaufrufs ist zunächst unbekannt: this.setType(TypePlaceholder.fresh(this)); //Berechne die Constraints des Receivers if(receiver == null){ @@ -199,19 +197,19 @@ public class MethodCall extends Expr } ret.add(receiver.get_Expr().TYPEExpr(assumptions)); - //Berechne die Constraints der Argumente aus der Argumentlist (also der Parameter, welche der Funktion übergeben wurden) + //Berechne die Constraints der Argumente aus der Argumentlist (also der Parameter, welche der Funktion übergeben wurden) if(this.arglist != null)for(Expr arg : this.arglist.expr){ ret.add(arg.TYPEExpr(assumptions)); } - //Noch das Overloading-Constraint anhängen: + //Noch das Overloading-Constraint anhängen: ret.add(overloading(assumptions)); return ret; } /** - * Erstellt die Constraints für den eigentlichen Methodenaufruf. + * Erstellt die Constraints für den eigentlichen Methodenaufruf. * Sucht in den Assumptions nach passenden Methoden und erstellt ein OderConstraintSet. * @param assumptions * @return @@ -222,9 +220,9 @@ public class MethodCall extends Expr OderConstraint oCons = new OderConstraint(); Menge methodAssumptions = assumptions.getMethodAssumptions(this.getName(), this.getArgumentList().size()); if(methodAssumptions.size()==0)throw new TypeinferenceException("Eine Methode "+this.get_Name()+" ist in den Assumptions nicht vorhanden", this); - //Alle möglichen Methoden durchgehen: + //Alle möglichen Methoden durchgehen: for(MethodAssumption methodAssumption : methodAssumptions){ - //Constraint nicht erstellen, falls Rückgabetyp von vorne herein nicht übereinstimmt: + //Constraint nicht erstellen, falls Rückgabetyp von vorne herein nicht übereinstimmt: if(!(this.type instanceof TypePlaceholder) && !this.type.equals(methodAssumption.getAssumedType()))break; oCons.addConstraint(constraintsFromMethodAssumption(methodAssumption, assumptions)); } @@ -244,22 +242,22 @@ public class MethodCall extends Expr * method, where the argument types are supertypes of a minimal type * assumption. * - * @TODO: wenn es sich um eine Methode einer anderen Klasse handelt, müssen neue TPH vergeben werden und nicht die der Assumption verwendet werden. + * @TODO: wenn es sich um eine Methode einer anderen Klasse handelt, müssen neue TPH vergeben werden und nicht die der Assumption verwendet werden. * * @return */ public UndConstraint constraintsFromMethodAssumption(MethodAssumption methodAssumption, TypeAssumptions assumptions){ UndConstraint methodConstraint = new UndConstraint(); - //Ein Constraint für den ReturnType der Methode... + //Ein Constraint für den ReturnType der Methode... methodConstraint.addConstraint(methodAssumption.getAssumedType().TYPE(assumptions, this), this.getType().TYPE(assumptions, this)); - //Ein Constraint für die Parameter der Methode... + //Ein Constraint für die Parameter der Methode... for(int i=0; i paralist, Menge genericMethodParameters) diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/NewArray.java b/src/de/dhbwstuttgart/syntaxtree/statement/NewArray.java index 7404db8be..3349dd04d 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/NewArray.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/NewArray.java @@ -7,9 +7,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Class; @@ -51,7 +48,7 @@ public class NewArray extends Expr // ino.method.getType.25803.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @return Returns the type. */ // ino.end @@ -66,7 +63,7 @@ public class NewArray extends Expr // ino.method.setType.25806.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param type The type to set. */ // ino.end @@ -118,26 +115,6 @@ public class NewArray extends Expr } // ino.end - // ino.method.codegen.25818.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25818.body - { - if(JVMCode.get_nType(this.getType().getName().toString()) == 4) { - for(int i = 0; i < expr.size(); i++) ((Expr)expr.elementAt(i)).codegen(classfile, code, paralist); - code.add_code(JVMCode.anewarray); - code.add_code_short(classfile.add_CONSTANT_Class_info(this.getType().getName().toString())); - } - else { - for(int i = 0; i < expr.size(); i++) ((Expr)expr.elementAt(i)).codegen(classfile, code, paralist); - code.add_code(JVMCode.newarray); - code.add_code_byte(this.get_codegen_Array_Type()); - } - } - // ino.end - - // ino.method.wandleRefTypeAttributes2GenericAttributes.25827.definition public void wandleRefTypeAttributes2GenericAttributes(Menge paralist, Menge genericMethodParameters) // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/NewClass.java b/src/de/dhbwstuttgart/syntaxtree/statement/NewClass.java index 12cf84226..91c7d912b 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/NewClass.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/NewClass.java @@ -9,9 +9,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -96,42 +93,9 @@ public class NewClass extends Expr } // ino.end - // ino.method.codegen.25858.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end -// ino.method.codegen.25858.body -{ - String class_name = this.get_UsedId().get_codegen_UsedId(); - String arg; - - // Argumentliste verarbeiten - if (arglist != null) { - arg = arglist.get_codegen_ArgumentList(paralist); - } else { - arg = "()"; - } - code.add_code(JVMCode.new_); - code.add_code_short(classfile.add_CONSTANT_Class_info(class_name)); - code.add_code(JVMCode.dup); - - // Vor invokespecial die Parameter auf den Stack legen - if (arglist != null) { - // Die einzelnen Argumente generieren - for (int i=0; i< arglist.expr.size(); i++) { - arglist.expr.elementAt(i).codegen(classfile, code, paralist); - } - } - - code.add_code(JVMCode.invokespecial); - code.add_code_short(classfile.add_method_ref(class_name, "", arg - + "V")); - } -// ino.end - // ino.method.toString.25867.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end @@ -158,10 +122,10 @@ public class NewClass extends Expr @Override public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { - //TODO: Das hier noch vervollständigen + //TODO: Das hier noch vervollständigen ConstraintsSet ret = new ConstraintsSet(); UndConstraint callConstraints = new UndConstraint(); - //Die Auskommentierten Zeilen gehören zu MethodRefNew + //Die Auskommentierten Zeilen gehören zu MethodRefNew //Menge argumentTypeList = new Menge(); //for(Expr expr : this.arglist.expr){ // argumentTypeList.add(expr.getTypeVariable()); diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/NotExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/NotExpr.java index 63c3578e3..a3cfbb679 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/NotExpr.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/NotExpr.java @@ -8,8 +8,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCStatementException; @@ -93,35 +91,6 @@ public class NotExpr extends UnaryExpr } // ino.end - // ino.method.codegen.25904.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25904.body - { - if(expr instanceof Binary) ((Binary)expr).not_codegen(classfile, code, paralist); - else if(expr instanceof NotExpr) ((NotExpr)expr).not_codegen(classfile, code, paralist); - else { - expr.codegen(classfile, code, paralist); - not.codegen(classfile, code, true); - } - } - // ino.end - - // ino.method.not_codegen.25907.definition - public void not_codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.not_codegen.25907.body - { - if(expr instanceof Binary) ((Binary)expr).codegen(classfile, code, paralist); - else if(expr instanceof NotExpr) ((NotExpr)expr).codegen(classfile, code, paralist); - else { - expr.codegen(classfile, code, paralist); - not.codegen(classfile, code, false); - } - } - // ino.end /* public void if_codegen(ClassFile classfile, Code_attribute code, boolean sw) throws JVMCodeException { if(expr instanceof NotExpr) if_codegen(classfile, code, !sw); diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Null.java b/src/de/dhbwstuttgart/syntaxtree/statement/Null.java index 58924e57f..325e67277 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Null.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Null.java @@ -7,9 +7,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Class; @@ -67,16 +64,6 @@ public class Null extends Literal // ino.end */ - // ino.method.codegen.25935.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25935.body - { - code.add_code(JVMCode.aconst_null); - } - // ino.end - // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.25944.definition public void wandleRefTypeAttributes2GenericAttributes(Menge paralist, Menge genericMethodParameters) diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/PositivExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/PositivExpr.java index d2730c2ae..ab5b1712d 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/PositivExpr.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/PositivExpr.java @@ -7,8 +7,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Class; @@ -89,14 +87,6 @@ public class PositivExpr extends UnaryExpr // ino.end */ - // ino.method.codegen.25975.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.25975.body - {} - // ino.end - // ino.method.wandleRefTypeAttributes2GenericAttributes.25984.definition public void wandleRefTypeAttributes2GenericAttributes(Menge paralist, Menge genericMethodParameters) // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/PostDecExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/PostDecExpr.java index e2ab3b534..3a006cd07 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/PostDecExpr.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/PostDecExpr.java @@ -8,9 +8,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -69,83 +66,6 @@ public class PostDecExpr extends UnaryExpr } // ino.end -// ino.method.codegen.26009.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.26009.body - { - if(expr instanceof LocalOrFieldVar) { - String local_name = (String)((LocalOrFieldVar)expr).get_Name_Menge().lastElement(); - - int index = code.get_indexOf_Var(local_name); - if(index != -1) { - code.add_code(JVMCode.iinc); - code.add_code_byte(index); - code.add_code_byte(-1); - } - else { - if(expr instanceof LocalOrFieldVar) { - LocalOrFieldVar local = (LocalOrFieldVar)expr; - Menge name_Menge = local.get_Name_Menge(); - Menge type_Menge = local.get_Type_Menge(); - String class_name = null; - String type = null; - for(int i=0; i < name_Menge.size()-1; i++) { - local_name = (String)name_Menge.elementAt(i); - type = JVMCode.get_codegen_Type((String)type_Menge.elementAt(i), paralist); - - index = code.get_indexOf_Var(local_name); - if(index != -1) { // LocalVar - try{ - String local_type = code.get_TypeOf_Var(local_name).getName().toString(); - code.add_code(JVMCode.nload_n(local_type, index)); - } - catch(JVMCodeException e) { // out of nload_n - String local_type = code.get_TypeOf_Var(local_name).getName().toString(); - code.add_code(JVMCode.nload(local_type)); - code.add_code_byte((byte)index); - } - } - else { // FieldVar - code.add_code(JVMCode.aload_0); - code.add_code(JVMCode.getfield); - code.add_code_short(classfile.add_field_ref(local_name, class_name, type)); - } - class_name = (String)type_Menge.elementAt(i); - } - - local_name = (String)name_Menge.lastElement(); - index = classfile.add_field_ref(local_name, class_name, JVMCode.get_codegen_Type("int", paralist)); - - code.add_code(JVMCode.dup); - code.add_code(JVMCode.getfield); - code.add_code_short(index); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.isub); - code.add_code(JVMCode.putfield); - code.add_code_short(index); - - } - } - } - else if(expr instanceof InstVar) { - InstVar instvar = (InstVar)expr; - String instvar_name = instvar.get_codegen_UsedId(); - int index = classfile.add_field_ref(instvar_name, null, null); - code.add_code(JVMCode.aload_0); - code.add_code(JVMCode.dup); - code.add_code(JVMCode.getfield); - code.add_code_short(index); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.isub); - code.add_code(JVMCode.putfield); - code.add_code_short(index); - } - else throw new JVMCodeException("JVMCodeException: PostDecExpr: void codegen(ClassFile classfile, Code_attribute code)"); - } - // ino.end - // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.26018.definition public void wandleRefTypeAttributes2GenericAttributes(Menge paralist, Menge genericMethodParameters) diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/PostIncExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/PostIncExpr.java index e44c1e5ca..1899fe918 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/PostIncExpr.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/PostIncExpr.java @@ -8,9 +8,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -73,83 +70,6 @@ public class PostIncExpr extends UnaryExpr } // ino.end - // ino.method.codegen.26043.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.26043.body - { - if(expr instanceof LocalOrFieldVar) { - String local_name = (String)((LocalOrFieldVar)expr).get_Name_Menge().lastElement(); - - int index = code.get_indexOf_Var(local_name); - if(index != -1) { - code.add_code(JVMCode.iinc); - code.add_code_byte(index); - code.add_code_byte(1); - } - else { - if(expr instanceof LocalOrFieldVar) { - LocalOrFieldVar local = (LocalOrFieldVar)expr; - Menge name_Menge = local.get_Name_Menge(); - Menge type_Menge = local.get_Type_Menge(); - String class_name = null; - String type = null; - for(int i=0; i < name_Menge.size()-1; i++) { - local_name = (String)name_Menge.elementAt(i); - type = JVMCode.get_codegen_Type((String)type_Menge.elementAt(i), paralist); - - index = code.get_indexOf_Var(local_name); - if(index != -1) { // LocalVar - try{ - String local_type = code.get_TypeOf_Var(local_name).getName().toString(); - code.add_code(JVMCode.nload_n(local_type, index)); - } - catch(JVMCodeException e) { // out of nload_n - String local_type = code.get_TypeOf_Var(local_name).getName().toString(); - code.add_code(JVMCode.nload(local_type)); - code.add_code_byte((byte)index); - } - } - else { // FieldVar - code.add_code(JVMCode.aload_0); - code.add_code(JVMCode.getfield); - code.add_code_short(classfile.add_field_ref(local_name, class_name, type)); - } - class_name = (String)type_Menge.elementAt(i); - } - - local_name = (String)name_Menge.lastElement(); - index = classfile.add_field_ref(local_name, class_name, JVMCode.get_codegen_Type("int", paralist)); - - code.add_code(JVMCode.dup); - code.add_code(JVMCode.getfield); - code.add_code_short(index); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.iadd); - code.add_code(JVMCode.putfield); - code.add_code_short(index); - - } - } - } - else if(expr instanceof InstVar) { - InstVar instvar = (InstVar)expr; - String instvar_name = instvar.get_codegen_UsedId(); - int index = classfile.add_field_ref(instvar_name, null, null); - code.add_code(JVMCode.aload_0); - code.add_code(JVMCode.dup); - code.add_code(JVMCode.getfield); - code.add_code_short(index); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.iadd); - code.add_code(JVMCode.putfield); - code.add_code_short(index); - } - else throw new JVMCodeException("JVMCodeException: PostIncExpr: void codegen(ClassFile classfile, Code_attribute code)"); - } - // ino.end - // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.26052.definition public void wandleRefTypeAttributes2GenericAttributes(Menge paralist, Menge genericMethodParameters) diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/PreDecExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/PreDecExpr.java index 02eee809d..1f7fd4150 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/PreDecExpr.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/PreDecExpr.java @@ -8,9 +8,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -68,83 +65,6 @@ public class PreDecExpr extends UnaryExpr return null; } // ino.end - - // ino.method.codegen.26077.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.26077.body - { - if(expr instanceof LocalOrFieldVar) { - String local_name = (String)((LocalOrFieldVar)expr).get_Name_Menge().lastElement(); - - int index = code.get_indexOf_Var(local_name); - if(index != -1) { - code.add_code(JVMCode.iinc); - code.add_code_byte(index); - code.add_code_byte(-1); - } - else { - if(expr instanceof LocalOrFieldVar) { - LocalOrFieldVar local = (LocalOrFieldVar)expr; - Menge name_Menge = local.get_Name_Menge(); - Menge type_Menge = local.get_Type_Menge(); - String class_name = null; - String type = null; - for(int i=0; i < name_Menge.size()-1; i++) { - local_name = (String)name_Menge.elementAt(i); - type = JVMCode.get_codegen_Type((String)type_Menge.elementAt(i), paralist); - - index = code.get_indexOf_Var(local_name); - if(index != -1) { // LocalVar - try{ - String local_type = code.get_TypeOf_Var(local_name).getName().toString(); - code.add_code(JVMCode.nload_n(local_type, index)); - } - catch(JVMCodeException e) { // out of nload_n - String local_type = code.get_TypeOf_Var(local_name).getName().toString(); - code.add_code(JVMCode.nload(local_type)); - code.add_code_byte((byte)index); - } - } - else { // FieldVar - code.add_code(JVMCode.aload_0); - code.add_code(JVMCode.getfield); - code.add_code_short(classfile.add_field_ref(local_name, class_name, type)); - } - class_name = (String)type_Menge.elementAt(i); - } - - local_name = (String)name_Menge.lastElement(); - index = classfile.add_field_ref(local_name, class_name, JVMCode.get_codegen_Type("int", paralist)); - - code.add_code(JVMCode.dup); - code.add_code(JVMCode.getfield); - code.add_code_short(index); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.isub); - code.add_code(JVMCode.putfield); - code.add_code_short(index); - - } - } - } - else if(expr instanceof InstVar) { - InstVar instvar = (InstVar)expr; - String instvar_name = instvar.get_codegen_UsedId(); - int index = classfile.add_field_ref(instvar_name, null, null); - code.add_code(JVMCode.aload_0); - code.add_code(JVMCode.dup); - code.add_code(JVMCode.getfield); - code.add_code_short(index); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.isub); - code.add_code(JVMCode.putfield); - code.add_code_short(index); - } - else throw new JVMCodeException("JVMCodeException: PreDecExpr: void codegen(ClassFile classfile, Code_attribute code)"); - } - // ino.end // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.26086.definition diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/PreIncExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/PreIncExpr.java index 00861390f..49df77d59 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/PreIncExpr.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/PreIncExpr.java @@ -8,9 +8,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -70,83 +67,6 @@ public class PreIncExpr extends UnaryExpr } // ino.end - // ino.method.codegen.26111.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.26111.body - { - if(expr instanceof LocalOrFieldVar) { - String local_name = (String)((LocalOrFieldVar)expr).get_Name_Menge().lastElement(); - - int index = code.get_indexOf_Var(local_name); - if(index != -1) { - code.add_code(JVMCode.iinc); - code.add_code_byte(index); - code.add_code_byte(1); - } - else { - if(expr instanceof LocalOrFieldVar) { - LocalOrFieldVar local = (LocalOrFieldVar)expr; - Menge name_Menge = local.get_Name_Menge(); - Menge type_Menge = local.get_Type_Menge(); - String class_name = null; - String type = null; - for(int i=0; i < name_Menge.size()-1; i++) { - local_name = (String)name_Menge.elementAt(i); - type = JVMCode.get_codegen_Type((String)type_Menge.elementAt(i), paralist); - - index = code.get_indexOf_Var(local_name); - if(index != -1) { // LocalVar - try{ - String local_type = code.get_TypeOf_Var(local_name).getName().toString(); - code.add_code(JVMCode.nload_n(local_type, index)); - } - catch(JVMCodeException e) { // out of nload_n - String local_type = code.get_TypeOf_Var(local_name).getName().toString(); - code.add_code(JVMCode.nload(local_type)); - code.add_code_byte((byte)index); - } - } - else { // FieldVar - code.add_code(JVMCode.aload_0); - code.add_code(JVMCode.getfield); - code.add_code_short(classfile.add_field_ref(local_name, class_name, type)); - } - class_name = (String)type_Menge.elementAt(i); - } - - local_name = (String)name_Menge.lastElement(); - index = classfile.add_field_ref(local_name, class_name, JVMCode.get_codegen_Type("int", paralist)); - - code.add_code(JVMCode.dup); - code.add_code(JVMCode.getfield); - code.add_code_short(index); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.iadd); - code.add_code(JVMCode.putfield); - code.add_code_short(index); - - } - } - } - else if(expr instanceof InstVar) { - InstVar instvar = (InstVar)expr; - String instvar_name = instvar.get_codegen_UsedId(); - int index = classfile.add_field_ref(instvar_name, null, null); - code.add_code(JVMCode.aload_0); - code.add_code(JVMCode.dup); - code.add_code(JVMCode.getfield); - code.add_code_short(index); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.iadd); - code.add_code(JVMCode.putfield); - code.add_code_short(index); - } - else throw new JVMCodeException("JVMCodeException: PreIncExpr: void codegen(ClassFile classfile, Code_attribute code)"); - } - // ino.end - // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.26120.definition public void wandleRefTypeAttributes2GenericAttributes(Menge paralist, Menge genericMethodParameters) diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Receiver.java b/src/de/dhbwstuttgart/syntaxtree/statement/Receiver.java index ddb355860..15a130a69 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Receiver.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Receiver.java @@ -34,7 +34,7 @@ public class Receiver // ino.method.Receiver.26132.defdescription type=javadoc /** - * Autor: J�rg B�uerle + * Autor: J�rg B�uerle * @param expr */ // ino.end @@ -76,7 +76,7 @@ public class Receiver // ino.method.toString.26147.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Return.java b/src/de/dhbwstuttgart/syntaxtree/statement/Return.java index 08c516b5a..57ed3ac54 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Return.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Return.java @@ -6,9 +6,6 @@ import java.util.Hashtable; import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -69,16 +66,6 @@ public class Return extends Statement } // ino.end - // ino.method.codegen.26172.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.26172.body - { - retexpr.codegen(classfile, code, paralist); - code.add_code(JVMCode.nreturn(retexpr.getTypeName())); - } - // ino.end // ino.method.toString.26178.definition public String toString() diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Statement.java b/src/de/dhbwstuttgart/syntaxtree/statement/Statement.java index a450bb1d6..b844a30fc 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Statement.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Statement.java @@ -6,8 +6,6 @@ import java.util.Enumeration; import java.util.Hashtable; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; @@ -69,11 +67,6 @@ public abstract class Statement extends SyntaxTreeNode implements IItemWithOffse } // ino.end - // ino.method.codegen.26206.declaration - public abstract void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException; - // ino.end - @@ -83,7 +76,7 @@ public abstract class Statement extends SyntaxTreeNode implements IItemWithOffse /** * @author AI10023 - Andreas Stadelmeier - * Implementierung des Java 8 - Typinferenzalgorithmus von Martin Plümicke + * Implementierung des Java 8 - Typinferenzalgorithmus von Martin Plümicke * Jedes Statement wird im Zuge des Algorithmus durch die TYPEExpr-Funktion angesprochen. */ public abstract ConstraintsSet TYPEStmt(TypeAssumptions assumptions); @@ -96,7 +89,7 @@ public abstract class Statement extends SyntaxTreeNode implements IItemWithOffse /** * @author Andreas Stadelmeier, a10023 - * Sollte von jedem Statement überschrieben werden. + * Sollte von jedem Statement überschrieben werden. * Liefert Informationen zum Statment und dessen Typ. * @return */ @@ -108,7 +101,7 @@ public abstract class Statement extends SyntaxTreeNode implements IItemWithOffse /** * @author AI10023 - Andreas Stadelmeier * Jedem Statement und jeder Expression wird im Zuge des Typinferenzalgorithmus eine Typvariable zugewiesen. - * Daher müssen alle Statements und Expressions die Methoden setTypeVariable und getTypeVariable implementieren. + * Daher müssen alle Statements und Expressions die Methoden setTypeVariable und getTypeVariable implementieren. */ public void setType(Type t) { diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/StringLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/StringLiteral.java index 89eb265d1..f1c9b2ff3 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/StringLiteral.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/StringLiteral.java @@ -7,9 +7,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.Class; @@ -85,33 +82,6 @@ public class StringLiteral extends Literal } // ino.end - // ino.method.codegen.26249.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.26249.body - { - int index = classfile.add_CONSTANT_String_info(string); - if(index < 256) { - code.add_code(JVMCode.ldc); - code.add_code_byte((byte)index); - } - else { - code.add_code(JVMCode.ldc_w); - code.add_code_short((short)index); - } - } - // ino.end - - // ino.method.ConstantCodegen.26252.definition - public short ConstantCodegen(ClassFile classfile) - throws JVMCodeException - // ino.end - // ino.method.ConstantCodegen.26252.body - { - return (short) classfile.add_CONSTANT_String_info(string); - } - // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.26258.definition public void wandleRefTypeAttributes2GenericAttributes(Menge paralist, Menge genericMethodParameters) diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java b/src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java index 262da736a..a66c20426 100644 --- a/src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java @@ -6,9 +6,6 @@ import java.util.Hashtable; import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCStatementException; @@ -67,7 +64,7 @@ public class SuperCall extends ThisCall return ret; }else{ //Ansonsten Fehler ausgeben: - throw new TypeinferenceException("super()-Aufruf hier nicht möglich", this); + throw new TypeinferenceException("super()-Aufruf hier nicht möglich", this); } } diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/This.java b/src/de/dhbwstuttgart/syntaxtree/statement/This.java index 32b6ad8fe..cc13362f3 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/This.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/This.java @@ -6,9 +6,6 @@ import java.util.Hashtable; import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCStatementException; @@ -94,16 +91,6 @@ public class This extends Expr // ino.end */ - // ino.method.codegen.26283.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.26283.body - { - code.add_code(JVMCode.aload_0); - } - // ino.end - // ino.method.get_Name.26286.definition public String get_Name() // ino.end @@ -124,7 +111,7 @@ public class This extends Expr public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) { ConstraintsSet ret = new ConstraintsSet(); //this.set_Type(new); - //this.setType(assumptions.getThisValue());//Die Assumption für this als TypeVariable setzen. + //this.setType(assumptions.getThisValue());//Die Assumption für this als TypeVariable setzen. this.setType(this.getParentClass().getType()); return ret; } diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ThisCall.java b/src/de/dhbwstuttgart/syntaxtree/statement/ThisCall.java index 7ca986b52..2bc329bfb 100644 --- a/src/de/dhbwstuttgart/syntaxtree/statement/ThisCall.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/ThisCall.java @@ -6,9 +6,6 @@ import java.util.Hashtable; import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCStatementException; @@ -87,7 +84,7 @@ public class ThisCall extends MethodCall return ret; }else{ //Ansonsten Fehler ausgeben: - throw new TypeinferenceException("this()-Aufruf hier nicht möglich", this); + throw new TypeinferenceException("this()-Aufruf hier nicht möglich", this); } } diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.java index cf77ca241..53903512f 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.java @@ -4,8 +4,6 @@ package de.dhbwstuttgart.syntaxtree.statement; // ino.module.UnaryExpr.8655.import import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; @@ -33,10 +31,6 @@ public abstract class UnaryExpr extends Expr } // ino.end - // ino.method.codegen.26305.declaration - public abstract void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException; - // ino.end private Menge getNumericTypes(){ Menge ret = new Menge<>(); diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/UnaryMinus.java b/src/de/dhbwstuttgart/syntaxtree/statement/UnaryMinus.java index 4c5fe47f0..43de66084 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/UnaryMinus.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/UnaryMinus.java @@ -2,10 +2,6 @@ package de.dhbwstuttgart.syntaxtree.statement; // ino.end -// ino.module.UnaryMinus.8656.import -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; // ino.class.UnaryMinus.26308.declaration @@ -13,16 +9,7 @@ public class UnaryMinus // ino.end // ino.class.UnaryMinus.26308.body { - // ino.method.codegen.26311.definition - public void codegen(ClassFile classfile, CodeAttribute code, String type, boolean neg) - throws JVMCodeException - // ino.end - // ino.method.codegen.26311.body - { - if(!neg) code.add_code(JVMCode.nneg(type)); - } - // ino.end - + } diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/UnaryNot.java b/src/de/dhbwstuttgart/syntaxtree/statement/UnaryNot.java index e76cc6239..3cb1ef91c 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/UnaryNot.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/UnaryNot.java @@ -2,10 +2,6 @@ package de.dhbwstuttgart.syntaxtree.statement; // ino.end -// ino.module.UnaryNot.8657.import -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.JVMCodeException; // ino.class.UnaryNot.26314.declaration @@ -13,31 +9,6 @@ public class UnaryNot // ino.end // ino.class.UnaryNot.26314.body { - // ino.method.codegen.26317.definition - public void codegen(ClassFile classfile, CodeAttribute code, boolean sw) - throws JVMCodeException - // ino.end - // ino.method.codegen.26317.body - { - if(!sw)code.add_code(JVMCode.ifne); - else code.add_code(JVMCode.ifeq); - code.add_code_short((short)7); - code.add_code(JVMCode.iconst_1); - code.add_code(JVMCode.goto_); - code.add_code_short((short)4); - code.add_code(JVMCode.iconst_0); - } - // ino.end - - // ino.method.if_codegen.26320.definition - public void if_codegen(ClassFile classfile, CodeAttribute code, boolean sw) - throws JVMCodeException - // ino.end - // ino.method.if_codegen.26320.body - { - if(!sw) code.add_code(JVMCode.ifne); - else code.add_code(JVMCode.ifeq); - } - // ino.end + } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/WhileStmt.java b/src/de/dhbwstuttgart/syntaxtree/statement/WhileStmt.java index 48f24c645..2de82c392 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/WhileStmt.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/WhileStmt.java @@ -9,9 +9,6 @@ import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.bytecode.CodeAttribute; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCExcept; @@ -81,62 +78,10 @@ public class WhileStmt extends Statement } // ino.end - // ino.method.codegen.26351.definition - public void codegen(ClassFile classfile, CodeAttribute code, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.codegen.26351.body - { - if(loop_block!=null && expr!=null) { - code.add_code(JVMCode.goto_); - int breakpoint = code.get_code_length(); - code.add_code_short(0); - loop_block.codegen(classfile, code, paralist); - code.set_code_short(code.get_code_length() + 1 - breakpoint, breakpoint); - - loop_codegen(classfile, code, breakpoint, false, paralist); - } - } - // ino.end - - // ino.method.loop_codegen.26354.definition - public void loop_codegen(ClassFile classfile, CodeAttribute code, int breakpoint, boolean not, Menge paralist) - throws JVMCodeException - // ino.end - // ino.method.loop_codegen.26354.body - { - if(expr instanceof NotExpr) { - expr = ((NotExpr)expr).get_Expr(); - loop_codegen(classfile, code, breakpoint, !not, paralist); - } - else if(expr instanceof Binary) { - Operator op = ((Binary)expr).get_Operator(); - if(op instanceof LogOp) ((LogOp)op).loop_codegen(classfile, code, expr, breakpoint, !not, paralist); - else if(op instanceof RelOp) { - Expr expr1 = ((Binary)expr).get_Expr1(); - Expr expr2 = ((Binary)expr).get_Expr2(); - expr1.codegen(classfile, code, paralist); - expr2.codegen(classfile, code, paralist); - - if(expr1 instanceof Null || expr2 instanceof Null) ((RelOp)op).if_codegen(classfile, code, "null", !not); - else ((RelOp)op).if_codegen(classfile, code, expr1.getTypeName(), !not); - - code.add_code_short(breakpoint + 3 - code.get_code_length()); - } - else throw new JVMCodeException("JVMCodeException: WhileStmt: void loop_codegen(ClassFile classfile, Code_attribute code, int breakpoint, boolean not)"); - } - else { - expr.codegen(classfile, code, paralist); - if(!not) code.add_code(JVMCode.ifne); - else code.add_code(JVMCode.ifeq); - code.add_code_short(breakpoint + 3 - code.get_code_length()); - } - } - // ino.end // ino.method.toString.26360.defdescription type=javadoc /** - *
Author: Martin Pl�micke + *
Author: Martin Pl�micke * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/type/BaseType.java b/src/de/dhbwstuttgart/syntaxtree/type/BaseType.java index c5adcbe0a..5297dcec0 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/BaseType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/BaseType.java @@ -40,7 +40,7 @@ public abstract class BaseType extends Type // ino.method.equals.26445.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param Object * @return */ @@ -85,7 +85,7 @@ public abstract class BaseType extends Type @Override public ConstraintType TYPE(TypeAssumptions ass, SyntaxTreeNode parent) { - return super.TYPE(ass, parent); //Die Base-Types müssen nicht nachgeschlagen werden. + return super.TYPE(ass, parent); //Die Base-Types müssen nicht nachgeschlagen werden. } diff --git a/src/de/dhbwstuttgart/syntaxtree/type/BooleanType.java b/src/de/dhbwstuttgart/syntaxtree/type/BooleanType.java index b1c88056a..b20385167 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/BooleanType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/BooleanType.java @@ -22,7 +22,7 @@ public class BooleanType extends BaseType // ino.method.equals.26458.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param Object * @return */ @@ -43,7 +43,7 @@ public class BooleanType extends BaseType // ino.method.clone.26461.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/type/BoundedGenericTypeVar.java b/src/de/dhbwstuttgart/syntaxtree/type/BoundedGenericTypeVar.java index ad2d5ea53..02dc75603 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/BoundedGenericTypeVar.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/BoundedGenericTypeVar.java @@ -87,7 +87,7 @@ public class BoundedGenericTypeVar extends GenericTypeVar public ConstraintsSet TYPE(TypeAssumptions ass) { ConstraintsSet ret = super.TYPE(ass); //ass.addGenericVarAssumption(this); - //Die Type methode der BoundedGenericTypeVar schreibt zusätzlich noch die Constraints für die bounds + //Die Type methode der BoundedGenericTypeVar schreibt zusätzlich noch die Constraints für die bounds Menge tempBounds = new Menge<>(); if(this.bounds != null){ for(ObjectType ev : this.bounds){ @@ -130,26 +130,6 @@ public class BoundedGenericTypeVar extends GenericTypeVar } // ino.end - // ino.method.getSignatureDefinition.26489.definition - public String getSignatureDefinition() - // ino.end - // ino.method.getSignatureDefinition.26489.body - { - // Rueckgabeformat: - // Zur kompletten Definition (bspw. Rueckgabewert) muss zusaetzlich - // noch ((GenericTypeVar)obj).getSignatureType(paralist) aufgerufen - // werden! - StringBuffer sb = new StringBuffer(); - sb.append(name); - - for (int i=0; i < bounds.size(); i++) { - sb.append(":"); - sb.append(bounds.elementAt(i).get_codegen_Type( null)); - } - - return sb.toString(); - } - // ino.end @Override public Menge getChildren() { diff --git a/src/de/dhbwstuttgart/syntaxtree/type/CRefTypeSet.java b/src/de/dhbwstuttgart/syntaxtree/type/CRefTypeSet.java deleted file mode 100755 index bf6ab090b..000000000 --- a/src/de/dhbwstuttgart/syntaxtree/type/CRefTypeSet.java +++ /dev/null @@ -1,29 +0,0 @@ -package de.dhbwstuttgart.syntaxtree.type; - -import java.util.Iterator; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.typeinference.unify.CMengeSet; - -public class CRefTypeSet extends CMengeSet { - - public CRefTypeSet shallowCopy(){ - CRefTypeSet copy = new CRefTypeSet(); - copy.setMenge((Menge)this.getMenge().clone()); - return copy; - } - - public CRefTypeSet deepCopy() { - - CRefTypeSet copy = new CRefTypeSet(); - Iterator it = this.getIterator(); - while(it.hasNext()){ - copy.addElement(it.next().clone()); - } - return copy; - } - - public Iterator iterator() { - return this.getIterator(); - } -} diff --git a/src/de/dhbwstuttgart/syntaxtree/type/CharacterType.java b/src/de/dhbwstuttgart/syntaxtree/type/CharacterType.java index 166192af7..025863fb7 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/CharacterType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/CharacterType.java @@ -22,7 +22,7 @@ public class CharacterType extends BaseType // ino.method.equals.26499.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param Object * @return */ @@ -43,7 +43,7 @@ public class CharacterType extends BaseType // ino.method.clone.26502.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/type/DoubleType.java b/src/de/dhbwstuttgart/syntaxtree/type/DoubleType.java index 50d4df58b..36e0f047b 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/DoubleType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/DoubleType.java @@ -22,7 +22,7 @@ public class DoubleType extends BaseType // ino.method.equals.26534.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param Object * @return */ @@ -43,7 +43,7 @@ public class DoubleType extends BaseType // ino.method.clone.26537.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/type/ExtendsWildcardType.java b/src/de/dhbwstuttgart/syntaxtree/type/ExtendsWildcardType.java index 347fbbe81..a48046b0d 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/ExtendsWildcardType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/ExtendsWildcardType.java @@ -21,8 +21,8 @@ import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; public class ExtendsWildcardType extends WildcardType implements ITypeContainer, IMatchable{ /** - * Author: Arne Lüdtke
- * Standard Konstruktor für eine ExtendsWildcard + * Author: Arne Lüdtke
+ * Standard Konstruktor für eine ExtendsWildcard */ public ExtendsWildcardType (int offset, ObjectType extendsType) { @@ -35,10 +35,10 @@ public class ExtendsWildcardType extends WildcardType implements ITypeContainer, } /** - * Author: Arne Lüdtke
- * Gibt den Typen in der Wildcard zurück. + * Author: Arne Lüdtke
+ * Gibt den Typen in der Wildcard zurück. * Beispiel: ? extends Integer. - * Integer wird zurückgegeben. + * Integer wird zurückgegeben. */ public ObjectType get_ExtendsType() { @@ -46,8 +46,8 @@ public class ExtendsWildcardType extends WildcardType implements ITypeContainer, } /** - * Author: Arne Lüdtke
- * Gibt String Entsprechung zurück. + * Author: Arne Lüdtke
+ * Gibt String Entsprechung zurück. */ public String toString() { @@ -55,8 +55,8 @@ public class ExtendsWildcardType extends WildcardType implements ITypeContainer, } /** - * Author: Arne Lüdtke
- * Gibt einen Klon der Wildcard zurück. + * Author: Arne Lüdtke
+ * Gibt einen Klon der Wildcard zurück. * Der Innere Typ wird auch geklont */ public ExtendsWildcardType clone() @@ -66,7 +66,7 @@ public class ExtendsWildcardType extends WildcardType implements ITypeContainer, } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Vergleicht mit einem anderen Objekt. * @param obj - Object to compare. */ @@ -83,9 +83,9 @@ public class ExtendsWildcardType extends WildcardType implements ITypeContainer, } /** - * Author: Arne Lüdtke
- * Gibt die passende FreshWildcardType Klasse zurück. - * Wird für CaptureConversion verwendet + * Author: Arne Lüdtke
+ * Gibt die passende FreshWildcardType Klasse zurück. + * Wird für CaptureConversion verwendet */ public FreshExtendsWildcardType GetFreshWildcardType() { @@ -93,9 +93,9 @@ public class ExtendsWildcardType extends WildcardType implements ITypeContainer, } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Das gleiche wie get_ExtendsType(). - * Überschreibt die Methode der Superklasse. + * Überschreibt die Methode der Superklasse. */ public Type GetWildcardType() { @@ -103,7 +103,7 @@ public class ExtendsWildcardType extends WildcardType implements ITypeContainer, } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Setzt den Typ in der Wildcard * @param T - Type to be set */ @@ -114,7 +114,7 @@ public class ExtendsWildcardType extends WildcardType implements ITypeContainer, } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Das gleiche wie get_ExtendsType(). * Implementiert ITypeContainer */ @@ -124,9 +124,9 @@ public class ExtendsWildcardType extends WildcardType implements ITypeContainer, } /** - * Author: Arne Lüdtke
- * Gibt den Typen zurück, der bei einem match im Unify verwendet werden soll. - * Wird über IMatchable implementiert. + * Author: Arne Lüdtke
+ * Gibt den Typen zurück, der bei einem match im Unify verwendet werden soll. + * Wird über IMatchable implementiert. */ public ObjectType getMatchType() { @@ -153,7 +153,7 @@ public class ExtendsWildcardType extends WildcardType implements ITypeContainer, @Override public ConstraintType TYPE(TypeAssumptions ass, SyntaxTreeNode parent) { - //Folgender TypeCast ist sicher. Wird ein ObjectType in einen ConstraintType umgewandelt und wieder zurück, kann kein Fehler auftreten. + //Folgender TypeCast ist sicher. Wird ein ObjectType in einen ConstraintType umgewandelt und wieder zurück, kann kein Fehler auftreten. this.innerType = (ObjectType) this.innerType.TYPE(ass, parent).getType(); return super.TYPE(ass, parent); } diff --git a/src/de/dhbwstuttgart/syntaxtree/type/FloatType.java b/src/de/dhbwstuttgart/syntaxtree/type/FloatType.java index 716f5bada..299589fde 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/FloatType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/FloatType.java @@ -22,7 +22,7 @@ public class FloatType extends BaseType // ino.method.equals.26534.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param Object * @return */ @@ -43,7 +43,7 @@ public class FloatType extends BaseType // ino.method.clone.26537.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/type/FreshExtendsWildcardType.java b/src/de/dhbwstuttgart/syntaxtree/type/FreshExtendsWildcardType.java index 4c5d8e4fa..2a455363b 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/FreshExtendsWildcardType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/FreshExtendsWildcardType.java @@ -7,8 +7,8 @@ public class FreshExtendsWildcardType extends FreshWildcardType implements IMatc private ObjectType extendsBoundType; /** - * Author: Arne Lüdtke
- * Standard Konstruktor für eine FreshExtendsWildcard + * Author: Arne Lüdtke
+ * Standard Konstruktor für eine FreshExtendsWildcard */ public FreshExtendsWildcardType(ObjectType extendsBound,SyntaxTreeNode parent ,int offset) { @@ -17,8 +17,8 @@ public class FreshExtendsWildcardType extends FreshWildcardType implements IMatc } /** - * Author: Arne Lüdtke
- * Privater Konstruktor für clone + * Author: Arne Lüdtke
+ * Privater Konstruktor für clone */ private FreshExtendsWildcardType(ObjectType extendsBound ,SyntaxTreeNode parent,int offset, String name) { @@ -27,8 +27,8 @@ public class FreshExtendsWildcardType extends FreshWildcardType implements IMatc } /** - * Author: Arne Lüdtke
- * Gibt String Entsprechung zurück. + * Author: Arne Lüdtke
+ * Gibt String Entsprechung zurück. */ public String toString() { @@ -40,8 +40,8 @@ public class FreshExtendsWildcardType extends FreshWildcardType implements IMatc } /** - * Author: Arne Lüdtke
- * Gibt einen Klon der Wildcard zurück. + * Author: Arne Lüdtke
+ * Gibt einen Klon der Wildcard zurück. * Der Innere Typ wird auch geklont */ public FreshExtendsWildcardType clone() @@ -50,8 +50,8 @@ public class FreshExtendsWildcardType extends FreshWildcardType implements IMatc } /** - * Author: Arne Lüdtke
- * Gibt die Grenze der Wildcard zurück + * Author: Arne Lüdtke
+ * Gibt die Grenze der Wildcard zurück */ public ObjectType get_ExtendsBound() { @@ -59,8 +59,8 @@ public class FreshExtendsWildcardType extends FreshWildcardType implements IMatc } /** - * Author: Arne Lüdtke
- * Prüft, ob zwei Objekte gleich sind. NICHT INSTANZGLEICH + * Author: Arne Lüdtke
+ * Prüft, ob zwei Objekte gleich sind. NICHT INSTANZGLEICH */ public boolean equals(Object obj) { @@ -74,9 +74,9 @@ public class FreshExtendsWildcardType extends FreshWildcardType implements IMatc } /** - * Author: Arne Lüdtke
- * Gibt die passende ExtendsWildcardType Klasse zurück. - * Wird für smaller4 verwendet + * Author: Arne Lüdtke
+ * Gibt die passende ExtendsWildcardType Klasse zurück. + * Wird für smaller4 verwendet */ public ExtendsWildcardType get_WildcardType() { @@ -84,9 +84,9 @@ public class FreshExtendsWildcardType extends FreshWildcardType implements IMatc } /** - * Author: Arne Lüdtke
- * Gibt den Typen zurück, der bei einem match im Unify verwendet werden soll. - * Wird über IMatchable implementiert. + * Author: Arne Lüdtke
+ * Gibt den Typen zurück, der bei einem match im Unify verwendet werden soll. + * Wird über IMatchable implementiert. */ public Type getMatchType() { diff --git a/src/de/dhbwstuttgart/syntaxtree/type/FreshSuperWildcardType.java b/src/de/dhbwstuttgart/syntaxtree/type/FreshSuperWildcardType.java index 743c6f306..c381d8e86 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/FreshSuperWildcardType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/FreshSuperWildcardType.java @@ -7,8 +7,8 @@ public class FreshSuperWildcardType extends FreshWildcardType implements IMatcha private ObjectType superBoundType; /** - * Author: Arne Lüdtke
- * Standard Konstruktor für eine FreshSuperWildcard + * Author: Arne Lüdtke
+ * Standard Konstruktor für eine FreshSuperWildcard */ public FreshSuperWildcardType(ObjectType superBound ,SyntaxTreeNode parent, int offset) { @@ -17,8 +17,8 @@ public class FreshSuperWildcardType extends FreshWildcardType implements IMatcha } /** - * Author: Arne Lüdtke
- * Privater Konstruktor für clone + * Author: Arne Lüdtke
+ * Privater Konstruktor für clone */ private FreshSuperWildcardType(ObjectType superBound,SyntaxTreeNode parent,int offset, String name) { @@ -27,8 +27,8 @@ public class FreshSuperWildcardType extends FreshWildcardType implements IMatcha } /** - * Author: Arne Lüdtke
- * Gibt String Entsprechung zurück. + * Author: Arne Lüdtke
+ * Gibt String Entsprechung zurück. */ public String toString() { @@ -40,8 +40,8 @@ public class FreshSuperWildcardType extends FreshWildcardType implements IMatcha } /** - * Author: Arne Lüdtke
- * Gibt einen Klon der Wildcard zurück. + * Author: Arne Lüdtke
+ * Gibt einen Klon der Wildcard zurück. * Der Innere Typ wird auch geklont */ public FreshSuperWildcardType clone() @@ -50,8 +50,8 @@ public class FreshSuperWildcardType extends FreshWildcardType implements IMatcha } /** - * Author: Arne Lüdtke
- * Gibt die Grenze der Wildcard zurück + * Author: Arne Lüdtke
+ * Gibt die Grenze der Wildcard zurück */ public ObjectType get_SuperBound() { @@ -59,8 +59,8 @@ public class FreshSuperWildcardType extends FreshWildcardType implements IMatcha } /** - * Author: Arne Lüdtke
- * Prüft, ob zwei Objekte gleich sind. NICHT INSTANZGLEICH + * Author: Arne Lüdtke
+ * Prüft, ob zwei Objekte gleich sind. NICHT INSTANZGLEICH */ public boolean equals(Object obj) { @@ -74,9 +74,9 @@ public class FreshSuperWildcardType extends FreshWildcardType implements IMatcha } /** - * Author: Arne Lüdtke
- * Gibt die passende SuperWildcardType Klasse zurück. - * Wird für smaller4 verwendet + * Author: Arne Lüdtke
+ * Gibt die passende SuperWildcardType Klasse zurück. + * Wird für smaller4 verwendet */ public SuperWildcardType get_WildcardType() { @@ -84,9 +84,9 @@ public class FreshSuperWildcardType extends FreshWildcardType implements IMatcha } /** - * Author: Arne Lüdtke
- * Gibt den Typen zurück, der bei einem match im Unify verwendet werden soll. - * Wird über IMatchable implementiert. + * Author: Arne Lüdtke
+ * Gibt den Typen zurück, der bei einem match im Unify verwendet werden soll. + * Wird über IMatchable implementiert. */ public Type getMatchType() { diff --git a/src/de/dhbwstuttgart/syntaxtree/type/FreshWildcardType.java b/src/de/dhbwstuttgart/syntaxtree/type/FreshWildcardType.java index 73f8019c5..fc5c73389 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/FreshWildcardType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/FreshWildcardType.java @@ -14,8 +14,8 @@ public class FreshWildcardType extends Type { private Menge upperBounds = new Menge(); /** - * Author: Arne Lüdtke
- * Standard Konstruktor für eine FreshWildcard + * Author: Arne Lüdtke
+ * Standard Konstruktor für eine FreshWildcard */ public FreshWildcardType(SyntaxTreeNode parent, int offset) { @@ -24,9 +24,9 @@ public class FreshWildcardType extends Type { } /** - * Author: Arne Lüdtke
- * Protected Konstruktor für clone. - * Protected, da vererbte Klassen ihn verwenden müssen. + * Author: Arne Lüdtke
+ * Protected Konstruktor für clone. + * Protected, da vererbte Klassen ihn verwenden müssen. */ protected FreshWildcardType(SyntaxTreeNode parent, int offset, String name) { @@ -35,8 +35,8 @@ public class FreshWildcardType extends Type { } /** - * Author: Arne Lüdtke
- * Gibt String Entsprechung zurück. + * Author: Arne Lüdtke
+ * Gibt String Entsprechung zurück. */ public String toString() { @@ -56,8 +56,8 @@ public class FreshWildcardType extends Type { } /** - * Author: Arne Lüdtke
- * Gibt einen Klon der Wildcard zurück. + * Author: Arne Lüdtke
+ * Gibt einen Klon der Wildcard zurück. * Der Innere Typ wird auch geklont */ public FreshWildcardType clone() @@ -66,19 +66,19 @@ public class FreshWildcardType extends Type { } /** - * Author: Arne Lüdtke
- * Prüft, ob zwei Objekte gleich sind. NICHT INSTANZGLEICH + * Author: Arne Lüdtke
+ * Prüft, ob zwei Objekte gleich sind. NICHT INSTANZGLEICH */ public boolean equals(Object obj) { //Da die Namensgebung von Typeplaceholdern und FreshWildcards identisch ist, - //und im Type nur auf Namen geprüft wird muss verhindert werden, dass ausversehen True zurückgegeben wird, + //und im Type nur auf Namen geprüft wird muss verhindert werden, dass ausversehen True zurückgegeben wird, //Wenn eine FreshWildcard mit einem TypePlaceholder verglichen wird. return (obj instanceof FreshWildcardType) && super.equals(obj); } /** - * Erzeugt einen neuen Namen, und gibt diesen zurück + * Erzeugt einen neuen Namen, und gibt diesen zurück * Methode aus TypePlaceholder kopiert */ private static JavaClassName makeNewName() @@ -86,14 +86,14 @@ public class FreshWildcardType extends Type { // luar: Methode aus TypePlaceholder kopiert. String strReturn = strNextName; - // n�chster Name berechnen und in strNextName speichern + // n�chster Name berechnen und in strNextName speichern inc( strNextName.length() - 1 ); return new JavaClassName(strReturn); } /** - * Hilfsmethode für makeNewName + * Hilfsmethode für makeNewName * Methode aus TypePlaceholder kopiert */ private static void inc(int i) @@ -112,18 +112,18 @@ public class FreshWildcardType extends Type { // aktuelle Stelle: auf A zuruecksetzen manipulate( i, 'A' ); - // vorherige Stelle erh�hen + // vorherige Stelle erh�hen inc( i - 1 ); } else { - // aktueller Buchstabe �ndern + // aktueller Buchstabe �ndern manipulate( i, cBuchstabe ); } } /** - * Hilfsmethode für makeNewName + * Hilfsmethode für makeNewName * Methode aus TypePlaceholder kopiert */ private static void manipulate( int nStelle, char nWert ) @@ -141,24 +141,24 @@ public class FreshWildcardType extends Type { } /** - * Author: Arne Lüdtke
- * Gibt die passende WildcardType Klasse zurück. - * Wird für smaller4 verwendet + * Author: Arne Lüdtke
+ * Gibt die passende WildcardType Klasse zurück. + * Wird für smaller4 verwendet */ public WildcardType get_WildcardType() { return new WildcardType(null, this.getParent(),this.getOffset()); } /** - * Author: Arne Lüdtke
- * Gibt den Menge der oberen Grenzen zurück + * Author: Arne Lüdtke
+ * Gibt den Menge der oberen Grenzen zurück */ public Menge get_UpperBounds() { return this.upperBounds; } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Setzt den Menge der oberen Grenzen */ public void set_UpperBounds(Menge bounds) diff --git a/src/de/dhbwstuttgart/syntaxtree/type/GenericTypeVar.java b/src/de/dhbwstuttgart/syntaxtree/type/GenericTypeVar.java index a1492e465..331c8831b 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/GenericTypeVar.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/GenericTypeVar.java @@ -24,8 +24,8 @@ import de.dhbwstuttgart.syntaxtree.GTVDeclarationContext; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; // ino.class.GenericTypeVar.26505.description type=javadoc /** - * TODO: Diese Klasse überarbeiten. Pair genericTypeVar ist nicht implementiert. - * @author J�rg B�uerle + * TODO: Diese Klasse überarbeiten. Pair genericTypeVar ist nicht implementiert. + * @author J�rg B�uerle * @version $Date: 2013/09/22 20:12:53 $ */ // ino.end @@ -38,9 +38,9 @@ public class GenericTypeVar extends ObjectType //Menge extendVars = new Menge(); protected Pair genericConstraint; /** - * Eine Registry f�r alle Generic-Instanzen, die vor der Bytecode-Generierung durch - * Ihre Superklasse ersetzt werden m�ssen. Siehe "Type Erasure" in Sun Spezifikation. - *
Autor: J�rg B�uerle + * Eine Registry f�r alle Generic-Instanzen, die vor der Bytecode-Generierung durch + * Ihre Superklasse ersetzt werden m�ssen. Siehe "Type Erasure" in Sun Spezifikation. + *
Autor: J�rg B�uerle */ // ino.method.GenericTypeVar.26509.defdescription type=line // private Hashtable> m_TypeErasureList; @@ -79,7 +79,7 @@ public class GenericTypeVar extends ObjectType */ // ino.method.clone.26512.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end @@ -94,7 +94,7 @@ public class GenericTypeVar extends ObjectType // ino.method.equals.26515.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @param obj * @return */ @@ -200,7 +200,7 @@ public class GenericTypeVar extends ObjectType } /** - * Die Type Methode auf generische Variablen angewandt sorgt für deren Eintragung in die TypeAssumptions. + * Die Type Methode auf generische Variablen angewandt sorgt für deren Eintragung in die TypeAssumptions. * @param ass * @return */ @@ -212,7 +212,7 @@ public class GenericTypeVar extends ObjectType @Override public ConstraintType TYPE(TypeAssumptions ass, SyntaxTreeNode parent) { - ass.addGenericVarAssumption(this); //Eine GenericTypeVar kann nur an Stellen vorkommen, an denen sie auch gültig ist. Daher kann sie den Assumptions hinzugefügt werden. + ass.addGenericVarAssumption(this); //Eine GenericTypeVar kann nur an Stellen vorkommen, an denen sie auch gültig ist. Daher kann sie den Assumptions hinzugefügt werden. return super.TYPE(ass, parent); } @@ -224,7 +224,7 @@ public class GenericTypeVar extends ObjectType public void parserPostProcessing(SyntaxTreeNode parent) { //SyntaxTreeNode parentTemp = this.parent; super.parserPostProcessing(parent); - //if(parentTemp != null)this.parent = parentTemp; //Der Parenttype einer GenericVar soll sich nicht ändern können, falls einmal gesetzt. + //if(parentTemp != null)this.parent = parentTemp; //Der Parenttype einer GenericVar soll sich nicht ändern können, falls einmal gesetzt. } public GTVDeclarationContext getDeclarationContext() { diff --git a/src/de/dhbwstuttgart/syntaxtree/type/IMatchable.java b/src/de/dhbwstuttgart/syntaxtree/type/IMatchable.java index 1a1252932..8950040ac 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/IMatchable.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/IMatchable.java @@ -2,17 +2,17 @@ package de.dhbwstuttgart.syntaxtree.type; /** * Dieses Interface wird von allen Klassen implementiert, die weitere Klassen - * enthalten, die im match des Unify beachtet werden müssen. + * enthalten, die im match des Unify beachtet werden müssen. * - * @author Arne Lüdtke + * @author Arne Lüdtke * */ public interface IMatchable { /** - * Author: Arne Lüdtke
- * Gibt den Typen zurück, der bei einem match im Unify verwendet werden soll. - * Wird über IMatchable implementiert. + * Author: Arne Lüdtke
+ * Gibt den Typen zurück, der bei einem match im Unify verwendet werden soll. + * Wird über IMatchable implementiert. */ Type getMatchType(); } diff --git a/src/de/dhbwstuttgart/syntaxtree/type/ITypeContainer.java b/src/de/dhbwstuttgart/syntaxtree/type/ITypeContainer.java index 3ad4a5115..8ce030cc7 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/ITypeContainer.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/ITypeContainer.java @@ -2,16 +2,16 @@ package de.dhbwstuttgart.syntaxtree.type; /** * Dieses Interface wird von allen Klassen implementiert, die weitere Klassen enthalten. - * Wird für diverse Hilfsmethoden verwendet. + * Wird für diverse Hilfsmethoden verwendet. * - * @author Arne Lüdtke + * @author Arne Lüdtke * */ public interface ITypeContainer { /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Das gleiche wie get_ExtendsType(). * Implementiert ITypeContainer */ diff --git a/src/de/dhbwstuttgart/syntaxtree/type/IntegerType.java b/src/de/dhbwstuttgart/syntaxtree/type/IntegerType.java index 84f0b1da4..6fb86103c 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/IntegerType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/IntegerType.java @@ -22,7 +22,7 @@ public class IntegerType extends BaseType // ino.method.equals.26534.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param Object * @return */ @@ -43,7 +43,7 @@ public class IntegerType extends BaseType // ino.method.clone.26537.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/type/LongType.java b/src/de/dhbwstuttgart/syntaxtree/type/LongType.java index 5b0164037..8184ee478 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/LongType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/LongType.java @@ -22,7 +22,7 @@ public class LongType extends BaseType // ino.method.equals.26534.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param Object * @return */ @@ -43,7 +43,7 @@ public class LongType extends BaseType // ino.method.clone.26537.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/type/RefType.java b/src/de/dhbwstuttgart/syntaxtree/type/RefType.java index bb938fe87..e4cb98697 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/RefType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/RefType.java @@ -9,7 +9,6 @@ import java.util.Iterator; import de.dhbwstuttgart.typeinference.Menge; import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.myexception.SCException; import de.dhbwstuttgart.parser.JavaClassName; @@ -86,7 +85,7 @@ public class RefType extends ObjectType implements IMatchable public int hashCode() { int hash = 0; hash += super.hashCode(); - hash += this.name.hashCode();//Nur den Name hashen. Sorgt für langsame, aber funktionierende HashMaps + hash += this.name.hashCode();//Nur den Name hashen. Sorgt für langsame, aber funktionierende HashMaps return hash; } @@ -114,8 +113,8 @@ public class RefType extends ObjectType implements IMatchable // ino.end /** - * Erstellt einen Referenztyp aus dem übergebenen Type. - * Dabei wird der Name und der Offset des baseType's übernommen. + * Erstellt einen Referenztyp aus dem übergebenen Type. + * Dabei wird der Name und der Offset des baseType's übernommen. * @param baseType */ public RefType( Type baseType){ @@ -229,8 +228,8 @@ public class RefType extends ObjectType implements IMatchable /** * HOTI * Diese Methode sucht in der Klassendefinition nach einen GTV, die - * so heißt wie die im RefType definierte Variable. Wenn sie diese gefunden - * hat, wird sie zurückgeben. Wenn dies nicht der Fall war, schaut sie, falls + * so heißt wie die im RefType definierte Variable. Wenn sie diese gefunden + * hat, wird sie zurückgeben. Wenn dies nicht der Fall war, schaut sie, falls * angegeben in den Methodenparametern nach. Findet sie dort auch nichts, liefert * die Methode null. * @param type @@ -314,8 +313,8 @@ public class RefType extends ObjectType implements IMatchable // ino.end /** - * Fügt eine Parameterliste an und tauscht zuvor alle GenerictTypeVars durch TPH aus. - * In einem RefType dürfen keine GTVs enthalten sein. + * Fügt eine Parameterliste an und tauscht zuvor alle GenerictTypeVars durch TPH aus. + * In einem RefType dürfen keine GTVs enthalten sein. * @param v */ // ino.method.set_ParaList.26661.definition @@ -336,7 +335,7 @@ public class RefType extends ObjectType implements IMatchable // ino.end /** - * @return gibt bei leere Parameterliste null zurück. Ist entscheidend für unify-Algorithmus + * @return gibt bei leere Parameterliste null zurück. Ist entscheidend für unify-Algorithmus */ // ino.method.get_ParaList.26664.definition public Menge get_ParaList() @@ -671,32 +670,6 @@ public class RefType extends ObjectType implements IMatchable } // ino.end - // ino.method.getSignatureType.26700.definition - public String getSignatureType(Menge paralist) - // ino.end - // ino.method.getSignatureType.26700.body - { - if (parameter == null || parameter.size() == 0) - return get_codegen_Type(paralist); - - StringBuffer sb = new StringBuffer(); - - // Basistyp, ; entfernen - String basis = JVMCode.get_codegen_Type(getTypeName(),null); - basis = basis.substring(0, basis.length() -1); - sb.append(basis); - - sb.append("<"); - - for(int i = 0; i< parameter.size(); i++) { - sb.append(parameter.elementAt(i).get_codegen_Type(null)); - } - - sb.append(">;"); - - return sb.toString(); - } - // ino.end // ino.method.setPrimitiveFlag.29415.definition public void setPrimitiveFlag(boolean b) @@ -737,9 +710,9 @@ public class RefType extends ObjectType implements IMatchable } /** - * Author: Arne Lüdtke
- * Gibt den Typen zurück, der bei einem match im Unify verwendet werden soll. - * Wird über IMatchable implementiert. + * Author: Arne Lüdtke
+ * Gibt den Typen zurück, der bei einem match im Unify verwendet werden soll. + * Wird über IMatchable implementiert. */ public Type getMatchType() { diff --git a/src/de/dhbwstuttgart/syntaxtree/type/ReturnType.java b/src/de/dhbwstuttgart/syntaxtree/type/ReturnType.java index e7c4a3bf0..379b8999e 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/ReturnType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/ReturnType.java @@ -21,7 +21,7 @@ public class ReturnType extends Type // ino.method.equals.26710.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param Object * @return */ @@ -42,7 +42,7 @@ public class ReturnType extends Type // ino.method.clone.26713.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/type/SuperWildcardType.java b/src/de/dhbwstuttgart/syntaxtree/type/SuperWildcardType.java index be2ba3b65..5c97ea97e 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/SuperWildcardType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/SuperWildcardType.java @@ -23,8 +23,8 @@ public class SuperWildcardType extends WildcardType implements ITypeContainer, I } /** - * Author: Arne Lüdtke
- * Standard Konstruktor für eine SuperWildcard + * Author: Arne Lüdtke
+ * Standard Konstruktor für eine SuperWildcard */ public SuperWildcardType(int offset, ObjectType innerType) { @@ -32,10 +32,10 @@ public class SuperWildcardType extends WildcardType implements ITypeContainer, I } /** - * Author: Arne Lüdtke
- * Gibt den Typen in der Wildcard zurück. + * Author: Arne Lüdtke
+ * Gibt den Typen in der Wildcard zurück. * Beispiel: ? super Integer. - * Integer wird zurückgegeben. + * Integer wird zurückgegeben. */ public ObjectType get_SuperType() { @@ -43,8 +43,8 @@ public class SuperWildcardType extends WildcardType implements ITypeContainer, I } /** - * Author: Arne Lüdtke
- * Gibt String Entsprechung zurück. + * Author: Arne Lüdtke
+ * Gibt String Entsprechung zurück. */ public String toString() { @@ -52,8 +52,8 @@ public class SuperWildcardType extends WildcardType implements ITypeContainer, I } /** - * Author: Arne Lüdtke
- * Gibt einen Klon der Wildcard zurück. + * Author: Arne Lüdtke
+ * Gibt einen Klon der Wildcard zurück. * Der Innere Typ wird auch geklont */ public SuperWildcardType clone() @@ -63,9 +63,9 @@ public class SuperWildcardType extends WildcardType implements ITypeContainer, I /** - * Author: Arne Lüdtke
- * Gibt die passende FreshWildcardType Klasse zurück. - * Wird für CaptureConversion verwendet + * Author: Arne Lüdtke
+ * Gibt die passende FreshWildcardType Klasse zurück. + * Wird für CaptureConversion verwendet */ public FreshSuperWildcardType GetFreshWildcardType() { @@ -73,9 +73,9 @@ public class SuperWildcardType extends WildcardType implements ITypeContainer, I } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Das gleiche wie get_innerType(). - * Überschreibt die Methode der Superklasse + * Überschreibt die Methode der Superklasse */ public Type GetWildcardType() { @@ -83,7 +83,7 @@ public class SuperWildcardType extends WildcardType implements ITypeContainer, I } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Setzt den Typ in der Wildcard * @param T - Type to be set */ @@ -94,7 +94,7 @@ public class SuperWildcardType extends WildcardType implements ITypeContainer, I } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Das gleiche wie get_innerType(). * Implementiert ITypeContainer */ @@ -104,9 +104,9 @@ public class SuperWildcardType extends WildcardType implements ITypeContainer, I } /** - * Author: Arne Lüdtke
- * Gibt den Typen zurück, der bei einem match im Unify verwendet werden soll. - * Wird über IMatchable implementiert. + * Author: Arne Lüdtke
+ * Gibt den Typen zurück, der bei einem match im Unify verwendet werden soll. + * Wird über IMatchable implementiert. */ public Type getMatchType() { @@ -119,7 +119,7 @@ public class SuperWildcardType extends WildcardType implements ITypeContainer, I } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Vergleicht mit einem anderen Objekt. * @param obj - Object to compare. */ diff --git a/src/de/dhbwstuttgart/syntaxtree/type/Type.java b/src/de/dhbwstuttgart/syntaxtree/type/Type.java index 801dd754e..ccb0a6266 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/Type.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/Type.java @@ -5,7 +5,6 @@ package de.dhbwstuttgart.syntaxtree.type; import java.util.ArrayList; import de.dhbwstuttgart.typeinference.Menge; -import de.dhbwstuttgart.bytecode.JVMCode; import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.parser.JavaClassName; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; @@ -110,36 +109,8 @@ public abstract class Type extends SyntaxTreeNode implements IItemWithOffset return used.name.toString(); } // ino.end - - // ino.method.get_codegen_Type.26750.defdescription type=javadoc - /** - * Liefert die Typrepraesentation fuer die - * Bytecodegenerierung zurueck. - */ - // ino.end - // ino.method.get_codegen_Type.26750.definition - public String get_codegen_Type(Menge paralist) - // ino.end - // ino.method.get_codegen_Type.26750.body - { - return JVMCode.get_codegen_Type(name.toString(), paralist); - } - // ino.end - - // ino.method.getSignatureType.26753.defdescription type=javadoc - /** - * Liefert den Typ fuer das Signature-Attribut zurueck. - */ - // ino.end - // ino.method.getSignatureType.26753.definition - public String getSignatureType(Menge paralist) - // ino.end - // ino.method.getSignatureType.26753.body - { - return get_codegen_Type(paralist); - } - // ino.end - + + // ino.method.Type2String.26756.definition public String Type2String() @@ -170,7 +141,7 @@ public abstract class Type extends SyntaxTreeNode implements IItemWithOffset // ino.method.equals.26765.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param Object * @return */ @@ -194,7 +165,7 @@ public abstract class Type extends SyntaxTreeNode implements IItemWithOffset // ino.method.clone.26768.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return // ino.end @@ -212,7 +183,7 @@ public abstract class Type extends SyntaxTreeNode implements IItemWithOffset // ino.method.toString.26771.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end @@ -288,7 +259,7 @@ public abstract class Type extends SyntaxTreeNode implements IItemWithOffset } /** - * Prüft ob der Typ von dem übergebenen TypPlaceholder abhängt. + * Prüft ob der Typ von dem übergebenen TypPlaceholder abhängt. * @param tph * @return */ @@ -297,9 +268,9 @@ public abstract class Type extends SyntaxTreeNode implements IItemWithOffset } /** - * Prüft ob der Typ in den Assumptions ass vorhanden ist. - * Dabei kann eine neue Instanz eines Typs entstehen, welche von der Methode zurückgegeben wird. - * @param ass - Die Assumptions für den jeweiligen Kontext in dem sich der Typ befindet. + * Prüft ob der Typ in den Assumptions ass vorhanden ist. + * Dabei kann eine neue Instanz eines Typs entstehen, welche von der Methode zurückgegeben wird. + * @param ass - Die Assumptions für den jeweiligen Kontext in dem sich der Typ befindet. public ConstraintType checkType(TypeAssumptions ass, SyntaxTreeNode parent){ ConstraintType t = ass.getTypeFor(this, this); @@ -308,7 +279,7 @@ public abstract class Type extends SyntaxTreeNode implements IItemWithOffset return t; } */ - //TODO: checkType wird nicht mehr gebraucht. TYPE übernimmt dessen Aufgabe. Es muss nur sichergestellt werden, dass jeder Typ in den Constraints landet, dadurch wird für jeden Typ die Methode TYPE aufgerufen. + //TODO: checkType wird nicht mehr gebraucht. TYPE übernimmt dessen Aufgabe. Es muss nur sichergestellt werden, dass jeder Typ in den Constraints landet, dadurch wird für jeden Typ die Methode TYPE aufgerufen. public ConstraintType TYPE(TypeAssumptions ass, SyntaxTreeNode parent){ ConstraintType t = ass.getTypeFor(this, parent); if(t==null) diff --git a/src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java b/src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java index 41a43d47a..8ea21928a 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java @@ -20,11 +20,11 @@ import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertPoint; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; // ino.class.TypePlaceholder.26780.description type=javadoc /** - * Repr�sentiert einen Typparameter f�r einen vom Programmierer nicht angegeben + * Repr�sentiert einen Typparameter f�r einen vom Programmierer nicht angegeben * Typ. Jede TypePlaceholder besitzt einen eindeutigen Namen aus einem Namenspool * und * ist in einer zentralen Registry, d.h. einer Hashtable abgelegt. - * @author J�rg B�uerle + * @author J�rg B�uerle * @version $Date: 2013/06/19 12:45:37 $ */ // ino.end @@ -50,9 +50,9 @@ public class TypePlaceholder extends ObjectType // ino.method.TypePlaceholder.26794.defdescription type=javadoc /** - * Privater Konstruktor - Eine TypePlaceholder-Variable wird �ber die + * Privater Konstruktor - Eine TypePlaceholder-Variable wird �ber die * Factory-Methode fresh() erzeugt. - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @param typeName Der Name der TypePlaceholder-Variablen */ // ino.end @@ -64,14 +64,14 @@ public class TypePlaceholder extends ObjectType super(parent, -1); if(typeName == null)throw new NullPointerException(); this.name = new JavaClassName(typeName); - if(parent != null)log.debug("Erstelle TPH "+typeName+" für SyntaxTreeNode: "+parent, Section.TYPEINFERENCE); + if(parent != null)log.debug("Erstelle TPH "+typeName+" für SyntaxTreeNode: "+parent, Section.TYPEINFERENCE); } // ino.end // ino.method.getInstance.26797.defdescription type=javadoc /** * Statische Methode, um einen TypePlaceholder aus der Registry zu holen. - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @param name Der Name des TypePlaceholders * @return Der TypePlaceholder oder null, falls er nicht in der * Registry existiert @@ -88,7 +88,7 @@ public class TypePlaceholder extends ObjectType /** * Generiert einen neuen TPH mit einem bestimmten Namen. - * Wird benötigt, wenn aus Generischen Variablen TPH generiert werden. + * Wird benötigt, wenn aus Generischen Variablen TPH generiert werden. * @param name * @return */ @@ -110,7 +110,7 @@ public class TypePlaceholder extends ObjectType /** * @author Andreas Stadelmeier, a10023 * Ruft die TypePlaceholder.fresh()-Methode auf. - * Fügt zusätzlich einen Replacementlistener hinzu. + * Fügt zusätzlich einen Replacementlistener hinzu. * @param listener * @return */ @@ -129,8 +129,8 @@ public class TypePlaceholder extends ObjectType // ino.method.makeNewName.26803.defdescription type=javadoc /** - * Berechnet einen neuen, eindeutigen Namen f�r eine neue - * TypePlaceholder.
Author: J�rg B�uerle + * Berechnet einen neuen, eindeutigen Namen f�r eine neue + * TypePlaceholder.
Author: J�rg B�uerle * @return Der Name */ // ino.end @@ -142,7 +142,7 @@ public class TypePlaceholder extends ObjectType // otth: Funktion berechnet einen neuen Namen anhand eines alten gespeicherten String strReturn = strNextName; - // n�chster Name berechnen und in strNextName speichern + // n�chster Name berechnen und in strNextName speichern inc( strNextName.length() - 1 ); return strReturn; @@ -152,7 +152,7 @@ public class TypePlaceholder extends ObjectType // ino.method.inc.26806.defdescription type=javadoc /** * Hilfsfunktion zur Berechnung eines neuen Namens - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @param i */ // ino.end @@ -162,10 +162,10 @@ public class TypePlaceholder extends ObjectType // ino.method.inc.26806.body { // otth: Hilfsfunktion zur Berechnung eines neuen Namens - // otth: Erh�hung des Buchstabens an der Stelle i im String strNextName - // otth: Nach �berlauf: rekursiver Aufruf + // otth: Erh�hung des Buchstabens an der Stelle i im String strNextName + // otth: Nach �berlauf: rekursiver Aufruf - // falls i = -1 --> neuer Buchstabe vorne anf�gen + // falls i = -1 --> neuer Buchstabe vorne anf�gen if ( i == -1 ) { strNextName = "A" + strNextName; @@ -179,12 +179,12 @@ public class TypePlaceholder extends ObjectType // aktuelle Stelle: auf A zuruecksetzen manipulate( i, 'A' ); - // vorherige Stelle erh�hen + // vorherige Stelle erh�hen inc( i - 1 ); } else { - // aktueller Buchstabe �ndern + // aktueller Buchstabe �ndern manipulate( i, cBuchstabe ); } @@ -194,7 +194,7 @@ public class TypePlaceholder extends ObjectType // ino.method.manipulate.26809.defdescription type=javadoc /** * Hilfsfunktion zur Berechnung eines neuen Namens. - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @param nStelle * @param nWert */ @@ -221,7 +221,7 @@ public class TypePlaceholder extends ObjectType // ino.method.equals.26812.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param Object * @return */ @@ -244,9 +244,9 @@ public class TypePlaceholder extends ObjectType // ino.method.deleteRegistry.26839.defdescription type=javadoc /** - * L�scht die komplette Registry von TypePlaceholders. Sollte nur und - * ausschlie�lich von MyCompiler.init() aufgerufen werden!!! - *
Author: J�rg B�uerle + * L�scht die komplette Registry von TypePlaceholders. Sollte nur und + * ausschlie�lich von MyCompiler.init() aufgerufen werden!!! + *
Author: J�rg B�uerle */ // ino.end // ino.method.deleteRegistry.26839.definition @@ -262,12 +262,12 @@ public class TypePlaceholder extends ObjectType // ino.method.clone.26842.defdescription type=javadoc /** * Diese Methode sollte nur sehr sparsam und mit Vorsicht verwendet werden, da die - * Registrierung neuer Listener �ber die zentrale Instanz in der Registry laufen + * Registrierung neuer Listener �ber die zentrale Instanz in der Registry laufen * muss.
* Diese Methode erzeugt eine Kopie dieser zentralen Instanz. Listener, die sich - * �ber diese Kopie registrieren, werden sp�ter nicht �ber Status�nderungen + * �ber diese Kopie registrieren, werden sp�ter nicht �ber Status�nderungen * benachrichtigt, d.h. ihre TypePlaceholders werden nicht substituiert. - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end @@ -283,7 +283,7 @@ public class TypePlaceholder extends ObjectType /** * @author Andreas Stadelmeier, a10023 - * Überschreibt die get_Name-Methode der Type-Klasse. (Keine Ahnung wieso es überhaupt ein get_Name und ein getName gibt!) + * Überschreibt die get_Name-Methode der Type-Klasse. (Keine Ahnung wieso es überhaupt ein get_Name und ein getName gibt!) */ @Override public String get_Name(){ @@ -300,15 +300,15 @@ public class TypePlaceholder extends ObjectType // ino.end /////////////////////////////////////////////////////////////////// - // Spezialfunktionen, f�r makeFC() und unify() + // Spezialfunktionen, f�r makeFC() und unify() // Sollten sonst nicht aufgerufen werden... /////////////////////////////////////////////////////////////////// // ino.method.backdoorFresh.26848.defdescription type=javadoc /** - * Backdoor-Hilfsfunktion, die f�r makeFC() und unify() - * ben�tigt wird, um neue TypePlaceholders zu erzeugen. Die erzeugten Variablen - * werden nicht registriert und sind v�llig losgel�st vom abstrakten Syntaxbaum. - *
Author: J�rg B�uerle + * Backdoor-Hilfsfunktion, die f�r makeFC() und unify() + * ben�tigt wird, um neue TypePlaceholders zu erzeugen. Die erzeugten Variablen + * werden nicht registriert und sind v�llig losgel�st vom abstrakten Syntaxbaum. + *
Author: J�rg B�uerle * @return Eine neue TypePlaceholder */ // ino.end @@ -332,14 +332,14 @@ public class TypePlaceholder extends ObjectType // ino.method.backdoorSetName.26851.defdescription type=javadoc /** - * Backdoor-Hilfsfunktion, die f�r makeFC() und unify() - * ben�tigt wird, um den Namen eines TypePlaceholders zu ver�ndern.
+ * Backdoor-Hilfsfunktion, die f�r makeFC() und unify() + * ben�tigt wird, um den Namen eines TypePlaceholders zu ver�ndern.
* ACHTUNG: Diese TypePlaceholder darf nicht Teil des abstrakten * Syntaxbaumes sein!!! Es muss sicher gestellt werden, dass die betreffende - * TypePlaceholder nicht �ber die Methode fresh(), - * sondern �ber backdoorCreate() oder backdoorClone() + * TypePlaceholder nicht �ber die Methode fresh(), + * sondern �ber backdoorCreate() oder backdoorClone() * erzeugt worden ist. - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @param varName Der Name des zu erzeugenden TypePlaceholders */ // ino.end @@ -354,10 +354,10 @@ public class TypePlaceholder extends ObjectType // ino.method.backdoorCreate.26854.defdescription type=javadoc /** - * Backdoor-Hilfsfunktion, die f�r makeFC() und unify() - * ben�tigt wird, zum Erzeugen eines TypePlaceholders, der nicht in - * der zentralen Registry eingetragen wird. Die erzeugte Variablen ist somit v�llig - * losgel�st vom abstrakten Syntaxbaum.
Author: J�rg B�uerle + * Backdoor-Hilfsfunktion, die f�r makeFC() und unify() + * ben�tigt wird, zum Erzeugen eines TypePlaceholders, der nicht in + * der zentralen Registry eingetragen wird. Die erzeugte Variablen ist somit v�llig + * losgel�st vom abstrakten Syntaxbaum.
Author: J�rg B�uerle * @param name * @return */ @@ -387,9 +387,9 @@ public class TypePlaceholder extends ObjectType public JavaCodeResult printJavaCode(ResultSet resultSet) { Type equalType = resultSet.getTypeEqualTo(this); if(equalType == null || equalType.equals(this)){ - //Für den Fall das der TPH nicht aufgelöst werden konnte. + //Für den Fall das der TPH nicht aufgelöst werden konnte. JavaCodeResult ret = new JavaCodeResult(this.getName().toString()); - //Jetzt muss eine nicht aufgelöste generische Variable dem JavaCodeResult-Set angefügt werden + //Jetzt muss eine nicht aufgelöste generische Variable dem JavaCodeResult-Set angefügt werden ret.addUnresolvedTPH(this); return ret; } @@ -401,9 +401,9 @@ public class TypePlaceholder extends ObjectType * Berechnet die InsertPoints dieses TypePlaceholders. * Alle an diesem TypePlaceholder registrierten ITypeReplacementListener werden darauf kontrolliert, * ob sie von TypeInsertable erben. - * Diese ergeben zusammen mit den Informationen aus dem übergebenen ResultSet einen TypeInsertPoint. + * Diese ergeben zusammen mit den Informationen aus dem übergebenen ResultSet einen TypeInsertPoint. * Mehrere TypeInsertPoint's ergeben ein TypeInsertSet. - * @param result Das ResultSet das den einzusetzenden Typ für diesen TPH enthält. + * @param result Das ResultSet das den einzusetzenden Typ für diesen TPH enthält. * @return * @see TypeInsertPoint */ diff --git a/src/de/dhbwstuttgart/syntaxtree/type/Void.java b/src/de/dhbwstuttgart/syntaxtree/type/Void.java index e97a809ff..77b3234fe 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/Void.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/Void.java @@ -26,7 +26,7 @@ public class Void extends RefType // ino.method.equals.26864.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param Object * @return */ @@ -57,7 +57,7 @@ public class Void extends RefType // ino.method.clone.26867.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @return */ // ino.end @@ -77,7 +77,7 @@ public class Void extends RefType @Override public Type checkTYPE(TypeAssumptions ass, SyntaxTreeNode method) { - return this;//VOID ist immer korrekt, das wird vom Parser geprüft + return this;//VOID ist immer korrekt, das wird vom Parser geprüft } } diff --git a/src/de/dhbwstuttgart/syntaxtree/type/WildcardType.java b/src/de/dhbwstuttgart/syntaxtree/type/WildcardType.java index b07a94b61..a6e4566dc 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/WildcardType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/WildcardType.java @@ -21,8 +21,8 @@ public class WildcardType extends Type{ protected ObjectType innerType = null; /** - * Author: Arne Lüdtke
- * Standard Konstruktor für eine Wildcard + * Author: Arne Lüdtke
+ * Standard Konstruktor für eine Wildcard */ public WildcardType(ObjectType innerType, SyntaxTreeNode parent, int offset) { @@ -31,8 +31,8 @@ public class WildcardType extends Type{ } /** - * Author: Arne Lüdtke
- * Gibt String Entsprechung zurück. + * Author: Arne Lüdtke
+ * Gibt String Entsprechung zurück. */ public String toString() { @@ -40,8 +40,8 @@ public class WildcardType extends Type{ } /** - * Author: Arne Lüdtke
- * Gibt einen Klon der Wildcard zurück. + * Author: Arne Lüdtke
+ * Gibt einen Klon der Wildcard zurück. */ public WildcardType clone() { @@ -49,9 +49,9 @@ public class WildcardType extends Type{ } /** - * Author: Arne Lüdtke
- * Gibt die passende FreshWildcardType Klasse zurück. - * Wird für CaptureConversion verwendet + * Author: Arne Lüdtke
+ * Gibt die passende FreshWildcardType Klasse zurück. + * Wird für CaptureConversion verwendet */ public FreshWildcardType GetFreshWildcardType() { @@ -59,8 +59,8 @@ public class WildcardType extends Type{ } /** - * Author: Arne Lüdtke
- * Die Allgemeine Wildcard enthält keinen Typen. + * Author: Arne Lüdtke
+ * Die Allgemeine Wildcard enthält keinen Typen. */ public Type GetWildcardType() { @@ -68,7 +68,7 @@ public class WildcardType extends Type{ } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Setzt den Typ in der Wildcard, Allgemeine Wildcard hat aber keinen Typen. * @param T - Type to be set */ diff --git a/src/de/dhbwstuttgart/typeinference/FunN.java b/src/de/dhbwstuttgart/typeinference/FunN.java index d03559ece..55101d67b 100755 --- a/src/de/dhbwstuttgart/typeinference/FunN.java +++ b/src/de/dhbwstuttgart/typeinference/FunN.java @@ -15,7 +15,7 @@ import de.dhbwstuttgart.typeinference.assumptions.MethodAssumption; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; /** - * @see Spezifikation "Complete Typeinference in Java 8" von Martin Plümicke + * @see Spezifikation "Complete Typeinference in Java 8" von Martin Plümicke * "interface FunN { R apply(T1 arg1, T2 arg2, ... , TN argN); }" * @author A10023 - Andreas Stadelmeier * @@ -30,7 +30,7 @@ public class FunN extends RefType { /** * @author Andreas Stadelmeier, a10023 - * Benötigt für den Typinferenzalgorithmus für Java 8 + * Benötigt für den Typinferenzalgorithmus für Java 8 * Generiert einen RefType auf eine FunN - Klasse. * @param R * @param T @@ -73,8 +73,8 @@ public class FunN extends RefType { } /** - * Muss nach jeder Änderung von T oder R aufgerufen werden. - * Dabei werden bestimmte, von RefType geerbte, Parameter angepasst. Dies ist wichtig für den Typinferenzalgorithmus. + * Muss nach jeder Änderung von T oder R aufgerufen werden. + * Dabei werden bestimmte, von RefType geerbte, Parameter angepasst. Dies ist wichtig für den Typinferenzalgorithmus. */ private void calculateNewParalist(){ Menge t = new Menge(); @@ -143,7 +143,7 @@ public class FunN extends RefType { } */ /** - * Die Clone-Methode von RefType darf von FunN NICHT überschrieben werden. + * Die Clone-Methode von RefType darf von FunN NICHT überschrieben werden. @Override public FunN clone() { diff --git a/src/de/dhbwstuttgart/typeinference/FunNInterface.java b/src/de/dhbwstuttgart/typeinference/FunNInterface.java index 2074e03bd..b4c233185 100644 --- a/src/de/dhbwstuttgart/typeinference/FunNInterface.java +++ b/src/de/dhbwstuttgart/typeinference/FunNInterface.java @@ -20,13 +20,13 @@ import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; */ public class FunNInterface extends Class{ //TODO: Diese Klasse sollte eigentlich von Interface erben - //TODO: getType muss einen Typ mit der ParameterListe zurückliefern. + //TODO: getType muss einen Typ mit der ParameterListe zurückliefern. //private Menge gtvparalist; /** - * Ein FunN-Interface enthält nur eine Methode (namens apply). Ist also ein Funktionales Interface. + * Ein FunN-Interface enthält nur eine Methode (namens apply). Ist also ein Funktionales Interface. * @param N - Die Anzahl der Parameter der apply-Methode. Beispiel N = 1 ergibt R apply(T1 par1); */ public FunNInterface(int N) { @@ -72,7 +72,7 @@ public class FunNInterface extends Class{ } /** - * Erstellt die nach Definition des Typinferenzalgorithmus von Martin Plümicke, in jedem FunN-Interface enthaltene apply-Methode + * Erstellt die nach Definition des Typinferenzalgorithmus von Martin Plümicke, in jedem FunN-Interface enthaltene apply-Methode * @return */ private FunNMethod getApplyFunction(){ diff --git a/src/de/dhbwstuttgart/typeinference/FunNMethod.java b/src/de/dhbwstuttgart/typeinference/FunNMethod.java index 1a7f6e74f..d7a18ad45 100755 --- a/src/de/dhbwstuttgart/typeinference/FunNMethod.java +++ b/src/de/dhbwstuttgart/typeinference/FunNMethod.java @@ -18,12 +18,12 @@ public class FunNMethod extends Method{ */ public FunNMethod(Menge paralist){ super(0); //Hat keinen Offset, da nur theoretisch gedachte Methode - int N = paralist.size(); //In der paraliste ist der erste Parameter der Rückgabetyp + int N = paralist.size(); //In der paraliste ist der erste Parameter der Rückgabetyp this.setType(paralist.firstElement()); this.set_DeclId(new DeclId("apply")); ParameterList pl = new ParameterList(); Menge fpList = new Menge(); - for(int i = 1;i fpList = new Menge(); - for(int i = 1;i<=N;i++){ //Alle verbleibenden Elemente in der übergebenen paralist durchgehen. + for(int i = 1;i<=N;i++){ //Alle verbleibenden Elemente in der übergebenen paralist durchgehen. DeclId paramName = new DeclId("T"+i); FormalParameter parameter = new FormalParameter(paramName); parameter.setType(TypePlaceholder.fresh(parameter)); diff --git a/src/de/dhbwstuttgart/typeinference/JavaCodeResult.java b/src/de/dhbwstuttgart/typeinference/JavaCodeResult.java index fff505d20..cbd881bfe 100755 --- a/src/de/dhbwstuttgart/typeinference/JavaCodeResult.java +++ b/src/de/dhbwstuttgart/typeinference/JavaCodeResult.java @@ -24,7 +24,7 @@ public class JavaCodeResult{ public JavaCodeResult attach(JavaCodeResult javaCodeResult){ this.javaCode += javaCodeResult.getJavaCode(); - //Alle TPH anfügen: + //Alle TPH anfügen: for(TypePlaceholder tph : javaCodeResult.getUnresolvedTPH())this.addUnresolvedTPH(tph); return this; } @@ -39,7 +39,7 @@ public class JavaCodeResult{ } /** - * Liefert alle TPHs, welche in diesem JavaCodeResult nicht zu einem Typ aufgelöst wurden. + * Liefert alle TPHs, welche in diesem JavaCodeResult nicht zu einem Typ aufgelöst wurden. * Diese TPHs stehen dadurch im JavaCode als Variablennamen ohne zugeordnetem Typ. * @return */ diff --git a/src/de/dhbwstuttgart/typeinference/KarthesischesProdukt.java b/src/de/dhbwstuttgart/typeinference/KarthesischesProdukt.java index 527e8f4e1..6272b7bed 100755 --- a/src/de/dhbwstuttgart/typeinference/KarthesischesProdukt.java +++ b/src/de/dhbwstuttgart/typeinference/KarthesischesProdukt.java @@ -13,7 +13,7 @@ public abstract class KarthesischesProdukt { ret.add(v); } return ret; - //return m1;//throw new TypinferenzException("m1 hat zu wenige Objekte für ein Karthesisches Produkt. Es müssen mindestens 2 sein."); + //return m1;//throw new TypinferenzException("m1 hat zu wenige Objekte für ein Karthesisches Produkt. Es müssen mindestens 2 sein."); } return berechneKarthesischesProdukt(m1, null); } @@ -45,7 +45,7 @@ public abstract class KarthesischesProdukt { ret = new Menge>(); ret.addAll( karthesischesProdukt2(m1.firstElement(), m2) ); }else{ - throw new TypinferenzException("Der übergebene Vektor m1 ist leer."); + throw new TypinferenzException("Der übergebene Vektor m1 ist leer."); } return ret;*/ @@ -53,10 +53,10 @@ public abstract class KarthesischesProdukt { private static Menge> karthesischesProdukt(Menge m1, Menge m2){ Menge> ret = new Menge>(); - /* Wird dieser Teil nicht auskommentiert, so kann auch ein Karthesisches Produkt über eine Menge mit leeren Teilmengen erstellt werden + /* Wird dieser Teil nicht auskommentiert, so kann auch ein Karthesisches Produkt über eine Menge mit leeren Teilmengen erstellt werden if(m2.size() == 0){//Sonderfall, m2 ist leer: ret.add(m1); - return ret; //Die restliche Berechnungen können übersprungen werden. + return ret; //Die restliche Berechnungen können übersprungen werden. } */ //for(M o1 : m1){ diff --git a/src/de/dhbwstuttgart/typeinference/OderConstraint.java b/src/de/dhbwstuttgart/typeinference/OderConstraint.java index 1db2aa71c..fc4935f8b 100755 --- a/src/de/dhbwstuttgart/typeinference/OderConstraint.java +++ b/src/de/dhbwstuttgart/typeinference/OderConstraint.java @@ -15,7 +15,7 @@ public class OderConstraint extends OderMenge{ private final static Logger logger = Logger.getLogger(OderConstraint.class.getName()); /** - * Erstellt ein neues Oder Constraint und fügt bereits ein Constraint hinzu. + * Erstellt ein neues Oder Constraint und fügt bereits ein Constraint hinzu. * @param p1 * @param p2 */ @@ -30,7 +30,7 @@ public class OderConstraint extends OderMenge{ /** - * Liefert alle in diesem OderConstraint enthaltene Constraints. Dabei gehen die Verknüpfungen (Oder/Und) verloren. + * Liefert alle in diesem OderConstraint enthaltene Constraints. Dabei gehen die Verknüpfungen (Oder/Und) verloren. * @return public Menge getConstraintPairs(){ @@ -44,7 +44,7 @@ public class OderConstraint extends OderMenge{ */ /** - * Fügt ein Pair(p1, p2) dem Constraint hinzu + * Fügt ein Pair(p1, p2) dem Constraint hinzu * @param p1 * @param p2 */ @@ -64,7 +64,7 @@ public class OderConstraint extends OderMenge{ this.addItems(methodConstraint);//oderConstraintPairs.add(methodConstraint); } - //TODO: Funktionalität für filter implementieren + //TODO: Funktionalität für filter implementieren void filterWrongConstraints(Unifier unifier) { /* Menge filteredConstraints = new Menge<>(); diff --git a/src/de/dhbwstuttgart/typeinference/Pair.java b/src/de/dhbwstuttgart/typeinference/Pair.java index 1d08ae513..863b36230 100755 --- a/src/de/dhbwstuttgart/typeinference/Pair.java +++ b/src/de/dhbwstuttgart/typeinference/Pair.java @@ -43,15 +43,15 @@ public class Pair // ino.attribute.bSubst.26552.decldescription type=line // false <--> vorinitialisierter Wert // true <--> Dieses Paar entstand durch reduce1-Regel (=.) - // --> Name von TA1 mu� gleich sein wie Name von TA2 + // --> Name von TA1 mu� gleich sein wie Name von TA2 // Nur noch reduce2-Regel anwendbar // luar 15-04-2007 - // Der Unify mit Wildcards benötigt 3 verschiedene Operatoren. + // Der Unify mit Wildcards benötigt 3 verschiedene Operatoren. // Deshalb wurde der boolean durch einen Enum ersetzt. // Smaller <--> vorinitialisierter Wert // SmallerExtends <--> Kleiner extends (wie vorinitialisiert, nur mit einschluss der Wildcard) - // Equal <--> Gleich: Name von TA1 und TA2 müssen gleich sein. + // Equal <--> Gleich: Name von TA1 und TA2 müssen gleich sein. // ino.end // ino.attribute.bSubst.26552.declaration @@ -301,7 +301,7 @@ public class Pair // ino.method.equals.26588.defdescription type=javadoc /** - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @param obj * @return */ @@ -321,8 +321,8 @@ public class Pair // ino.end /** - * Author: Arne Lüdtke
- * Überprüft ob die Paare die gleichen Instanzen sind. + * Author: Arne Lüdtke
+ * Überprüft ob die Paare die gleichen Instanzen sind. */ public boolean instanzeEquals(Object obj) { @@ -330,7 +330,7 @@ public class Pair } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Abfrage, ob Operator vom Typ Equal ist. */ public boolean OperatorEqual() @@ -339,7 +339,7 @@ public class Pair } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Abfrage, ob Operator vom Typ Smaller ist. */ public boolean OperatorSmaller() @@ -348,7 +348,7 @@ public class Pair } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Abfrage, ob Operator vom Typ SmallerExtends ist. */ public boolean OperatorSmallerExtends() @@ -357,8 +357,8 @@ public class Pair } /** - * Author: Arne Lüdtke
- * Gibt den Operator zurück. + * Author: Arne Lüdtke
+ * Gibt den Operator zurück. */ public PairOperator GetOperator() { @@ -366,7 +366,7 @@ public class Pair } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Setzt den Operator * @param operator - Operator to set. */ @@ -376,7 +376,7 @@ public class Pair } /** - * Author: Arne Lüdtke
+ * Author: Arne Lüdtke
* Erzeugt einen Klon des Paares. */ public Pair clone() @@ -385,8 +385,8 @@ public class Pair } /** - * Gibt eine Liste aller TypePlaceholder die in diesem Pair enthalten sind zurück. - * (Immer zwischen 0 und 2 Stück ;P) + * Gibt eine Liste aller TypePlaceholder die in diesem Pair enthalten sind zurück. + * (Immer zwischen 0 und 2 Stück ;P) * @return */ public Menge getTypePlaceholder() { diff --git a/src/de/dhbwstuttgart/typeinference/ResultSet.java b/src/de/dhbwstuttgart/typeinference/ResultSet.java index 64737673f..5f1aeca29 100755 --- a/src/de/dhbwstuttgart/typeinference/ResultSet.java +++ b/src/de/dhbwstuttgart/typeinference/ResultSet.java @@ -33,7 +33,7 @@ public class ResultSet implements Iterable { } /** - * Löst den übergebenen Typ auf. Rückgabetyp ist ein Reftype oder Void + * Löst den übergebenen Typ auf. Rückgabetyp ist ein Reftype oder Void * @param type * @return */ @@ -62,7 +62,7 @@ public class ResultSet implements Iterable { } /** - * Durchsucht das ResultSet (die unifizierten Constraints des ResultSets) nach diesem Typ. Der Typ wird nicht aufgelöst. + * Durchsucht das ResultSet (die unifizierten Constraints des ResultSets) nach diesem Typ. Der Typ wird nicht aufgelöst. * Es spielt keine Rolle in welchem Kontext der Typ im ResultSet auftaucht. * @param tA1 * @return true, falls der gesuchte Typ enthalten ist. @@ -86,7 +86,7 @@ public class ResultSet implements Iterable { /** - * Sammelt alle Constraints, welche mit den übergebenen TPH's in Verbindung stehen. + * Sammelt alle Constraints, welche mit den übergebenen TPH's in Verbindung stehen. * Auch alle Constraints, welche wiederum mit den gesammelten Constraints in Verbindung stehen werden gesammelt. * @return */ @@ -109,7 +109,7 @@ public class ResultSet implements Iterable { } /** - * Durchsucht das ResultSet nach Typen, die die übergebenen unresolvedTPHs als generische Variablen einbinden. + * Durchsucht das ResultSet nach Typen, die die übergebenen unresolvedTPHs als generische Variablen einbinden. * @param unresolvedTPH * @return */ diff --git a/src/de/dhbwstuttgart/typeinference/SingleConstraint.java b/src/de/dhbwstuttgart/typeinference/SingleConstraint.java index 8b0907f02..18232176c 100755 --- a/src/de/dhbwstuttgart/typeinference/SingleConstraint.java +++ b/src/de/dhbwstuttgart/typeinference/SingleConstraint.java @@ -11,9 +11,9 @@ import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException; /** - * Beschreibung von Herrn Plümicke: - * "The set of constraints consists of constraints of the form θ R θ' , where θ and - * θ' are Java types and R (R ∈ { < , { - //private Pair constraintPair; //entspricht θ condition θ' + //private Pair constraintPair; //entspricht θ condition θ' //private R condition; //entspricht der condition (R) public SingleConstraint(ConstraintType p1, ConstraintType p2){ @@ -41,7 +41,7 @@ public class SingleConstraint extends EinzelElement{ } /* - @Override //Methode überschreiben, damit immer nur ein Menge mit nur einem Element zurückgeliefert wird. + @Override //Methode überschreiben, damit immer nur ein Menge mit nur einem Element zurückgeliefert wird. public Menge getConstraintPairs(){ Menge ret = new Menge(); ret.add(constraintPair); @@ -50,7 +50,7 @@ public class SingleConstraint extends EinzelElement{ */ public void addConstraint(ConstraintPair toAdd){ - //if(constraintPair != null)throw new DebugException("Ein Constraint darf nur aus einem ConstraintPair bestehen. Das hinzufügen von "+ toAdd + " ist nicht möglich."); + //if(constraintPair != null)throw new DebugException("Ein Constraint darf nur aus einem ConstraintPair bestehen. Das hinzufügen von "+ toAdd + " ist nicht möglich."); Type p1 = toAdd.getPair().TA1; Type p2 = toAdd.getPair().TA2; @@ -64,12 +64,12 @@ public class SingleConstraint extends EinzelElement{ //if((p1 instanceof GenericTypeVar))p1 = ((GenericTypeVar)p1).getTypePlaceHolder();//throw new DebugException("GenericTypeVar sind in den Constraints nicht erlaubt");// //if((p2 instanceof GenericTypeVar))p2 = ((GenericTypeVar)p2).getTypePlaceHolder();//throw new DebugException("GenericTypeVar sind in den Constraints nicht erlaubt");// - // BaseTypes werden in RefTypes umgewandelt. Constraints dürfen nur RefTypes oder TypePlaceholder enthalten, da sonst der Unify-Algorithmus nicht funktioniert. + // BaseTypes werden in RefTypes umgewandelt. Constraints dürfen nur RefTypes oder TypePlaceholder enthalten, da sonst der Unify-Algorithmus nicht funktioniert. //if(!(p1 instanceof RefType) && !(p1 instanceof TypePlaceholder) && !(p1 instanceof GenericTypeVar))p1 = new RefType(p1); //if(!(p2 instanceof RefType) && !(p2 instanceof TypePlaceholder) && !(p2 instanceof GenericTypeVar))p2 = new RefType(p2); //if(!(TypePlaceholder.class.isInstance(p1)) || !(RefType.class.isInstance(p1)) || !(TypePlaceholder.class.isInstance(p2)) || !(RefType.class.isInstance(p2))) - //{//Wenn die beiden übergebenen Typen weder RefTypes noch TypePlaceholder sind: + //{//Wenn die beiden übergebenen Typen weder RefTypes noch TypePlaceholder sind: // throw new TypinferenzException("Ein Constraint darf nur aus TypePlaceholdern und Reftypes bestehen"); //} //if(!(p1 instanceof RefType) && !(p1 instanceof TypePlaceholder))throw new DebugException("Fehler: "+p2+" kann nicht in TPH oder RefType umgewandelt werden"); diff --git a/src/de/dhbwstuttgart/typeinference/TypeInsertable.java b/src/de/dhbwstuttgart/typeinference/TypeInsertable.java index f4b62ddb6..cba61fcea 100644 --- a/src/de/dhbwstuttgart/typeinference/TypeInsertable.java +++ b/src/de/dhbwstuttgart/typeinference/TypeInsertable.java @@ -11,11 +11,11 @@ public interface TypeInsertable extends Typeable, IItemWithOffset { public String getIdentifier(); /** - * Errechnet den TypeInsertPoint für das TypeInsertable. - * TypeInsertPoints sollten nur über diese Funktion erstellt werden. + * Errechnet den TypeInsertPoint für das TypeInsertable. + * TypeInsertPoints sollten nur über diese Funktion erstellt werden. * @param tph * @param resultSet - * @return - kann auch null zurückgeben. + * @return - kann auch null zurückgeben. */ public TypeInsertPoint createTypeInsertPoint(TypePlaceholder tph, ResultSet resultSet); diff --git a/src/de/dhbwstuttgart/typeinference/Typeable.java b/src/de/dhbwstuttgart/typeinference/Typeable.java index 85118f5d0..d0b276a98 100755 --- a/src/de/dhbwstuttgart/typeinference/Typeable.java +++ b/src/de/dhbwstuttgart/typeinference/Typeable.java @@ -6,7 +6,7 @@ public interface Typeable { /** * @author Andreas Stadelmeier, a10023 * Jede Expression und jedes Statement muss im Zuge des Typinferenzalgorithmus das Interfece Typable einbinden. - * Die Funktion setTypeVariable muss während des durchlaufens des Typinferenzalgorithmus einmalig für jedes Statement und jede Expression aufgerufen werden. + * Die Funktion setTypeVariable muss während des durchlaufens des Typinferenzalgorithmus einmalig für jedes Statement und jede Expression aufgerufen werden. * Dabei kann auch eine FreshTypeVariable als Typ vergeben werden. * @param typ Der Typ der Typable-Expression/Statement */ diff --git a/src/de/dhbwstuttgart/typeinference/TypeinferenceResultSet.java b/src/de/dhbwstuttgart/typeinference/TypeinferenceResultSet.java index 7c5d9f9a3..f8fd20c86 100755 --- a/src/de/dhbwstuttgart/typeinference/TypeinferenceResultSet.java +++ b/src/de/dhbwstuttgart/typeinference/TypeinferenceResultSet.java @@ -19,12 +19,12 @@ import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet; // ino.class.CTypeReconstructionResult.27238.description type=javadoc /** - * Diese Container-Klasse kapselt alle Ergebniswerte f�r eine m�gliche + * Diese Container-Klasse kapselt alle Ergebniswerte f�r eine m�gliche * Typkombination einer Klasse und deren Methoden sowie lokalen Variablen. Eine - * Instanz dieser Klasse steht f�r genau eine m�gliche Typkombination.
- * Objekte dieser Klasse werden vom Typrekonstruktionsalgorithmus �ber die - * Compiler-API zur�ckgegeben. - * @author J�rg B�uerle + * Instanz dieser Klasse steht f�r genau eine m�gliche Typkombination.
+ * Objekte dieser Klasse werden vom Typrekonstruktionsalgorithmus �ber die + * Compiler-API zur�ckgegeben. + * @author J�rg B�uerle * @version $Date: 2013/09/22 20:13:02 $ */ // ino.end @@ -41,7 +41,7 @@ public class TypeinferenceResultSet * Das unifizierte ConstaraintsSet */ private ResultSet unifiedConstraints; - private de.dhbwstuttgart.syntaxtree.Class ownerOfResultSet;//Jedes Resultset gilt immer nur für eine Klasse. Diese wird in dieser Variable gespeichert. + private de.dhbwstuttgart.syntaxtree.Class ownerOfResultSet;//Jedes Resultset gilt immer nur für eine Klasse. Diese wird in dieser Variable gespeichert. // ino.method.CTypeReconstructionResult.27256.definition public TypeinferenceResultSet(de.dhbwstuttgart.syntaxtree.Class inferedClass, Menge constraints, ResultSet unifiedConstraints) @@ -57,7 +57,7 @@ public class TypeinferenceResultSet /** * @author Andreas Stadelmeier, a10023 * Anhand des Syntaxbaums errechnet der Typinferenzalgorithmus ein Set von Constraints. - * Diese Funktion ist nur für automatisierte Tests interessant. + * Diese Funktion ist nur für automatisierte Tests interessant. * Zum abrufen der Unifizierten Constraints siehe getUnifiedConstraints() * @return */ @@ -67,8 +67,8 @@ public class TypeinferenceResultSet /** * @author Andreas Stadelmeier, a10023 - * Nach dem Durchführen des Interferenzalgorithmus von Lambda 8 entsteht für jede Lösung ein Set con Constraints. - * Diese Constraints haben bereits den Unify-Algorithmus durchlaufen und weißen die errechneten Typen den Typeplacholdern zu. + * Nach dem Durchführen des Interferenzalgorithmus von Lambda 8 entsteht für jede Lösung ein Set con Constraints. + * Diese Constraints haben bereits den Unify-Algorithmus durchlaufen und weißen die errechneten Typen den Typeplacholdern zu. * @return Das fertige ConstraintsSet dieser CTypeRecunstructionResult */ public ResultSet getUnifiedConstraints() { @@ -77,7 +77,7 @@ public class TypeinferenceResultSet /** - * Ermittelt den in diesem ResultSet für den TypePlaceholder tph zugewiesenen Wert. + * Ermittelt den in diesem ResultSet für den TypePlaceholder tph zugewiesenen Wert. * @author Andreas Stadelmeier, a10023 */ public Type getTypeOfPlaceholder(TypePlaceholder tph){ @@ -86,7 +86,7 @@ public class TypeinferenceResultSet /** * Jedes TypeReconstructionResultSet entstand bei der Typinferierung einer Klasse. - * @return Gibt die Klasse zurück der dieses ResultSet zugeordnet ist. + * @return Gibt die Klasse zurück der dieses ResultSet zugeordnet ist. */ public de.dhbwstuttgart.syntaxtree.Class getInterferedClass(){ return this.ownerOfResultSet; @@ -98,8 +98,8 @@ public class TypeinferenceResultSet } /** - * Berechnet alle möglichen Punkte zum Einsetzen eines Typs im Quelltext - * Dabei entstehen TypeInsertSets. Für jeden gesammelten TypeInsertPoint werden alle Abhängigkeiten berechnet. + * Berechnet alle möglichen Punkte zum Einsetzen eines Typs im Quelltext + * Dabei entstehen TypeInsertSets. Für jeden gesammelten TypeInsertPoint werden alle Abhängigkeiten berechnet. * * @return */ @@ -112,7 +112,7 @@ public class TypeinferenceResultSet } /** - * Startet die Bytecodegenerierung dieser Lösung. + * Startet die Bytecodegenerierung dieser Lösung. * Dabei wird die codegen-Methode der inferierten Klasse mit diesem ResultSet aufgerufen. */ public void codegen(){ diff --git a/src/de/dhbwstuttgart/typeinference/UndConstraint.java b/src/de/dhbwstuttgart/typeinference/UndConstraint.java index 3c221d667..3e7b241a6 100755 --- a/src/de/dhbwstuttgart/typeinference/UndConstraint.java +++ b/src/de/dhbwstuttgart/typeinference/UndConstraint.java @@ -7,7 +7,7 @@ import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.typeinference.unify.Unifier; /** - * Stellt ein Constraint dar, welches aus mehreren Constraint-Paaren besteht. Diese gelten alle stets gleichzeitig / sind per "Und" miteinander verknüpft. + * Stellt ein Constraint dar, welches aus mehreren Constraint-Paaren besteht. Diese gelten alle stets gleichzeitig / sind per "Und" miteinander verknüpft. * @author janulrich * */ diff --git a/src/de/dhbwstuttgart/typeinference/UndMenge.java b/src/de/dhbwstuttgart/typeinference/UndMenge.java index 709b263dd..a8fcc0602 100644 --- a/src/de/dhbwstuttgart/typeinference/UndMenge.java +++ b/src/de/dhbwstuttgart/typeinference/UndMenge.java @@ -34,7 +34,7 @@ public class UndMenge
implements KomplexeMenge{ ret = km.cartesianProduct(); }else{ Menge> cartesianProduct = new Menge<>(); - for(Menge r : ret)for(Menge m : km.cartesianProduct()){ //Für jedes Element aus dem Karthesischen Produkt: + for(Menge r : ret)for(Menge m : km.cartesianProduct()){ //Für jedes Element aus dem Karthesischen Produkt: Menge undElement = new Menge(); undElement.addAll(cloner.deepClone(r)); undElement.addAll(m); diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/Assumption.java b/src/de/dhbwstuttgart/typeinference/assumptions/Assumption.java index 0c66535ee..bb7a9063a 100644 --- a/src/de/dhbwstuttgart/typeinference/assumptions/Assumption.java +++ b/src/de/dhbwstuttgart/typeinference/assumptions/Assumption.java @@ -11,7 +11,7 @@ public class Assumption { private TypeInsertable typable; /** - * Wird dieser Konstruktor benutzt müssen alle Methoden der Klasse Assumption überschrieben werden. + * Wird dieser Konstruktor benutzt müssen alle Methoden der Klasse Assumption überschrieben werden. */ protected Assumption(){ } diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/ParameterAssumption.java b/src/de/dhbwstuttgart/typeinference/assumptions/ParameterAssumption.java index 89364bc03..7c5c8b84f 100644 --- a/src/de/dhbwstuttgart/typeinference/assumptions/ParameterAssumption.java +++ b/src/de/dhbwstuttgart/typeinference/assumptions/ParameterAssumption.java @@ -3,7 +3,7 @@ package de.dhbwstuttgart.typeinference.assumptions; import de.dhbwstuttgart.syntaxtree.FormalParameter; /** - * ParameterAssumptions repräsentieren die Methodenparameter innerhalb des Rumpfes einer Methode. + * ParameterAssumptions repräsentieren die Methodenparameter innerhalb des Rumpfes einer Methode. * * @author janulrich * diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java b/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java index f9b4428df..1f7043d2f 100755 --- a/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java +++ b/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java @@ -24,7 +24,7 @@ import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException; /** * Eine Sammlung von TypeAssumptions. - * Jede Expression und jedes Statement erhält beim Aufrufen ihrer TYPE-Methode ein AssumptionSet mit den Assumptions ihrer Umgebung als Parameter übergeben. + * Jede Expression und jedes Statement erhält beim Aufrufen ihrer TYPE-Methode ein AssumptionSet mit den Assumptions ihrer Umgebung als Parameter übergeben. * @author janulrich * * Es gibt verschiedene Assumptions: @@ -52,7 +52,7 @@ public class TypeAssumptions { /** * Dieser Konstruktor setzt bei der Initialisierung auch den Wert von "this" - * @param klassenname - Wert für "this" + * @param klassenname - Wert für "this" */ public TypeAssumptions(){ //this.thisClassName = klassenname; @@ -64,7 +64,7 @@ public class TypeAssumptions { } /** - * Liefert alle bekannten öffentlichen Feldern mit dem Namen withName. Dabei werden alle bekannten Klassen durchsucht. + * Liefert alle bekannten öffentlichen Feldern mit dem Namen withName. Dabei werden alle bekannten Klassen durchsucht. * @param withName * @return */ @@ -80,7 +80,7 @@ public class TypeAssumptions { * Liefert den Typ einer Feldvariable der Klasse inClass * @param withName * @param inClass - * @return null, falls die Klasse kein zugängliches Feld enthält + * @return null, falls die Klasse kein zugängliches Feld enthält */ public Type getTypeOfFieldVar(String withName, Class inClass){ for(FieldAssumption fa : this.getFieldVars(withName)){ @@ -102,7 +102,7 @@ public class TypeAssumptions { } /** - * Liefert den Typ einer lokalen Variable. Zuerst werden die Parameter dieses AssumptionSets durchsucht, dann die lokalen Variablen. Anschließend die Felder der, "this" repräsentierenden Klasse + * Liefert den Typ einer lokalen Variable. Zuerst werden die Parameter dieses AssumptionSets durchsucht, dann die lokalen Variablen. Anschließend die Felder der, "this" repräsentierenden Klasse * @param withName * @return */ @@ -121,7 +121,7 @@ public class TypeAssumptions { * Sucht nach Assumptions zu einer Methode mit dem Namen methodName und parameterCount Parametern. * @param methodName * @param i Die Parameter, welche die Methode verarbeiten soll - * @return Alle Methoden in den Assumptions, welche eine Parameterliste der Länge der übergebenen Parameterliste (parameter) verarbeiten können. + * @return Alle Methoden in den Assumptions, welche eine Parameterliste der Länge der übergebenen Parameterliste (parameter) verarbeiten können. */ public Menge getMethodAssumptions(String methodName, int parameterCount){ Menge ret = new Menge(); @@ -133,7 +133,7 @@ public class TypeAssumptions { //TODO: Dieser Teil mit der Generierung von FunN-Methoden kann raus, da die FunNInterfaces sich in den Basic-Assumptions befinden sollten. //Falls es sich um die apply-Methode eines FunN-Interface handelt: - //if(methodName.equals("apply")){ //Ein Workaround für den Typinferenzalgorithmus TODO: Das hier rausnehmen. + //if(methodName.equals("apply")){ //Ein Workaround für den Typinferenzalgorithmus TODO: Das hier rausnehmen. //CMethodTypeAssumption funNAssumption = new FunN(parameterCount).toCMethodTypeAssumption(); // MethodAssumption funNAssumption = new MethodAssumption(new FunNMethod(parameterCount), new FunNInterface(parameter)); // ret.add(funNAssumption); @@ -144,11 +144,11 @@ public class TypeAssumptions { /** - * Durchsucht die Assumptions des aktuellen Gültigkeitsbereichs (lokale Variablen und Felder der aktuellen Klasse) nach einem Eintrag für den übergebenen Variablennamen. - * In den Assumptions wird dann in der Reihenfolge LocalVarAssumptions, FieldAssumption nach dem übergebenen Variablennamen gesucht. + * Durchsucht die Assumptions des aktuellen Gültigkeitsbereichs (lokale Variablen und Felder der aktuellen Klasse) nach einem Eintrag für den übergebenen Variablennamen. + * In den Assumptions wird dann in der Reihenfolge LocalVarAssumptions, FieldAssumption nach dem übergebenen Variablennamen gesucht. * @param variableName - der Identifier der gesuchten Variablen - * @param inScope - Sucht auch die Felder der übergebenen Klasse ab. Hier kann auch null übergeben werden, dann werden nur die Lokalen Variablen dieser TypeAssumption durchsucht. - * @return - Der Typ für diesen Identifier, oder null, falls kein Typ vorliegt. + * @param inScope - Sucht auch die Felder der übergebenen Klasse ab. Hier kann auch null übergeben werden, dann werden nur die Lokalen Variablen dieser TypeAssumption durchsucht. + * @return - Der Typ für diesen Identifier, oder null, falls kein Typ vorliegt. */ public Type getVarType(String variableName, Class inScope){ //Zuerst die Parameter durchsuchen @@ -193,7 +193,7 @@ public class TypeAssumptions { } /** - * Liefert alle Assumptions, außer die der lokalen Variablen, welche einer bestimmten Klasse zugeordnet sind. + * Liefert alle Assumptions, außer die der lokalen Variablen, welche einer bestimmten Klasse zugeordnet sind. * @param className * @return */ @@ -280,7 +280,7 @@ public class TypeAssumptions { /** * Kontrolliert den vom Parser gesetzten Typ. - * Erweitert dessen Bezeichnung, wenn nötig. + * Erweitert dessen Bezeichnung, wenn nötig. * @param t * @return null, falls der Typ nicht vorhanden ist. */ @@ -305,14 +305,14 @@ public class TypeAssumptions { match = name.equals(typName); if(match && t instanceof RefType){ RefType tr = (RefType)t; - RefType ret = ass.getAssumedClass().getType(); //Dadurch erhält der RefType den vollen Namen (bsp. java.lang.Integer) + RefType ret = ass.getAssumedClass().getType(); //Dadurch erhält der RefType den vollen Namen (bsp. java.lang.Integer) - //Falls der RefType mit Parametern angegeben wurde, so müssen diese erhalten bleiben: + //Falls der RefType mit Parametern angegeben wurde, so müssen diese erhalten bleiben: if(tr.get_ParaList()!=null && tr.getParaList().size()>0){ ret.set_ParaList(tr.getParaList()); } - //Der RefType muss zusätzlich seine Parameter prüfen. + //Der RefType muss zusätzlich seine Parameter prüfen. Menge parameterList = new Menge<>(); if(ret.get_ParaList()!=null)for(Type param : ret.get_ParaList()){ ConstraintType ct = param.TYPE(this, inNode); @@ -334,7 +334,7 @@ public class TypeAssumptions { GTVDeclarationContext gtvDeclNode = ass.getAssumedType().getDeclarationContext(); //Der GTV-Kontext von inNOde GTVDeclarationContext gtvNode = inNode.getGTVDeclarationContext(); - //Überprüfungen (siehe Dokumentation): + //Überprüfungen (siehe Dokumentation): if(gtvDeclNode.isClass()){ //GTV wurde in Klasse definiert if(! gtvNode.getParentClass().equals(gtvDeclNode))sameContext = false; }else{ //GTV wurde in Methode oder Feld definiert: @@ -353,7 +353,7 @@ public class TypeAssumptions { } if(t.getName() == null)throw new DebugException(t.toString()); - //Spezialfälle bei char, int, boolean, .... + //Spezialfälle bei char, int, boolean, .... String name = t.getName().toString(); switch(name){ case "int": @@ -374,8 +374,8 @@ public class TypeAssumptions { } /** - * Fügt eine TypAssumption an. - * Dadurch wird ein Pool von Typen aufgebaut, welche überhaupt erlaubt sind. + * Fügt eine TypAssumption an. + * Dadurch wird ein Pool von Typen aufgebaut, welche überhaupt erlaubt sind. * Wird genutzt um vom Parser eingelesene Typen auf ihre Korrektheit zu kontrollieren. * @param classAssumption */ @@ -397,7 +397,7 @@ public class TypeAssumptions { } /** - * Fügt eine Generische Typvariablen den Assumptions hinzu + * Fügt eine Generische Typvariablen den Assumptions hinzu * @param genericTypeVar */ public void addGenericVarAssumption( @@ -410,13 +410,13 @@ public class TypeAssumptions { } public Type checkType(RefType type, SyntaxTreeNode parent) { - ConstraintType t = this.getTypeFor(type, parent); //Richtigkeit des Typnahmensprüfen + ConstraintType t = this.getTypeFor(type, parent); //Richtigkeit des Typnahmensprüfen type.setName(t.getType().getName()); //Und diesen auf den Typ anwenden return t.getType(); } /** - * Prüft einen Typ auf das vorhandensein in den BasicAssumptions. + * Prüft einen Typ auf das vorhandensein in den BasicAssumptions. * Dabei werden alle Konstruktoren nach diesem Typ durchsucht. Denn jede Klasse hat einen Konstruktor und der muss in den TypeAssumptions vorhanden sein. * @param t * @return diff --git a/src/de/dhbwstuttgart/typeinference/exceptions/TypeinferenceException.java b/src/de/dhbwstuttgart/typeinference/exceptions/TypeinferenceException.java index 4108f1e7c..feaa287cc 100755 --- a/src/de/dhbwstuttgart/typeinference/exceptions/TypeinferenceException.java +++ b/src/de/dhbwstuttgart/typeinference/exceptions/TypeinferenceException.java @@ -4,8 +4,8 @@ import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; /** - * Eine RuntimeException, welche bei einem Fehler während des Typinferenzalgorithmus ausgelöst wird. - * Dies wird zum Beispiel durch Programmierfehler in der Java-Eingabedatei ausgelöst. + * Eine RuntimeException, welche bei einem Fehler während des Typinferenzalgorithmus ausgelöst wird. + * Dies wird zum Beispiel durch Programmierfehler in der Java-Eingabedatei ausgelöst. * @author Andreas Stadelmeier, a10023 * */ diff --git a/src/de/dhbwstuttgart/typeinference/typedeployment/GenericTypeInsertPoint.java b/src/de/dhbwstuttgart/typeinference/typedeployment/GenericTypeInsertPoint.java index 50f9e081f..5b2601dba 100644 --- a/src/de/dhbwstuttgart/typeinference/typedeployment/GenericTypeInsertPoint.java +++ b/src/de/dhbwstuttgart/typeinference/typedeployment/GenericTypeInsertPoint.java @@ -17,9 +17,9 @@ import de.dhbwstuttgart.typeinference.TypeInsertable; import de.dhbwstuttgart.typeinference.exceptions.DebugException; /** - * Ein InsertPoint für Generische Variablen + * Ein InsertPoint für Generische Variablen * Wird beim Einsetzen eines TIP generiert. - * Steht für die Einsetzung aller Generischen Variablendeklarationen zugehörig zu einem Punkt in der SourceFile. + * Steht für die Einsetzung aller Generischen Variablendeklarationen zugehörig zu einem Punkt in der SourceFile. * @author janulrich * */ @@ -37,7 +37,7 @@ public class GenericTypeInsertPoint extends SourcePatchPoint { } /** - * Der TypeInsertString wird im Falle des GTIP von dem zugehörigen SyntaxTreeNode generiert. + * Der TypeInsertString wird im Falle des GTIP von dem zugehörigen SyntaxTreeNode generiert. * @return */ public String getTypeInsertString() { @@ -55,7 +55,7 @@ public class GenericTypeInsertPoint extends SourcePatchPoint { @Override public int compareTo(SourcePatchPoint arg0) { int ret = super.compareTo(arg0); - if(ret == 0)ret = -666;//Hack der dazu führt, dass GTIP vor anderen InsertTypes eingesetzt werden. + if(ret == 0)ret = -666;//Hack der dazu führt, dass GTIP vor anderen InsertTypes eingesetzt werden. return ret; } @@ -95,7 +95,7 @@ class GenericVarPatch { private Menge usedTPHs; /** - * Fügt eine generische Variable in Form eines Pairs an. + * Fügt eine generische Variable in Form eines Pairs an. * @param p */ public void add(Pair p){ @@ -112,10 +112,10 @@ class GenericVarPatch { } public String getInsertString(ResultSet rs){ - //Alle Generische Einsetzungen verwerfen, welche nicht benötigt werden: + //Alle Generische Einsetzungen verwerfen, welche nicht benötigt werden: /* - * Dies geht mit der momentanen Variante nur für die genericVarDeclarations. - * Es kann passieren, dass bei den genericVarExtendDeclarations extend-Verknüpfungen enthalten sind, + * Dies geht mit der momentanen Variante nur für die genericVarDeclarations. + * Es kann passieren, dass bei den genericVarExtendDeclarations extend-Verknüpfungen enthalten sind, * welche nicht im eingesetzten Typ auftauchen, aber dennoch notwendig sind. */ Menge tmpGenVars = new Menge<>(); @@ -126,7 +126,7 @@ class GenericVarPatch { } this.genericVarDeclarations = tmpGenVars; - //Hier sollten TPHs nicht aufgelöst sondern in Generische Variablen umgewandelt werden: + //Hier sollten TPHs nicht aufgelöst sondern in Generische Variablen umgewandelt werden: String ret = ""; Iterator it1 = this.genericVarDeclarations.iterator(); boolean bereitsVorhanden = false; @@ -194,7 +194,7 @@ class GenericVarExtendsDeclarationPatch { private Pair genericPair; /** - * Kontrolliert ob der T1 mit tph übereinstimmt im Constraint: T1 extends T2 + * Kontrolliert ob der T1 mit tph übereinstimmt im Constraint: T1 extends T2 * @param tph * @return */ diff --git a/src/de/dhbwstuttgart/typeinference/typedeployment/TypeInsertPoint.java b/src/de/dhbwstuttgart/typeinference/typedeployment/TypeInsertPoint.java index 2d4f0fc3a..6540249be 100644 --- a/src/de/dhbwstuttgart/typeinference/typedeployment/TypeInsertPoint.java +++ b/src/de/dhbwstuttgart/typeinference/typedeployment/TypeInsertPoint.java @@ -14,7 +14,7 @@ import de.dhbwstuttgart.typeinference.TypeInsertable; import de.dhbwstuttgart.typeinference.exceptions.DebugException; /** - * Stellt eine Einsetzungsmöglichkeit für einen Typ an einem (Typeable)Punkt im Syntaxbaum dar. + * Stellt eine Einsetzungsmöglichkeit für einen Typ an einem (Typeable)Punkt im Syntaxbaum dar. * Mehrere TypeInsertPoint's werden in einem TypInsertSet zusammengefasst. * @author janulrich * @@ -41,7 +41,7 @@ public class TypeInsertPoint extends SourcePatchPoint { } /** - * Setzt den Typ dieses TypeInsertPoint in den übergebenen Quelltext ein. + * Setzt den Typ dieses TypeInsertPoint in den übergebenen Quelltext ein. * @param fileContent - der Quelltext * @param additionalOffset - Falls mehrere Typen in einen Quellcode eingesetzet werden muss die Verschiebung der Offsets mit einbezogen werden. * @return @@ -59,7 +59,7 @@ public class TypeInsertPoint extends SourcePatchPoint { /** * - * @return Der Offset des TypeInsertPoints in dem geparsten Source für dessen Klasse er erstellt wurde. + * @return Der Offset des TypeInsertPoints in dem geparsten Source für dessen Klasse er erstellt wurde. */ public int getOffset(){ return this.getInsertPoint().getOffset(); @@ -79,7 +79,7 @@ public class TypeInsertPoint extends SourcePatchPoint { } /** - * @return - Der Punkt (Knoten) im Syntaxbaum, für den dieser TypeInsertPoint gilt. + * @return - Der Punkt (Knoten) im Syntaxbaum, für den dieser TypeInsertPoint gilt. */ public IItemWithOffset getInsertPoint(){ return this.point; diff --git a/src/de/dhbwstuttgart/typeinference/typedeployment/TypeInsertSet.java b/src/de/dhbwstuttgart/typeinference/typedeployment/TypeInsertSet.java index 7e7bb3a06..6510d90e2 100644 --- a/src/de/dhbwstuttgart/typeinference/typedeployment/TypeInsertSet.java +++ b/src/de/dhbwstuttgart/typeinference/typedeployment/TypeInsertSet.java @@ -19,9 +19,9 @@ import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.TypeInsertable; /** - * Bündelt ein Set von TypeInsertPoints, welche zu einem TypeInferenceResultSet gehören. - * Das TypeInsertSet löst zudem Abhängigkeiten auf. Wird eine Generische Variable eingesetzt, - * müssen alle mit ihr in Verbindung stehenden Typen ebenfalls eingesetzt werden. + * Bündelt ein Set von TypeInsertPoints, welche zu einem TypeInferenceResultSet gehören. + * Das TypeInsertSet löst zudem Abhängigkeiten auf. Wird eine Generische Variable eingesetzt, + * müssen alle mit ihr in Verbindung stehenden Typen ebenfalls eingesetzt werden. * @author janulrich * */ @@ -37,7 +37,7 @@ public class TypeInsertSet { } /** - * Fügt einen TypeInsertPoint dem TypeInsertSet hinzu. + * Fügt einen TypeInsertPoint dem TypeInsertSet hinzu. * @param typeInsertPoint * @return */ @@ -48,7 +48,7 @@ public class TypeInsertSet { } /** - * Fügt nur einen einzelnen TypeInsertPoint in fileContent ein. + * Fügt nur einen einzelnen TypeInsertPoint in fileContent ein. * @param tip * @param fileContent * @return @@ -60,7 +60,7 @@ public class TypeInsertSet { } /** - * Fügt einen einzelnen TypeInsertPoint einem TypePatchJob hinzu + * Fügt einen einzelnen TypeInsertPoint einem TypePatchJob hinzu * @param tip * @param tpj */ @@ -68,8 +68,8 @@ public class TypeInsertSet { /* * Ablauf: * 1. Alle TypePlaceholder im einzusetzenden Typ ermitteln. - * 2. Alle Constraints die mit diesen TPHs zusammenhängen ermitteln (Das kann möglicherweise wegfallen) - * 3. Alle TPHs, aus Schritt 1 und 2 zusammenfügen. + * 2. Alle Constraints die mit diesen TPHs zusammenhängen ermitteln (Das kann möglicherweise wegfallen) + * 3. Alle TPHs, aus Schritt 1 und 2 zusammenfügen. * 4. Kontrollieren, welche TPHs in dem InsertKontext noch nicht bekannt sind. * 5. Alle Unbekannten TPHs herausfiltern (von den Pairs nur TA2) * 6. Alle unbekannten TPHs + Pairs als GenericTypeInsertPoint deklarieren. @@ -102,7 +102,7 @@ public class TypeInsertSet { /* - // und Schritt 5: (Es werden nur die TPHs übernommen, welche noch nicht in den involvedTPHs vorkommen) + // und Schritt 5: (Es werden nur die TPHs übernommen, welche noch nicht in den involvedTPHs vorkommen) for(Pair pair : pairs)for(Type t : pair.getTypes())for(TypePlaceholder tph : t.getInvolvedTypePlaceholder()){ if(!allTPHs.contains(tph)){ allTPHs.add(tph); @@ -144,7 +144,7 @@ public class TypeInsertSet { } /** - * Fügt alle Typen dieses TypeInsertSets in den übergebenen Quellcode ein + * Fügt alle Typen dieses TypeInsertSets in den übergebenen Quellcode ein * @param fileContent * @return */ @@ -160,7 +160,7 @@ public class TypeInsertSet { /** * * @param node - * @return - null, falls kein InsertPoint für node vorhanden. + * @return - null, falls kein InsertPoint für node vorhanden. */ public TypeInsertPoint getInsertPointFor(TypeInsertable node){ for(TypeInsertPoint point : points){ @@ -179,14 +179,14 @@ public class TypeInsertSet { //Jeder TypeInsertPoint muss auch in equals vorkommen: if(!equals.points.contains(point)) return false; - //... aber nicht öfter als 1x : + //... aber nicht öfter als 1x : if(equals.points.lastIndexOf(point)!=equals.points.indexOf(point))return false; } return true; } /** - * Fügt TypeInsertPoints an + * Fügt TypeInsertPoints an * @param insertPoints */ public void add(Menge insertPoints) { diff --git a/src/de/dhbwstuttgart/typeinference/unify/CSubstitution.java b/src/de/dhbwstuttgart/typeinference/unify/CSubstitution.java index eef002332..fc9d6705b 100755 --- a/src/de/dhbwstuttgart/typeinference/unify/CSubstitution.java +++ b/src/de/dhbwstuttgart/typeinference/unify/CSubstitution.java @@ -30,7 +30,7 @@ import de.dhbwstuttgart.typeinference.Pair; * TypePlaceholder auf einen Substitutions-Typ ab. Instanzen dieser * Klasse werden in der Regel aus * Pair-Objekten erzeugt. - * @author J�rg B�uerle + * @author J�rg B�uerle * @version $Date: 2006/07/10 11:27:04 $ */ // ino.end @@ -74,7 +74,7 @@ public class CSubstitution // ino.method.CSubstitution.27021.body { if(!(unifier.TA1 instanceof TypePlaceholder)){ - throw new CTypeReconstructionException("Unifier enth�lt keinen Typeplaceholder",unifier.TA1); + throw new CTypeReconstructionException("Unifier enth�lt keinen Typeplaceholder",unifier.TA1); } m_TypeVar = (TypePlaceholder)unifier.TA1; m_Type = unifier.TA2; @@ -84,7 +84,7 @@ public class CSubstitution // ino.method.getType.27024.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @return Returns the Type. */ // ino.end @@ -99,7 +99,7 @@ public class CSubstitution // ino.method.setType.27027.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param type The Type to set. */ // ino.end @@ -114,7 +114,7 @@ public class CSubstitution // ino.method.getTypeVar.27030.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @return Returns the TypeVar. */ // ino.end @@ -129,7 +129,7 @@ public class CSubstitution // ino.method.setTypeVar.27033.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @param typeVar The TypeVar to set. */ // ino.end @@ -184,7 +184,7 @@ public class CSubstitution // ino.method.applyUnifier.27048.defdescription type=javadoc /** * Wendet den Unifier auf die rechte Seite dieser Substitution an. - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @param unifier */ // ino.end @@ -207,8 +207,8 @@ public class CSubstitution // ino.method.applySubstitution.27051.defdescription type=javadoc /** - * Wendet die �bergebene Substitution rekursiv auf den �bergebenen Typ an. - *
Author: J�rg B�uerle + * Wendet die �bergebene Substitution rekursiv auf den �bergebenen Typ an. + *
Author: J�rg B�uerle * @param type Der zu untersuchende Typ * @param unifierSub Die anzuwendende Substitution * @return Den ermittelnden Typ diff --git a/src/de/dhbwstuttgart/typeinference/unify/CSubstitutionGenVar.java b/src/de/dhbwstuttgart/typeinference/unify/CSubstitutionGenVar.java index e16769020..a93b6eec9 100755 --- a/src/de/dhbwstuttgart/typeinference/unify/CSubstitutionGenVar.java +++ b/src/de/dhbwstuttgart/typeinference/unify/CSubstitutionGenVar.java @@ -11,7 +11,7 @@ import de.dhbwstuttgart.syntaxtree.type.Type; * TypePlaceholder auf einen Substitutions-Typ ab. Instanzen dieser * Klasse werden in der Regel aus * Pair-Objekten erzeugt. - * @author Martin Pl�micke + * @author Martin Pl�micke * @version $Date: 2006/06/13 10:37:32 $ */ // ino.end @@ -45,7 +45,7 @@ public class CSubstitutionGenVar extends CSubstitution // ino.method.getTypeVar.27070.defdescription type=javadoc /** - * Author: J�rg B�uerle
+ * Author: J�rg B�uerle
* @return Returns the TypeVar. */ // ino.end diff --git a/src/de/dhbwstuttgart/typeinference/unify/CSubstitutionSet.java b/src/de/dhbwstuttgart/typeinference/unify/CSubstitutionSet.java index e10f62aac..481ca7cf5 100755 --- a/src/de/dhbwstuttgart/typeinference/unify/CSubstitutionSet.java +++ b/src/de/dhbwstuttgart/typeinference/unify/CSubstitutionSet.java @@ -12,7 +12,7 @@ import de.dhbwstuttgart.typeinference.Pair; // ino.class.CSubstitutionSet.27471.description type=javadoc /** - * @author J�rg B�uerle + * @author J�rg B�uerle * @version $Date: 2013/03/27 18:29:34 $ */ // ino.end @@ -71,7 +71,7 @@ public class CSubstitutionSet extends CVectorSet // ino.method.applyUnifier.27487.defdescription type=javadoc /** * Wendet den Unifier auf die rechten Seiten alle Substitutionen an. - *
Author: J�rg B�uerle + *
Author: J�rg B�uerle * @param unifier */ // ino.end diff --git a/src/de/dhbwstuttgart/typeinference/unify/CVectorSet.java b/src/de/dhbwstuttgart/typeinference/unify/CVectorSet.java index 96d451917..5fc6146ff 100755 --- a/src/de/dhbwstuttgart/typeinference/unify/CVectorSet.java +++ b/src/de/dhbwstuttgart/typeinference/unify/CVectorSet.java @@ -9,7 +9,7 @@ import de.dhbwstuttgart.typeinference.Menge; // ino.class.CMengeSet.27519.description type=javadoc /** - * @author J�rg B�uerle + * @author J�rg B�uerle * @version $Date: 2013/02/07 05:08:51 $ */ // ino.end @@ -85,9 +85,9 @@ public abstract class CVectorSet extends CSet // ino.end /** - * Fügt ein CMengeSet an! - * Es handelt sich um eine Vereinigung (es werden keine bereits vorhandenen Elemente übernommen) - * @param anotherSet Das hinzuzufügende CMengeSet (CSet wird ignoriert) + * Fügt ein CMengeSet an! + * Es handelt sich um eine Vereinigung (es werden keine bereits vorhandenen Elemente übernommen) + * @param anotherSet Das hinzuzufügende CMengeSet (CSet wird ignoriert) */ // ino.method.unite.27544.definition public void unite(CSet anotherSet) @@ -99,7 +99,7 @@ public abstract class CVectorSet extends CSet } CVectorSet MengeSet = (CVectorSet)anotherSet; - // Elemente der anderen Menge hinzuf�gen: + // Elemente der anderen Menge hinzuf�gen: Iterator it = MengeSet.getIterator(); while(it.hasNext()){ E elem = it.next(); diff --git a/src/de/dhbwstuttgart/typeinference/unify/FC_TTO.java b/src/de/dhbwstuttgart/typeinference/unify/FC_TTO.java index 708959aef..56cf9176e 100755 --- a/src/de/dhbwstuttgart/typeinference/unify/FC_TTO.java +++ b/src/de/dhbwstuttgart/typeinference/unify/FC_TTO.java @@ -11,8 +11,8 @@ import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; // ino.class.FC_TTO.28013.description type=javadoc /** - * Hilfsklasse f�r den Unifizierungsalgorithmus - * @author Martin Pl�micke + * Hilfsklasse f�r den Unifizierungsalgorithmus + * @author Martin Pl�micke * @version $Date: 2013/05/12 14:00:05 $ */ // ino.end diff --git a/src/de/dhbwstuttgart/typeinference/unify/Unify.java b/src/de/dhbwstuttgart/typeinference/unify/Unify.java index d10f9e419..858f5c353 100755 --- a/src/de/dhbwstuttgart/typeinference/unify/Unify.java +++ b/src/de/dhbwstuttgart/typeinference/unify/Unify.java @@ -21,7 +21,6 @@ import de.dhbwstuttgart.myexception.SCException; import de.dhbwstuttgart.parser.JavaClassName; import de.dhbwstuttgart.syntaxtree.Class; import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.CRefTypeSet; import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; import de.dhbwstuttgart.syntaxtree.type.FreshExtendsWildcardType; import de.dhbwstuttgart.syntaxtree.type.FreshSuperWildcardType; @@ -46,7 +45,7 @@ import de.dhbwstuttgart.typeinference.UndConstraint; // ino.class.Unify.28049.description type=javadoc /** * Implementierung des Unifizierungsalgorithmus - * @author Martin Pl�micke, Thomas Ott + * @author Martin Pl�micke, Thomas Ott * @version $Date: 2013/05/22 22:23:50 $ */ // ino.end @@ -116,7 +115,7 @@ public class Unify * Entweder alle Elemente in solved Form [A =. type, B =. type2, ...] * oder alle Elemente in der Form [A <. B, C <. D, ..., E in Typ A ...> werden keine ? extends-, ? super-Typen erzeugt + * Für den Argumenttype FunN<...> in Typ A ...> werden keine ? extends-, ? super-Typen erzeugt */ public static Menge> unify (Menge E, FC_TTO fc_tto) { @@ -140,7 +139,7 @@ public class Unify } else if(!(p.TA1 instanceof TypePlaceholder) && !(p.TA2 instanceof TypePlaceholder)) { - //Diese Paare können nicht mehr Unifiziert werden. fail. + //Diese Paare können nicht mehr Unifiziert werden. fail. inferencelog.debug("UNIFY FAIL:" + p.TA1 + " <. " + p.TA2 + " muesste mindestens einen TPH enthalten."); return new Menge>(); } @@ -152,8 +151,8 @@ public class Unify if(!Eq1.contains(p)) Eq2.add(p); } - /* Schritt 4, Teil 1: Einsammeln der Sets für das Kartesiche Produkt. - * Hier werden die Paare verglichen. Je nach Struktur können neue Paare erzeugt + /* Schritt 4, Teil 1: Einsammeln der Sets für das Kartesiche Produkt. + * Hier werden die Paare verglichen. Je nach Struktur können neue Paare erzeugt * werden, aus denen dann das kartesische Produkt gebildet wird.*/ Menge>> cartProduktSets = new Menge>>(); for(Pair p : Eq2) @@ -165,7 +164,7 @@ public class Unify p.TA2 = ((SuperWildcardType)p.TA2).get_SuperType(); //HIER GIBT ES EIN PROBLEM, WENN get_SuperType ein TPH LIEFERT PL 15-03-12 //Dann ist THP <. TPH in Eq2 anstatt in Eq1 - //Muesste mit folgendem if gelöst sein. PL 15-03-17 + //Muesste mit folgendem if gelöst sein. PL 15-03-17 if (p.TA2 instanceof TypePlaceholder) { Eq1.addElement(p); // Eq2.remove(p); @@ -216,7 +215,7 @@ public class Unify unifyErgs.add(unifyErgsElement.firstElement()); } } -// Nach dem Unifizieren wird das Ergebnis überprüft, und evtl. durch die FC entstandene TPHs werden gelöscht. +// Nach dem Unifizieren wird das Ergebnis überprüft, und evtl. durch die FC entstandene TPHs werden gelöscht. if((p_fc.TA2 instanceof RefType && !unifyErgs.isEmpty()) || p_fc.TA2.equals(p_TA2)) //Bedingung fuer Reflexifitaet BRAURHT MAN VERMUTLIRH NIRHT PL 07-08-05 { @@ -315,7 +314,7 @@ public class Unify } else if(p.OperatorSmaller() && p.TA2 instanceof GenericTypeVar) { - //Paar unverändert lassen, wenn eine GenericTypeVar ist + //Paar unverändert lassen, wenn eine GenericTypeVar ist Menge> setofsetofpairs = new Menge>(); Menge vTmp = new Menge(); vTmp.add(p); @@ -357,7 +356,7 @@ public class Unify unifyErgs.add(unifyErgsElement.firstElement()); } } - //Nach dem Unifizieren wird das Ergebnis überprüft, und evtl. durch die FC entstandene TPHs werden gelöscht. + //Nach dem Unifizieren wird das Ergebnis überprüft, und evtl. durch die FC entstandene TPHs werden gelöscht. if((p_fc.TA2 instanceof RefType && !unifyErgs.isEmpty()) || p_fc.TA2.equals(p_TA2)) //Bedingung fuer Reflexifitaet BRAURHT MAN VERMUTLIRH NIRHT PL 07-08-05 { @@ -532,7 +531,7 @@ public class Unify unifyErgs.add(unifyErgsElement.firstElement()); } } -// Nach dem Unifizieren wird das Ergebnis überprüft, und evtl. durch die FC entstandene TPHs werden gelöscht. +// Nach dem Unifizieren wird das Ergebnis überprüft, und evtl. durch die FC entstandene TPHs werden gelöscht. if((p_fc.TA2 instanceof RefType && !unifyErgs.isEmpty()) || p_fc.TA2.equals(p_TA1)) //Bedingung fuer Reflexifitaet BRAURHT MAN VERMUTLIRH NIRHT PL 07-08-05 { @@ -631,7 +630,7 @@ public class Unify } } //Schritt 4, Teil 2: Kartesisches Produkt bilden. - //TODO: Vor der Bildung des Karthesischen Produkts unmögliche Kombinationen ausfiltern + //TODO: Vor der Bildung des Karthesischen Produkts unmögliche Kombinationen ausfiltern //cartProduktSets kontrollieren: ConstraintsSet cSet = new ConstraintsSet(); for (Menge> vecvecpair : cartProduktSets){ @@ -688,7 +687,7 @@ public class Unify } //Schritt 5: Einsetzen der Subst Regel - //Hier werden die TPHs substituiert, und dann nach geänderten und nicht geänderten Sets sortiert. + //Hier werden die TPHs substituiert, und dann nach geänderten und nicht geänderten Sets sortiert. Menge> changedSets = new Menge>(); Menge> notChangedSets = new Menge>(); for(Menge vecpair : bigCartProductErg) @@ -742,29 +741,29 @@ public class Unify } } - //Eq2Set ist das eigentliche Ergebnis, dass zurückgegeben wird. + //Eq2Set ist das eigentliche Ergebnis, dass zurückgegeben wird. Menge> Eq2Set = new Menge>(); - //Schritt 6A: Beginnen mit Schritt 1 bei den geänderten. + //Schritt 6A: Beginnen mit Schritt 1 bei den geänderten. for(Menge vecpair : changedSets) { Menge> unifyErgs = unify(vecpair,fc_tto); - //Die Ergebnissvektoren sind schon im Schritt 7 von dem Rekursiven Aufruf geprüft worden. Sie können direkt eingefügt werden. + //Die Ergebnissvektoren sind schon im Schritt 7 von dem Rekursiven Aufruf geprüft worden. Sie können direkt eingefügt werden. Eq2Set.addAll(unifyErgs); } - //Schritt 6B Einfügen der nicht geänderten. + //Schritt 6B Einfügen der nicht geänderten. //Schritt 7: Aussortieren der falschen Sets /* * Durch die Rekursion in Schritt 6A sind die Ergebnisse, welche in 6A dazukommen auf jeden Fall korrekt. - * Es müssen nur die Ergebnisse aus 6B geprüft werden. + * Es müssen nur die Ergebnisse aus 6B geprüft werden. */ for(Menge vecpair : notChangedSets) { - //Überprüfen ob Menge in SolvedForm ist. + //Überprüfen ob Menge in SolvedForm ist. if(hasSolvedForm(vecpair)) //PL 13-05-22 hasSolvedForm angepasst { - //Überprüfung auf FreshTypeVars in den Typen + //Überprüfung auf FreshTypeVars in den Typen boolean foundFresh = false; for(Pair p : vecpair) { @@ -782,14 +781,14 @@ public class Unify } } - //Ergebnis zurückgeben. + //Ergebnis zurückgeben. return Eq2Set; } /** * PL 2014-10-25 * schnitt1 checkt ob die Typeplaceholders aus in den Elemeneten aus vars enthalten sind - * Rückgabe ist die Menge der Indizies von vars der Schnittmengen mit var nicht leer sind. + * Rückgabe ist die Menge der Indizies von vars der Schnittmengen mit var nicht leer sind. * @param var * @param vars * @param indexe @@ -840,10 +839,10 @@ public class Unify * Beispiel: unifyERgs = [[a = Integer, b = Number ]], test = Menge
* In diesm fall wird b = Number aus dem Menge entfernt. * - * Durch das Entfernen entstehen evtl. Identische Mengeen, diese werden auch gelöscht. + * Durch das Entfernen entstehen evtl. Identische Mengeen, diese werden auch gelöscht. * - * @param unifyErgs - Ergebnisse des Unify, die geprüft werden sollen. - * @param test - RefType gegen den geprüft werden soll. + * @param unifyErgs - Ergebnisse des Unify, die geprüft werden sollen. + * @param test - RefType gegen den geprüft werden soll. */ private static void testUnifyErg(Menge> unifyErgs, RefType test) { @@ -857,7 +856,7 @@ public class Unify vec--; } } - //Gleiche Mengeen löschen + //Gleiche Mengeen löschen for(int i = 0; i < unifyErgs.size(); i++) { Menge p1 = unifyErgs.elementAt(i); @@ -886,13 +885,13 @@ public class Unify } /** - * Diese Methode generiert einen Menge> wobei immer der übergebene TA1 vorne steht, und jeder Typ aus otherPairTypes hinten. + * Diese Methode generiert einen Menge> wobei immer der übergebene TA1 vorne steht, und jeder Typ aus otherPairTypes hinten. * Beispiel: otherPairTypes = [Integer, Number, Menge], TA1 = TPH a. * return: [[TPH a = Integer],[TPH a = Number],[TPH a = Menge]] * * @param TA1 - Der Typ der immer vorne steht * @param otherPairTypes - Die anderen Typen - * @return - Ein Menge> der alle Paare enthält. + * @return - Ein Menge> der alle Paare enthält. */ private static Menge> generateSetOfSetOfPair(Type TA1, Menge otherPairTypes) { @@ -993,7 +992,7 @@ public class Unify //Menge wird geclont, Elemente nicht //Menge Mub = (Menge)ub.clone(); - //Elemente die nicht kleinste obere Schranken sind, werden gel�scht + //Elemente die nicht kleinste obere Schranken sind, werden gel�scht //FUNKTIONIERT NICHT. SIEHE iftest.java PL 08-08-13 for (int i = 0; i < ub.size(); i++) { for (int j = 0; j < ub.size(); j++) { @@ -1049,7 +1048,7 @@ throws MatchException // ino.method.match.28064.body { //PL 05-01-22 - //gibt eine Substitution zur�ck, die den Variablen aus FCtype + //gibt eine Substitution zur�ck, die den Variablen aus FCtype //die Typterme aus tomatch zu ordnet. Es wird davon ausgegangen, dass //FCtype gegen tomatch gematcht werden kann. if (FCtype.getTypeName().equals(tomatch.getTypeName())) { @@ -1093,7 +1092,7 @@ throws MatchException // ino.method.sub_unify.28067.body { //PL 05-01-21 umbenannt in sub_unify - //Luar boolean useSubst hinzugefügt, um bei bedarf zu Steuern ob Subst Regel angewendet wird oder nicht. + //Luar boolean useSubst hinzugefügt, um bei bedarf zu Steuern ob Subst Regel angewendet wird oder nicht. // otth: Unifikation - Versuch 1 :-) //Menge FC = fc_tto.getFC(); @@ -1118,7 +1117,7 @@ throws MatchException inferencelog.debug("Ausgewaehltes Paar = " + P.toString() + ""); inferencelog.debug( "--------------------------------------------------"); - // Bei allen Erase erfolgt keine Kopie nach H, dadurch wird das Pair gelöscht. + // Bei allen Erase erfolgt keine Kopie nach H, dadurch wird das Pair gelöscht. //ERASE3 if( P.isEqual() && P.OperatorEqual() ) { @@ -1240,13 +1239,13 @@ throws MatchException } catch( SCException Ex ) { - inferencelog.debug("---- Unifikation nicht m�glich: Permutation fehlgeschlagen!"); + inferencelog.debug("---- Unifikation nicht m�glich: Permutation fehlgeschlagen!"); break; } } else { - inferencelog.info("---- Unifikation nicht m�glich: Anzahl der Parameter verschieden!"); + inferencelog.info("---- Unifikation nicht m�glich: Anzahl der Parameter verschieden!"); break; } } @@ -1297,13 +1296,13 @@ throws MatchException } catch( SCException Ex ) { - inferencelog.debug("---- Unifikation nicht m�glich: Permutation fehlgeschlagen!"); + inferencelog.debug("---- Unifikation nicht m�glich: Permutation fehlgeschlagen!"); break; } } else { - inferencelog.info("---- Unifikation nicht m�glich: Anzahl der Parameter verschieden!"); + inferencelog.info("---- Unifikation nicht m�glich: Anzahl der Parameter verschieden!"); break; } } @@ -1374,7 +1373,7 @@ throws MatchException RefType TA1 = null; RefType TA2 = null; - //Hier werden die RefTypes gefüllt. + //Hier werden die RefTypes gefüllt. if(P.TA1 instanceof RefType && P.TA2 instanceof RefType) { TA1 = (RefType)P.TA1; @@ -1396,7 +1395,7 @@ throws MatchException } catch( SCException Ex ) { - inferencelog.error("---- Unifikation nicht m�glich: Permutation fehlgeschlagen!"); + inferencelog.error("---- Unifikation nicht m�glich: Permutation fehlgeschlagen!"); break; } } @@ -1429,7 +1428,7 @@ throws MatchException } catch( SCException Ex ) { - inferencelog.debug("---- Unifikation nicht m�glich: Permutation fehlgeschlagen!"); + inferencelog.debug("---- Unifikation nicht m�glich: Permutation fehlgeschlagen!"); break; } } @@ -1449,7 +1448,7 @@ throws MatchException } catch( SCException Ex ) { - inferencelog.error("---- Unifikation nicht m�glich: Permutation fehlgeschlagen!"); + inferencelog.error("---- Unifikation nicht m�glich: Permutation fehlgeschlagen!"); break; } } @@ -1562,7 +1561,7 @@ throws MatchException } - // Subst --> noch zu pr�fen + // Subst --> noch zu pr�fen if( P.TA1 instanceof TypePlaceholder && P.OperatorEqual() && useSubst) //&& P.TA2 instanceof RefType ) //PL 05-02-09 P.TA@ duerfen auch TypePlaceholder sein /* BEISPIEL: @@ -1716,7 +1715,7 @@ throws MatchException /** * Implementiert die reduceEq Regel des sub_unify - * Da in reduce2 unnötigerweise pi verwendet wird (siehe Kommentar in reduce2), kann reduceEq einfach an reduce2 deligieren. + * Da in reduce2 unnötigerweise pi verwendet wird (siehe Kommentar in reduce2), kann reduceEq einfach an reduce2 deligieren. */ private static void reduceEq(Menge H, RefType TA1, RefType TA2, Menge TTO) throws SCException { @@ -1738,11 +1737,11 @@ throws MatchException inferencelog.debug("---- Parameteranzahl gleich"); inferencelog.debug("---- Reduce !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (" + L1.size() + ") neue(s) Paar(e)"); - // hier mu� die PERMUTATION erfolgen + // hier mu� die PERMUTATION erfolgen inferencelog.debug("---- PAARBILDUNG "); for( int k = 0; k < L1.size(); k++ ) { - // pi eig. bei reduce2 �berfl�ssig, schadet aber hoff. auch nicht :-) + // pi eig. bei reduce2 �berfl�ssig, schadet aber hoff. auch nicht :-) //luar 19-04-2007 durch das pi kann reduce2 auch als reduceEq verwendet werden. Wenn das pi durch k ersetzt wird, muss reduceEq entsprechend ausprogrammiert werden. Pair P2 = new Pair( L1.elementAt( pi(k, TA1.getTypeName(), TA2.getTypeName(), TTO ) ), L2.elementAt(k), PairOperator.Equal ); inferencelog.debug("---- Paar1: (" + (L1.elementAt( pi(k, TA1.getTypeName(), TA2.getTypeName(), TTO ) )).getName() + ", " + (L2.elementAt(k)).getName() + P2.OperatorEqual() + ")"); @@ -2041,7 +2040,7 @@ throws MatchException //LIEGT //erlegigt 06-04-28 Menge res = sub_unify(subunifypair, fc_tto); - if (hasSolvedForm(res)) { //PL 13-05-22: hasSolvedForm geaendert, es nicht geklärt, ob es funktioniert. + if (hasSolvedForm(res)) { //PL 13-05-22: hasSolvedForm geaendert, es nicht geklärt, ob es funktioniert. inferencelog.debug("HasSolvedForm: "); printMenge("RES_SMALLER", res, 6); ht = MengePair2SubstHashtableMengePair(res); @@ -2157,6 +2156,7 @@ throws MatchException } // ino.end + /* // ino.method.allGreater.29428.definition public static Menge allGreater (BoundedGenericTypeVar ty, Menge FC) // ino.end @@ -2174,6 +2174,7 @@ throws MatchException return ret.getMenge(); } // ino.end + */ // ino.method.allGreater.28094.definition public static Menge allGreater (RefType ty, Menge FC) @@ -2222,7 +2223,7 @@ throws MatchException { // otth: Funktion, die prueft, ob Paar( R1, R2 ) in FC liegt, // bzw. deren rechten Seiten, ohne die TypePlaceholder-Variablen zu beachten - // z.B. Menge w�re hier gleich wie Menge + // z.B. Menge w�re hier gleich wie Menge // z.B. FC = { ( AA <=* CC< DD > ) ,...} // R1 = AA @@ -2270,7 +2271,7 @@ throws MatchException { // otth: Funktion, die prueft, ob Paar( R1, \sigma(R2) ) in FC liegt, // bzw. deren rechten Seiten, ohne die TypePlaceholders zu beachten - // z.B. Menge w�re hier gleich wie Menge + // z.B. Menge w�re hier gleich wie Menge // z.B. FC = { ( AA <=* CC< DD > ) ,...} // R1 = AA @@ -2308,7 +2309,7 @@ throws MatchException Menge vp = sub_unify(R2vec, fc_tto); printMenge("VP", vp, 6); - if ( hasSolvedForm(vp) ) //PL 13-05-22: hasSolvedForm geaendert, es nicht geklärt, ob es funktioniert. + if ( hasSolvedForm(vp) ) //PL 13-05-22: hasSolvedForm geaendert, es nicht geklärt, ob es funktioniert. //if( isRXSimilarRY( RFC, R2 ) ) { inferencelog.debug("SIMILAR2"); @@ -2405,7 +2406,7 @@ throws MatchException if (o instanceof RefType) {//PL 05-02-09 eingefuegt siehe Methodenkopf if( bMitVorbedingung && isTVinRefType( a, (RefType)o ) ) { - inferencelog.debug(" Subst nicht m�glich, da TV " + a.getName() + " in RefType " + o.getName()); + inferencelog.debug(" Subst nicht m�glich, da TV " + a.getName() + " in RefType " + o.getName()); return false; } } @@ -2415,7 +2416,7 @@ throws MatchException { // Parameterliste durchgehen Menge vTemp = ((RefType)T).get_ParaList(); - Boolean ret = true; //EINGEFUEGT PL 14-01-16: Return darf erst am Ende zurückgegeben werden und nicht in den ifs + Boolean ret = true; //EINGEFUEGT PL 14-01-16: Return darf erst am Ende zurückgegeben werden und nicht in den ifs //sonst werden nicht alle Elemente der Forschleife durchlaufen for( int i = 0; i < vTemp.size(); i++ ) { @@ -2461,7 +2462,7 @@ throws MatchException return true; } } - //Wildcard ergänzt PL 14-12-05 + //Wildcard ergänzt PL 14-12-05 if ( T instanceof ExtendsWildcardType ) { Type Temp = ((ExtendsWildcardType) T).get_ExtendsType(); @@ -2476,7 +2477,7 @@ throws MatchException } } } - //Wildcard ergänzt PL 14-12-05 + //Wildcard ergänzt PL 14-12-05 if ( T instanceof SuperWildcardType ) { Type Temp = ((SuperWildcardType) T).get_SuperType(); @@ -2557,7 +2558,7 @@ throws MatchException { - // otth: Funktion pr�ft, ob Klasse 'Basis' von Klasse 'Mutter' direkt oder indirekt abgeleitet ist + // otth: Funktion pr�ft, ob Klasse 'Basis' von Klasse 'Mutter' direkt oder indirekt abgeleitet ist // Basisklasse suchen Menge tto = fc_tto.getTTO(); @@ -2581,9 +2582,9 @@ throws MatchException } /* - * Hier wird überprüft ob in der Paraliste ein anderes Element als ein GTV drinne ist. - * Sollte ein anderes Element gefunden werden ist Reduce nicht möglich. - * Beispiel: Matrix <. Menge> ist nur durch adapt möglich. + * Hier wird überprüft ob in der Paraliste ein anderes Element als ein GTV drinne ist. + * Sollte ein anderes Element gefunden werden ist Reduce nicht möglich. + * Beispiel: Matrix <. Menge> ist nur durch adapt möglich. */ for(Type t : s) { @@ -2717,7 +2718,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: if( n >= vD.size() ) throw F; - // Permuationswert f�r 'n' berechnen + // Permuationswert f�r 'n' berechnen Type TV = (Type)vD.elementAt(n); int nPos = -1; @@ -2749,12 +2750,12 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: // ino.method.printMengeUnifier.28121.body { //PL 05-01-21 - //Ruft f�r eine Menge von Unifikatoren die Methode + //Ruft f�r eine Menge von Unifikatoren die Methode //printMenge auf for (int i = 0; i < Uni.size(); i++) { inferencelog.debug((i+1) + ". Unifier"); printMenge(strMenge, Uni.elementAt(i), nDebug); - if( hasSolvedForm( Uni.elementAt(i) ) ) { //PL 13-05-22: hasSolvedForm geaendert, es nicht geklärt, ob es funktioniert. + if( hasSolvedForm( Uni.elementAt(i) ) ) { //PL 13-05-22: hasSolvedForm geaendert, es nicht geklärt, ob es funktioniert. inferencelog.debug((i+1) + ". Unifier ist in 'Solved form'!\n"); } else { @@ -2781,7 +2782,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: } for( int tt = 0; tt < E.size(); tt++ ) { - //luar 13-03-07 If Else Block gelöscht, da sinnlos. + //luar 13-03-07 If Else Block gelöscht, da sinnlos. if( tt > 0 ) strTemp = strTemp + ",\n" + E.elementAt(tt).toString(); else @@ -2874,7 +2875,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: /** * Implementiert die CaptureConversion. Wendet diese auf jeden Typ im Menge TVec an. - * Rückgabe ist ein ErgebnisMenge + * Rückgabe ist ein ErgebnisMenge */ private static Menge CaptureConversion(Menge TVec, FC_TTO fc_tto) { @@ -2882,7 +2883,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: for(ObjectType t : TVec) { ObjectType ccT = (ObjectType)CaptureConversion(t,fc_tto); - //CaptureConversion kann nur ObjectTypes zurückliefern, laesst sich aber nicht zurziehen. + //CaptureConversion kann nur ObjectTypes zurückliefern, laesst sich aber nicht zurziehen. if(ccT != null) retVec.add(ccT); } @@ -2892,7 +2893,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: /** * Erzeugt die CaptureConversion von einem Typ. * - * @param T - Ãœbergebener Typ, von welchem die CaptureConversion gemacht werden soll. + * @param T - Übergebener Typ, von welchem die CaptureConversion gemacht werden soll. * @param fc_tto - Hilfsklasse. * @return - CC(T) */ @@ -2927,7 +2928,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: if(t instanceof WildcardType) { FreshWildcardType fwcT = ((WildcardType)t).GetFreshWildcardType(); - //Wenn beim Original Typ an der Stelle eine BoundedGenericTypeVar ist werden die Bounds zu der Wildcard hinzugefügt. + //Wenn beim Original Typ an der Stelle eine BoundedGenericTypeVar ist werden die Bounds zu der Wildcard hinzugefügt. if(cl.get_ParaList().elementAt(i) instanceof BoundedGenericTypeVar) { BoundedGenericTypeVar bgv = (BoundedGenericTypeVar)cl.get_ParaList().elementAt(i); @@ -2941,7 +2942,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: } refT.set_ParaList(ccTypes); } - //Wenn eine CaptureConversion durchgeführt wurde den Typ zurückgeben. + //Wenn eine CaptureConversion durchgeführt wurde den Typ zurückgeben. if(ccDone) return refT; else @@ -2958,13 +2959,13 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: //Von hier an Greater implementierung 28-03-07 /** - * Der Komplette Ablauf von greater und was die einzelnen Teilschritte machen kann anhand von Aktivitätsdiagrammen - * im Inovator Projekt, oder in der Studienarbeit Arne Lüdtke, 2007 nachgelesen werden. + * Der Komplette Ablauf von greater und was die einzelnen Teilschritte machen kann anhand von Aktivitätsdiagrammen + * im Inovator Projekt, oder in der Studienarbeit Arne Lüdtke, 2007 nachgelesen werden. */ /** - * Erzeugt alle Typen die greater sind als T. Gibt diese zurück. - * Für den Argumenttype FunN<...> in Typ A ...> werden keine ? extends-, ? super-Typen erzeugt + * Erzeugt alle Typen die greater sind als T. Gibt diese zurück. + * Für den Argumenttype FunN<...> in Typ A ...> werden keine ? extends-, ? super-Typen erzeugt */ private static Menge greater(ObjectType T, FC_TTO fc_tto) //an die Aenderungen im Skript anpassen 07-11-03 @@ -2989,22 +2990,22 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: //greater1 Erzeugen Menge greater1Erg = greater1(T,fc_tto); - //Reflexivität, deshalb T hinzufügen. + //Reflexivität, deshalb T hinzufügen. if(!greater1Erg.contains(T)) greater1Erg.add(T); - //Falls in greater1Erg Typen doppelt vorhanden sind werden diese nicht in retVec übernommen. + //Falls in greater1Erg Typen doppelt vorhanden sind werden diese nicht in retVec übernommen. for(ObjectType t : greater1Erg) if(!retVec.contains(t)) retVec.add(t); - //Ergebnis von greater1 an greater2 durchreichen, ERgebnisse in retVec einfügen + //Ergebnis von greater1 an greater2 durchreichen, ERgebnisse in retVec einfügen Menge greater2Erg = greater2(greater1Erg,fc_tto); for(ObjectType t : greater2Erg) if(!retVec.contains(t)) retVec.add(t); - //Ergebnis von greater2 an greater3 durchreichen, ERgebnisse in retVec einfügen + //Ergebnis von greater2 an greater3 durchreichen, ERgebnisse in retVec einfügen Menge greater3Erg = greater3(greater2Erg,fc_tto); for(ObjectType t : greater3Erg) if(!retVec.contains(t)) @@ -3015,7 +3016,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: /** * greater1 Schritt von greater. - * Für den Argumenttype FunN<...> in Typ A ...> werden keine ? extends-, ? super-Typen erzeugt + * Für den Argumenttype FunN<...> in Typ A ...> werden keine ? extends-, ? super-Typen erzeugt */ private static Menge greater1(ObjectType T, FC_TTO fc_tto) { @@ -3053,8 +3054,8 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: } /** - * Ãœberladung der Funktion cartProductType, damit der Programmierer beim ersten Aufruf nicht den 2. Parameter - * welcher für die rekursion erforderlich ist mit übergeben muss. + * Überladung der Funktion cartProductType, damit der Programmierer beim ersten Aufruf nicht den 2. Parameter + * welcher für die rekursion erforderlich ist mit übergeben muss. */ private static Menge> cartProductType (Menge> vec) { @@ -3063,7 +3064,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: /** * Erzeugt das Kartesische Product von mehreren Mengeen von Typen. - * Für den Startaufruf ist der index = 0. Danach ruft sich cartProductType rekursiv auf. + * Für den Startaufruf ist der index = 0. Danach ruft sich cartProductType rekursiv auf. */ private static Menge> cartProductType (Menge> vec, int index) { @@ -3098,8 +3099,8 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: } /** - * Ãœberladung der Funktion cartProductPair, damit der Programmierer beim ersten Aufruf nicht den 2. Parameter - * welcher für die rekursion erforderlich ist mit übergeben muss. + * Überladung der Funktion cartProductPair, damit der Programmierer beim ersten Aufruf nicht den 2. Parameter + * welcher für die rekursion erforderlich ist mit übergeben muss. */ private static Menge> cartProductPair (Menge> vec) { @@ -3108,7 +3109,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: /** * Erzeugt das Kartesische Product von mehreren Mengeen von Paaren. - * Für den Startaufruf ist der index = 0. Danach ruft sich cartProductPair rekursiv auf. + * Für den Startaufruf ist der index = 0. Danach ruft sich cartProductPair rekursiv auf. */ private static Menge> cartProductPair (Menge> vec, int index) { @@ -3168,7 +3169,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: /** * greaterArg Schritt von greater - * Für den Argumenttype FunN<...> werden keine ? extends-, ? super-Typen erzeugt + * Für den Argumenttype FunN<...> werden keine ? extends-, ? super-Typen erzeugt */ private static Menge greaterArg(Type T, FC_TTO fc_tto) { @@ -3224,7 +3225,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: return new Menge(); */ - //Diese Abfrage sorgt für grArg(a) = {a} //Luar 07-07-31 + //Diese Abfrage sorgt für grArg(a) = {a} //Luar 07-07-31 else if(T instanceof TypePlaceholder) retVec.add(T); //Diese Abfrage verhindert, dass bei FunN Wildcard-Typen generiert werden //PL 13-05-22 @@ -3253,7 +3254,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: Menge retVec = new Menge(); /* * luar 02-05-07: Beschreibung der Funktion: - * Für Jeden Typ aus greater1 durch die FC laufen, und auf der Linken seite einen Match versuchen. + * Für Jeden Typ aus greater1 durch die FC laufen, und auf der Linken seite einen Match versuchen. * Wenn das Funktioniert, dann ist der Typ auf der rechten Seite auch greater. * */ Hashtable ht = new Hashtable(); @@ -3278,7 +3279,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: RefType TA2neu = ((RefType)p.TA2).clone(); SubstHashtableGeneric(TA2neu,ht); - //TA2neu ist greater als T. Einfügen in retVec + //TA2neu ist greater als T. Einfügen in retVec if(!retVec.contains(TA2neu)) retVec.add(TA2neu); } @@ -3308,12 +3309,12 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: //Von hier an Smaller implementierung luar 28-03-07 /** - * Der Komplette Ablauf von smaller und was die einzelnen Teilschritte machen kann anhand von Aktivitätsdiagrammen - * im Inovator Projekt, oder in der Studienarbeit Arne Lüdtke, 2007 nachgelesen werden. + * Der Komplette Ablauf von smaller und was die einzelnen Teilschritte machen kann anhand von Aktivitätsdiagrammen + * im Inovator Projekt, oder in der Studienarbeit Arne Lüdtke, 2007 nachgelesen werden. */ /** - * Erzeugt alle Typen die smaller sind als T. Gibt diese zurück. + * Erzeugt alle Typen die smaller sind als T. Gibt diese zurück. */ private static Menge smaller(ObjectType T, FC_TTO fc_tto) //an die Aenderungen im Skript anpassen 07-11-03 @@ -3349,18 +3350,18 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: if(!smaller12Erg.contains(T)) smaller12Erg.add(T); - //Ergebnise in retVec einfügen. Doppelte werden gelöscht. + //Ergebnise in retVec einfügen. Doppelte werden gelöscht. for(ObjectType t : smaller12Erg) if(!retVec.contains(t)) retVec.add(t); - //Ergebnis von smaller1 und smaller2 an smaller3 weitergeben, Ergebnisse einfügen. + //Ergebnis von smaller1 und smaller2 an smaller3 weitergeben, Ergebnisse einfügen. Menge smaller3Erg = smaller3(smaller12Erg,fc_tto); for(ObjectType t : smaller3Erg) if(!retVec.contains(t)) retVec.add(t); - //Ergebnisse von smaller3 an smaller4 weitergeben, Ergebnisse einfügen. + //Ergebnisse von smaller3 an smaller4 weitergeben, Ergebnisse einfügen. Menge smaller4Erg = smaller4(smaller3Erg); for(ObjectType t : smaller4Erg) if(!retVec.contains(t)) @@ -3409,7 +3410,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: Menge retVec = new Menge(); if(T instanceof ExtendsWildcardType) { - //Für eine ExtendsWildcard rekursiv smaller0 aufrufen, und neue Wildcards erzeugen. + //Für eine ExtendsWildcard rekursiv smaller0 aufrufen, und neue Wildcards erzeugen. ExtendsWildcardType exT = (ExtendsWildcardType)T; Menge smallerTypes = smaller0(exT.get_ExtendsType(),fc_tto); for(ObjectType t : smallerTypes) @@ -3420,7 +3421,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: } else if(T instanceof SuperWildcardType) { - //Für eine SuperWildcard rekursiv greater0 aufrufen, unr neue Wildcards erzeugen. + //Für eine SuperWildcard rekursiv greater0 aufrufen, unr neue Wildcards erzeugen. SuperWildcardType suT = (SuperWildcardType)T; Menge greaterTypes = greater0(suT.get_SuperType(),fc_tto); for(ObjectType t : greaterTypes) @@ -3459,7 +3460,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: Menge retVec = new Menge(); /* * luar 02-05-07: Beschreibung der Funktion: - * Für Jeden Typ aus Smaller12 durch die FC laufen, und auf der Rechten seite einen Match versuchen. + * Für Jeden Typ aus Smaller12 durch die FC laufen, und auf der Rechten seite einen Match versuchen. * Wenn das Funktioniert, dann ist der Typ auf der linken Seite auch smaller. * */ Hashtable ht = new Hashtable(); @@ -3482,7 +3483,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: //Macht hat funktioniert. In Linker Seite Typen substituieren RefType TA1neu = ((RefType)p.TA1).clone(); SubstHashtableGeneric(TA1neu,ht); - //TA1neu ist smaller als T. Einfügen in retVec + //TA1neu ist smaller als T. Einfügen in retVec if(!retVec.contains(TA1neu)) retVec.add(TA1neu); } @@ -3532,12 +3533,12 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: } /** - * Gibt True zurück, wenn T eine FreshWildcard ist, oder im Falle eines RefTypes oder WildcardTypes eine FreshWildcard enthält. + * Gibt True zurück, wenn T eine FreshWildcard ist, oder im Falle eines RefTypes oder WildcardTypes eine FreshWildcard enthält. */ private static boolean DelFreshWildcardTypeVar(Type T) { //luar 29-05-2007 - //Ãœberprüft rekursiv ob in dem RefType ein FreshWildcardType enthalten ist. + //Überprüft rekursiv ob in dem RefType ein FreshWildcardType enthalten ist. if(T instanceof RefType) { RefType refT = (RefType)T; @@ -3546,7 +3547,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.: if(DelFreshWildcardTypeVar(t)) return true; } - //Im Falle einer Wildcard, Typen aus der WC rausnehmen und diesen rekursiv prüfen. + //Im Falle einer Wildcard, Typen aus der WC rausnehmen und diesen rekursiv prüfen. if(T instanceof ExtendsWildcardType) return DelFreshWildcardTypeVar(((ExtendsWildcardType)T).get_ExtendsType()); diff --git a/test/bytecode/BytecodeTester.java b/test/bytecode/BytecodeTester.java deleted file mode 100644 index a8ed0eaf2..000000000 --- a/test/bytecode/BytecodeTester.java +++ /dev/null @@ -1,45 +0,0 @@ -package bytecode; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Paths; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.bytecode.ClassFile; -import de.dhbwstuttgart.core.MyCompiler; -import de.dhbwstuttgart.core.MyCompilerAPI; -import de.dhbwstuttgart.myexception.JVMCodeException; -import junit.framework.TestCase; - -public class BytecodeTester{ - - //Web-Disassembler: http://hakurai.github.io/javap.js/web/ - - public static final String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; - - public static Menge testCodegen(String sourceCode){ - MyCompilerAPI compiler = MyCompiler.getAPI(); - compiler.parse(sourceCode); - Menge ret = null; - try { - ret = compiler.codeGeneration(null); - } catch (NullPointerException | JVMCodeException e) { - e.printStackTrace(); - TestCase.fail(); - } - TestCase.assertTrue("Es wurden keine ClassFiles generiert",ret != null && ret.size()>0); - return ret; - } - - public static Menge readFileAndTestCodegen(String fileName) throws IOException{ - return testCodegen(getFileContent(rootDirectory + fileName)); - } - - private static String getFileContent(String path)throws IOException - { - byte[] encoded = Files.readAllBytes(Paths.get(path)); - return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(encoded)).toString(); - } -} diff --git a/test/bytecode/EmptyClassTest.java b/test/bytecode/EmptyClassTest.java deleted file mode 100644 index c31f510ad..000000000 --- a/test/bytecode/EmptyClassTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package bytecode; - -import de.dhbwstuttgart.typeinference.Menge; - -import junit.framework.TestCase; - -import org.junit.Test; - -import de.dhbwstuttgart.core.MyCompiler; -import de.dhbwstuttgart.core.MyCompilerAPI; -import de.dhbwstuttgart.myexception.JVMCodeException; -import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; - -public class EmptyClassTest extends TestCase { - - @Test - public void test(){ - BytecodeTester.testCodegen("class EmptyClass{}"); - } - -} diff --git a/test/bytecode/FieldTest.jav b/test/bytecode/FieldTest.jav deleted file mode 100644 index 57f1614ab..000000000 --- a/test/bytecode/FieldTest.jav +++ /dev/null @@ -1,6 +0,0 @@ -class FieldTest{ - String var; - String methode(String para1){ - return var; - } -} \ No newline at end of file diff --git a/test/bytecode/GeneralTest.java b/test/bytecode/GeneralTest.java deleted file mode 100644 index e9c9c12ea..000000000 --- a/test/bytecode/GeneralTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package bytecode; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import de.dhbwstuttgart.typeinference.Menge; - -import junit.framework.TestCase; - -import org.junit.Test; - -import de.dhbwstuttgart.bytecode.ClassFile; -import sun.misc.IOUtils; - -public class GeneralTest extends TestCase{ - @Test - public void test(){ - Menge cfs = null; - try { - cfs = BytecodeTester.readFileAndTestCodegen("FieldTest.jav"); - } catch (IOException e) { - e.printStackTrace(); - fail(); - } - assertTrue("Es darf nur eine ClassFile erstellt werden", cfs.size()==1); - try { - FileOutputStream output = new FileOutputStream(new File(BytecodeTester.rootDirectory+"FieldTest.class")); - output.write(cfs.firstElement().getBytecode()); - } catch (IOException e) { - e.printStackTrace(); - fail(); - } - } - -} diff --git a/test/bytecode/MethodTest.java b/test/bytecode/MethodTest.java deleted file mode 100644 index 6df9d4199..000000000 --- a/test/bytecode/MethodTest.java +++ /dev/null @@ -1,12 +0,0 @@ -package bytecode; - -import org.junit.Test; - -public class MethodTest { - - @Test - public void test(){ - BytecodeTester.testCodegen("class MethodTest{ public void method(){} }"); - } - -} diff --git a/test/mycompiler/test/AllTests.java b/test/mycompiler/test/AllTests.java deleted file mode 100755 index c4e1235ad..000000000 --- a/test/mycompiler/test/AllTests.java +++ /dev/null @@ -1,41 +0,0 @@ -package mycompiler.test; - -import junit.framework.Test; -import junit.framework.TestSuite; -import mycompiler.test.blocks.AllTestsBlocks; -import mycompiler.test.complexTypes.AllTestsComplexTypes; -import mycompiler.test.generics.AllTestsGenerics; -import mycompiler.test.inferenceByCharacteristic.AllTestsInferenceByCharacteristic; -import mycompiler.test.javaConcepts.inheritance.AllTestsInheritance; -import mycompiler.test.javaConcepts.overloading.AllTestsOverloading; -import mycompiler.test.javaConcepts.staticAccess.AllTestsStaticAccess; -import mycompiler.test.operators.AllTestsOperators; -import mycompiler.test.primitiveTypes.AllTestsPrimitiveTypes; -import mycompiler.test.trivial.AllTestsTrivial; - -import de.dhbwstuttgart.logger.xml.DOMConfigurator; - -public class AllTests { - - - public static Test suite() { -// DOMConfigurator.configure("test/log4jTesting.xml"); -// DOMConfigurator.configure("log4j.xml"); - TestSuite suite = new TestSuite("Test for mycompiler.test"); - //$JUnit-BEGIN$ - suite.addTest(AllTestsBlocks.suite()); - suite.addTest(AllTestsInferenceByCharacteristic.suite()); - suite.addTest(AllTestsInheritance.suite()); - suite.addTest(AllTestsOverloading.suite()); - suite.addTest(AllTestsOperators.suite()); - suite.addTest(AllTestsPrimitiveTypes.suite()); - suite.addTest(AllTestsTrivial.suite()); - suite.addTest(AllTestsGenerics.suite()); - suite.addTest(AllTestsStaticAccess.suite()); - suite.addTest(AllTestsComplexTypes.suite()); - - //$JUnit-END$ - return suite; - } - -} diff --git a/test/mycompiler/test/LambdaInterferenzTest.java b/test/mycompiler/test/LambdaInterferenzTest.java deleted file mode 100755 index 7fb0ac2d0..000000000 --- a/test/mycompiler/test/LambdaInterferenzTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package mycompiler.test; - -import junit.framework.Test; -import junit.framework.TestSuite; - - -public class LambdaInterferenzTest { - - public static Test suite() { - - TestSuite suite = new TestSuite("Test for 'Complete Typeinference in Java 8'"); - - return suite; - } -} diff --git a/test/mycompiler/test/Log4jWrapper.java b/test/mycompiler/test/Log4jWrapper.java deleted file mode 100755 index 715dedb27..000000000 --- a/test/mycompiler/test/Log4jWrapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package mycompiler.test; - -import de.dhbwstuttgart.logger.xml.DOMConfigurator; - -/** - * needed to assure one-time execution of configure script - * @author tom - * - */ -public class Log4jWrapper { - - private static Log4jWrapper instance=null; - private static boolean log4jInit=false; - - private Log4jWrapper() { - - } - - public static Log4jWrapper getInstance() { - if (instance==null) { - instance=new Log4jWrapper(); - } - return instance; - } - - public void configureLog4j() { - if (!this.log4jInit){ - DOMConfigurator.configure("test/log4jTesting.xml"); - DOMConfigurator.configure("log4j.xml"); - this.log4jInit=true; - } - - } - -} diff --git a/test/mycompiler/test/blocks/AllTestsBlocks.java b/test/mycompiler/test/blocks/AllTestsBlocks.java deleted file mode 100755 index 7e07e9221..000000000 --- a/test/mycompiler/test/blocks/AllTestsBlocks.java +++ /dev/null @@ -1,23 +0,0 @@ -package mycompiler.test.blocks; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsBlocks { - - public static Test suite() { - TestSuite suite = new TestSuite("Test for mycompiler.test.blocks"); - //$JUnit-BEGIN$ - suite.addTestSuite(TestWhileStmt.class); - suite.addTestSuite(TestUninitializedVariable.class); - suite.addTestSuite(TestForStmt.class); - suite.addTestSuite(TestInferenceAcrossBlocks.class); - suite.addTestSuite(TestIfStmt.class); - suite.addTestSuite(TestSimpleVariable.class); - suite.addTestSuite(TestSimpleBlocks.class); - suite.addTestSuite(TestUndeterminedReturnNegative.class); - //$JUnit-END$ - return suite; - } - -} diff --git a/test/mycompiler/test/blocks/TestForStmt.jav b/test/mycompiler/test/blocks/TestForStmt.jav deleted file mode 100755 index a12ba6c8e..000000000 --- a/test/mycompiler/test/blocks/TestForStmt.jav +++ /dev/null @@ -1,32 +0,0 @@ - -public class TestForStmt { - - public void m1() { - - i; - for (i=0;i<5;i++) { - - } - } - - public void m2() { - i; - for (i=0;i<5;i++) { - j; - j="abc"; - } - j; - j=3; - } - - public m3() { - i; - for (i=0;i<5;i++) { - j; - for (j=0;j<5;j++) { - return i==j; - } - } - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestForStmt.java b/test/mycompiler/test/blocks/TestForStmt.java deleted file mode 100755 index 587992cca..000000000 --- a/test/mycompiler/test/blocks/TestForStmt.java +++ /dev/null @@ -1,75 +0,0 @@ -package mycompiler.test.blocks; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.BlockExpect; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 18-04-08 - * @author - * - * tests correct identification of for-stmt - */ - -public class TestForStmt extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestForStmt"; - private final static String JAVPATH="test/mycompiler/test/blocks/"; - - public TestForStmt(String name) { - super(name,TestForStmt.JAVPATH+TestForStmt.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testForStmt = new ClassExpect(TestForStmt.TESTEDCLASSNAME); - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("void",-1)); - VarExpect var1 = new VarExpect("i",new RefType("java.lang.Integer",-1)); - //short not inferenced - //var1.addExpectedType(new RefType("java.lang.Short",-1)); - m1.getBlock().addLocalVar(var1); - - MethodExpect m2 = new MethodExpect("m2", new RefType("void",-1)); - VarExpect var20 = new VarExpect("i",new RefType("java.lang.Integer",-1)); - //short not inferenced - //var20.addExpectedType(new RefType("java.lang.Short",-1)); - VarExpect var21 = new VarExpect("j",new RefType("java.lang.String",-1)); - VarExpect var22 = new VarExpect("j",new RefType("java.lang.Integer",-1)); - //short not inferenced - //var22.addExpectedType(new RefType("java.lang.Short",-1)); - //var22.addExpectedType(new RefType("java.lang.Long",-1)); - m2.getBlock().addLocalVar(var20); - BlockExpect for2 = new BlockExpect("1","1"); - for2.addLocalVar(var21); - m2.getBlock().addBlock(for2); - m2.getBlock().addLocalVar(var22); - - MethodExpect m3 = new MethodExpect("m3", new RefType("java.lang.Boolean",-1)); - VarExpect var30 = new VarExpect("i",new RefType("java.lang.Integer",-1)); - //short not inferenced - //var30.addExpectedType(new RefType("java.lang.Short",-1)); - VarExpect var31 = new VarExpect("j",new RefType("java.lang.Integer",-1)); - //short not inferenced - //var31.addExpectedType(new RefType("java.lang.Short",-1)); - //var31.addExpectedType(new RefType("java.lang.Long",-1)); - m3.getBlock().addLocalVar(var30); - BlockExpect for3 = new BlockExpect("1","1"); - for3.addLocalVar(var31); - m3.getBlock().addBlock(for3); - m3.getBlock().addLocalVar(var22); - - - testForStmt.addMethod(m1); - testForStmt.addMethod(m2); - testForStmt.addMethod(m3); - return new Expectation(testForStmt); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestIfStmt.jav b/test/mycompiler/test/blocks/TestIfStmt.jav deleted file mode 100755 index de6e7e120..000000000 --- a/test/mycompiler/test/blocks/TestIfStmt.jav +++ /dev/null @@ -1,27 +0,0 @@ -import de.dhbwstuttgart.typeinference.Menge; - -public class TestIfStmt { - - public m1() { - a; - if (a) { - return a; - } - else - return false; - } - - public m2() { - a; - c; - a = new Menge(); - if (a.isEmpty()) { - c="empty"; - } - else if (a.size()==1) { - c="almost empty"; - } - else - return a; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestIfStmt.java b/test/mycompiler/test/blocks/TestIfStmt.java deleted file mode 100755 index 442bd0f04..000000000 --- a/test/mycompiler/test/blocks/TestIfStmt.java +++ /dev/null @@ -1,74 +0,0 @@ -package mycompiler.test.blocks; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 18-04-08 - * @author - * - * this test checks correct identification of if-stmt and block usage - */ - -public class TestIfStmt extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestIfStmt"; - private final static String JAVPATH="test/mycompiler/test/blocks/"; - - public TestIfStmt(String name) { - super(name,TestIfStmt.JAVPATH+TestIfStmt.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testIfStmt = new ClassExpect(TestIfStmt.TESTEDCLASSNAME); - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("java.lang.Boolean",-1)); - VarExpect var1 = new VarExpect("a",new RefType("java.lang.Boolean",-1)); - //short not inferenced - //var1.addExpectedType(new RefType("java.lang.Short",-1)); - m1.getBlock().addLocalVar(var1); - - Menge ret = new Menge(); - ret.add(new RefType("java.lang.Integer",-1)); - MethodExpect m2 = new MethodExpect("m2",new RefType("de.dhbwstuttgart.typeinference.Menge",ret,-1)); - - Menge ret1 = new Menge(); - ret1.add(new ExtendsWildcardType(-1,new RefType("java.lang.Integer",-1))); - Menge ret2 = new Menge(); - ret2.add(new SuperWildcardType(-1,new RefType("java.lang.Integer",-1))); - m2.addReturntype(new RefType("de.dhbwstuttgart.typeinference.Menge",ret1,-1)); - m2.addReturntype(new RefType("de.dhbwstuttgart.typeinference.Menge",ret2,-1)); - - Menge a_param = new Menge(); - a_param.add(new RefType("java.lang.Integer",-1)); - VarExpect var21 = new VarExpect("a",new RefType("de.dhbwstuttgart.typeinference.Menge",a_param,-1)); - Menge a_param1 = new Menge(); - a_param1.add(new ExtendsWildcardType(-1,new RefType("java.lang.Integer",-1))); - Menge a_param2 = new Menge(); - a_param2.add(new SuperWildcardType(-1,new RefType("java.lang.Integer",-1))); - var21.addExpectedType(new RefType("de.dhbwstuttgart.typeinference.Menge",a_param1,-1)); - var21.addExpectedType(new RefType("de.dhbwstuttgart.typeinference.Menge",a_param2,-1)); - - VarExpect var22 = new VarExpect("c",new RefType("java.lang.String",-1)); - - m2.getBlock().addLocalVar(var21); - m2.getBlock().addLocalVar(var22); - - testIfStmt.addMethod(m1); - testIfStmt.addMethod(m2); - return new Expectation(testIfStmt); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestInferenceAcrossBlocks.jav b/test/mycompiler/test/blocks/TestInferenceAcrossBlocks.jav deleted file mode 100755 index 508f0aaff..000000000 --- a/test/mycompiler/test/blocks/TestInferenceAcrossBlocks.jav +++ /dev/null @@ -1,12 +0,0 @@ -public class TestInferenceAcrossBlocks{ - - public m(a){ - if(a==true){ - return 3; - } - else { - x; - return x; - } - } -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestInferenceAcrossBlocks.java b/test/mycompiler/test/blocks/TestInferenceAcrossBlocks.java deleted file mode 100755 index 8bccc6f36..000000000 --- a/test/mycompiler/test/blocks/TestInferenceAcrossBlocks.java +++ /dev/null @@ -1,45 +0,0 @@ -package mycompiler.test.blocks; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.BlockExpect; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** - * 18-04-08 - * @author - * - * this test checks correct inference across different block with respect to local variables - */ - -public class TestInferenceAcrossBlocks extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestInferenceAcrossBlocks"; - private final static String JAVPATH="test/mycompiler/test/blocks/"; - - public TestInferenceAcrossBlocks(String name) { - super(name,TestInferenceAcrossBlocks.JAVPATH+TestInferenceAcrossBlocks.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testInferenceAcrossBlocks = new ClassExpect(TestInferenceAcrossBlocks.TESTEDCLASSNAME); - - //Methods - MethodExpect m = new MethodExpect("m",new RefType("java.lang.Integer",-1)); - m.addParameter(new VarExpect("a", new RefType("java.lang.Boolean",-1))); - BlockExpect elseBlock = new BlockExpect(m.getBlock().getBlockID(),"2"); - elseBlock.addLocalVar(new VarExpect("x", new RefType("java.lang.Integer",-1))); - m.getBlock().addBlock(elseBlock); - - - testInferenceAcrossBlocks.addMethod(m); - return new Expectation(testInferenceAcrossBlocks); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestSimpleBlocks.jav b/test/mycompiler/test/blocks/TestSimpleBlocks.jav deleted file mode 100755 index 25d97b971..000000000 --- a/test/mycompiler/test/blocks/TestSimpleBlocks.jav +++ /dev/null @@ -1,18 +0,0 @@ -public class TestSimpleBlocks{ - - public m(a){ - { - d; - d = 'a'; - { - c; - c = d; - } - { - c; - c = d==a; - } - } - return a; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestSimpleBlocks.java b/test/mycompiler/test/blocks/TestSimpleBlocks.java deleted file mode 100755 index 11221b7de..000000000 --- a/test/mycompiler/test/blocks/TestSimpleBlocks.java +++ /dev/null @@ -1,56 +0,0 @@ -package mycompiler.test.blocks; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.BlockExpect; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** - * 18-04-08 - * @author - * - * this test checks correct detection of scope of variables in simple blocks without a language specific statement - */ - -public class TestSimpleBlocks extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestSimpleBlocks"; - private final static String JAVPATH="test/mycompiler/test/blocks/"; - - public TestSimpleBlocks(String name) { - super(name,TestSimpleBlocks.JAVPATH+TestSimpleBlocks.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testSimpleBlocks = new ClassExpect(TestSimpleBlocks.TESTEDCLASSNAME); - - //Methods - MethodExpect m = new MethodExpect("m",new RefType("java.lang.Character",-1)); - m.addParameter(new VarExpect("a", new RefType("java.lang.Character",-1))); - BlockExpect outerBlock = new BlockExpect(m.getBlock().getBlockID(),"1"); - outerBlock.addLocalVar(new VarExpect("d",new RefType("java.lang.Character",-1))); - - - BlockExpect firstBlock = new BlockExpect(outerBlock.getBlockID(),"1"); - firstBlock.addLocalVar(new VarExpect("c", new RefType("java.lang.Character",-1))); - - BlockExpect secondBlock = new BlockExpect(outerBlock.getBlockID(),"2"); - secondBlock.addLocalVar(new VarExpect("c", new RefType("java.lang.Boolean",-1))); - - outerBlock.addBlock(firstBlock); - outerBlock.addBlock(secondBlock); - - m.getBlock().addBlock(outerBlock); - - testSimpleBlocks.addMethod(m); - - return new Expectation(testSimpleBlocks); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestSimpleVariable.jav b/test/mycompiler/test/blocks/TestSimpleVariable.jav deleted file mode 100755 index b3d3ba248..000000000 --- a/test/mycompiler/test/blocks/TestSimpleVariable.jav +++ /dev/null @@ -1,7 +0,0 @@ -public class TestSimpleVariable { - - public m() { - c; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestSimpleVariable.java b/test/mycompiler/test/blocks/TestSimpleVariable.java deleted file mode 100755 index 26f4d2c36..000000000 --- a/test/mycompiler/test/blocks/TestSimpleVariable.java +++ /dev/null @@ -1,43 +0,0 @@ -package mycompiler.test.blocks; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.TypePlaceholderExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** - * 18-04-08 - * @author - * - * this test checks correct detection of a single variable in root block - * TODO: maybe move to trival? - */ - -public class TestSimpleVariable extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestSimpleVariable"; - private final static String JAVPATH="test/mycompiler/test/blocks/"; - - public TestSimpleVariable(String name) { - super(name,TestSimpleVariable.JAVPATH+TestSimpleVariable.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testSimpleVariable = new ClassExpect(TestSimpleVariable.TESTEDCLASSNAME); - - //Methods - MethodExpect m = new MethodExpect("m",new RefType("void",-1)); - VarExpect var = new VarExpect("c",new TypePlaceholderExpect("a")); - m.getBlock().addLocalVar(var); - - testSimpleVariable.addMethod(m); - return new Expectation(testSimpleVariable); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestSwitchStmt.jav b/test/mycompiler/test/blocks/TestSwitchStmt.jav deleted file mode 100755 index 1b9f689bc..000000000 --- a/test/mycompiler/test/blocks/TestSwitchStmt.jav +++ /dev/null @@ -1,11 +0,0 @@ -public class TestSwitchStmt { - - public m(a) { - switch (a) { - case 1: return a++; break; - case 2: return a--; break; - default: return a; - } - - -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestTryCatchBlock.jav b/test/mycompiler/test/blocks/TestTryCatchBlock.jav deleted file mode 100755 index 59951045a..000000000 --- a/test/mycompiler/test/blocks/TestTryCatchBlock.jav +++ /dev/null @@ -1,14 +0,0 @@ -public class TestTryCatchBlock { - - public m() { - - try { - return new TestTryCatchBlock(); - } - catch (e) { - return null; - } - - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestUndeterminedReturnNegative.jav b/test/mycompiler/test/blocks/TestUndeterminedReturnNegative.jav deleted file mode 100755 index 166cd9739..000000000 --- a/test/mycompiler/test/blocks/TestUndeterminedReturnNegative.jav +++ /dev/null @@ -1,12 +0,0 @@ - -public class TestUndeterminedReturnNegative { - - public m1(a) { - if (a) { - a=false; - } - else - return false; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestUndeterminedReturnNegative.java b/test/mycompiler/test/blocks/TestUndeterminedReturnNegative.java deleted file mode 100755 index 490c27217..000000000 --- a/test/mycompiler/test/blocks/TestUndeterminedReturnNegative.java +++ /dev/null @@ -1,53 +0,0 @@ -package mycompiler.test.blocks; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** - * 16-05-08 - * @author - * - * this test checks a scenario where undefined return state is given by condition dependant retun statment# - * Test expects an exception thrown - */ -public class TestUndeterminedReturnNegative extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestUndeterminedReturnNegative"; - private final static String JAVPATH="test/mycompiler/test/blocks/"; - - public TestUndeterminedReturnNegative(String name) { - super(name,TestUndeterminedReturnNegative.JAVPATH+TestUndeterminedReturnNegative.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testUndeterminedReturnNegative = new ClassExpect(TestUndeterminedReturnNegative.TESTEDCLASSNAME); - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("java.lang.Boolean",-1)); - //m1.addReturntype(new RefType("void",-1)); - VarExpect var1 = new VarExpect("a",new RefType("java.lang.Boolean",-1)); - m1.addParameter(var1); - //short not inferenced - //var1.addExpectedType(new RefType("java.lang.Short",-1)); - - - testUndeterminedReturnNegative.addMethod(m1); - - Expectation ret = new Expectation(testUndeterminedReturnNegative); - ret.addException(new Exception()); //returntype undefined, one case return = boolean, other case return=void - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestUninitializedVariable.jav b/test/mycompiler/test/blocks/TestUninitializedVariable.jav deleted file mode 100755 index 793bbbe8c..000000000 --- a/test/mycompiler/test/blocks/TestUninitializedVariable.jav +++ /dev/null @@ -1,11 +0,0 @@ -public class TestUninitializedVariable { - - public void m1() { - a; - a++; - } - - void m2(T a) { - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestUninitializedVariable.java b/test/mycompiler/test/blocks/TestUninitializedVariable.java deleted file mode 100755 index be8d16166..000000000 --- a/test/mycompiler/test/blocks/TestUninitializedVariable.java +++ /dev/null @@ -1,45 +0,0 @@ -package mycompiler.test.blocks; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** - * 29-05-08 - * @author - * - * this test checks a scenario where an uninitialized variable is incremented, which should be discarded by the compiler - * Test expects an exception thrown - */ -public class TestUninitializedVariable extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestUninitializedVariable"; - private final static String JAVPATH="test/mycompiler/test/blocks/"; - - public TestUninitializedVariable(String name) { - super(name,TestUninitializedVariable.JAVPATH+TestUninitializedVariable.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testUninitializedVariable = new ClassExpect(TestUninitializedVariable.TESTEDCLASSNAME); - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("void",-1)); - VarExpect var1 = new VarExpect("a",new RefType("java.lang.Integer",-1)); - m1.getBlock().addLocalVar(var1); - - - testUninitializedVariable.addMethod(m1); - - Expectation ret = new Expectation(testUninitializedVariable); - ret.addException(new Exception()); //variable used not initialized - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestWhileStmt.jav b/test/mycompiler/test/blocks/TestWhileStmt.jav deleted file mode 100755 index 1debca80b..000000000 --- a/test/mycompiler/test/blocks/TestWhileStmt.jav +++ /dev/null @@ -1,9 +0,0 @@ -public class TestWhileStmt { - - public m1() { - i; - while (true) - i++; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/blocks/TestWhileStmt.java b/test/mycompiler/test/blocks/TestWhileStmt.java deleted file mode 100755 index 28f207411..000000000 --- a/test/mycompiler/test/blocks/TestWhileStmt.java +++ /dev/null @@ -1,43 +0,0 @@ -package mycompiler.test.blocks; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** - * 18-04-08 - * @author - * - * simply verifies while-stmt recognition - */ - -public class TestWhileStmt extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestWhileStmt"; - private final static String JAVPATH="test/mycompiler/test/blocks/"; - - public TestWhileStmt(String name) { - super(name,TestWhileStmt.JAVPATH+TestWhileStmt.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testWhileStmt = new ClassExpect(TestWhileStmt.TESTEDCLASSNAME); - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("void",-1)); - VarExpect var1 = new VarExpect("i",new RefType("java.lang.Integer",-1)); - //var1.addExpectedType(new RefType("java.lang.Short",-1)); - //var1.addExpectedType(new RefType("java.lang.Long",-1)); - m1.getBlock().addLocalVar(var1); - - testWhileStmt.addMethod(m1); - return new Expectation(testWhileStmt); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/complexTypes/AllTestsComplexTypes.java b/test/mycompiler/test/complexTypes/AllTestsComplexTypes.java deleted file mode 100755 index 31cf867b0..000000000 --- a/test/mycompiler/test/complexTypes/AllTestsComplexTypes.java +++ /dev/null @@ -1,19 +0,0 @@ -package mycompiler.test.complexTypes; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsComplexTypes { - - public static Test suite() { - TestSuite suite = new TestSuite("Test for mycompiler.test.complexTypes"); - //$JUnit-BEGIN$ - suite.addTestSuite(TestOwnClassMethod.class); - suite.addTestSuite(TestOwnClassMember.class); - suite.addTestSuite(TestStandardLibMethod.class); - suite.addTestSuite(TestStandardLibInheritanceInference.class); - //$JUnit-END$ - return suite; - } - -} diff --git a/test/mycompiler/test/complexTypes/TestOwnClassMember.jav b/test/mycompiler/test/complexTypes/TestOwnClassMember.jav deleted file mode 100755 index fa73127e8..000000000 --- a/test/mycompiler/test/complexTypes/TestOwnClassMember.jav +++ /dev/null @@ -1,9 +0,0 @@ -public class TestOwnClassMember { - - Integer a; - - public void m1(b) { - b += a; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/complexTypes/TestOwnClassMember.java b/test/mycompiler/test/complexTypes/TestOwnClassMember.java deleted file mode 100755 index 60fceee07..000000000 --- a/test/mycompiler/test/complexTypes/TestOwnClassMember.java +++ /dev/null @@ -1,41 +0,0 @@ -package mycompiler.test.complexTypes; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** - * 25-04-08 - * @author - * - * test checks for correct inference using a class member variable - */ -public class TestOwnClassMember extends AbstractInferenceTest{ - private final static String TESTEDCLASSNAME="TestOwnClassMember"; - private final static String JAVPATH="test/mycompiler/test/complexTypes/"; - - public TestOwnClassMember(String name) { - super(name,TestOwnClassMember.JAVPATH+TestOwnClassMember.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testOwnClassMember = new ClassExpect(TestOwnClassMember.TESTEDCLASSNAME); - //Member - testOwnClassMember.addMember(new VarExpect("a", new RefType("java.lang.Integer",-1))); - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("void",-1)); - m1.addParameter(new VarExpect("b",new RefType("java.lang.Integer",-1))); - - - - testOwnClassMember.addMethod(m1); - - return new Expectation(testOwnClassMember); - } - } \ No newline at end of file diff --git a/test/mycompiler/test/complexTypes/TestOwnClassMethod.jav b/test/mycompiler/test/complexTypes/TestOwnClassMethod.jav deleted file mode 100755 index e3d2a9255..000000000 --- a/test/mycompiler/test/complexTypes/TestOwnClassMethod.jav +++ /dev/null @@ -1,12 +0,0 @@ -public class TestOwnClassMethod { - - Integer a; - - public void m1(b) { - a += b; - } - - public void m2(c, d) { - c.m1(d); - } - } \ No newline at end of file diff --git a/test/mycompiler/test/complexTypes/TestOwnClassMethod.java b/test/mycompiler/test/complexTypes/TestOwnClassMethod.java deleted file mode 100755 index 19eaad005..000000000 --- a/test/mycompiler/test/complexTypes/TestOwnClassMethod.java +++ /dev/null @@ -1,47 +0,0 @@ -package mycompiler.test.complexTypes; - - - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 18-04-08 - * @author - * - * tests inference using return statement of a member-method - */ -public class TestOwnClassMethod extends AbstractInferenceTest{ - private final static String TESTEDCLASSNAME="TestOwnClassMethod"; - private final static String JAVPATH="test/mycompiler/test/complexTypes/"; - - public TestOwnClassMethod(String name) { - super(name,TestOwnClassMethod.JAVPATH+TestOwnClassMethod.TESTEDCLASSNAME + ".jav"); - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testOwnClassMethod = new ClassExpect(TestOwnClassMethod.TESTEDCLASSNAME); - //Member - testOwnClassMethod.addMember(new VarExpect("a", new RefType("java.lang.Integer",-1))); - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("void",-1)); - m1.addParameter(new VarExpect("b",new RefType("java.lang.Integer",-1))); - - MethodExpect m2 = new MethodExpect("m2", new RefType("void",-1)); - m2.addParameter(new VarExpect("c", new RefType(TestOwnClassMethod.TESTEDCLASSNAME,-1))); - m2.addParameter(new VarExpect("d", new RefType("java.lang.Integer",-1))); - - - testOwnClassMethod.addMethod(m1); - testOwnClassMethod.addMethod(m2); - - return new Expectation(testOwnClassMethod); - } - } \ No newline at end of file diff --git a/test/mycompiler/test/complexTypes/TestStandardLibInheritanceInference.jav b/test/mycompiler/test/complexTypes/TestStandardLibInheritanceInference.jav deleted file mode 100755 index deafc13a6..000000000 --- a/test/mycompiler/test/complexTypes/TestStandardLibInheritanceInference.jav +++ /dev/null @@ -1,12 +0,0 @@ -import java.io.OutputStream; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.io.BufferedOutputStream; -import java.sql.Connection; - - -class TestStandardLibInheritanceInference{ - foo(x){ - x.close(); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/complexTypes/TestStandardLibInheritanceInference.java b/test/mycompiler/test/complexTypes/TestStandardLibInheritanceInference.java deleted file mode 100755 index 060322cb3..000000000 --- a/test/mycompiler/test/complexTypes/TestStandardLibInheritanceInference.java +++ /dev/null @@ -1,44 +0,0 @@ -package mycompiler.test.complexTypes; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 25-05-08 - * @author - * - * inference of std-types according to import statements with respect to inheritance structure - */ - -public class TestStandardLibInheritanceInference extends AbstractInferenceTest{ - private final static String TESTEDCLASSNAME="TestStandardLibInheritanceInference"; - private final static String JAVPATH="test/mycompiler/test/complexTypes/"; - - public TestStandardLibInheritanceInference(String name) { - super(name,TestStandardLibInheritanceInference.JAVPATH+TestStandardLibInheritanceInference.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testStandardLibInheritanceInference = new ClassExpect(TESTEDCLASSNAME); - - //Methods - MethodExpect foo = new MethodExpect("foo",new RefType("void",-1)); - VarExpect x = new VarExpect("x",new RefType("java.io.OutputStream",-1)); - x.addExpectedType(new RefType("java.io.BufferedOutputStream",-1)); - x.addExpectedType(new RefType("java.io.InputStream",-1)); - x.addExpectedType(new RefType("java.io.ByteArrayOutputStream",-1)); - x.addExpectedType(new RefType("java.sql.Connection",-1)); - foo.addParameter(x); - - testStandardLibInheritanceInference.addMethod(foo); - - return new Expectation(testStandardLibInheritanceInference); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/complexTypes/TestStandardLibMember.jav b/test/mycompiler/test/complexTypes/TestStandardLibMember.jav deleted file mode 100755 index c54b0b142..000000000 --- a/test/mycompiler/test/complexTypes/TestStandardLibMember.jav +++ /dev/null @@ -1,11 +0,0 @@ -import java.lang.System; -import java.io.PrintStream; - -public class TestStandardLibMember { - - public m1() { - a; - a=System.out; - a.println(); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/complexTypes/TestStandardLibMethod.jav b/test/mycompiler/test/complexTypes/TestStandardLibMethod.jav deleted file mode 100755 index 3f01ac70f..000000000 --- a/test/mycompiler/test/complexTypes/TestStandardLibMethod.jav +++ /dev/null @@ -1,20 +0,0 @@ -import java.util.HashMap; -import de.dhbwstuttgart.typeinference.Menge; - -public class TestStandardLibMethod { - - public m1() { - a; - a = new HashMap(); - a.put("2",-1); - } - - public m2(Menge> m){ - k; - k = 0; - ret; - ret = m.elementAt(k).elementAt(k).intValue(); - return ret; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/complexTypes/TestStandardLibMethod.java b/test/mycompiler/test/complexTypes/TestStandardLibMethod.java deleted file mode 100755 index 8e6c29193..000000000 --- a/test/mycompiler/test/complexTypes/TestStandardLibMethod.java +++ /dev/null @@ -1,53 +0,0 @@ -package mycompiler.test.complexTypes; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** - * 18-04-08 - * @author - * - * this test checks correct inference of std types by their methods used - */ -public class TestStandardLibMethod extends AbstractInferenceTest{ - private final static String TESTEDCLASSNAME="TestStandardLibMethod"; - private final static String JAVPATH="test/mycompiler/test/complexTypes/"; - - public TestStandardLibMethod(String name) { - super(name,TestStandardLibMethod.JAVPATH+TestStandardLibMethod.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testStandardLibMethod = new ClassExpect(TestStandardLibMethod.TESTEDCLASSNAME); - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("void",-1)); - RefType aType = new RefType("java.util.HashMap",new Menge(),-1); - aType.add_Parameter(new RefType("java.lang.String",-1)); - aType.add_Parameter(new RefType("java.lang.Integer",-1)); - m1.getBlock().addLocalVar(new VarExpect("a", aType)); - - MethodExpect m2 = new MethodExpect("m2", new RefType("java.lang.Integer",-1)); - RefType mType = new RefType("de.dhbwstuttgart.typeinference.Menge",new Menge(),-1); - RefType mType1 = new RefType("de.dhbwstuttgart.typeinference.Menge",new Menge(),-1); - mType1.add_Parameter(new RefType("java.lang.Integer",-1)); - mType.add_Parameter(mType1); - m2.addParameter(new VarExpect("m", mType)); - m2.getBlock().addLocalVar(new VarExpect("k",new RefType("java.lang.Integer",-1))); - m2.getBlock().addLocalVar(new VarExpect("ret",new RefType("java.lang.Integer",-1))); - - - testStandardLibMethod.addMethod(m1); - testStandardLibMethod.addMethod(m2); - - return new Expectation(testStandardLibMethod); - } - } \ No newline at end of file diff --git a/test/mycompiler/test/expectationTypes/BlockExpect.java b/test/mycompiler/test/expectationTypes/BlockExpect.java deleted file mode 100755 index 47e4b4e69..000000000 --- a/test/mycompiler/test/expectationTypes/BlockExpect.java +++ /dev/null @@ -1,74 +0,0 @@ -package mycompiler.test.expectationTypes; - -import java.util.HashMap; -import de.dhbwstuttgart.typeinference.Menge; - -/** - * 15-04-08 - * @author - * - * expectation structure to define expectations for a particular block - */ - -public class BlockExpect implements IExpectation{ - private HashMap localVars = null; - private Menge containedBlocks = null; - private String blockID = null; - - public BlockExpect(String parentBlockID,String blockID) { - - this.localVars = new HashMap(); - this.containedBlocks = new Menge(); - if (parentBlockID==null) - this.blockID=blockID; - else - this.blockID = parentBlockID+"-"+blockID; - } - - public void addBlock(BlockExpect block) { - this.containedBlocks.add(block); - } - - public void addLocalVar(VarExpect localVar) { - this.localVars.put(localVar.getName(), localVar); - } - - public boolean verifyTypeExpectationsCompletelyMet() { - boolean ret = true; - for (VarExpect localVar : localVars.values()) { - ret &=localVar.verifyTypeExpectationsCompletelyMet(); - } - - for (BlockExpect containedBlock : containedBlocks) { - ret &=containedBlock.verifyTypeExpectationsCompletelyMet(); - } - return ret; - } - - public HashMap getLocalVar() { - return localVars; - } - - public void setLocalVar(HashMap localVar) { - this.localVars = localVar; - } - - public Menge getContainedBlocks() { - return containedBlocks; - } - - public void setContainedBlocks(Menge containedBlocks) { - this.containedBlocks = containedBlocks; - } - - public String getBlockID() { - return blockID; - } - - public void setBlockID(String blockID) { - this.blockID = blockID; - } - - - -} diff --git a/test/mycompiler/test/expectationTypes/ClassExpect.java b/test/mycompiler/test/expectationTypes/ClassExpect.java deleted file mode 100755 index dcc9f693d..000000000 --- a/test/mycompiler/test/expectationTypes/ClassExpect.java +++ /dev/null @@ -1,92 +0,0 @@ -package mycompiler.test.expectationTypes; - -import java.util.HashMap; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import mycompiler.mytypereconstruction.typeassumptionkey.CMethodKey; -/** - * 15-04-08 - * @author - * - * expectation structure to define expectations for a particular class - */ -public class ClassExpect implements IExpectation { - private String name = null; - private Menge generics = null; - private HashMap members = null; - private HashMap methods = null; - - - public ClassExpect(String name) { - this.name = name; - this.generics= new Menge(); - this.members = new HashMap(); - this.methods = new HashMap(); - } - - public void addGeneric(GenericTypeVar generic) { - this.generics.add(generic); - } - - public void addMember(VarExpect member) { - this.members.put(member.getName(), member); - } - - public void addMethod(MethodExpect method) { - this.methods.put(new CMethodKey(this.getName(),method.getName(),method.getParaCount(),method.getOverloadID()),method); - } - - public boolean verifyTypeExpectationsCompletelyMet() { - boolean ret=true; - for (VarExpect member : this.members.values()) - ret &=member.verifyTypeExpectationsCompletelyMet(); - for (MethodExpect method: this.methods.values()) - ret &=method.verifyTypeExpectationsCompletelyMet(); - return ret; - } - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public Menge getGenerics() { - return generics; - } - - - public void setGenerics(Menge generics) { - this.generics = generics; - } - - - public HashMap getMembers() { - return members; - } - - - public void setMembers(HashMap members) { - this.members = members; - } - - - public HashMap getMethods() { - return methods; - } - - - public void setMethods(HashMap methods) { - this.methods = methods; - } - - - - - -} \ No newline at end of file diff --git a/test/mycompiler/test/expectationTypes/Expectation.java b/test/mycompiler/test/expectationTypes/Expectation.java deleted file mode 100755 index 1b80baec6..000000000 --- a/test/mycompiler/test/expectationTypes/Expectation.java +++ /dev/null @@ -1,58 +0,0 @@ -package mycompiler.test.expectationTypes; - -import java.util.HashMap; -import de.dhbwstuttgart.typeinference.Menge; -/** - * 15-04-08 - * @author - * - * expectation structure to define expectations for an entire testcase - * holds information about classes, exceptions - */ -public class Expectation implements IExpectation { - - private HashMap classes = null; - private Menge exceptions = null; - private UnknownTypesMappingExpect mappings = null; - - public Expectation(ClassExpect classExpect) { - if (classExpect!=null) { - this.classes = new HashMap(); - this.classes.put(classExpect.getName(), classExpect); - } - this.exceptions = new Menge(); - this.mappings = new UnknownTypesMappingExpect(); - } - - public boolean verifyTypeExpectationsCompletelyMet() { - boolean ret = true; - for (ClassExpect classexpect : this.classes.values()) - ret &= classexpect.verifyTypeExpectationsCompletelyMet(); - return ret; - } - - public void addClass(ClassExpect classExpect) { - this.classes.put(classExpect.getName(),classExpect); - } - - public void addException (Exception e) { - this.exceptions.add(e); - } - - public Menge getExceptions() { - return this.exceptions; - } - - public HashMap getClasses() { - return classes; - } - - public void setClasses(HashMap classes) { - this.classes = classes; - } - - public UnknownTypesMappingExpect getMappings() { - return mappings; - } - -} diff --git a/test/mycompiler/test/expectationTypes/GenericTypeVarExpect.java b/test/mycompiler/test/expectationTypes/GenericTypeVarExpect.java deleted file mode 100755 index 8f2131e68..000000000 --- a/test/mycompiler/test/expectationTypes/GenericTypeVarExpect.java +++ /dev/null @@ -1,21 +0,0 @@ -package mycompiler.test.expectationTypes; - -import mycompiler.test.expectationTypes.IUnknownTypeExpect; -/** - * 15-05-08 - * @author - * - * class used to define variable expectations for a GenericTypeVar - */ -public class GenericTypeVarExpect implements IUnknownTypeExpect { - - private String name = null; - - public GenericTypeVarExpect(String name) { - this.name=name; - } - - public String getName() { - return this.name; - } -} diff --git a/test/mycompiler/test/expectationTypes/IExpectation.java b/test/mycompiler/test/expectationTypes/IExpectation.java deleted file mode 100755 index 5e74f38bd..000000000 --- a/test/mycompiler/test/expectationTypes/IExpectation.java +++ /dev/null @@ -1,12 +0,0 @@ -package mycompiler.test.expectationTypes; - -/** - * 15-04-08 - * @author - * an interface defining common structure of a expectation definition - */ -public interface IExpectation { - - public boolean verifyTypeExpectationsCompletelyMet(); - -} diff --git a/test/mycompiler/test/expectationTypes/IUnknownTypeExpect.java b/test/mycompiler/test/expectationTypes/IUnknownTypeExpect.java deleted file mode 100755 index bf4334ed2..000000000 --- a/test/mycompiler/test/expectationTypes/IUnknownTypeExpect.java +++ /dev/null @@ -1,12 +0,0 @@ -package mycompiler.test.expectationTypes; - -/** - * 15-05-08 - * @author - * - * interface for an expectation class to be defined - */ -public interface IUnknownTypeExpect { - - public String getName(); -} diff --git a/test/mycompiler/test/expectationTypes/MethodExpect.java b/test/mycompiler/test/expectationTypes/MethodExpect.java deleted file mode 100755 index e2822f6e5..000000000 --- a/test/mycompiler/test/expectationTypes/MethodExpect.java +++ /dev/null @@ -1,157 +0,0 @@ -package mycompiler.test.expectationTypes; - -import java.util.HashMap; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Type; -/** - * 15-04-08 - * @author - * - * defines expectations for methods - */ -public class MethodExpect implements IExpectation { - - private final static String METHODNAMEDELIMITER = "#"; - - private String name = null; - private Menge returntypes = null; - private Menge returntypesCopy = null; //used to ensure all expectations have been met - private IUnknownTypeExpect unknownReturnType=null; - private Menge generics = null; - private HashMap parameters = null; - private BlockExpect block = null; - private int overloadID = 0; - - - public MethodExpect(String name) { - this(name,0); - } - - public MethodExpect(String name, int overloadID) { - this.name = name; - - this.generics=new Menge(); - this.parameters=new HashMap(); - this.returntypes = new Menge(); - this.returntypesCopy=(Menge)this.returntypes.clone(); - this.block = new BlockExpect(null,"1"); - - this.overloadID = overloadID; - } - - public MethodExpect(String name, Type returntype) { - this(name,returntype,0); - } - - public MethodExpect(String name, Type returntype, int overloadID) { - this(name,overloadID); - this.returntypes.add(returntype); - this.returntypesCopy=(Menge)this.returntypes.clone(); - } - - public MethodExpect(String name, IUnknownTypeExpect unknownreturntype) { - this(name,unknownreturntype,0); - } - - public MethodExpect(String name, IUnknownTypeExpect unknownreturntype, int overloadID) { - this(name,overloadID); - this.unknownReturnType=unknownreturntype; - } - - public void addGeneric (GenericTypeVar generic) { - this.generics.add(generic); - } - - public void addReturntype(Type returntype) { - if (this.returntypes==null) - this.returntypes = new Menge(); - //to avoid usage of returntypes and unknownreturntypes at the same time - if (this.unknownReturnType==null) { - this.returntypes.add(returntype); - this.returntypesCopy.add(returntype); - } - } - - public void addParameter(VarExpect parameter) { - this.parameters.put(parameter.getName(),parameter); - } - - public boolean verifyTypeExpectationsCompletelyMet() { - boolean ret = true; - for (VarExpect parameter : this.parameters.values() ) { - ret &=parameter.verifyTypeExpectationsCompletelyMet(); - } - if (this.block!=null) - ret &=this.block.verifyTypeExpectationsCompletelyMet(); - ret &=this.returntypesCopy.size()==0; - return ret; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public Menge getReturntypes() { - return returntypes; - } - - public void setReturntypes(Menge returntypes) { - this.returntypes = returntypes; - } - - public Menge getGenerics() { - return generics; - } - - public void setGenerics(Menge generics) { - this.generics = generics; - } - - public HashMap getParameter() { - return parameters; - } - - public void setParameter(HashMap parameter) { - this.parameters = parameter; - } - - public BlockExpect getBlock() { - return block; - } - - public void setBlock(BlockExpect block) { - this.block = block; - } - - public int getOverloadID() { - return overloadID; - } - - public void setOverloadID(int overloadID) { - this.overloadID = overloadID; - } - - public Menge getReturntypesCopy() { - return returntypesCopy; - } - - public void setReturntypesCopy(Menge returntypesCopy) { - this.returntypesCopy = returntypesCopy; - this.returntypesCopy=(Menge)this.returntypes.clone(); - } - - public IUnknownTypeExpect getUnknownReturnType() { - return this.unknownReturnType; - } - - public int getParaCount() { - return this.getParameter().size(); - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/expectationTypes/TypePlaceholderExpect.java b/test/mycompiler/test/expectationTypes/TypePlaceholderExpect.java deleted file mode 100755 index fcfc08e09..000000000 --- a/test/mycompiler/test/expectationTypes/TypePlaceholderExpect.java +++ /dev/null @@ -1,21 +0,0 @@ -package mycompiler.test.expectationTypes; - -import mycompiler.test.expectationTypes.IUnknownTypeExpect; -/** - * 15-05-08 - * @author - * - * type for defining an expected TypePlaceholder - */ -public class TypePlaceholderExpect implements IUnknownTypeExpect { - - private String name = null; - - public TypePlaceholderExpect(String name) { - this.name=name; - } - - public String getName() { - return this.name; - } -} diff --git a/test/mycompiler/test/expectationTypes/UnknownTypesMappingExpect.java b/test/mycompiler/test/expectationTypes/UnknownTypesMappingExpect.java deleted file mode 100755 index 6e3a5e652..000000000 --- a/test/mycompiler/test/expectationTypes/UnknownTypesMappingExpect.java +++ /dev/null @@ -1,42 +0,0 @@ -package mycompiler.test.expectationTypes; - -import java.util.HashMap; - -/** - * class is used to translate expected Typeplaceholder variable names to the ones used by the compiler allowing a comparison. It simply holds a registry that is filled upon detection of an unknown type which may later be in need of comparison - * only helps verifying that same expected typeplaceholders are mapped to same assumed typeplaceholders - * @author stresing - * - */ - -public class UnknownTypesMappingExpect { - - private HashMap unknownTypeNameMapping = null; - - public UnknownTypesMappingExpect() { - this.unknownTypeNameMapping = new HashMap(); - } - - /** - * returns mapped Type name as of expectation or null if not yet mapped - * @param foundTypeName - * @return - */ - public String getMappedType(String expectedTypeName) { - return this.unknownTypeNameMapping.get(expectedTypeName); - } - - public void addMapping(String expectedTypeName, String foundTypeName) { - this.unknownTypeNameMapping.put(expectedTypeName, foundTypeName); - - } - - public HashMap getUnknownTypeNameMapping() { - return unknownTypeNameMapping; - } - - public void setUnknownTypeNameMapping( - HashMap unknownTypeNameMapping) { - this.unknownTypeNameMapping = unknownTypeNameMapping; - } -} diff --git a/test/mycompiler/test/expectationTypes/VarExpect.java b/test/mycompiler/test/expectationTypes/VarExpect.java deleted file mode 100755 index f849841ba..000000000 --- a/test/mycompiler/test/expectationTypes/VarExpect.java +++ /dev/null @@ -1,80 +0,0 @@ -package mycompiler.test.expectationTypes; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.Type; -/** - * 15-04-08 - * @author - * - * classes used to define expectation of a particular variable - */ -public class VarExpect implements IExpectation { - private Menge expectedType = null; - private Menge expectedTypeCopy = null; - private IUnknownTypeExpect expectedUnknownType=null; - private String name = null; - - public VarExpect(String name) { - this.name=name; - this.expectedType=new Menge(); - this.expectedTypeCopy=(Menge)this.expectedType.clone(); - } - - public VarExpect(String name, Type expectedType) { - this(name); - this.expectedType.add(expectedType); - this.expectedTypeCopy=(Menge)this.expectedType.clone(); - } - - public VarExpect(String name, IUnknownTypeExpect expectedUnknownType) { - this(name); - this.expectedUnknownType=expectedUnknownType; - } - - public void addExpectedType(Type type) { - if (this.expectedType==null) - this.expectedType = new Menge(); - this.expectedType.add(type); - this.expectedTypeCopy=(Menge)this.expectedType.clone(); - } - - public boolean verifyTypeExpectationsCompletelyMet() { - return this.expectedTypeCopy.size()==0; - } - - public Menge getExpectedType() { - return expectedType; - } - - public void setExpectedType(Menge expectedType) { - this.expectedType = expectedType; - this.expectedTypeCopy=(Menge)this.expectedType.clone(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Menge getExpectedTypeCopy() { - return expectedTypeCopy; - } - - public void setExpectedTypeCopy(Menge expectedTypeCopy) { - this.expectedTypeCopy = expectedTypeCopy; - } - - public IUnknownTypeExpect getExpectedUnknownType() { - return expectedUnknownType; - } - - public void setExpectedUnknownType(IUnknownTypeExpect expectedUnknownType) { - this.expectedUnknownType = expectedUnknownType; - } - -} - diff --git a/test/mycompiler/test/generics/AllTestsGenerics.java b/test/mycompiler/test/generics/AllTestsGenerics.java deleted file mode 100755 index bf3a7144d..000000000 --- a/test/mycompiler/test/generics/AllTestsGenerics.java +++ /dev/null @@ -1,25 +0,0 @@ -package mycompiler.test.generics; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsGenerics { - - public static Test suite() { - TestSuite suite = new TestSuite("Test for mycompiler.test.generics"); - //$JUnit-BEGIN$ - suite.addTestSuite(TestExtendedClassesWithBoundedGenerics.class); - suite.addTestSuite(TestAssignmentTwoGenericTypesNegative.class); - suite.addTestSuite(TestNestedGenerics.class); - suite.addTestSuite(TestSimpleClassesWithGenerics.class); - suite.addTestSuite(TestClassesWithBoundedGenericsUsedInMethods.class); - suite.addTestSuite(TestSimpleClassesWithBoundedGenerics.class); - suite.addTestSuite(TestSimpleClassesWithGenericsNegative.class); - suite.addTestSuite(TestClassesWithBoundedGenericsOfTwoTypes.class); - suite.addTestSuite(TestSimpleClassesWithBoundedGenericsNegative.class); - suite.addTestSuite(TestNestedGenericsNonExistingType.class); - //$JUnit-END$ - return suite; - } - -} diff --git a/test/mycompiler/test/generics/TestAssignmentTwoGenericTypesNegative.jav b/test/mycompiler/test/generics/TestAssignmentTwoGenericTypesNegative.jav deleted file mode 100755 index 160126b58..000000000 --- a/test/mycompiler/test/generics/TestAssignmentTwoGenericTypesNegative.jav +++ /dev/null @@ -1,12 +0,0 @@ -import java.util.ArrayList; - -public class TestAssignmentTwoGenericTypesNegative { - - public void m() { - - ArrayList ls; - ls = new ArrayList(); - ArrayList lo; - lo = ls; /*<-- compile error*/ - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestAssignmentTwoGenericTypesNegative.java b/test/mycompiler/test/generics/TestAssignmentTwoGenericTypesNegative.java deleted file mode 100755 index 9658e395a..000000000 --- a/test/mycompiler/test/generics/TestAssignmentTwoGenericTypesNegative.java +++ /dev/null @@ -1,51 +0,0 @@ -package mycompiler.test.generics; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * verifies correct detection of incompatible type assignments of two templates - * @author - * 13-05-08 - */ - - -public class TestAssignmentTwoGenericTypesNegative extends AbstractInferenceTest{ - - private final static String TESTEDCLASSNAME="TestAssignmentTwoGenericTypesNegative"; - private final static String JAVPATH="test/mycompiler/test/generics/"; - - public TestAssignmentTwoGenericTypesNegative(String name) { - super(name,TestAssignmentTwoGenericTypesNegative.JAVPATH+TestAssignmentTwoGenericTypesNegative.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect testAssignmentTwoGenericTypesNegative = new ClassExpect(TestAssignmentTwoGenericTypesNegative.TESTEDCLASSNAME); - //Methods - MethodExpect method = new MethodExpect("m",new RefType("void",-1)); - RefType paramString = new RefType("java.lang.String",-1); - Menge param1 = new Menge(); - param1.add(paramString); - method.getBlock().addLocalVar(new VarExpect("ls", new RefType("java.util.ArrayList",param1,-1))); - RefType paramObject = new RefType("java.lang.Object",-1); - Menge param2 = new Menge(); - param2.add(paramObject); - method.getBlock().addLocalVar(new VarExpect("lo", new RefType("java.util.ArrayList",param2,-1))); - - testAssignmentTwoGenericTypesNegative.addMethod(method); - - Expectation ret = new Expectation(testAssignmentTwoGenericTypesNegative); - ret.addException(new Exception()); - return ret; - - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestClassesWithBoundedGenericsOfTwoTypes.jav b/test/mycompiler/test/generics/TestClassesWithBoundedGenericsOfTwoTypes.jav deleted file mode 100755 index aec3e2351..000000000 --- a/test/mycompiler/test/generics/TestClassesWithBoundedGenericsOfTwoTypes.jav +++ /dev/null @@ -1,17 +0,0 @@ -interface I1 {} - -interface I2 {} - -class Implementation implements I1 {} - -class Implementation2 implements I2 {} - -class A {} - -class B{} - -class C{} - -class D{} - -class E{} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestClassesWithBoundedGenericsOfTwoTypes.java b/test/mycompiler/test/generics/TestClassesWithBoundedGenericsOfTwoTypes.java deleted file mode 100755 index 31c65b5ec..000000000 --- a/test/mycompiler/test/generics/TestClassesWithBoundedGenericsOfTwoTypes.java +++ /dev/null @@ -1,86 +0,0 @@ -package mycompiler.test.generics; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * checks inference upon bounds, however test fails up to now, bounds are not considered - * @author - * 21-04-08 - */ - - -public class TestClassesWithBoundedGenericsOfTwoTypes extends AbstractInferenceTest{ - - private final static String TESTEDCLASSNAME="TestClassesWithBoundedGenericsOfTwoTypes"; - private final static String JAVPATH="test/mycompiler/test/generics/"; - - public TestClassesWithBoundedGenericsOfTwoTypes(String name) { - super(name,TestClassesWithBoundedGenericsOfTwoTypes.JAVPATH+TestClassesWithBoundedGenericsOfTwoTypes.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //interfaces - ClassExpect i1 = new ClassExpect("I1"); - ClassExpect i2 = new ClassExpect("I2"); - - //classes - ClassExpect impl = new ClassExpect("Implementation"); - ClassExpect impl2 = new ClassExpect("Implementation2"); - ClassExpect a = new ClassExpect("A"); - ClassExpect b = new ClassExpect("B"); - ClassExpect c = new ClassExpect("C"); - ClassExpect d = new ClassExpect("D"); - ClassExpect e = new ClassExpect("E"); - - //generics - Menge boundsA = new Menge(); - boundsA.add(new RefType("I1",-1)); - a.addGeneric(new BoundedGenericTypeVar("T",boundsA,-1)); - - Menge boundsB = new Menge(); - boundsB.add(new RefType("I1",-1)); - boundsB.add(new RefType("I2",-1)); - b.addGeneric(new BoundedGenericTypeVar("T",boundsB,-1)); - - Menge boundsC = new Menge(); - boundsC.add(new RefType("I1",-1)); - boundsC.add(new RefType("Implementation",-1)); - c.addGeneric(new BoundedGenericTypeVar("T",boundsC,-1)); - - Menge boundsD = new Menge(); - boundsD.add(new RefType("I2",-1)); - boundsD.add(new RefType("Implementation",-1)); - d.addGeneric(new BoundedGenericTypeVar("T",boundsD,-1)); - - Menge boundsE = new Menge(); - boundsE.add(new RefType("Implementation",-1)); - boundsE.add(new RefType("Implementation2",-1)); - e.addGeneric(new BoundedGenericTypeVar("T",boundsE,-1)); - - - Expectation ret = new Expectation(i1); - ret.addClass(i2); - ret.addClass(impl); - ret.addClass(impl2); - ret.addClass(a); - ret.addClass(b); - ret.addClass(c); - ret.addClass(d); - ret.addClass(e); - //generic cannot extend two classes - no multiple inheritance in java - ret.addException(new Exception()); - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestClassesWithBoundedGenericsUsedInMethods.jav b/test/mycompiler/test/generics/TestClassesWithBoundedGenericsUsedInMethods.jav deleted file mode 100755 index b5a53fc73..000000000 --- a/test/mycompiler/test/generics/TestClassesWithBoundedGenericsUsedInMethods.jav +++ /dev/null @@ -1,21 +0,0 @@ -interface I1 { - public m1(); -} - -class Implementation implements I1 { - public m1() { - } -} - -class TestClassesWithBoundedGenericsUsedInMethods { - - /*since S is at least of Type I1, call m1() should work*/ - public void m3 (S x) { - x.m1(); - } - - /*T is bounded by class generics, thus always at least of type I1*/ - public m2(T x) { - x.m1(); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestClassesWithBoundedGenericsUsedInMethods.java b/test/mycompiler/test/generics/TestClassesWithBoundedGenericsUsedInMethods.java deleted file mode 100755 index 6699b4849..000000000 --- a/test/mycompiler/test/generics/TestClassesWithBoundedGenericsUsedInMethods.java +++ /dev/null @@ -1,75 +0,0 @@ -package mycompiler.test.generics; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -import mycompiler.test.expectationTypes.TypePlaceholderExpect; - -/** - * checks case of bounds being two classes, which should not be possible: multiple inheritance is not allowed in java - * @author - * 21-04-08 - */ - - -public class TestClassesWithBoundedGenericsUsedInMethods extends AbstractInferenceTest{ - - private final static String TESTEDCLASSNAME="TestClassesWithBoundedGenericsUsedInMethods"; - private final static String JAVPATH="test/mycompiler/test/generics/"; - - public TestClassesWithBoundedGenericsUsedInMethods(String name) { - super(name,TestClassesWithBoundedGenericsUsedInMethods.JAVPATH+TestClassesWithBoundedGenericsUsedInMethods.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //interfaces - ClassExpect i1 = new ClassExpect("I1"); - - //classes - ClassExpect impl = new ClassExpect("Implementation"); - ClassExpect testClassesWithBoundedGenericsUsedInMethods = new ClassExpect(TestClassesWithBoundedGenericsUsedInMethods.TESTEDCLASSNAME); - - //generics - Menge boundsT = new Menge(); - boundsT.add(new RefType("I1",-1)); - BoundedGenericTypeVar t = new BoundedGenericTypeVar("T",boundsT,-1); - Menge boundsS = new Menge(); - boundsS.add(new RefType("I1",-1)); - - BoundedGenericTypeVar s = new BoundedGenericTypeVar("T",boundsS,-1); - - - testClassesWithBoundedGenericsUsedInMethods.addGeneric(t); - - //methods - MethodExpect m1 = new MethodExpect("m1", new TypePlaceholderExpect("a")); - i1.addMethod(m1); - - MethodExpect mImpl1 = new MethodExpect("m1", new RefType("void",-1)); - impl.addMethod(mImpl1); - - MethodExpect m2 = new MethodExpect("m2", new RefType("void",-1)); - m2.addParameter(new VarExpect("x", t)); - testClassesWithBoundedGenericsUsedInMethods.addMethod(m2); - - MethodExpect m3 = new MethodExpect("m3", new RefType("void",-1)); - m3.addGeneric(new GenericTypeVar("T",-1)); - m3.addParameter(new VarExpect("x", s)); - testClassesWithBoundedGenericsUsedInMethods.addMethod(m3); - - Expectation ret = new Expectation(testClassesWithBoundedGenericsUsedInMethods); - ret.addClass(i1); - ret.addClass(impl); - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestExtendedClassesWithBoundedGenerics.jav b/test/mycompiler/test/generics/TestExtendedClassesWithBoundedGenerics.jav deleted file mode 100755 index 9e98bb177..000000000 --- a/test/mycompiler/test/generics/TestExtendedClassesWithBoundedGenerics.jav +++ /dev/null @@ -1,34 +0,0 @@ -interface I1 { - public m1(); -} - -interface I2 { - public m2(); -} - -class Implementation implements I1, I2 { - public m1() {} - - public m2() {} -} - -class Tester { - - public m3(T x) { - x.m1(); - x.m2(); - } -} - -public class TestExtendedClassesWithBoundedGenerics { - - public m() { - x; - /*can only be of Type Implementation*/ - x= new Implementation(); - y; - /*could be of Type: Tester, Tester*/ - y= new Tester(); - y.m3(x); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestExtendedClassesWithBoundedGenerics.java b/test/mycompiler/test/generics/TestExtendedClassesWithBoundedGenerics.java deleted file mode 100755 index dacf31256..000000000 --- a/test/mycompiler/test/generics/TestExtendedClassesWithBoundedGenerics.java +++ /dev/null @@ -1,90 +0,0 @@ -package mycompiler.test.generics; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -import mycompiler.test.expectationTypes.TypePlaceholderExpect; - -/** - * checks extended usage of generics, however test fails up to now because of no relation between class generics and method generics - * @author - * 21-04-08 - */ - - -public class TestExtendedClassesWithBoundedGenerics extends AbstractInferenceTest{ - - private final static String TESTEDCLASSNAME="TestExtendedClassesWithBoundedGenerics"; - private final static String JAVPATH="test/mycompiler/test/generics/"; - - public TestExtendedClassesWithBoundedGenerics(String name) { - super(name,TestExtendedClassesWithBoundedGenerics.JAVPATH+TestExtendedClassesWithBoundedGenerics.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //interfaces - ClassExpect i1 = new ClassExpect("I1"); - ClassExpect i2 = new ClassExpect("I2"); - - //classes - ClassExpect impl = new ClassExpect("Implementation"); - ClassExpect testExtendedClassesWithBoundedGenerics = new ClassExpect(TestExtendedClassesWithBoundedGenerics.TESTEDCLASSNAME); - ClassExpect tester = new ClassExpect("Tester"); - - //generics - Menge bounds = new Menge(); - bounds.add(new RefType("I1",-1)); - bounds.add(new RefType("I2",-1)); - BoundedGenericTypeVar t = new BoundedGenericTypeVar("T",bounds,-1); - tester.addGeneric(t); - - //methods - MethodExpect m1 = new MethodExpect("m1", new TypePlaceholderExpect("a")); - i1.addMethod(m1); - MethodExpect m2 = new MethodExpect("m2", new TypePlaceholderExpect("b")); - i2.addMethod(m2); - - MethodExpect mImpl1 = new MethodExpect("m1", new RefType("void",-1)); - MethodExpect mImpl2 = new MethodExpect("m2", new RefType("void",-1)); - - impl.addMethod(mImpl1); - impl.addMethod(mImpl2); - - MethodExpect m3 = new MethodExpect("m3", new RefType("void",-1)); - m3.addParameter(new VarExpect("x", t)); - tester.addMethod(m3); - - MethodExpect m = new MethodExpect("m", new RefType("void",-1)); - VarExpect x = new VarExpect("x",new RefType("Implementation",-1)); - //x.addExpectedType(new RefType("I1",-1)); - //x.addExpectedType(new RefType("I2",-1)); - m.getBlock().addLocalVar(x); - - Menge testerParams1 = new Menge(); - testerParams1.add(new RefType("Implementation",-1)); - Menge testerParams2 = new Menge(); - testerParams2.add(new SuperWildcardType(-1,new RefType("Implementation",-1))); - VarExpect y = new VarExpect("y",new RefType("Tester",testerParams1,-1)); - y.addExpectedType(new RefType("Tester",testerParams2,-1)); - m.getBlock().addLocalVar(y); - - testExtendedClassesWithBoundedGenerics.addMethod(m); - - Expectation ret = new Expectation(testExtendedClassesWithBoundedGenerics); - ret.addClass(i1); - ret.addClass(i2); - ret.addClass(impl); - ret.addClass(tester); - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestNestedGenerics.jav b/test/mycompiler/test/generics/TestNestedGenerics.jav deleted file mode 100755 index 1b34d70c4..000000000 --- a/test/mycompiler/test/generics/TestNestedGenerics.jav +++ /dev/null @@ -1,14 +0,0 @@ -class A{ - -} - -public class TestNestedGenerics{ - ,C> void foo(T a,C b){} - - void m(){ - TestNestedGenerics t = new TestNestedGenerics(); - String str = new String(); - A a = new A(); - t.foo(a,str); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestNestedGenerics.java b/test/mycompiler/test/generics/TestNestedGenerics.java deleted file mode 100755 index 6d2cc1673..000000000 --- a/test/mycompiler/test/generics/TestNestedGenerics.java +++ /dev/null @@ -1,64 +0,0 @@ -package mycompiler.test.generics; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** - * 16-05-08 - * @author - * - * this test tests for nested generics, meaning a generic whose bound is another class with a generic - */ -public class TestNestedGenerics extends AbstractInferenceTest{ - - private final static String TESTEDCLASSNAME="TestNestedGenerics"; - private final static String JAVPATH="test/mycompiler/test/generics/"; - - public TestNestedGenerics(String name) { - super(name,TestNestedGenerics.JAVPATH+TestNestedGenerics.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testNestedGenerics = new ClassExpect(TestNestedGenerics.TESTEDCLASSNAME); - ClassExpect a = new ClassExpect("A"); - a.addGeneric(new GenericTypeVar("T",-1)); - - //Methods - MethodExpect foo = new MethodExpect("foo",new RefType("void",-1)); - BoundedGenericTypeVar genericT = new BoundedGenericTypeVar("T",-1); - GenericTypeVar genericC = new GenericTypeVar("C",-1); - Menge param = new Menge(); - param.add(genericC); - genericT.addBound(new RefType("A",param,-1)); - foo.addParameter(new VarExpect("a",genericT)); - foo.addParameter(new VarExpect("b",genericC)); - - MethodExpect m = new MethodExpect("m", new RefType("void",-1)); - m.getBlock().addLocalVar(new VarExpect("t", new RefType("TestNestedGenerics",-1))); - m.getBlock().addLocalVar(new VarExpect("str",new RefType("java.lang.String",-1))); - RefType typeString = new RefType("java.lang.String",-1); - Mengeparam2 = new Menge(); - param2.add(typeString); - m.getBlock().addLocalVar(new VarExpect("a", new RefType("A",param2,-1))); - - testNestedGenerics.addMethod(foo); - testNestedGenerics.addMethod(m); - - Expectation ret = new Expectation(testNestedGenerics); - ret.addClass(a); - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestNestedGenericsNonExistingType.jav b/test/mycompiler/test/generics/TestNestedGenericsNonExistingType.jav deleted file mode 100755 index 428cdda4c..000000000 --- a/test/mycompiler/test/generics/TestNestedGenericsNonExistingType.jav +++ /dev/null @@ -1,6 +0,0 @@ - -public class TestNestedGenerics{ - - ,C> void foo(T a,C b){} - -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestNestedGenericsNonExistingType.java b/test/mycompiler/test/generics/TestNestedGenericsNonExistingType.java deleted file mode 100755 index 263a51a11..000000000 --- a/test/mycompiler/test/generics/TestNestedGenericsNonExistingType.java +++ /dev/null @@ -1,51 +0,0 @@ -package mycompiler.test.generics; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** - * 16-05-08 - * @author - * - * tests case where bounds are of a non exisiting type -> should throw error - */ -public class TestNestedGenericsNonExistingType extends AbstractInferenceTest{ - - private final static String TESTEDCLASSNAME="TestNestedGenericsNonExistingType"; - private final static String JAVPATH="test/mycompiler/test/generics/"; - - public TestNestedGenericsNonExistingType(String name) { - super(name,TestNestedGenericsNonExistingType.JAVPATH+TestNestedGenericsNonExistingType.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testNestedGenericsNonExistingType = new ClassExpect(TestNestedGenericsNonExistingType.TESTEDCLASSNAME); - - //Methods - MethodExpect foo = new MethodExpect("foo",new RefType("void",-1)); - BoundedGenericTypeVar genericT = new BoundedGenericTypeVar("T",-1); - GenericTypeVar genericC = new GenericTypeVar("C",-1); - Menge param = new Menge(); - param.add(genericC); - genericT.addBound(new RefType("A",param,-1)); - foo.addParameter(new VarExpect("a",genericT)); - foo.addParameter(new VarExpect("b",genericC)); - - testNestedGenericsNonExistingType.addMethod(foo); - - return new Expectation(testNestedGenericsNonExistingType); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestSimpleClassesWithBoundedGenerics.jav b/test/mycompiler/test/generics/TestSimpleClassesWithBoundedGenerics.jav deleted file mode 100755 index 8b43ff952..000000000 --- a/test/mycompiler/test/generics/TestSimpleClassesWithBoundedGenerics.jav +++ /dev/null @@ -1,30 +0,0 @@ -import de.dhbwstuttgart.typeinference.Menge; -import java.util.HashMap; - -public class TestSimpleClassesWithBoundedGenerics { - - public ma(T x) { - return x; - } -} - -class A { - - public m1() { - x; - x= new TestSimpleClassesWithBoundedGenerics(); - return x.ma(3); - } - - public m2() { - x; - x = new TestSimpleClassesWithBoundedGenerics(); - } -/* - public m2() { - x; - x= new TestSimpleClassesWithBoundedGenerics(); - return x.m(new Double(3.)); - } -*/ -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestSimpleClassesWithBoundedGenerics.java b/test/mycompiler/test/generics/TestSimpleClassesWithBoundedGenerics.java deleted file mode 100755 index 77ea4fabe..000000000 --- a/test/mycompiler/test/generics/TestSimpleClassesWithBoundedGenerics.java +++ /dev/null @@ -1,71 +0,0 @@ -package mycompiler.test.generics; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** - * 13-05-08 - * @author - * - * test bounded generics - */ -public class TestSimpleClassesWithBoundedGenerics extends AbstractInferenceTest{ - - private final static String TESTEDCLASSNAME="TestSimpleClassesWithBoundedGenerics"; - private final static String JAVPATH="test/mycompiler/test/generics/"; - - public TestSimpleClassesWithBoundedGenerics(String name) { - super(name,TestSimpleClassesWithBoundedGenerics.JAVPATH+TestSimpleClassesWithBoundedGenerics.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testSimpleClassesWithBoundedGenerics = new ClassExpect(TestSimpleClassesWithBoundedGenerics.TESTEDCLASSNAME); - ClassExpect a = new ClassExpect("A"); - - //generics - BoundedGenericTypeVar t = new BoundedGenericTypeVar("T",-1); - t.addBound(new RefType("java.lang.Number",-1)); - testSimpleClassesWithBoundedGenerics.addGeneric(t); - - - //methods - MethodExpect ma = new MethodExpect("ma", t); - ma.addParameter(new VarExpect("x", t)); - testSimpleClassesWithBoundedGenerics.addMethod(ma); - - MethodExpect m1 = new MethodExpect("m1", new RefType("java.lang.Integer",-1)); - Menge param = new Menge(); - param.add(new RefType("java.lang.Integer",-1)); - m1.getBlock().addLocalVar(new VarExpect("x", new RefType(TestSimpleClassesWithBoundedGenerics.TESTEDCLASSNAME,param,-1))); - a.addMethod(m1); - - MethodExpect m2 = new MethodExpect("m2", new RefType("void",-1)); - Menge testerParams1 = new Menge(); - testerParams1.add(new RefType("java.lang.Double",-1)); - Menge testerParams2 = new Menge(); - testerParams2.add(new SuperWildcardType(-1,new RefType("java.lang.Double",-1))); - Menge testerParams3 = new Menge(); - testerParams3.add(new ExtendsWildcardType(-1,new RefType("java.lang.Double",-1))); - VarExpect x = new VarExpect("x",new RefType("TestSimpleClassesWithBoundedGenerics",testerParams1,-1)); - x.addExpectedType(new RefType("TestSimpleClassesWithBoundedGenerics",testerParams2,-1)); - x.addExpectedType(new RefType("TestSimpleClassesWithBoundedGenerics",testerParams3,-1)); - m2.getBlock().addLocalVar(x); - a.addMethod(m2); - - Expectation ret = new Expectation(testSimpleClassesWithBoundedGenerics); - ret.addClass(a); - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestSimpleClassesWithBoundedGenericsNegative.jav b/test/mycompiler/test/generics/TestSimpleClassesWithBoundedGenericsNegative.jav deleted file mode 100755 index 19ef124c3..000000000 --- a/test/mycompiler/test/generics/TestSimpleClassesWithBoundedGenericsNegative.jav +++ /dev/null @@ -1,17 +0,0 @@ - -public class TestSimpleClassesWithBoundedGenericsNegative { - - public m(T x) { - return x; - } - -} - -class A { - public m1() { - x; - x = new TestSimpleClassesWithBoundedGenericsNegative(); - return x.m("abc"); - - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestSimpleClassesWithBoundedGenericsNegative.java b/test/mycompiler/test/generics/TestSimpleClassesWithBoundedGenericsNegative.java deleted file mode 100755 index 68036d579..000000000 --- a/test/mycompiler/test/generics/TestSimpleClassesWithBoundedGenericsNegative.java +++ /dev/null @@ -1,62 +0,0 @@ -package mycompiler.test.generics; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * verifies correct identification of a bounded generic which is instanciated with a type not included in bounds - * @author tom - * - */ - - -public class TestSimpleClassesWithBoundedGenericsNegative extends AbstractInferenceTest{ - - private final static String TESTEDCLASSNAME="TestSimpleClassesWithBoundedGenericsNegative"; - private final static String JAVPATH="test/mycompiler/test/generics/"; - - public TestSimpleClassesWithBoundedGenericsNegative(String name) { - super(name,TestSimpleClassesWithBoundedGenericsNegative.JAVPATH+TestSimpleClassesWithBoundedGenericsNegative.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testSimpleClassesWithBoundedGenericsNegative = new ClassExpect(TestSimpleClassesWithBoundedGenericsNegative.TESTEDCLASSNAME); - ClassExpect a = new ClassExpect("A"); - - //generics - BoundedGenericTypeVar t = new BoundedGenericTypeVar("T",-1); - t.addBound(new RefType("java.lang.Number",-1)); - testSimpleClassesWithBoundedGenericsNegative.addGeneric(t); - - - //methods - MethodExpect m = new MethodExpect("m", t); - m.addParameter(new VarExpect("x", t)); - testSimpleClassesWithBoundedGenericsNegative.addMethod(m); - - MethodExpect m1 = new MethodExpect("m1", new RefType("java.lang.String",-1)); - Menge param = new Menge(); - param.add(new RefType("java.lang.String",-1)); - m1.getBlock().addLocalVar(new VarExpect("x", new RefType(TestSimpleClassesWithBoundedGenericsNegative.TESTEDCLASSNAME,param,-1))); - a.addMethod(m1); - - Expectation ret = new Expectation(testSimpleClassesWithBoundedGenericsNegative); - ret.addClass(a); - - //Exception expected!!! - ret.addException(new Exception()); - - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestSimpleClassesWithGenerics.jav b/test/mycompiler/test/generics/TestSimpleClassesWithGenerics.jav deleted file mode 100755 index 359b9a522..000000000 --- a/test/mycompiler/test/generics/TestSimpleClassesWithGenerics.jav +++ /dev/null @@ -1,17 +0,0 @@ -public class TestSimpleClassesWithGenerics { - - public m(T x) { - return x; - } - -} - -class A { - - public method() { - x; - x= new TestSimpleClassesWithGenerics(); - return x.m(3); - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestSimpleClassesWithGenerics.java b/test/mycompiler/test/generics/TestSimpleClassesWithGenerics.java deleted file mode 100755 index 7dfed4f9d..000000000 --- a/test/mycompiler/test/generics/TestSimpleClassesWithGenerics.java +++ /dev/null @@ -1,58 +0,0 @@ -package mycompiler.test.generics; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * checks simple usage of generics without bounds - * @author tom - * - */ - - -public class TestSimpleClassesWithGenerics extends AbstractInferenceTest{ - - private final static String TESTEDCLASSNAME="TestSimpleClassesWithGenerics"; - private final static String JAVPATH="test/mycompiler/test/generics/"; - - public TestSimpleClassesWithGenerics(String name) { - super(name,TestSimpleClassesWithGenerics.JAVPATH+TestSimpleClassesWithGenerics.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testSimpleClassesWithGenerics = new ClassExpect(TestSimpleClassesWithGenerics.TESTEDCLASSNAME); - ClassExpect a = new ClassExpect("A"); - - //generics - GenericTypeVar t = new GenericTypeVar("T",-1); - testSimpleClassesWithGenerics.addGeneric(t); - - - //methods - MethodExpect m = new MethodExpect("m", t); - m.addParameter(new VarExpect("x", t)); - testSimpleClassesWithGenerics.addMethod(m); - - MethodExpect m1 = new MethodExpect("method", new RefType("java.lang.Integer",-1)); - Menge param = new Menge(); - param.add(new RefType("java.lang.Integer",-1)); - m1.getBlock().addLocalVar(new VarExpect("x", new RefType(TestSimpleClassesWithGenerics.TESTEDCLASSNAME,param,-1))); - a.addMethod(m1); - - Expectation ret = new Expectation(testSimpleClassesWithGenerics); - ret.addClass(a); - - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestSimpleClassesWithGenericsNegative.jav b/test/mycompiler/test/generics/TestSimpleClassesWithGenericsNegative.jav deleted file mode 100755 index 938ea5044..000000000 --- a/test/mycompiler/test/generics/TestSimpleClassesWithGenericsNegative.jav +++ /dev/null @@ -1,17 +0,0 @@ -public class TestSimpleClassesWithGenericsNegative { - - public m(T x) { - return x; - } - -} - -class A { - - public method() { - x; - x= new TestSimpleClassesWithGenerics(); - return x.m("abc"); - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/generics/TestSimpleClassesWithGenericsNegative.java b/test/mycompiler/test/generics/TestSimpleClassesWithGenericsNegative.java deleted file mode 100755 index 2c00eae09..000000000 --- a/test/mycompiler/test/generics/TestSimpleClassesWithGenericsNegative.java +++ /dev/null @@ -1,59 +0,0 @@ -package mycompiler.test.generics; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * checks whether wrong usage of generics is detected - * @author tom - * - */ - - -public class TestSimpleClassesWithGenericsNegative extends AbstractInferenceTest{ - - private final static String TESTEDCLASSNAME="TestSimpleClassesWithGenericsNegative"; - private final static String JAVPATH="test/mycompiler/test/generics/"; - - public TestSimpleClassesWithGenericsNegative(String name) { - super(name,TestSimpleClassesWithGenericsNegative.JAVPATH+TestSimpleClassesWithGenericsNegative.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testSimpleClassesWithGenericsNegative = new ClassExpect(TestSimpleClassesWithGenericsNegative.TESTEDCLASSNAME); - ClassExpect a = new ClassExpect("A"); - - //generics - GenericTypeVar t = new GenericTypeVar("T",-1); - testSimpleClassesWithGenericsNegative.addGeneric(t); - - - //methods - MethodExpect m = new MethodExpect("m", t); - m.addParameter(new VarExpect("x", t)); - testSimpleClassesWithGenericsNegative.addMethod(m); - - MethodExpect m1 = new MethodExpect("method", new RefType("java.lang.String",-1)); - Menge param = new Menge(); - param.add(new RefType("java.lang.Integer",-1)); - m1.getBlock().addLocalVar(new VarExpect("x", new RefType(TestSimpleClassesWithGenericsNegative.TESTEDCLASSNAME,param,-1))); - a.addMethod(m1); - - Expectation ret = new Expectation(testSimpleClassesWithGenericsNegative); - ret.addClass(a); - //Exception - ret.addException(new Exception()); - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/AllTestsInferenceByCharacteristic.java b/test/mycompiler/test/inferenceByCharacteristic/AllTestsInferenceByCharacteristic.java deleted file mode 100755 index 61f294e16..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/AllTestsInferenceByCharacteristic.java +++ /dev/null @@ -1,26 +0,0 @@ -package mycompiler.test.inferenceByCharacteristic; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsInferenceByCharacteristic { - - public static Test suite() { - TestSuite suite = new TestSuite( - "Test for mycompiler.test.inferenceByCharacteristic"); - //$JUnit-BEGIN$ - suite.addTestSuite(TestInferenceStdTypeByReturnType.class); - suite.addTestSuite(TestInferenceOwnTypeByMemberAcrossClasses.class); - suite.addTestSuite(TestInferenceOwnTypeByReturnType.class); - suite.addTestSuite(TestInferenceStdTypeByOperation.class); - suite.addTestSuite(TestInferenceOwnTypeByMember.class); - suite.addTestSuite(TestInferenceOwnTypeByMethodReturnTypeMixed1.class); - suite.addTestSuite(TestInferenceOwnTypeByMethodParameter.class); - suite.addTestSuite(TestInferenceOwnTypeByMethodCallAcrossClasses.class); - suite.addTestSuite(TestInferenceOwnTypeByMethodCall.class); - suite.addTestSuite(TestInferenceOwnTypeByReturnTypeAcrossClasses.class); - //$JUnit-END$ - return suite; - } - -} diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMember.jav b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMember.jav deleted file mode 100755 index d6b39b878..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMember.jav +++ /dev/null @@ -1,16 +0,0 @@ -public class TestInferenceOwnTypeByMember { - - Float a; - - public void m1(b) { - a += b; - } - - public void m2(a) { - this.a=a; - } - - public m3() { - return a; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMember.java b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMember.java deleted file mode 100755 index 897943fa7..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMember.java +++ /dev/null @@ -1,52 +0,0 @@ -package mycompiler.test.inferenceByCharacteristic; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 28-04-08 - * @author - * - * test inference by member of same class - */ - -public class TestInferenceOwnTypeByMember extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestInferenceOwnTypeByMember"; - private final static String JAVPATH="test/mycompiler/test/inferenceByCharacteristic/"; - - public TestInferenceOwnTypeByMember(String name) { - super(name,TestInferenceOwnTypeByMember.JAVPATH+TestInferenceOwnTypeByMember.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testInferenceOwnTypeByMember = new ClassExpect(TestInferenceOwnTypeByMember.TESTEDCLASSNAME); - //Member - testInferenceOwnTypeByMember.addMember(new VarExpect("a", new RefType("java.lang.Float",-1))); - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("void",-1),0); - m1.addParameter(new VarExpect("b",new RefType("java.lang.Float",-1))); - - MethodExpect m2 = new MethodExpect("m2",new RefType("void",-1),0); - m2.addParameter(new VarExpect("a",new RefType("java.lang.Float",-1))); - - MethodExpect m3 = new MethodExpect("m3",new RefType("java.lang.Float",-1),0); - - - - - testInferenceOwnTypeByMember.addMethod(m1); - //testInferenceOwnTypeByMember.addMethod(m2); - testInferenceOwnTypeByMember.addMethod(m3); - - return new Expectation(testInferenceOwnTypeByMember); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMemberAcrossClasses.jav b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMemberAcrossClasses.jav deleted file mode 100755 index c595b224b..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMemberAcrossClasses.jav +++ /dev/null @@ -1,14 +0,0 @@ -class A { - - public Character c; - -} - -public class TestInferenceOwnTypeByMemberAcrossClasses { - - public m1(a) { - x; - x = new A(); - a=x.c; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMemberAcrossClasses.java b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMemberAcrossClasses.java deleted file mode 100755 index 8493685a7..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMemberAcrossClasses.java +++ /dev/null @@ -1,47 +0,0 @@ -package mycompiler.test.inferenceByCharacteristic; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 28-04-08 - * @author - * - * test inference by member across different classes - */ - -public class TestInferenceOwnTypeByMemberAcrossClasses extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestInferenceOwnTypeByMemberAcrossClasses"; - private final static String JAVPATH="test/mycompiler/test/inferenceByCharacteristic/"; - - public TestInferenceOwnTypeByMemberAcrossClasses(String name) { - super(name,TestInferenceOwnTypeByMemberAcrossClasses.JAVPATH+TestInferenceOwnTypeByMemberAcrossClasses.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect a = new ClassExpect("A"); - ClassExpect testInferenceOwnTypeByMemberAcrossClasses = new ClassExpect(TestInferenceOwnTypeByMemberAcrossClasses.TESTEDCLASSNAME); - //Member - a.addMember(new VarExpect("c", new RefType("java.lang.Character",-1))); - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("void",-1),0); - m1.addParameter(new VarExpect("a",new RefType("java.lang.Character",-1))); - m1.getBlock().addLocalVar(new VarExpect("x",new RefType("A",-1))); - - - testInferenceOwnTypeByMemberAcrossClasses.addMethod(m1); - - Expectation ret = new Expectation(testInferenceOwnTypeByMemberAcrossClasses); - ret.addClass(a); - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodCall.jav b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodCall.jav deleted file mode 100755 index fc3ca3d2e..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodCall.jav +++ /dev/null @@ -1,32 +0,0 @@ -public class TestInferenceOwnTypeByMethodCall{ - - public m1(a) { - return a; - } - - public Integer m2(a) { - return a; - } - - public m3(a) { - return a; - } - - - - public void m01(d) { - e; - e=m1(d); - } - - public void m02(d) { - e; - e=m2(d); - } - - public void m03(c,Character d) { - e; - e=c.m3(d); - } - - } \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodCall.java b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodCall.java deleted file mode 100755 index aac98c000..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodCall.java +++ /dev/null @@ -1,68 +0,0 @@ -package mycompiler.test.inferenceByCharacteristic; - -import de.dhbwstuttgart.logger.xml.DOMConfigurator; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.GenericTypeVarExpect; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 29-04-08 - * @author - * - * test checks extended inference by return type of a method of same class - */ - -public class TestInferenceOwnTypeByMethodCall extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestInferenceOwnTypeByMethodCall"; - private final static String JAVPATH="test/mycompiler/test/inferenceByCharacteristic/"; - - public TestInferenceOwnTypeByMethodCall(String name) { - super(name,TestInferenceOwnTypeByMethodCall.JAVPATH+TestInferenceOwnTypeByMethodCall.TESTEDCLASSNAME + ".jav"); - DOMConfigurator.configure("test/log4jTesting.xml"); - DOMConfigurator.configure("log4j.xml"); - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testInferenceOwnTypeByMethodCall = new ClassExpect(TestInferenceOwnTypeByMethodCall.TESTEDCLASSNAME); - //Member - - //Methods - MethodExpect m1 = new MethodExpect("m1",new GenericTypeVarExpect("a")); - m1.addParameter(new VarExpect("a",new GenericTypeVarExpect("a"))); - MethodExpect m2 = new MethodExpect("m2",new RefType("java.lang.Integer",-1)); - m2.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - MethodExpect m3 = new MethodExpect("m3",new RefType("java.lang.Character",-1)); - m3.addParameter(new VarExpect("a",new RefType("java.lang.Character",-1))); - - MethodExpect m01 = new MethodExpect("m01",new RefType("void",-1)); - m01.addParameter(new VarExpect("d",new GenericTypeVarExpect("a"))); - m01.getBlock().addLocalVar(new VarExpect("e",new GenericTypeVarExpect("a"))); - MethodExpect m02 = new MethodExpect("m02",new RefType("void",-1),0); - m02.addParameter(new VarExpect("d",new RefType("java.lang.Integer",-1))); - m02.getBlock().addLocalVar(new VarExpect("e",new RefType("java.lang.Integer",-1))); - MethodExpect m03 = new MethodExpect("m03",new RefType("void",-1),0); - m03.addParameter(new VarExpect("c",new RefType(TestInferenceOwnTypeByMethodCall.TESTEDCLASSNAME,-1))); - m03.addParameter(new VarExpect("d",new RefType("java.lang.Character",-1))); - m03.getBlock().addLocalVar(new VarExpect("e",new RefType("java.lang.Character",-1))); - - - testInferenceOwnTypeByMethodCall.addMethod(m1); - testInferenceOwnTypeByMethodCall.addMethod(m2); - testInferenceOwnTypeByMethodCall.addMethod(m3); - - testInferenceOwnTypeByMethodCall.addMethod(m01); - testInferenceOwnTypeByMethodCall.addMethod(m02); - testInferenceOwnTypeByMethodCall.addMethod(m03); - - - return new Expectation(testInferenceOwnTypeByMethodCall); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodCallAcrossClasses.jav b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodCallAcrossClasses.jav deleted file mode 100755 index 4bb4bcce8..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodCallAcrossClasses.jav +++ /dev/null @@ -1,18 +0,0 @@ -class A{ - public mA(x){ - return(x); - } -} - -class TestInferenceOwnTypeByMethodCallAcrossClasses{ - - public m(Integer a, String b){ - x; - x=new A(); - c; - c=x.mA(a); - d; - d=x.mA(b); - - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodCallAcrossClasses.java b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodCallAcrossClasses.java deleted file mode 100755 index 7ece1945d..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodCallAcrossClasses.java +++ /dev/null @@ -1,55 +0,0 @@ -package mycompiler.test.inferenceByCharacteristic; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -import mycompiler.test.expectationTypes.GenericTypeVarExpect; - -/** - * 28-04-08 - * @author - * - * tests method call across classes - */ - -public class TestInferenceOwnTypeByMethodCallAcrossClasses extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestInferenceOwnTypeByMethodCallAcrossClasses"; - private final static String JAVPATH="test/mycompiler/test/inferenceByCharacteristic/"; - - public TestInferenceOwnTypeByMethodCallAcrossClasses(String name) { - super(name,TestInferenceOwnTypeByMethodCallAcrossClasses.JAVPATH+TestInferenceOwnTypeByMethodCallAcrossClasses.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect a = new ClassExpect("A"); - ClassExpect testInferenceOwnTypeByMethodCallAcrossClasses = new ClassExpect(TestInferenceOwnTypeByMethodCallAcrossClasses.TESTEDCLASSNAME); - //Member - - //Methods - MethodExpect m = new MethodExpect("m",new RefType("void",-1),0); - m.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - m.addParameter(new VarExpect("b",new RefType("java.lang.String",-1))); - m.getBlock().addLocalVar(new VarExpect("c",new RefType("java.lang.Integer",-1))); - m.getBlock().addLocalVar(new VarExpect("d",new RefType("java.lang.String",-1))); - m.getBlock().addLocalVar(new VarExpect("x",new RefType("A",-1))); - - - MethodExpect mA = new MethodExpect("mA",new GenericTypeVarExpect("a")); - mA.addParameter(new VarExpect("x",new GenericTypeVarExpect("a"))); - - - testInferenceOwnTypeByMethodCallAcrossClasses.addMethod(m); - a.addMethod(mA); - - Expectation ret = new Expectation(testInferenceOwnTypeByMethodCallAcrossClasses); - ret.addClass(a); - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodParameter.jav b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodParameter.jav deleted file mode 100755 index 0970988fc..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodParameter.jav +++ /dev/null @@ -1,19 +0,0 @@ -class A { - static void m() {} -} - -public class TestInferenceOwnTypeByMethodParameter { - - m1(a,b) { - return a+b; - } - - m2(java.lang.String a) { - return a; - } - - m3(a) { - return a.m(); - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodParameter.java b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodParameter.java deleted file mode 100755 index c6f5d942e..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodParameter.java +++ /dev/null @@ -1,61 +0,0 @@ -package mycompiler.test.inferenceByCharacteristic; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** - * 28-04-08 - * @author - * - * checks inference by method parameter - */ - -public class TestInferenceOwnTypeByMethodParameter extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestInferenceOwnTypeByMethodParameter"; - private final static String JAVPATH="test/mycompiler/test/inferenceByCharacteristic/"; - - public TestInferenceOwnTypeByMethodParameter(String name) { - super(name,TestInferenceOwnTypeByMethodParameter.JAVPATH+TestInferenceOwnTypeByMethodParameter.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect a = new ClassExpect("A"); - ClassExpect testInferenceOwnTypeByMethodParameter = new ClassExpect(TestInferenceOwnTypeByMethodParameter.TESTEDCLASSNAME); - //Member - - //Methods - MethodExpect m = new MethodExpect("m", new RefType("void",-1)); - - MethodExpect m1 = new MethodExpect("m1"); - m1.setReturntypes(createMengeAllNumberTypes()); - VarExpect m1a = new VarExpect("a"); - VarExpect m1b = new VarExpect("b"); - m1a.setExpectedType(createMengeAllNumberTypes()); - m1b.setExpectedType(createMengeAllNumberTypes()); - m1.addParameter(m1a); - m1.addParameter(m1b); - - MethodExpect m2 = new MethodExpect("m2",new RefType("java.lang.String",-1)); - m2.addParameter(new VarExpect("a", new RefType("java.lang.String",-1))); - - - MethodExpect m3 = new MethodExpect("m3",new RefType("void",-1),0); - m3.addParameter(new VarExpect("a",new RefType("A",-1))); - - testInferenceOwnTypeByMethodParameter.addMethod(m1); - testInferenceOwnTypeByMethodParameter.addMethod(m2); - testInferenceOwnTypeByMethodParameter.addMethod(m3); - a.addMethod(m); - - Expectation ret = new Expectation(testInferenceOwnTypeByMethodParameter); - ret.addClass(a); - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodReturnTypeMixed1.jav b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodReturnTypeMixed1.jav deleted file mode 100755 index b6e341d3f..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodReturnTypeMixed1.jav +++ /dev/null @@ -1,20 +0,0 @@ -class A1{ - void foo(java.lang.String x){} -} -class A2{ - void foo(java.lang.Integer y){} -} -class B1{ - java.lang.String bar(){return("");} -} -class B2{ - java.lang.Integer bar(){return(1);} -} -public class TestInferenceOwnTypeByMethodReturnTypeMixed1{ - method1(a,b){ - a.foo(b.bar()); - } - method2(a,B2 b) { - a.foo(b.bar()); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodReturnTypeMixed1.java b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodReturnTypeMixed1.java deleted file mode 100755 index a771f483c..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByMethodReturnTypeMixed1.java +++ /dev/null @@ -1,71 +0,0 @@ -package mycompiler.test.inferenceByCharacteristic; -/** -* 26-04-08 -* @author -* -* identifying type of a variable by parameter passed to a method of another class -*/ -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class TestInferenceOwnTypeByMethodReturnTypeMixed1 extends AbstractInferenceTest{ - private final static String TESTEDCLASSNAME="TestInferenceOwnTypeByMethodReturnTypeMixed1"; - private final static String JAVPATH="test/mycompiler/test/inferenceByCharacteristic/"; - - public TestInferenceOwnTypeByMethodReturnTypeMixed1(String name) { - super(name,TestInferenceOwnTypeByMethodReturnTypeMixed1.JAVPATH+TestInferenceOwnTypeByMethodReturnTypeMixed1.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //classes - ClassExpect testInferenceOwnTypeByMethodReturnTypeMixed1 = new ClassExpect(TestInferenceOwnTypeByMethodReturnTypeMixed1.TESTEDCLASSNAME); - ClassExpect a1 = new ClassExpect("A1"); - ClassExpect a2 = new ClassExpect("A2"); - ClassExpect b1 = new ClassExpect("B1"); - ClassExpect b2 = new ClassExpect("B2"); - - //Methods - MethodExpect method1 = new MethodExpect("method1",new RefType("void",-1)); - MethodExpect method2 = new MethodExpect("method2",new RefType("void",-1)); - VarExpect method1a = new VarExpect("a",new RefType("A1",-1)); - method1a.addExpectedType(new RefType("A2",-1)); - VarExpect method1b = new VarExpect("b",new RefType("B1",-1)); - method1b.addExpectedType(new RefType("B2",-1)); - method1.addParameter(method1a); - method1.addParameter(method1b); - method2.addParameter(new VarExpect("a", new RefType("A2",-1))); - method2.addParameter(new VarExpect("b", new RefType("B2",-1))); - - - MethodExpect foo1 = new MethodExpect("foo", new RefType("void",-1)); - foo1.addParameter(new VarExpect("x", new RefType("java.lang.String",-1))); - MethodExpect foo2 = new MethodExpect("foo", new RefType("void",-1)); - foo2.addParameter(new VarExpect("y", new RefType("java.lang.Integer",-1))); - - MethodExpect bar1 = new MethodExpect("bar", new RefType("java.lang.String",-1)); - MethodExpect bar2 = new MethodExpect("bar", new RefType("java.lang.Integer",-1)); - - - testInferenceOwnTypeByMethodReturnTypeMixed1.addMethod(method1); - testInferenceOwnTypeByMethodReturnTypeMixed1.addMethod(method2); - a1.addMethod(foo1); - a2.addMethod(foo2); - b1.addMethod(bar1); - b2.addMethod(bar2); - - Expectation ret = new Expectation(testInferenceOwnTypeByMethodReturnTypeMixed1); - ret.addClass(a1); - ret.addClass(a2); - ret.addClass(b1); - ret.addClass(b2); - - - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByReturnType.jav b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByReturnType.jav deleted file mode 100755 index 559fde50a..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByReturnType.jav +++ /dev/null @@ -1,18 +0,0 @@ -public class TestInferenceOwnTypeByReturnType { - - public java.lang.Integer m1(a) { - return a; - } - - public String m2() { - return "abc"; - } - - public void m3(a) { - a=m2(); - } - - public java.lang.Integer m4(a,b) { - return a+b; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByReturnType.java b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByReturnType.java deleted file mode 100755 index 81b10adf1..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByReturnType.java +++ /dev/null @@ -1,56 +0,0 @@ -package mycompiler.test.inferenceByCharacteristic; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 28-04-08 - * @author - * - * checks inference by method return type -*/ - -public class TestInferenceOwnTypeByReturnType extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestInferenceOwnTypeByReturnType"; - private final static String JAVPATH="test/mycompiler/test/inferenceByCharacteristic/"; - - public TestInferenceOwnTypeByReturnType(String name) { - super(name,TestInferenceOwnTypeByReturnType.JAVPATH+TestInferenceOwnTypeByReturnType.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testInferenceOwnTypeByReturnType = new ClassExpect(TestInferenceOwnTypeByReturnType.TESTEDCLASSNAME); - //Member - - //Methods - - MethodExpect m1 = new MethodExpect("m1",new RefType("java.lang.Integer",-1)); - m1.addParameter(new VarExpect("a", new RefType("java.lang.Integer",-1))); - - MethodExpect m2 = new MethodExpect("m2",new RefType("java.lang.String",-1)); - - MethodExpect m3 = new MethodExpect("m3",new RefType("void",-1)); - m3.addParameter(new VarExpect("a",new RefType("java.lang.String",-1))); - - MethodExpect m4 = new MethodExpect("m4", new RefType("java.lang.Integer",-1)); - m4.addParameter(new VarExpect("a", new RefType("java.lang.Integer",-1))); - m4.addParameter(new VarExpect("b", new RefType("java.lang.Integer",-1))); - - testInferenceOwnTypeByReturnType.addMethod(m1); - testInferenceOwnTypeByReturnType.addMethod(m2); - testInferenceOwnTypeByReturnType.addMethod(m3); - testInferenceOwnTypeByReturnType.addMethod(m4); - - - return new Expectation(testInferenceOwnTypeByReturnType); - - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByReturnTypeAcrossClasses.jav b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByReturnTypeAcrossClasses.jav deleted file mode 100755 index 243df6d9a..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByReturnTypeAcrossClasses.jav +++ /dev/null @@ -1,23 +0,0 @@ -class A{ - public String m() { - return "abc"; - } -} - -class B{ - public Integer m() { - return 1; - } -} - -public class TestInferenceOwnTypeByReturnTypeAcrossClasses { - - public main1(java.lang.Integer i, x){ - i=x.m(); - } - - public main2(i,x) { - i=x.m(); - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByReturnTypeAcrossClasses.java b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByReturnTypeAcrossClasses.java deleted file mode 100755 index bf5c07acb..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceOwnTypeByReturnTypeAcrossClasses.java +++ /dev/null @@ -1,66 +0,0 @@ -package mycompiler.test.inferenceByCharacteristic; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** -* 27-04-08 -* @author -* -* checks inference by return type across classes -*/ -public class TestInferenceOwnTypeByReturnTypeAcrossClasses extends AbstractInferenceTest{ - - private final static String TESTEDCLASSNAME="TestInferenceOwnTypeByReturnTypeAcrossClasses"; - private final static String JAVPATH="test/mycompiler/test/inferenceByCharacteristic/"; - - public TestInferenceOwnTypeByReturnTypeAcrossClasses(String name) { - super(name,TestInferenceOwnTypeByReturnTypeAcrossClasses.JAVPATH+TestInferenceOwnTypeByReturnTypeAcrossClasses.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //classes - ClassExpect testInferenceOwnTypeByReturnTypeAcrossClasses = new ClassExpect(TestInferenceOwnTypeByReturnTypeAcrossClasses.TESTEDCLASSNAME); - ClassExpect a = new ClassExpect("A"); - ClassExpect b = new ClassExpect("B"); - - //Methods - MethodExpect main1 = new MethodExpect("main1",new RefType("void",-1),0); - main1.addParameter(new VarExpect("i",new RefType("java.lang.Integer",-1))); - main1.addParameter(new VarExpect("x",new RefType("B",-1))); - - MethodExpect main2 = new MethodExpect("main2",new RefType("void",-1),0); - VarExpect main2i = new VarExpect("i", new RefType("java.lang.Integer",-1)); - main2i.addExpectedType(new RefType("java.lang.String",-1)); - main2.addParameter(main2i); - VarExpect main2x = new VarExpect("x", new RefType("A",-1)); - main2x.addExpectedType(new RefType("B",-1)); - main2.addParameter(main2x); - - MethodExpect foo1 = new MethodExpect("foo", new RefType("void",-1)); - foo1.addParameter(new VarExpect("x", new RefType("java.lang.String",-1))); - MethodExpect foo2 = new MethodExpect("foo", new RefType("void",-1)); - foo2.addParameter(new VarExpect("y", new RefType("java.lang.Integer",-1))); - - MethodExpect mA = new MethodExpect("m", new RefType("java.lang.String",-1)); - MethodExpect mB = new MethodExpect("m", new RefType("java.lang.Integer",-1)); - - - testInferenceOwnTypeByReturnTypeAcrossClasses.addMethod(main1); - testInferenceOwnTypeByReturnTypeAcrossClasses.addMethod(main2); - a.addMethod(mA); - b.addMethod(mB); - - Expectation ret = new Expectation(testInferenceOwnTypeByReturnTypeAcrossClasses); - ret.addClass(a); - ret.addClass(b); - - - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByMember.jav b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByMember.jav deleted file mode 100755 index a2c370f4b..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByMember.jav +++ /dev/null @@ -1,9 +0,0 @@ -import java.lang.System; - -public class TestInferenceStdTypeByMember { - - public m1(a) { - a=System.out; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByOperation.jav b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByOperation.jav deleted file mode 100755 index 955a14783..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByOperation.jav +++ /dev/null @@ -1,13 +0,0 @@ -import java.util.HashMap; -import java.lang.Object; - -public class TestInferenceStdTypeByOperation { - - public m1(a) { - a.put("1","1"); - } - - public m2(b) { - b.toString(); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByOperation.java b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByOperation.java deleted file mode 100755 index c098cf17a..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByOperation.java +++ /dev/null @@ -1,47 +0,0 @@ -package mycompiler.test.inferenceByCharacteristic; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** -* 4-05-08 -* @author -* -* checks inference of std types by operation -*/ - -public class TestInferenceStdTypeByOperation extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestInferenceStdTypeByOperation"; - private final static String JAVPATH="test/mycompiler/test/inferenceByCharacteristic/"; - - public TestInferenceStdTypeByOperation(String name) { - super(name,TestInferenceStdTypeByOperation.JAVPATH+TestInferenceStdTypeByOperation.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testInferenceStdTypeByOperation = new ClassExpect(TestInferenceStdTypeByOperation.TESTEDCLASSNAME); - //Member - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("void",-1)); - m1.addParameter(new VarExpect("a",new RefType("java.util.HashMap",-1))); - - MethodExpect m2 = new MethodExpect("m2",new RefType("void",-1)); - m2.addParameter(new VarExpect("b", new RefType("java.lang.Object",-1))); - - testInferenceStdTypeByOperation.addMethod(m1); - testInferenceStdTypeByOperation.addMethod(m2); - - - return new Expectation(testInferenceStdTypeByOperation); - - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByReturnType.jav b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByReturnType.jav deleted file mode 100755 index 7be9e282a..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByReturnType.jav +++ /dev/null @@ -1,18 +0,0 @@ -import de.dhbwstuttgart.typeinference.Menge; -import java.util.ArrayList; - -public class TestInferenceStdTypeByReturnType { - - public void m1(a) { - b; - b= new Menge(); - a = b.size(); - } - - public void m2(a) { - b; - b= new ArrayList(); - a = b.get(0); - - } -} \ No newline at end of file diff --git a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByReturnType.java b/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByReturnType.java deleted file mode 100755 index 733682660..000000000 --- a/test/mycompiler/test/inferenceByCharacteristic/TestInferenceStdTypeByReturnType.java +++ /dev/null @@ -1,80 +0,0 @@ -package mycompiler.test.inferenceByCharacteristic; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** -* 4-05-08 -* @author -* -* checks inference of std types by return type -*/ - -public class TestInferenceStdTypeByReturnType extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestInferenceStdTypeByReturnType"; - private final static String JAVPATH="test/mycompiler/test/inferenceByCharacteristic/"; - - public TestInferenceStdTypeByReturnType(String name) { - super(name,TestInferenceStdTypeByReturnType.JAVPATH+TestInferenceStdTypeByReturnType.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testInferenceStdTypeByReturnType = new ClassExpect(TestInferenceStdTypeByReturnType.TESTEDCLASSNAME); - //Member - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("void",-1)); - m1.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - - MethodExpect m2 = new MethodExpect("m2",new RefType("void",-1)); - m2.addParameter(new VarExpect("a", new RefType("java.lang.Object",-1))); - - - - //Vars - VarExpect m1B= new VarExpect("b"); - Menge paramsm1B1 = new Menge(); - paramsm1B1.add(new RefType("java.lang.String",-1)); - m1B.addExpectedType(new RefType("de.dhbwstuttgart.typeinference.Menge",paramsm1B1,-1)); - Menge paramsm1B2 = new Menge(); - paramsm1B2.add(new ExtendsWildcardType(-1,new RefType("java.lang.String",-1))); - m1B.addExpectedType(new RefType("de.dhbwstuttgart.typeinference.Menge",paramsm1B2,-1)); - Menge paramsm1B3 = new Menge(); - paramsm1B3.add(new SuperWildcardType(-1,new RefType("java.lang.String",-1))); - m1B.addExpectedType(new RefType("de.dhbwstuttgart.typeinference.Menge",paramsm1B3,-1)); - m1.getBlock().addLocalVar(m1B); - - VarExpect m2B= new VarExpect("b"); - Menge paramsm2B1 = new Menge(); - paramsm2B1.add(new RefType("java.lang.String",-1)); - m2B.addExpectedType(new RefType("java.util.ArrayList",paramsm2B1,-1)); - Menge paramsm2B2 = new Menge(); - paramsm2B2.add(new ExtendsWildcardType(-1,new RefType("java.lang.String",-1))); - m2B.addExpectedType(new RefType("java.util.ArrayList",paramsm2B2,-1)); - Menge paramsm2B3 = new Menge(); - paramsm2B3.add(new SuperWildcardType(-1,new RefType("java.lang.String",-1))); - m2B.addExpectedType(new RefType("java.util.ArrayList",paramsm2B3,-1)); - m2.getBlock().addLocalVar(m2B); - - - - testInferenceStdTypeByReturnType.addMethod(m1); - testInferenceStdTypeByReturnType.addMethod(m2); - - return new Expectation(testInferenceStdTypeByReturnType); - - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/inheritance/AllTestsInheritance.java b/test/mycompiler/test/javaConcepts/inheritance/AllTestsInheritance.java deleted file mode 100755 index 7bfd2ef51..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/AllTestsInheritance.java +++ /dev/null @@ -1,24 +0,0 @@ -package mycompiler.test.javaConcepts.inheritance; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsInheritance { - - public static Test suite() { - TestSuite suite = new TestSuite( - "Test for mycompiler.test.javaConcepts.inheritance"); - //$JUnit-BEGIN$ - suite.addTestSuite(TestInheritanceCircle.class); - suite.addTestSuite(TestInheritanceMultipleClasses.class); - suite.addTestSuite(TestInheritanceAcrossLevel.class); - suite.addTestSuite(TestInheritanceOverriding.class); - suite.addTestSuite(TestInheritanceConstructor.class); - suite.addTestSuite(TestInheritanceTwoHierarchies.class); - suite.addTestSuite(TestSimpleInheritance.class); - suite.addTestSuite(TestInheritanceMultiple.class); - //$JUnit-END$ - return suite; - } - -} diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceAcrossLevel.jav b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceAcrossLevel.jav deleted file mode 100755 index 053275681..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceAcrossLevel.jav +++ /dev/null @@ -1,56 +0,0 @@ -/* - A - B C -D E - -*/ - -class A { - fooA() {} -} - -class B extends A { - fooB() {} -} - -class C extends A { - fooC(){} -} - -class D extends B { - fooD() {} -} - -class E extends B { - fooE() {} -} - - - -public class TestInheritanceAcrossLevel { - - public m1(x) { - x.fooA(); - return x; - } - - public m2(x) { - x.fooB(); - /*return x;*/ - } - - public m3(x) { - x.fooC(); - /*return x;*/ - } - - public m4(x) { - x.fooD(); - /*return x;*/ - } - - public m5(B x) { - x.fooA(); - return x; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceAcrossLevel.java b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceAcrossLevel.java deleted file mode 100755 index 7dbfefb58..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceAcrossLevel.java +++ /dev/null @@ -1,92 +0,0 @@ -package mycompiler.test.javaConcepts.inheritance; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class TestInheritanceAcrossLevel extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestInheritanceAcrossLevel"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/inheritance/"; - - public TestInheritanceAcrossLevel(String name) { - super(name,TestInheritanceAcrossLevel.JAVPATH+TestInheritanceAcrossLevel.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //Classes - ClassExpect a = new ClassExpect("A"); - ClassExpect b = new ClassExpect("B"); - ClassExpect c = new ClassExpect("C"); - ClassExpect d = new ClassExpect("D"); - ClassExpect e = new ClassExpect("E"); - ClassExpect testInheritanceAcrossLevel = new ClassExpect(TestInheritanceAcrossLevel.TESTEDCLASSNAME); - - //methods - MethodExpect fooA = new MethodExpect("fooA", new RefType("void",-1),0); - MethodExpect fooB = new MethodExpect("fooB", new RefType("void",-1),0); - MethodExpect fooC = new MethodExpect("fooC", new RefType("void",-1),0); - MethodExpect fooD = new MethodExpect("fooD", new RefType("void",-1),0); - MethodExpect fooE = new MethodExpect("fooE", new RefType("void",-1),0); - - MethodExpect m1 = new MethodExpect("m1",new RefType("A",-1),0); - m1.addReturntype(new RefType("B",-1)); - m1.addReturntype(new RefType("C",-1)); - m1.addReturntype(new RefType("D",-1)); - m1.addReturntype(new RefType("E",-1)); - VarExpect x1 = new VarExpect("x",new RefType("A",-1)); - x1.addExpectedType(new RefType("B",-1)); - x1.addExpectedType(new RefType("C",-1)); - x1.addExpectedType(new RefType("D",-1)); - x1.addExpectedType(new RefType("E",-1)); - m1.addParameter(x1); - - MethodExpect m2 = new MethodExpect("m2",new RefType("void",-1),0); - VarExpect x2 = new VarExpect("x",new RefType("B",-1)); - x2.addExpectedType(new RefType("D",-1)); - x2.addExpectedType(new RefType("E",-1)); - m2.addParameter(x2); - - MethodExpect m3 = new MethodExpect("m3",new RefType("void",-1),0); - VarExpect x3 = new VarExpect("x",new RefType("C",-1)); - m3.addParameter(x3); - - MethodExpect m4 = new MethodExpect("m4",new RefType("void",-1),0); - VarExpect x4 = new VarExpect("x",new RefType("D",-1)); - m4.addParameter(x4); - - MethodExpect m5 = new MethodExpect("m5",new RefType("A",-1),0); - VarExpect x5 = new VarExpect("x",new RefType("B",-1)); - m5.addReturntype(new RefType("B",-1)); - m5.addParameter(x5); - - //adding methods to classes - a.addMethod(fooA); - b.addMethod(fooB); - c.addMethod(fooC); - d.addMethod(fooD); - e.addMethod(fooE); - - - testInheritanceAcrossLevel.addMethod(m1); - testInheritanceAcrossLevel.addMethod(m2); - testInheritanceAcrossLevel.addMethod(m3); - testInheritanceAcrossLevel.addMethod(m4); - testInheritanceAcrossLevel.addMethod(m5); - - //adding classes to Expectation - Expectation ret = new Expectation(testInheritanceAcrossLevel); - ret.addClass(a); - ret.addClass(b); - ret.addClass(c); - ret.addClass(d); - ret.addClass(e); - return ret; - } - -} - diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceCircle.jav b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceCircle.jav deleted file mode 100755 index 354e09f54..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceCircle.jav +++ /dev/null @@ -1,41 +0,0 @@ -/* - - A - B C - D -*/ - -interface A{ - fooA(); -} - -interface B extends A{ - fooB(); -} - -interface C extends A{} - -class D implements B,C { - fooA() { - } - fooB() { - } -} - -public class TestInheritanceCircle{ - - public m1(x) { - x.fooA(); - /*return x;*/ - } - - public m2(x) { - x.fooB(); - /*return x;*/ - } - public m3(D x) { - x.fooA(); - return x; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceCircle.java b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceCircle.java deleted file mode 100755 index 2184b4490..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceCircle.java +++ /dev/null @@ -1,82 +0,0 @@ -package mycompiler.test.javaConcepts.inheritance; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -import mycompiler.test.expectationTypes.TypePlaceholderExpect; - - -/* - * Testcase currently adjusted to compiler implementation - */ - -public class TestInheritanceCircle extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestInheritanceCircle"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/inheritance/"; - - public TestInheritanceCircle(String name) { - super(name,TestInheritanceCircle.JAVPATH+TestInheritanceCircle.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //Interfaces - ClassExpect a = new ClassExpect("A"); - ClassExpect b = new ClassExpect("B"); - ClassExpect c = new ClassExpect("C"); - //classes - ClassExpect d = new ClassExpect("D"); - ClassExpect testInheritanceCircle = new ClassExpect(TestInheritanceCircle.TESTEDCLASSNAME); - - //methods - //return type should not be "null" since implementation shows "void" -> Testcase adjusted to current compiler implementation, but shall be changed as soon as adapted - MethodExpect fooAa = new MethodExpect("fooA", new TypePlaceholderExpect("a")); - MethodExpect fooBb = new MethodExpect("fooB", new TypePlaceholderExpect("b")); - MethodExpect fooAd = new MethodExpect("fooA", new RefType("void",-1) ,0); - MethodExpect fooBd = new MethodExpect("fooB", new RefType("void",-1),0); - - - MethodExpect m1 = new MethodExpect("m1",new RefType("void",-1),0); - VarExpect x1 = new VarExpect("x",new RefType("A",-1)); - x1.addExpectedType(new RefType("B",-1)); - x1.addExpectedType(new RefType("C",-1)); - x1.addExpectedType(new RefType("D",-1)); - m1.addParameter(x1); - - MethodExpect m2 = new MethodExpect("m2",new RefType("void",-1),0); - VarExpect x2 = new VarExpect("x",new RefType("B",-1)); - x2.addExpectedType(new RefType("D",-1)); - m2.addParameter(x2); - - MethodExpect m3 = new MethodExpect("m3",new RefType("B",-1),0); - m3.addReturntype(new RefType("A",-1)); - m3.addReturntype(new RefType("C",-1)); - m3.addReturntype(new RefType("D",-1)); - VarExpect x3 = new VarExpect("x",new RefType("D",-1)); - m3.addParameter(x3); - - //adding methods to classes - a.addMethod(fooAa); - b.addMethod(fooBb); - d.addMethod(fooAd); - d.addMethod(fooBd); - - testInheritanceCircle.addMethod(m1); - testInheritanceCircle.addMethod(m2); - testInheritanceCircle.addMethod(m3); - - //adding classes to Expectation - Expectation ret = new Expectation(testInheritanceCircle); - ret.addClass(a); - ret.addClass(b); - ret.addClass(c); - ret.addClass(d); - return ret; - } - -} - diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceConstructor.jav b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceConstructor.jav deleted file mode 100755 index 11073ccf8..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceConstructor.jav +++ /dev/null @@ -1,27 +0,0 @@ -class A { - public Integer memberInteger; - - public A(i) { - member=i; - } - -} - -class B extends A { - public String memberString; - public B(i,s) { - super(i); - memberString=s; - } -} - -public class TestInheritanceConstructor { - - public static main() { - x; - x=new B(3,"abc"); - y; - y=x.memberInteger; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceConstructor.java b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceConstructor.java deleted file mode 100755 index 7552296f8..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceConstructor.java +++ /dev/null @@ -1,56 +0,0 @@ -package mycompiler.test.javaConcepts.inheritance; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/* - * Testcase currently adjusted to compiler implementation - */ - -public class TestInheritanceConstructor extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestInheritanceConstructor"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/inheritance/"; - - public TestInheritanceConstructor(String name) { - super(name,TestInheritanceConstructor.JAVPATH+TestInheritanceConstructor.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //classes - ClassExpect a = new ClassExpect("A"); - a.addMember(new VarExpect("memberInteger",new RefType("java.lang.Integer",-1))); - ClassExpect b = new ClassExpect("B"); - b.addMember(new VarExpect("memberString",new RefType("java.lang.String",-1))); - ClassExpect testInheritanceConstructor = new ClassExpect(TestInheritanceConstructor.TESTEDCLASSNAME); - - //methods - MethodExpect aA = new MethodExpect("A", new RefType("void",-1)); - aA.addParameter(new VarExpect("i",new RefType("java.lang.Integer",-1))); - MethodExpect bB = new MethodExpect("B", new RefType("void",-1)); - bB.addParameter(new VarExpect("i",new RefType("java.lang.Integer",-1))); - bB.addParameter(new VarExpect("s",new RefType("java.lang.String",-1))); - MethodExpect main = new MethodExpect("main",new RefType("void",-1)); - main.getBlock().addLocalVar(new VarExpect("x",new RefType("B",-1))); - main.getBlock().addLocalVar(new VarExpect("y",new RefType("java.lang.Integer",-1))); - - //adding methods to classes - a.addMethod(aA); - b.addMethod(bB); - - testInheritanceConstructor.addMethod(main); - - //adding classes to Expectation - Expectation ret = new Expectation(testInheritanceConstructor); - ret.addClass(a); - return ret; - } - -} - diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceMultiple.jav b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceMultiple.jav deleted file mode 100755 index 63b6a1998..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceMultiple.jav +++ /dev/null @@ -1,22 +0,0 @@ -interface A{ -} -interface B{} - -class Tester implements A,B{ - m(){ - } -} - -public class TestInheritanceMultiple{ - - /*should return either of Type Intf1, Intf2, or Tester*/ - public m1(x){ - x.m(); - return(x); - } - - public m2(Tester x){ - x.m(); - return x; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceMultiple.java b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceMultiple.java deleted file mode 100755 index bf44556b4..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceMultiple.java +++ /dev/null @@ -1,56 +0,0 @@ -package mycompiler.test.javaConcepts.inheritance; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class TestInheritanceMultiple extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestInheritanceMultiple"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/inheritance/"; - - public TestInheritanceMultiple(String name) { - super(name,TestInheritanceMultiple.JAVPATH+TestInheritanceMultiple.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //Interfaces - ClassExpect a = new ClassExpect("A"); - ClassExpect b = new ClassExpect("B"); - //classes - ClassExpect tester = new ClassExpect("Tester"); - ClassExpect testInheritanceMultiple = new ClassExpect(TestInheritanceMultiple.TESTEDCLASSNAME); - - //methods - MethodExpect m = new MethodExpect("m", new RefType("void",-1),0); - - MethodExpect m1 = new MethodExpect("m1",new RefType("Tester",-1),0); - m1.addReturntype(new RefType("A",-1)); - m1.addReturntype(new RefType("B",-1)); - VarExpect x1 = new VarExpect("x",new RefType("Tester",-1)); - m1.addParameter(x1); - - MethodExpect m2 = new MethodExpect("m2",new RefType("Tester",-1),0); - VarExpect x2 = new VarExpect("x",new RefType("Tester",-1)); - m2.addReturntype(new RefType("A",-1)); - m2.addReturntype(new RefType("B",-1)); - m2.addParameter(x2); - - tester.addMethod(m); - testInheritanceMultiple.addMethod(m1); - testInheritanceMultiple.addMethod(m2); - - //adding classes to Expectation - Expectation ret = new Expectation(testInheritanceMultiple); - ret.addClass(a); - ret.addClass(b); - ret.addClass(tester); - return ret; - } - -} - diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceMultipleClasses.jav b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceMultipleClasses.jav deleted file mode 100755 index 70241b36f..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceMultipleClasses.jav +++ /dev/null @@ -1,8 +0,0 @@ - -class A {} - -class B {} - -public class TestInheritanceMultipleClasses extends A, B { - -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceMultipleClasses.java b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceMultipleClasses.java deleted file mode 100755 index 04b0526e5..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceMultipleClasses.java +++ /dev/null @@ -1,34 +0,0 @@ -package mycompiler.test.javaConcepts.inheritance; - -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; - -public class TestInheritanceMultipleClasses extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestInheritanceMultipleClasses"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/inheritance/"; - - public TestInheritanceMultipleClasses(String name) { - super(name,TestInheritanceMultipleClasses.JAVPATH+TestInheritanceMultipleClasses.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //classes - ClassExpect a = new ClassExpect("A"); - ClassExpect b = new ClassExpect("B"); - ClassExpect testInheritanceMultipleClasses = new ClassExpect(TestInheritanceMultipleClasses.TESTEDCLASSNAME); - - - //adding classes to Expectation - Expectation ret = new Expectation(testInheritanceMultipleClasses); - ret.addClass(a); - ret.addClass(b); - //multiple inheritance of classes not possible in java - ret.addException(new Exception()); - return ret; - } - -} - diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceOverriding.jav b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceOverriding.jav deleted file mode 100755 index 7690516b3..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceOverriding.jav +++ /dev/null @@ -1,27 +0,0 @@ -class A{ - public m() { - return new A(); - } -} - -class B extends A{ - - public m() { - return new B(); - } - public m(java.lang.Integer a) { - return a; - } -} - -public class TestInheritanceOverriding { - - public main1(x,A y) { - y = new B(); - x = y.m(); - } - /*public main2(x) { - y; - y=x.m(2); - }*/ -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceOverriding.java b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceOverriding.java deleted file mode 100755 index 498ebdecd..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceOverriding.java +++ /dev/null @@ -1,55 +0,0 @@ -package mycompiler.test.javaConcepts.inheritance; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class TestInheritanceOverriding extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestInheritanceOverriding"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/inheritance/"; - - public TestInheritanceOverriding(String name) { - super(name,TestInheritanceOverriding.JAVPATH+TestInheritanceOverriding.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //classes - ClassExpect a = new ClassExpect("A"); - ClassExpect b = new ClassExpect("B"); - ClassExpect testInheritanceOverriding = new ClassExpect(TestInheritanceOverriding.TESTEDCLASSNAME); - - //methods - MethodExpect ma = new MethodExpect("m", new RefType("A",-1)); - MethodExpect mb1 = new MethodExpect("m", new RefType("B",-1)); - mb1.addReturntype(new RefType("A",-1)); - MethodExpect mb2 = new MethodExpect("m", new RefType("java.lang.Integer",-1)); - mb2.addParameter(new VarExpect("a", new RefType("java.lang.Integer",-1))); - - MethodExpect main1 = new MethodExpect("main1",new RefType("void",-1)); - main1.addParameter(new VarExpect("x", new RefType("A",-1))); - main1.addParameter(new VarExpect("y", new RefType("A",-1))); - - MethodExpect main2 = new MethodExpect("main2",new RefType("void",-1)); - main2.addParameter(new VarExpect("x", new RefType("B",-1))); - main2.getBlock().addLocalVar(new VarExpect("y", new RefType("java.lang.Integer",-1))); - - a.addMethod(ma); - b.addMethod(mb1); - b.addMethod(mb2); - testInheritanceOverriding.addMethod(main1); - //testInheritanceOverriding.addMethod(main2); - - //adding classes to Expectation - Expectation ret = new Expectation(testInheritanceOverriding); - ret.addClass(a); - ret.addClass(b); - return ret; - } - -} - diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceTwoHierarchies.jav b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceTwoHierarchies.jav deleted file mode 100755 index df2f7dca8..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceTwoHierarchies.jav +++ /dev/null @@ -1,37 +0,0 @@ - -/* - - A I - B C D -E F - -*/ -interface I{ - void fooA(); -} -class A{ - void fooA() {} -} -class B extends A{} - -class C extends A implements I{} - -class D implements I{ - fooD() {} -} -class E extends B {} - -class F extends C{} - -public class TestInheritanceTwoHierarchies { - - public m1(x) { - x.fooA(); - return x; - } - - public m2(x) { - x.fooD(); - return x; - } -} diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceTwoHierarchies.java b/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceTwoHierarchies.java deleted file mode 100755 index 32d98791b..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestInheritanceTwoHierarchies.java +++ /dev/null @@ -1,83 +0,0 @@ -package mycompiler.test.javaConcepts.inheritance; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class TestInheritanceTwoHierarchies extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestInheritanceTwoHierarchies"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/inheritance/"; - - public TestInheritanceTwoHierarchies(String name) { - super(name,TestInheritanceTwoHierarchies.JAVPATH+TestInheritanceTwoHierarchies.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //interfaces - ClassExpect i = new ClassExpect("I"); - - //Classes - ClassExpect a = new ClassExpect("A"); - ClassExpect b = new ClassExpect("B"); - ClassExpect c = new ClassExpect("C"); - ClassExpect d = new ClassExpect("D"); - ClassExpect e = new ClassExpect("E"); - ClassExpect f = new ClassExpect("F"); - ClassExpect testInheritanceTwoHierarchies = new ClassExpect(TestInheritanceTwoHierarchies.TESTEDCLASSNAME); - - //methods - MethodExpect fooAa = new MethodExpect("fooA", new RefType("void",-1),0); - MethodExpect fooAi = new MethodExpect("fooA", new RefType("void",-1),0); - MethodExpect fooD = new MethodExpect("fooD", new RefType("void",-1),0); - - MethodExpect m1 = new MethodExpect("m1",new RefType("A",-1),0); - m1.addReturntype(new RefType("B",-1)); - m1.addReturntype(new RefType("C",-1)); - m1.addReturntype(new RefType("D",-1)); - m1.addReturntype(new RefType("E",-1)); - m1.addReturntype(new RefType("F",-1)); - m1.addReturntype(new RefType("I",-1)); - VarExpect x1 = new VarExpect("x",new RefType("A",-1)); - x1.addExpectedType(new RefType("B",-1)); - x1.addExpectedType(new RefType("C",-1)); - x1.addExpectedType(new RefType("D",-1)); - x1.addExpectedType(new RefType("E",-1)); - x1.addExpectedType(new RefType("F",-1)); - x1.addExpectedType(new RefType("I",-1)); - m1.addParameter(x1); - - MethodExpect m2 = new MethodExpect("m2",new RefType("I",-1),0); - m2.addReturntype(new RefType("D",-1)); - VarExpect x2 = new VarExpect("x",new RefType("D",-1)); - m2.addParameter(x2); - - - //adding methods to classes - a.addMethod(fooAa); - d.addMethod(fooD); - i.addMethod(fooAi); - - - testInheritanceTwoHierarchies.addMethod(m1); - testInheritanceTwoHierarchies.addMethod(m2); - - //adding classes to Expectation - Expectation ret = new Expectation(testInheritanceTwoHierarchies); - ret.addClass(a); - ret.addClass(b); - ret.addClass(c); - ret.addClass(d); - ret.addClass(e); - ret.addClass(f); - ret.addClass(i); - - return ret; - } - -} - diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestSimpleInheritance.jav b/test/mycompiler/test/javaConcepts/inheritance/TestSimpleInheritance.jav deleted file mode 100755 index 3a0c0639c..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestSimpleInheritance.jav +++ /dev/null @@ -1,13 +0,0 @@ - -class A { - - public m1() { - } -} - -public class TestSimpleInheritance extends A { - - public m(x) { - x.m1(); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/inheritance/TestSimpleInheritance.java b/test/mycompiler/test/javaConcepts/inheritance/TestSimpleInheritance.java deleted file mode 100755 index 1eaa2d3dd..000000000 --- a/test/mycompiler/test/javaConcepts/inheritance/TestSimpleInheritance.java +++ /dev/null @@ -1,42 +0,0 @@ -package mycompiler.test.javaConcepts.inheritance; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class TestSimpleInheritance extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestSimpleInheritance"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/inheritance/"; - - public TestSimpleInheritance(String name) { - super(name,TestSimpleInheritance.JAVPATH+TestSimpleInheritance.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //classes - ClassExpect a = new ClassExpect("A"); - ClassExpect testSimpleInheritance = new ClassExpect(TestSimpleInheritance.TESTEDCLASSNAME); - - MethodExpect m1 = new MethodExpect("m1",new RefType("void",-1),0); - - MethodExpect m = new MethodExpect("m",new RefType("void",-1),0); - VarExpect x2 = new VarExpect("x",new RefType("A",-1)); - x2.addExpectedType(new RefType(TestSimpleInheritance.TESTEDCLASSNAME,-1)); - m.addParameter(x2); - - a.addMethod(m1); - testSimpleInheritance.addMethod(m); - - //adding classes to Expectation - Expectation ret = new Expectation(testSimpleInheritance); - ret.addClass(a); - return ret; - } - -} - diff --git a/test/mycompiler/test/javaConcepts/overloading/AllTestsOverloading.java b/test/mycompiler/test/javaConcepts/overloading/AllTestsOverloading.java deleted file mode 100755 index 9bedaa69e..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/AllTestsOverloading.java +++ /dev/null @@ -1,31 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsOverloading { - - public static Test suite() { - TestSuite suite = new TestSuite( - "Test for mycompiler.test.javaConcepts.overloading"); - //$JUnit-BEGIN$ - suite.addTestSuite(OverloadingNotSameHierarchy.class); - suite - .addTestSuite(OverloadingDifferentNumberOfParametersAndDifferentTypes.class); - suite.addTestSuite(OverloadingTypeInferenceSameHierarchy.class); - suite.addTestSuite(OverloadingGenericSameHierarchy.class); - suite.addTestSuite(OverloadingSameSignature.class); - suite.addTestSuite(OverloadingSameHierarchy.class); - suite.addTestSuite(OverloadingSameSignatureGenerics.class); - suite.addTestSuite(OverloadingGenericTypeInferenceSameHierarchy.class); - suite.addTestSuite(OverloadingSameSignatureDifferentReturnTypes.class); - suite.addTestSuite(OverloadingTypeInferenceNotSameHierarchy.class); - suite.addTestSuite(OverloadingDifferentNumberOfParameters.class); - suite.addTestSuite(OverloadingGenericNotSameHierarchy.class); - suite - .addTestSuite(OverloadingGenericTypeInferenceNotSameHierarchy.class); - //$JUnit-END$ - return suite; - } - -} diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingDifferentNumberOfParameters.jav b/test/mycompiler/test/javaConcepts/overloading/OverloadingDifferentNumberOfParameters.jav deleted file mode 100755 index 27139295d..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingDifferentNumberOfParameters.jav +++ /dev/null @@ -1,6 +0,0 @@ -class OverloadingDifferentNumberOfParameters{ - void foo(){} - void foo(Integer a){} - void foo(Integer a, Double b){} - void foo(Integer a, Double b, Long c){} -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingDifferentNumberOfParameters.java b/test/mycompiler/test/javaConcepts/overloading/OverloadingDifferentNumberOfParameters.java deleted file mode 100755 index 89404d4d7..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingDifferentNumberOfParameters.java +++ /dev/null @@ -1,51 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; -/** -* 16-04-08 -* @author -* -* -*/ -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class OverloadingDifferentNumberOfParameters extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="OverloadingDifferentNumberOfParameters"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/overloading/"; - - public OverloadingDifferentNumberOfParameters(String name) { - super(name,OverloadingDifferentNumberOfParameters.JAVPATH+OverloadingDifferentNumberOfParameters.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(OverloadingDifferentNumberOfParameters.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("foo",new RefType("void",-1),0); - - MethodExpect m1 = new MethodExpect("foo",new RefType("void",-1),0); - m1.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - - MethodExpect m2 = new MethodExpect("foo",new RefType("void",-1),0); - m2.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - m2.addParameter(new VarExpect("b",new RefType("java.lang.Double",-1))); - - MethodExpect m3 = new MethodExpect("foo",new RefType("void",-1),0); - m3.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - m3.addParameter(new VarExpect("b",new RefType("java.lang.Double",-1))); - m3.addParameter(new VarExpect("c",new RefType("java.lang.Long",-1))); - - overloading.addMethod(m0); - overloading.addMethod(m1); - overloading.addMethod(m2); - overloading.addMethod(m3); - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingDifferentNumberOfParametersAndDifferentTypes.jav b/test/mycompiler/test/javaConcepts/overloading/OverloadingDifferentNumberOfParametersAndDifferentTypes.jav deleted file mode 100755 index 5cc96afcc..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingDifferentNumberOfParametersAndDifferentTypes.jav +++ /dev/null @@ -1,9 +0,0 @@ -class OverloadingDifferentNumberOfParametersAndDifferentTypes{ - void foo(){} - void foo(Integer a){} - void foo(Integer a, Double b){} - void foo(Integer a, Double b, Long c){} - void foo(String a){} - void foo(String a, Integer b){} - void foo(String a, Integer b, Long c){} -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingDifferentNumberOfParametersAndDifferentTypes.java b/test/mycompiler/test/javaConcepts/overloading/OverloadingDifferentNumberOfParametersAndDifferentTypes.java deleted file mode 100755 index e7b1b28ff..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingDifferentNumberOfParametersAndDifferentTypes.java +++ /dev/null @@ -1,66 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; -/** -* 16-04-08 -* @author -* -* -*/ -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class OverloadingDifferentNumberOfParametersAndDifferentTypes extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="OverloadingDifferentNumberOfParametersAndDifferentTypes"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/overloading/"; - - public OverloadingDifferentNumberOfParametersAndDifferentTypes(String name) { - super(name,OverloadingDifferentNumberOfParametersAndDifferentTypes.JAVPATH+OverloadingDifferentNumberOfParametersAndDifferentTypes.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(OverloadingDifferentNumberOfParametersAndDifferentTypes.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("foo",new RefType("void",-1),0); - - MethodExpect m1 = new MethodExpect("foo",new RefType("void",-1),0); - m1.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - - MethodExpect m2 = new MethodExpect("foo",new RefType("void",-1),0); - m2.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - m2.addParameter(new VarExpect("b",new RefType("java.lang.Double",-1))); - - MethodExpect m3 = new MethodExpect("foo",new RefType("void",-1),0); - m3.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - m3.addParameter(new VarExpect("b",new RefType("java.lang.Double",-1))); - m3.addParameter(new VarExpect("c",new RefType("java.lang.Long",-1))); - - MethodExpect m4 = new MethodExpect("foo",new RefType("void",-1),1); - m4.addParameter(new VarExpect("a",new RefType("java.lang.String",-1))); - - MethodExpect m5 = new MethodExpect("foo",new RefType("void",-1),1); - m5.addParameter(new VarExpect("a",new RefType("java.lang.String",-1))); - m5.addParameter(new VarExpect("b",new RefType("java.lang.Integer",-1))); - - MethodExpect m6 = new MethodExpect("foo",new RefType("void",-1),1); - m6.addParameter(new VarExpect("a",new RefType("java.lang.String",-1))); - m6.addParameter(new VarExpect("b",new RefType("java.lang.Integer",-1))); - m6.addParameter(new VarExpect("c",new RefType("java.lang.Long",-1))); - - overloading.addMethod(m0); - overloading.addMethod(m1); - overloading.addMethod(m2); - overloading.addMethod(m3); - overloading.addMethod(m4); - overloading.addMethod(m5); - overloading.addMethod(m6); - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericNotSameHierarchy.jav b/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericNotSameHierarchy.jav deleted file mode 100755 index 50bae3e0d..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericNotSameHierarchy.jav +++ /dev/null @@ -1,13 +0,0 @@ -/* -Diese Klasse ueberlaed eine Methoden bei total Typverschiedenen generischen parametern (nicht gleiche Vererbungshierarchie -*/ -class OverloadingGenericNotSameHierarchy{ - - void foo(){} - void foo(T n){} - void foo(T v){} - -/* - void foo(T n){} - */ -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericNotSameHierarchy.java b/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericNotSameHierarchy.java deleted file mode 100755 index 7c721a488..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericNotSameHierarchy.java +++ /dev/null @@ -1,56 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; -/** -* 16-04-08 -* @author -* -* -*/ -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class OverloadingGenericNotSameHierarchy extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="OverloadingGenericNotSameHierarchy"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/overloading/"; - - public OverloadingGenericNotSameHierarchy(String name) { - super(name,OverloadingGenericNotSameHierarchy.JAVPATH+OverloadingGenericNotSameHierarchy.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(OverloadingGenericNotSameHierarchy.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("foo",new RefType("void",-1),0); - - MethodExpect m1 = new MethodExpect("foo",new RefType("void",-1),0); - Menge bounds = new Menge(); - bounds.add(new RefType("Number",-1)); - BoundedGenericTypeVar boundedGenericT = new BoundedGenericTypeVar("T",bounds,-1); - m1.addGeneric(boundedGenericT); - m1.addParameter(new VarExpect("n",boundedGenericT)); - - MethodExpect m2 = new MethodExpect("foo",new RefType("void",-1),1); - Menge bounds2 = new Menge(); - bounds2.add(new RefType("de.dhbwstuttgart.typeinference.Menge",-1)); - BoundedGenericTypeVar boundedGenericT2 = new BoundedGenericTypeVar("T",bounds2,-1); - m2.addGeneric(boundedGenericT2); - m2.addParameter(new VarExpect("v",boundedGenericT2)); - - overloading.addMethod(m0); - overloading.addMethod(m1); - overloading.addMethod(m2); - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericSameHierarchy.jav b/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericSameHierarchy.jav deleted file mode 100755 index 7db406522..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericSameHierarchy.jav +++ /dev/null @@ -1,8 +0,0 @@ -/* -Diese Klasse ueberlaedt eine Methoden bei verschiedenen generischen Typen von Parametern welche in der gleichen Vererbungshierarchie liegen*/ - -class OverloadingGenericSameHierarchy { - void foo(T o){} - void foo(T n){} - void foo(T i){} -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericSameHierarchy.java b/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericSameHierarchy.java deleted file mode 100755 index fc4b6996c..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericSameHierarchy.java +++ /dev/null @@ -1,61 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; -/** -* 16-04-08 -* @author -* -* -*/ -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class OverloadingGenericSameHierarchy extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="OverloadingGenericSameHierarchy"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/overloading/"; - - public OverloadingGenericSameHierarchy(String name) { - super(name,OverloadingGenericSameHierarchy.JAVPATH+OverloadingGenericSameHierarchy.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(OverloadingGenericSameHierarchy.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("foo",new RefType("void",-1),0); - Menge bounds0 = new Menge(); - bounds0.add(new RefType("Object",-1)); - BoundedGenericTypeVar boundedGenericT0 = new BoundedGenericTypeVar("T",bounds0,-1); - m0.addGeneric(boundedGenericT0); - m0.addParameter(new VarExpect("o",boundedGenericT0)); - - MethodExpect m1 = new MethodExpect("foo",new RefType("void",-1),1); - Menge bounds1 = new Menge(); - bounds1.add(new RefType("Number",-1)); - BoundedGenericTypeVar boundedGenericT1 = new BoundedGenericTypeVar("T",bounds1,-1); - m1.addGeneric(boundedGenericT1); - m1.addParameter(new VarExpect("n",boundedGenericT1)); - - MethodExpect m2 = new MethodExpect("foo",new RefType("void",-1),2); - Menge bounds2 = new Menge(); - bounds2.add(new RefType("java.lang.Integer",-1)); - BoundedGenericTypeVar boundedGenericT2 = new BoundedGenericTypeVar("T",bounds2,-1); - m2.addGeneric(boundedGenericT2); - m2.addParameter(new VarExpect("i",boundedGenericT2)); - - overloading.addMethod(m0); - overloading.addMethod(m1); - overloading.addMethod(m2); - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericTypeInferenceNotSameHierarchy.jav b/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericTypeInferenceNotSameHierarchy.jav deleted file mode 100755 index b2dec67e2..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericTypeInferenceNotSameHierarchy.jav +++ /dev/null @@ -1,19 +0,0 @@ -/* -Diese Klasse ueberlaedt eine Methode durch Typinferenz erkannte generische typverschiedenen Tarametern (nicht gleiche Vererbungshierarchie) -*/ - -import de.dhbwstuttgart.typeinference.Menge; - -class A { - -} - -class OverloadingGenericTypeInferenceNotSameHierarchy{ - foo(){} - foo(i){ - i = new A(); - } - foo(s){ - s = new Menge(); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericTypeInferenceNotSameHierarchy.java b/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericTypeInferenceNotSameHierarchy.java deleted file mode 100755 index f924c18a5..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericTypeInferenceNotSameHierarchy.java +++ /dev/null @@ -1,77 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; -/** -* 16-04-08 -* @author -* -* -*/ -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class OverloadingGenericTypeInferenceNotSameHierarchy extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="OverloadingGenericTypeInferenceNotSameHierarchy"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/overloading/"; - - public OverloadingGenericTypeInferenceNotSameHierarchy(String name) { - super(name,OverloadingGenericTypeInferenceNotSameHierarchy.JAVPATH+OverloadingGenericTypeInferenceNotSameHierarchy.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect a = new ClassExpect("A"); - a.addGeneric(new GenericTypeVar("T",-1)); - - ClassExpect overloading = new ClassExpect(OverloadingGenericTypeInferenceNotSameHierarchy.TESTEDCLASSNAME); - overloading.addGeneric(new GenericTypeVar("T",-1)); - //methods - - MethodExpect m0 = new MethodExpect("foo",new RefType("void",-1)); -// m0.addParameter(new VarExpect("o",boundedGenericT0)); - - MethodExpect m1 = new MethodExpect("foo",new RefType("void",-1),0); - Menge bounds1a = new Menge(); - bounds1a.add(new RefType("java.lang.Double",-1)); - Menge bounds1b = new Menge(); - bounds1b.add(new ExtendsWildcardType(-1,new RefType("java.lang.Double",-1))); - Menge bounds1c = new Menge(); - bounds1c.add(new SuperWildcardType(-1,new RefType("java.lang.Double",-1))); - VarExpect i = new VarExpect("i", new RefType("A",bounds1a,-1)); - i.addExpectedType(new RefType("A",bounds1b,-1)); - i.addExpectedType(new RefType("A",bounds1c,-1)); - m1.addParameter(i); - - MethodExpect m2 = new MethodExpect("foo",new RefType("void",-1),1); - Menge bounds2a = new Menge(); - bounds2a.add(new RefType("java.lang.Integer",-1)); - Menge bounds2b = new Menge(); - bounds2b.add(new ExtendsWildcardType(-1,new RefType("java.lang.Integer",-1))); - Menge bounds2c = new Menge(); - bounds2c.add(new SuperWildcardType(-1,new RefType("java.lang.Integer",-1))); - VarExpect s = new VarExpect("s",new RefType("de.dhbwstuttgart.typeinference.Menge",bounds2a,-1)); - s.addExpectedType(new RefType("de.dhbwstuttgart.typeinference.Menge",bounds2b,-1)); - s.addExpectedType(new RefType("de.dhbwstuttgart.typeinference.Menge",bounds2c,-1)); - - m2.addParameter(s); - - overloading.addMethod(m0); - overloading.addMethod(m1); - overloading.addMethod(m2); - - Expectation ret = new Expectation(a); - ret.addClass(overloading); - return ret; - } - -} diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericTypeInferenceSameHierarchy.jav b/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericTypeInferenceSameHierarchy.jav deleted file mode 100755 index e4af92395..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericTypeInferenceSameHierarchy.jav +++ /dev/null @@ -1,20 +0,0 @@ -/* -Diese Klasse ueberlaedt eine Methoden durch typeinferenz erkannte generische Typverschiedenen parametern welche in der selben Typhierarchie sind*/ -class B{ -} -class C extends B{ -} -class D extends C{ -} -class OverloadingGenericTypeInferenceSameHierarchy{ - foo(i){ - i = new B(); - } - foo(n){ - n = new C(); - } - - foo(o){ - o = new D(); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericTypeInferenceSameHierarchy.java b/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericTypeInferenceSameHierarchy.java deleted file mode 100755 index e2549b75a..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingGenericTypeInferenceSameHierarchy.java +++ /dev/null @@ -1,91 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class OverloadingGenericTypeInferenceSameHierarchy extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="OverloadingGenericTypeInferenceSameHierarchy"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/overloading/"; - - public OverloadingGenericTypeInferenceSameHierarchy(String name) { - super(name,OverloadingGenericTypeInferenceSameHierarchy.JAVPATH+OverloadingGenericTypeInferenceSameHierarchy.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //classes - ClassExpect b = new ClassExpect("B"); - ClassExpect c = new ClassExpect("C"); - ClassExpect d = new ClassExpect("D"); - ClassExpect overloading = new ClassExpect(OverloadingGenericTypeInferenceSameHierarchy.TESTEDCLASSNAME); - - //generics - b.addGeneric(new GenericTypeVar("T",-1)); - c.addGeneric(new GenericTypeVar("T",-1)); - d.addGeneric(new GenericTypeVar("T",-1)); - - //methods - MethodExpect m1 = new MethodExpect("foo",new RefType("void",-1),0); - Menge bounds1a = new Menge(); - bounds1a.add(new RefType("java.lang.Integer",-1)); - Menge bounds1b = new Menge(); - bounds1b.add(new ExtendsWildcardType(-1,new RefType("java.lang.Integer",-1))); - Menge bounds1c = new Menge(); - bounds1c.add(new SuperWildcardType(-1,new RefType("java.lang.Integer",-1))); - VarExpect i = new VarExpect("i", new RefType("B",bounds1a,-1)); - i.addExpectedType(new RefType("B",bounds1b,-1)); - i.addExpectedType(new RefType("B",bounds1c,-1)); - m1.addParameter(i); - - MethodExpect m2 = new MethodExpect("foo",new RefType("void",-1),1); - Menge bounds2a = new Menge(); - bounds2a.add(new RefType("java.lang.Integer",-1)); - Menge bounds2b = new Menge(); - bounds2b.add(new ExtendsWildcardType(-1,new RefType("java.lang.Integer",-1))); - Menge bounds2c = new Menge(); - bounds2c.add(new SuperWildcardType(-1,new RefType("java.lang.Integer",-1))); - VarExpect n = new VarExpect("n", new RefType("B",bounds2a,-1)); - n.addExpectedType(new RefType("B",bounds2b,-1)); - n.addExpectedType(new RefType("B",bounds2c,-1)); - n.addExpectedType(new RefType("C",bounds2a,-1)); - n.addExpectedType(new RefType("C",bounds2b,-1)); - n.addExpectedType(new RefType("C",bounds2c,-1)); - m2.addParameter(n); - MethodExpect m3 = new MethodExpect("foo",new RefType("void",-1),2); - Menge bounds3a = new Menge(); - bounds3a.add(new RefType("java.lang.Integer",-1)); - Menge bounds3b = new Menge(); - bounds3b.add(new ExtendsWildcardType(-1,new RefType("java.lang.Integer",-1))); - Menge bounds3c = new Menge(); - bounds3c.add(new SuperWildcardType(-1,new RefType("java.lang.Integer",-1))); - VarExpect o = new VarExpect("o", new RefType("B",bounds3a,-1)); - o.addExpectedType(new RefType("B",bounds3b,-1)); - o.addExpectedType(new RefType("B",bounds3c,-1)); - o.addExpectedType(new RefType("C",bounds3a,-1)); - o.addExpectedType(new RefType("C",bounds3b,-1)); - o.addExpectedType(new RefType("C",bounds3c,-1)); - o.addExpectedType(new RefType("D",bounds3a,-1)); - o.addExpectedType(new RefType("D",bounds3b,-1)); - o.addExpectedType(new RefType("D",bounds3c,-1)); - m3.addParameter(o); - - overloading.addMethod(m1); - overloading.addMethod(m2); - overloading.addMethod(m3); - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingNotSameHierarchy.jav b/test/mycompiler/test/javaConcepts/overloading/OverloadingNotSameHierarchy.jav deleted file mode 100755 index 2b2e635e0..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingNotSameHierarchy.jav +++ /dev/null @@ -1,8 +0,0 @@ -/* -Diese Klasse ueberlaed eine Methoden bei total Typverschiedenen parametern (nicht gleiche Vererbungshierarchie -*/ -class OverloadingNotSameHierarchy{ - void foo(){} - void foo(String s){} - void foo(Integer i){} -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingNotSameHierarchy.java b/test/mycompiler/test/javaConcepts/overloading/OverloadingNotSameHierarchy.java deleted file mode 100755 index 30f86e927..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingNotSameHierarchy.java +++ /dev/null @@ -1,45 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; -/** -* 16-04-08 -* @author -* -* -*/ -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class OverloadingNotSameHierarchy extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="OverloadingNotSameHierarchy"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/overloading/"; - - public OverloadingNotSameHierarchy(String name) { - super(name,OverloadingNotSameHierarchy.JAVPATH+OverloadingNotSameHierarchy.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(OverloadingNotSameHierarchy.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("foo",new RefType("void",-1),0); - - MethodExpect m1 = new MethodExpect("foo",new RefType("void",-1),0); - m1.addParameter(new VarExpect("s",new RefType("java.lang.String",-1))); - - MethodExpect m2 = new MethodExpect("foo",new RefType("void",-1),1); - m2.addParameter(new VarExpect("i",new RefType("java.lang.Integer",-1))); - - - overloading.addMethod(m0); - overloading.addMethod(m1); - overloading.addMethod(m2); - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameHierarchy.jav b/test/mycompiler/test/javaConcepts/overloading/OverloadingSameHierarchy.jav deleted file mode 100755 index d622462f3..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameHierarchy.jav +++ /dev/null @@ -1,7 +0,0 @@ -/* -Diese Klasse ueberlaedt eine Methoden bei verschiedenen Typen von Parametern welche in der gleichen Vererbungshierarchie liegen*/ -class OverloadingSameHierarchy{ - void foo(java.lang.Number n){} - void foo(java.lang.Integer i){} - void foo(java.lang.Object o){} -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameHierarchy.java b/test/mycompiler/test/javaConcepts/overloading/OverloadingSameHierarchy.java deleted file mode 100755 index 63813ef14..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameHierarchy.java +++ /dev/null @@ -1,46 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; -/** -* 16-04-08 -* @author -* -* -*/ -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class OverloadingSameHierarchy extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="OverloadingSameHierarchy"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/overloading/"; - - public OverloadingSameHierarchy(String name) { - super(name,OverloadingSameHierarchy.JAVPATH+OverloadingSameHierarchy.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(OverloadingSameHierarchy.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("foo",new RefType("void",-1),0); - m0.addParameter(new VarExpect("n",new RefType("java.lang.Number",-1))); - - MethodExpect m1 = new MethodExpect("foo",new RefType("void",-1),1); - m1.addParameter(new VarExpect("i",new RefType("java.lang.Integer",-1))); - - MethodExpect m2 = new MethodExpect("foo",new RefType("void",-1),2); - m2.addParameter(new VarExpect("o",new RefType("java.lang.Object",-1))); - - - overloading.addMethod(m0); - overloading.addMethod(m1); - overloading.addMethod(m2); - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignature.jav b/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignature.jav deleted file mode 100755 index ff58ff0a7..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignature.jav +++ /dev/null @@ -1,6 +0,0 @@ -class OverloadingSameSignature{ - void foo(){ - } - void foo(){ - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignature.java b/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignature.java deleted file mode 100755 index fe856c0b0..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignature.java +++ /dev/null @@ -1,27 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; -/** -* 16-04-08 -* @author -* -* -*/ -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.notUsedAnymore.TestAbstractInferenceTest2; - -public class OverloadingSameSignature extends AbstractInferenceTest{ - private final static String TESTEDCLASSNAME="OverloadingSameSignature"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/overloading/"; - - public OverloadingSameSignature(String name) { - super(name,OverloadingSameSignature.JAVPATH+OverloadingSameSignature.TESTEDCLASSNAME + ".jav"); - } - - @Override - protected Expectation getExpectations() { - Expectation expect = new Expectation(null); - expect.addException(new Exception()); - return expect; - } - -} diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignatureDifferentReturnTypes.jav b/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignatureDifferentReturnTypes.jav deleted file mode 100755 index 2668cd06e..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignatureDifferentReturnTypes.jav +++ /dev/null @@ -1,7 +0,0 @@ -class OverloadingSameSignatureDifferentReturnTypes{ - void foo(){ - } - String foo(){ - return "abcd"; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignatureDifferentReturnTypes.java b/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignatureDifferentReturnTypes.java deleted file mode 100755 index c42febce6..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignatureDifferentReturnTypes.java +++ /dev/null @@ -1,26 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; -/** -* 16-04-08 -* @author -* -* -*/ -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.Expectation; - -public class OverloadingSameSignatureDifferentReturnTypes extends AbstractInferenceTest{ - private final static String TESTEDCLASSNAME="OverloadingSameSignatureDifferentReturnTypes"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/overloading/"; - - public OverloadingSameSignatureDifferentReturnTypes(String name) { - super(name,OverloadingSameSignatureDifferentReturnTypes.JAVPATH+OverloadingSameSignatureDifferentReturnTypes.TESTEDCLASSNAME + ".jav"); - } - - @Override - protected Expectation getExpectations() { - Expectation expect = new Expectation(null); - expect.addException(new Exception()); - return expect; - } - -} diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignatureGenerics.jav b/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignatureGenerics.jav deleted file mode 100755 index de6ebda2d..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignatureGenerics.jav +++ /dev/null @@ -1,8 +0,0 @@ -class OverloadingSameSignatureGenerics{ - T foo(T a){ - return a; - } - void foo(T a){ - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignatureGenerics.java b/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignatureGenerics.java deleted file mode 100755 index 8519973a7..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingSameSignatureGenerics.java +++ /dev/null @@ -1,25 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; -/** -* 16-04-08 -* @author -* -* -*/ -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.Expectation; - -public class OverloadingSameSignatureGenerics extends AbstractInferenceTest{ - private final static String TESTEDCLASSNAME="OverloadingSameSignatureGenerics"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/overloading/"; - - public OverloadingSameSignatureGenerics(String name) { - super(name,OverloadingSameSignatureGenerics.JAVPATH+OverloadingSameSignatureGenerics.TESTEDCLASSNAME + ".jav"); - } - - @Override - protected Expectation getExpectations() { - Expectation expect = new Expectation(null); - expect.addException(new Exception()); - return expect; - } -} diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingTypeInferenceNotSameHierarchy.jav b/test/mycompiler/test/javaConcepts/overloading/OverloadingTypeInferenceNotSameHierarchy.jav deleted file mode 100755 index 317fc85c1..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingTypeInferenceNotSameHierarchy.jav +++ /dev/null @@ -1,12 +0,0 @@ -/* -Diese Klasse ueberlaed eine Methoden durch typeinferenz erkannte Typverschiedenen parametern (nicht gleiche Vererbungshierarchie -*/ -class OverloadingTypeInferenceNotSameHierarchy{ - foo(){} - foo(i){ - i = new java.lang.Integer(); - } - foo(s){ - s = "String"; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingTypeInferenceNotSameHierarchy.java b/test/mycompiler/test/javaConcepts/overloading/OverloadingTypeInferenceNotSameHierarchy.java deleted file mode 100755 index 749902f97..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingTypeInferenceNotSameHierarchy.java +++ /dev/null @@ -1,45 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; -/** -* 16-04-08 -* @author -* -* -*/ -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class OverloadingTypeInferenceNotSameHierarchy extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="OverloadingTypeInferenceNotSameHierarchy"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/overloading/"; - - public OverloadingTypeInferenceNotSameHierarchy(String name) { - super(name,OverloadingTypeInferenceNotSameHierarchy.JAVPATH+OverloadingTypeInferenceNotSameHierarchy.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(OverloadingTypeInferenceNotSameHierarchy.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("foo",new RefType("void",-1),0); - - MethodExpect m1 = new MethodExpect("foo",new RefType("void",-1),1); - m1.addParameter(new VarExpect("s",new RefType("java.lang.String",-1))); - - MethodExpect m2 = new MethodExpect("foo",new RefType("void",-1),0); - m2.addParameter(new VarExpect("i",new RefType("java.lang.Integer",-1))); - - - overloading.addMethod(m0); - overloading.addMethod(m1); - overloading.addMethod(m2); - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingTypeInferenceSameHierarchy.jav b/test/mycompiler/test/javaConcepts/overloading/OverloadingTypeInferenceSameHierarchy.jav deleted file mode 100755 index dc83554cb..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingTypeInferenceSameHierarchy.jav +++ /dev/null @@ -1,16 +0,0 @@ -/* -Diese Klasse ueberlaed eine Methoden durch typeinferenz erkannte Typverschiedenen parametern welche in der selben Typhierarchie sind*/ -class OverloadingTypeInferenceSameHierarchy{ - /*i = Integer*/ - foo(i){ - i = new java.lang.Integer(); - } - /*n = Number*/ - foo(n){ - n = new java.lang.Number(); - } - /*o = Object*/ - foo(o){ - o = new java.lang.Object(); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/overloading/OverloadingTypeInferenceSameHierarchy.java b/test/mycompiler/test/javaConcepts/overloading/OverloadingTypeInferenceSameHierarchy.java deleted file mode 100755 index 031bd3432..000000000 --- a/test/mycompiler/test/javaConcepts/overloading/OverloadingTypeInferenceSameHierarchy.java +++ /dev/null @@ -1,47 +0,0 @@ -package mycompiler.test.javaConcepts.overloading; -/** -* 16-04-08 -* @author -* -* -*/ -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class OverloadingTypeInferenceSameHierarchy extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="OverloadingTypeInferenceSameHierarchy"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/overloading//"; - - public OverloadingTypeInferenceSameHierarchy(String name) { - super(name,OverloadingTypeInferenceSameHierarchy.JAVPATH+OverloadingTypeInferenceSameHierarchy.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(OverloadingTypeInferenceSameHierarchy.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("foo",new RefType("void",-1),0); - m0.addParameter(new VarExpect("i",new RefType("java.lang.Integer",-1))); - - MethodExpect m1 = new MethodExpect("foo",new RefType("void",-1),1); - m1.addParameter(new VarExpect("n",new RefType("java.lang.Number",-1))); - - MethodExpect m2 = new MethodExpect("foo",new RefType("void",-1),2); - m2.addParameter(new VarExpect("o",new RefType("java.lang.Object",-1))); - - - - overloading.addMethod(m0); - overloading.addMethod(m1); - overloading.addMethod(m2); - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/javaConcepts/staticAccess/AllTestsStaticAccess.java b/test/mycompiler/test/javaConcepts/staticAccess/AllTestsStaticAccess.java deleted file mode 100755 index ab4edc303..000000000 --- a/test/mycompiler/test/javaConcepts/staticAccess/AllTestsStaticAccess.java +++ /dev/null @@ -1,19 +0,0 @@ -package mycompiler.test.javaConcepts.staticAccess; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsStaticAccess { - - public static Test suite() { - TestSuite suite = new TestSuite( - "Test for mycompiler.test.javaConcepts.staticAccess"); - //$JUnit-BEGIN$ - suite.addTestSuite(TestNonStaticAccess.class); - suite.addTestSuite(TestStaticAccess.class); - suite.addTestSuite(TestStaticAccessError.class); - //$JUnit-END$ - return suite; - } - -} diff --git a/test/mycompiler/test/javaConcepts/staticAccess/TestNonStaticAccess.jav b/test/mycompiler/test/javaConcepts/staticAccess/TestNonStaticAccess.jav deleted file mode 100755 index 717d5ed3b..000000000 --- a/test/mycompiler/test/javaConcepts/staticAccess/TestNonStaticAccess.jav +++ /dev/null @@ -1,19 +0,0 @@ -public class Access{ - - public String nonStaticMember="abc"; - - public nonStaticMethod() { - return "def"; - } - -} - -class TestNonStaticAccess { - - public method1(a,b) { - x; - x = new Access(); - a=x.nonStaticMember; - b=x.nonStaticMethod(); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/staticAccess/TestNonStaticAccess.java b/test/mycompiler/test/javaConcepts/staticAccess/TestNonStaticAccess.java deleted file mode 100755 index 441599e67..000000000 --- a/test/mycompiler/test/javaConcepts/staticAccess/TestNonStaticAccess.java +++ /dev/null @@ -1,53 +0,0 @@ -package mycompiler.test.javaConcepts.staticAccess; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** -* 22-04-08 -* @author -* Tests non static access of a method or a member -* -*/ -public class TestNonStaticAccess extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestNonStaticAccess"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/staticAccess/"; - - public TestNonStaticAccess(String name) { - super(name,TestNonStaticAccess.JAVPATH+TestNonStaticAccess.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect access = new ClassExpect("Access"); - ClassExpect testNonStaticAccess = new ClassExpect(TestNonStaticAccess.TESTEDCLASSNAME); - - //Methods - MethodExpect method = new MethodExpect("method1",new RefType("void",-1)); - method.addParameter(new VarExpect("a",new RefType("java.lang.String",-1))); - method.addParameter(new VarExpect("b",new RefType("java.lang.String",-1))); - method.getBlock().addLocalVar(new VarExpect("x",new RefType("Access",-1))); - - MethodExpect nonStaticMethod = new MethodExpect("nonStaticMethod",new RefType("java.lang.String",-1)); - - //add methods to classes - testNonStaticAccess.addMethod(method); - access.addMethod(nonStaticMethod); - - //Member - access.addMember(new VarExpect("nonStaticMember",new RefType("java.lang.String",-1))); - - Expectation ret = new Expectation(testNonStaticAccess); - ret.addClass(access); - - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/staticAccess/TestStaticAccess.jav b/test/mycompiler/test/javaConcepts/staticAccess/TestStaticAccess.jav deleted file mode 100755 index b00c2e8ef..000000000 --- a/test/mycompiler/test/javaConcepts/staticAccess/TestStaticAccess.jav +++ /dev/null @@ -1,18 +0,0 @@ -public class Access{ - - public static String staticMember="def"; - - public static staticMethod() { - return "abc"; - } - -} - -class TestStaticAccess { - - public method1(a,b) { - x; - a=x.staticMember; - b=x.staticMethod(); - } -} diff --git a/test/mycompiler/test/javaConcepts/staticAccess/TestStaticAccess.java b/test/mycompiler/test/javaConcepts/staticAccess/TestStaticAccess.java deleted file mode 100755 index aa4542bef..000000000 --- a/test/mycompiler/test/javaConcepts/staticAccess/TestStaticAccess.java +++ /dev/null @@ -1,53 +0,0 @@ -package mycompiler.test.javaConcepts.staticAccess; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** -* 22-04-08 -* @author -* -* Tests static access of a member or methods -*/ -public class TestStaticAccess extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestStaticAccess"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/staticAccess/"; - - public TestStaticAccess(String name) { - super(name,TestStaticAccess.JAVPATH+TestStaticAccess.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect access = new ClassExpect("Access"); - ClassExpect testStaticAccess = new ClassExpect(TestStaticAccess.TESTEDCLASSNAME); - - //Methods - MethodExpect method = new MethodExpect("method1",new RefType("void",-1)); - method.addParameter(new VarExpect("a",new RefType("java.lang.String",-1))); - method.addParameter(new VarExpect("b",new RefType("java.lang.String",-1))); - method.getBlock().addLocalVar(new VarExpect("x",new RefType("Access",-1))); - - MethodExpect nonStaticMethod = new MethodExpect("staticMethod",new RefType("java.lang.String",-1)); - - //add methods to classes - testStaticAccess.addMethod(method); - - access.addMethod(nonStaticMethod); - //Member - access.addMember(new VarExpect("staticMember",new RefType("java.lang.String",-1))); - - Expectation ret = new Expectation(testStaticAccess); - ret.addClass(access); - - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/staticAccess/TestStaticAccessError.jav b/test/mycompiler/test/javaConcepts/staticAccess/TestStaticAccessError.jav deleted file mode 100755 index e7445702f..000000000 --- a/test/mycompiler/test/javaConcepts/staticAccess/TestStaticAccessError.jav +++ /dev/null @@ -1,17 +0,0 @@ -public class Access{ - public String nonStaticMember="abc"; - - public nonStaticMethod() { - return "def"; - } - -} - -class TestStaticAccessError { - - public methodError1(a,b) { - x; - a=x.nonStaticMember; - b=x.nonStaticMethod(); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/javaConcepts/staticAccess/TestStaticAccessError.java b/test/mycompiler/test/javaConcepts/staticAccess/TestStaticAccessError.java deleted file mode 100755 index 3c284eb9b..000000000 --- a/test/mycompiler/test/javaConcepts/staticAccess/TestStaticAccessError.java +++ /dev/null @@ -1,54 +0,0 @@ -package mycompiler.test.javaConcepts.staticAccess; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** -* 22-04-08 -* @author -* -* checks static access to non-static elements -> should throw erro -*/ - -public class TestStaticAccessError extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestStaticAccessError"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/staticAccess/"; - - public TestStaticAccessError(String name) { - super(name,TestStaticAccessError.JAVPATH+TestStaticAccessError.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect access = new ClassExpect("Access"); - ClassExpect testStaticAccessError = new ClassExpect(TestStaticAccessError.TESTEDCLASSNAME); - - //Methods - MethodExpect method = new MethodExpect("methodError1",new RefType("void",-1)); - method.addParameter(new VarExpect("a",new RefType("java.lang.String",-1))); - method.addParameter(new VarExpect("b",new RefType("java.lang.String",-1))); - method.getBlock().addLocalVar(new VarExpect("x",new RefType("Access",-1))); - - MethodExpect nonStaticMethod = new MethodExpect("nonStaticMethod",new RefType("java.lang.String",-1)); - - //add methods to classes - testStaticAccessError.addMethod(method); - - access.addMethod(nonStaticMethod); - //Member - access.addMember(new VarExpect("nonStaticMember",new RefType("java.lang.String",-1))); - - Expectation ret = new Expectation(testStaticAccessError); - ret.addClass(access); - //static accessing of objects not possible - ret.addException(new Exception()); - - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/AllgemeinerLambdaTest1.java b/test/mycompiler/test/lambda/AllgemeinerLambdaTest1.java deleted file mode 100755 index 0d331affa..000000000 --- a/test/mycompiler/test/lambda/AllgemeinerLambdaTest1.java +++ /dev/null @@ -1,28 +0,0 @@ -package mycompiler.test.lambda; - -import java.util.HashMap; - -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -public class AllgemeinerLambdaTest1 { - private static final String exampleJavFile = "LambdaTest1.jav"; - private static final String classname = "LambdaTest1"; - - private HashMap variableTypeAssumptions = new HashMap(); - - - @Test - public void test() { - variableTypeAssumptions.put("var", "String"); - executeTest(); - } - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFile); - tester.runTestAndCheckResultSet(classname, variableTypeAssumptions); - - } - -} diff --git a/test/mycompiler/test/lambda/BasicAssumptions.jav b/test/mycompiler/test/lambda/BasicAssumptions.jav deleted file mode 100755 index 91a38c9c5..000000000 --- a/test/mycompiler/test/lambda/BasicAssumptions.jav +++ /dev/null @@ -1,12 +0,0 @@ -import de.dhbwstuttgart.typeinference.Menge; - -class BasicAssumptionsTest{ - -varString; -var = 2; - -void methode(){ - var = 1; - varString.add(var); -} -} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/BasicAssumptionsTest.java b/test/mycompiler/test/lambda/BasicAssumptionsTest.java deleted file mode 100755 index 90b5cf8be..000000000 --- a/test/mycompiler/test/lambda/BasicAssumptionsTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package mycompiler.test.lambda; - -import java.util.HashMap; - -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -public class BasicAssumptionsTest { - private static final String exampleJavFile = "BasicAssumptions.jav"; - private static final String classname = "BasicAssumptionsTest"; - - private HashMap variableTypeAssumptions = new HashMap(); - - - @Test - public void test() { - variableTypeAssumptions.put("varString", "java.lang.String"); - executeTest(); - } - - - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFile); - tester.runTestAndCheckResultSet(classname, variableTypeAssumptions); - - } - -} diff --git a/test/mycompiler/test/lambda/ConstructorTest.java b/test/mycompiler/test/lambda/ConstructorTest.java deleted file mode 100755 index 1ba005186..000000000 --- a/test/mycompiler/test/lambda/ConstructorTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package mycompiler.test.lambda; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import de.dhbwstuttgart.typeinference.Menge; - -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; -import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; - -public class ConstructorTest { - - @Test - public void test() { - executeTest(); - } - - private static final Menge exampleJavFiles = new Menge(); - static{ - exampleJavFiles.add("ConstructorTestFile1.jav"); - exampleJavFiles.add("ConstructorTestFile2.jav"); - } - - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFiles); - Menge results = tester.runTest(); - int anzahlGeparsterKlassen = 0; - for(TypeinferenceResultSet res : results){ - de.dhbwstuttgart.syntaxtree.Class cl = res.getInterferedClass(); - TypeAssumptions ass = cl.getPublicFieldAssumptions(); - if(cl.getName().equals("ConstructorTest1")){ - anzahlGeparsterKlassen++; - }else if(cl.getName().equals("ConstructorTest2")){ - anzahlGeparsterKlassen++; - assertTrue("ConstructorTest2.var muss vom Typ ConstructorTest1 sein.", ass.getVarType("var",cl).printJavaCode( - res.getUnifiedConstraints()).toString().equals("ConstructorTest1")); - }else fail("Die geparsten Klassen müssen ConstructorTest1 und ConstructorTest2 heißen"); - } - assertTrue("Es müssen insgesamt 2 Klassen inferierd worden sein", anzahlGeparsterKlassen == 2); - } - -} diff --git a/test/mycompiler/test/lambda/ConstructorTestFile1.jav b/test/mycompiler/test/lambda/ConstructorTestFile1.jav deleted file mode 100755 index 1b26e2bb4..000000000 --- a/test/mycompiler/test/lambda/ConstructorTestFile1.jav +++ /dev/null @@ -1,8 +0,0 @@ -class ConstructorTest1{ - -ConstructorTest1(){ -var; -var = 1; -} - -} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/ConstructorTestFile2.jav b/test/mycompiler/test/lambda/ConstructorTestFile2.jav deleted file mode 100755 index d2ce318e8..000000000 --- a/test/mycompiler/test/lambda/ConstructorTestFile2.jav +++ /dev/null @@ -1,7 +0,0 @@ -class ConstructorTest2{ -var; - void method(){ - var = new ConstructorTest1(); - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/GenericParameterTest.jav b/test/mycompiler/test/lambda/GenericParameterTest.jav deleted file mode 100644 index 2655fe565..000000000 --- a/test/mycompiler/test/lambda/GenericParameterTest.jav +++ /dev/null @@ -1,7 +0,0 @@ -class GenericVarTest{ - Menge test; - method(){ - test = test; - return 1; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/GenericParameterTest.java b/test/mycompiler/test/lambda/GenericParameterTest.java deleted file mode 100644 index f0adfa957..000000000 --- a/test/mycompiler/test/lambda/GenericParameterTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package mycompiler.test.lambda; - -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; - -public class GenericParameterTest { - @Test - public void test() { - executeTest(); - } - - private static final String exampleJavFile = "GenericParameterTest.jav"; - - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFile); - TypeinferenceResultSet result1 = tester.runTestAndGetSingularResultSet(); - } -} diff --git a/test/mycompiler/test/lambda/GenericVarTest.jav b/test/mycompiler/test/lambda/GenericVarTest.jav deleted file mode 100755 index 6e6db51b8..000000000 --- a/test/mycompiler/test/lambda/GenericVarTest.jav +++ /dev/null @@ -1,7 +0,0 @@ -class GenericVarTest{ - test; - method(){ - test = test; - return 1; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/GenericVarTest.java b/test/mycompiler/test/lambda/GenericVarTest.java deleted file mode 100755 index 9f546dad1..000000000 --- a/test/mycompiler/test/lambda/GenericVarTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package mycompiler.test.lambda; - -import static org.junit.Assert.*; - -import de.dhbwstuttgart.typeinference.Menge; - -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; - -public class GenericVarTest { - - @Test - public void test() { - executeTest(); - } - - private static final String exampleJavFile = "GenericVarTest.jav"; - - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFile); - TypeinferenceResultSet result1 = tester.runTestAndGetSingularResultSet(); - } - -} diff --git a/test/mycompiler/test/lambda/LambdaTest1.jav b/test/mycompiler/test/lambda/LambdaTest1.jav deleted file mode 100755 index b024385cc..000000000 --- a/test/mycompiler/test/lambda/LambdaTest1.jav +++ /dev/null @@ -1,7 +0,0 @@ -class LambdaTest1{ - var = "test"; - - method(String toAppend){ - return (String text) -> { return toAppend;}; - } -} diff --git a/test/mycompiler/test/lambda/OverloadingTest.jav b/test/mycompiler/test/lambda/OverloadingTest.jav deleted file mode 100755 index bdcba2bc6..000000000 --- a/test/mycompiler/test/lambda/OverloadingTest.jav +++ /dev/null @@ -1,21 +0,0 @@ -class OverloadingTest{ - - var; - - public clone(){ - return this; - } - - public testMethode(){ - return var.clone(); - } - -} - -class OverloadingTest2{ - - public clone(){ - return this; - } - -} diff --git a/test/mycompiler/test/lambda/OverloadingTest.java b/test/mycompiler/test/lambda/OverloadingTest.java deleted file mode 100755 index 869c3198e..000000000 --- a/test/mycompiler/test/lambda/OverloadingTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package mycompiler.test.lambda; - -import static org.junit.Assert.*; - -import de.dhbwstuttgart.typeinference.Menge; - -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; - -public class OverloadingTest { - - @Test - public void test() { - executeTest(); - } - - private static final String exampleJavFile = "OverloadingTest.jav"; - - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFile); - Menge result1 = tester.runTest(); - } - -} diff --git a/test/mycompiler/test/lambda/ParseMultipleFilesTest.java b/test/mycompiler/test/lambda/ParseMultipleFilesTest.java deleted file mode 100755 index 47a10a8ae..000000000 --- a/test/mycompiler/test/lambda/ParseMultipleFilesTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package mycompiler.test.lambda; - -import de.dhbwstuttgart.typeinference.Menge; - -import static org.junit.Assert.*; -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; -import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; - -public class ParseMultipleFilesTest { - - @Test - public void test() { - executeTest(); - } - - private static final Menge exampleJavFiles = new Menge(); - static{ - exampleJavFiles.add("parseMultipleFilesFile1.jav"); - exampleJavFiles.add("parseMultipleFilesFile2.jav"); - } - - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFiles); - Menge results = tester.runTest(); - int anzahlGeparsterKlassen = 0; - for(TypeinferenceResultSet res : results){ - de.dhbwstuttgart.syntaxtree.Class cl = res.getInterferedClass(); - TypeAssumptions ass = cl.getPublicFieldAssumptions(); - if(cl.getName().equals("Klasse1")){ - anzahlGeparsterKlassen++; - assertTrue("Klasse1.var1 muss vom Typ int sein.", ass.getVarType("var1",cl).printJavaCode(res.getUnifiedConstraints()).toString().equals("int")); - }else if(cl.getName().equals("Klasse2")){ - anzahlGeparsterKlassen++; - assertTrue("Klasse1.var1 muss vom Typ Klasse1 sein.", ass.getVarType("var1",cl).printJavaCode(res.getUnifiedConstraints()).toString().equals("Klasse1")); - }else fail("Die geparsten Klassen müssen Klasse1 und Klasse2 heißen"); - } - assertTrue("Es müssen insgesamt 2 Klassen inferierd worden sein", anzahlGeparsterKlassen == 2); - } - -} diff --git a/test/mycompiler/test/lambda/TestAssign.jav b/test/mycompiler/test/lambda/TestAssign.jav deleted file mode 100755 index 17117f182..000000000 --- a/test/mycompiler/test/lambda/TestAssign.jav +++ /dev/null @@ -1,3 +0,0 @@ -class Assign{ -stringVar = "String"; -} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/TestAssign.java b/test/mycompiler/test/lambda/TestAssign.java deleted file mode 100755 index f8aace823..000000000 --- a/test/mycompiler/test/lambda/TestAssign.java +++ /dev/null @@ -1,35 +0,0 @@ -package mycompiler.test.lambda; - -import java.util.HashMap; -import de.dhbwstuttgart.typeinference.Menge; - -import junit.framework.TestCase; -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; - -public class TestAssign extends TestCase{ - - private static final String exampleJavFile = "TestAssign.jav"; - private static final String classname = "Assign"; - private HashMap variableTypeAssumptions = new HashMap(); - - - @Test - public void test() { - variableTypeAssumptions.put("stringVar", "java.lang.String"); - executeTest(); - } - - - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFile); - tester.runTestAndCheckResultSet(classname, variableTypeAssumptions); - - } - - -} diff --git a/test/mycompiler/test/lambda/TestFunN.jav b/test/mycompiler/test/lambda/TestFunN.jav deleted file mode 100755 index 6488fdf7e..000000000 --- a/test/mycompiler/test/lambda/TestFunN.jav +++ /dev/null @@ -1,2 +0,0 @@ -class Matrix extends Menge> { -op = (m) -> (f) -> f.apply(this, m); } \ No newline at end of file diff --git a/test/mycompiler/test/lambda/TestFunN.java b/test/mycompiler/test/lambda/TestFunN.java deleted file mode 100755 index 6866be672..000000000 --- a/test/mycompiler/test/lambda/TestFunN.java +++ /dev/null @@ -1,29 +0,0 @@ -package mycompiler.test.lambda; - -import java.util.HashMap; - -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -public class TestFunN { - - private static final String exampleJavFile = "TestFunN.jav"; - private static final String classname = "TestFunN"; - private HashMap variableTypeAssumptions = new HashMap(); - - - @Test - public void test() { - //variableTypeAssumptions.put("op", "Fun1"); - executeTest(); - } - - - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFile); - tester.runTestAndCheckResultSet(classname, variableTypeAssumptions); - - } -} diff --git a/test/mycompiler/test/lambda/TestIfStmt.jav b/test/mycompiler/test/lambda/TestIfStmt.jav deleted file mode 100755 index b4a244d46..000000000 --- a/test/mycompiler/test/lambda/TestIfStmt.jav +++ /dev/null @@ -1,13 +0,0 @@ -class TestIfStmt { - -methode(){ - var; - if(true){ - var=this; - }else{ - var=this; - } - return 1; -} - -} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/TestIfStmt.java b/test/mycompiler/test/lambda/TestIfStmt.java deleted file mode 100755 index d405c4cce..000000000 --- a/test/mycompiler/test/lambda/TestIfStmt.java +++ /dev/null @@ -1,28 +0,0 @@ -package mycompiler.test.lambda; - -import static org.junit.Assert.*; - -import java.util.HashMap; - -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -public class TestIfStmt { - @Test - public void test() { - variableTypeAssumptions.put("var", "TestIfStmt"); - executeTest(); - } - - private static final String exampleJavFile = "TestIfStmt.jav"; - private static final String classname = "TestIfStmt"; - - private HashMap variableTypeAssumptions = new HashMap(); - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFile); - tester.runTestAndCheckResultSet(classname, variableTypeAssumptions); - - } -} diff --git a/test/mycompiler/test/lambda/TestInterface.jav b/test/mycompiler/test/lambda/TestInterface.jav deleted file mode 100644 index 569e12943..000000000 --- a/test/mycompiler/test/lambda/TestInterface.jav +++ /dev/null @@ -1,9 +0,0 @@ -interface TestInterface{ - methode(); -} - -class TestClass implements TestInterface{ - methode(){ - return "test"; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/TestInterface.java b/test/mycompiler/test/lambda/TestInterface.java deleted file mode 100644 index a73aa9520..000000000 --- a/test/mycompiler/test/lambda/TestInterface.java +++ /dev/null @@ -1,24 +0,0 @@ -package mycompiler.test.lambda; - -import java.util.HashMap; - -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -public class TestInterface { - @Test - public void test() { - //Testet nur ob ein Interface ohne Fehler geparst und inferiert wird. - executeTest(); - } - - private static final String exampleJavFile = "TestInterface.jav"; - - private HashMap variableTypeAssumptions = new HashMap(); - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFile); - tester.runTest(); - } -} diff --git a/test/mycompiler/test/lambda/TestLambda.jav b/test/mycompiler/test/lambda/TestLambda.jav deleted file mode 100755 index 36f107343..000000000 --- a/test/mycompiler/test/lambda/TestLambda.jav +++ /dev/null @@ -1,3 +0,0 @@ -class TestLambda{ -op = (test) -> test = "string"; -} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/TestLambda.java b/test/mycompiler/test/lambda/TestLambda.java deleted file mode 100755 index 4c540f483..000000000 --- a/test/mycompiler/test/lambda/TestLambda.java +++ /dev/null @@ -1,38 +0,0 @@ -package mycompiler.test.lambda; - -import static org.junit.Assert.*; - -import java.util.HashMap; - -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; - -public class TestLambda { - - private static final String exampleJavFile = "TestLambda.jav"; - private static final String classname = "TestLambda"; - private HashMap variableTypeAssumptions = new HashMap(); - - - @Test - public void test() { - // Die folgenden 3 Lösungen sind alle richtig. - //TODO: Möglichkeit mehrere richtiger Lösungen beim Test implementieren. - variableTypeAssumptions.put("op", "Fun1"); - variableTypeAssumptions.put("op", "Fun1"); - variableTypeAssumptions.put("op", "Fun1"); - executeTest(); - } - - - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFile); - //tester.runTestAndCheckResultSet(classname, variableTypeAssumptions); - tester.runTest(); - } - -} diff --git a/test/mycompiler/test/lambda/TestMethodCall.jav b/test/mycompiler/test/lambda/TestMethodCall.jav deleted file mode 100755 index 8abb035be..000000000 --- a/test/mycompiler/test/lambda/TestMethodCall.jav +++ /dev/null @@ -1,17 +0,0 @@ -class TestMethodCall { - -var; - -getSomething(){ - return this; -} - -getSomethingMore(){ - return getSomething(); -} - -void setVar(){ - var = getSomethingMore(); -} - -} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/TestMethodCall.java b/test/mycompiler/test/lambda/TestMethodCall.java deleted file mode 100755 index 5e39ba271..000000000 --- a/test/mycompiler/test/lambda/TestMethodCall.java +++ /dev/null @@ -1,29 +0,0 @@ -package mycompiler.test.lambda; - -import static org.junit.Assert.*; - -import java.util.HashMap; - -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -public class TestMethodCall { - - @Test - public void test() { - variableTypeAssumptions.put("var", "TestMethodCall"); - executeTest(); - } - - private static final String exampleJavFile = "TestMethodCall.jav"; - private static final String classname = "TestMethodCall"; - - private HashMap variableTypeAssumptions = new HashMap(); - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFile); - tester.runTestAndCheckResultSet(classname, variableTypeAssumptions); - } - -} diff --git a/test/mycompiler/test/lambda/TestThis.java b/test/mycompiler/test/lambda/TestThis.java deleted file mode 100755 index a03575e52..000000000 --- a/test/mycompiler/test/lambda/TestThis.java +++ /dev/null @@ -1,29 +0,0 @@ -package mycompiler.test.lambda; - -import java.util.HashMap; - -import mycompiler.mytest.LambdaTest; - -import org.junit.Test; - -public class TestThis { - private static final String exampleJavFile = "ThisTest.jav"; - private static final String classname = "ThisTest"; - private HashMap variableTypeAssumptions = new HashMap(); - - - @Test - public void test() { - variableTypeAssumptions.put("thisVar", "ThisTest"); - executeTest(); - } - - - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFile); - tester.runTestAndCheckResultSet(classname, variableTypeAssumptions); - - } - -} diff --git a/test/mycompiler/test/lambda/TestWhile.jav b/test/mycompiler/test/lambda/TestWhile.jav deleted file mode 100755 index 504a72cf1..000000000 --- a/test/mycompiler/test/lambda/TestWhile.jav +++ /dev/null @@ -1,10 +0,0 @@ -class WhileTest{ - - var; - public method(){ - while(true){ - var = "String"; - } - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/TestWhile.java b/test/mycompiler/test/lambda/TestWhile.java deleted file mode 100755 index 1c193d6c0..000000000 --- a/test/mycompiler/test/lambda/TestWhile.java +++ /dev/null @@ -1,37 +0,0 @@ -package mycompiler.test.lambda; - -import static org.junit.Assert.*; - -import java.util.HashMap; -import de.dhbwstuttgart.typeinference.Menge; - -import mycompiler.mytest.LambdaTest; -import mycompiler.mytypereconstruction.set.CTypeAssumptionSet; - -import org.junit.Test; - -import de.dhbwstuttgart.syntaxtree.type.Type; -import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; -import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; - -public class TestWhile { - - @Test - public void test() { - variableTypeAssumptions.put("var", "String"); - executeTest(); - } - - private static final String exampleJavFile = "TestWhile.jav"; - private static final String classname = "WhileTest"; - - private HashMap variableTypeAssumptions = new HashMap(); - - public void executeTest(){ - LambdaTest tester = new LambdaTest(exampleJavFile); - tester.runTestAndCheckResultSet(classname, variableTypeAssumptions); - - } - -} diff --git a/test/mycompiler/test/lambda/ThisTest.jav b/test/mycompiler/test/lambda/ThisTest.jav deleted file mode 100755 index 0ca725581..000000000 --- a/test/mycompiler/test/lambda/ThisTest.jav +++ /dev/null @@ -1,5 +0,0 @@ -class ThisTest{ - -thisVar = this; - -} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/parseMultipleFilesFile1.jav b/test/mycompiler/test/lambda/parseMultipleFilesFile1.jav deleted file mode 100755 index e51527c00..000000000 --- a/test/mycompiler/test/lambda/parseMultipleFilesFile1.jav +++ /dev/null @@ -1,18 +0,0 @@ -class Klasse2 { - -var1; - -testMethode(){ - var1 = new Klasse1(); - return var1.getVar1(); -} - -} - -class Klasse1 { - var1; - - int getVar1(){ - return var1; - } -} diff --git a/test/mycompiler/test/lambda/parseMultipleFilesFile2.jav b/test/mycompiler/test/lambda/parseMultipleFilesFile2.jav deleted file mode 100755 index 47def1950..000000000 --- a/test/mycompiler/test/lambda/parseMultipleFilesFile2.jav +++ /dev/null @@ -1,7 +0,0 @@ -class Klasse1 { - var1; - - int getVar1(){ - return var1; - } -} diff --git a/test/mycompiler/test/lambda/testResults/LambdaTest.log b/test/mycompiler/test/lambda/testResults/LambdaTest.log deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/mycompiler/test/notUsedAnymore/AbstractInferenceTestExtendedOLD.java b/test/mycompiler/test/notUsedAnymore/AbstractInferenceTestExtendedOLD.java deleted file mode 100755 index 55da86acd..000000000 --- a/test/mycompiler/test/notUsedAnymore/AbstractInferenceTestExtendedOLD.java +++ /dev/null @@ -1,149 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import java.util.HashMap; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import mycompiler.mytypereconstruction.typeassumption.CInstVarTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CLocalVarTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CMethodTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption; - -/* TODO: this file may be merged with AbstractInferenceTest, meanwhile used for extended testing, where redundant implementations are realized here - * - */ - -public abstract class AbstractInferenceTestExtendedOLD extends AbstractInferenceTestOLD_2 { - - protected HashMap expectedMethodTypeAssumptions = null; - protected HashMap> expectedMethodsTypeAssumptions = null; - - protected AbstractInferenceTestExtendedOLD(String name, String javFilename) { - super(name,javFilename); - this.expectedMethodTypeAssumptions=getExpectedMethodTypeAssumptions(); - this.expectedMethodsTypeAssumptions=getExpectedMethodsTypeAssumptions(); - } - @Deprecated - /** - * - * @return HashMap containing inference results for specific method or null - * key: method name - * value: CMethodTypeAssumption - */ - protected HashMap getExpectedMethodTypeAssumptions() { - return null; - } - - protected HashMap> getExpectedMethodsTypeAssumptions() { - return null; - } - - /** - * start test according to JUnit conventions - * @throws Throwable - */ - public void testSetup() throws Throwable { - runTest(); - } - - protected void checkForFoundClass(Menge foundClasses) { - AbstractInferenceTestExtendedOLD.assertTrue(foundClasses.contains(this.testedClasses.elementAt(0))); - } - - protected void checkForFoundGenerics(Menge foundGenerics) { - - } - - protected void checkForValidMethodTypes(CMethodTypeAssumption assumpt) { - //if called, methods have been found, thus expectation should not be null - if (this.expectedMethodTypeAssumptions!=null) { - //check if found method is expected - AbstractInferenceTestExtendedOLD.assertTrue(expectedMethodTypeAssumptions.containsKey(assumpt.getIdentifier())); - //select correct expected method for further asserts - CMethodTypeAssumption expected = this.expectedMethodTypeAssumptions.get(assumpt.getIdentifier()); - - //return type - AbstractInferenceTestExtendedOLD.assertEquals(expected.getAssumedType().getName(), assumpt.getAssumedType().getName()); - - AbstractInferenceTestExtendedOLD.assertTrue(expected.equalsAssumption(assumpt)); - //number parameters - // AbstractInferenceTestExtended.assertTrue(expected.getParaCount()==assumpt.getParaCount()); - /* for (int i=0;i param = expected.getParaAssumptions(); - AbstractInferenceTestExtended.assertTrue(expected.getParaAssumptions().contains(param.get(i))); - } - */ - //Generic Parameter - AbstractInferenceTestExtendedOLD.assertTrue(expected.getGenericMethodParameters().size()==assumpt.getGenericMethodParameters().size()); - for (int i=0;i> assumptions) { - - AbstractInferenceTestExtendedOLD.assertTrue(expectedMethodsTypeAssumptions.size()==assumptions.size()); - AbstractInferenceTestExtendedOLD.assertTrue(expectedMethodsTypeAssumptions.keySet().equals(assumptions.keySet())); - - //call test for every method - for(String method : assumptions.keySet()) { - Menge currentMethodExpectation = expectedMethodsTypeAssumptions.get(method); - Menge currentMethodAssumption = assumptions.get(method); - - //verify amount of assumption for method - AbstractInferenceTestExtendedOLD.assertTrue(currentMethodExpectation.size()==currentMethodAssumption.size()); - - for (int i=0;i paramExpected = currentMethodExpectation.elementAt(i).getParaAssumptions(); - Menge paramAssumpt = currentMethodAssumption.elementAt(i).getParaAssumptions(); - //check for parameter assumptions - for (int j=0;j genericsExpected = currentMethodExpectation.get(i).getGenericMethodParameters(); - Menge genericsAssumpt = currentMethodAssumption.get(i).getGenericMethodParameters(); - //check amount - AbstractInferenceTestExtendedOLD.assertTrue(genericsExpected.size()==genericsAssumpt.size()); - for (int j=0;j assumption,Menge expected) { - //boolean ret=false; - for (int i=0;i testedClasses = null; - protected MyCompilerAPI compiler = MyCompiler.getAPI(); - - protected AbstractInferenceTestOLD_2(String name, String javFilename) { - super(name); - javFile = new File(javFilename); - this.testedClasses = getTestedClasses(); - } - - protected void runTest() throws Throwable { - parseFile(); - typeReconstruction(); - codeGeneration(); - } - - protected void parseFile() - throws Throwable - { - // Parsen der Klasse - compiler.parse(javFile); - } - - protected void typeReconstruction() - throws Exception - { - // Typ-Rekonstruktion - Menge resultSet = compiler.typeReconstruction(); - // Keine Typ-Rekonstruktion erforderlich - if (resultSet == null || resultSet.size() == 0) throw new Exception("Typrekonstruktion nicht durchfuehrbar!"); - - //specific Testcase-Check for every tested class - - for (String testedClass : this.testedClasses) { - //System.out.println("number1: "+ testedClass); - checkResults(resultSet, testedClass); - } - - TypeinferenceResultSet onePossibility = resultSet.firstElement(); - Iterator substIt = onePossibility.getSubstitutions().getIterator(); - while(substIt.hasNext()){ - CSubstitution subst = (CSubstitution)substIt.next(); - // Substition machen - subst.execute(); - } - } - - protected void codeGeneration() - throws Exception - { - // Code generieren - compiler.codeGeneration(); - } - - - /** - * extracts type-inference results for tested class and calls test methods - * test methods shall be implemented as needed in test class, - * @param resultSet result from typeReconstruction() - */ -// protected void checkResults(Menge resultSet, String testedClass) { -// -// //check valid - implementation -//System.out.println("Länge ResultSet: " + resultSet.size()); -// for (int resIndex=0; resIndex < resultSet.size(); resIndex++) { -// //-------- -// //Classes: -// //-------- -// checkForFoundClass(resultSet.get(resIndex).getClassNameList()); -// //--------- -// //Generics: -// //---------Menge genVec = resultSet.get(resIndex).getGenericsTable().get(testedClass); -// checkForFoundGenerics(resultSet.get(resIndex).getGenericsTable().get(testedClass)); -// //---------- -// // Methods: -// //---------- -// HashMap> assumptions = new HashMap>(); -// Iterator iter1 = resultSet.get(resIndex).getMethodIntersectionTypes().values().iterator(); -// while (iter1.hasNext()) { -// Menge vecAssumpt = iter1.next().getMethodTypeAssumptions(); -// //for (int i=0; i()); -// } -// -// assumptions.get(assumpt.getIdentifier()).add(assumpt); -// //------------------------- -// } -// //} -// } -// if (!assumptions.isEmpty()) -// checkForValidMethodTypes(assumptions); -// //--------------------------- -// //Local and member variables: -// //--------------------------- -// -// Iterator iter2 = resultSet.get(resIndex).getFieldAndLocalVarAssumptions().values().iterator(); -// while (iter2.hasNext()) { -// CTypeAssumption assumption = iter2.next(); -// -// // Es ist eine locale Variable -// if (assumption instanceof CLocalVarTypeAssumption) { -// -// CLocalVarTypeAssumption assu = (CLocalVarTypeAssumption)assumption; -// -// if (assu.getClassName().equals(testedClass)) { -// //---------------------- -// checkForValidLocalVarTypes(assu); -// //---------------------- -// } -// -// } -// -// // Es ist eine Member-Variable -// else if (assumption instanceof CInstVarTypeAssumption) { -// -// CInstVarTypeAssumption assu = (CInstVarTypeAssumption)assumption; -// if (assu.getClassName().equals(testedClass)) { -// //------------------- -// checkForValidMemberTypes(assu); -// //-------------------- -// } -// } -// } -// } -// } - protected void checkResults(Menge resultSet, String testedClass) { - - //check valid - implementation -System.out.println("Länge ResultSet: " + resultSet.size()); - for (int resIndex=0; resIndex < resultSet.size(); resIndex++) { - //-------- - //Classes: - //-------- - // checkForFoundClass(resultSet.get(resIndex).getClassNameList()); - //--------- - //Generics: - //---------Menge genVec = resultSet.get(resIndex).getGenericsTable().get(testedClass); - // checkForFoundGenerics(resultSet.get(resIndex).getGenericsTable().get(testedClass)); - //---------- - // Methods: - //---------- - HashMap> assumptions = new HashMap>(); - Iterator iter1 = resultSet.get(resIndex).getMethodIntersectionTypes().values().iterator(); - while (iter1.hasNext()) { - Menge vecAssumpt = iter1.next().getMethodTypeAssumptions(); - //for (int i=0; i()); - } - - assumptions.get(assumpt.getIdentifier()).add(assumpt); - //------------------------- - } - //} - } - if (!assumptions.isEmpty()) - checkForValidMethodTypes(assumptions); - //--------------------------- - //Local and member variables: - //--------------------------- - - Iterator iter2 = resultSet.get(resIndex).getFieldAndLocalVarAssumptions().values().iterator(); - while (iter2.hasNext()) { - CTypeAssumption assumption = iter2.next(); - - // Es ist eine locale Variable - if (assumption instanceof CLocalVarTypeAssumption) { - - CLocalVarTypeAssumption assu = (CLocalVarTypeAssumption)assumption; - - if (assu.getClassName().equals(testedClass)) { - //---------------------- - checkForValidLocalVarTypes(assu); - //---------------------- - } - - } - - // Es ist eine Member-Variable - else if (assumption instanceof CInstVarTypeAssumption) { - - CInstVarTypeAssumption assu = (CInstVarTypeAssumption)assumption; - if (assu.getClassName().equals(testedClass)) { - //------------------- - checkForValidMemberTypes(assu); - //-------------------- - } - } - } - } - } - - /** - * @return returns a Menge of class names of tested file - */ - protected abstract Menge getTestedClasses(); - protected void checkForFoundClass(Menge foundClasses) {} - protected void checkForFoundGenerics(Menge foundGenerics) {} - @Deprecated - protected void checkForValidMethodTypes(CMethodTypeAssumption assumpt) {} - protected void checkForValidMethodTypes(HashMap> assumptions) {} - protected void checkForValidLocalVarTypes(CLocalVarTypeAssumption assumpt) {} - protected void checkForValidMemberTypes(CInstVarTypeAssumption assumpt) {} - protected void setUp() {} - protected void tearDown() {} - -// protected void setUp() -// throws Exception -// { -// super.setUp(); -//System.out.println("setup called"); -// -// // Setup fuer Log4J -// // Logfiles werden im Ordner testResults gespeichert -// // Der Dateiname ist der Klassename plus .log -// String logFile = "testResults/"+ javFile.getName() + ".log"; -// -// File f = new File(logFile); // Altes Logfile loeschen -// f.delete(); -// -// // Ausgabeoptionen fuer die Logger -// PatternLayout pl = new PatternLayout("%-15C{1} %-5p [%-9c] %m%n"); -// FileAppender fa = new FileAppender(pl, logFile); -// -// // Die Einstellungen jedes Loggers veraendern -// ModifyLogger("parser", Level.ALL, fa); -// ModifyLogger("inference", Level.INFO, fa); -// ModifyLogger("codegen", Level.ALL, fa); -// ModifyLogger("bytecode", Level.ALL, fa); -// } -// -// protected void ModifyLogger(String strlogger, Level lv, FileAppender fa) -// { -// Logger lg = Logger.getLogger(strlogger); -// -// lg.setLevel(lv); -// lg.removeAllAppenders(); -// lg.addAppender(fa); -// } -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/AbstractInferenceTestOld.java b/test/mycompiler/test/notUsedAnymore/AbstractInferenceTestOld.java deleted file mode 100755 index c008e6cbf..000000000 --- a/test/mycompiler/test/notUsedAnymore/AbstractInferenceTestOld.java +++ /dev/null @@ -1,381 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import java.io.File; -import java.util.HashMap; -import java.util.Iterator; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.core.MyCompiler; -import de.dhbwstuttgart.core.MyCompilerAPI; -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.Type; -import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; -import de.dhbwstuttgart.typeinference.unify.CSubstitution; -import junit.framework.TestCase; -import mycompiler.mytypereconstruction.CIntersectionType; -import mycompiler.mytypereconstruction.typeassumption.CInstVarTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CLocalVarTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CMethodTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.BlockExpect; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** Todo: - inheritance - * - exception handling cannot verify correct exception yet - * - generic returntype does not work well - * - cmethodkey-usage? - * - log4j - * - * done: - exception handling - * - commented asserts - * @author Stresing - * last change: 06-04-08 - */ -public abstract class AbstractInferenceTestOld extends TestCase { - - private File javFile=null; - private Expectation expectation=null; - private MyCompilerAPI compiler = MyCompiler.getAPI(); - - private final static String METHODNAMEDELIMITER = "#"; - - protected AbstractInferenceTestOld(String name, String javFilename) { - super(name); - javFile = new File(javFilename); - - //retrieve Expectation object from specific Testcase for comparisons - this.expectation = getExpectations(); - } - - /** - * runs the JUnit-Test, calls all compiler steps - * @throws Throwable - */ - public void testSetup() throws Throwable { - //runs all compiler steps, any exception will cause the Test to fail, if not expected - - try { - parseFile(); - typeReconstruction(); - //codeGeneration(); - } catch (Exception e) { - checkForExpectedException(e); - - } - } - - /** - * calls parse() from Compiler-API - * @throws Throwable - */ - - protected void parseFile() - throws Throwable - { - // Parse file - compiler.parse(javFile); - } - - /** - * calls typeReconstruction() from Compiler-API, checks result against expectations and substitutes all types according to first assumption - * @throws Exception - */ - - protected void typeReconstruction() - throws Exception - { - // Typ-Rekonstruktion - Menge resultSet = compiler.typeReconstruction(); - // Keine Typ-Rekonstruktion erforderlich - if (resultSet == null || resultSet.size() == 0) throw new Exception("Type reconstruction could not be done!"); - - if (this.expectation.getClasses()!=null) - checkResults(resultSet,this.expectation); - - TypeinferenceResultSet onePossibility = resultSet.firstElement(); - Iterator substIt = onePossibility.getSubstitutions().getIterator(); - while(substIt.hasNext()){ - CSubstitution subst = (CSubstitution)substIt.next(); - // Substition machen - subst.execute(); - } - } - - /** - * calls codeGeneration from Compiler-API - * @throws Exception - */ - - protected void codeGeneration() - throws Exception - { - // Code generieren - compiler.codeGeneration(); - } - - /** - * compares resultSet from compiler to expectations - * @param resultSet - * @param expect - */ - - protected void checkResults(Menge resultSet, Expectation expect) { - - //iterates thru all available assumption-sets - for (int resIndex=0; resIndex < resultSet.size(); resIndex++) { - //checks whether all expected classes, methods, members are available - checkClasses(resultSet.get(resIndex),expect); - //-------------- - //Methods - //-------------- - //iterates through all found methods - Iterator iter1 = resultSet.get(resIndex).getMethodIntersectionTypes().values().iterator(); - while (iter1.hasNext()) { - Menge vecAssumpt = iter1.next().getMethodTypeAssumptions(); - //for (int i=0; i iter2 = resultSet.get(resIndex).getFieldAndLocalVarAssumptions().values().iterator(); - while (iter2.hasNext()) { - CTypeAssumption assumption = iter2.next(); - - // local variable - if (assumption instanceof CLocalVarTypeAssumption) { - - CLocalVarTypeAssumption assu = (CLocalVarTypeAssumption)assumption; - - if (expect.getClasses().containsKey(assu.getClassName())){ - //current method to compare assumption to: - MethodExpect method = expect.getClasses().get(assu.getClassName()).getMethods().get(assu.getMethodName()+ AbstractInferenceTestOld.METHODNAMEDELIMITER + assu.getMethodOverloadedID() + AbstractInferenceTestOld.METHODNAMEDELIMITER + assu.getMethodParaCount()); - AbstractInferenceTest.assertTrue("block variable " + assu.getMethodName()+ " not valid or not found!",checkFoundVariable(assu, method.getBlock())); - } - - } - - // member variable - else if (assumption instanceof CInstVarTypeAssumption) { - - - CInstVarTypeAssumption assu = (CInstVarTypeAssumption)assumption; - if (expect.getClasses().containsKey(assu.getClassName())){ - //current class to compare assumption to: - ClassExpect classexpect = expect.getClasses().get(assu.getClassName()); - checkFoundMembers(assu, classexpect.getMembers()); - } - } - } - } - - //verify that every single type assumption that was expected has been detected by the compiler - AbstractInferenceTest.assertTrue("not all expected types have been found", expectation.verifyTypeExpectationsCompletelyMet()); - } - - /** - * @return returns a Menge of class names of tested file - */ - protected abstract Expectation getExpectations(); - - - /** - * checks the return type of a method comparing it to the expectation - * @param assumpt - * @param expect - */ - protected void checkReturnType(Type assumpt, MethodExpect expect) { - if (!expect.getReturntypes().isEmpty()) { - AbstractInferenceTest.assertTrue("found return type " + assumpt.getName() + " is not in expected list", expect.getReturntypes().contains(assumpt)); - - checkBoundedTypes(assumpt,expect.getReturntypes().get(expect.getReturntypes().indexOf(assumpt))); - //remove this expectation to assure, all expectations have been met at least once - if (expect.getReturntypesCopy().contains(assumpt)) - expect.getReturntypesCopy().remove(assumpt); - } - else if (assumpt instanceof GenericTypeVar) - //expect.addGeneric((GenericTypeVar) assumpt); - System.out.println("assumpt is GenericTypeVar"); - else - AbstractInferenceTest.assertTrue("no return type for " + assumpt.getName() +" has been defined in expectation",assumpt instanceof TypePlaceholder); - } - - /** - * checks for generic methods comparing them to the expectation - * @param assumpt - * @param expect - */ - protected void checkFoundGenerics(Menge assumpt, Menge expect) { - AbstractInferenceTest.assertTrue("amount of generic variables expected != assumed",((assumpt==null || assumpt.size()==0) && (expect==null || expect.size()==0)) || assumpt.size()==expect.size()); - for (GenericTypeVar typ : assumpt) { - //System.out.println("Generics: " + typ.get_Name() + ((BoundedGenericTypeVar)typ).getBounds() + ", " + expect.indexOf(typ)); - AbstractInferenceTest.assertTrue("Generic " + typ.getName() + " has not been expected",expect.contains(typ)); - - checkBoundedTypes(typ,expect.get(expect.indexOf(typ))); - } - } - - private void checkBoundedTypes(Type assumed, Type expected) { - if (assumed instanceof BoundedGenericTypeVar) { - AbstractInferenceTest.assertTrue(expected instanceof BoundedGenericTypeVar); - BoundedGenericTypeVar typBound = (BoundedGenericTypeVar)assumed; - BoundedGenericTypeVar expBound = (BoundedGenericTypeVar)expected; - for (Type t : typBound.getBounds()) { - boolean ret = false; - for (Type e : expBound.getBounds()) { -System.out.println(" here " + t + " -- " + e); - if (e.equals(t)) { - ret=true; - } - } - AbstractInferenceTest.assertTrue("Bounded generic's type is not equal", ret); - } - } - else if (assumed instanceof GenericTypeVar) { - System.out.println("GENERICTYPEVAR"); - } - } - - /** - * searches recursively for the matching block in the expectation set and compares found variables to the expectation - * @param assumpt - * @param expect - * @return - */ - - protected boolean checkFoundVariable(CLocalVarTypeAssumption assumpt, BlockExpect expect) { - //there is an expectation for a variable - AbstractInferenceTest.assertTrue(expect!=null); - boolean ret=false; - if (expect.getBlockID().equals(assumpt.getBlockId())) { - AbstractInferenceTest.assertTrue("Variable "+assumpt.getIdentifier() + " is not defined in expectation",expect.getLocalVar().containsKey(assumpt.getIdentifier())); - Menge expTypes = expect.getLocalVar().get(assumpt.getIdentifier()).getExpectedType(); - //check if a specific type for this variable is expected or whether it should be a typeplaceholder - if (!expTypes.isEmpty()) { - AbstractInferenceTest.assertTrue("Type " + assumpt.getAssumedType() + " for variable " + assumpt.getIdentifier() + " is not found in expectations", expTypes.contains(assumpt.getAssumedType())); - checkBoundedTypes(assumpt.getAssumedType(), expTypes.get(expTypes.indexOf(assumpt.getAssumedType()))); - - //remove this expectation to assure, all expectations have been met at least once - expect.getLocalVar().get(assumpt.getIdentifier()).getExpectedTypeCopy().remove(assumpt.getAssumedType()); - } - else - //check for TypePlaceholder as expected - AbstractInferenceTest.assertTrue("no type for variable "+ assumpt.getIdentifier() + " has been defined", assumpt.getAssumedType() instanceof TypePlaceholder); - - return true; - } - else if (expect.getContainedBlocks()!=null){ - //dig one block deeper in hierarchy - for (BlockExpect exp : expect.getContainedBlocks()) - ret |= checkFoundVariable(assumpt,exp); - return ret; - } - return false; - } - /** - * checks method parameters comparing them to the expectation - * @param assumpt - * @param expect - */ - - protected void checkParameters(CMethodTypeAssumption methodAssumpt, MethodExpect methodExpect) { - Menge assumpt = methodAssumpt.getParaAssumptions(); - HashMap expect = methodExpect.getParameter(); - //amount of parameter - AbstractInferenceTest.assertEquals("amount of parameters not equal!", assumpt.size(),expect.size()); - - for (CParaTypeAssumption paraAssumpt : assumpt) { - //check if variable is expected - AbstractInferenceTest.assertTrue("variable " + paraAssumpt.getIdentifier() + " is not expected!", expect.containsKey(paraAssumpt.getIdentifier())); - Menge expectedTypes = expect.get(paraAssumpt.getIdentifier()).getExpectedType(); - //check if variable's type is expected - - //case of undefined type (generic variable), add generic to generic list - if (!expectedTypes.isEmpty()) { - AbstractInferenceTest.assertTrue("type " + paraAssumpt.getAssumedType() + " for variable " + paraAssumpt.getIdentifier() + " is not expected!", expectedTypes.contains(paraAssumpt.getAssumedType())); - checkBoundedTypes(paraAssumpt.getAssumedType(), expectedTypes.get(expectedTypes.indexOf(paraAssumpt.getAssumedType()))); - - //remove this expectation to assure, all expectations have been met at least once - expect.get(paraAssumpt.getIdentifier()).getExpectedTypeCopy().remove(paraAssumpt.getAssumedType()); - } - else if (paraAssumpt.getAssumedType() instanceof GenericTypeVar) { - if (!methodExpect.getGenerics().contains((GenericTypeVar)paraAssumpt.getAssumedType())) - methodExpect.addGeneric((GenericTypeVar) paraAssumpt.getAssumedType()); - } - else - AbstractInferenceTest.fail("no type for " + paraAssumpt.getIdentifier() +" has been defined in expectation"); - } - } - - /** - * checks every class expected is included in compiler assumption + available generics - * @param assumption - * @param expectation - */ - protected void checkClasses(TypeinferenceResultSet assumption, Expectation expectation) { - - - for (String expect : expectation.getClasses().keySet()) { - //class exists - AbstractInferenceTest.assertTrue("class " + expect + " is not found in assumption!", assumption.getClassNameList().contains(expect)); - //generics - checkFoundGenerics(assumption.getGenerics(expect), expectation.getClasses().get(expect).getGenerics()); - } - } - - /** - * members found are compared to the expectation - * @param assumpt - * @param expect - */ - - protected void checkFoundMembers(CInstVarTypeAssumption assumpt, HashMap expect) { - AbstractInferenceTest.assertTrue("Member " + assumpt.getIdentifier() + " is not found in expectation!", expect.containsKey(assumpt.getIdentifier())); - AbstractInferenceTest.assertTrue("Type " + assumpt.getAssumedType() + " for member " + assumpt.getIdentifier() + " is not found in expectation",expect.get(assumpt.getIdentifier()).getExpectedType().contains(assumpt.getAssumedType())); - // - //remove this expectation to assure, all expectations have been met at least once - if (expect.get(assumpt.getIdentifier()).getExpectedTypeCopy().contains(assumpt.getAssumedType())) - expect.get(assumpt.getIdentifier()).getExpectedTypeCopy().remove(assumpt.getAssumedType()); - } - - /** - * called to verify whether thrown exception from compiler calls is expected - * @param e - * @throws Throwable - */ - protected void checkForExpectedException (Exception e) throws Throwable { - if (!this.expectation.getExceptions().isEmpty()) { - //check if thrown exception has been expected - e.printStackTrace(); - System.out.println(e.getClass()); - //AbstractInferenceTest2.assertTrue("Exception " + e.getMessage() + " is not same as expected", e.getClass().equals(this.expectation.getExceptions().firstElement())); - AbstractInferenceTestOLD_2.assertTrue("Exception " + e.getMessage() + " is not expected", !this.expectation.getExceptions().isEmpty()); - } - else - throw e; - } - - @Deprecated - protected void checkForValidMethodTypes(CMethodTypeAssumption assumpt) {} - protected void setUp() {} - protected void tearDown() {} -} diff --git a/test/mycompiler/test/notUsedAnymore/CTypeAssumptionWrapper.java b/test/mycompiler/test/notUsedAnymore/CTypeAssumptionWrapper.java deleted file mode 100755 index 4bc8c82ca..000000000 --- a/test/mycompiler/test/notUsedAnymore/CTypeAssumptionWrapper.java +++ /dev/null @@ -1,60 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption; - -public class CTypeAssumptionWrapper { - - CTypeAssumption assumption; - - public CTypeAssumptionWrapper(CTypeAssumption assumption) { - this.assumption=assumption; - } - - public final boolean equals(Object obj) - // ino.end - // ino.method.equals.27820.body - { - if(obj instanceof CTypeAssumption){ - CTypeAssumption assum = (CTypeAssumption)obj; - boolean ret = true; - ret &= getClassName().equals(assum.getClassName()); - ret &= getIdentifier().equals(assum.getIdentifier()); - ret &= getAssumedType().equals(assum.getAssumedType()); - ret &= this.equalsAssumption(assum); - return ret; - } - else{ - return false; - } - } - - public boolean equalsAssumption(CTypeAssumption assumpt) { - return assumption.equalsAssumption(assumpt); - } - - public Type getAssumedType() { - return assumption.getAssumedType(); - } - - public String getClassName() { - return assumption.getClassName(); - } - - public String getIdentifier() { - return assumption.getIdentifier(); - } - - public void setAssumedType(Type assumedType) { - assumption.setAssumedType(assumedType); - } - - public void setClassName(String className) { - assumption.setClassName(className); - } - - public String toString() { - return assumption.toString(); - } - -} diff --git a/test/mycompiler/test/notUsedAnymore/IResultValidator.java b/test/mycompiler/test/notUsedAnymore/IResultValidator.java deleted file mode 100755 index ce4ce6444..000000000 --- a/test/mycompiler/test/notUsedAnymore/IResultValidator.java +++ /dev/null @@ -1,11 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; - -public interface IResultValidator { - - public void checkResults(Menge resultSet); - -} diff --git a/test/mycompiler/test/notUsedAnymore/TEst_2.java b/test/mycompiler/test/notUsedAnymore/TEst_2.java deleted file mode 100755 index 050919a10..000000000 --- a/test/mycompiler/test/notUsedAnymore/TEst_2.java +++ /dev/null @@ -1,25 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import java.util.ArrayList; - -class A{ - -} - -public class TEst_2{ - ,C> void foo(T a,C b){} - - void m(){ - TEst_2 t = new TEst_2(); - String c = new String(); - A str = new A(); - t.foo(str,c); - } - - public void m2(Object a) { - - ArrayList b= new ArrayList(); - a = b.get(0); - - } -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/Test.java b/test/mycompiler/test/notUsedAnymore/Test.java deleted file mode 100755 index c9a32b4a4..000000000 --- a/test/mycompiler/test/notUsedAnymore/Test.java +++ /dev/null @@ -1,67 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -interface I1 { - public void m1(); -} - -interface I2 { - public void m2(); -} - -class Implementation implements I1, I2 { - public void m1() {} - - public void m2() {} -} - -class Implementation2 extends Implementation { -} - -class Tester { - T x; - public void m3(Implementation x) { - x.m1(); - x.m2(); - } - public void m4 (T x) { - x.m1(); - x.m2(); - } - - public Long m4(Integer a, Long b) { - return a+b; - } - -} - - -public class Test { - - public static void main(String[] args) { - Implementation x= new Implementation(); - Implementation2 y = new Implementation2(); - - Tester a = new Tester(); - //a.m3(x); - - - Tester b = new Tester(); - b.m3(y); - - Tester c = new Tester(); - c.m3(y); - //c.m4(y); - } -} - -class TestSimpleClassesWithBoundedGenerics1 { - - public T ma(T x) { - return x; - } - - public int mb(T x) { - return x+1; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest.jav b/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest.jav deleted file mode 100755 index df5e707fc..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest.jav +++ /dev/null @@ -1,20 +0,0 @@ - -class TestAbstractInferenceTest { - - public foo(a, b) { - c; - d; - d = a+ b; - { - i; - i=5; - } - { - i; - i="abc"; - } - c = new TestAbstractInferenceTest(); - return a+b; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest.java b/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest.java deleted file mode 100755 index f95cb61df..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest.java +++ /dev/null @@ -1,304 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import de.dhbwstuttgart.typeinference.Menge; - -import mycompiler.mytypereconstruction.typeassumption.CInstVarTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CLocalVarTypeAssumption; -import mycompiler.mytypereconstruction.typeassumption.CMethodTypeAssumption; - - -public class TestAbstractInferenceTest extends AbstractInferenceTestOLD_2 { - - private final static String TESTEDCLASSNAME="TestAbstractInferenceTest"; - private final static String JAVPATH="test/mycompiler/test/"; - - public TestAbstractInferenceTest(String name) { - super(name,TestAbstractInferenceTest.JAVPATH+TestAbstractInferenceTest.TESTEDCLASSNAME+".jav"); - - } - - protected Menge getTestedClasses(){ - Menge testedclasses = new Menge(); - testedclasses.add(TestAbstractInferenceTest.TESTEDCLASSNAME); - return testedclasses; - } - public void testThisCase() throws Throwable { - - runTest(); - } - - protected void checkForValidClass(Menge testedClass) { - } - - protected void checkForValidMethodTypes(CMethodTypeAssumption assumpt) { - System.out.println("Method "+assumpt.getIdentifier()+ ", &return:" + assumpt.getAssumedType().getName()); - } - - protected void checkForValidLocalVarTypes(CLocalVarTypeAssumption assumpt) { - System.out.println("Local-Variable "+assumpt.getIdentifier()+ "(" + assumpt.getBlockId() + "), Typ:" +assumpt.getAssumedType().getName()+ ", Methode:" + assumpt.getMethodName()); - } - - protected void checkForValidMemberTypes(CInstVarTypeAssumption assumpt) { - System.out.println("Member-Variable "+assumpt.getIdentifier()+", Typ:" +assumpt.getAssumedType().getName()); - } - -// public void checkResults(Menge resultSet) { -// //check valid - implementation -//System.out.println("checkResults called, Länge ResultSet: " + resultSet.size()); -// //for (int resIndex=0; resIndex < resultSet.size(); ++resIndex) { -// for (int resIndex=0; resIndex < resultSet.size(); resIndex++) { -// -// Menge genVec = resultSet.get(resIndex).getGenericsTable().get("Test1"); -// System.out.println("Generics: " + genVec); -// // Methoden: -// // --------- -// -// Iterator iter1 = resultSet.get(resIndex).getMethodIntersectionTypes().values().iterator(); -// while (iter1.hasNext()) { -// -// CMethodTypeAssumption assumpt = iter1.next().getMethodTypeAssumptions().get(0); -// -// // Methode geh�rt zur aktuellen Klasse (ist somit g�ltig) -// //System.out.println("Classname: " + assumpt.getClassName()); -// if (assumpt.getClassName().equals("TestAbstractInferenceTest")) { -// // if (assumpt.getIdentifier().equals("foo")) { -// // Methode holen bzw. anlegen -// String DummyMethodname;//Sonderfall fuer ueberladene Methoden -// if(assumpt.getOverloadedMethodID()<10) -// { -// DummyMethodname=assumpt.getIdentifier()+"0"+new Integer(assumpt.getOverloadedMethodID()).toString(); -// } -// else -// { -// DummyMethodname=assumpt.getIdentifier()+new Integer(assumpt.getOverloadedMethodID()).toString(); -// } -// //JavMethodIdent method = jClass.addMethod(DummyMethodname, assumpt.getLineNumber(),assumpt.getOffset(),assumpt.getOffsetMenge(),assumpt.getAssumedType().getOffset()); -// //alleMethodenOffsets.addElement(assumpt.getOffset()); -// System.out.println("Method "+assumpt.getIdentifier()+ ", &return:" + assumpt.getAssumedType().getName()); -// -// // R�ckgabewert hinzuf�gen -// //method.addReturnFacility(new TypeFacility(getAssumedTypeName(assumpt.getAssumedType()), resIndex), -// // assumpt.getLineNumber()); -// -// // Parameter hinzuf�gen -// Menge vec = assumpt.getParaAssumptions(); -// for (int j=0; j genTypVec = assumpt.getGenericMethodParameters(); -// // method.setGenericMethodParameters(genTypVec); -// for(GenericTypeVar GTV : genTypVec) -// { -// System.out.println("Generic Method-Parameter "+GTV.getName()+", Methode:" + assumpt.getIdentifier()); -// } -// } -// } -// // Locale und Membervariablen: -// // --------------------------- -// -// Iterator iter2 = resultSet.get(resIndex).getFieldAndLocalVarAssumptions().values().iterator(); -// -// while (iter2.hasNext()) { -// CTypeAssumption assumption = iter2.next(); -// -// // Es ist eine locale Variable -// if (assumption instanceof CLocalVarTypeAssumption) { -// -// CLocalVarTypeAssumption assu = (CLocalVarTypeAssumption)assumption; -// -// -// if (assu.getClassName().equals("TestAbstractInferenceTest")) { -////checks whether assumption deals with focussed class -// // TestAbstractInferenceTest.assertEquals(assu.getClassName(), this.getClass().getName() ); -// -// System.out.println("Local-Variable "+assu.getIdentifier()+ "(" + assu.getBlockId() + "), Typ:" +assu.getAssumedType().getName()+ ", Methode:" + assu.getMethodName()); -// String DummyMethodname;//Sonderfall fuer ueberladene Methoden -// if(assu.getMethodOverloadedID()<10) -// { -// DummyMethodname=assu.getMethodName()+"0"+new Integer(assu.getMethodOverloadedID()).toString(); -// } -// else -// { -// DummyMethodname=assu.getMethodName()+new Integer(assu.getMethodOverloadedID()).toString(); -// } -// //JavMethodIdent method = jClass.addMethod(DummyMethodname, assu.getLineNumber(),assu.getOffset(),assu.getOffsetMenge(),assu.getOffset()); -// String localVarName = assu.getIdentifier()+ "(" + assu.getBlockId() + ")"; -// -// -// if (assu.isPlaceholderVariable()) { -// -// if (resIndex==0) { -// //method.addLocalVar(localVarName, assu, genVec, assu.getLineNumber(),assu.getOffset(),assu.getOffsetMenge()); -// System.out.println("assu is TypePlaceholder:"); -// } -// } -// else { -// //method.addLocalVar(localVarName, -// // new TypeFacility(getAssumedTypeName(assu.getAssumedType()), resIndex), -// // assu.getLineNumber(),assu.getOffset(),assu.getOffsetMenge()); -// } -// } -// -// } -// -// // Es ist eine Member-Variable -// else if (assumption instanceof CInstVarTypeAssumption) { -// //System.out.println("eine Membervariable???"); -// -// CInstVarTypeAssumption assu = (CInstVarTypeAssumption)assumption; -// if (assu.getClassName().equals("TestAbstractInferenceTest")) { -// //TestAbstractInferenceTest.assertEquals(assu.getClassName(), this.getClass().getName()); -// System.out.println("Member-Variable "+assu.getIdentifier()+", Typ:" +assu.getAssumedType().getName()); -// //jClass.addMember(assu.getIdentifier(), -// // new TypeFacility(getAssumedTypeName(assu.getAssumedType()), resIndex), -// // assu.getLineNumber(),assu.getOffset(),assu.getOffsetMenge()); -// } -// } -// } -// } -// } - -//public void checkResults(Menge resultSet) { -// //check valid - implementation -//System.out.println("checkResults called, Länge ResultSet: " + resultSet.size()); -// //for (int resIndex=0; resIndex < resultSet.size(); ++resIndex) { -// for (int resIndex=0; resIndex < 1; resIndex++) { -// -// Menge genVec = resultSet.get(resIndex).getGenericsTable().get("Test1"); -// -// // Methoden: -// // --------- -// -// Iterator iter1 = resultSet.get(resIndex).getMethodIntersectionTypes().values().iterator(); -// while (iter1.hasNext()) { -// -// CMethodTypeAssumption assumpt = iter1.next().getMethodTypeAssumptions().get(0); -// -// // Methode geh�rt zur aktuellen Klasse (ist somit g�ltig) -// //TestAbstractInferenceTest.assertTrue(1==0); -// //hier muss der Klassenassert hin -// //if (assumpt.getClassName().equals(className)) { -// if (assumpt.getIdentifier().equals("foo")) { -// // Methode holen bzw. anlegen -// String DummyMethodname;//Sonderfall fuer ueberladene Methoden -// if(assumpt.getOverloadedMethodID()<10) -// { -// DummyMethodname=assumpt.getIdentifier()+"0"+new Integer(assumpt.getOverloadedMethodID()).toString(); -// } -// else -// { -// DummyMethodname=assumpt.getIdentifier()+new Integer(assumpt.getOverloadedMethodID()).toString(); -// } -// //JavMethodIdent method = jClass.addMethod(DummyMethodname, assumpt.getLineNumber(),assumpt.getOffset(),assumpt.getOffsetMenge(),assumpt.getAssumedType().getOffset()); -// //alleMethodenOffsets.addElement(assumpt.getOffset()); -// System.out.println("Method "+assumpt.getIdentifier()+ ", &return:" + assumpt.getAssumedType().getName()); -// -// // R�ckgabewert hinzuf�gen -// //method.addReturnFacility(new TypeFacility(getAssumedTypeName(assumpt.getAssumedType()), resIndex), -// // assumpt.getLineNumber()); -// -// // Parameter hinzuf�gen -// Menge vec = assumpt.getParaAssumptions(); -// for (int j=0; j genTypVec = assumpt.getGenericMethodParameters(); -// // method.setGenericMethodParameters(genTypVec); -// for(GenericTypeVar GTV : genTypVec) -// { -// System.out.println("Generic Method-Parameter "+GTV.getName()+", Methode:" + assumpt.getIdentifier()); -// } -// } -// } -// // Locale und Membervariablen: -// // --------------------------- -// -// Iterator iter2 = resultSet.get(resIndex).getFieldAndLocalVarAssumptions().values().iterator(); -// -// while (iter2.hasNext()) { -// CTypeAssumption assumption = iter2.next(); -// -// // Es ist eine locale Variable -// if (assumption instanceof CLocalVarTypeAssumption) { -// -// CLocalVarTypeAssumption assu = (CLocalVarTypeAssumption)assumption; -// -// -// //if (assu.getClassName().equals(className)) { -////checks whether assumption deals with focussed class -// // TestAbstractInferenceTest.assertEquals(assu.getClassName(), this.getClass().getName() ); -// -// System.out.println("Local-Variable "+assu.getIdentifier()+ "(" + assu.getBlockId() + "), Typ:" +assu.getAssumedType().getName()+ ", Methode:" + assu.getMethodName()); -// String DummyMethodname;//Sonderfall fuer ueberladene Methoden -// if(assu.getMethodOverloadedID()<10) -// { -// DummyMethodname=assu.getMethodName()+"0"+new Integer(assu.getMethodOverloadedID()).toString(); -// } -// else -// { -// DummyMethodname=assu.getMethodName()+new Integer(assu.getMethodOverloadedID()).toString(); -// } -// //JavMethodIdent method = jClass.addMethod(DummyMethodname, assu.getLineNumber(),assu.getOffset(),assu.getOffsetMenge(),assu.getOffset()); -// String localVarName = assu.getIdentifier()+ "(" + assu.getBlockId() + ")"; -// -// -// if (assu.isPlaceholderVariable()) { -// -// if (resIndex==0) { -// //method.addLocalVar(localVarName, assu, genVec, assu.getLineNumber(),assu.getOffset(),assu.getOffsetMenge()); -// System.out.println("assu is TypePlaceholder:"); -// } -// } -// else { -// //method.addLocalVar(localVarName, -// // new TypeFacility(getAssumedTypeName(assu.getAssumedType()), resIndex), -// // assu.getLineNumber(),assu.getOffset(),assu.getOffsetMenge()); -// } -// -// } -// -// // Es ist eine Member-Variable -// else if (assumption instanceof CInstVarTypeAssumption) { -// System.out.println("eine Membervariable???"); -// -// CInstVarTypeAssumption assu = (CInstVarTypeAssumption)assumption; -// //if (assu.getClassName().equals(className)) { -// //TestAbstractInferenceTest.assertEquals(assu.getClassName(), this.getClass().getName()); -// System.out.println("Member-Variable "+assu.getIdentifier()+", Typ:" +assu.getAssumedType().getName()); -// //jClass.addMember(assu.getIdentifier(), -// // new TypeFacility(getAssumedTypeName(assu.getAssumedType()), resIndex), -// // assu.getLineNumber(),assu.getOffset(),assu.getOffsetMenge()); -// } -// } -// } -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest2.jav b/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest2.jav deleted file mode 100755 index 1f4cef494..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest2.jav +++ /dev/null @@ -1,21 +0,0 @@ - -public class TestAbstractInferenceTest2 { - - method(Integer a, String s) { - } -} - -class TestAbstractInferenceTest3 extends TestAbstractInferenceTest2 { -/* - method(Integer a) { - c; - }*/ - method2(String s) { - c; - c = new TestAbstractInferenceTest2(); - c.method(2,"abc"); - method(3,"abc"); - } - - -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest2.java b/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest2.java deleted file mode 100755 index a64868578..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestAbstractInferenceTest2.java +++ /dev/null @@ -1,56 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class TestAbstractInferenceTest2 extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestAbstractInferenceTest2"; - private final static String JAVPATH="test/mycompiler/test/"; - - public TestAbstractInferenceTest2(String name) { - super(name,TestAbstractInferenceTest2.JAVPATH+TestAbstractInferenceTest2.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect testAbstractInferenceTest2 = new ClassExpect(TestAbstractInferenceTest2.TESTEDCLASSNAME); - ClassExpect testAbstractInferenceTest3 = new ClassExpect("TestAbstractInferenceTest3"); - - //methods - MethodExpect m1 = new MethodExpect("method",new RefType("void",-1),0); - GenericTypeVar t = new GenericTypeVar("T",-1); - m1.addParameter(new VarExpect("a", new RefType("java.lang.Integer",-1))); - m1.addParameter(new VarExpect("s",new RefType("java.lang.String",-1))); - // m1.addGeneric(t); - - // m1.getBlock().addLocalVar(new VarExpect("c",null)); - - testAbstractInferenceTest2.addMethod(m1); - - MethodExpect m2 = new MethodExpect("method2",new RefType("void",-1),0); - m2.addParameter(new VarExpect("s", new RefType("java.lang.String",-1))); - m2.getBlock().addLocalVar(new VarExpect("c",new RefType("TestAbstractInferenceTest2",-1))); - - MethodExpect m3 = new MethodExpect("method",new RefType("void",-1),0); - m3.addParameter(new VarExpect("a", new RefType("java.lang.Integer",-1))); - m3.addParameter(new VarExpect("s", new RefType("java.lang.String",-1))); - //m3.getBlock().addLocalVar(new VarExpect("c",null)); - - //testAbstractInferenceTest3.addMethod(m1); - testAbstractInferenceTest3.addMethod(m2); - testAbstractInferenceTest3.addMethod(m3); - - - Expectation ret = new Expectation(testAbstractInferenceTest2); - ret.addClass(testAbstractInferenceTest3); - return ret; - } - -} diff --git a/test/mycompiler/test/notUsedAnymore/TestClassMemberWithoutType.jav b/test/mycompiler/test/notUsedAnymore/TestClassMemberWithoutType.jav deleted file mode 100755 index 249e1d57d..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestClassMemberWithoutType.jav +++ /dev/null @@ -1,5 +0,0 @@ - -public class TestClassMemberWithoutType { - - member; -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestClassMemberWithoutType.java b/test/mycompiler/test/notUsedAnymore/TestClassMemberWithoutType.java deleted file mode 100755 index 8ef1d5c2e..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestClassMemberWithoutType.java +++ /dev/null @@ -1,37 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.VarExpect; -import mycompiler.test.expectationTypes.TypePlaceholderExpect; - -/** - * 18-04-08 - * @author - * todo: delete this test, cuz it does not make sense - * - * this test checks whether members without types are supported - */ -public class TestClassMemberWithoutType extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestClassMemberWithoutType"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestClassMemberWithoutType(String name) { - super(name,TestClassMemberWithoutType.JAVPATH+TestClassMemberWithoutType.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - //class--- TestClassMemberWithoutType - ClassExpect testClassMemberWithoutType = new ClassExpect(TestClassMemberWithoutType.TESTEDCLASSNAME); - //member - VarExpect member = new VarExpect("member",new TypePlaceholderExpect("a")); - testClassMemberWithoutType.addMember(member); - //Expectation - return new Expectation(testClassMemberWithoutType); - } - -} diff --git a/test/mycompiler/test/notUsedAnymore/TestConstantsWithoutType.jav b/test/mycompiler/test/notUsedAnymore/TestConstantsWithoutType.jav deleted file mode 100755 index e61a2feb8..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestConstantsWithoutType.jav +++ /dev/null @@ -1,6 +0,0 @@ -public class TestConstantsWithoutType { - public final static B = true; - public final static I = 1; - public final static C = 'A'; - public final static S = "Hello World!"; -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestConstantsWithoutType.java b/test/mycompiler/test/notUsedAnymore/TestConstantsWithoutType.java deleted file mode 100755 index 971aee158..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestConstantsWithoutType.java +++ /dev/null @@ -1,39 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 18-04-08 - * @author - * - * this test checks correct detection of constants as members - */ -public class TestConstantsWithoutType extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestConstantsWithoutType"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestConstantsWithoutType(String name) { - super(name,TestConstantsWithoutType.JAVPATH+TestConstantsWithoutType.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - //class--- TestConstantsWithoutType - ClassExpect testConstantsWithoutType = new ClassExpect(TestConstantsWithoutType.TESTEDCLASSNAME); - //member - testConstantsWithoutType.addMember(new VarExpect("B",new RefType("java.lang.Boolean",-1))); - testConstantsWithoutType.addMember(new VarExpect("I",new RefType("java.lang.Integer",-1))); - testConstantsWithoutType.addMember(new VarExpect("C",new RefType("java.lang.Character",-1))); - testConstantsWithoutType.addMember(new VarExpect("S",new RefType("java.lang.String",-1))); - - //Expectation - return new Expectation(testConstantsWithoutType); - } - -} diff --git a/test/mycompiler/test/notUsedAnymore/TestGenerics.jav b/test/mycompiler/test/notUsedAnymore/TestGenerics.jav deleted file mode 100755 index fa01ce32a..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestGenerics.jav +++ /dev/null @@ -1,8 +0,0 @@ - - -public class TestGenerics { - - > void foo(T n) {} - void foo(T i) {} - -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestGenerics.java b/test/mycompiler/test/notUsedAnymore/TestGenerics.java deleted file mode 100755 index 2e2d5d00e..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestGenerics.java +++ /dev/null @@ -1,60 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** - * 01-04-08 - * @author - * - * This test verifies identification of a simple method with returntype void - * - */ - -public class TestGenerics extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestGenerics"; - private final static String JAVPATH="test/mycompiler/test/"; - - public TestGenerics(String name) { - super(name,TestGenerics.JAVPATH+TestGenerics.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - // Classes - ClassExpect testGenerics = new ClassExpect(TestGenerics.TESTEDCLASSNAME); - - //Methods - MethodExpect m0 = new MethodExpect("foo",new RefType("void",-1),0); - Menge bounds1 = new Menge(); - Menge parameter = new Menge(); - parameter.add(new RefType("java.lang.Integer",-1)); - RefType test = new RefType("Menge",parameter,-1); - bounds1.add(test); - BoundedGenericTypeVar generic1 = new BoundedGenericTypeVar("T",bounds1,-1); - m0.addGeneric(generic1); - m0.addParameter(new VarExpect("n",generic1)); - - MethodExpect m1 = new MethodExpect("foo",new RefType("void",-1),1); - Menge bounds2 = new Menge(); - bounds2.add(new RefType("Number",-1)); - BoundedGenericTypeVar generic2 = new BoundedGenericTypeVar("T",bounds2,-1); - m1.addGeneric(generic2); - m1.addParameter(new VarExpect("i",generic2)); - - - testGenerics.addMethod(m0); - testGenerics.addMethod(m1); - return new Expectation(testGenerics); - } -} diff --git a/test/mycompiler/test/notUsedAnymore/TestInheritanceCheckValidImplementationFromInterface.jav b/test/mycompiler/test/notUsedAnymore/TestInheritanceCheckValidImplementationFromInterface.jav deleted file mode 100755 index 127ed26eb..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestInheritanceCheckValidImplementationFromInterface.jav +++ /dev/null @@ -1,7 +0,0 @@ -interface A{ - public m(); -} -class TestInheritanceCheckValidImplementationFromInterface implements A{ - - public void m(){} -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestInheritanceCheckValidImplementationFromInterface.java b/test/mycompiler/test/notUsedAnymore/TestInheritanceCheckValidImplementationFromInterface.java deleted file mode 100755 index 946001d8f..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestInheritanceCheckValidImplementationFromInterface.java +++ /dev/null @@ -1,42 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; - -/* - * Testcase fails, because the interface's method is not inferenced according to its implementation in class - */ -public class TestInheritanceCheckValidImplementationFromInterface extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestInheritanceCheckValidImplementationFromInterface"; - private final static String JAVPATH="test/mycompiler/test/javaConcepts/inheritance/"; - - public TestInheritanceCheckValidImplementationFromInterface(String name) { - super(name,TestInheritanceCheckValidImplementationFromInterface.JAVPATH+TestInheritanceCheckValidImplementationFromInterface.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //Interface - ClassExpect a = new ClassExpect("A"); - //Class - ClassExpect testInheritanceCheckValidImplementationFromInterface = new ClassExpect(TestInheritanceCheckValidImplementationFromInterface.TESTEDCLASSNAME); - - //methods - MethodExpect mClass = new MethodExpect("m", new RefType("void",-1)); - MethodExpect mInterface = new MethodExpect("m", new RefType("void",-1)); - a.addMethod(mInterface); - testInheritanceCheckValidImplementationFromInterface.addMethod(mClass); - - //adding classes to Expectation - Expectation ret = new Expectation(testInheritanceCheckValidImplementationFromInterface); - ret.addClass(a); - return ret; - } - -} - diff --git a/test/mycompiler/test/notUsedAnymore/TestInheritanceCheckValidImplementationFromInterfaceNegative.jav b/test/mycompiler/test/notUsedAnymore/TestInheritanceCheckValidImplementationFromInterfaceNegative.jav deleted file mode 100755 index e05fdae65..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestInheritanceCheckValidImplementationFromInterfaceNegative.jav +++ /dev/null @@ -1,7 +0,0 @@ -interface A{ - public m(); -} -class TestInheritanceCheckValidImplementationFromInterfaceNegative implements A{ - - public void m1(){} -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestInheritanceCheckValidImplementationFromInterfaceNegative2.jav b/test/mycompiler/test/notUsedAnymore/TestInheritanceCheckValidImplementationFromInterfaceNegative2.jav deleted file mode 100755 index 0dd2a73e1..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestInheritanceCheckValidImplementationFromInterfaceNegative2.jav +++ /dev/null @@ -1,14 +0,0 @@ -interface TestInheritanceCheckValidImplementationFromInterfaceNegative2{ - public m(); -} -class A implements TestInheritanceCheckValidImplementationFromInterfaceNegative2{ - - public void m(){} -} - -class B implements TestInheritanceCheckValidImplementationFromInterfaceNegative2 { - - public m() { - return 1; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestMethodReturnType.jav b/test/mycompiler/test/notUsedAnymore/TestMethodReturnType.jav deleted file mode 100755 index ae4d9c9be..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestMethodReturnType.jav +++ /dev/null @@ -1,21 +0,0 @@ - -public class TestMethodReturnType { - -/* methodReturnType1(a) { - return a; - } - */ - methodReturnType2(a,b) { - return a+b; - } - - methodReturnType3(String a) { - return a; - } - - Integer methodReturnType4(a) { - return a; - } - - -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestMethodReturnType.java b/test/mycompiler/test/notUsedAnymore/TestMethodReturnType.java deleted file mode 100755 index ff24c613f..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestMethodReturnType.java +++ /dev/null @@ -1,64 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class TestMethodReturnType extends AbstractInferenceTest { - - - private final static String TESTEDCLASSNAME="TestMethodReturnType"; - private final static String JAVPATH="test/mycompiler/test/"; - - public TestMethodReturnType(String name) { - super(name,TestMethodReturnType.JAVPATH+TestMethodReturnType.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect testMethodReturnType = new ClassExpect(TestMethodReturnType.TESTEDCLASSNAME); - - //methods -// MethodExpect m0 = new MethodExpect("methodReturnType1",null,0); -// m0.addParameter(new VarExpect("a",null)); - - MethodExpect m1 = new MethodExpect("methodReturnType2",new RefType("java.lang.Integer",-1),0); - m1.addReturntype(new RefType("java.lang.Double",-1)); - m1.addReturntype(new RefType("java.lang.Float",-1)); - m1.addReturntype(new RefType("java.lang.Long",-1)); - //m1.addReturntype(new RefType("java.lang.String",-1)); - VarExpect a1 = new VarExpect("a",new RefType("java.lang.Integer",-1)); - VarExpect b1 = new VarExpect("b",new RefType("java.lang.Integer",-1)); - a1.addExpectedType(new RefType("java.lang.Double",-1)); - a1.addExpectedType(new RefType("java.lang.Float",-1)); - a1.addExpectedType(new RefType("java.lang.Long",-1)); - //a1.addExpectedType(new RefType("java.lang.String",-1)); - b1.addExpectedType(new RefType("java.lang.Double",-1)); - b1.addExpectedType(new RefType("java.lang.Float",-1)); - b1.addExpectedType(new RefType("java.lang.Long",-1)); - //b1.addExpectedType(new RefType("java.lang.String",-1)); - m1.addParameter(a1); - m1.addParameter(b1); - - MethodExpect m2 = new MethodExpect("methodReturnType3",new RefType("java.lang.String",-1),0); - m2.addParameter(new VarExpect("a",new RefType("java.lang.String",-1))); - - MethodExpect m3 = new MethodExpect("methodReturnType4",new RefType("java.lang.Integer",-1),0); - m3.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - - -// testMethodReturnType.addMethod(m0); - testMethodReturnType.addMethod(m1); - testMethodReturnType.addMethod(m2); - testMethodReturnType.addMethod(m3); - return new Expectation(testMethodReturnType); - } - - -} diff --git a/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeGeneric.jav b/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeGeneric.jav deleted file mode 100755 index c33e753b2..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeGeneric.jav +++ /dev/null @@ -1,15 +0,0 @@ - -public class TestMethodReturnTypeGeneric { - - testMethodReturnTypeGeneric() { - return new TestMethodReturnTypeGeneric(); - } - - testMethodReturnTypeGeneric2(T a) { - return a; - } - - - - -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeNegative.jav b/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeNegative.jav deleted file mode 100755 index 10b5f1087..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeNegative.jav +++ /dev/null @@ -1,8 +0,0 @@ - -public class TestMethodReturnTypeNegative { - - /*returned String, but must be Integer*/ - Integer m1(String a) { - return a; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeNegative.java b/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeNegative.java deleted file mode 100755 index 7f333dedd..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeNegative.java +++ /dev/null @@ -1,42 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class TestMethodReturnTypeNegative extends AbstractInferenceTest { - - - private final static String TESTEDCLASSNAME="TestMethodReturnTypeNegative"; - private final static String JAVPATH="test/mycompiler/test/"; - - public TestMethodReturnTypeNegative(String name) { - super(name,TestMethodReturnTypeNegative.JAVPATH+TestMethodReturnTypeNegative.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect testMethodReturnTypeNegative = new ClassExpect(TestMethodReturnTypeNegative.TESTEDCLASSNAME); - - //methods - MethodExpect m1 = new MethodExpect("m1",new RefType("java.lang.Integer",-1)); - m1.addParameter(new VarExpect("a", new RefType("java.lang.String",-1))); - - MethodExpect m2 = new MethodExpect("m2",new RefType("java.lang.Boolean",-1)); - m2.getBlock().addLocalVar(new VarExpect("a",new RefType("java.lang.Boolean",-1))); - - testMethodReturnTypeNegative.addMethod(m1); - testMethodReturnTypeNegative.addMethod(m2); - - - Expectation ret = new Expectation(testMethodReturnTypeNegative); - ret.addException(new Exception()); - return ret; - } - - -} diff --git a/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeNegative2.jav b/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeNegative2.jav deleted file mode 100755 index 15f21075d..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeNegative2.jav +++ /dev/null @@ -1,11 +0,0 @@ - -public class TestMethodReturnTypeNegative2 { - - /*not always boolean returned*/ - public m1() { - a; - if (a) { - return a; - } - } -} \ No newline at end of file diff --git a/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeNegative2.java b/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeNegative2.java deleted file mode 100755 index da9a797a7..000000000 --- a/test/mycompiler/test/notUsedAnymore/TestMethodReturnTypeNegative2.java +++ /dev/null @@ -1,38 +0,0 @@ -package mycompiler.test.notUsedAnymore; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class TestMethodReturnTypeNegative2 extends AbstractInferenceTest { - - - private final static String TESTEDCLASSNAME="TestMethodReturnTypeNegative2"; - private final static String JAVPATH="test/mycompiler/test/"; - - public TestMethodReturnTypeNegative2(String name) { - super(name,TestMethodReturnTypeNegative2.JAVPATH+TestMethodReturnTypeNegative2.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect testMethodReturnTypeNegative2 = new ClassExpect(TestMethodReturnTypeNegative2.TESTEDCLASSNAME); - - //methods - MethodExpect m1 = new MethodExpect("m2",new RefType("java.lang.Boolean",-1)); - m1.getBlock().addLocalVar(new VarExpect("a",new RefType("java.lang.Boolean",-1))); - - testMethodReturnTypeNegative2.addMethod(m1); - - - Expectation ret = new Expectation(testMethodReturnTypeNegative2); - ret.addException(new Exception()); - return ret; - } - - -} diff --git a/test/mycompiler/test/operators/AllTestsOperators.java b/test/mycompiler/test/operators/AllTestsOperators.java deleted file mode 100755 index 88f2a30cf..000000000 --- a/test/mycompiler/test/operators/AllTestsOperators.java +++ /dev/null @@ -1,22 +0,0 @@ -package mycompiler.test.operators; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsOperators { - - public static Test suite() { - TestSuite suite = new TestSuite("Test for mycompiler.test.operators"); - //$JUnit-BEGIN$ - suite.addTestSuite(TestOperatorBool.class); - suite.addTestSuite(TestOperatorObjects.class); - suite.addTestSuite(TestOperatorString.class); - suite.addTestSuite(TestOperatorIncrement.class); - suite.addTestSuite(TestOperatorComparison.class); - suite.addTestSuite(TestOperatorArithmetic.class); - suite.addTestSuite(TestOperatorBitwise.class); - //$JUnit-END$ - return suite; - } - -} diff --git a/test/mycompiler/test/operators/TestOperatorArithmetic.jav b/test/mycompiler/test/operators/TestOperatorArithmetic.jav deleted file mode 100755 index 7c346c58f..000000000 --- a/test/mycompiler/test/operators/TestOperatorArithmetic.jav +++ /dev/null @@ -1,40 +0,0 @@ -public class TestOperatorArithmetic { - - public m1(i,j) { - return i+j; - } - - public m2(i,java.lang.Double j) { - return i-j; - } - - public m3(java.lang.Integer i,j) { - return i*j; - } - - public java.lang.Double m4(i,j) { - return i/j; - } - - public m5(i,j) { - return i%j; - } - - public m6(i) { - return -i; - } - - public m7 (i,j) { - i+=j; - return i; - } - - public m8(i, java.lang.Float j) { - return i/j; - } - - /*public java.lang.Long m9(i, j) { - return i+j; - }*/ - -} \ No newline at end of file diff --git a/test/mycompiler/test/operators/TestOperatorArithmetic.java b/test/mycompiler/test/operators/TestOperatorArithmetic.java deleted file mode 100755 index 1e0cc08cd..000000000 --- a/test/mycompiler/test/operators/TestOperatorArithmetic.java +++ /dev/null @@ -1,110 +0,0 @@ -package mycompiler.test.operators; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** -* 12-04-08 -* @author -* -* checks arithmetic operations -*/ - -public class TestOperatorArithmetic extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestOperatorArithmetic"; - private final static String JAVPATH="test/mycompiler/test/operators/"; - - public TestOperatorArithmetic(String name) { - super(name,TestOperatorArithmetic.JAVPATH+TestOperatorArithmetic.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testOperatorArithmetic = new ClassExpect(TestOperatorArithmetic.TESTEDCLASSNAME); - - //Methods - VarExpect m1_i = new VarExpect("i",new RefType("java.lang.Integer",-1)); - m1_i.setExpectedType(createMengeAllNumberTypes()); - VarExpect m1_j = new VarExpect("j",new RefType("java.lang.Integer",-1)); - m1_j.setExpectedType(createMengeAllNumberTypes()); - MethodExpect m1 = new MethodExpect("m1",new RefType("java.lang.Integer",-1),0); - m1.setReturntypes(createMengeAllNumberTypes()); - m1.addParameter(m1_i); - m1.addParameter(m1_j); - - MethodExpect m2 = new MethodExpect("m2",new RefType("java.lang.Double",-1),0); - m2.addParameter(new VarExpect("i",new RefType("java.lang.Double",-1))); - m2.addParameter(new VarExpect("j",new RefType("java.lang.Double",-1))); - - MethodExpect m3 = new MethodExpect("m3",new RefType("java.lang.Integer",-1),0); - m3.addParameter(new VarExpect("i",new RefType("java.lang.Integer",-1))); - m3.addParameter(new VarExpect("j",new RefType("java.lang.Integer",-1))); - - MethodExpect m4 = new MethodExpect("m4",new RefType("java.lang.Double",-1),0); - m4.addParameter(new VarExpect("i",new RefType("java.lang.Double",-1))); - m4.addParameter(new VarExpect("j",new RefType("java.lang.Double",-1))); - - - VarExpect m5_i = new VarExpect("i",new RefType("java.lang.Integer",-1)); - m5_i.setExpectedType(createMengeAllNumberTypes()); - VarExpect m5_j = new VarExpect("j",new RefType("java.lang.Integer",-1)); - m5_j.setExpectedType(createMengeAllNumberTypes()); - MethodExpect m5 = new MethodExpect("m5",new RefType("java.lang.Integer",-1),0); - m5.setReturntypes(createMengeAllNumberTypes()); - m5.addParameter(m5_i); - m5.addParameter(m5_j); - - MethodExpect m6 = new MethodExpect("m6", new RefType("java.lang.Integer",-1),0); - m6.addParameter(new VarExpect("i", new RefType("java.lang.Integer",-1))); - - VarExpect m7_i = new VarExpect("i",new RefType("java.lang.Integer",-1)); - m7_i.setExpectedType(createMengeAllNumberTypes()); - VarExpect m7_j = new VarExpect("j",new RefType("java.lang.Integer",-1)); - m7_j.setExpectedType(createMengeAllNumberTypes()); - MethodExpect m7 = new MethodExpect("m7",new RefType("java.lang.Integer",-1),0); - m7.setReturntypes(createMengeAllNumberTypes()); - m7.addParameter(m7_i); - m7.addParameter(m7_j); - - VarExpect m8_i = new VarExpect("i",new RefType("java.lang.Float",-1)); - m8_i.setExpectedType(createMengeAllNumberTypes()); - VarExpect m8_j = new VarExpect("j",new RefType("java.lang.Float",-1)); - m8_j.setExpectedType(createMengeAllNumberTypes()); - MethodExpect m8 = new MethodExpect("m8",new RefType("java.lang.Float",-1),0); - m8.setReturntypes(createMengeAllNumberTypes()); - m8.addParameter(m8_i); - m8.addParameter(m8_j); - - VarExpect m9_i = new VarExpect("i",new RefType("java.lang.Long",-1)); - m9_i.setExpectedType(createMengeAllNumberTypes()); - VarExpect m9_j = new VarExpect("j",new RefType("java.lang.Long",-1)); - m9_j.setExpectedType(createMengeAllNumberTypes()); - MethodExpect m9 = new MethodExpect("m9",new RefType("java.lang.Long",-1),0); - m9.setReturntypes(createMengeAllNumberTypes()); - m9.addParameter(m9_i); - m9.addParameter(m9_j); - - - testOperatorArithmetic.addMethod(m1); - testOperatorArithmetic.addMethod(m2); - testOperatorArithmetic.addMethod(m3); - testOperatorArithmetic.addMethod(m4); - testOperatorArithmetic.addMethod(m5); - testOperatorArithmetic.addMethod(m6); - testOperatorArithmetic.addMethod(m7); - testOperatorArithmetic.addMethod(m8); - //testOperatorArithmetic.addMethod(m9); -// - return new Expectation(testOperatorArithmetic); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/operators/TestOperatorBitwise.jav b/test/mycompiler/test/operators/TestOperatorBitwise.jav deleted file mode 100755 index 7c7026cc0..000000000 --- a/test/mycompiler/test/operators/TestOperatorBitwise.jav +++ /dev/null @@ -1,45 +0,0 @@ -public class TestOperatorBitwise { - - public m1(a,b) { - return a & b; - } - - public m2(a,b) { - return a ^ b; - } - - public m3(a,b) { - return a | b; - } - - public m4(Integer a, b) { - return a & b; - } - - public m5(a, Long b) { - return a & b; - } - - public Integer m6(a,b) { - return a & b; - } - - /* bit-shift not accepted by parser - - public m7(a,b) { - return x << y; - } - - public m8(a,b) { - return x >> y; - } - - public m9(a,b) { - return x >>> y; - } - - public m10(a) { - return ~a; - } - */ -} \ No newline at end of file diff --git a/test/mycompiler/test/operators/TestOperatorBitwise.java b/test/mycompiler/test/operators/TestOperatorBitwise.java deleted file mode 100755 index 337627d03..000000000 --- a/test/mycompiler/test/operators/TestOperatorBitwise.java +++ /dev/null @@ -1,129 +0,0 @@ -package mycompiler.test.operators; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.GenericTypeVarExpect; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** -* 29-05-08 -* @author -* -* checks bit operators -*/ - -public class TestOperatorBitwise extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestOperatorBitwise"; - private final static String JAVPATH="test/mycompiler/test/operators/"; - - public TestOperatorBitwise(String name) { - super(name,TestOperatorBitwise.JAVPATH+TestOperatorBitwise.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testOperatorBitwise = new ClassExpect(TestOperatorBitwise.TESTEDCLASSNAME); - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("java.lang.Integer",-1)); - m1.addReturntype(new RefType("java.lang.Long",-1)); - VarExpect m1a = new VarExpect("a",new RefType("java.lang.Integer",-1)); - m1a.addExpectedType(new RefType("java.lang.Byte",-1)); - m1a.addExpectedType(new RefType("java.lang.Short",-1)); - m1a.addExpectedType(new RefType("java.lang.Character",-1)); - m1a.addExpectedType(new RefType("java.lang.Long",-1)); - VarExpect m1b = new VarExpect("b",new RefType("java.lang.Integer",-1)); - m1b.addExpectedType(new RefType("java.lang.Byte",-1)); - m1b.addExpectedType(new RefType("java.lang.Short",-1)); - m1b.addExpectedType(new RefType("java.lang.Character",-1)); - m1b.addExpectedType(new RefType("java.lang.Long",-1)); - m1.addParameter(m1a); - m1.addParameter(m1b); - - - MethodExpect m2 = new MethodExpect("m2",new RefType("java.lang.Integer",-1)); - m2.addReturntype(new RefType("java.lang.Long",-1)); - VarExpect m2a = new VarExpect("a",new RefType("java.lang.Integer",-1)); - m2a.addExpectedType(new RefType("java.lang.Byte",-1)); - m2a.addExpectedType(new RefType("java.lang.Short",-1)); - m2a.addExpectedType(new RefType("java.lang.Character",-1)); - m2a.addExpectedType(new RefType("java.lang.Long",-1)); - VarExpect m2b = new VarExpect("b",new RefType("java.lang.Integer",-1)); - m2b.addExpectedType(new RefType("java.lang.Byte",-1)); - m2b.addExpectedType(new RefType("java.lang.Short",-1)); - m2b.addExpectedType(new RefType("java.lang.Character",-1)); - m2b.addExpectedType(new RefType("java.lang.Long",-1)); - m2.addParameter(m2a); - m2.addParameter(m2b); - - MethodExpect m3 = new MethodExpect("m3",new RefType("java.lang.Integer",-1)); - m3.addReturntype(new RefType("java.lang.Long",-1)); - VarExpect m3a = new VarExpect("a",new RefType("java.lang.Integer",-1)); - m3a.addExpectedType(new RefType("java.lang.Byte",-1)); - m3a.addExpectedType(new RefType("java.lang.Short",-1)); - m3a.addExpectedType(new RefType("java.lang.Character",-1)); - m3a.addExpectedType(new RefType("java.lang.Long",-1)); - VarExpect m3b = new VarExpect("b",new RefType("java.lang.Integer",-1)); - m3b.addExpectedType(new RefType("java.lang.Byte",-1)); - m3b.addExpectedType(new RefType("java.lang.Short",-1)); - m3b.addExpectedType(new RefType("java.lang.Character",-1)); - m3b.addExpectedType(new RefType("java.lang.Long",-1)); - m3.addParameter(m3a); - m3.addParameter(m3b); - - MethodExpect m4 = new MethodExpect("m4",new RefType("java.lang.Integer",-1)); - m4.addReturntype(new RefType("java.lang.Long",-1)); - VarExpect m4a = new VarExpect("a",new RefType("java.lang.Integer",-1)); - VarExpect m4b = new VarExpect("b",new RefType("java.lang.Integer",-1)); - m4b.addExpectedType(new RefType("java.lang.Byte",-1)); - m4b.addExpectedType(new RefType("java.lang.Short",-1)); - m4b.addExpectedType(new RefType("java.lang.Character",-1)); - m4b.addExpectedType(new RefType("java.lang.Long",-1)); - m4.addParameter(m4a); - m4.addParameter(m4b); - - MethodExpect m5 = new MethodExpect("m5",new RefType("java.lang.Long",-1)); - VarExpect m5a = new VarExpect("a",new RefType("java.lang.Integer",-1)); - m5a.addExpectedType(new RefType("java.lang.Byte",-1)); - m5a.addExpectedType(new RefType("java.lang.Short",-1)); - m5a.addExpectedType(new RefType("java.lang.Character",-1)); - m5a.addExpectedType(new RefType("java.lang.Long",-1)); - VarExpect m5b = new VarExpect("b",new RefType("java.lang.Long",-1)); - m5.addParameter(m5a); - m5.addParameter(m5b); - - MethodExpect m6 = new MethodExpect("m6",new RefType("java.lang.Integer",-1)); - VarExpect m6a = new VarExpect("a",new RefType("java.lang.Integer",-1)); - m6a.addExpectedType(new RefType("java.lang.Byte",-1)); - m6a.addExpectedType(new RefType("java.lang.Short",-1)); - m6a.addExpectedType(new RefType("java.lang.Character",-1)); - VarExpect m6b = new VarExpect("b",new RefType("java.lang.Integer",-1)); - m6b.addExpectedType(new RefType("java.lang.Byte",-1)); - m6b.addExpectedType(new RefType("java.lang.Short",-1)); - m6b.addExpectedType(new RefType("java.lang.Character",-1)); - m6.addParameter(m6a); - m6.addParameter(m6b); - - - - - - - testOperatorBitwise.addMethod(m1); - testOperatorBitwise.addMethod(m2); - testOperatorBitwise.addMethod(m3); - testOperatorBitwise.addMethod(m4); - testOperatorBitwise.addMethod(m5); - testOperatorBitwise.addMethod(m6); - - - return new Expectation(testOperatorBitwise); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/operators/TestOperatorBool.jav b/test/mycompiler/test/operators/TestOperatorBool.jav deleted file mode 100755 index 33c002b12..000000000 --- a/test/mycompiler/test/operators/TestOperatorBool.jav +++ /dev/null @@ -1,19 +0,0 @@ -public class TestOperatorBool { - - public m1(a,b) { - return a && b; - } - - public m2(a,b) { - return a || b; - } - - public m3(a) { - return !a; - } - - public m4( a, b) { - return a==b; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/operators/TestOperatorBool.java b/test/mycompiler/test/operators/TestOperatorBool.java deleted file mode 100755 index 38e10d116..000000000 --- a/test/mycompiler/test/operators/TestOperatorBool.java +++ /dev/null @@ -1,58 +0,0 @@ -package mycompiler.test.operators; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -import mycompiler.test.expectationTypes.GenericTypeVarExpect; - - -/** -* 12-04-08 -* @author -* -* checks operators requiring boolean types -*/ - -public class TestOperatorBool extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestOperatorBool"; - private final static String JAVPATH="test/mycompiler/test/operators/"; - - public TestOperatorBool(String name) { - super(name,TestOperatorBool.JAVPATH+TestOperatorBool.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testOperatorBool = new ClassExpect(TestOperatorBool.TESTEDCLASSNAME); - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("java.lang.Boolean",-1),0); - m1.addParameter(new VarExpect("a",new RefType("java.lang.Boolean",-1))); - m1.addParameter(new VarExpect("b",new RefType("java.lang.Boolean",-1))); - - MethodExpect m2 = new MethodExpect("m2",new RefType("java.lang.Boolean",-1),0); - m2.addParameter(new VarExpect("a",new RefType("java.lang.Boolean",-1))); - m2.addParameter(new VarExpect("b",new RefType("java.lang.Boolean",-1))); - - MethodExpect m3 = new MethodExpect("m3",new RefType("java.lang.Boolean",-1),0); - m3.addParameter(new VarExpect("a",new RefType("java.lang.Boolean",-1))); - - MethodExpect m4 = new MethodExpect("m4",new RefType("java.lang.Boolean",-1),0); - m4.addParameter(new VarExpect("a",new GenericTypeVarExpect("a"))); - m4.addParameter(new VarExpect("b",new GenericTypeVarExpect("b"))); - - testOperatorBool.addMethod(m1); - testOperatorBool.addMethod(m2); - testOperatorBool.addMethod(m3); - testOperatorBool.addMethod(m4); - - - return new Expectation(testOperatorBool); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/operators/TestOperatorComparison.jav b/test/mycompiler/test/operators/TestOperatorComparison.jav deleted file mode 100755 index 62aaee58f..000000000 --- a/test/mycompiler/test/operators/TestOperatorComparison.jav +++ /dev/null @@ -1,22 +0,0 @@ -public class TestOperatorComparison { - -/* public m1(a,b) { - return a < b; - } - - public m2(a, b) { - return a >= b; - } - */ - public m3(a, b) { - return a==b; - } - - public java.lang.Boolean m4(a,b) { - return a!=b; - } - - public m5(Integer a, b) { - return a createMengeAllDiscreteNumberTypes() { - Menge ret = new Menge(); - ret.add(new RefType("java.lang.Integer",-1)); - // ret.add(new RefType("java.lang.Long",-1)); - // ret.add(new RefType("java.lang.Short",-1)); - // ret.add(new RefType("java.lang.Byte",-1)); - - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/operators/TestOperatorIncrement.jav b/test/mycompiler/test/operators/TestOperatorIncrement.jav deleted file mode 100755 index dd497c864..000000000 --- a/test/mycompiler/test/operators/TestOperatorIncrement.jav +++ /dev/null @@ -1,11 +0,0 @@ - -public class TestOperatorIncrement { - - public void m(i,j,k,l) { - i++; - j--; - ++k; - --l; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/operators/TestOperatorIncrement.java b/test/mycompiler/test/operators/TestOperatorIncrement.java deleted file mode 100755 index b5980ab81..000000000 --- a/test/mycompiler/test/operators/TestOperatorIncrement.java +++ /dev/null @@ -1,65 +0,0 @@ -package mycompiler.test.operators; -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** -* 12-04-08 -* @author -* checks correct identification of types which the increment operator can be used for -* -*/ - -public class TestOperatorIncrement extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestOperatorIncrement"; - private final static String JAVPATH="test/mycompiler/test/operators/"; - - public TestOperatorIncrement(String name) { - super(name,TestOperatorIncrement.JAVPATH+TestOperatorIncrement.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testOperatorIncrement = new ClassExpect(TestOperatorIncrement.TESTEDCLASSNAME); - - //Methods - VarExpect m1_i = new VarExpect("i",new RefType("java.lang.Integer",-1)); - m1_i.setExpectedType(createMengeAllDiscreteNumberTypes()); - VarExpect m1_j = new VarExpect("j",new RefType("java.lang.Integer",-1)); - m1_j.setExpectedType(createMengeAllDiscreteNumberTypes()); - VarExpect m1_k = new VarExpect("k",new RefType("java.lang.Integer",-1)); - m1_j.setExpectedType(createMengeAllDiscreteNumberTypes()); - VarExpect m1_l = new VarExpect("l",new RefType("java.lang.Integer",-1)); - m1_j.setExpectedType(createMengeAllDiscreteNumberTypes()); - - MethodExpect m1 = new MethodExpect("m",new RefType("void",-1),0); - m1.addParameter(m1_i); - m1.addParameter(m1_j); - m1.addParameter(m1_k); - m1.addParameter(m1_l); - - testOperatorIncrement.addMethod(m1); - - return new Expectation(testOperatorIncrement); - } - - private Menge createMengeAllDiscreteNumberTypes() { - Menge ret = new Menge(); - ret.add(new RefType("java.lang.Integer",-1)); - // ret.add(new RefType("java.lang.Long",-1)); - // ret.add(new RefType("java.lang.Short",-1)); - // ret.add(new RefType("java.lang.Byte",-1)); - - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/operators/TestOperatorObjects.jav b/test/mycompiler/test/operators/TestOperatorObjects.jav deleted file mode 100755 index f9564dc01..000000000 --- a/test/mycompiler/test/operators/TestOperatorObjects.jav +++ /dev/null @@ -1,18 +0,0 @@ -class A { - - public java.lang.Integer m(a) { - return a; - } - -} - -public class TestOperatorObjects { - - public static void main() { - b; - b=new A(); - c; - c=b.m(3); - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/operators/TestOperatorObjects.java b/test/mycompiler/test/operators/TestOperatorObjects.java deleted file mode 100755 index f9cccff4c..000000000 --- a/test/mycompiler/test/operators/TestOperatorObjects.java +++ /dev/null @@ -1,48 +0,0 @@ -package mycompiler.test.operators; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** -* 12-04-08 -* @author -* -* checks object usage -*/ - -public class TestOperatorObjects extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestOperatorObjects"; - private final static String JAVPATH="test/mycompiler/test/operators/"; - - public TestOperatorObjects(String name) { - super(name,TestOperatorObjects.JAVPATH+TestOperatorObjects.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect a = new ClassExpect("A"); - ClassExpect testOperatorObjects = new ClassExpect(TestOperatorObjects.TESTEDCLASSNAME); - - //Methods - MethodExpect m = new MethodExpect("m",new RefType("java.lang.Integer",-1),0); - m.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - MethodExpect main = new MethodExpect("main",new RefType("void",-1),0); - main.getBlock().addLocalVar(new VarExpect("b",new RefType("A",-1))); - main.getBlock().addLocalVar(new VarExpect("c",new RefType("java.lang.Integer",-1))); - - - testOperatorObjects.addMethod(main); - a.addMethod(m); - - Expectation ret = new Expectation(testOperatorObjects); - ret.addClass(a); - return ret; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/operators/TestOperatorString.jav b/test/mycompiler/test/operators/TestOperatorString.jav deleted file mode 100755 index a209da133..000000000 --- a/test/mycompiler/test/operators/TestOperatorString.jav +++ /dev/null @@ -1,11 +0,0 @@ -public class TestOperatorString { - - public m() { - a; - b; - a="abc"; - b="def"; - return a+b; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/operators/TestOperatorString.java b/test/mycompiler/test/operators/TestOperatorString.java deleted file mode 100755 index 3b778ccc0..000000000 --- a/test/mycompiler/test/operators/TestOperatorString.java +++ /dev/null @@ -1,41 +0,0 @@ -package mycompiler.test.operators; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** -* 12-04-08 -* @author -* -* checks whether plus operator can be used on strings -*/ - -public class TestOperatorString extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestOperatorString"; - private final static String JAVPATH="test/mycompiler/test/operators/"; - - public TestOperatorString(String name) { - super(name,TestOperatorString.JAVPATH+TestOperatorString.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - ClassExpect testOperatorString = new ClassExpect(TestOperatorString.TESTEDCLASSNAME); - - //Methods - MethodExpect m = new MethodExpect("m",new RefType("java.lang.String",-1),0); - m.getBlock().addLocalVar(new VarExpect("a",new RefType("java.lang.String",-1))); - m.getBlock().addLocalVar(new VarExpect("b",new RefType("java.lang.String",-1))); - - testOperatorString.addMethod(m); - - return new Expectation(testOperatorString); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/primitiveTypes/AllTestsPrimitiveTypes.java b/test/mycompiler/test/primitiveTypes/AllTestsPrimitiveTypes.java deleted file mode 100755 index 9f14501ae..000000000 --- a/test/mycompiler/test/primitiveTypes/AllTestsPrimitiveTypes.java +++ /dev/null @@ -1,25 +0,0 @@ -package mycompiler.test.primitiveTypes; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsPrimitiveTypes { - - public static Test suite() { - TestSuite suite = new TestSuite( - "Test for mycompiler.test.primitiveTypes"); - //$JUnit-BEGIN$ - suite.addTestSuite(StringTest.class); - suite.addTestSuite(IntegerTest.class); - suite.addTestSuite(FloatTest.class); - suite.addTestSuite(BooleanTest.class); - suite.addTestSuite(LongTest.class); - suite.addTestSuite(ByteTest.class); - suite.addTestSuite(TestSimpleTypes.class); - suite.addTestSuite(DoubleTest.class); - suite.addTestSuite(CharTest.class); - //$JUnit-END$ - return suite; - } - -} diff --git a/test/mycompiler/test/primitiveTypes/BooleanTest.jav b/test/mycompiler/test/primitiveTypes/BooleanTest.jav deleted file mode 100755 index f04ef412e..000000000 --- a/test/mycompiler/test/primitiveTypes/BooleanTest.jav +++ /dev/null @@ -1,5 +0,0 @@ -class BooleanTest{ - void booleanTest(b){ - b = true; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/primitiveTypes/BooleanTest.java b/test/mycompiler/test/primitiveTypes/BooleanTest.java deleted file mode 100755 index ad3f59c38..000000000 --- a/test/mycompiler/test/primitiveTypes/BooleanTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package mycompiler.test.primitiveTypes; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** -* 02-04-08 -* @author -* -* check type boolean -*/ -public class BooleanTest extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="BooleanTest"; - private final static String JAVPATH="test/mycompiler/test/primitiveTypes/"; - - public BooleanTest(String name) { - super(name,BooleanTest.JAVPATH+BooleanTest.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(BooleanTest.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("booleanTest",new RefType("void",-1),0); - m0.addParameter(new VarExpect("b",new RefType("java.lang.Boolean",-1))); - - overloading.addMethod(m0); - - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/primitiveTypes/ByteTest.jav b/test/mycompiler/test/primitiveTypes/ByteTest.jav deleted file mode 100755 index 156cf51df..000000000 --- a/test/mycompiler/test/primitiveTypes/ByteTest.jav +++ /dev/null @@ -1,6 +0,0 @@ -class ByteTest{ - void byteTest(b){ - byte myByte = -1; - b = myByte; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/primitiveTypes/ByteTest.java b/test/mycompiler/test/primitiveTypes/ByteTest.java deleted file mode 100755 index a283d6d1b..000000000 --- a/test/mycompiler/test/primitiveTypes/ByteTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package mycompiler.test.primitiveTypes; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.BlockExpect; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** -* 02-04-08 -* @author -* -* check type byte -*/ -public class ByteTest extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="ByteTest"; - private final static String JAVPATH="test/mycompiler/test/primitiveTypes/"; - - public ByteTest(String name) { - super(name,ByteTest.JAVPATH+ByteTest.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(ByteTest.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("byteTest",new RefType("void",-1),0); - m0.addParameter(new VarExpect("b",new RefType("byte",-1))); - - BlockExpect b0 = new BlockExpect(null,"1"); - VarExpect v0 = new VarExpect("myByte",new RefType("byte",-1)); - b0.addLocalVar(v0); - - m0.setBlock(b0); - - overloading.addMethod(m0); - - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/primitiveTypes/CharTest.jav b/test/mycompiler/test/primitiveTypes/CharTest.jav deleted file mode 100755 index 7c75f6755..000000000 --- a/test/mycompiler/test/primitiveTypes/CharTest.jav +++ /dev/null @@ -1,5 +0,0 @@ -class CharTest{ - void character(c){ - c = 'c'; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/primitiveTypes/CharTest.java b/test/mycompiler/test/primitiveTypes/CharTest.java deleted file mode 100755 index 7cd905cee..000000000 --- a/test/mycompiler/test/primitiveTypes/CharTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package mycompiler.test.primitiveTypes; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** -* 02-04-08 -* @author -* -* chck type character -*/ -public class CharTest extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="CharTest"; - private final static String JAVPATH="test/mycompiler/test/primitiveTypes/"; - - public CharTest(String name) { - super(name,CharTest.JAVPATH+CharTest.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(CharTest.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("character",new RefType("void",-1),0); - m0.addParameter(new VarExpect("c",new RefType("java.lang.Character",-1))); - - overloading.addMethod(m0); - - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/primitiveTypes/DoubleTest.jav b/test/mycompiler/test/primitiveTypes/DoubleTest.jav deleted file mode 100755 index a13652f38..000000000 --- a/test/mycompiler/test/primitiveTypes/DoubleTest.jav +++ /dev/null @@ -1,5 +0,0 @@ -class DoubleTest{ - void doublePrecision(d){ - d = 1.0; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/primitiveTypes/DoubleTest.java b/test/mycompiler/test/primitiveTypes/DoubleTest.java deleted file mode 100755 index 597fa8d52..000000000 --- a/test/mycompiler/test/primitiveTypes/DoubleTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package mycompiler.test.primitiveTypes; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** -* 02-04-08 -* @author -* -* check type double -*/ -public class DoubleTest extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="DoubleTest"; - private final static String JAVPATH="test/mycompiler/test/primitiveTypes/"; - - public DoubleTest(String name) { - super(name,DoubleTest.JAVPATH+DoubleTest.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(DoubleTest.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("doublePrecision",new RefType("void",-1),0); - m0.addParameter(new VarExpect("d",new RefType("java.lang.Double",-1))); - - overloading.addMethod(m0); - - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/primitiveTypes/FloatTest.jav b/test/mycompiler/test/primitiveTypes/FloatTest.jav deleted file mode 100755 index 054e946ed..000000000 --- a/test/mycompiler/test/primitiveTypes/FloatTest.jav +++ /dev/null @@ -1,5 +0,0 @@ -class FloatTest { - void floatingPoint(f) { - f = 5f; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/primitiveTypes/FloatTest.java b/test/mycompiler/test/primitiveTypes/FloatTest.java deleted file mode 100755 index a910b8294..000000000 --- a/test/mycompiler/test/primitiveTypes/FloatTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package mycompiler.test.primitiveTypes; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** -* 02-04-08 -* @author -* -* check type Float -*/ -public class FloatTest extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="FloatTest"; - private final static String JAVPATH="test/mycompiler/test/primitiveTypes/"; - - public FloatTest(String name) { - super(name,FloatTest.JAVPATH+FloatTest.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(FloatTest.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("floatingPoint",new RefType("void",-1),0); - m0.addParameter(new VarExpect("f",new RefType("java.lang.Float",-1))); - - overloading.addMethod(m0); - - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/primitiveTypes/IntegerTest.jav b/test/mycompiler/test/primitiveTypes/IntegerTest.jav deleted file mode 100755 index 5b6bc3d2d..000000000 --- a/test/mycompiler/test/primitiveTypes/IntegerTest.jav +++ /dev/null @@ -1,5 +0,0 @@ -class IntegerTest{ - void integer(i){ - i = 1; /* koennte vielleicht auch short/byte/char sein .. */ - } -} \ No newline at end of file diff --git a/test/mycompiler/test/primitiveTypes/IntegerTest.java b/test/mycompiler/test/primitiveTypes/IntegerTest.java deleted file mode 100755 index 42a6559ce..000000000 --- a/test/mycompiler/test/primitiveTypes/IntegerTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package mycompiler.test.primitiveTypes; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** -* 02-04-08 -* @author -* -* check type Integer -*/ -public class IntegerTest extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="IntegerTest"; - private final static String JAVPATH="test/mycompiler/test/primitiveTypes/"; - - public IntegerTest(String name) { - super(name,IntegerTest.JAVPATH+IntegerTest.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(IntegerTest.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("integer",new RefType("void",-1),0); - VarExpect i_type = new VarExpect("i", new RefType("java.lang.Integer",-1)); -// i_type.addExpectedType(new RefType("java.lang.Short",-1)); -// i_type.addExpectedType(new RefType("java.lang.Character",-1)); -// i_type.addExpectedType(new RefType("java.lang.Long",-1)); -// i_type.addExpectedType(new RefType("java.lang.Byte",-1)); - m0.addParameter(i_type); - - overloading.addMethod(m0); - - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/primitiveTypes/LongTest.jav b/test/mycompiler/test/primitiveTypes/LongTest.jav deleted file mode 100755 index 4bc6590a1..000000000 --- a/test/mycompiler/test/primitiveTypes/LongTest.jav +++ /dev/null @@ -1,5 +0,0 @@ -class LongTest{ - void longTest(l){ - l = 4L; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/primitiveTypes/LongTest.java b/test/mycompiler/test/primitiveTypes/LongTest.java deleted file mode 100755 index 8951408cd..000000000 --- a/test/mycompiler/test/primitiveTypes/LongTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package mycompiler.test.primitiveTypes; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** -* 02-04-08 -* @author -* -* check type Long -*/ -public class LongTest extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="LongTest"; - private final static String JAVPATH="test/mycompiler/test/primitiveTypes/"; - - public LongTest(String name) { - super(name,LongTest.JAVPATH+LongTest.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(LongTest.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("longTest",new RefType("void",-1),0); - m0.addParameter(new VarExpect("l",new RefType("java.lang.Long",-1))); - - overloading.addMethod(m0); - - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/primitiveTypes/StringTest.jav b/test/mycompiler/test/primitiveTypes/StringTest.jav deleted file mode 100755 index 72c8f75d2..000000000 --- a/test/mycompiler/test/primitiveTypes/StringTest.jav +++ /dev/null @@ -1,5 +0,0 @@ -class StringTest{ - void string(s){ - s = "String"; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/primitiveTypes/StringTest.java b/test/mycompiler/test/primitiveTypes/StringTest.java deleted file mode 100755 index 4c538aee6..000000000 --- a/test/mycompiler/test/primitiveTypes/StringTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package mycompiler.test.primitiveTypes; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -/** -* 02-04-08 -* @author -* -* check type String -*/ -public class StringTest extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="StringTest"; - private final static String JAVPATH="test/mycompiler/test/primitiveTypes/"; - - public StringTest(String name) { - super(name,StringTest.JAVPATH+StringTest.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect overloading = new ClassExpect(StringTest.TESTEDCLASSNAME); - //methods - - MethodExpect m0 = new MethodExpect("string",new RefType("void",-1),0); - m0.addParameter(new VarExpect("s",new RefType("java.lang.String",-1))); - - overloading.addMethod(m0); - - - return new Expectation(overloading); - } - -} diff --git a/test/mycompiler/test/primitiveTypes/TestSimpleTypes.jav b/test/mycompiler/test/primitiveTypes/TestSimpleTypes.jav deleted file mode 100755 index 9ddb95262..000000000 --- a/test/mycompiler/test/primitiveTypes/TestSimpleTypes.jav +++ /dev/null @@ -1,22 +0,0 @@ - -class TestSimpleTypes{ - - public m1(int a) { - } - - public int m2(int a) - { - return a; - } - - public m3(char a) {} - -/* not implemented? - public m4(float a) {} - public m5(double a) {}*/ - - /* cast from Integer to int does not work - public int m6() { - return 3; - }*/ -} \ No newline at end of file diff --git a/test/mycompiler/test/primitiveTypes/TestSimpleTypes.java b/test/mycompiler/test/primitiveTypes/TestSimpleTypes.java deleted file mode 100755 index bbdfac28c..000000000 --- a/test/mycompiler/test/primitiveTypes/TestSimpleTypes.java +++ /dev/null @@ -1,53 +0,0 @@ -package mycompiler.test.primitiveTypes; - -import de.dhbwstuttgart.syntaxtree.type.CharacterType; -import de.dhbwstuttgart.syntaxtree.type.IntegerType; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** - * 01-04-08 - * @author - * - * This test verifies identification of a simple method with returntype void - * - */ - -public class TestSimpleTypes extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestSimpleTypes"; - private final static String JAVPATH="test/mycompiler/test/primitiveTypes/"; - - public TestSimpleTypes(String name) { - super(name,TestSimpleTypes.JAVPATH+TestSimpleTypes.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - // Classes - ClassExpect testSimpleType = new ClassExpect(TestSimpleTypes.TESTEDCLASSNAME); - - //Methods - MethodExpect m1 = new MethodExpect("m1",new RefType("void",-1),0); - m1.addParameter(new VarExpect("a",new IntegerType())); - MethodExpect m2 = new MethodExpect("m2",new IntegerType(),0); - m2.addParameter(new VarExpect("a",new IntegerType())); - MethodExpect m3 = new MethodExpect("m3",new RefType("void",-1),0); - m3.addParameter(new VarExpect("a",new CharacterType())); -// MethodExpect m4 = new MethodExpect("m4",new RefType("void",-1),0); -// m4.addParameter(new VarExpect("a",new FloatType())); -// MethodExpect m5 = new MethodExpect("m5",new RefType("void",-1),0); -// m5.addParameter(new VarExpect("a",new DoubleType())); - - - testSimpleType.addMethod(m1); - testSimpleType.addMethod(m2); - testSimpleType.addMethod(m3); - return new Expectation(testSimpleType); - } -} diff --git a/test/mycompiler/test/trivial/AllTestsTrivial.java b/test/mycompiler/test/trivial/AllTestsTrivial.java deleted file mode 100755 index d0400368b..000000000 --- a/test/mycompiler/test/trivial/AllTestsTrivial.java +++ /dev/null @@ -1,30 +0,0 @@ -package mycompiler.test.trivial; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsTrivial { - - public static Test suite() { - TestSuite suite = new TestSuite("Test for mycompiler.test.trivial"); - //$JUnit-BEGIN$ - suite.addTestSuite(TestInterfaceEmpty.class); - suite.addTestSuite(TestClassMember.class); - suite.addTestSuite(TestClassMemberAssignment.class); - suite.addTestSuite(TestClassEmptyGenerics.class); - suite.addTestSuite(TestConstants.class); - suite.addTestSuite(TestConstructor.class); - suite.addTestSuite(TestInterfaceMethod.class); - suite.addTestSuite(TestClassEmpty.class); - suite.addTestSuite(TestMethodEmptyParameterGenericExtends.class); - suite.addTestSuite(TestConstructorNegative.class); - suite.addTestSuite(TestMethodEmptyParameter.class); - suite.addTestSuite(TestMethodEmptyGeneric.class); - suite.addTestSuite(TestInterfaceNotInferenced.class); - suite.addTestSuite(TestMethodEmpty.class); - suite.addTestSuite(TestInterfaceMember.class); - //$JUnit-END$ - return suite; - } - -} diff --git a/test/mycompiler/test/trivial/TestClassEmpty.jav b/test/mycompiler/test/trivial/TestClassEmpty.jav deleted file mode 100755 index d7f473a06..000000000 --- a/test/mycompiler/test/trivial/TestClassEmpty.jav +++ /dev/null @@ -1,3 +0,0 @@ - -public class TestClassEmpty { -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestClassEmpty.java b/test/mycompiler/test/trivial/TestClassEmpty.java deleted file mode 100755 index f7129f960..000000000 --- a/test/mycompiler/test/trivial/TestClassEmpty.java +++ /dev/null @@ -1,34 +0,0 @@ -package mycompiler.test.trivial; - -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; - - -/** - * 01-04-08 - * @author - * - * This tests verifies correct detection of an empty class. - * - */ - -public class TestClassEmpty extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestClassEmpty"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestClassEmpty(String name) { - super(name,TestClassEmpty.JAVPATH+TestClassEmpty.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - //classes - ClassExpect testEmptyClass = new ClassExpect(TestClassEmpty.TESTEDCLASSNAME); - - return new Expectation(testEmptyClass); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestClassEmptyGenerics.jav b/test/mycompiler/test/trivial/TestClassEmptyGenerics.jav deleted file mode 100755 index bb072d4b8..000000000 --- a/test/mycompiler/test/trivial/TestClassEmptyGenerics.jav +++ /dev/null @@ -1,4 +0,0 @@ - -public class TestClassEmptyGenerics { - -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestClassEmptyGenerics.java b/test/mycompiler/test/trivial/TestClassEmptyGenerics.java deleted file mode 100755 index 8556a7f5e..000000000 --- a/test/mycompiler/test/trivial/TestClassEmptyGenerics.java +++ /dev/null @@ -1,36 +0,0 @@ -package mycompiler.test.trivial; - -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; - -/** - * 01-04-08 - * @author - * - * This tests verifies correct identification of a generic class. - * - */ - -public class TestClassEmptyGenerics extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestClassEmptyGenerics"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestClassEmptyGenerics(String name) { - super(name,TestClassEmptyGenerics.JAVPATH+TestClassEmptyGenerics.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //Classes - ClassExpect testEmptyClassGenerics = new ClassExpect(TestClassEmptyGenerics.TESTEDCLASSNAME); - testEmptyClassGenerics.addGeneric(new GenericTypeVar("E",-1)); - testEmptyClassGenerics.addGeneric(new GenericTypeVar("F",-1)); - - //Expectation - return new Expectation(testEmptyClassGenerics); - } -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestClassMember.jav b/test/mycompiler/test/trivial/TestClassMember.jav deleted file mode 100755 index 3fc799e5f..000000000 --- a/test/mycompiler/test/trivial/TestClassMember.jav +++ /dev/null @@ -1,6 +0,0 @@ -import de.dhbwstuttgart.typeinference.Menge; -public class TestClassMember { - - Integer member; - Menge member2; -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestClassMember.java b/test/mycompiler/test/trivial/TestClassMember.java deleted file mode 100755 index 64fae9082..000000000 --- a/test/mycompiler/test/trivial/TestClassMember.java +++ /dev/null @@ -1,45 +0,0 @@ -package mycompiler.test.trivial; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 01-04-08 - * @author - * - * This test verifies correct detection of a member variable. - */ -public class TestClassMember extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestClassMember"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestClassMember(String name) { - super(name,TestClassMember.JAVPATH+TestClassMember.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - //class--- TestClassMember - ClassExpect testClassMember = new ClassExpect(TestClassMember.TESTEDCLASSNAME); - //member - VarExpect member = new VarExpect("member",new RefType("java.lang.Integer",-1)); - Menge param = new Menge(); - param.add(new RefType("java.lang.String",-1)); - RefType member2Type = new RefType("de.dhbwstuttgart.typeinference.Menge",param,-1); - VarExpect member2 = new VarExpect("member2",member2Type); - testClassMember.addMember(member); - testClassMember.addMember(member2); - - //Expectation - return new Expectation(testClassMember); - } - -} diff --git a/test/mycompiler/test/trivial/TestClassMemberAssignment.jav b/test/mycompiler/test/trivial/TestClassMemberAssignment.jav deleted file mode 100755 index 771ea288a..000000000 --- a/test/mycompiler/test/trivial/TestClassMemberAssignment.jav +++ /dev/null @@ -1,22 +0,0 @@ - -public class TestClassMemberAssignment { - - Integer member; - - public m1() { - member=1; - } - - public m2() { - this.member=2; - } - - public m3(a) { - member=a; - } - - public void m(a) { - this.a=a; - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestClassMemberAssignment.java b/test/mycompiler/test/trivial/TestClassMemberAssignment.java deleted file mode 100755 index 25d0caadc..000000000 --- a/test/mycompiler/test/trivial/TestClassMemberAssignment.java +++ /dev/null @@ -1,53 +0,0 @@ -package mycompiler.test.trivial; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 18-04-08 - * @author - * - * This test verifies correct member assignments. - */ -public class TestClassMemberAssignment extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestClassMemberAssignment"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestClassMemberAssignment(String name) { - super(name,TestClassMemberAssignment.JAVPATH+TestClassMemberAssignment.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - //class--- TestClassMemberAssignment - ClassExpect testClassMemberAssignment = new ClassExpect(TestClassMemberAssignment.TESTEDCLASSNAME); - //member - VarExpect member = new VarExpect("member",new RefType("java.lang.Integer",-1)); - testClassMemberAssignment.addMember(member); - //methods - MethodExpect m1 = new MethodExpect("m1", new RefType("void",-1)); - MethodExpect m2 = new MethodExpect("m2", new RefType("void",-1)); - MethodExpect m3 = new MethodExpect("m3", new RefType("void",-1)); - m3.addParameter(new VarExpect("a", new RefType("java.lang.Integer",-1))); - MethodExpect m4 = new MethodExpect("m3", new RefType("void",-1)); - m3.addParameter(new VarExpect("a", new RefType("java.lang.Integer",-1))); - - testClassMemberAssignment.addMethod(m1); - testClassMemberAssignment.addMethod(m2); - testClassMemberAssignment.addMethod(m3); - testClassMemberAssignment.addMethod(m4); - - //Expectation - return new Expectation(testClassMemberAssignment); - } - -} diff --git a/test/mycompiler/test/trivial/TestConstants.jav b/test/mycompiler/test/trivial/TestConstants.jav deleted file mode 100755 index f9d293ac5..000000000 --- a/test/mycompiler/test/trivial/TestConstants.jav +++ /dev/null @@ -1,6 +0,0 @@ -public class TestConstants { - public final static Boolean B = true; - public final static Integer I = 1; - public final static Character C = 'A'; - public final static String S = "Hello World!"; -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestConstants.java b/test/mycompiler/test/trivial/TestConstants.java deleted file mode 100755 index cc6f9852a..000000000 --- a/test/mycompiler/test/trivial/TestConstants.java +++ /dev/null @@ -1,39 +0,0 @@ -package mycompiler.test.trivial; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 18-04-08 - * @author - * - * this test checks correct detection of constants as members - */ -public class TestConstants extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestConstants"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestConstants(String name) { - super(name,TestConstants.JAVPATH+TestConstants.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - //class--- TestConstants - ClassExpect testConstants = new ClassExpect(TestConstants.TESTEDCLASSNAME); - //member - testConstants.addMember(new VarExpect("B",new RefType("java.lang.Boolean",-1))); - testConstants.addMember(new VarExpect("I",new RefType("java.lang.Integer",-1))); - testConstants.addMember(new VarExpect("C",new RefType("java.lang.Character",-1))); - testConstants.addMember(new VarExpect("S",new RefType("java.lang.String",-1))); - - //Expectation - return new Expectation(testConstants); - } - -} diff --git a/test/mycompiler/test/trivial/TestConstructor.jav b/test/mycompiler/test/trivial/TestConstructor.jav deleted file mode 100755 index f07566b45..000000000 --- a/test/mycompiler/test/trivial/TestConstructor.jav +++ /dev/null @@ -1,20 +0,0 @@ -import java.util.Stack; - -public class TestConstructor { - Integer i; - Stack s; - - public TestConstructor() { - i=3; - s=new Stack(); - } - - public TestConstructor(a) { - a=4; - } - - public TestConstructor(java.lang.Integer a, Stack b) { - i=a; - s=b; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestConstructor.java b/test/mycompiler/test/trivial/TestConstructor.java deleted file mode 100755 index 8fee9776a..000000000 --- a/test/mycompiler/test/trivial/TestConstructor.java +++ /dev/null @@ -1,51 +0,0 @@ -package mycompiler.test.trivial; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** - * 13-04-08 - * @author - * - * This test verifies correct identification of a Constructor - * - */ - -public class TestConstructor extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestConstructor"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestConstructor(String name) { - super(name,TestConstructor.JAVPATH+TestConstructor.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - // Classes - ClassExpect testConstructor = new ClassExpect(TestConstructor.TESTEDCLASSNAME); - - //Member - testConstructor.addMember(new VarExpect("i",new RefType("java.lang.Integer",-1))); - testConstructor.addMember(new VarExpect("s",new RefType("java.util.Stack",-1))); - - - //Methods - MethodExpect constructor1 = new MethodExpect("",new RefType("void",-1)); - MethodExpect constructor2 = new MethodExpect("",new RefType("void",-1)); - constructor2.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - MethodExpect constructor3 = new MethodExpect("",new RefType("void",-1)); - constructor3.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - constructor3.addParameter(new VarExpect("b",new RefType("java.util.Stack",-1))); - - testConstructor.addMethod(constructor1); - testConstructor.addMethod(constructor2); - testConstructor.addMethod(constructor3); - return new Expectation(testConstructor); - } -} diff --git a/test/mycompiler/test/trivial/TestConstructorNegative.jav b/test/mycompiler/test/trivial/TestConstructorNegative.jav deleted file mode 100755 index b4bfcf903..000000000 --- a/test/mycompiler/test/trivial/TestConstructorNegative.jav +++ /dev/null @@ -1,8 +0,0 @@ - -public class TestConstructorNegative { - - /*should throw error*/ - public TestConstructorNegative(java.lang.Integer a, String b) { - return a; - } -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestConstructorNegative.java b/test/mycompiler/test/trivial/TestConstructorNegative.java deleted file mode 100755 index 56e6e299c..000000000 --- a/test/mycompiler/test/trivial/TestConstructorNegative.java +++ /dev/null @@ -1,45 +0,0 @@ -package mycompiler.test.trivial; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - - -/** - * 13-04-08 - * @author - * - * This test verifies that it's not allowed for a constructor to return a value - * - */ - -public class TestConstructorNegative extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestConstructorNegative"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestConstructorNegative(String name) { - super(name,TestConstructorNegative.JAVPATH+TestConstructorNegative.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - // Classes - ClassExpect testConstructorNegative = new ClassExpect(TestConstructorNegative.TESTEDCLASSNAME); - - //Methods - /*this is as assumed*/ - MethodExpect constructor1 = new MethodExpect("",new RefType("void",-1)); - constructor1.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - constructor1.addParameter(new VarExpect("b",new RefType("java.lang.String",-1))); - /*however, testcase should throw an error*/ - - testConstructorNegative.addMethod(constructor1); - Expectation ret = new Expectation(testConstructorNegative); - ret.addException(new Exception()); - return ret; - } -} diff --git a/test/mycompiler/test/trivial/TestInterfaceEmpty.jav b/test/mycompiler/test/trivial/TestInterfaceEmpty.jav deleted file mode 100755 index 52bfca29f..000000000 --- a/test/mycompiler/test/trivial/TestInterfaceEmpty.jav +++ /dev/null @@ -1,4 +0,0 @@ - -interface TestInterfaceEmpty { - -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestInterfaceEmpty.java b/test/mycompiler/test/trivial/TestInterfaceEmpty.java deleted file mode 100755 index f227fa453..000000000 --- a/test/mycompiler/test/trivial/TestInterfaceEmpty.java +++ /dev/null @@ -1,33 +0,0 @@ -package mycompiler.test.trivial; - -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; - -/** - * 01-04-08 - * @author - * - *This test verifies correct detection of simple interface - * - */ - -public class TestInterfaceEmpty extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestInterfaceEmpty"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestInterfaceEmpty(String name) { - super(name,TestInterfaceEmpty.JAVPATH+TestInterfaceEmpty.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - // Classes - ClassExpect testEmptyInterface = new ClassExpect(TestInterfaceEmpty.TESTEDCLASSNAME); - - //Expectation - return new Expectation(testEmptyInterface); - } -} diff --git a/test/mycompiler/test/trivial/TestInterfaceMember.jav b/test/mycompiler/test/trivial/TestInterfaceMember.jav deleted file mode 100755 index 5e60eb603..000000000 --- a/test/mycompiler/test/trivial/TestInterfaceMember.jav +++ /dev/null @@ -1,5 +0,0 @@ -interface TestInterfaceMember { - - Integer member=3; - -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestInterfaceMember.java b/test/mycompiler/test/trivial/TestInterfaceMember.java deleted file mode 100755 index b1a42a20e..000000000 --- a/test/mycompiler/test/trivial/TestInterfaceMember.java +++ /dev/null @@ -1,37 +0,0 @@ -package mycompiler.test.trivial; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 18-04-08 - * @author - * - *This test verifies correct detection of an interface with a single member - * - */ - -public class TestInterfaceMember extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestInterfaceMember"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestInterfaceMember(String name) { - super(name,TestInterfaceMember.JAVPATH+TestInterfaceMember.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - // Classes - ClassExpect testInterfaceMember = new ClassExpect(TestInterfaceMember.TESTEDCLASSNAME); - - testInterfaceMember.addMember(new VarExpect("member", new RefType("java.lang.Integer",-1))); - - //Expectation - return new Expectation(testInterfaceMember); - } -} diff --git a/test/mycompiler/test/trivial/TestInterfaceMethod.jav b/test/mycompiler/test/trivial/TestInterfaceMethod.jav deleted file mode 100755 index 1b416fd08..000000000 --- a/test/mycompiler/test/trivial/TestInterfaceMethod.jav +++ /dev/null @@ -1,10 +0,0 @@ -interface TestInterfaceMethod { - - empty1(); - - void empty2(); - - empty3(Integer a); - - empty4(String a, Integer b); -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestInterfaceMethod.java b/test/mycompiler/test/trivial/TestInterfaceMethod.java deleted file mode 100755 index af58cf8ae..000000000 --- a/test/mycompiler/test/trivial/TestInterfaceMethod.java +++ /dev/null @@ -1,50 +0,0 @@ -package mycompiler.test.trivial; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -import mycompiler.test.expectationTypes.TypePlaceholderExpect; - -/** - * 10-04-08 - * @author - * - *This test verifies correct detection of an interface with a method - * - */ - -public class TestInterfaceMethod extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestInterfaceMethod"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestInterfaceMethod(String name) { - super(name,TestInterfaceMethod.JAVPATH+TestInterfaceMethod.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - // Classes - ClassExpect testInterfaceMethod = new ClassExpect(TestInterfaceMethod.TESTEDCLASSNAME); - - MethodExpect empty1 = new MethodExpect("empty1",new TypePlaceholderExpect("a")); - MethodExpect empty2 = new MethodExpect("empty2",new RefType("void",-1)); - MethodExpect empty3 = new MethodExpect("empty3",new TypePlaceholderExpect("b")); - empty3.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - MethodExpect empty4 = new MethodExpect("empty4",new TypePlaceholderExpect("c")); - empty4.addParameter(new VarExpect("a",new RefType("java.lang.String",-1))); - empty4.addParameter(new VarExpect("b",new RefType("java.lang.Integer",-1))); - - testInterfaceMethod.addMethod(empty1); - testInterfaceMethod.addMethod(empty2); - testInterfaceMethod.addMethod(empty3); - testInterfaceMethod.addMethod(empty4); - - //Expectation - return new Expectation(testInterfaceMethod); - } -} diff --git a/test/mycompiler/test/trivial/TestInterfaceNotInferenced.jav b/test/mycompiler/test/trivial/TestInterfaceNotInferenced.jav deleted file mode 100755 index f03d6b181..000000000 --- a/test/mycompiler/test/trivial/TestInterfaceNotInferenced.jav +++ /dev/null @@ -1,10 +0,0 @@ -public interface TestInterfaceNotInferenced { - - public Integer m1(); - - /*should throw error, because not all Types defined*/ - public m2(); - - public void m3(a); - -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestInterfaceNotInferenced.java b/test/mycompiler/test/trivial/TestInterfaceNotInferenced.java deleted file mode 100755 index cce9d8775..000000000 --- a/test/mycompiler/test/trivial/TestInterfaceNotInferenced.java +++ /dev/null @@ -1,48 +0,0 @@ -package mycompiler.test.trivial; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.TypePlaceholderExpect; -import mycompiler.test.expectationTypes.VarExpect; - -/** - * 20-05-08 - * @author - * - * checks that interfaces do not get inferenced according to discussion with M. Plümicke - */ -public class TestInterfaceNotInferenced extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestInterfaceNotInferenced"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestInterfaceNotInferenced(String name) { - super(name,TestInterfaceNotInferenced.JAVPATH+TestInterfaceNotInferenced.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - - //interface--- TestInterfaceNotInferenced - ClassExpect testInterfaceNotInferenced = new ClassExpect(TestInterfaceNotInferenced.TESTEDCLASSNAME); - - //methods - MethodExpect m1 = new MethodExpect("m1",new RefType("java.lang.Integer",-1)); - MethodExpect m2 = new MethodExpect("m2", new TypePlaceholderExpect("a")); - MethodExpect m3 = new MethodExpect("m3", new RefType("void",-1)); - m3.addParameter(new VarExpect("a", new TypePlaceholderExpect("b"))); - - testInterfaceNotInferenced.addMethod(m1); - testInterfaceNotInferenced.addMethod(m2); - testInterfaceNotInferenced.addMethod(m3); - //Expectation - Expectation ret = new Expectation(testInterfaceNotInferenced); - //interfaces should not be inferenceable - ret.addException(new Exception()); - return ret; - } - -} diff --git a/test/mycompiler/test/trivial/TestMethodEmpty.jav b/test/mycompiler/test/trivial/TestMethodEmpty.jav deleted file mode 100755 index c9c21cd5c..000000000 --- a/test/mycompiler/test/trivial/TestMethodEmpty.jav +++ /dev/null @@ -1,6 +0,0 @@ - -public class TestMethodEmpty { - - emptyMethod() { - } -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestMethodEmpty.java b/test/mycompiler/test/trivial/TestMethodEmpty.java deleted file mode 100755 index 05b1f535f..000000000 --- a/test/mycompiler/test/trivial/TestMethodEmpty.java +++ /dev/null @@ -1,38 +0,0 @@ -package mycompiler.test.trivial; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; - - -/** - * 01-04-08 - * @author - * - * This test verifies identification of a simple method with return type void - * - */ - -public class TestMethodEmpty extends AbstractInferenceTest { - private final static String TESTEDCLASSNAME="TestMethodEmpty"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestMethodEmpty(String name) { - super(name,TestMethodEmpty.JAVPATH+TestMethodEmpty.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - // Classes - ClassExpect testEmptyMethod = new ClassExpect(TestMethodEmpty.TESTEDCLASSNAME); - - //Methods - MethodExpect emptyMethod = new MethodExpect("emptyMethod",new RefType("void",-1)); - testEmptyMethod.addMethod(emptyMethod); - - return new Expectation(testEmptyMethod); - } -} diff --git a/test/mycompiler/test/trivial/TestMethodEmptyGeneric.jav b/test/mycompiler/test/trivial/TestMethodEmptyGeneric.jav deleted file mode 100755 index c7043f018..000000000 --- a/test/mycompiler/test/trivial/TestMethodEmptyGeneric.jav +++ /dev/null @@ -1,10 +0,0 @@ - -public class TestMethodEmptyGeneric{ - - emptyMethodGeneric() { - } - - emptyMethodGeneric2() { - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestMethodEmptyGeneric.java b/test/mycompiler/test/trivial/TestMethodEmptyGeneric.java deleted file mode 100755 index 26325c4eb..000000000 --- a/test/mycompiler/test/trivial/TestMethodEmptyGeneric.java +++ /dev/null @@ -1,46 +0,0 @@ -package mycompiler.test.trivial; - -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; - -/** - * 01-04-08 - * @author - * - * Simply tests recognition of a generic method with return type void - * - */ - -public class TestMethodEmptyGeneric extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestMethodEmptyGeneric"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestMethodEmptyGeneric(String name) { - super(name,TestMethodEmptyGeneric.JAVPATH+TestMethodEmptyGeneric.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - // classes - ClassExpect testEmptyMethodGeneric = new ClassExpect(TestMethodEmptyGeneric.TESTEDCLASSNAME); - - //methods - MethodExpect emptyMethodGeneric = new MethodExpect("emptyMethodGeneric",new RefType("void",-1)); - emptyMethodGeneric.addGeneric(new GenericTypeVar("T",-1)); - MethodExpect emptyMethodGeneric2= new MethodExpect("emptyMethodGeneric2",new RefType("void",-1)); - emptyMethodGeneric2.addGeneric(new GenericTypeVar("T",-1)); - emptyMethodGeneric2.addGeneric(new GenericTypeVar("S",-1)); - - testEmptyMethodGeneric.addMethod(emptyMethodGeneric); - testEmptyMethodGeneric.addMethod(emptyMethodGeneric2); - - return new Expectation(testEmptyMethodGeneric); - } - -} diff --git a/test/mycompiler/test/trivial/TestMethodEmptyParameter.jav b/test/mycompiler/test/trivial/TestMethodEmptyParameter.jav deleted file mode 100755 index 7b5b47ac0..000000000 --- a/test/mycompiler/test/trivial/TestMethodEmptyParameter.jav +++ /dev/null @@ -1,16 +0,0 @@ - -public class TestMethodEmptyParameter{ - - - emptyMethodParameter(Integer a) { - } - - - emptyMethodParameter2(Boolean a, Integer b) { - - } - - emptyMethodParameter3(a,b) { - } - -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestMethodEmptyParameter.java b/test/mycompiler/test/trivial/TestMethodEmptyParameter.java deleted file mode 100755 index e0503619c..000000000 --- a/test/mycompiler/test/trivial/TestMethodEmptyParameter.java +++ /dev/null @@ -1,52 +0,0 @@ -package mycompiler.test.trivial; - -import de.dhbwstuttgart.syntaxtree.type.RefType; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; -import mycompiler.test.expectationTypes.GenericTypeVarExpect; - -/** - * TODO: - * @author tom - * - * Test simple empty methods with parameters -> parameters will be inference to genericstypevar - */ - -public class TestMethodEmptyParameter extends AbstractInferenceTest { - - private final static String TESTEDCLASSNAME="TestMethodEmptyParameter"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestMethodEmptyParameter(String name) { - super(name,TestMethodEmptyParameter.JAVPATH+TestMethodEmptyParameter.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - //classes - ClassExpect testEmptyMethodParameter = new ClassExpect(TestMethodEmptyParameter.TESTEDCLASSNAME); - - //methods - MethodExpect emptyMethodParameter = new MethodExpect("emptyMethodParameter",new RefType("void",-1)); - emptyMethodParameter.addParameter(new VarExpect("a",new RefType("java.lang.Integer",-1))); - - MethodExpect emptyMethodParameter2 = new MethodExpect("emptyMethodParameter2",new RefType("void",-1)); - emptyMethodParameter2.addParameter(new VarExpect("a",new RefType("java.lang.Boolean",-1))); - emptyMethodParameter2.addParameter(new VarExpect("b",new RefType("java.lang.Integer",-1))); - - MethodExpect emptyMethodParameter3 = new MethodExpect("emptyMethodParameter3",new RefType("void",-1)); - emptyMethodParameter2.addParameter(new VarExpect("a",new GenericTypeVarExpect("a"))); - emptyMethodParameter2.addParameter(new VarExpect("b",new GenericTypeVarExpect("b"))); - - testEmptyMethodParameter.addMethod(emptyMethodParameter); - testEmptyMethodParameter.addMethod(emptyMethodParameter2); - testEmptyMethodParameter.addMethod(emptyMethodParameter3); - - return new Expectation(testEmptyMethodParameter); - } - -} diff --git a/test/mycompiler/test/trivial/TestMethodEmptyParameterGenericExtends.jav b/test/mycompiler/test/trivial/TestMethodEmptyParameterGenericExtends.jav deleted file mode 100755 index 369661ac9..000000000 --- a/test/mycompiler/test/trivial/TestMethodEmptyParameterGenericExtends.jav +++ /dev/null @@ -1,9 +0,0 @@ - -public class TestMethodEmptyParameterGenericExtends{ - - emptyMethodGenericExtends2(T a) { - } - - emptyMethodGenericExtends3(T a, S b) { - } -} \ No newline at end of file diff --git a/test/mycompiler/test/trivial/TestMethodEmptyParameterGenericExtends.java b/test/mycompiler/test/trivial/TestMethodEmptyParameterGenericExtends.java deleted file mode 100755 index cfd0ef827..000000000 --- a/test/mycompiler/test/trivial/TestMethodEmptyParameterGenericExtends.java +++ /dev/null @@ -1,53 +0,0 @@ -package mycompiler.test.trivial; - -import de.dhbwstuttgart.typeinference.Menge; - -import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import mycompiler.test.AbstractInferenceTest; -import mycompiler.test.expectationTypes.ClassExpect; -import mycompiler.test.expectationTypes.Expectation; -import mycompiler.test.expectationTypes.MethodExpect; -import mycompiler.test.expectationTypes.VarExpect; - -public class TestMethodEmptyParameterGenericExtends extends AbstractInferenceTest { - - - private final static String TESTEDCLASSNAME="TestMethodEmptyParameterGenericExtends"; - private final static String JAVPATH="test/mycompiler/test/trivial/"; - - public TestMethodEmptyParameterGenericExtends(String name) { - super(name,TestMethodEmptyParameterGenericExtends.JAVPATH+TestMethodEmptyParameterGenericExtends.TESTEDCLASSNAME + ".jav"); - - } - - @Override - protected Expectation getExpectations() { - ClassExpect testEmptyMethodParameterGenericExtends = new ClassExpect(TestMethodEmptyParameterGenericExtends.TESTEDCLASSNAME); - - //methods - MethodExpect m1 = new MethodExpect("emptyMethodGenericExtends2",new RefType("void",-1)); - Menge bounds1 = new Menge(); - bounds1.add(new RefType("java.lang.Number",-1)); - m1.addGeneric(new BoundedGenericTypeVar("T",bounds1,-1)); - m1.addParameter(new VarExpect("a",new BoundedGenericTypeVar("T",bounds1,-1))); - - MethodExpect m2 = new MethodExpect("emptyMethodGenericExtends3",new RefType("void",-1)); - Menge bounds2 = new Menge(); - bounds2.add(new RefType("java.lang.Number",-1)); - m2.addGeneric(new GenericTypeVar("T",-1)); - m2.addGeneric(new BoundedGenericTypeVar("S",bounds2,-1)); - m2.addParameter(new VarExpect("a",new GenericTypeVar("T",-1))); - m2.addParameter(new VarExpect("b",new BoundedGenericTypeVar("S",bounds2,-1))); - - - testEmptyMethodParameterGenericExtends.addMethod(m1); - testEmptyMethodParameterGenericExtends.addMethod(m2); - - return new Expectation(testEmptyMethodParameterGenericExtends); - } - - -} diff --git a/test/mycompiler/test/unittest/typeReconstructionTest/TrAlgorithmTestSuite.java b/test/mycompiler/test/unittest/typeReconstructionTest/TrAlgorithmTestSuite.java deleted file mode 100755 index 25c232c28..000000000 --- a/test/mycompiler/test/unittest/typeReconstructionTest/TrAlgorithmTestSuite.java +++ /dev/null @@ -1,26 +0,0 @@ -package mycompiler.test.unittest.typeReconstructionTest; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class TrAlgorithmTestSuite { - /** - * JUnit Tests for main type reconstruction algorithms - */ - - public static Test suite() { - - TestSuite trAlgoSuite = new TestSuite("TR Testsuite"); - - //trMakeFCTest - trAlgoSuite.addTest(new TrMakeFCTest("testAllMakeFC")); - trAlgoSuite.addTest(new TrMakeFCTest("testTrivialMakeFC")); - - //trUnify - trAlgoSuite.addTestSuite(TrSubUnifyTest.class); - //trAlgoSuite.addTest(TrMakeFCTest.suite()); - - return trAlgoSuite; - } - -} diff --git a/test/mycompiler/test/unittest/typeReconstructionTest/TrMakeFCTest.java b/test/mycompiler/test/unittest/typeReconstructionTest/TrMakeFCTest.java deleted file mode 100755 index f516cc976..000000000 --- a/test/mycompiler/test/unittest/typeReconstructionTest/TrMakeFCTest.java +++ /dev/null @@ -1,178 +0,0 @@ -package mycompiler.test.unittest.typeReconstructionTest; - -import de.dhbwstuttgart.typeinference.Menge; - -import junit.framework.TestCase; - -import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.logger.xml.DOMConfigurator; - -import de.dhbwstuttgart.syntaxtree.Class; -import de.dhbwstuttgart.syntaxtree.ClassBody; -import de.dhbwstuttgart.syntaxtree.Interface; -import de.dhbwstuttgart.syntaxtree.SourceFile; -import de.dhbwstuttgart.syntaxtree.misc.UsedId; -import de.dhbwstuttgart.syntaxtree.modifier.Modifiers; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import de.dhbwstuttgart.typeinference.Pair; -import de.dhbwstuttgart.typeinference.unify.FC_TTO; - -public class TrMakeFCTest extends TestCase{ - - /* makeFC() is not being tested according to unit test specs -> used objects cannot be mocked*/ - - private static Logger testlog = Logger.getLogger("trtest"); - private SourceFile src=null; - private FC_TTO expected=null; - - public TrMakeFCTest(String name) { - super(name); - DOMConfigurator.configure("log4j.xml"); //maybe subject to asserts -> mocking - DOMConfigurator.configure("test/log4jTesting.xml"); - } - - public void setUp() { - this.src=new SourceFile(); - - } - - public void tearDown() { - this.src=null; - } - - public void testTrivialMakeFC() { - //only classes, no inheritance, no parameters - - testlog.info("----------testTrivilialMakeFC-----------"); - //start environment - //Classes - for (int i=0;i<3;i++) - this.src.addElement(new Class("Test"+i,new Modifiers(),new ClassBody(),new Menge(),null,null,new Menge(),null)); - //Interfaces - for (int i=0;i<3;i++) - this.src.addElement(new Interface("ITest"+i,new Modifiers())); - - //expected result - Menge fc = new Menge(); - //fc.add(new Pair(new RefType("Test",-1),new RefType("",-1))); - Menge tto=(Menge)fc.clone(); - expected = new FC_TTO(fc,tto,this.src.KlassenVektor); - testlog.debug("Test-Setup: " + this.src.KlassenVektor); - - //call tested method - FC_TTO ret = this.src.makeFC(); - testlog.debug("expected: "+expected.getFC()); - testlog.debug("returned: "+ret.getFC()); - - //compare results - TrMakeFCTest.assertEquals(expected.getFC(), ret.getFC()); - TrMakeFCTest.assertEquals(expected.getTTO(),ret.getTTO()); - TrMakeFCTest.assertEquals(expected.getClasses(),ret.getClasses()); - } - - public void testAllMakeFC() { - //white box: all branches of makeFC are being touched - testlog.info("----------testAllMakeFC----------"); - //start environment - //(1) class AbstractList{} - //(2) class Vektor extends AbstractList{} - //(3) class Matrix extends Vektor>{} - //(4) class ExMatrix extends Matrix{} - - //Interface - //(1) - GenericTypeVar gtv_a = new GenericTypeVar("A",20); - Menge paralist = new Menge(); - paralist.add(gtv_a); - Interface abstractlist = new Interface("AbstractList"); - abstractlist.setParaList(paralist); - this.src.addElement(abstractlist); - - //Classes with superclasses - //(1) -// GenericTypeVar param = new GenericTypeVar("A",20); -// Menge paralist = new Menge(); -// paralist.add(param); -// Class abstractlist = new Class("AbstractList",new Modifiers(),new ClassBody(),new Menge(),null,null,new Menge(),paralist); -// this.src.addElement(abstractlist); - //(2) - UsedId superclass = new UsedId(1); - superclass.set_Name(abstractlist.getName()); - Menge paralist2=abstractlist.getParaList(); - superclass.set_ParaList(paralist2); - //implements AbstractList - Menge superif = new Menge(); - superif.add(superclass); - Class vektor= new Class("Vektor",new Modifiers(),new ClassBody(),new Menge(),null,null,superif,paralist); - this.src.addElement(vektor); - //(3) - UsedId superclass2 = new UsedId(2); - superclass2.set_Name(vektor.getName()); - RefType param2 = new RefType("Vektor",paralist,20); - Menge paralist3 = new Menge(); - paralist3.add(param2); - superclass2.set_ParaList(paralist3); - Class matrix = new Class("Matrix",new Modifiers(), new ClassBody(), new Menge(),null,superclass2,new Menge(),paralist); - this.src.addElement(matrix); - - //(4) - UsedId superclass3 = new UsedId(3); - superclass3.set_Name(matrix.getName()); - superclass3.set_ParaList(matrix.get_ParaList()); - Class exmatrix = new Class("ExMatrix", new Modifiers(), new ClassBody(), new Menge(),null,superclass3, new Menge(),paralist); - this.src.addElement(exmatrix); - //Interfaces - - testlog.debug("Test-Setup: " + this.src.KlassenVektor); - - - - //expected Result - GenericTypeVar gtv = new GenericTypeVar("A",20); - Menge gtvparameter = new Menge(); - gtvparameter.add(gtv); - - RefType vektortype = new RefType("Vektor",gtvparameter,-1); - RefType abstractlisttype = new RefType("AbstractList",gtvparameter,-1); - RefType matrixtype = new RefType("Matrix",gtvparameter,-1); - RefType exmatrixtype = new RefType("ExMatrix",gtvparameter,-1); - - Menge vektorparameter = new Menge(); - vektorparameter.add(vektortype); - - Menge fc = new Menge(); - // set "=" - fc.add(new Pair(vektortype,abstractlisttype)); - fc.add(new Pair(matrixtype,new RefType("Vektor",vektorparameter,-1))); - fc.add(new Pair(exmatrixtype,matrixtype)); - - Menge tto=(Menge)fc.clone(); - // set "=*" - fc.add(new Pair(matrixtype,new RefType("AbstractList",vektorparameter,-1))); - fc.add(new Pair(exmatrixtype,new RefType("Vektor",vektorparameter,-1))); - fc.add(new Pair(exmatrixtype,new RefType("AbstractList",vektorparameter,-1))); - - expected = new FC_TTO(fc,tto,this.src.KlassenVektor); - - //call tested method - FC_TTO ret = this.src.makeFC(); - - testlog.debug("expected: "+expected.getFC()); - testlog.debug("returned: "+ret.getFC());; - - //compare results - TrMakeFCTest.assertEquals(expected.getFC(), ret.getFC()); - TrMakeFCTest.assertEquals(expected.getTTO(),ret.getTTO()); - TrMakeFCTest.assertEquals(expected.getClasses(),ret.getClasses()); - } - - /*public static Test suite() { - TestSuite thisch = new TestSuite("TrMakeFCTest"); - - thisch.addTest(new TrMakeFCTest("testTrivialMakeFC")); - thisch.addTest(new TrMakeFCTest("testAllMakeFC")); - return thisch; - }*/ -} diff --git a/test/mycompiler/test/unittest/typeReconstructionTest/TrSubUnifyTest.java b/test/mycompiler/test/unittest/typeReconstructionTest/TrSubUnifyTest.java deleted file mode 100755 index bdde2e517..000000000 --- a/test/mycompiler/test/unittest/typeReconstructionTest/TrSubUnifyTest.java +++ /dev/null @@ -1,636 +0,0 @@ -package mycompiler.test.unittest.typeReconstructionTest; - - -import de.dhbwstuttgart.typeinference.Menge; - -import junit.framework.TestCase; - -import de.dhbwstuttgart.logger.Logger; -import de.dhbwstuttgart.logger.xml.DOMConfigurator; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; - -import de.dhbwstuttgart.syntaxtree.Class; -import de.dhbwstuttgart.syntaxtree.ClassBody; -import de.dhbwstuttgart.syntaxtree.Interface; -import de.dhbwstuttgart.syntaxtree.SourceFile; -import de.dhbwstuttgart.syntaxtree.misc.UsedId; -import de.dhbwstuttgart.syntaxtree.modifier.Modifiers; -import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -import de.dhbwstuttgart.typeinference.Pair; -import de.dhbwstuttgart.typeinference.Pair.PairOperator; -import de.dhbwstuttgart.typeinference.unify.FC_TTO; -import de.dhbwstuttgart.typeinference.unify.Unify; - -/*TODO: - mock makeFC and needs to be relocated (now called for every test) - * - erase2 -> FreshWildcardType?? - * - reduce2 wird niemals verwendet!!! <-> erase3 - * - reduce 1/2,... werfen exceptions, die gefangen werden -> schwer testbar, wäre aber vllt sinnvoll - * - adapts not implemented - */ - -public class TrSubUnifyTest extends TestCase{ - - private static Logger testlog = Logger.getLogger("trtest"); - private FC_TTO fc=null; - private FC_TTO fcWithPara=null; - - public TrSubUnifyTest(String name) { - super(name); - DOMConfigurator.configure("test/log4jTesting.xml"); - DOMConfigurator.configure("log4j.xml"); - this.fcWithPara = constructFCwithParams(); - this.fc=constructFC(); - - } - - private FC_TTO constructFC() { - //constructs FC according to the following Environment - //however uses real makeFC up until now - //environment - //(1) interface A - //(2) class B implements A - //(3) class C extends B - - SourceFile src=new SourceFile(); - - //(1) - Interface a = new Interface("A"); - src.addElement(a); - - //(2) - UsedId superclass = new UsedId(1); - superclass.set_Name(a.getName()); - Menge superif = new Menge(); - superif.add(superclass); - Class b= new Class("B",new Modifiers(),new ClassBody(),new Menge(),null,null,superif,null); - src.addElement(b); - //(3) - UsedId superclass2 = new UsedId(2); - superclass2.set_Name(b.getName()); - Class c = new Class("C",new Modifiers(), new ClassBody(), new Menge(),null,superclass2,new Menge(),null); - src.addElement(c); - FC_TTO fca = src.makeFC(); - testlog.info(fca.getTTO()); - return fca; - - } - - private FC_TTO constructFCwithParams() { - //constructs FC according to the following Environment - //however uses real makeFC up until now - //environment - //(1) interface AbstractList{} - //(2) class Vektor extends AbstractList{} - //(3) class Matrix extends Vektor>{} - //(4) class ExMatrix extends Matrix{} - - SourceFile src=new SourceFile(); - - //Interface - //(1) - GenericTypeVar gtv_a = new GenericTypeVar("A",20); - Menge paralist = new Menge(); - paralist.add(gtv_a); - Interface abstractlist = new Interface("AbstractList"); - abstractlist.setParaList(paralist); - src.addElement(abstractlist); - - //Classes with superclasses - //(1) (either as a class or as an interface -// GenericTypeVar param = new GenericTypeVar("A",20); -// Menge paralist = new Menge(); -// paralist.add(param); -// Class abstractlist = new Class("AbstractList",new Modifiers(),new ClassBody(),new Menge(),null,null,new Menge(),paralist); -// this.src.addElement(abstractlist); - //(2) - UsedId superclass = new UsedId(1); - superclass.set_Name(abstractlist.getName()); - Menge paralist2=abstractlist.getParaList(); - superclass.set_ParaList(paralist2); - //implements AbstractList - Menge superif = new Menge(); - superif.add(superclass); - Class vektor= new Class("Vektor",new Modifiers(),new ClassBody(),new Menge(),null,null,superif,paralist); - src.addElement(vektor); - //(3) - UsedId superclass2 = new UsedId(2); - superclass2.set_Name(vektor.getName()); - RefType param2 = new RefType("Vektor",paralist,20); - Menge paralist3 = new Menge(); - paralist3.add(param2); - superclass2.set_ParaList(paralist3); - Class matrix = new Class("Matrix",new Modifiers(), new ClassBody(), new Menge(),null,superclass2,new Menge(),paralist); - src.addElement(matrix); - - //(4) - UsedId superclass3 = new UsedId(3); - superclass3.set_Name(matrix.getName()); - superclass3.set_ParaList(matrix.get_ParaList()); - Class exmatrix = new Class("ExMatrix", new Modifiers(), new ClassBody(), new Menge(),null,superclass3, new Menge(),paralist); - src.addElement(exmatrix); - return src.makeFC(); - } - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - - //erase - -// public void testSubUnifyErase1() { -// //setup - see constructFC() -// //(1){ B <* A} -> {} -// //(2){ C <* A} -> {} -// //(3){ C <* B} -> {} -// testlog.info("-------testSubUnifyErase1---------"); -// //Type 1 -// Type ty1 = new RefType("A",-1); -// -// //Type2 -// Type ty2 = new RefType("B",-1); -// -// //Type3 -// Type ty3 = new RefType("C",-1); -//testlog.debug("Test-Setup: " + ty2 + " -> " + ty1); -//testlog.debug("Test-Setup: " + ty3 + " -> " + ty1); -//testlog.debug("Test-Setup: " + ty3 + " -> " + ty2); -// -// //expected -// Menge expected = new Menge(); -//testlog.debug("expected: " + expected); -// -// //actual -// //(1) -// Menge types1 = new Menge(); -// types1.add(new Pair(ty2,ty1,PairOperator.Smaller)); -// //(2) -// Menge types2 = new Menge(); -// types2.add(new Pair(ty3,ty1,PairOperator.Smaller)); -// //(3) -// Menge types3 = new Menge(); -// types3.add(new Pair(ty3,ty2,PairOperator.Smaller)); -// //execution of tested method -// Menge ret1 = Unify.sub_unify(types1 ,fc); -// Menge ret2 = Unify.sub_unify(types2 ,fc); -// Menge ret3 = Unify.sub_unify(types3 ,fc); -// //comparisons -//testlog.debug("returned: "+ ret1); -//testlog.debug("returned: "+ ret2); -//testlog.debug("returned: "+ ret3); -// TrMakeFCTest.assertEquals("erase1a",expected.toString(), ret1.toString()); -// TrMakeFCTest.assertEquals("erase1b",expected.toString(), ret2.toString()); -// TrMakeFCTest.assertEquals("erase1c",expected.toString(), ret3.toString()); -// } -// -// public void testSubUnifyErase2() { -//testlog.info("-------testSubUnifyErase2---------"); -// //setup - see constructFC() -// //(1){ B <*? extends A} -> {} -// //(2){ C <*? super A} -> {} -// //(3){ C <* B} -> {} <- TODO FreshWildCards???? -// //Type 1 -// Type ty1 = new ExtendsWildcardType(-1, new RefType("A",-1)); -// -// //Type2 -// Type ty2 = new RefType("B",-1); -// -// //Type3 -// Type ty3 = new SuperWildcardType(-1, new RefType("C",-1)); -//testlog.debug("Test-Setup: " + ty2 + " -> extends " + ty1); -//testlog.debug("Test-Setup: " + ty2 + " -> super " + ty3); -////testlog.debug("Test-Setup: " + ty3 + " -> " + ty2); -// -// //expected -// Menge expected = new Menge(); -//testlog.debug("expected: " + expected); -// -// //actual -// //(1) -// Menge types1 = new Menge(); -// types1.add(new Pair(ty2,ty1,PairOperator.SmallerExtends)); -// //(2) -// Menge types2 = new Menge(); -// types2.add(new Pair(ty2,ty3,PairOperator.SmallerExtends)); -// //(3) -//// Menge types3 = new Menge(); -//// types3.add(new Pair(ty3,ty2,PairOperator.SmallerExtends)); -// //execution of tested method -// Menge ret1 = Unify.sub_unify(types1 ,fc); -// Menge ret2 = Unify.sub_unify(types2 ,fc); -//// Menge ret3 = Unify.sub_unify(types3 ,fc); -// //comparisons -//testlog.debug("returned: "+ ret1); -//testlog.debug("returned: "+ ret2); -////testlog.info("returned: "+ ret3); -// TrMakeFCTest.assertEquals("erase2a",expected.toString(), ret1.toString()); -// TrMakeFCTest.assertEquals("erase2b",expected.toString(), ret2.toString()); -//// TrMakeFCTest.assertEquals("erase2c",expected.toString(), ret3.toString()); -// } -// -// public void testSubUnifyErase3() { -// //{ A = B} -> {} -//testlog.info("-------testSubUnifyErase3---------"); -// //Type 1 -// Type ty1 = new RefType("A",-1); -// -// //Type2 -// Type ty2 = new RefType("A",-1); -//testlog.debug("Test-Setup: " + ty1 + " -> " + ty2); -// -// //expected -// Menge expected = new Menge(); -// //expected.add(new Pair(ty1,ty2,PairOperator.Equal)); -//testlog.debug("expected: " + expected); -// -// //actual -// //execution of tested method -// Menge types = new Menge(); -// types.add(new Pair(ty1,ty2,PairOperator.Equal)); -// Menge ret = Unify.sub_unify(types ,fc); -//testlog.debug("returned: "+ ret); -// //comparison -// TrMakeFCTest.assertEquals("erase3",expected.toString(), ret.toString()); -// } -// -// //swap -// -// public void testSubUnifySwap() { -// //{ A = TypePlaceholder a} -> {a = A} -// //A can be: RefType, GenericTypeVar, WildcardType -//testlog.info("-------testSubUnifySwap---------"); -// //Type 1 -// Type ty1a = new RefType("A",-1); -// Type ty1b = new GenericTypeVar("B",-1); -// Type ty1c = new SuperWildcardType(-1,new RefType("C",-1)); -// Type ty1d = new ExtendsWildcardType(-1, new RefType("D",-1)); -// -// //Type2 -// Type ty2a = TypePlaceholder.fresh(); -// Type ty2b = TypePlaceholder.fresh(); -// Type ty2c = TypePlaceholder.fresh(); -// Type ty2d = TypePlaceholder.fresh(); -// -//testlog.debug("Test-Setup: " + ty1a + " = " + ty2a + "; "); -//testlog.debug(ty1b + " = " + ty2b + "; "); -//testlog.debug(ty1c + " = " + ty2c + "; "); -//testlog.debug(ty1d + " = " + ty2d + "; "); -// -// //expected -// Menge expected = new Menge(); -// expected.add(new Pair(ty2a,ty1a,PairOperator.Equal)); -// expected.add(new Pair(ty2b,ty1b,PairOperator.Equal)); -// expected.add(new Pair(ty2c,ty1c,PairOperator.Equal)); -// expected.add(new Pair(ty2d,ty1d,PairOperator.Equal)); -//testlog.debug("expected: " + expected); -// -// //actual -// //execution of tested method -// Menge types = new Menge(); -// types.add(new Pair(ty1a,ty2a,PairOperator.Equal)); -// types.add(new Pair(ty1b,ty2b,PairOperator.Equal)); -// types.add(new Pair(ty1c,ty2c,PairOperator.Equal)); -// types.add(new Pair(ty1d,ty2d,PairOperator.Equal)); -// Menge ret = Unify.sub_unify(types ,fc); -//testlog.debug("returned: "+ ret); -// //comparison -// TrMakeFCTest.assertEquals("swap",expected.toString(), ret.toString()); -// } -// -// //adapt -// public void testSubUnifyAdapt() { -// //adapt-meaning of test unclear -// // -//testlog.info("-------testSubUnifyAdapt---------"); -// //Type 1 -// //Parameter -// Menge paramAa = new Menge(); -// paramAa.add(new RefType("java.lang.Integer",-1)); -// paramAa.add(TypePlaceholder.fresh()); -// //paramAa.add(TypePlaceholder.fresh()); -// Menge paramAb = new Menge(); -// paramAb.add(new RefType("Vektor",paramAa,-1)); -// Type ty1 = new RefType("Vektor",paramAa,-1); -// -// //Type2 -// Menge paramB = new Menge(); -// //paramB.add(new RefType("java.lang.Number",-1)); -// paramB.add(TypePlaceholder.fresh()); -// Type ty2 = new RefType("AbstractList",paramB,-1); -// -// testlog.debug("Test-Setup: " + ty1 + " -> " + ty2); -// -// //expected -// Menge expected = new Menge(); -//// for (int i = 0;i types = new Menge(); -// types.add(new Pair(ty1,ty2,PairOperator.Smaller)); -// Menge ret = Unify.sub_unify(types ,fcWithPara); -// testlog.debug("returned: "+ ret); -// //comparison -// TrMakeFCTest.assertEquals("adapt",expected.toString(), ret.toString()); -//// fail("not correctly implemented"); -// } -// -// -// //reduce -// -// public void testSubUnfiyReduceLow() { -// //{?extends A < B} -> {A < B} -// //setup - unification of two types -//testlog.info("-------testSubUnifyReduceLow---------"); -// //Type 1 -// Type ty1 = new ExtendsWildcardType(-1,new RefType("A",-1)); -// -// //Type2 -// Type ty2 = new RefType("B",-1); -//testlog.debug("Test-Setup: " + ty1 + " -> " + ty2); -// -// //expected -// Menge expected = new Menge(); -// expected.add(new Pair(((ExtendsWildcardType)ty1).get_ExtendsType(),ty2,PairOperator.Smaller)); -//testlog.debug("expected: " + expected); -// -// //actual -// //execution of tested method -// Menge types = new Menge(); -// types.add(new Pair(ty1,ty2,PairOperator.Smaller)); -// Menge ret = Unify.sub_unify(types ,fc); -//testlog.debug("returned: "+ ret); -// //comparison -// TrMakeFCTest.assertEquals("reduceLow",expected.toString(), ret.toString()); -// } -// -// public void testSubUnifyReduceUp() { -// //{A {A < B} -// //setup - unification of two types -//testlog.info("-------testSubUnifyReduceUp---------"); -// //Type 1 -// Type ty1 = new RefType("A",-1); -// -// //Type2 -// Type ty2 = new SuperWildcardType(-1, new RefType("B",-1)); -//testlog.debug("Test-Setup: " + ty1 + " -> " + ty2); -// -// //expected -// Menge expected = new Menge(); -// expected.add(new Pair(ty1,((SuperWildcardType)ty2).get_SuperType(),PairOperator.Smaller)); -//testlog.debug("expected: " + expected); -////ReduceU -// //actual -// //execution of tested method -// Menge types = new Menge(); -// types.add(new Pair(ty1,ty2,PairOperator.Smaller)); -// Menge ret = Unify.sub_unify(types ,fc); -//testlog.debug("returned: "+ ret); -// //comparison -// TrMakeFCTest.assertEquals("reduceUp",expected.toString(), ret.toString()); -// } -// -// public void testSubUnifyReduceUpLow() { -// //{?extends A {A < B} -// //setup - unification of two types -//testlog.info("-------testSubUnifyReduceUpLow---------"); -// //Type 1 -// Type ty1 = new ExtendsWildcardType(-1,new RefType("A",-1)); -// -// //Type2 -// Type ty2 = new SuperWildcardType(-1, new RefType("B",-1)); -//testlog.debug("Test-Setup: " + ty1 + " -> " + ty2); -// -// //expected -// Menge expected = new Menge(); -// expected.add(new Pair(((ExtendsWildcardType)ty1).get_ExtendsType(),((SuperWildcardType)ty2).get_SuperType(),PairOperator.Smaller)); -//testlog.debug("expected: " + expected); -// -// //actual -// //execution of tested method -// Menge types = new Menge(); -// types.add(new Pair(ty1,ty2,PairOperator.Smaller)); -// Menge ret = Unify.sub_unify(types ,fc); -//testlog.debug("returned: "+ ret); -// //comparison -// TrMakeFCTest.assertEquals("reduceUpLow",expected.toString(), ret.toString()); -// } -// -// public void testSubUnifyReduce1() { -// //{Vektor < AbstractList -> {a paramA = new Menge(); -// paramA.add(TypePlaceholder.fresh()); -// Type ty1 = new RefType("Vektor",paramA,-1); -// -// //Type2 -// Menge paramB = new Menge(); -// paramB.add(TypePlaceholder.fresh()); -// Type ty2 = new RefType("AbstractList",paramB,-1); -// -//testlog.debug("Test-Setup: " + ty1 + " -> " + ty2); -// -// //expected -// Menge expected = new Menge(); -// for (int i = 0;i types = new Menge(); -// types.add(new Pair(ty1,ty2,PairOperator.Smaller)); -// Menge ret = Unify.sub_unify(types ,fcWithPara); -//testlog.debug("returned: "+ ret); -// //comparison -// TrMakeFCTest.assertEquals("reduce1",expected.toString(), ret.toString()); -// } -// - public void testSubUnifyReduce2() { - - //!!!! Fall tritt niemals ein - //Vor: type1 = type2 wird vorher schon gefangen - - //{A = A -> {a=d,b=e,c=f} - //setup - unification of two types -testlog.info("-------testSubUnifyReduce2---------"); - //Type 1 - //Parameter - Menge paramA = new Menge(); - paramA.add(new GenericTypeVar("a",-1)); - paramA.add(new GenericTypeVar("b",-1)); - paramA.add(new GenericTypeVar("c",-1)); - Type ty1 = new RefType("A",paramA,-1); - - //Type2 - Menge paramB = new Menge(); - paramB.add(new GenericTypeVar("d",-1)); - paramB.add(new GenericTypeVar("e",-1)); - paramB.add(new GenericTypeVar("f",-1)); - Type ty2 = new RefType("A",paramB,-1); - -testlog.debug("Test-Setup: " + ty1 + " -> " + ty2); - - //expected - Menge expected = new Menge(); - for (int i = 0;i types = new Menge(); - types.add(new Pair(ty1,ty2,PairOperator.Equal)); - Menge ret = Unify.sub_unify(types ,fc); -testlog.debug("returned: "+ ret); - //comparison - TrMakeFCTest.assertEquals("reduce2",expected.toString(), ret.toString()); - } -// -// public void testSubUnifyReduceExt() { -// //a: {Vektor -> {a -> {a paramA = new Menge(); -// paramA.add(TypePlaceholder.fresh()); -// Type ty1a = new RefType("Vektor",paramA,-1); -// Type ty1b = new ExtendsWildcardType(-1, new RefType("Vektor",paramA,-1)); -// -// //Type2 -// Menge paramB = new Menge(); -// paramB.add(TypePlaceholder.fresh()); -// Type ty2 = new ExtendsWildcardType(-1,new RefType("AbstractList",paramB,-1)); -// -//testlog.debug("Test-Setup: " + ty1a + " -> " + ty2 + "; " + ty1b + " -> " + ty2); -// -// //expected -// Menge expected = new Menge(); -// for (int i = 0;i typesa = new Menge(); -// typesa.add(new Pair(ty1a,ty2,PairOperator.SmallerExtends)); -// Menge reta = Unify.sub_unify(typesa ,fcWithPara); -// //b -// Menge typesb = new Menge(); -// typesb.add(new Pair(ty1b,ty2,PairOperator.SmallerExtends)); -// Menge retb = Unify.sub_unify(typesb ,fcWithPara); -// -//testlog.debug("returned: "+ reta); -//testlog.debug("returned: "+ retb); -// //comparison -// TrMakeFCTest.assertEquals("reduceExt",expected.toString(), reta.toString()); -// TrMakeFCTest.assertEquals("reduceExt",expected.toString(), retb.toString()); -// } -// -// public void testSubUnifyReduceSup() { -// //a: {Vektor -> {a -> {a paramA = new Menge(); -// paramA.add(TypePlaceholder.fresh()); -// Type ty1a = new RefType("AbstractList",paramA,-1); -// Type ty1b = new SuperWildcardType(-1, new RefType("AbstractList",paramA,-1)); -// -// //Type2 -// Menge paramB = new Menge(); -// paramB.add(TypePlaceholder.fresh()); -// Type ty2 = new SuperWildcardType(-1,new RefType("Vektor",paramB,-1)); -// -//testlog.debug("Test-Setup: " + ty1a + " -> " + ty2 + "; " + ty1b + " -> " + ty2); -// -// //expected -// Menge expected = new Menge(); -// for (int i = 0;i typesa = new Menge(); -// typesa.add(new Pair(ty1a,ty2,PairOperator.SmallerExtends)); -// Menge reta = Unify.sub_unify(typesa ,fcWithPara); -// //b -// Menge typesb = new Menge(); -// typesb.add(new Pair(ty1b,ty2,PairOperator.SmallerExtends)); -// Menge retb = Unify.sub_unify(typesb ,fcWithPara); -// -//testlog.debug("returned: "+ reta); -//testlog.debug("returned: "+ retb); -// //comparison -// TrMakeFCTest.assertEquals("reduceSup",expected.toString(), reta.toString()); -// TrMakeFCTest.assertEquals("reduceSup",expected.toString(), retb.toString()); -// } -// -// public void testSubUnfiyReduceEq() { -// //{Vektor -> {a=d, b=e, c=f} -//System.out.println("-------testSubUnifyReduceEq---------"); -// //Type 1 -// //Parameter -// Menge paramA = new Menge(); -// paramA.add(TypePlaceholder.fresh()); -// paramA.add(TypePlaceholder.fresh()); -// paramA.add(TypePlaceholder.fresh()); -// Type ty1 = new RefType("Vektor",paramA,-1); -// -// //Type2 -// Menge paramB = new Menge(); -// paramB.add(TypePlaceholder.fresh()); -// paramB.add(TypePlaceholder.fresh()); -// paramB.add(TypePlaceholder.fresh()); -// Type ty2 = new RefType("Vektor",paramB,-1); -// -//testlog.debug("Test-Setup: " + ty1 + " ->? " + ty2); -// -// //expected -// Menge expected = new Menge(); -// for (int i = 0;i types = new Menge(); -// types.add(new Pair(ty1,ty2,PairOperator.SmallerExtends)); -// Menge ret = Unify.sub_unify(types ,fcWithPara); -//testlog.debug("returned: "+ ret); -// //comparison -// TrMakeFCTest.assertEquals("reduceEq",expected.toString(), ret.toString()); -// } - -} diff --git a/test/mycompiler/test/unittest/typeReconstructionTest/TrUnifyTest.java b/test/mycompiler/test/unittest/typeReconstructionTest/TrUnifyTest.java deleted file mode 100755 index 01b948e80..000000000 --- a/test/mycompiler/test/unittest/typeReconstructionTest/TrUnifyTest.java +++ /dev/null @@ -1,177 +0,0 @@ -package mycompiler.test.unittest.typeReconstructionTest; - -import de.dhbwstuttgart.typeinference.Menge; - -import junit.framework.TestCase; - -import de.dhbwstuttgart.logger.xml.DOMConfigurator; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import de.dhbwstuttgart.syntaxtree.Class; -import de.dhbwstuttgart.syntaxtree.ClassBody; -import de.dhbwstuttgart.syntaxtree.Interface; -import de.dhbwstuttgart.syntaxtree.SourceFile; -import de.dhbwstuttgart.syntaxtree.misc.UsedId; -import de.dhbwstuttgart.syntaxtree.modifier.Modifiers; -import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -import de.dhbwstuttgart.typeinference.Pair; -import de.dhbwstuttgart.typeinference.Pair.PairOperator; -import de.dhbwstuttgart.typeinference.unify.FC_TTO; -import de.dhbwstuttgart.typeinference.unify.Unify; - -public class TrUnifyTest extends TestCase { - - FC_TTO fc=null; - - public TrUnifyTest(String name) { - super(name); - DOMConfigurator.configure("log4j.xml"); //maybe subject to asserts -> mocking - this.fc = constructFC(); - - } - public void setUpBeforeClass() { - System.out.println("test"); - } - - private FC_TTO constructFC() { - SourceFile src=new SourceFile(); - - //environment - //(1) interface AbstractList{} - //(2) class Vektor extends AbstractList{} - //(3) class Matrix extends Vektor>{} - //(4) class ExMatrix extends Matrix{} - - //Interface - //(1) - GenericTypeVar gtv_a = new GenericTypeVar("A",20); - Menge paralist = new Menge(); - paralist.add(gtv_a); - Interface abstractlist = new Interface("AbstractList"); - abstractlist.setParaList(paralist); - src.addElement(abstractlist); - - //Classes with superclasses - //(1) (either as a class or as an interface -// GenericTypeVar param = new GenericTypeVar("A",20); -// Menge paralist = new Menge(); -// paralist.add(param); -// Class abstractlist = new Class("AbstractList",new Modifiers(),new ClassBody(),new Menge(),null,null,new Menge(),paralist); -// this.src.addElement(abstractlist); - //(2) - UsedId superclass = new UsedId(1); - superclass.set_Name(abstractlist.getName()); - Menge paralist2=abstractlist.getParaList(); - superclass.set_ParaList(paralist2); - //implements AbstractList - Menge superif = new Menge(); - superif.add(superclass); - Class vektor= new Class("Vektor",new Modifiers(),new ClassBody(),new Menge(),null,null,superif,paralist); - src.addElement(vektor); - //(3) - UsedId superclass2 = new UsedId(2); - superclass2.set_Name(vektor.getName()); - RefType param2 = new RefType("Vektor",paralist,20); - Menge paralist3 = new Menge(); - paralist3.add(param2); - superclass2.set_ParaList(paralist3); - Class matrix = new Class("Matrix",new Modifiers(), new ClassBody(), new Menge(),null,superclass2,new Menge(),paralist); - src.addElement(matrix); - - //(4) - UsedId superclass3 = new UsedId(3); - superclass3.set_Name(matrix.getName()); - superclass3.set_ParaList(matrix.get_ParaList()); - Class exmatrix = new Class("ExMatrix", new Modifiers(), new ClassBody(), new Menge(),null,superclass3, new Menge(),paralist); - src.addElement(exmatrix); - return src.makeFC(); - } - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - //Java-Types without respect to FC (java types) - public void testUnifytesting() { - //setup - unification of two types - //Type 1 - TypePlaceholder th1 = TypePlaceholder.fresh(); - // TypePlaceholder ty2 = TypePlaceholder.fresh(); - Menge param = new Menge(); - //param.add(new GenericTypeVar("A",-1)); - param.add(th1); - - Menge param2 = new Menge(); - param2.add(new RefType("B",-1)); - Menge param1 = new Menge(); - param1.add(new RefType("Vektor",param2,-1)); - Type ty1 = new RefType("Vektor",param,-1); - // ty1.replaceWithType(ty3); - // Type ty1 = new RefType("java.lang.Number",-1); - Type ty2 = new RefType("Matrix",param1,-1); - - //expected - Menge> expected = new Menge>(); - Menge result1 = new Menge(); - result1.add(new Pair(ty1,ty2,PairOperator.Equal)); - expected.add(result1); -System.out.println("expected: " + expected); - - //actual - //execution of tested method - // Menge> ret = Unify.unify(ty1, ty2 ,new FC_TTO(new Menge(),new Menge(),new Menge())); - Menge> ret = Unify.unify(ty1, ty2 ,fc); -System.out.println("returned: "+ ret); - //comparison - //TrMakeFCTest.assertEquals(expected, ret); - } - - //Java-Types with respect to FC -// public void testUnifyWithFC() { -// //setup - unification of two types -// //Type 1 -// Type ty1 = TypePlaceholder.fresh(); -// Type ty2 = new RefType("java.lang.Boolean",-1); -// -// //expected -// Menge> expected = new Menge>(); -// Menge result1 = new Menge(); -// result1.add(new Pair(ty1,ty2,PairOperator.Equal)); -// expected.add(result1); -//System.out.println("expected: " + expected); -// -// //actual -// //execution of tested method -// Menge> ret = Unify.unify(ty1, ty2 ,new FC_TTO(new Menge(),new Menge(),new Menge())); -//System.out.println("returned: "+ ret); -// //comparison -// TrMakeFCTest.assertEquals(expected, ret); -// //fail("Not yet implemented"); -// } -// - - - - - public void testUnifyReduce1() { - fail("Not yet implemented"); - } - - - public void testUnifyErase1() { - //löscht "A extends B" - - } - -} diff --git a/test/parser/GeneralParserTest.java b/test/parser/GeneralParserTest.java index 6432d850a..59f8a07bb 100644 --- a/test/parser/GeneralParserTest.java +++ b/test/parser/GeneralParserTest.java @@ -8,8 +8,10 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; -import de.dhbwstuttgart.typeinference.Menge; +import de.dhbwstuttgart.logger.LoggerConfiguration; +import de.dhbwstuttgart.logger.Section; +import de.dhbwstuttgart.typeinference.Menge; import junit.framework.TestCase; import org.junit.Test; @@ -18,7 +20,7 @@ import de.dhbwstuttgart.core.MyCompiler; import de.dhbwstuttgart.core.MyCompilerAPI; /** - * Dieser Test prüft nur, ob .java-Dateien fehlerfrei geparst werden. + * Dieser Test pr�ft nur, ob .java-Dateien fehlerfrei geparst werden. * Der dabei erstellte Syntaxbaum wird nicht kontrolliert. * @author janulrich * @@ -28,13 +30,17 @@ public class GeneralParserTest{ @Test public void run(){ + + LoggerConfiguration config = new LoggerConfiguration(); + config.setOutput(Section.PARSER, System.out); + Menge filenames = new Menge(); filenames.add("FieldInitializationTest.jav"); filenames.add("ImportTest.jav"); filenames.add("BoundedParameter.jav"); filenames.add("GenericFieldVarTest.jav"); filenames.add("FieldVarTest.jav"); - MyCompilerAPI compiler = MyCompiler.getAPI(); + MyCompilerAPI compiler = MyCompiler.getAPI(config); try{ for(String filename : filenames) compiler.parse(new File(rootDirectory + filename)); diff --git a/test/plugindevelopment/InsertSingleTypeTest.java b/test/plugindevelopment/InsertSingleTypeTest.java index d09a2a1fd..ac88cdd92 100644 --- a/test/plugindevelopment/InsertSingleTypeTest.java +++ b/test/plugindevelopment/InsertSingleTypeTest.java @@ -6,12 +6,15 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; + import de.dhbwstuttgart.typeinference.Menge; import org.junit.Test; import de.dhbwstuttgart.core.MyCompiler; import de.dhbwstuttgart.core.MyCompilerAPI; +import de.dhbwstuttgart.logger.LoggerConfiguration; +import de.dhbwstuttgart.logger.Section; import de.dhbwstuttgart.parser.JavaParser.yyException; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertPoint; @@ -36,12 +39,13 @@ public class InsertSingleTypeTest { static final String rootDirectory = System.getProperty("user.dir")+"/test/plugindevelopment/"; public static TypeinferenceResultSet test(String sourceFileToInfere){ + String inferedSource = ""; - MyCompilerAPI compiler = MyCompiler.getAPI(); + MyCompilerAPI compiler = MyCompiler.getAPI(new LoggerConfiguration().setOutput(Section.TYPEINFERENCE, System.out)); try { compiler.parse(new File(rootDirectory + sourceFileToInfere)); Menge results = compiler.typeReconstruction(); - TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); + TestCase.assertTrue("Es darf nicht mehr als eine L�sungsm�glichkeit geben und nicht "+results.size(), results.size()==1); return results.firstElement(); } catch (IOException | yyException e) { e.printStackTrace(); @@ -51,7 +55,7 @@ public class InsertSingleTypeTest { } //Source: https://stackoverflow.com/questions/326390/how-to-create-a-java-string-from-the-contents-of-a-file - //PS: benötigt Java 7 + //PS: ben�tigt Java 7 public static String getFileContent(String path)throws IOException { byte[] encoded = Files.readAllBytes(Paths.get(path)); diff --git a/test/plugindevelopment/KarthesischesProduktTest.java b/test/plugindevelopment/KarthesischesProduktTest.java deleted file mode 100644 index 0828b1653..000000000 --- a/test/plugindevelopment/KarthesischesProduktTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package plugindevelopment; - -import de.dhbwstuttgart.typeinference.Menge; - -import org.junit.Test; - -import de.dhbwstuttgart.typeinference.ConstraintPair; -import de.dhbwstuttgart.typeinference.ConstraintType; -import de.dhbwstuttgart.typeinference.ConstraintsSet; -import de.dhbwstuttgart.typeinference.KarthesischesProdukt; -import de.dhbwstuttgart.typeinference.OderConstraint; -import de.dhbwstuttgart.typeinference.SingleConstraint; - -public class KarthesischesProduktTest { - - @Test - public void test(){ - Menge> testV = new Menge<>(); - Menge dummy = new Menge<>(); - dummy.add("1"); - dummy.add("2"); - dummy.add("3"); - testV.add(dummy); - testV.add(dummy); - - ConstraintsSet cs = new ConstraintsSet(); - OderConstraint oc = new OderConstraint(); - //oc.addConstraint(new SingleConstraint(new RefType(""))); - cs.add(oc); - - Menge out = new KarthesischesProdukt().berechneKarthesischesProdukt(testV); - System.out.println(out); - } - -} -class TestConstraintPair extends ConstraintPair{ - - public TestConstraintPair(ConstraintType t1, ConstraintType t2) { - super(t1, t2); - // TODO Auto-generated constructor stub - } - -} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/Tester.java b/test/plugindevelopment/MartinTestCases/Tester.java index 3e9efc8f2..66488c7a1 100644 --- a/test/plugindevelopment/MartinTestCases/Tester.java +++ b/test/plugindevelopment/MartinTestCases/Tester.java @@ -2,12 +2,15 @@ package plugindevelopment.MartinTestCases; import java.io.File; import java.io.IOException; + import de.dhbwstuttgart.typeinference.Menge; import org.junit.Test; import de.dhbwstuttgart.core.MyCompiler; import de.dhbwstuttgart.core.MyCompilerAPI; +import de.dhbwstuttgart.logger.LoggerConfiguration; +import de.dhbwstuttgart.logger.Section; import de.dhbwstuttgart.parser.JavaParser.yyException; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; @@ -22,11 +25,11 @@ public class Tester extends TypeInsertTester{ public static void test(String sourceFileToInfere, Menge mustContain){ String gesamterSrc = ""; String inferedSource = ""; - MyCompilerAPI compiler = MyCompiler.getAPI(); + MyCompilerAPI compiler = MyCompiler.getAPI(new LoggerConfiguration().setOutput(Section.TYPEINFERENCE, System.out)); try { compiler.parse(new File(rootDirectory + sourceFileToInfere)); Menge results = compiler.typeReconstruction(); - //TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); + //TestCase.assertTrue("Es darf nicht mehr als eine L�sungsm�glichkeit geben und nicht "+results.size(), results.size()==1); for(TypeinferenceResultSet result : results){ TypeInsertSet point = result.getTypeInsertionPoints(); //TestCase.assertTrue("Es muss mindestens ein TypeInsertSet vorhanden sein", points.size()>0); @@ -45,7 +48,7 @@ public class Tester extends TypeInsertTester{ TestCase.fail(); } for(String containString : mustContain){ - TestCase.assertTrue("\""+containString+"\" muss in den inferierten Lösungen vorkommen",gesamterSrc.contains(containString)); + TestCase.assertTrue("\""+containString+"\" muss in den inferierten L�sungen vorkommen",gesamterSrc.contains(containString)); } } diff --git a/test/plugindevelopment/SyntaxTreeTests.java b/test/plugindevelopment/SyntaxTreeTests.java index 105897a1c..099661636 100644 --- a/test/plugindevelopment/SyntaxTreeTests.java +++ b/test/plugindevelopment/SyntaxTreeTests.java @@ -2,6 +2,6 @@ package plugindevelopment; public class SyntaxTreeTests { - //TODO: Hier tests für getChildren anfügen. + //TODO: Hier tests für getChildren anfügen. } diff --git a/test/plugindevelopment/TRMEqualTest.java b/test/plugindevelopment/TRMEqualTest.java deleted file mode 100644 index 375b3da1d..000000000 --- a/test/plugindevelopment/TRMEqualTest.java +++ /dev/null @@ -1,132 +0,0 @@ -package plugindevelopment; - -import static org.junit.Assert.*; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import de.dhbwstuttgart.typeinference.Menge; - -import org.junit.Test; - -import de.dhbwstuttgart.core.MyCompiler; -import de.dhbwstuttgart.core.MyCompilerAPI; -import de.dhbwstuttgart.parser.JavaParser.yyException; -import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; -import de.dhbwstuttgart.syntaxtree.type.RefType; -import de.dhbwstuttgart.syntaxtree.type.Type; -import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -import de.dhbwstuttgart.typeinference.Pair; -import de.dhbwstuttgart.typeinference.ResultSet; -import de.dhbwstuttgart.typeinference.TypeInsertable; -import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; -import de.dhbwstuttgart.typeinference.Pair.PairOperator; -import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertPoint; -import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; -import junit.framework.TestCase; -import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent; - -public class TRMEqualTest { - Menge replaceSet = new Menge(); - TestNode node; - TypePlaceholder tph; - - - public void initTRMEqualTest(){ - node = new TestNode(); - tph = TypePlaceholder.fresh(node); - node.setType(tph); - } - - @Test - public void test(){ - initTRMEqualTest(); - assertTrue("Zu Beginn ist das Set leer",replaceSet.size()==0); - addTestNode("Typ1"); - assertTrue("Nach dem Anfügen eines Type muss das Set 1 Element enthalten",replaceSet.size()==1); - addTestNode("Typ2"); - assertTrue("Nach dem Anfügen eines weiteren Typs muss das Set 2 Elemente enthalten und nicht "+replaceSet.size(),replaceSet.size()==2); - addTestNode("Typ1"); - assertTrue("Nach dem Anfügen des selben Typs wie zuvor muss das Set immer noch 2 Element enthalten. Und nicht "+replaceSet.size(),replaceSet.size()==2); - } - - private void addTestNode(String type){ - Menge resultContent = new Menge(); - Pair pair = new Pair(tph,new RefType(type,0)); - pair.SetOperator(PairOperator.Equal); - resultContent.add(pair); - ResultSet resultSet = new ResultSet(resultContent); - Menge tphs = tph.getTypeInsertPoints(resultSet); - TypeInsertSet toAdd = new TypeInsertSet(resultSet); - for(TypeInsertPoint tip : tphs){ - toAdd.add(tip); - } - System.out.println("Füge hinzu: "+toAdd); - if(!replaceSet.contains(toAdd))replaceSet.add(toAdd); - } -} - -class TestNode extends SyntaxTreeNode implements TypeInsertable{ - - @Override - public void replaceType(CReplaceTypeEvent e) { - // TODO Auto-generated method stub - - } - - @Override - public int getTypeLineNumber() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public void setType(Type typ) { - // TODO Auto-generated method stub - - } - - @Override - public Type getType() { - // TODO Auto-generated method stub - return null; - } - - @Override - public int getOffset() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public void setOffset(int offset) { - // TODO Auto-generated method stub - - } - - @Override - public String getIdentifier() { - // TODO Auto-generated method stub - return null; - } - - @Override - public TypeInsertPoint createTypeInsertPoint(TypePlaceholder tph, - ResultSet resultSet) { - return new TypeInsertPoint( this, this, resultSet.getTypeEqualTo(tph), resultSet); - } - - @Override - public int getVariableLength() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public Menge getChildren() { - // TODO Auto-generated method stub - return new Menge<>(); - } - -} - diff --git a/test/plugindevelopment/TypeInsertSetEqualTest.java b/test/plugindevelopment/TypeInsertSetEqualTest.java deleted file mode 100644 index a3d70056c..000000000 --- a/test/plugindevelopment/TypeInsertSetEqualTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package plugindevelopment; - -import java.io.File; -import java.io.IOException; -import de.dhbwstuttgart.typeinference.Menge; - -import junit.framework.TestCase; - -import org.junit.Test; - -import de.dhbwstuttgart.core.MyCompiler; -import de.dhbwstuttgart.core.MyCompilerAPI; -import de.dhbwstuttgart.parser.JavaParser.yyException; -import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; -import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; - -public class TypeInsertSetEqualTest { - - - private static final String TEST_FILE = "TypeInsertSetEqualTest.jav"; - - @Test - public void run(){ - String inferedSource = ""; - MyCompilerAPI compiler = MyCompiler.getAPI(); - try { - compiler.parse(new File(TypeInsertTester.rootDirectory + TEST_FILE)); - Menge results = compiler.typeReconstruction(); - //TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); - Menge insertSets = new Menge(); - for(TypeinferenceResultSet result : results){ - TypeInsertSet point = result.getTypeInsertionPoints(); - if(!insertSets.contains(point))insertSets.add(point); - //TestCase.assertTrue("Es muss mindestens ein TypeInsertSet vorhanden sein", points.size()>0); - - } - if(insertSets.size()!=1){ - TestCase.fail("Es darf nur ein TypeInsertSet geben und nicht "+insertSets.size()); - } - - } catch (IOException | yyException e) { - e.printStackTrace(); - TestCase.fail(); - } - - } - -} diff --git a/test/plugindevelopment/TypeInsertTester.java b/test/plugindevelopment/TypeInsertTester.java index 27154bb22..25f8676a3 100755 --- a/test/plugindevelopment/TypeInsertTester.java +++ b/test/plugindevelopment/TypeInsertTester.java @@ -46,7 +46,7 @@ public class TypeInsertTester{ try { compiler.parse(new File(rootDirectory + sourceFileToInfere)); Menge results = compiler.typeReconstruction(); - TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); + TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); for(TypeinferenceResultSet result : results){ TypeInsertSet point = result.getTypeInsertionPoints(); //TestCase.assertTrue("Es muss mindestens ein TypeInsertSet vorhanden sein", points.size()>0); @@ -65,7 +65,7 @@ public class TypeInsertTester{ } //Source: https://stackoverflow.com/questions/326390/how-to-create-a-java-string-from-the-contents-of-a-file - //PS: benötigt Java 7 + //PS: benötigt Java 7 public static String getFileContent(String path)throws IOException { byte[] encoded = Files.readAllBytes(Paths.get(path)); diff --git a/test/plugindevelopment/TypeInsertTests/MultipleTypesInsertTester.java b/test/plugindevelopment/TypeInsertTests/MultipleTypesInsertTester.java index 79dce8040..293311739 100755 --- a/test/plugindevelopment/TypeInsertTests/MultipleTypesInsertTester.java +++ b/test/plugindevelopment/TypeInsertTests/MultipleTypesInsertTester.java @@ -42,8 +42,8 @@ public class MultipleTypesInsertTester extends TypeInsertTester{ try { compiler.parse(new File(rootDirectory + sourceFileToInfere)); Menge results = compiler.typeReconstruction(); - System.out.println("Typinferenz ausgeführt!"); - //TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); + System.out.println("Typinferenz ausgeführt!"); + //TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); for(TypeinferenceResultSet result : results){ TypeInsertSet point = result.getTypeInsertionPoints(); //TestCase.assertTrue("Es muss mindestens ein TypeInsertSet vorhanden sein", points.size()>0); @@ -62,7 +62,7 @@ public class MultipleTypesInsertTester extends TypeInsertTester{ TestCase.fail(); } for(String containString : mustContain){ - TestCase.assertTrue("\""+containString+"\" muss in den inferierten Lösungen vorkommen",gesamterSrc.contains(containString)); + TestCase.assertTrue("\""+containString+"\" muss in den inferierten Lösungen vorkommen",gesamterSrc.contains(containString)); } } @@ -73,7 +73,7 @@ public class MultipleTypesInsertTester extends TypeInsertTester{ try { compiler.parse(new File(rootDirectory + sourceFileToInfere)); Menge results = compiler.typeReconstruction(); - //TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); + //TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1); for(TypeinferenceResultSet result : results){ TypeInsertSet point = result.getTypeInsertionPoints(); //TestCase.assertTrue("Es muss mindestens ein TypeInsertSet vorhanden sein", points.size()>0); @@ -93,7 +93,7 @@ public class MultipleTypesInsertTester extends TypeInsertTester{ TestCase.fail(); } for(String containString : mustContain){ - TestCase.assertTrue("\""+containString+"\" muss in den inferierten Lösungen vorkommen",gesamterSrc.contains(containString)); + TestCase.assertTrue("\""+containString+"\" muss in den inferierten Lösungen vorkommen",gesamterSrc.contains(containString)); } } }