diff --git a/.classpath b/.classpath
deleted file mode 100644
index 22ddf0a09..000000000
--- a/.classpath
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.gitignore b/.gitignore
index 98b5964bf..c71c9ed2c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,7 @@ bin
*.jar
*.war
*.ear
+
+# IDEs
+.classpath
+
diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml
deleted file mode 100644
index 6a9ec0914..000000000
--- a/.idea/libraries/lib.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 000000000..e96534fb2
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/.project b/.project
deleted file mode 100644
index 792f8088b..000000000
--- a/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- JavaCompilerCore
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
-
-
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index a698e5967..000000000
--- a/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.8
diff --git a/JavaTXcompiler.iml b/JavaTXcompiler.iml
new file mode 100644
index 000000000..20953853b
--- /dev/null
+++ b/JavaTXcompiler.iml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/classes/classes.iml b/classes/classes.iml
deleted file mode 100644
index 8021953ed..000000000
--- a/classes/classes.iml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/doc/LambdaJavadoc/de/dhbwstuttgart/typeinference/ResultSet.html b/doc/LambdaJavadoc/de/dhbwstuttgart/typeinference/ResultSet.html
index 711ccc169..b96e7a0bf 100644
--- a/doc/LambdaJavadoc/de/dhbwstuttgart/typeinference/ResultSet.html
+++ b/doc/LambdaJavadoc/de/dhbwstuttgart/typeinference/ResultSet.html
@@ -100,7 +100,7 @@ var activeTableTab = "activeTableTab";
java.lang.Object
-- de.dhbwstuttgart.typeinference.ResultSet
+- de.dhbwstuttgart.typeinference.result.ResultSet
diff --git a/doc/LambdaJavadoc/de/dhbwstuttgart/typeinference/class-use/ResultSet.html b/doc/LambdaJavadoc/de/dhbwstuttgart/typeinference/class-use/ResultSet.html
index cb62bfa35..aa2bb95c2 100644
--- a/doc/LambdaJavadoc/de/dhbwstuttgart/typeinference/class-use/ResultSet.html
+++ b/doc/LambdaJavadoc/de/dhbwstuttgart/typeinference/class-use/ResultSet.html
@@ -3,7 +3,7 @@
-Uses of Class de.dhbwstuttgart.typeinference.ResultSet
+Uses of Class de.dhbwstuttgart.typeinference.result.ResultSet
@@ -70,7 +70,7 @@
diff --git a/doc/Studienarbeiten/S2017_Jan-Elric_Neumann.pdf b/doc/Studienarbeiten/S2017_Jan-Elric_Neumann.pdf
new file mode 100755
index 000000000..559ab690b
Binary files /dev/null and b/doc/Studienarbeiten/S2017_Jan-Elric_Neumann.pdf differ
diff --git a/lib/annotations-2.0.1.jar b/lib/annotations-2.0.1.jar
deleted file mode 100644
index 8a0204fc2..000000000
Binary files a/lib/annotations-2.0.1.jar and /dev/null differ
diff --git a/lib/antlr-complete.jar b/lib/antlr-complete.jar
deleted file mode 100755
index 8203e15e5..000000000
Binary files a/lib/antlr-complete.jar and /dev/null differ
diff --git a/lib/bcel-6.1-SNAPSHOT-sources.jar b/lib/bcel-6.1-SNAPSHOT-sources.jar
deleted file mode 100644
index 6b1fdda0c..000000000
Binary files a/lib/bcel-6.1-SNAPSHOT-sources.jar and /dev/null differ
diff --git a/lib/bcel-6.1-SNAPSHOT.jar b/lib/bcel-6.1-SNAPSHOT.jar
deleted file mode 100644
index 3b5306fba..000000000
Binary files a/lib/bcel-6.1-SNAPSHOT.jar and /dev/null differ
diff --git a/lib/cloning.jar b/lib/cloning.jar
deleted file mode 100644
index d56184265..000000000
Binary files a/lib/cloning.jar and /dev/null differ
diff --git a/lib/commons-bcel6-6.0-SNAPSHOT.jar b/lib/commons-bcel6-6.0-SNAPSHOT.jar
deleted file mode 100644
index 1512826c4..000000000
Binary files a/lib/commons-bcel6-6.0-SNAPSHOT.jar and /dev/null differ
diff --git a/lib/guava-10.0.1.jar b/lib/guava-10.0.1.jar
deleted file mode 100644
index d107c0f3b..000000000
Binary files a/lib/guava-10.0.1.jar and /dev/null differ
diff --git a/lib/guava-15.0.jar b/lib/guava-15.0.jar
deleted file mode 100644
index eb9ef8ad5..000000000
Binary files a/lib/guava-15.0.jar and /dev/null differ
diff --git a/lib/javassist-3.19.0-GA.jar b/lib/javassist-3.19.0-GA.jar
deleted file mode 100644
index 7ac42641f..000000000
Binary files a/lib/javassist-3.19.0-GA.jar and /dev/null differ
diff --git a/lib/junit-4.0.jar b/lib/junit-4.0.jar
deleted file mode 100755
index b20406924..000000000
Binary files a/lib/junit-4.0.jar and /dev/null differ
diff --git a/lib/log4j-1.2.12.jar b/lib/log4j-1.2.12.jar
deleted file mode 100755
index 9b5a72008..000000000
Binary files a/lib/log4j-1.2.12.jar and /dev/null differ
diff --git a/lib/reflections-0.9.10-javadoc.jar b/lib/reflections-0.9.10-javadoc.jar
deleted file mode 100644
index d0186c094..000000000
Binary files a/lib/reflections-0.9.10-javadoc.jar and /dev/null differ
diff --git a/lib/reflections-0.9.10-sources.jar b/lib/reflections-0.9.10-sources.jar
deleted file mode 100644
index 8412a6243..000000000
Binary files a/lib/reflections-0.9.10-sources.jar and /dev/null differ
diff --git a/lib/reflections-0.9.10.jar b/lib/reflections-0.9.10.jar
deleted file mode 100644
index c25564182..000000000
Binary files a/lib/reflections-0.9.10.jar and /dev/null differ
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 000000000..fed9a7694
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,49 @@
+
+
+ 4.0.0
+ de.dhbwstuttgart
+ JavaTXcompiler
+ jar
+ 0.1
+ JavaTXcompiler
+ http://maven.apache.org
+
+
+ junit
+ junit
+ 4.0
+ test
+
+
+ org.antlr
+ antlr4
+ 4.7
+
+
+com.google.guava
+ guava
+ 19.0
+
+
+ org.reflections
+ reflections
+ 0.9.11
+
+
+
+
+ target
+ target/classes
+ ${artifactId}-${version}
+ target/test-classes
+ src/
+ test/
+
+
+ 1.8
+ 1.8
+
+
diff --git a/src/de/dhbwstuttgart/core/ConsoleInterface.java b/src/de/dhbwstuttgart/core/ConsoleInterface.java
old mode 100755
new mode 100644
index c86afbe3f..77a172bf6
--- a/src/de/dhbwstuttgart/core/ConsoleInterface.java
+++ b/src/de/dhbwstuttgart/core/ConsoleInterface.java
@@ -3,16 +3,14 @@ package de.dhbwstuttgart.core;
import java.io.File;
import java.io.IOException;
import java.util.*;
+import java.util.stream.Collectors;
public class ConsoleInterface {
private static final String directory = System.getProperty("user.dir");
public static void main(String[] args) throws IOException, ClassNotFoundException {
-
- JavaTXCompiler compiler = new JavaTXCompiler();
- for(String arg : Arrays.asList(args)){
- compiler.parse(new File(arg));
- }
+ List input = Arrays.asList(args).stream().map((s -> new File(s))).collect(Collectors.toList());
+ JavaTXCompiler compiler = new JavaTXCompiler(input);
compiler.typeInference();
}
}
diff --git a/src/de/dhbwstuttgart/core/IItemWithOffset.java b/src/de/dhbwstuttgart/core/IItemWithOffset.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/de/dhbwstuttgart/core/JavaTXCompiler.java
index e89297296..6e7e65168 100644
--- a/src/de/dhbwstuttgart/core/JavaTXCompiler.java
+++ b/src/de/dhbwstuttgart/core/JavaTXCompiler.java
@@ -1,42 +1,51 @@
package de.dhbwstuttgart.core;
-import de.dhbwstuttgart.exceptions.DebugException;
+import de.dhbwstuttgart.environment.CompilationEnvironment;
import de.dhbwstuttgart.parser.JavaTXParser;
+import de.dhbwstuttgart.parser.scope.GenericsRegistry;
+import de.dhbwstuttgart.parser.SyntaxTreeGenerator.SyntaxTreeGenerator;
+import de.dhbwstuttgart.parser.antlr.Java8Parser.CompilationUnitContext;
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
import de.dhbwstuttgart.syntaxtree.SourceFile;
-import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
import de.dhbwstuttgart.syntaxtree.factory.UnifyTypeFactory;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
-import de.dhbwstuttgart.typedeployment.TypeInsert;
-import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
-import de.dhbwstuttgart.typedeployment.TypeInsertPoint;
-import de.dhbwstuttgart.typeinference.ResultSet;
import de.dhbwstuttgart.typeinference.constraints.Constraint;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
import de.dhbwstuttgart.typeinference.constraints.Pair;
+import de.dhbwstuttgart.typeinference.result.ResultSet;
import de.dhbwstuttgart.typeinference.typeAlgo.TYPE;
import de.dhbwstuttgart.typeinference.unify.TypeUnify;
-import de.dhbwstuttgart.typeinference.unify.interfaces.IFiniteClosure;
import de.dhbwstuttgart.typeinference.unify.model.FiniteClosure;
import de.dhbwstuttgart.typeinference.unify.model.UnifyPair;
-import de.dhbwstuttgart.typeinference.unify.model.UnifyType;
import java.io.File;
import java.io.IOException;
import java.util.*;
+import java.util.stream.Collectors;
public class JavaTXCompiler {
- protected List sourceFiles = new ArrayList<>();
+ final CompilationEnvironment environment;
+ public final Map sourceFiles = new HashMap<>();
- public ResultSet typeInference(){
- List allClasses = new ArrayList<>();
- for(SourceFile sf : sourceFiles){
+ public JavaTXCompiler(File sourceFile) throws IOException, ClassNotFoundException {
+ this(Arrays.asList(sourceFile));
+ }
+
+ public JavaTXCompiler(List sources) throws IOException, ClassNotFoundException {
+ environment = new CompilationEnvironment(sources);
+ for(File s : sources){
+ sourceFiles.put(s,parse(s));
+ }
+ }
+
+ public List typeInference(){
+ List allClasses = new ArrayList<>();//environment.getAllAvailableClasses();
+ for(SourceFile sf : sourceFiles.values()){
allClasses.addAll(sf.getClasses());
}
FiniteClosure finiteClosure = UnifyTypeFactory.generateFC(allClasses);
- ConstraintSet cons = new ConstraintSet<>();
- cons = new TYPE(sourceFiles).getConstraints();
+ final ConstraintSet cons = new TYPE(sourceFiles.values(), allClasses).getConstraints();
ConstraintSet unifyCons = UnifyTypeFactory.convert(cons);
TypeUnify unify = new TypeUnify();
@@ -52,9 +61,9 @@ public class JavaTXCompiler {
System.out.println("RESULT: " + result);
results.addAll(result);
}
- return new ResultSet(UnifyTypeFactory.convert(results, generateTPHMap(cons)));
- //return new ResultSet(new HashSet<>(Arrays.asList(UnifyTypeFactory.convert(results, generateTPHMap(cons)).iterator().next())));
- }
+ return results.stream().map((unifyPairs ->
+ new ResultSet(UnifyTypeFactory.convert(unifyPairs, generateTPHMap(cons))))).collect(Collectors.toList());
+ }
private Map generateTPHMap(ConstraintSet constraints){
HashMap ret = new HashMap<>();
@@ -70,15 +79,10 @@ public class JavaTXCompiler {
return ret;
}
- public SourceFile parse(File sourceFile) throws IOException, java.lang.ClassNotFoundException {
- SourceFile ret = new JavaTXParser().parse(sourceFile);
- sourceFiles.add(ret);
- return ret;
- }
-
- public SourceFile parse(String source) throws IOException, java.lang.ClassNotFoundException {
- SourceFile ret = new JavaTXParser().parse(source);
- sourceFiles.add(ret);
+ private SourceFile parse(File sourceFile) throws IOException, java.lang.ClassNotFoundException {
+ CompilationUnitContext tree = JavaTXParser.parse(sourceFile);
+ SyntaxTreeGenerator generator = new SyntaxTreeGenerator(environment.getRegistry(sourceFile), new GenericsRegistry(null));
+ SourceFile ret = generator.convert(tree);
return ret;
}
diff --git a/src/de/dhbwstuttgart/environment/CompilationEnvironment.java b/src/de/dhbwstuttgart/environment/CompilationEnvironment.java
new file mode 100644
index 000000000..46a60139e
--- /dev/null
+++ b/src/de/dhbwstuttgart/environment/CompilationEnvironment.java
@@ -0,0 +1,63 @@
+package de.dhbwstuttgart.environment;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
+import de.dhbwstuttgart.syntaxtree.SourceFile;
+import de.dhbwstuttgart.syntaxtree.factory.ASTFactory;
+import org.reflections.Reflections;
+import org.reflections.scanners.ResourcesScanner;
+import org.reflections.scanners.SubTypesScanner;
+import org.reflections.util.ClasspathHelper;
+import org.reflections.util.ConfigurationBuilder;
+import org.reflections.util.FilterBuilder;
+
+import de.dhbwstuttgart.exceptions.DebugException;
+import de.dhbwstuttgart.parser.JavaTXParser;
+import de.dhbwstuttgart.parser.antlr.Java8Parser.CompilationUnitContext;
+import de.dhbwstuttgart.parser.scope.GatherNames;
+import de.dhbwstuttgart.parser.scope.JavaClassRegistry;
+
+/**
+ * Stellt die Java-Environment dar und speichert alle Binarys, Librarys und Sourcefiles im zu kompilierenden Projekt
+ * Sie erstellt anhand dieser Informationen die JavaClassNameRegistry
+ *
+ * TODO: Zur Initialisierung der CompilationEnvironment sollten alle SourceFiles mit ANTLR geparst werden und alle Klassen Generics und Typen herausgefunden werden
+ */
+public class CompilationEnvironment {
+ private final List librarys;
+ private final List sourceFiles;
+
+ /**
+ * Imitiert die Environment beim Aufruf des JavaCompilers auf einer Menge von java-Dateien
+ * Die Environment enth�lt automatisch die Java Standard Library
+ * @param sourceFiles die zu kompilierenden Dateien
+ */
+ public CompilationEnvironment(List sourceFiles) {
+ String bootClassPath = System.getProperty("sun.boot.class.path");
+ librarys = new ArrayList<>();
+ for(String path : bootClassPath.split(File.pathSeparator)) {
+ try {
+ librarys.add(new URL("file:"+path));
+ } catch (MalformedURLException e) {
+ new DebugException("Fehler im Classpath auf diesem System");
+ }
+ }
+ this.sourceFiles = sourceFiles;
+ }
+
+ public JavaClassRegistry getRegistry(File forSourceFile) throws ClassNotFoundException, IOException {
+ List allNames;
+ CompilationUnitContext tree = JavaTXParser.parse(forSourceFile);
+ allNames = GatherNames.getNames(tree, new PackageCrawler(librarys));
+ return new JavaClassRegistry(allNames);
+ }
+}
diff --git a/src/de/dhbwstuttgart/environment/PackageCrawler.java b/src/de/dhbwstuttgart/environment/PackageCrawler.java
new file mode 100644
index 000000000..e1e4b70c7
--- /dev/null
+++ b/src/de/dhbwstuttgart/environment/PackageCrawler.java
@@ -0,0 +1,65 @@
+package de.dhbwstuttgart.environment;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.reflections.Reflections;
+import org.reflections.scanners.ResourcesScanner;
+import org.reflections.scanners.SubTypesScanner;
+import org.reflections.util.ConfigurationBuilder;
+import org.reflections.util.FilterBuilder;
+
+import de.dhbwstuttgart.parser.scope.JavaClassName;
+
+/**
+ * Hilft beim Durchsuchen von Packages
+ * Benutzt die Reflections-Library (https://github.com/ronmamo/reflections)
+ * Hilfe dazu: http://stackoverflow.com/a/9571146
+ */
+public class PackageCrawler {
+
+ final URL[] urls;
+ public PackageCrawler(List urlList) {
+ urls = urlList.toArray(new URL[0]);
+ }
+
+ public Set> getClassesInPackage(String packageName){
+ /*
+ List classLoadersList = new LinkedList();
+ classLoadersList.add(Thread.currentThread().getContextClassLoader());
+ classLoadersList.add(ClasspathHelper.staticClassLoader());
+ classLoadersList.add(Thread.currentThread().getContextClassLoader().getParent());
+ classLoadersList.add(ClassLoader.getSystemClassLoader());
+ String bootClassPath = System.getProperty("sun.boot.class.path");
+ ArrayList urlList = new ArrayList<>();
+ for(String path : bootClassPath.split(";")) {
+ try {
+ urlList.add(new URL("file:"+path));
+ } catch (MalformedURLException e) {
+ new DebugException("Fehler im Classpath auf diesem System");
+ }
+ }
+ URL[] urls = urlList.toArray(new URL[0]);
+ classLoadersList.add(new URLClassLoader(urls, ClassLoader.getSystemClassLoader()));
+ */
+ Reflections reflections = new Reflections(new ConfigurationBuilder()
+ .setScanners(new SubTypesScanner(false /* don't exclude Object.class */), new ResourcesScanner())
+ .setUrls(urls)
+ .filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(packageName))));
+
+ Set> classes = reflections.getSubTypesOf(Object.class);
+
+ return classes;
+ }
+
+ public List getClassNames(String packageName){
+ List nameList = new ArrayList();
+ Set> classes = getClassesInPackage(packageName);
+ for(Class c : classes){
+ nameList.add(c.getName());
+ }
+ return nameList;
+ }
+}
diff --git a/src/de/dhbwstuttgart/exceptions/TypeinferenceException.java b/src/de/dhbwstuttgart/exceptions/TypeinferenceException.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/parser/JavaTXParser.java b/src/de/dhbwstuttgart/parser/JavaTXParser.java
index 970958afb..c860a6a74 100644
--- a/src/de/dhbwstuttgart/parser/JavaTXParser.java
+++ b/src/de/dhbwstuttgart/parser/JavaTXParser.java
@@ -1,10 +1,12 @@
package de.dhbwstuttgart.parser;
+import de.dhbwstuttgart.environment.CompilationEnvironment;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.SyntaxTreeGenerator;
import de.dhbwstuttgart.parser.antlr.Java8Lexer;
import de.dhbwstuttgart.parser.antlr.Java8Parser;
+import de.dhbwstuttgart.parser.scope.JavaClassRegistry;
import de.dhbwstuttgart.syntaxtree.SourceFile;
-import de.dhbwstuttgart.typecheck.JavaClassRegistry;
+
import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CommonTokenStream;
@@ -13,26 +15,23 @@ import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
-public class JavaTXParser {
- public SourceFile parse(InputStream source) throws IOException, java.lang.ClassNotFoundException {
- InputStream stream = source;//new FileInputStream(sourceFile);
+public class JavaTXParser {
+ public static Java8Parser.CompilationUnitContext parse(File source) throws IOException, java.lang.ClassNotFoundException {
+ InputStream stream = new FileInputStream(source);
ANTLRInputStream input = new ANTLRInputStream(stream);
Java8Lexer lexer = new Java8Lexer(input);
CommonTokenStream tokens = new CommonTokenStream(lexer);
Java8Parser parser = new Java8Parser(tokens);
- Java8Parser.CompilationUnitContext tree = parser.compilationUnit();
-
- JavaClassRegistry reg = new JavaClassRegistry(new ArrayList<>());
- reg.addPackage("java.lang");
- SyntaxTreeGenerator generator = new SyntaxTreeGenerator(reg);
+ return parser.compilationUnit();
+ /*
+ SyntaxTreeGenerator generator = new SyntaxTreeGenerator(environment.getRegistry(source));
return generator.convert(tree);
+ */
}
-
- public SourceFile parse(File file) throws IOException, java.lang.ClassNotFoundException {
- return this.parse(new FileInputStream(file));
- }
-
+
+ /* Für das Typsystem ist es notwendig, dass sich der Source in einer Datei befindet:
public SourceFile parse(String fileContent) throws IOException, java.lang.ClassNotFoundException {
return this.parse(new ByteArrayInputStream(fileContent.getBytes(StandardCharsets.UTF_8)));
}
+ */
}
diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/GenericContext.java b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/GenericContext.java
index 88f94ee81..6e3ce7d95 100644
--- a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/GenericContext.java
+++ b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/GenericContext.java
@@ -1,6 +1,6 @@
package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
-import de.dhbwstuttgart.typecheck.JavaClassName;
+import de.dhbwstuttgart.parser.scope.JavaClassName;
public class GenericContext {
public final String parentMethod;
diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/GenericsRegistry.java b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/GenericsRegistry.java
deleted file mode 100644
index 08212fc94..000000000
--- a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/GenericsRegistry.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
-
-import java.util.HashMap;
-
-public class GenericsRegistry extends HashMap {
-
-}
\ No newline at end of file
diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
index 89bc43742..cb351ec91 100644
--- a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
+++ b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
@@ -3,6 +3,8 @@ package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
import de.dhbwstuttgart.exceptions.NotImplementedException;
import de.dhbwstuttgart.parser.NullToken;
import de.dhbwstuttgart.parser.antlr.Java8Parser;
+import de.dhbwstuttgart.parser.scope.GenericsRegistry;
+import de.dhbwstuttgart.parser.scope.JavaClassRegistry;
import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.statement.*;
import de.dhbwstuttgart.syntaxtree.statement.literal.*;
@@ -10,7 +12,7 @@ import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.syntaxtree.type.Void;
-import de.dhbwstuttgart.typecheck.JavaClassRegistry;
+
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.tree.TerminalNode;
@@ -467,7 +469,7 @@ public class StatementGenerator {
private Statement convert(Java8Parser.ReturnStatementContext stmt){
if(stmt.expression() != null){
- return new Return( convert(stmt.expression()),stmt.getStart());
+ return new Return( convert(stmt.expression()),stmt.getStart() );
}else{
return new ReturnVoid(stmt.getStart());
}
diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java
index f16fc4043..172cdbcf1 100644
--- a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java
+++ b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java
@@ -2,19 +2,19 @@ package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
import de.dhbwstuttgart.exceptions.NotImplementedException;
import java.lang.ClassNotFoundException;
-import de.dhbwstuttgart.parser.NullToken;
+
import de.dhbwstuttgart.parser.antlr.Java8Parser;
+import de.dhbwstuttgart.parser.scope.GenericsRegistry;
+import de.dhbwstuttgart.parser.scope.JavaClassName;
+import de.dhbwstuttgart.parser.scope.JavaClassRegistry;
import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.factory.ASTFactory;
import de.dhbwstuttgart.syntaxtree.statement.*;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
-import de.dhbwstuttgart.typecheck.*;
-import java.io.File;
import java.lang.reflect.Modifier;
-import java.sql.Ref;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -26,68 +26,20 @@ import org.antlr.v4.runtime.tree.TerminalNode;
public class SyntaxTreeGenerator{
private JavaClassRegistry reg;
+ private final GenericsRegistry globalGenerics;
private String pkgName = "";
List imports = new ArrayList();
List fieldInitializations = new ArrayList<>();
- public SyntaxTreeGenerator(JavaClassRegistry reg){
+ public SyntaxTreeGenerator(JavaClassRegistry reg, GenericsRegistry globalGenerics){
+ //Die Generics müssen während des Bauens des AST erstellt werden,
+ // da diese mit der Methode oder Klasse, in welcher sie deklariert werden
+ // verknüpft sein müssen. Dennoch werden die Namen aller Generics in einer globalen Datenbank benötigt.
+ this.globalGenerics = globalGenerics;
this.reg = reg;
}
- public void setPackageName(Java8Parser.CompilationUnitContext ctx){
- if(ctx.packageDeclaration() != null){
- for(TerminalNode t : ctx.packageDeclaration().Identifier()){
- this.pkgName = this.pkgName + "." + t.toString();
- }
- this.pkgName = this.pkgName.substring(1);
- }
- }
-
- public void getNames(Java8Parser.CompilationUnitContext ctx){
- if(this.pkgName == "") this.setPackageName(ctx);
- String nameString = "";
- for (Java8Parser.TypeDeclarationContext typeDecl : ctx.typeDeclaration()){
- if(typeDecl.interfaceDeclaration() != null){
- if(typeDecl.interfaceDeclaration().normalInterfaceDeclaration() != null){
- if(this.pkgName != ""){
- nameString = this.pkgName + "." + typeDecl.interfaceDeclaration().normalInterfaceDeclaration().Identifier().toString();
- }
- else{
- nameString = typeDecl.interfaceDeclaration().normalInterfaceDeclaration().Identifier().toString();
- }
- //Die Generic TypeParameter Definitionen Nicht! an die JavaClassName-Registry anfügen:
- /* //Diese gelängen dadurch in den globalen Scope, was sie schließlich nicht sind
- if(typeDecl.classDeclaration().normalClassDeclaration().typeParameters() != null){
- for(Java8Parser.TypeParameterContext tp : typeDecl.classDeclaration().normalClassDeclaration().typeParameters().typeParameterList().typeParameter()){
- //this.reg.add(tp.Identifier().toString());
- }
- }
- */
- this.reg.add(nameString);
- }
- }
- else{
- if(typeDecl.classDeclaration().normalClassDeclaration() != null){
- if(this.pkgName != ""){
- nameString = this.pkgName + "." + typeDecl.classDeclaration().normalClassDeclaration().Identifier().toString();
- }
- else{
- nameString = typeDecl.classDeclaration().normalClassDeclaration().Identifier().toString();
- }
- //Die Generic TypeParameter Definitionen Nicht! an die JavaClassName-Registry anfügen:
- /* //Diese gelängen dadurch in den globalen Scope, was sie schließlich nicht sind
- if(typeDecl.classDeclaration().normalClassDeclaration().typeParameters() != null){
- for(Java8Parser.TypeParameterContext tp : typeDecl.classDeclaration().normalClassDeclaration().typeParameters().typeParameterList().typeParameter()){
- this.reg.add(tp.Identifier().toString());
- }
- }
- */
- this.reg.add(nameString);
- }
- }
- }
- }
public JavaClassRegistry getReg(){
return this.reg;
@@ -138,8 +90,6 @@ public class SyntaxTreeGenerator{
private JavaClassName convertSingleTypeImportDeclaration(Java8Parser.SingleTypeImportDeclarationContext ctx) throws ClassNotFoundException{
String typeName = convertTypeName(ctx.typeName());
- Thread.currentThread().getContextClassLoader().loadClass(typeName);
- reg.add(typeName);
JavaClassName ret = reg.getName(typeName);
return ret;
}
@@ -168,7 +118,6 @@ public class SyntaxTreeGenerator{
public SourceFile convert(Java8Parser.CompilationUnitContext ctx) throws ClassNotFoundException{
List classes = new ArrayList<>();
- this.getNames(ctx);
this.setImports(ctx);
for(Java8Parser.TypeDeclarationContext typeDecl : ctx.typeDeclaration()){
ClassOrInterface newClass;
@@ -187,7 +136,7 @@ public class SyntaxTreeGenerator{
Java8Parser.MethodHeaderContext header = methodDeclarationContext.methodHeader();
int modifiers = SyntaxTreeGenerator.convert(methodDeclarationContext.methodModifier());
GenericsRegistry localGenerics = createGenerics(methodDeclarationContext.methodHeader().typeParameters(),
- parentClass, header.methodDeclarator().Identifier().getText());
+ parentClass, header.methodDeclarator().Identifier().getText(), reg, generics);
localGenerics.putAll(generics);
return convert(modifiers, header, methodDeclarationContext.methodBody(),parentClass, superClass, localGenerics);
}
@@ -196,7 +145,7 @@ public class SyntaxTreeGenerator{
Java8Parser.MethodHeaderContext header = ctx.methodHeader();
int modifiers = SyntaxTreeGenerator.convertInterfaceModifier(ctx.interfaceMethodModifier());
- GenericsRegistry localGenerics = createGenerics(header.typeParameters(), parentClass, header.methodDeclarator().Identifier().getText());
+ GenericsRegistry localGenerics = createGenerics(header.typeParameters(), parentClass, header.methodDeclarator().Identifier().getText(), reg, generics);
localGenerics.putAll(generics);
return convert(modifiers, header, ctx.methodBody(),parentClass, superClass, localGenerics);
@@ -210,7 +159,7 @@ public class SyntaxTreeGenerator{
String name = header.methodDeclarator().Identifier().getText();
GenericDeclarationList gtvDeclarations = new GenericDeclarationList(new ArrayList<>(), header.getStart());
if(header.typeParameters() != null){
- gtvDeclarations = TypeGenerator.convert(header.typeParameters(), parentClass, name,reg, localGenerics);
+ gtvDeclarations = TypeGenerator.convert(header.typeParameters(), parentClass, name, reg, localGenerics);
}else{
gtvDeclarations = new GenericDeclarationList(new ArrayList<>(), header.getStart());
}
@@ -259,7 +208,7 @@ public class SyntaxTreeGenerator{
}
}
JavaClassName name = reg.getName(ctx.Identifier().getText());
- GenericsRegistry generics = createGenerics(ctx.typeParameters(), name, "");
+ GenericsRegistry generics = createGenerics(ctx.typeParameters(), name, "", reg, new GenericsRegistry(globalGenerics));
Token offset = ctx.getStart();
GenericDeclarationList genericClassParameters;
if(ctx.typeParameters() == null){
@@ -465,7 +414,7 @@ public class SyntaxTreeGenerator{
}
JavaClassName name = reg.getName(ctx.Identifier().getText());
- GenericsRegistry generics = createGenerics(ctx.typeParameters(), name, "");
+ GenericsRegistry generics = createGenerics(ctx.typeParameters(), name, "", reg, new GenericsRegistry(globalGenerics));
GenericDeclarationList genericParams;
if(ctx.typeParameters() != null){
@@ -491,8 +440,9 @@ public class SyntaxTreeGenerator{
return new GenericDeclarationList(new ArrayList<>(), gtvOffset);
}
- private GenericsRegistry createGenerics(Java8Parser.TypeParametersContext ctx, JavaClassName parentClass, String parentMethod) {
- GenericsRegistry ret = new GenericsRegistry();
+ private GenericsRegistry createGenerics(Java8Parser.TypeParametersContext ctx, JavaClassName parentClass, String parentMethod, JavaClassRegistry reg, GenericsRegistry generics) {
+ GenericsRegistry ret = new GenericsRegistry(this.globalGenerics);
+ ret.putAll(generics);
if(ctx == null || ctx.typeParameterList() == null)return ret;
for(Java8Parser.TypeParameterContext tp : ctx.typeParameterList().typeParameter()){
TypeGenerator.convert(tp, parentClass, parentMethod, reg, ret);
diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java
index eeaca00c4..ed0f06af7 100644
--- a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java
+++ b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java
@@ -2,23 +2,21 @@ package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
import de.dhbwstuttgart.exceptions.NotImplementedException;
import de.dhbwstuttgart.exceptions.TypeinferenceException;
-import de.dhbwstuttgart.parser.NullToken;
import de.dhbwstuttgart.parser.antlr.Java8Parser;
+import de.dhbwstuttgart.parser.scope.GenericTypeName;
+import de.dhbwstuttgart.parser.scope.GenericsRegistry;
+import de.dhbwstuttgart.parser.scope.JavaClassName;
+import de.dhbwstuttgart.parser.scope.JavaClassRegistry;
import de.dhbwstuttgart.syntaxtree.GenericDeclarationList;
import de.dhbwstuttgart.syntaxtree.GenericTypeVar;
import de.dhbwstuttgart.syntaxtree.factory.ASTFactory;
-import de.dhbwstuttgart.syntaxtree.statement.ArgumentList;
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
-import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
-import de.dhbwstuttgart.typecheck.GenericTypeName;
-import de.dhbwstuttgart.typecheck.JavaClassName;
-import de.dhbwstuttgart.typecheck.JavaClassRegistry;
+
import org.antlr.v4.runtime.Token;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
public class TypeGenerator {
@@ -67,6 +65,8 @@ public class TypeGenerator {
public static GenericTypeVar convert(Java8Parser.TypeParameterContext typeParameter, JavaClassName parentClass, String parentMethod, JavaClassRegistry reg, GenericsRegistry generics) {
String name = typeParameter.Identifier().getText();
+ //TODO: Es müssen erst alle GenericTypeVars generiert werden, dann können die bounds dieser Generics ermittelt werden
+ //Problem ist erlaubt, würde aber bei den Bounds von A den Generic B nicht als solchen erkennen
List bounds = TypeGenerator.convert(typeParameter.typeBound(),reg, generics);
GenericTypeVar ret = new GenericTypeVar(new GenericTypeName(new GenericContext(parentClass, parentMethod), name), bounds, typeParameter.getStart(), typeParameter.getStop());
@@ -75,13 +75,33 @@ public class TypeGenerator {
}
public static List convert(Java8Parser.TypeBoundContext typeBoundContext, JavaClassRegistry reg, GenericsRegistry generics) {
+ List ret = new ArrayList<>();
if(typeBoundContext == null){
- List ret = new ArrayList<>();
ret.add(ASTFactory.createObjectClass().getType());
return ret;
}
+ if(typeBoundContext.typeVariable() != null){
+ ret.add(convertTypeName(typeBoundContext.typeVariable().Identifier().getText(), null, typeBoundContext.typeVariable().getStart(), reg, generics));
+ return ret;
+ }
+ if(typeBoundContext.classOrInterfaceType() != null){
+ ret.add(convert(typeBoundContext.classOrInterfaceType()));
+ if(typeBoundContext.additionalBound() != null)
+ for(Java8Parser.AdditionalBoundContext addCtx : typeBoundContext.additionalBound()){
+ ret.add(convert(addCtx.interfaceType()));
+ }
+ return ret;
+ }else{
+ throw new NotImplementedException();
+ }
+ }
- throw new de.dhbwstuttgart.exceptions.NotImplementedException();
+ private static RefTypeOrTPHOrWildcardOrGeneric convert(Java8Parser.ClassOrInterfaceTypeContext classOrInterfaceTypeContext) {
+ throw new NotImplementedException();
+ }
+
+ private static RefTypeOrTPHOrWildcardOrGeneric convert(Java8Parser.InterfaceTypeContext interfaceTypeContext) {
+ throw new NotImplementedException();
}
public static RefTypeOrTPHOrWildcardOrGeneric convert(Java8Parser.ReferenceTypeContext referenceTypeContext, JavaClassRegistry reg, GenericsRegistry generics) {
@@ -95,7 +115,7 @@ public class TypeGenerator {
public static RefTypeOrTPHOrWildcardOrGeneric convertTypeName(
String name, Java8Parser.TypeArgumentsContext typeArguments, Token offset, JavaClassRegistry reg, GenericsRegistry generics){
if(!reg.contains(name)){ //Dann könnte es ein Generische Type sein
- if(generics.keySet().contains(name)){
+ if(generics.contains(name)){
return new GenericRefType(new GenericTypeName(generics.get(name),name), offset);
}else{
throw new TypeinferenceException("Der Typ "+ name + " ist nicht vorhanden",offset);
diff --git a/src/de/dhbwstuttgart/parser/antlr/Java8.g4 b/src/de/dhbwstuttgart/parser/antlr/Java8.g4
index 14891bac5..f566ef070 100644
--- a/src/de/dhbwstuttgart/parser/antlr/Java8.g4
+++ b/src/de/dhbwstuttgart/parser/antlr/Java8.g4
@@ -732,7 +732,7 @@ localVariableDeclarationStatement
unannTypeOrAuto
: unannType
- | 'auto'
+ | 'var'
;
localVariableDeclaration
diff --git a/src/de/dhbwstuttgart/parser/antlr/Java8.tokens b/src/de/dhbwstuttgart/parser/antlr/Java8.tokens
index 82895a500..da68d0140 100644
--- a/src/de/dhbwstuttgart/parser/antlr/Java8.tokens
+++ b/src/de/dhbwstuttgart/parser/antlr/Java8.tokens
@@ -106,7 +106,7 @@ ELLIPSIS=105
WS=106
COMMENT=107
LINE_COMMENT=108
-'auto'=1
+'var'=1
'abstract'=2
'assert'=3
'boolean'=4
diff --git a/src/de/dhbwstuttgart/parser/antlr/Java8Lexer.java b/src/de/dhbwstuttgart/parser/antlr/Java8Lexer.java
index 5d545ba3b..c4b858697 100644
--- a/src/de/dhbwstuttgart/parser/antlr/Java8Lexer.java
+++ b/src/de/dhbwstuttgart/parser/antlr/Java8Lexer.java
@@ -68,7 +68,7 @@ public class Java8Lexer extends Lexer {
};
private static final String[] _LITERAL_NAMES = {
- null, "'auto'", "'abstract'", "'assert'", "'boolean'", "'break'", "'byte'",
+ null, "'var'", "'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'",
@@ -184,7 +184,7 @@ public class Java8Lexer extends Lexer {
}
public static final String _serializedATN =
- "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2n\u044f\b\1\4\2\t"+
+ "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2n\u044e\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"+
@@ -204,88 +204,88 @@ public class Java8Lexer extends Lexer {
"\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\4\u0095\t\u0095\4\u0096\t\u0096\4\u0097"+
"\t\u0097\4\u0098\t\u0098\4\u0099\t\u0099\4\u009a\t\u009a\4\u009b\t\u009b"+
- "\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\3\3\3\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\5\3\5\3\6\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\t\3\t\3\t\3\t\3\t\3\t\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"+
- "\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16"+
- "\3\16\3\17\3\17\3\17\3\20\3\20\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\23\3\23\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\25\3\25\3\25\3\25\3\25\3\25\3\25"+
- "\3\25\3\26\3\26\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\27\3\30\3\30\3\30"+
- "\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\32\3\32"+
- "\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\34\3\34\3\34\3\34\3\34"+
- "\3\34\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\36\3\36\3\36\3\36"+
- "\3\36\3\36\3\36\3\36\3\36\3\36\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\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\61\3\61\3\61"+
- "\3\61\3\62\3\62\3\62\3\62\3\62\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63"+
- "\3\63\3\64\3\64\3\64\3\64\3\64\3\64\3\65\3\65\3\65\3\65\5\65\u0294\n\65"+
- "\3\66\3\66\5\66\u0298\n\66\3\67\3\67\5\67\u029c\n\67\38\38\58\u02a0\n"+
- "8\39\39\59\u02a4\n9\3:\3:\3;\3;\3;\5;\u02ab\n;\3;\3;\3;\5;\u02b0\n;\5"+
- ";\u02b2\n;\3<\3<\5<\u02b6\n<\3<\5<\u02b9\n<\3=\3=\5=\u02bd\n=\3>\3>\3"+
- "?\6?\u02c2\n?\r?\16?\u02c3\3@\3@\5@\u02c8\n@\3A\6A\u02cb\nA\rA\16A\u02cc"+
- "\3B\3B\3B\3B\3C\3C\5C\u02d5\nC\3C\5C\u02d8\nC\3D\3D\3E\6E\u02dd\nE\rE"+
- "\16E\u02de\3F\3F\5F\u02e3\nF\3G\3G\5G\u02e7\nG\3G\3G\3H\3H\5H\u02ed\n"+
- "H\3H\5H\u02f0\nH\3I\3I\3J\6J\u02f5\nJ\rJ\16J\u02f6\3K\3K\5K\u02fb\nK\3"+
- "L\3L\3L\3L\3M\3M\5M\u0303\nM\3M\5M\u0306\nM\3N\3N\3O\6O\u030b\nO\rO\16"+
- "O\u030c\3P\3P\5P\u0311\nP\3Q\3Q\5Q\u0315\nQ\3R\3R\3R\5R\u031a\nR\3R\5"+
- "R\u031d\nR\3R\5R\u0320\nR\3R\3R\3R\5R\u0325\nR\3R\5R\u0328\nR\3R\3R\3"+
- "R\5R\u032d\nR\3R\3R\3R\5R\u0332\nR\3S\3S\3S\3T\3T\3U\5U\u033a\nU\3U\3"+
- "U\3V\3V\3W\3W\3X\3X\3X\5X\u0345\nX\3Y\3Y\5Y\u0349\nY\3Y\3Y\3Y\5Y\u034e"+
- "\nY\3Y\3Y\5Y\u0352\nY\3Z\3Z\3Z\3[\3[\3\\\3\\\3\\\3\\\3\\\3\\\3\\\3\\\3"+
- "\\\5\\\u0362\n\\\3]\3]\3]\3]\3]\3]\3]\3]\5]\u036c\n]\3^\3^\3_\3_\5_\u0372"+
- "\n_\3_\3_\3`\6`\u0377\n`\r`\16`\u0378\3a\3a\5a\u037d\na\3b\3b\3b\3b\5"+
- "b\u0383\nb\3c\3c\3c\3c\3c\3c\3c\3c\3c\3c\3c\5c\u0390\nc\3d\3d\3e\3e\3"+
- "e\3e\3e\3e\3e\3f\3f\3f\3f\3f\3g\3g\3h\3h\3i\3i\3j\3j\3k\3k\3l\3l\3m\3"+
- "m\3n\3n\3o\3o\3p\3p\3q\3q\3r\3r\3s\3s\3t\3t\3u\3u\3v\3v\3w\3w\3w\3x\3"+
- "x\3x\3y\3y\3y\3z\3z\3z\3{\3{\3{\3|\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\u0083\3\u0083\3\u0084"+
- "\3\u0084\3\u0085\3\u0085\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\u008b"+
- "\3\u008b\3\u008b\3\u008c\3\u008c\3\u008c\3\u008d\3\u008d\3\u008d\3\u008e"+
- "\3\u008e\3\u008e\3\u008f\3\u008f\3\u008f\3\u0090\3\u0090\3\u0090\3\u0091"+
- "\3\u0091\3\u0091\3\u0091\3\u0092\3\u0092\3\u0092\3\u0092\3\u0093\3\u0093"+
- "\3\u0093\3\u0093\3\u0093\3\u0094\3\u0094\7\u0094\u0415\n\u0094\f\u0094"+
- "\16\u0094\u0418\13\u0094\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095"+
- "\5\u0095\u0420\n\u0095\3\u0096\3\u0096\3\u0096\3\u0096\3\u0096\3\u0096"+
- "\5\u0096\u0428\n\u0096\3\u0097\3\u0097\3\u0098\3\u0098\3\u0098\3\u0098"+
- "\3\u0099\6\u0099\u0431\n\u0099\r\u0099\16\u0099\u0432\3\u0099\3\u0099"+
- "\3\u009a\3\u009a\3\u009a\3\u009a\7\u009a\u043b\n\u009a\f\u009a\16\u009a"+
- "\u043e\13\u009a\3\u009a\3\u009a\3\u009a\3\u009a\3\u009a\3\u009b\3\u009b"+
- "\3\u009b\3\u009b\7\u009b\u0449\n\u009b\f\u009b\16\u009b\u044c\13\u009b"+
- "\3\u009b\3\u009b\3\u043c\2\u009c\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\66k\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\2\u0099\2\u009b\2\u009d\2\u009f\2\u00a1\67\u00a3\2\u00a5\2\u00a7"+
- "\2\u00a9\2\u00ab\2\u00ad\2\u00af\2\u00b1\2\u00b3\2\u00b5\2\u00b78\u00b9"+
- "9\u00bb\2\u00bd:\u00bf\2\u00c1\2\u00c3\2\u00c5\2\u00c7\2\u00c9\2\u00cb"+
- ";\u00cd<\u00cf=\u00d1>\u00d3?\u00d5@\u00d7A\u00d9B\u00dbC\u00ddD\u00df"+
- "E\u00e1F\u00e3G\u00e5H\u00e7I\u00e9J\u00ebK\u00edL\u00efM\u00f1N\u00f3"+
- "O\u00f5P\u00f7Q\u00f9R\u00fbS\u00fdT\u00ffU\u0101V\u0103W\u0105X\u0107"+
- "Y\u0109Z\u010b[\u010d\\\u010f]\u0111^\u0113_\u0115`\u0117a\u0119b\u011b"+
- "c\u011dd\u011fe\u0121f\u0123g\u0125h\u0127i\u0129\2\u012b\2\u012dj\u012f"+
- "k\u0131l\u0133m\u0135n\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\2RRrr\4\2))^^\4\2"+
- "$$^^\n\2$$))^^ddhhppttvv\3\2\62\65\6\2&&C\\aac|\4\2\2\u0081\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\u045d\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\2C\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\2i\3\2\2\2\2\u00a1"+
- "\3\2\2\2\2\u00b7\3\2\2\2\2\u00b9\3\2\2\2\2\u00bd\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\3\2\3\2\3\2\3\3\3\3\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\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\6\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\t\3\t\3\t\3\t\3\t\3\t\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\r\3"+
+ "\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16"+
+ "\3\17\3\17\3\17\3\20\3\20\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\23\3\23\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\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25"+
+ "\3\26\3\26\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\27\3\30\3\30\3\30\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\32\3\32\3\32"+
+ "\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\34\3\34\3\34\3\34\3\34\3\34"+
+ "\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\36\3\36\3\36\3\36\3\36"+
+ "\3\36\3\36\3\36\3\36\3\36\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\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\61\3\61\3\61\3\61"+
+ "\3\62\3\62\3\62\3\62\3\62\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63"+
+ "\3\64\3\64\3\64\3\64\3\64\3\64\3\65\3\65\3\65\3\65\5\65\u0293\n\65\3\66"+
+ "\3\66\5\66\u0297\n\66\3\67\3\67\5\67\u029b\n\67\38\38\58\u029f\n8\39\3"+
+ "9\59\u02a3\n9\3:\3:\3;\3;\3;\5;\u02aa\n;\3;\3;\3;\5;\u02af\n;\5;\u02b1"+
+ "\n;\3<\3<\5<\u02b5\n<\3<\5<\u02b8\n<\3=\3=\5=\u02bc\n=\3>\3>\3?\6?\u02c1"+
+ "\n?\r?\16?\u02c2\3@\3@\5@\u02c7\n@\3A\6A\u02ca\nA\rA\16A\u02cb\3B\3B\3"+
+ "B\3B\3C\3C\5C\u02d4\nC\3C\5C\u02d7\nC\3D\3D\3E\6E\u02dc\nE\rE\16E\u02dd"+
+ "\3F\3F\5F\u02e2\nF\3G\3G\5G\u02e6\nG\3G\3G\3H\3H\5H\u02ec\nH\3H\5H\u02ef"+
+ "\nH\3I\3I\3J\6J\u02f4\nJ\rJ\16J\u02f5\3K\3K\5K\u02fa\nK\3L\3L\3L\3L\3"+
+ "M\3M\5M\u0302\nM\3M\5M\u0305\nM\3N\3N\3O\6O\u030a\nO\rO\16O\u030b\3P\3"+
+ "P\5P\u0310\nP\3Q\3Q\5Q\u0314\nQ\3R\3R\3R\5R\u0319\nR\3R\5R\u031c\nR\3"+
+ "R\5R\u031f\nR\3R\3R\3R\5R\u0324\nR\3R\5R\u0327\nR\3R\3R\3R\5R\u032c\n"+
+ "R\3R\3R\3R\5R\u0331\nR\3S\3S\3S\3T\3T\3U\5U\u0339\nU\3U\3U\3V\3V\3W\3"+
+ "W\3X\3X\3X\5X\u0344\nX\3Y\3Y\5Y\u0348\nY\3Y\3Y\3Y\5Y\u034d\nY\3Y\3Y\5"+
+ "Y\u0351\nY\3Z\3Z\3Z\3[\3[\3\\\3\\\3\\\3\\\3\\\3\\\3\\\3\\\3\\\5\\\u0361"+
+ "\n\\\3]\3]\3]\3]\3]\3]\3]\3]\5]\u036b\n]\3^\3^\3_\3_\5_\u0371\n_\3_\3"+
+ "_\3`\6`\u0376\n`\r`\16`\u0377\3a\3a\5a\u037c\na\3b\3b\3b\3b\5b\u0382\n"+
+ "b\3c\3c\3c\3c\3c\3c\3c\3c\3c\3c\3c\5c\u038f\nc\3d\3d\3e\3e\3e\3e\3e\3"+
+ "e\3e\3f\3f\3f\3f\3f\3g\3g\3h\3h\3i\3i\3j\3j\3k\3k\3l\3l\3m\3m\3n\3n\3"+
+ "o\3o\3p\3p\3q\3q\3r\3r\3s\3s\3t\3t\3u\3u\3v\3v\3w\3w\3w\3x\3x\3x\3y\3"+
+ "y\3y\3z\3z\3z\3{\3{\3{\3|\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\u0083\3\u0083\3\u0084\3\u0084"+
+ "\3\u0085\3\u0085\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\u008b\3\u008b"+
+ "\3\u008b\3\u008c\3\u008c\3\u008c\3\u008d\3\u008d\3\u008d\3\u008e\3\u008e"+
+ "\3\u008e\3\u008f\3\u008f\3\u008f\3\u0090\3\u0090\3\u0090\3\u0091\3\u0091"+
+ "\3\u0091\3\u0091\3\u0092\3\u0092\3\u0092\3\u0092\3\u0093\3\u0093\3\u0093"+
+ "\3\u0093\3\u0093\3\u0094\3\u0094\7\u0094\u0414\n\u0094\f\u0094\16\u0094"+
+ "\u0417\13\u0094\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\5\u0095"+
+ "\u041f\n\u0095\3\u0096\3\u0096\3\u0096\3\u0096\3\u0096\3\u0096\5\u0096"+
+ "\u0427\n\u0096\3\u0097\3\u0097\3\u0098\3\u0098\3\u0098\3\u0098\3\u0099"+
+ "\6\u0099\u0430\n\u0099\r\u0099\16\u0099\u0431\3\u0099\3\u0099\3\u009a"+
+ "\3\u009a\3\u009a\3\u009a\7\u009a\u043a\n\u009a\f\u009a\16\u009a\u043d"+
+ "\13\u009a\3\u009a\3\u009a\3\u009a\3\u009a\3\u009a\3\u009b\3\u009b\3\u009b"+
+ "\3\u009b\7\u009b\u0448\n\u009b\f\u009b\16\u009b\u044b\13\u009b\3\u009b"+
+ "\3\u009b\3\u043b\2\u009c\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\62"+
+ "c\63e\64g\65i\66k\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"+
+ "\2\u0099\2\u009b\2\u009d\2\u009f\2\u00a1\67\u00a3\2\u00a5\2\u00a7\2\u00a9"+
+ "\2\u00ab\2\u00ad\2\u00af\2\u00b1\2\u00b3\2\u00b5\2\u00b78\u00b99\u00bb"+
+ "\2\u00bd:\u00bf\2\u00c1\2\u00c3\2\u00c5\2\u00c7\2\u00c9\2\u00cb;\u00cd"+
+ "<\u00cf=\u00d1>\u00d3?\u00d5@\u00d7A\u00d9B\u00dbC\u00ddD\u00dfE\u00e1"+
+ "F\u00e3G\u00e5H\u00e7I\u00e9J\u00ebK\u00edL\u00efM\u00f1N\u00f3O\u00f5"+
+ "P\u00f7Q\u00f9R\u00fbS\u00fdT\u00ffU\u0101V\u0103W\u0105X\u0107Y\u0109"+
+ "Z\u010b[\u010d\\\u010f]\u0111^\u0113_\u0115`\u0117a\u0119b\u011bc\u011d"+
+ "d\u011fe\u0121f\u0123g\u0125h\u0127i\u0129\2\u012b\2\u012dj\u012fk\u0131"+
+ "l\u0133m\u0135n\3\2\30\4\2NNnn\3\2\63;\4\2ZZzz\5\2\62;CHch\3\2\629\4\2"+
+ "DDdd\3\2\62\63\4\2GGgg\4\2--//\6\2FFHHffhh\4\2RRrr\4\2))^^\4\2$$^^\n\2"+
+ "$$))^^ddhhppttvv\3\2\62\65\6\2&&C\\aac|\4\2\2\u0081\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\u045c\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\2C\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\2i\3\2\2\2\2\u00a1\3"+
+ "\2\2\2\2\u00b7\3\2\2\2\2\u00b9\3\2\2\2\2\u00bd\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"+
@@ -296,285 +296,285 @@ public class Java8Lexer extends Lexer {
"\2\2\u0115\3\2\2\2\2\u0117\3\2\2\2\2\u0119\3\2\2\2\2\u011b\3\2\2\2\2\u011d"+
"\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\2\u012d\3\2\2\2\2\u012f\3\2\2\2\2\u0131\3\2\2\2\2\u0133"+
- "\3\2\2\2\2\u0135\3\2\2\2\3\u0137\3\2\2\2\5\u013c\3\2\2\2\7\u0145\3\2\2"+
- "\2\t\u014c\3\2\2\2\13\u0154\3\2\2\2\r\u015a\3\2\2\2\17\u015f\3\2\2\2\21"+
- "\u0164\3\2\2\2\23\u016a\3\2\2\2\25\u016f\3\2\2\2\27\u0175\3\2\2\2\31\u017b"+
- "\3\2\2\2\33\u0184\3\2\2\2\35\u018c\3\2\2\2\37\u018f\3\2\2\2!\u0196\3\2"+
- "\2\2#\u019b\3\2\2\2%\u01a0\3\2\2\2\'\u01a8\3\2\2\2)\u01ae\3\2\2\2+\u01b6"+
- "\3\2\2\2-\u01bc\3\2\2\2/\u01c0\3\2\2\2\61\u01c3\3\2\2\2\63\u01c8\3\2\2"+
- "\2\65\u01d3\3\2\2\2\67\u01da\3\2\2\29\u01e5\3\2\2\2;\u01e9\3\2\2\2=\u01f3"+
- "\3\2\2\2?\u01f8\3\2\2\2A\u01ff\3\2\2\2C\u0203\3\2\2\2E\u020b\3\2\2\2G"+
- "\u0213\3\2\2\2I\u021d\3\2\2\2K\u0224\3\2\2\2M\u022b\3\2\2\2O\u0231\3\2"+
- "\2\2Q\u0238\3\2\2\2S\u0241\3\2\2\2U\u0247\3\2\2\2W\u024e\3\2\2\2Y\u025b"+
- "\3\2\2\2[\u0260\3\2\2\2]\u0266\3\2\2\2_\u026d\3\2\2\2a\u0277\3\2\2\2c"+
- "\u027b\3\2\2\2e\u0280\3\2\2\2g\u0289\3\2\2\2i\u0293\3\2\2\2k\u0295\3\2"+
- "\2\2m\u0299\3\2\2\2o\u029d\3\2\2\2q\u02a1\3\2\2\2s\u02a5\3\2\2\2u\u02b1"+
- "\3\2\2\2w\u02b3\3\2\2\2y\u02bc\3\2\2\2{\u02be\3\2\2\2}\u02c1\3\2\2\2\177"+
- "\u02c7\3\2\2\2\u0081\u02ca\3\2\2\2\u0083\u02ce\3\2\2\2\u0085\u02d2\3\2"+
- "\2\2\u0087\u02d9\3\2\2\2\u0089\u02dc\3\2\2\2\u008b\u02e2\3\2\2\2\u008d"+
- "\u02e4\3\2\2\2\u008f\u02ea\3\2\2\2\u0091\u02f1\3\2\2\2\u0093\u02f4\3\2"+
- "\2\2\u0095\u02fa\3\2\2\2\u0097\u02fc\3\2\2\2\u0099\u0300\3\2\2\2\u009b"+
- "\u0307\3\2\2\2\u009d\u030a\3\2\2\2\u009f\u0310\3\2\2\2\u00a1\u0314\3\2"+
- "\2\2\u00a3\u0331\3\2\2\2\u00a5\u0333\3\2\2\2\u00a7\u0336\3\2\2\2\u00a9"+
- "\u0339\3\2\2\2\u00ab\u033d\3\2\2\2\u00ad\u033f\3\2\2\2\u00af\u0341\3\2"+
- "\2\2\u00b1\u0351\3\2\2\2\u00b3\u0353\3\2\2\2\u00b5\u0356\3\2\2\2\u00b7"+
- "\u0361\3\2\2\2\u00b9\u036b\3\2\2\2\u00bb\u036d\3\2\2\2\u00bd\u036f\3\2"+
- "\2\2\u00bf\u0376\3\2\2\2\u00c1\u037c\3\2\2\2\u00c3\u0382\3\2\2\2\u00c5"+
- "\u038f\3\2\2\2\u00c7\u0391\3\2\2\2\u00c9\u0393\3\2\2\2\u00cb\u039a\3\2"+
- "\2\2\u00cd\u039f\3\2\2\2\u00cf\u03a1\3\2\2\2\u00d1\u03a3\3\2\2\2\u00d3"+
- "\u03a5\3\2\2\2\u00d5\u03a7\3\2\2\2\u00d7\u03a9\3\2\2\2\u00d9\u03ab\3\2"+
- "\2\2\u00db\u03ad\3\2\2\2\u00dd\u03af\3\2\2\2\u00df\u03b1\3\2\2\2\u00e1"+
- "\u03b3\3\2\2\2\u00e3\u03b5\3\2\2\2\u00e5\u03b7\3\2\2\2\u00e7\u03b9\3\2"+
- "\2\2\u00e9\u03bb\3\2\2\2\u00eb\u03bd\3\2\2\2\u00ed\u03bf\3\2\2\2\u00ef"+
- "\u03c2\3\2\2\2\u00f1\u03c5\3\2\2\2\u00f3\u03c8\3\2\2\2\u00f5\u03cb\3\2"+
- "\2\2\u00f7\u03ce\3\2\2\2\u00f9\u03d1\3\2\2\2\u00fb\u03d4\3\2\2\2\u00fd"+
- "\u03d7\3\2\2\2\u00ff\u03d9\3\2\2\2\u0101\u03db\3\2\2\2\u0103\u03dd\3\2"+
- "\2\2\u0105\u03df\3\2\2\2\u0107\u03e1\3\2\2\2\u0109\u03e3\3\2\2\2\u010b"+
- "\u03e5\3\2\2\2\u010d\u03e7\3\2\2\2\u010f\u03ea\3\2\2\2\u0111\u03ed\3\2"+
- "\2\2\u0113\u03f0\3\2\2\2\u0115\u03f3\3\2\2\2\u0117\u03f6\3\2\2\2\u0119"+
- "\u03f9\3\2\2\2\u011b\u03fc\3\2\2\2\u011d\u03ff\3\2\2\2\u011f\u0402\3\2"+
- "\2\2\u0121\u0405\3\2\2\2\u0123\u0409\3\2\2\2\u0125\u040d\3\2\2\2\u0127"+
- "\u0412\3\2\2\2\u0129\u041f\3\2\2\2\u012b\u0427\3\2\2\2\u012d\u0429\3\2"+
- "\2\2\u012f\u042b\3\2\2\2\u0131\u0430\3\2\2\2\u0133\u0436\3\2\2\2\u0135"+
- "\u0444\3\2\2\2\u0137\u0138\7c\2\2\u0138\u0139\7w\2\2\u0139\u013a\7v\2"+
- "\2\u013a\u013b\7q\2\2\u013b\4\3\2\2\2\u013c\u013d\7c\2\2\u013d\u013e\7"+
- "d\2\2\u013e\u013f\7u\2\2\u013f\u0140\7v\2\2\u0140\u0141\7t\2\2\u0141\u0142"+
- "\7c\2\2\u0142\u0143\7e\2\2\u0143\u0144\7v\2\2\u0144\6\3\2\2\2\u0145\u0146"+
- "\7c\2\2\u0146\u0147\7u\2\2\u0147\u0148\7u\2\2\u0148\u0149\7g\2\2\u0149"+
- "\u014a\7t\2\2\u014a\u014b\7v\2\2\u014b\b\3\2\2\2\u014c\u014d\7d\2\2\u014d"+
- "\u014e\7q\2\2\u014e\u014f\7q\2\2\u014f\u0150\7n\2\2\u0150\u0151\7g\2\2"+
- "\u0151\u0152\7c\2\2\u0152\u0153\7p\2\2\u0153\n\3\2\2\2\u0154\u0155\7d"+
- "\2\2\u0155\u0156\7t\2\2\u0156\u0157\7g\2\2\u0157\u0158\7c\2\2\u0158\u0159"+
- "\7m\2\2\u0159\f\3\2\2\2\u015a\u015b\7d\2\2\u015b\u015c\7{\2\2\u015c\u015d"+
- "\7v\2\2\u015d\u015e\7g\2\2\u015e\16\3\2\2\2\u015f\u0160\7e\2\2\u0160\u0161"+
- "\7c\2\2\u0161\u0162\7u\2\2\u0162\u0163\7g\2\2\u0163\20\3\2\2\2\u0164\u0165"+
- "\7e\2\2\u0165\u0166\7c\2\2\u0166\u0167\7v\2\2\u0167\u0168\7e\2\2\u0168"+
- "\u0169\7j\2\2\u0169\22\3\2\2\2\u016a\u016b\7e\2\2\u016b\u016c\7j\2\2\u016c"+
- "\u016d\7c\2\2\u016d\u016e\7t\2\2\u016e\24\3\2\2\2\u016f\u0170\7e\2\2\u0170"+
- "\u0171\7n\2\2\u0171\u0172\7c\2\2\u0172\u0173\7u\2\2\u0173\u0174\7u\2\2"+
- "\u0174\26\3\2\2\2\u0175\u0176\7e\2\2\u0176\u0177\7q\2\2\u0177\u0178\7"+
- "p\2\2\u0178\u0179\7u\2\2\u0179\u017a\7v\2\2\u017a\30\3\2\2\2\u017b\u017c"+
- "\7e\2\2\u017c\u017d\7q\2\2\u017d\u017e\7p\2\2\u017e\u017f\7v\2\2\u017f"+
- "\u0180\7k\2\2\u0180\u0181\7p\2\2\u0181\u0182\7w\2\2\u0182\u0183\7g\2\2"+
- "\u0183\32\3\2\2\2\u0184\u0185\7f\2\2\u0185\u0186\7g\2\2\u0186\u0187\7"+
- "h\2\2\u0187\u0188\7c\2\2\u0188\u0189\7w\2\2\u0189\u018a\7n\2\2\u018a\u018b"+
- "\7v\2\2\u018b\34\3\2\2\2\u018c\u018d\7f\2\2\u018d\u018e\7q\2\2\u018e\36"+
- "\3\2\2\2\u018f\u0190\7f\2\2\u0190\u0191\7q\2\2\u0191\u0192\7w\2\2\u0192"+
- "\u0193\7d\2\2\u0193\u0194\7n\2\2\u0194\u0195\7g\2\2\u0195 \3\2\2\2\u0196"+
- "\u0197\7g\2\2\u0197\u0198\7n\2\2\u0198\u0199\7u\2\2\u0199\u019a\7g\2\2"+
- "\u019a\"\3\2\2\2\u019b\u019c\7g\2\2\u019c\u019d\7p\2\2\u019d\u019e\7w"+
- "\2\2\u019e\u019f\7o\2\2\u019f$\3\2\2\2\u01a0\u01a1\7g\2\2\u01a1\u01a2"+
- "\7z\2\2\u01a2\u01a3\7v\2\2\u01a3\u01a4\7g\2\2\u01a4\u01a5\7p\2\2\u01a5"+
- "\u01a6\7f\2\2\u01a6\u01a7\7u\2\2\u01a7&\3\2\2\2\u01a8\u01a9\7h\2\2\u01a9"+
- "\u01aa\7k\2\2\u01aa\u01ab\7p\2\2\u01ab\u01ac\7c\2\2\u01ac\u01ad\7n\2\2"+
- "\u01ad(\3\2\2\2\u01ae\u01af\7h\2\2\u01af\u01b0\7k\2\2\u01b0\u01b1\7p\2"+
- "\2\u01b1\u01b2\7c\2\2\u01b2\u01b3\7n\2\2\u01b3\u01b4\7n\2\2\u01b4\u01b5"+
- "\7{\2\2\u01b5*\3\2\2\2\u01b6\u01b7\7h\2\2\u01b7\u01b8\7n\2\2\u01b8\u01b9"+
- "\7q\2\2\u01b9\u01ba\7c\2\2\u01ba\u01bb\7v\2\2\u01bb,\3\2\2\2\u01bc\u01bd"+
- "\7h\2\2\u01bd\u01be\7q\2\2\u01be\u01bf\7t\2\2\u01bf.\3\2\2\2\u01c0\u01c1"+
- "\7k\2\2\u01c1\u01c2\7h\2\2\u01c2\60\3\2\2\2\u01c3\u01c4\7i\2\2\u01c4\u01c5"+
- "\7q\2\2\u01c5\u01c6\7v\2\2\u01c6\u01c7\7q\2\2\u01c7\62\3\2\2\2\u01c8\u01c9"+
- "\7k\2\2\u01c9\u01ca\7o\2\2\u01ca\u01cb\7r\2\2\u01cb\u01cc\7n\2\2\u01cc"+
- "\u01cd\7g\2\2\u01cd\u01ce\7o\2\2\u01ce\u01cf\7g\2\2\u01cf\u01d0\7p\2\2"+
- "\u01d0\u01d1\7v\2\2\u01d1\u01d2\7u\2\2\u01d2\64\3\2\2\2\u01d3\u01d4\7"+
- "k\2\2\u01d4\u01d5\7o\2\2\u01d5\u01d6\7r\2\2\u01d6\u01d7\7q\2\2\u01d7\u01d8"+
- "\7t\2\2\u01d8\u01d9\7v\2\2\u01d9\66\3\2\2\2\u01da\u01db\7k\2\2\u01db\u01dc"+
- "\7p\2\2\u01dc\u01dd\7u\2\2\u01dd\u01de\7v\2\2\u01de\u01df\7c\2\2\u01df"+
- "\u01e0\7p\2\2\u01e0\u01e1\7e\2\2\u01e1\u01e2\7g\2\2\u01e2\u01e3\7q\2\2"+
- "\u01e3\u01e4\7h\2\2\u01e48\3\2\2\2\u01e5\u01e6\7k\2\2\u01e6\u01e7\7p\2"+
- "\2\u01e7\u01e8\7v\2\2\u01e8:\3\2\2\2\u01e9\u01ea\7k\2\2\u01ea\u01eb\7"+
- "p\2\2\u01eb\u01ec\7v\2\2\u01ec\u01ed\7g\2\2\u01ed\u01ee\7t\2\2\u01ee\u01ef"+
- "\7h\2\2\u01ef\u01f0\7c\2\2\u01f0\u01f1\7e\2\2\u01f1\u01f2\7g\2\2\u01f2"+
- "<\3\2\2\2\u01f3\u01f4\7n\2\2\u01f4\u01f5\7q\2\2\u01f5\u01f6\7p\2\2\u01f6"+
- "\u01f7\7i\2\2\u01f7>\3\2\2\2\u01f8\u01f9\7p\2\2\u01f9\u01fa\7c\2\2\u01fa"+
- "\u01fb\7v\2\2\u01fb\u01fc\7k\2\2\u01fc\u01fd\7x\2\2\u01fd\u01fe\7g\2\2"+
- "\u01fe@\3\2\2\2\u01ff\u0200\7p\2\2\u0200\u0201\7g\2\2\u0201\u0202\7y\2"+
- "\2\u0202B\3\2\2\2\u0203\u0204\7r\2\2\u0204\u0205\7c\2\2\u0205\u0206\7"+
- "e\2\2\u0206\u0207\7m\2\2\u0207\u0208\7c\2\2\u0208\u0209\7i\2\2\u0209\u020a"+
- "\7g\2\2\u020aD\3\2\2\2\u020b\u020c\7r\2\2\u020c\u020d\7t\2\2\u020d\u020e"+
- "\7k\2\2\u020e\u020f\7x\2\2\u020f\u0210\7c\2\2\u0210\u0211\7v\2\2\u0211"+
- "\u0212\7g\2\2\u0212F\3\2\2\2\u0213\u0214\7r\2\2\u0214\u0215\7t\2\2\u0215"+
- "\u0216\7q\2\2\u0216\u0217\7v\2\2\u0217\u0218\7g\2\2\u0218\u0219\7e\2\2"+
- "\u0219\u021a\7v\2\2\u021a\u021b\7g\2\2\u021b\u021c\7f\2\2\u021cH\3\2\2"+
- "\2\u021d\u021e\7r\2\2\u021e\u021f\7w\2\2\u021f\u0220\7d\2\2\u0220\u0221"+
- "\7n\2\2\u0221\u0222\7k\2\2\u0222\u0223\7e\2\2\u0223J\3\2\2\2\u0224\u0225"+
- "\7t\2\2\u0225\u0226\7g\2\2\u0226\u0227\7v\2\2\u0227\u0228\7w\2\2\u0228"+
- "\u0229\7t\2\2\u0229\u022a\7p\2\2\u022aL\3\2\2\2\u022b\u022c\7u\2\2\u022c"+
- "\u022d\7j\2\2\u022d\u022e\7q\2\2\u022e\u022f\7t\2\2\u022f\u0230\7v\2\2"+
- "\u0230N\3\2\2\2\u0231\u0232\7u\2\2\u0232\u0233\7v\2\2\u0233\u0234\7c\2"+
- "\2\u0234\u0235\7v\2\2\u0235\u0236\7k\2\2\u0236\u0237\7e\2\2\u0237P\3\2"+
- "\2\2\u0238\u0239\7u\2\2\u0239\u023a\7v\2\2\u023a\u023b\7t\2\2\u023b\u023c"+
- "\7k\2\2\u023c\u023d\7e\2\2\u023d\u023e\7v\2\2\u023e\u023f\7h\2\2\u023f"+
- "\u0240\7r\2\2\u0240R\3\2\2\2\u0241\u0242\7u\2\2\u0242\u0243\7w\2\2\u0243"+
- "\u0244\7r\2\2\u0244\u0245\7g\2\2\u0245\u0246\7t\2\2\u0246T\3\2\2\2\u0247"+
- "\u0248\7u\2\2\u0248\u0249\7y\2\2\u0249\u024a\7k\2\2\u024a\u024b\7v\2\2"+
- "\u024b\u024c\7e\2\2\u024c\u024d\7j\2\2\u024dV\3\2\2\2\u024e\u024f\7u\2"+
- "\2\u024f\u0250\7{\2\2\u0250\u0251\7p\2\2\u0251\u0252\7e\2\2\u0252\u0253"+
- "\7j\2\2\u0253\u0254\7t\2\2\u0254\u0255\7q\2\2\u0255\u0256\7p\2\2\u0256"+
- "\u0257\7k\2\2\u0257\u0258\7|\2\2\u0258\u0259\7g\2\2\u0259\u025a\7f\2\2"+
- "\u025aX\3\2\2\2\u025b\u025c\7v\2\2\u025c\u025d\7j\2\2\u025d\u025e\7k\2"+
- "\2\u025e\u025f\7u\2\2\u025fZ\3\2\2\2\u0260\u0261\7v\2\2\u0261\u0262\7"+
- "j\2\2\u0262\u0263\7t\2\2\u0263\u0264\7q\2\2\u0264\u0265\7y\2\2\u0265\\"+
- "\3\2\2\2\u0266\u0267\7v\2\2\u0267\u0268\7j\2\2\u0268\u0269\7t\2\2\u0269"+
- "\u026a\7q\2\2\u026a\u026b\7y\2\2\u026b\u026c\7u\2\2\u026c^\3\2\2\2\u026d"+
- "\u026e\7v\2\2\u026e\u026f\7t\2\2\u026f\u0270\7c\2\2\u0270\u0271\7p\2\2"+
- "\u0271\u0272\7u\2\2\u0272\u0273\7k\2\2\u0273\u0274\7g\2\2\u0274\u0275"+
- "\7p\2\2\u0275\u0276\7v\2\2\u0276`\3\2\2\2\u0277\u0278\7v\2\2\u0278\u0279"+
- "\7t\2\2\u0279\u027a\7{\2\2\u027ab\3\2\2\2\u027b\u027c\7x\2\2\u027c\u027d"+
- "\7q\2\2\u027d\u027e\7k\2\2\u027e\u027f\7f\2\2\u027fd\3\2\2\2\u0280\u0281"+
- "\7x\2\2\u0281\u0282\7q\2\2\u0282\u0283\7n\2\2\u0283\u0284\7c\2\2\u0284"+
- "\u0285\7v\2\2\u0285\u0286\7k\2\2\u0286\u0287\7n\2\2\u0287\u0288\7g\2\2"+
- "\u0288f\3\2\2\2\u0289\u028a\7y\2\2\u028a\u028b\7j\2\2\u028b\u028c\7k\2"+
- "\2\u028c\u028d\7n\2\2\u028d\u028e\7g\2\2\u028eh\3\2\2\2\u028f\u0294\5"+
- "k\66\2\u0290\u0294\5m\67\2\u0291\u0294\5o8\2\u0292\u0294\5q9\2\u0293\u028f"+
- "\3\2\2\2\u0293\u0290\3\2\2\2\u0293\u0291\3\2\2\2\u0293\u0292\3\2\2\2\u0294"+
- "j\3\2\2\2\u0295\u0297\5u;\2\u0296\u0298\5s:\2\u0297\u0296\3\2\2\2\u0297"+
- "\u0298\3\2\2\2\u0298l\3\2\2\2\u0299\u029b\5\u0083B\2\u029a\u029c\5s:\2"+
- "\u029b\u029a\3\2\2\2\u029b\u029c\3\2\2\2\u029cn\3\2\2\2\u029d\u029f\5"+
- "\u008dG\2\u029e\u02a0\5s:\2\u029f\u029e\3\2\2\2\u029f\u02a0\3\2\2\2\u02a0"+
- "p\3\2\2\2\u02a1\u02a3\5\u0097L\2\u02a2\u02a4\5s:\2\u02a3\u02a2\3\2\2\2"+
- "\u02a3\u02a4\3\2\2\2\u02a4r\3\2\2\2\u02a5\u02a6\t\2\2\2\u02a6t\3\2\2\2"+
- "\u02a7\u02b2\7\62\2\2\u02a8\u02af\5{>\2\u02a9\u02ab\5w<\2\u02aa\u02a9"+
- "\3\2\2\2\u02aa\u02ab\3\2\2\2\u02ab\u02b0\3\2\2\2\u02ac\u02ad\5\u0081A"+
- "\2\u02ad\u02ae\5w<\2\u02ae\u02b0\3\2\2\2\u02af\u02aa\3\2\2\2\u02af\u02ac"+
- "\3\2\2\2\u02b0\u02b2\3\2\2\2\u02b1\u02a7\3\2\2\2\u02b1\u02a8\3\2\2\2\u02b2"+
- "v\3\2\2\2\u02b3\u02b8\5y=\2\u02b4\u02b6\5}?\2\u02b5\u02b4\3\2\2\2\u02b5"+
- "\u02b6\3\2\2\2\u02b6\u02b7\3\2\2\2\u02b7\u02b9\5y=\2\u02b8\u02b5\3\2\2"+
- "\2\u02b8\u02b9\3\2\2\2\u02b9x\3\2\2\2\u02ba\u02bd\7\62\2\2\u02bb\u02bd"+
- "\5{>\2\u02bc\u02ba\3\2\2\2\u02bc\u02bb\3\2\2\2\u02bdz\3\2\2\2\u02be\u02bf"+
- "\t\3\2\2\u02bf|\3\2\2\2\u02c0\u02c2\5\177@\2\u02c1\u02c0\3\2\2\2\u02c2"+
- "\u02c3\3\2\2\2\u02c3\u02c1\3\2\2\2\u02c3\u02c4\3\2\2\2\u02c4~\3\2\2\2"+
- "\u02c5\u02c8\5y=\2\u02c6\u02c8\7a\2\2\u02c7\u02c5\3\2\2\2\u02c7\u02c6"+
- "\3\2\2\2\u02c8\u0080\3\2\2\2\u02c9\u02cb\7a\2\2\u02ca\u02c9\3\2\2\2\u02cb"+
- "\u02cc\3\2\2\2\u02cc\u02ca\3\2\2\2\u02cc\u02cd\3\2\2\2\u02cd\u0082\3\2"+
- "\2\2\u02ce\u02cf\7\62\2\2\u02cf\u02d0\t\4\2\2\u02d0\u02d1\5\u0085C\2\u02d1"+
- "\u0084\3\2\2\2\u02d2\u02d7\5\u0087D\2\u02d3\u02d5\5\u0089E\2\u02d4\u02d3"+
- "\3\2\2\2\u02d4\u02d5\3\2\2\2\u02d5\u02d6\3\2\2\2\u02d6\u02d8\5\u0087D"+
- "\2\u02d7\u02d4\3\2\2\2\u02d7\u02d8\3\2\2\2\u02d8\u0086\3\2\2\2\u02d9\u02da"+
- "\t\5\2\2\u02da\u0088\3\2\2\2\u02db\u02dd\5\u008bF\2\u02dc\u02db\3\2\2"+
- "\2\u02dd\u02de\3\2\2\2\u02de\u02dc\3\2\2\2\u02de\u02df\3\2\2\2\u02df\u008a"+
- "\3\2\2\2\u02e0\u02e3\5\u0087D\2\u02e1\u02e3\7a\2\2\u02e2\u02e0\3\2\2\2"+
- "\u02e2\u02e1\3\2\2\2\u02e3\u008c\3\2\2\2\u02e4\u02e6\7\62\2\2\u02e5\u02e7"+
- "\5\u0081A\2\u02e6\u02e5\3\2\2\2\u02e6\u02e7\3\2\2\2\u02e7\u02e8\3\2\2"+
- "\2\u02e8\u02e9\5\u008fH\2\u02e9\u008e\3\2\2\2\u02ea\u02ef\5\u0091I\2\u02eb"+
- "\u02ed\5\u0093J\2\u02ec\u02eb\3\2\2\2\u02ec\u02ed\3\2\2\2\u02ed\u02ee"+
- "\3\2\2\2\u02ee\u02f0\5\u0091I\2\u02ef\u02ec\3\2\2\2\u02ef\u02f0\3\2\2"+
- "\2\u02f0\u0090\3\2\2\2\u02f1\u02f2\t\6\2\2\u02f2\u0092\3\2\2\2\u02f3\u02f5"+
- "\5\u0095K\2\u02f4\u02f3\3\2\2\2\u02f5\u02f6\3\2\2\2\u02f6\u02f4\3\2\2"+
- "\2\u02f6\u02f7\3\2\2\2\u02f7\u0094\3\2\2\2\u02f8\u02fb\5\u0091I\2\u02f9"+
- "\u02fb\7a\2\2\u02fa\u02f8\3\2\2\2\u02fa\u02f9\3\2\2\2\u02fb\u0096\3\2"+
- "\2\2\u02fc\u02fd\7\62\2\2\u02fd\u02fe\t\7\2\2\u02fe\u02ff\5\u0099M\2\u02ff"+
- "\u0098\3\2\2\2\u0300\u0305\5\u009bN\2\u0301\u0303\5\u009dO\2\u0302\u0301"+
- "\3\2\2\2\u0302\u0303\3\2\2\2\u0303\u0304\3\2\2\2\u0304\u0306\5\u009bN"+
- "\2\u0305\u0302\3\2\2\2\u0305\u0306\3\2\2\2\u0306\u009a\3\2\2\2\u0307\u0308"+
- "\t\b\2\2\u0308\u009c\3\2\2\2\u0309\u030b\5\u009fP\2\u030a\u0309\3\2\2"+
- "\2\u030b\u030c\3\2\2\2\u030c\u030a\3\2\2\2\u030c\u030d\3\2\2\2\u030d\u009e"+
- "\3\2\2\2\u030e\u0311\5\u009bN\2\u030f\u0311\7a\2\2\u0310\u030e\3\2\2\2"+
- "\u0310\u030f\3\2\2\2\u0311\u00a0\3\2\2\2\u0312\u0315\5\u00a3R\2\u0313"+
- "\u0315\5\u00afX\2\u0314\u0312\3\2\2\2\u0314\u0313\3\2\2\2\u0315\u00a2"+
- "\3\2\2\2\u0316\u0317\5w<\2\u0317\u0319\7\60\2\2\u0318\u031a\5w<\2\u0319"+
- "\u0318\3\2\2\2\u0319\u031a\3\2\2\2\u031a\u031c\3\2\2\2\u031b\u031d\5\u00a5"+
- "S\2\u031c\u031b\3\2\2\2\u031c\u031d\3\2\2\2\u031d\u031f\3\2\2\2\u031e"+
- "\u0320\5\u00adW\2\u031f\u031e\3\2\2\2\u031f\u0320\3\2\2\2\u0320\u0332"+
- "\3\2\2\2\u0321\u0322\7\60\2\2\u0322\u0324\5w<\2\u0323\u0325\5\u00a5S\2"+
- "\u0324\u0323\3\2\2\2\u0324\u0325\3\2\2\2\u0325\u0327\3\2\2\2\u0326\u0328"+
- "\5\u00adW\2\u0327\u0326\3\2\2\2\u0327\u0328\3\2\2\2\u0328\u0332\3\2\2"+
- "\2\u0329\u032a\5w<\2\u032a\u032c\5\u00a5S\2\u032b\u032d\5\u00adW\2\u032c"+
- "\u032b\3\2\2\2\u032c\u032d\3\2\2\2\u032d\u0332\3\2\2\2\u032e\u032f\5w"+
- "<\2\u032f\u0330\5\u00adW\2\u0330\u0332\3\2\2\2\u0331\u0316\3\2\2\2\u0331"+
- "\u0321\3\2\2\2\u0331\u0329\3\2\2\2\u0331\u032e\3\2\2\2\u0332\u00a4\3\2"+
- "\2\2\u0333\u0334\5\u00a7T\2\u0334\u0335\5\u00a9U\2\u0335\u00a6\3\2\2\2"+
- "\u0336\u0337\t\t\2\2\u0337\u00a8\3\2\2\2\u0338\u033a\5\u00abV\2\u0339"+
- "\u0338\3\2\2\2\u0339\u033a\3\2\2\2\u033a\u033b\3\2\2\2\u033b\u033c\5w"+
- "<\2\u033c\u00aa\3\2\2\2\u033d\u033e\t\n\2\2\u033e\u00ac\3\2\2\2\u033f"+
- "\u0340\t\13\2\2\u0340\u00ae\3\2\2\2\u0341\u0342\5\u00b1Y\2\u0342\u0344"+
- "\5\u00b3Z\2\u0343\u0345\5\u00adW\2\u0344\u0343\3\2\2\2\u0344\u0345\3\2"+
- "\2\2\u0345\u00b0\3\2\2\2\u0346\u0348\5\u0083B\2\u0347\u0349\7\60\2\2\u0348"+
- "\u0347\3\2\2\2\u0348\u0349\3\2\2\2\u0349\u0352\3\2\2\2\u034a\u034b\7\62"+
- "\2\2\u034b\u034d\t\4\2\2\u034c\u034e\5\u0085C\2\u034d\u034c\3\2\2\2\u034d"+
- "\u034e\3\2\2\2\u034e\u034f\3\2\2\2\u034f\u0350\7\60\2\2\u0350\u0352\5"+
- "\u0085C\2\u0351\u0346\3\2\2\2\u0351\u034a\3\2\2\2\u0352\u00b2\3\2\2\2"+
- "\u0353\u0354\5\u00b5[\2\u0354\u0355\5\u00a9U\2\u0355\u00b4\3\2\2\2\u0356"+
- "\u0357\t\f\2\2\u0357\u00b6\3\2\2\2\u0358\u0359\7v\2\2\u0359\u035a\7t\2"+
- "\2\u035a\u035b\7w\2\2\u035b\u0362\7g\2\2\u035c\u035d\7h\2\2\u035d\u035e"+
- "\7c\2\2\u035e\u035f\7n\2\2\u035f\u0360\7u\2\2\u0360\u0362\7g\2\2\u0361"+
- "\u0358\3\2\2\2\u0361\u035c\3\2\2\2\u0362\u00b8\3\2\2\2\u0363\u0364\7)"+
- "\2\2\u0364\u0365\5\u00bb^\2\u0365\u0366\7)\2\2\u0366\u036c\3\2\2\2\u0367"+
- "\u0368\7)\2\2\u0368\u0369\5\u00c3b\2\u0369\u036a\7)\2\2\u036a\u036c\3"+
- "\2\2\2\u036b\u0363\3\2\2\2\u036b\u0367\3\2\2\2\u036c\u00ba\3\2\2\2\u036d"+
- "\u036e\n\r\2\2\u036e\u00bc\3\2\2\2\u036f\u0371\7$\2\2\u0370\u0372\5\u00bf"+
- "`\2\u0371\u0370\3\2\2\2\u0371\u0372\3\2\2\2\u0372\u0373\3\2\2\2\u0373"+
- "\u0374\7$\2\2\u0374\u00be\3\2\2\2\u0375\u0377\5\u00c1a\2\u0376\u0375\3"+
- "\2\2\2\u0377\u0378\3\2\2\2\u0378\u0376\3\2\2\2\u0378\u0379\3\2\2\2\u0379"+
- "\u00c0\3\2\2\2\u037a\u037d\n\16\2\2\u037b\u037d\5\u00c3b\2\u037c\u037a"+
- "\3\2\2\2\u037c\u037b\3\2\2\2\u037d\u00c2\3\2\2\2\u037e\u037f\7^\2\2\u037f"+
- "\u0383\t\17\2\2\u0380\u0383\5\u00c5c\2\u0381\u0383\5\u00c9e\2\u0382\u037e"+
- "\3\2\2\2\u0382\u0380\3\2\2\2\u0382\u0381\3\2\2\2\u0383\u00c4\3\2\2\2\u0384"+
- "\u0385\7^\2\2\u0385\u0390\5\u0091I\2\u0386\u0387\7^\2\2\u0387\u0388\5"+
- "\u0091I\2\u0388\u0389\5\u0091I\2\u0389\u0390\3\2\2\2\u038a\u038b\7^\2"+
- "\2\u038b\u038c\5\u00c7d\2\u038c\u038d\5\u0091I\2\u038d\u038e\5\u0091I"+
- "\2\u038e\u0390\3\2\2\2\u038f\u0384\3\2\2\2\u038f\u0386\3\2\2\2\u038f\u038a"+
- "\3\2\2\2\u0390\u00c6\3\2\2\2\u0391\u0392\t\20\2\2\u0392\u00c8\3\2\2\2"+
- "\u0393\u0394\7^\2\2\u0394\u0395\7w\2\2\u0395\u0396\5\u0087D\2\u0396\u0397"+
- "\5\u0087D\2\u0397\u0398\5\u0087D\2\u0398\u0399\5\u0087D\2\u0399\u00ca"+
- "\3\2\2\2\u039a\u039b\7p\2\2\u039b\u039c\7w\2\2\u039c\u039d\7n\2\2\u039d"+
- "\u039e\7n\2\2\u039e\u00cc\3\2\2\2\u039f\u03a0\7*\2\2\u03a0\u00ce\3\2\2"+
- "\2\u03a1\u03a2\7+\2\2\u03a2\u00d0\3\2\2\2\u03a3\u03a4\7}\2\2\u03a4\u00d2"+
- "\3\2\2\2\u03a5\u03a6\7\177\2\2\u03a6\u00d4\3\2\2\2\u03a7\u03a8\7]\2\2"+
- "\u03a8\u00d6\3\2\2\2\u03a9\u03aa\7_\2\2\u03aa\u00d8\3\2\2\2\u03ab\u03ac"+
- "\7=\2\2\u03ac\u00da\3\2\2\2\u03ad\u03ae\7.\2\2\u03ae\u00dc\3\2\2\2\u03af"+
- "\u03b0\7\60\2\2\u03b0\u00de\3\2\2\2\u03b1\u03b2\7?\2\2\u03b2\u00e0\3\2"+
- "\2\2\u03b3\u03b4\7@\2\2\u03b4\u00e2\3\2\2\2\u03b5\u03b6\7>\2\2\u03b6\u00e4"+
- "\3\2\2\2\u03b7\u03b8\7#\2\2\u03b8\u00e6\3\2\2\2\u03b9\u03ba\7\u0080\2"+
- "\2\u03ba\u00e8\3\2\2\2\u03bb\u03bc\7A\2\2\u03bc\u00ea\3\2\2\2\u03bd\u03be"+
- "\7<\2\2\u03be\u00ec\3\2\2\2\u03bf\u03c0\7?\2\2\u03c0\u03c1\7?\2\2\u03c1"+
- "\u00ee\3\2\2\2\u03c2\u03c3\7>\2\2\u03c3\u03c4\7?\2\2\u03c4\u00f0\3\2\2"+
- "\2\u03c5\u03c6\7@\2\2\u03c6\u03c7\7?\2\2\u03c7\u00f2\3\2\2\2\u03c8\u03c9"+
- "\7#\2\2\u03c9\u03ca\7?\2\2\u03ca\u00f4\3\2\2\2\u03cb\u03cc\7(\2\2\u03cc"+
- "\u03cd\7(\2\2\u03cd\u00f6\3\2\2\2\u03ce\u03cf\7~\2\2\u03cf\u03d0\7~\2"+
- "\2\u03d0\u00f8\3\2\2\2\u03d1\u03d2\7-\2\2\u03d2\u03d3\7-\2\2\u03d3\u00fa"+
- "\3\2\2\2\u03d4\u03d5\7/\2\2\u03d5\u03d6\7/\2\2\u03d6\u00fc\3\2\2\2\u03d7"+
- "\u03d8\7-\2\2\u03d8\u00fe\3\2\2\2\u03d9\u03da\7/\2\2\u03da\u0100\3\2\2"+
- "\2\u03db\u03dc\7,\2\2\u03dc\u0102\3\2\2\2\u03dd\u03de\7\61\2\2\u03de\u0104"+
- "\3\2\2\2\u03df\u03e0\7(\2\2\u03e0\u0106\3\2\2\2\u03e1\u03e2\7~\2\2\u03e2"+
- "\u0108\3\2\2\2\u03e3\u03e4\7`\2\2\u03e4\u010a\3\2\2\2\u03e5\u03e6\7\'"+
- "\2\2\u03e6\u010c\3\2\2\2\u03e7\u03e8\7/\2\2\u03e8\u03e9\7@\2\2\u03e9\u010e"+
- "\3\2\2\2\u03ea\u03eb\7<\2\2\u03eb\u03ec\7<\2\2\u03ec\u0110\3\2\2\2\u03ed"+
- "\u03ee\7-\2\2\u03ee\u03ef\7?\2\2\u03ef\u0112\3\2\2\2\u03f0\u03f1\7/\2"+
- "\2\u03f1\u03f2\7?\2\2\u03f2\u0114\3\2\2\2\u03f3\u03f4\7,\2\2\u03f4\u03f5"+
- "\7?\2\2\u03f5\u0116\3\2\2\2\u03f6\u03f7\7\61\2\2\u03f7\u03f8\7?\2\2\u03f8"+
- "\u0118\3\2\2\2\u03f9\u03fa\7(\2\2\u03fa\u03fb\7?\2\2\u03fb\u011a\3\2\2"+
- "\2\u03fc\u03fd\7~\2\2\u03fd\u03fe\7?\2\2\u03fe\u011c\3\2\2\2\u03ff\u0400"+
- "\7`\2\2\u0400\u0401\7?\2\2\u0401\u011e\3\2\2\2\u0402\u0403\7\'\2\2\u0403"+
- "\u0404\7?\2\2\u0404\u0120\3\2\2\2\u0405\u0406\7>\2\2\u0406\u0407\7>\2"+
- "\2\u0407\u0408\7?\2\2\u0408\u0122\3\2\2\2\u0409\u040a\7@\2\2\u040a\u040b"+
- "\7@\2\2\u040b\u040c\7?\2\2\u040c\u0124\3\2\2\2\u040d\u040e\7@\2\2\u040e"+
- "\u040f\7@\2\2\u040f\u0410\7@\2\2\u0410\u0411\7?\2\2\u0411\u0126\3\2\2"+
- "\2\u0412\u0416\5\u0129\u0095\2\u0413\u0415\5\u012b\u0096\2\u0414\u0413"+
- "\3\2\2\2\u0415\u0418\3\2\2\2\u0416\u0414\3\2\2\2\u0416\u0417\3\2\2\2\u0417"+
- "\u0128\3\2\2\2\u0418\u0416\3\2\2\2\u0419\u0420\t\21\2\2\u041a\u041b\n"+
- "\22\2\2\u041b\u0420\6\u0095\2\2\u041c\u041d\t\23\2\2\u041d\u041e\t\24"+
- "\2\2\u041e\u0420\6\u0095\3\2\u041f\u0419\3\2\2\2\u041f\u041a\3\2\2\2\u041f"+
- "\u041c\3\2\2\2\u0420\u012a\3\2\2\2\u0421\u0428\t\25\2\2\u0422\u0423\n"+
- "\22\2\2\u0423\u0428\6\u0096\4\2\u0424\u0425\t\23\2\2\u0425\u0426\t\24"+
- "\2\2\u0426\u0428\6\u0096\5\2\u0427\u0421\3\2\2\2\u0427\u0422\3\2\2\2\u0427"+
- "\u0424\3\2\2\2\u0428\u012c\3\2\2\2\u0429\u042a\7B\2\2\u042a\u012e\3\2"+
- "\2\2\u042b\u042c\7\60\2\2\u042c\u042d\7\60\2\2\u042d\u042e\7\60\2\2\u042e"+
- "\u0130\3\2\2\2\u042f\u0431\t\26\2\2\u0430\u042f\3\2\2\2\u0431\u0432\3"+
- "\2\2\2\u0432\u0430\3\2\2\2\u0432\u0433\3\2\2\2\u0433\u0434\3\2\2\2\u0434"+
- "\u0435\b\u0099\2\2\u0435\u0132\3\2\2\2\u0436\u0437\7\61\2\2\u0437\u0438"+
- "\7,\2\2\u0438\u043c\3\2\2\2\u0439\u043b\13\2\2\2\u043a\u0439\3\2\2\2\u043b"+
- "\u043e\3\2\2\2\u043c\u043d\3\2\2\2\u043c\u043a\3\2\2\2\u043d\u043f\3\2"+
- "\2\2\u043e\u043c\3\2\2\2\u043f\u0440\7,\2\2\u0440\u0441\7\61\2\2\u0441"+
- "\u0442\3\2\2\2\u0442\u0443\b\u009a\2\2\u0443\u0134\3\2\2\2\u0444\u0445"+
- "\7\61\2\2\u0445\u0446\7\61\2\2\u0446\u044a\3\2\2\2\u0447\u0449\n\27\2"+
- "\2\u0448\u0447\3\2\2\2\u0449\u044c\3\2\2\2\u044a\u0448\3\2\2\2\u044a\u044b"+
- "\3\2\2\2\u044b\u044d\3\2\2\2\u044c\u044a\3\2\2\2\u044d\u044e\b\u009b\2"+
- "\2\u044e\u0136\3\2\2\28\2\u0293\u0297\u029b\u029f\u02a3\u02aa\u02af\u02b1"+
- "\u02b5\u02b8\u02bc\u02c3\u02c7\u02cc\u02d4\u02d7\u02de\u02e2\u02e6\u02ec"+
- "\u02ef\u02f6\u02fa\u0302\u0305\u030c\u0310\u0314\u0319\u031c\u031f\u0324"+
- "\u0327\u032c\u0331\u0339\u0344\u0348\u034d\u0351\u0361\u036b\u0371\u0378"+
- "\u037c\u0382\u038f\u0416\u041f\u0427\u0432\u043c\u044a\3\b\2\2";
+ "\3\2\2\2\2\u0135\3\2\2\2\3\u0137\3\2\2\2\5\u013b\3\2\2\2\7\u0144\3\2\2"+
+ "\2\t\u014b\3\2\2\2\13\u0153\3\2\2\2\r\u0159\3\2\2\2\17\u015e\3\2\2\2\21"+
+ "\u0163\3\2\2\2\23\u0169\3\2\2\2\25\u016e\3\2\2\2\27\u0174\3\2\2\2\31\u017a"+
+ "\3\2\2\2\33\u0183\3\2\2\2\35\u018b\3\2\2\2\37\u018e\3\2\2\2!\u0195\3\2"+
+ "\2\2#\u019a\3\2\2\2%\u019f\3\2\2\2\'\u01a7\3\2\2\2)\u01ad\3\2\2\2+\u01b5"+
+ "\3\2\2\2-\u01bb\3\2\2\2/\u01bf\3\2\2\2\61\u01c2\3\2\2\2\63\u01c7\3\2\2"+
+ "\2\65\u01d2\3\2\2\2\67\u01d9\3\2\2\29\u01e4\3\2\2\2;\u01e8\3\2\2\2=\u01f2"+
+ "\3\2\2\2?\u01f7\3\2\2\2A\u01fe\3\2\2\2C\u0202\3\2\2\2E\u020a\3\2\2\2G"+
+ "\u0212\3\2\2\2I\u021c\3\2\2\2K\u0223\3\2\2\2M\u022a\3\2\2\2O\u0230\3\2"+
+ "\2\2Q\u0237\3\2\2\2S\u0240\3\2\2\2U\u0246\3\2\2\2W\u024d\3\2\2\2Y\u025a"+
+ "\3\2\2\2[\u025f\3\2\2\2]\u0265\3\2\2\2_\u026c\3\2\2\2a\u0276\3\2\2\2c"+
+ "\u027a\3\2\2\2e\u027f\3\2\2\2g\u0288\3\2\2\2i\u0292\3\2\2\2k\u0294\3\2"+
+ "\2\2m\u0298\3\2\2\2o\u029c\3\2\2\2q\u02a0\3\2\2\2s\u02a4\3\2\2\2u\u02b0"+
+ "\3\2\2\2w\u02b2\3\2\2\2y\u02bb\3\2\2\2{\u02bd\3\2\2\2}\u02c0\3\2\2\2\177"+
+ "\u02c6\3\2\2\2\u0081\u02c9\3\2\2\2\u0083\u02cd\3\2\2\2\u0085\u02d1\3\2"+
+ "\2\2\u0087\u02d8\3\2\2\2\u0089\u02db\3\2\2\2\u008b\u02e1\3\2\2\2\u008d"+
+ "\u02e3\3\2\2\2\u008f\u02e9\3\2\2\2\u0091\u02f0\3\2\2\2\u0093\u02f3\3\2"+
+ "\2\2\u0095\u02f9\3\2\2\2\u0097\u02fb\3\2\2\2\u0099\u02ff\3\2\2\2\u009b"+
+ "\u0306\3\2\2\2\u009d\u0309\3\2\2\2\u009f\u030f\3\2\2\2\u00a1\u0313\3\2"+
+ "\2\2\u00a3\u0330\3\2\2\2\u00a5\u0332\3\2\2\2\u00a7\u0335\3\2\2\2\u00a9"+
+ "\u0338\3\2\2\2\u00ab\u033c\3\2\2\2\u00ad\u033e\3\2\2\2\u00af\u0340\3\2"+
+ "\2\2\u00b1\u0350\3\2\2\2\u00b3\u0352\3\2\2\2\u00b5\u0355\3\2\2\2\u00b7"+
+ "\u0360\3\2\2\2\u00b9\u036a\3\2\2\2\u00bb\u036c\3\2\2\2\u00bd\u036e\3\2"+
+ "\2\2\u00bf\u0375\3\2\2\2\u00c1\u037b\3\2\2\2\u00c3\u0381\3\2\2\2\u00c5"+
+ "\u038e\3\2\2\2\u00c7\u0390\3\2\2\2\u00c9\u0392\3\2\2\2\u00cb\u0399\3\2"+
+ "\2\2\u00cd\u039e\3\2\2\2\u00cf\u03a0\3\2\2\2\u00d1\u03a2\3\2\2\2\u00d3"+
+ "\u03a4\3\2\2\2\u00d5\u03a6\3\2\2\2\u00d7\u03a8\3\2\2\2\u00d9\u03aa\3\2"+
+ "\2\2\u00db\u03ac\3\2\2\2\u00dd\u03ae\3\2\2\2\u00df\u03b0\3\2\2\2\u00e1"+
+ "\u03b2\3\2\2\2\u00e3\u03b4\3\2\2\2\u00e5\u03b6\3\2\2\2\u00e7\u03b8\3\2"+
+ "\2\2\u00e9\u03ba\3\2\2\2\u00eb\u03bc\3\2\2\2\u00ed\u03be\3\2\2\2\u00ef"+
+ "\u03c1\3\2\2\2\u00f1\u03c4\3\2\2\2\u00f3\u03c7\3\2\2\2\u00f5\u03ca\3\2"+
+ "\2\2\u00f7\u03cd\3\2\2\2\u00f9\u03d0\3\2\2\2\u00fb\u03d3\3\2\2\2\u00fd"+
+ "\u03d6\3\2\2\2\u00ff\u03d8\3\2\2\2\u0101\u03da\3\2\2\2\u0103\u03dc\3\2"+
+ "\2\2\u0105\u03de\3\2\2\2\u0107\u03e0\3\2\2\2\u0109\u03e2\3\2\2\2\u010b"+
+ "\u03e4\3\2\2\2\u010d\u03e6\3\2\2\2\u010f\u03e9\3\2\2\2\u0111\u03ec\3\2"+
+ "\2\2\u0113\u03ef\3\2\2\2\u0115\u03f2\3\2\2\2\u0117\u03f5\3\2\2\2\u0119"+
+ "\u03f8\3\2\2\2\u011b\u03fb\3\2\2\2\u011d\u03fe\3\2\2\2\u011f\u0401\3\2"+
+ "\2\2\u0121\u0404\3\2\2\2\u0123\u0408\3\2\2\2\u0125\u040c\3\2\2\2\u0127"+
+ "\u0411\3\2\2\2\u0129\u041e\3\2\2\2\u012b\u0426\3\2\2\2\u012d\u0428\3\2"+
+ "\2\2\u012f\u042a\3\2\2\2\u0131\u042f\3\2\2\2\u0133\u0435\3\2\2\2\u0135"+
+ "\u0443\3\2\2\2\u0137\u0138\7x\2\2\u0138\u0139\7c\2\2\u0139\u013a\7t\2"+
+ "\2\u013a\4\3\2\2\2\u013b\u013c\7c\2\2\u013c\u013d\7d\2\2\u013d\u013e\7"+
+ "u\2\2\u013e\u013f\7v\2\2\u013f\u0140\7t\2\2\u0140\u0141\7c\2\2\u0141\u0142"+
+ "\7e\2\2\u0142\u0143\7v\2\2\u0143\6\3\2\2\2\u0144\u0145\7c\2\2\u0145\u0146"+
+ "\7u\2\2\u0146\u0147\7u\2\2\u0147\u0148\7g\2\2\u0148\u0149\7t\2\2\u0149"+
+ "\u014a\7v\2\2\u014a\b\3\2\2\2\u014b\u014c\7d\2\2\u014c\u014d\7q\2\2\u014d"+
+ "\u014e\7q\2\2\u014e\u014f\7n\2\2\u014f\u0150\7g\2\2\u0150\u0151\7c\2\2"+
+ "\u0151\u0152\7p\2\2\u0152\n\3\2\2\2\u0153\u0154\7d\2\2\u0154\u0155\7t"+
+ "\2\2\u0155\u0156\7g\2\2\u0156\u0157\7c\2\2\u0157\u0158\7m\2\2\u0158\f"+
+ "\3\2\2\2\u0159\u015a\7d\2\2\u015a\u015b\7{\2\2\u015b\u015c\7v\2\2\u015c"+
+ "\u015d\7g\2\2\u015d\16\3\2\2\2\u015e\u015f\7e\2\2\u015f\u0160\7c\2\2\u0160"+
+ "\u0161\7u\2\2\u0161\u0162\7g\2\2\u0162\20\3\2\2\2\u0163\u0164\7e\2\2\u0164"+
+ "\u0165\7c\2\2\u0165\u0166\7v\2\2\u0166\u0167\7e\2\2\u0167\u0168\7j\2\2"+
+ "\u0168\22\3\2\2\2\u0169\u016a\7e\2\2\u016a\u016b\7j\2\2\u016b\u016c\7"+
+ "c\2\2\u016c\u016d\7t\2\2\u016d\24\3\2\2\2\u016e\u016f\7e\2\2\u016f\u0170"+
+ "\7n\2\2\u0170\u0171\7c\2\2\u0171\u0172\7u\2\2\u0172\u0173\7u\2\2\u0173"+
+ "\26\3\2\2\2\u0174\u0175\7e\2\2\u0175\u0176\7q\2\2\u0176\u0177\7p\2\2\u0177"+
+ "\u0178\7u\2\2\u0178\u0179\7v\2\2\u0179\30\3\2\2\2\u017a\u017b\7e\2\2\u017b"+
+ "\u017c\7q\2\2\u017c\u017d\7p\2\2\u017d\u017e\7v\2\2\u017e\u017f\7k\2\2"+
+ "\u017f\u0180\7p\2\2\u0180\u0181\7w\2\2\u0181\u0182\7g\2\2\u0182\32\3\2"+
+ "\2\2\u0183\u0184\7f\2\2\u0184\u0185\7g\2\2\u0185\u0186\7h\2\2\u0186\u0187"+
+ "\7c\2\2\u0187\u0188\7w\2\2\u0188\u0189\7n\2\2\u0189\u018a\7v\2\2\u018a"+
+ "\34\3\2\2\2\u018b\u018c\7f\2\2\u018c\u018d\7q\2\2\u018d\36\3\2\2\2\u018e"+
+ "\u018f\7f\2\2\u018f\u0190\7q\2\2\u0190\u0191\7w\2\2\u0191\u0192\7d\2\2"+
+ "\u0192\u0193\7n\2\2\u0193\u0194\7g\2\2\u0194 \3\2\2\2\u0195\u0196\7g\2"+
+ "\2\u0196\u0197\7n\2\2\u0197\u0198\7u\2\2\u0198\u0199\7g\2\2\u0199\"\3"+
+ "\2\2\2\u019a\u019b\7g\2\2\u019b\u019c\7p\2\2\u019c\u019d\7w\2\2\u019d"+
+ "\u019e\7o\2\2\u019e$\3\2\2\2\u019f\u01a0\7g\2\2\u01a0\u01a1\7z\2\2\u01a1"+
+ "\u01a2\7v\2\2\u01a2\u01a3\7g\2\2\u01a3\u01a4\7p\2\2\u01a4\u01a5\7f\2\2"+
+ "\u01a5\u01a6\7u\2\2\u01a6&\3\2\2\2\u01a7\u01a8\7h\2\2\u01a8\u01a9\7k\2"+
+ "\2\u01a9\u01aa\7p\2\2\u01aa\u01ab\7c\2\2\u01ab\u01ac\7n\2\2\u01ac(\3\2"+
+ "\2\2\u01ad\u01ae\7h\2\2\u01ae\u01af\7k\2\2\u01af\u01b0\7p\2\2\u01b0\u01b1"+
+ "\7c\2\2\u01b1\u01b2\7n\2\2\u01b2\u01b3\7n\2\2\u01b3\u01b4\7{\2\2\u01b4"+
+ "*\3\2\2\2\u01b5\u01b6\7h\2\2\u01b6\u01b7\7n\2\2\u01b7\u01b8\7q\2\2\u01b8"+
+ "\u01b9\7c\2\2\u01b9\u01ba\7v\2\2\u01ba,\3\2\2\2\u01bb\u01bc\7h\2\2\u01bc"+
+ "\u01bd\7q\2\2\u01bd\u01be\7t\2\2\u01be.\3\2\2\2\u01bf\u01c0\7k\2\2\u01c0"+
+ "\u01c1\7h\2\2\u01c1\60\3\2\2\2\u01c2\u01c3\7i\2\2\u01c3\u01c4\7q\2\2\u01c4"+
+ "\u01c5\7v\2\2\u01c5\u01c6\7q\2\2\u01c6\62\3\2\2\2\u01c7\u01c8\7k\2\2\u01c8"+
+ "\u01c9\7o\2\2\u01c9\u01ca\7r\2\2\u01ca\u01cb\7n\2\2\u01cb\u01cc\7g\2\2"+
+ "\u01cc\u01cd\7o\2\2\u01cd\u01ce\7g\2\2\u01ce\u01cf\7p\2\2\u01cf\u01d0"+
+ "\7v\2\2\u01d0\u01d1\7u\2\2\u01d1\64\3\2\2\2\u01d2\u01d3\7k\2\2\u01d3\u01d4"+
+ "\7o\2\2\u01d4\u01d5\7r\2\2\u01d5\u01d6\7q\2\2\u01d6\u01d7\7t\2\2\u01d7"+
+ "\u01d8\7v\2\2\u01d8\66\3\2\2\2\u01d9\u01da\7k\2\2\u01da\u01db\7p\2\2\u01db"+
+ "\u01dc\7u\2\2\u01dc\u01dd\7v\2\2\u01dd\u01de\7c\2\2\u01de\u01df\7p\2\2"+
+ "\u01df\u01e0\7e\2\2\u01e0\u01e1\7g\2\2\u01e1\u01e2\7q\2\2\u01e2\u01e3"+
+ "\7h\2\2\u01e38\3\2\2\2\u01e4\u01e5\7k\2\2\u01e5\u01e6\7p\2\2\u01e6\u01e7"+
+ "\7v\2\2\u01e7:\3\2\2\2\u01e8\u01e9\7k\2\2\u01e9\u01ea\7p\2\2\u01ea\u01eb"+
+ "\7v\2\2\u01eb\u01ec\7g\2\2\u01ec\u01ed\7t\2\2\u01ed\u01ee\7h\2\2\u01ee"+
+ "\u01ef\7c\2\2\u01ef\u01f0\7e\2\2\u01f0\u01f1\7g\2\2\u01f1<\3\2\2\2\u01f2"+
+ "\u01f3\7n\2\2\u01f3\u01f4\7q\2\2\u01f4\u01f5\7p\2\2\u01f5\u01f6\7i\2\2"+
+ "\u01f6>\3\2\2\2\u01f7\u01f8\7p\2\2\u01f8\u01f9\7c\2\2\u01f9\u01fa\7v\2"+
+ "\2\u01fa\u01fb\7k\2\2\u01fb\u01fc\7x\2\2\u01fc\u01fd\7g\2\2\u01fd@\3\2"+
+ "\2\2\u01fe\u01ff\7p\2\2\u01ff\u0200\7g\2\2\u0200\u0201\7y\2\2\u0201B\3"+
+ "\2\2\2\u0202\u0203\7r\2\2\u0203\u0204\7c\2\2\u0204\u0205\7e\2\2\u0205"+
+ "\u0206\7m\2\2\u0206\u0207\7c\2\2\u0207\u0208\7i\2\2\u0208\u0209\7g\2\2"+
+ "\u0209D\3\2\2\2\u020a\u020b\7r\2\2\u020b\u020c\7t\2\2\u020c\u020d\7k\2"+
+ "\2\u020d\u020e\7x\2\2\u020e\u020f\7c\2\2\u020f\u0210\7v\2\2\u0210\u0211"+
+ "\7g\2\2\u0211F\3\2\2\2\u0212\u0213\7r\2\2\u0213\u0214\7t\2\2\u0214\u0215"+
+ "\7q\2\2\u0215\u0216\7v\2\2\u0216\u0217\7g\2\2\u0217\u0218\7e\2\2\u0218"+
+ "\u0219\7v\2\2\u0219\u021a\7g\2\2\u021a\u021b\7f\2\2\u021bH\3\2\2\2\u021c"+
+ "\u021d\7r\2\2\u021d\u021e\7w\2\2\u021e\u021f\7d\2\2\u021f\u0220\7n\2\2"+
+ "\u0220\u0221\7k\2\2\u0221\u0222\7e\2\2\u0222J\3\2\2\2\u0223\u0224\7t\2"+
+ "\2\u0224\u0225\7g\2\2\u0225\u0226\7v\2\2\u0226\u0227\7w\2\2\u0227\u0228"+
+ "\7t\2\2\u0228\u0229\7p\2\2\u0229L\3\2\2\2\u022a\u022b\7u\2\2\u022b\u022c"+
+ "\7j\2\2\u022c\u022d\7q\2\2\u022d\u022e\7t\2\2\u022e\u022f\7v\2\2\u022f"+
+ "N\3\2\2\2\u0230\u0231\7u\2\2\u0231\u0232\7v\2\2\u0232\u0233\7c\2\2\u0233"+
+ "\u0234\7v\2\2\u0234\u0235\7k\2\2\u0235\u0236\7e\2\2\u0236P\3\2\2\2\u0237"+
+ "\u0238\7u\2\2\u0238\u0239\7v\2\2\u0239\u023a\7t\2\2\u023a\u023b\7k\2\2"+
+ "\u023b\u023c\7e\2\2\u023c\u023d\7v\2\2\u023d\u023e\7h\2\2\u023e\u023f"+
+ "\7r\2\2\u023fR\3\2\2\2\u0240\u0241\7u\2\2\u0241\u0242\7w\2\2\u0242\u0243"+
+ "\7r\2\2\u0243\u0244\7g\2\2\u0244\u0245\7t\2\2\u0245T\3\2\2\2\u0246\u0247"+
+ "\7u\2\2\u0247\u0248\7y\2\2\u0248\u0249\7k\2\2\u0249\u024a\7v\2\2\u024a"+
+ "\u024b\7e\2\2\u024b\u024c\7j\2\2\u024cV\3\2\2\2\u024d\u024e\7u\2\2\u024e"+
+ "\u024f\7{\2\2\u024f\u0250\7p\2\2\u0250\u0251\7e\2\2\u0251\u0252\7j\2\2"+
+ "\u0252\u0253\7t\2\2\u0253\u0254\7q\2\2\u0254\u0255\7p\2\2\u0255\u0256"+
+ "\7k\2\2\u0256\u0257\7|\2\2\u0257\u0258\7g\2\2\u0258\u0259\7f\2\2\u0259"+
+ "X\3\2\2\2\u025a\u025b\7v\2\2\u025b\u025c\7j\2\2\u025c\u025d\7k\2\2\u025d"+
+ "\u025e\7u\2\2\u025eZ\3\2\2\2\u025f\u0260\7v\2\2\u0260\u0261\7j\2\2\u0261"+
+ "\u0262\7t\2\2\u0262\u0263\7q\2\2\u0263\u0264\7y\2\2\u0264\\\3\2\2\2\u0265"+
+ "\u0266\7v\2\2\u0266\u0267\7j\2\2\u0267\u0268\7t\2\2\u0268\u0269\7q\2\2"+
+ "\u0269\u026a\7y\2\2\u026a\u026b\7u\2\2\u026b^\3\2\2\2\u026c\u026d\7v\2"+
+ "\2\u026d\u026e\7t\2\2\u026e\u026f\7c\2\2\u026f\u0270\7p\2\2\u0270\u0271"+
+ "\7u\2\2\u0271\u0272\7k\2\2\u0272\u0273\7g\2\2\u0273\u0274\7p\2\2\u0274"+
+ "\u0275\7v\2\2\u0275`\3\2\2\2\u0276\u0277\7v\2\2\u0277\u0278\7t\2\2\u0278"+
+ "\u0279\7{\2\2\u0279b\3\2\2\2\u027a\u027b\7x\2\2\u027b\u027c\7q\2\2\u027c"+
+ "\u027d\7k\2\2\u027d\u027e\7f\2\2\u027ed\3\2\2\2\u027f\u0280\7x\2\2\u0280"+
+ "\u0281\7q\2\2\u0281\u0282\7n\2\2\u0282\u0283\7c\2\2\u0283\u0284\7v\2\2"+
+ "\u0284\u0285\7k\2\2\u0285\u0286\7n\2\2\u0286\u0287\7g\2\2\u0287f\3\2\2"+
+ "\2\u0288\u0289\7y\2\2\u0289\u028a\7j\2\2\u028a\u028b\7k\2\2\u028b\u028c"+
+ "\7n\2\2\u028c\u028d\7g\2\2\u028dh\3\2\2\2\u028e\u0293\5k\66\2\u028f\u0293"+
+ "\5m\67\2\u0290\u0293\5o8\2\u0291\u0293\5q9\2\u0292\u028e\3\2\2\2\u0292"+
+ "\u028f\3\2\2\2\u0292\u0290\3\2\2\2\u0292\u0291\3\2\2\2\u0293j\3\2\2\2"+
+ "\u0294\u0296\5u;\2\u0295\u0297\5s:\2\u0296\u0295\3\2\2\2\u0296\u0297\3"+
+ "\2\2\2\u0297l\3\2\2\2\u0298\u029a\5\u0083B\2\u0299\u029b\5s:\2\u029a\u0299"+
+ "\3\2\2\2\u029a\u029b\3\2\2\2\u029bn\3\2\2\2\u029c\u029e\5\u008dG\2\u029d"+
+ "\u029f\5s:\2\u029e\u029d\3\2\2\2\u029e\u029f\3\2\2\2\u029fp\3\2\2\2\u02a0"+
+ "\u02a2\5\u0097L\2\u02a1\u02a3\5s:\2\u02a2\u02a1\3\2\2\2\u02a2\u02a3\3"+
+ "\2\2\2\u02a3r\3\2\2\2\u02a4\u02a5\t\2\2\2\u02a5t\3\2\2\2\u02a6\u02b1\7"+
+ "\62\2\2\u02a7\u02ae\5{>\2\u02a8\u02aa\5w<\2\u02a9\u02a8\3\2\2\2\u02a9"+
+ "\u02aa\3\2\2\2\u02aa\u02af\3\2\2\2\u02ab\u02ac\5\u0081A\2\u02ac\u02ad"+
+ "\5w<\2\u02ad\u02af\3\2\2\2\u02ae\u02a9\3\2\2\2\u02ae\u02ab\3\2\2\2\u02af"+
+ "\u02b1\3\2\2\2\u02b0\u02a6\3\2\2\2\u02b0\u02a7\3\2\2\2\u02b1v\3\2\2\2"+
+ "\u02b2\u02b7\5y=\2\u02b3\u02b5\5}?\2\u02b4\u02b3\3\2\2\2\u02b4\u02b5\3"+
+ "\2\2\2\u02b5\u02b6\3\2\2\2\u02b6\u02b8\5y=\2\u02b7\u02b4\3\2\2\2\u02b7"+
+ "\u02b8\3\2\2\2\u02b8x\3\2\2\2\u02b9\u02bc\7\62\2\2\u02ba\u02bc\5{>\2\u02bb"+
+ "\u02b9\3\2\2\2\u02bb\u02ba\3\2\2\2\u02bcz\3\2\2\2\u02bd\u02be\t\3\2\2"+
+ "\u02be|\3\2\2\2\u02bf\u02c1\5\177@\2\u02c0\u02bf\3\2\2\2\u02c1\u02c2\3"+
+ "\2\2\2\u02c2\u02c0\3\2\2\2\u02c2\u02c3\3\2\2\2\u02c3~\3\2\2\2\u02c4\u02c7"+
+ "\5y=\2\u02c5\u02c7\7a\2\2\u02c6\u02c4\3\2\2\2\u02c6\u02c5\3\2\2\2\u02c7"+
+ "\u0080\3\2\2\2\u02c8\u02ca\7a\2\2\u02c9\u02c8\3\2\2\2\u02ca\u02cb\3\2"+
+ "\2\2\u02cb\u02c9\3\2\2\2\u02cb\u02cc\3\2\2\2\u02cc\u0082\3\2\2\2\u02cd"+
+ "\u02ce\7\62\2\2\u02ce\u02cf\t\4\2\2\u02cf\u02d0\5\u0085C\2\u02d0\u0084"+
+ "\3\2\2\2\u02d1\u02d6\5\u0087D\2\u02d2\u02d4\5\u0089E\2\u02d3\u02d2\3\2"+
+ "\2\2\u02d3\u02d4\3\2\2\2\u02d4\u02d5\3\2\2\2\u02d5\u02d7\5\u0087D\2\u02d6"+
+ "\u02d3\3\2\2\2\u02d6\u02d7\3\2\2\2\u02d7\u0086\3\2\2\2\u02d8\u02d9\t\5"+
+ "\2\2\u02d9\u0088\3\2\2\2\u02da\u02dc\5\u008bF\2\u02db\u02da\3\2\2\2\u02dc"+
+ "\u02dd\3\2\2\2\u02dd\u02db\3\2\2\2\u02dd\u02de\3\2\2\2\u02de\u008a\3\2"+
+ "\2\2\u02df\u02e2\5\u0087D\2\u02e0\u02e2\7a\2\2\u02e1\u02df\3\2\2\2\u02e1"+
+ "\u02e0\3\2\2\2\u02e2\u008c\3\2\2\2\u02e3\u02e5\7\62\2\2\u02e4\u02e6\5"+
+ "\u0081A\2\u02e5\u02e4\3\2\2\2\u02e5\u02e6\3\2\2\2\u02e6\u02e7\3\2\2\2"+
+ "\u02e7\u02e8\5\u008fH\2\u02e8\u008e\3\2\2\2\u02e9\u02ee\5\u0091I\2\u02ea"+
+ "\u02ec\5\u0093J\2\u02eb\u02ea\3\2\2\2\u02eb\u02ec\3\2\2\2\u02ec\u02ed"+
+ "\3\2\2\2\u02ed\u02ef\5\u0091I\2\u02ee\u02eb\3\2\2\2\u02ee\u02ef\3\2\2"+
+ "\2\u02ef\u0090\3\2\2\2\u02f0\u02f1\t\6\2\2\u02f1\u0092\3\2\2\2\u02f2\u02f4"+
+ "\5\u0095K\2\u02f3\u02f2\3\2\2\2\u02f4\u02f5\3\2\2\2\u02f5\u02f3\3\2\2"+
+ "\2\u02f5\u02f6\3\2\2\2\u02f6\u0094\3\2\2\2\u02f7\u02fa\5\u0091I\2\u02f8"+
+ "\u02fa\7a\2\2\u02f9\u02f7\3\2\2\2\u02f9\u02f8\3\2\2\2\u02fa\u0096\3\2"+
+ "\2\2\u02fb\u02fc\7\62\2\2\u02fc\u02fd\t\7\2\2\u02fd\u02fe\5\u0099M\2\u02fe"+
+ "\u0098\3\2\2\2\u02ff\u0304\5\u009bN\2\u0300\u0302\5\u009dO\2\u0301\u0300"+
+ "\3\2\2\2\u0301\u0302\3\2\2\2\u0302\u0303\3\2\2\2\u0303\u0305\5\u009bN"+
+ "\2\u0304\u0301\3\2\2\2\u0304\u0305\3\2\2\2\u0305\u009a\3\2\2\2\u0306\u0307"+
+ "\t\b\2\2\u0307\u009c\3\2\2\2\u0308\u030a\5\u009fP\2\u0309\u0308\3\2\2"+
+ "\2\u030a\u030b\3\2\2\2\u030b\u0309\3\2\2\2\u030b\u030c\3\2\2\2\u030c\u009e"+
+ "\3\2\2\2\u030d\u0310\5\u009bN\2\u030e\u0310\7a\2\2\u030f\u030d\3\2\2\2"+
+ "\u030f\u030e\3\2\2\2\u0310\u00a0\3\2\2\2\u0311\u0314\5\u00a3R\2\u0312"+
+ "\u0314\5\u00afX\2\u0313\u0311\3\2\2\2\u0313\u0312\3\2\2\2\u0314\u00a2"+
+ "\3\2\2\2\u0315\u0316\5w<\2\u0316\u0318\7\60\2\2\u0317\u0319\5w<\2\u0318"+
+ "\u0317\3\2\2\2\u0318\u0319\3\2\2\2\u0319\u031b\3\2\2\2\u031a\u031c\5\u00a5"+
+ "S\2\u031b\u031a\3\2\2\2\u031b\u031c\3\2\2\2\u031c\u031e\3\2\2\2\u031d"+
+ "\u031f\5\u00adW\2\u031e\u031d\3\2\2\2\u031e\u031f\3\2\2\2\u031f\u0331"+
+ "\3\2\2\2\u0320\u0321\7\60\2\2\u0321\u0323\5w<\2\u0322\u0324\5\u00a5S\2"+
+ "\u0323\u0322\3\2\2\2\u0323\u0324\3\2\2\2\u0324\u0326\3\2\2\2\u0325\u0327"+
+ "\5\u00adW\2\u0326\u0325\3\2\2\2\u0326\u0327\3\2\2\2\u0327\u0331\3\2\2"+
+ "\2\u0328\u0329\5w<\2\u0329\u032b\5\u00a5S\2\u032a\u032c\5\u00adW\2\u032b"+
+ "\u032a\3\2\2\2\u032b\u032c\3\2\2\2\u032c\u0331\3\2\2\2\u032d\u032e\5w"+
+ "<\2\u032e\u032f\5\u00adW\2\u032f\u0331\3\2\2\2\u0330\u0315\3\2\2\2\u0330"+
+ "\u0320\3\2\2\2\u0330\u0328\3\2\2\2\u0330\u032d\3\2\2\2\u0331\u00a4\3\2"+
+ "\2\2\u0332\u0333\5\u00a7T\2\u0333\u0334\5\u00a9U\2\u0334\u00a6\3\2\2\2"+
+ "\u0335\u0336\t\t\2\2\u0336\u00a8\3\2\2\2\u0337\u0339\5\u00abV\2\u0338"+
+ "\u0337\3\2\2\2\u0338\u0339\3\2\2\2\u0339\u033a\3\2\2\2\u033a\u033b\5w"+
+ "<\2\u033b\u00aa\3\2\2\2\u033c\u033d\t\n\2\2\u033d\u00ac\3\2\2\2\u033e"+
+ "\u033f\t\13\2\2\u033f\u00ae\3\2\2\2\u0340\u0341\5\u00b1Y\2\u0341\u0343"+
+ "\5\u00b3Z\2\u0342\u0344\5\u00adW\2\u0343\u0342\3\2\2\2\u0343\u0344\3\2"+
+ "\2\2\u0344\u00b0\3\2\2\2\u0345\u0347\5\u0083B\2\u0346\u0348\7\60\2\2\u0347"+
+ "\u0346\3\2\2\2\u0347\u0348\3\2\2\2\u0348\u0351\3\2\2\2\u0349\u034a\7\62"+
+ "\2\2\u034a\u034c\t\4\2\2\u034b\u034d\5\u0085C\2\u034c\u034b\3\2\2\2\u034c"+
+ "\u034d\3\2\2\2\u034d\u034e\3\2\2\2\u034e\u034f\7\60\2\2\u034f\u0351\5"+
+ "\u0085C\2\u0350\u0345\3\2\2\2\u0350\u0349\3\2\2\2\u0351\u00b2\3\2\2\2"+
+ "\u0352\u0353\5\u00b5[\2\u0353\u0354\5\u00a9U\2\u0354\u00b4\3\2\2\2\u0355"+
+ "\u0356\t\f\2\2\u0356\u00b6\3\2\2\2\u0357\u0358\7v\2\2\u0358\u0359\7t\2"+
+ "\2\u0359\u035a\7w\2\2\u035a\u0361\7g\2\2\u035b\u035c\7h\2\2\u035c\u035d"+
+ "\7c\2\2\u035d\u035e\7n\2\2\u035e\u035f\7u\2\2\u035f\u0361\7g\2\2\u0360"+
+ "\u0357\3\2\2\2\u0360\u035b\3\2\2\2\u0361\u00b8\3\2\2\2\u0362\u0363\7)"+
+ "\2\2\u0363\u0364\5\u00bb^\2\u0364\u0365\7)\2\2\u0365\u036b\3\2\2\2\u0366"+
+ "\u0367\7)\2\2\u0367\u0368\5\u00c3b\2\u0368\u0369\7)\2\2\u0369\u036b\3"+
+ "\2\2\2\u036a\u0362\3\2\2\2\u036a\u0366\3\2\2\2\u036b\u00ba\3\2\2\2\u036c"+
+ "\u036d\n\r\2\2\u036d\u00bc\3\2\2\2\u036e\u0370\7$\2\2\u036f\u0371\5\u00bf"+
+ "`\2\u0370\u036f\3\2\2\2\u0370\u0371\3\2\2\2\u0371\u0372\3\2\2\2\u0372"+
+ "\u0373\7$\2\2\u0373\u00be\3\2\2\2\u0374\u0376\5\u00c1a\2\u0375\u0374\3"+
+ "\2\2\2\u0376\u0377\3\2\2\2\u0377\u0375\3\2\2\2\u0377\u0378\3\2\2\2\u0378"+
+ "\u00c0\3\2\2\2\u0379\u037c\n\16\2\2\u037a\u037c\5\u00c3b\2\u037b\u0379"+
+ "\3\2\2\2\u037b\u037a\3\2\2\2\u037c\u00c2\3\2\2\2\u037d\u037e\7^\2\2\u037e"+
+ "\u0382\t\17\2\2\u037f\u0382\5\u00c5c\2\u0380\u0382\5\u00c9e\2\u0381\u037d"+
+ "\3\2\2\2\u0381\u037f\3\2\2\2\u0381\u0380\3\2\2\2\u0382\u00c4\3\2\2\2\u0383"+
+ "\u0384\7^\2\2\u0384\u038f\5\u0091I\2\u0385\u0386\7^\2\2\u0386\u0387\5"+
+ "\u0091I\2\u0387\u0388\5\u0091I\2\u0388\u038f\3\2\2\2\u0389\u038a\7^\2"+
+ "\2\u038a\u038b\5\u00c7d\2\u038b\u038c\5\u0091I\2\u038c\u038d\5\u0091I"+
+ "\2\u038d\u038f\3\2\2\2\u038e\u0383\3\2\2\2\u038e\u0385\3\2\2\2\u038e\u0389"+
+ "\3\2\2\2\u038f\u00c6\3\2\2\2\u0390\u0391\t\20\2\2\u0391\u00c8\3\2\2\2"+
+ "\u0392\u0393\7^\2\2\u0393\u0394\7w\2\2\u0394\u0395\5\u0087D\2\u0395\u0396"+
+ "\5\u0087D\2\u0396\u0397\5\u0087D\2\u0397\u0398\5\u0087D\2\u0398\u00ca"+
+ "\3\2\2\2\u0399\u039a\7p\2\2\u039a\u039b\7w\2\2\u039b\u039c\7n\2\2\u039c"+
+ "\u039d\7n\2\2\u039d\u00cc\3\2\2\2\u039e\u039f\7*\2\2\u039f\u00ce\3\2\2"+
+ "\2\u03a0\u03a1\7+\2\2\u03a1\u00d0\3\2\2\2\u03a2\u03a3\7}\2\2\u03a3\u00d2"+
+ "\3\2\2\2\u03a4\u03a5\7\177\2\2\u03a5\u00d4\3\2\2\2\u03a6\u03a7\7]\2\2"+
+ "\u03a7\u00d6\3\2\2\2\u03a8\u03a9\7_\2\2\u03a9\u00d8\3\2\2\2\u03aa\u03ab"+
+ "\7=\2\2\u03ab\u00da\3\2\2\2\u03ac\u03ad\7.\2\2\u03ad\u00dc\3\2\2\2\u03ae"+
+ "\u03af\7\60\2\2\u03af\u00de\3\2\2\2\u03b0\u03b1\7?\2\2\u03b1\u00e0\3\2"+
+ "\2\2\u03b2\u03b3\7@\2\2\u03b3\u00e2\3\2\2\2\u03b4\u03b5\7>\2\2\u03b5\u00e4"+
+ "\3\2\2\2\u03b6\u03b7\7#\2\2\u03b7\u00e6\3\2\2\2\u03b8\u03b9\7\u0080\2"+
+ "\2\u03b9\u00e8\3\2\2\2\u03ba\u03bb\7A\2\2\u03bb\u00ea\3\2\2\2\u03bc\u03bd"+
+ "\7<\2\2\u03bd\u00ec\3\2\2\2\u03be\u03bf\7?\2\2\u03bf\u03c0\7?\2\2\u03c0"+
+ "\u00ee\3\2\2\2\u03c1\u03c2\7>\2\2\u03c2\u03c3\7?\2\2\u03c3\u00f0\3\2\2"+
+ "\2\u03c4\u03c5\7@\2\2\u03c5\u03c6\7?\2\2\u03c6\u00f2\3\2\2\2\u03c7\u03c8"+
+ "\7#\2\2\u03c8\u03c9\7?\2\2\u03c9\u00f4\3\2\2\2\u03ca\u03cb\7(\2\2\u03cb"+
+ "\u03cc\7(\2\2\u03cc\u00f6\3\2\2\2\u03cd\u03ce\7~\2\2\u03ce\u03cf\7~\2"+
+ "\2\u03cf\u00f8\3\2\2\2\u03d0\u03d1\7-\2\2\u03d1\u03d2\7-\2\2\u03d2\u00fa"+
+ "\3\2\2\2\u03d3\u03d4\7/\2\2\u03d4\u03d5\7/\2\2\u03d5\u00fc\3\2\2\2\u03d6"+
+ "\u03d7\7-\2\2\u03d7\u00fe\3\2\2\2\u03d8\u03d9\7/\2\2\u03d9\u0100\3\2\2"+
+ "\2\u03da\u03db\7,\2\2\u03db\u0102\3\2\2\2\u03dc\u03dd\7\61\2\2\u03dd\u0104"+
+ "\3\2\2\2\u03de\u03df\7(\2\2\u03df\u0106\3\2\2\2\u03e0\u03e1\7~\2\2\u03e1"+
+ "\u0108\3\2\2\2\u03e2\u03e3\7`\2\2\u03e3\u010a\3\2\2\2\u03e4\u03e5\7\'"+
+ "\2\2\u03e5\u010c\3\2\2\2\u03e6\u03e7\7/\2\2\u03e7\u03e8\7@\2\2\u03e8\u010e"+
+ "\3\2\2\2\u03e9\u03ea\7<\2\2\u03ea\u03eb\7<\2\2\u03eb\u0110\3\2\2\2\u03ec"+
+ "\u03ed\7-\2\2\u03ed\u03ee\7?\2\2\u03ee\u0112\3\2\2\2\u03ef\u03f0\7/\2"+
+ "\2\u03f0\u03f1\7?\2\2\u03f1\u0114\3\2\2\2\u03f2\u03f3\7,\2\2\u03f3\u03f4"+
+ "\7?\2\2\u03f4\u0116\3\2\2\2\u03f5\u03f6\7\61\2\2\u03f6\u03f7\7?\2\2\u03f7"+
+ "\u0118\3\2\2\2\u03f8\u03f9\7(\2\2\u03f9\u03fa\7?\2\2\u03fa\u011a\3\2\2"+
+ "\2\u03fb\u03fc\7~\2\2\u03fc\u03fd\7?\2\2\u03fd\u011c\3\2\2\2\u03fe\u03ff"+
+ "\7`\2\2\u03ff\u0400\7?\2\2\u0400\u011e\3\2\2\2\u0401\u0402\7\'\2\2\u0402"+
+ "\u0403\7?\2\2\u0403\u0120\3\2\2\2\u0404\u0405\7>\2\2\u0405\u0406\7>\2"+
+ "\2\u0406\u0407\7?\2\2\u0407\u0122\3\2\2\2\u0408\u0409\7@\2\2\u0409\u040a"+
+ "\7@\2\2\u040a\u040b\7?\2\2\u040b\u0124\3\2\2\2\u040c\u040d\7@\2\2\u040d"+
+ "\u040e\7@\2\2\u040e\u040f\7@\2\2\u040f\u0410\7?\2\2\u0410\u0126\3\2\2"+
+ "\2\u0411\u0415\5\u0129\u0095\2\u0412\u0414\5\u012b\u0096\2\u0413\u0412"+
+ "\3\2\2\2\u0414\u0417\3\2\2\2\u0415\u0413\3\2\2\2\u0415\u0416\3\2\2\2\u0416"+
+ "\u0128\3\2\2\2\u0417\u0415\3\2\2\2\u0418\u041f\t\21\2\2\u0419\u041a\n"+
+ "\22\2\2\u041a\u041f\6\u0095\2\2\u041b\u041c\t\23\2\2\u041c\u041d\t\24"+
+ "\2\2\u041d\u041f\6\u0095\3\2\u041e\u0418\3\2\2\2\u041e\u0419\3\2\2\2\u041e"+
+ "\u041b\3\2\2\2\u041f\u012a\3\2\2\2\u0420\u0427\t\25\2\2\u0421\u0422\n"+
+ "\22\2\2\u0422\u0427\6\u0096\4\2\u0423\u0424\t\23\2\2\u0424\u0425\t\24"+
+ "\2\2\u0425\u0427\6\u0096\5\2\u0426\u0420\3\2\2\2\u0426\u0421\3\2\2\2\u0426"+
+ "\u0423\3\2\2\2\u0427\u012c\3\2\2\2\u0428\u0429\7B\2\2\u0429\u012e\3\2"+
+ "\2\2\u042a\u042b\7\60\2\2\u042b\u042c\7\60\2\2\u042c\u042d\7\60\2\2\u042d"+
+ "\u0130\3\2\2\2\u042e\u0430\t\26\2\2\u042f\u042e\3\2\2\2\u0430\u0431\3"+
+ "\2\2\2\u0431\u042f\3\2\2\2\u0431\u0432\3\2\2\2\u0432\u0433\3\2\2\2\u0433"+
+ "\u0434\b\u0099\2\2\u0434\u0132\3\2\2\2\u0435\u0436\7\61\2\2\u0436\u0437"+
+ "\7,\2\2\u0437\u043b\3\2\2\2\u0438\u043a\13\2\2\2\u0439\u0438\3\2\2\2\u043a"+
+ "\u043d\3\2\2\2\u043b\u043c\3\2\2\2\u043b\u0439\3\2\2\2\u043c\u043e\3\2"+
+ "\2\2\u043d\u043b\3\2\2\2\u043e\u043f\7,\2\2\u043f\u0440\7\61\2\2\u0440"+
+ "\u0441\3\2\2\2\u0441\u0442\b\u009a\2\2\u0442\u0134\3\2\2\2\u0443\u0444"+
+ "\7\61\2\2\u0444\u0445\7\61\2\2\u0445\u0449\3\2\2\2\u0446\u0448\n\27\2"+
+ "\2\u0447\u0446\3\2\2\2\u0448\u044b\3\2\2\2\u0449\u0447\3\2\2\2\u0449\u044a"+
+ "\3\2\2\2\u044a\u044c\3\2\2\2\u044b\u0449\3\2\2\2\u044c\u044d\b\u009b\2"+
+ "\2\u044d\u0136\3\2\2\28\2\u0292\u0296\u029a\u029e\u02a2\u02a9\u02ae\u02b0"+
+ "\u02b4\u02b7\u02bb\u02c2\u02c6\u02cb\u02d3\u02d6\u02dd\u02e1\u02e5\u02eb"+
+ "\u02ee\u02f5\u02f9\u0301\u0304\u030b\u030f\u0313\u0318\u031b\u031e\u0323"+
+ "\u0326\u032b\u0330\u0338\u0343\u0347\u034c\u0350\u0360\u036a\u0370\u0377"+
+ "\u037b\u0381\u038e\u0415\u041e\u0426\u0431\u043b\u0449\3\b\2\2";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
diff --git a/src/de/dhbwstuttgart/parser/antlr/Java8Lexer.tokens b/src/de/dhbwstuttgart/parser/antlr/Java8Lexer.tokens
index 82895a500..da68d0140 100644
--- a/src/de/dhbwstuttgart/parser/antlr/Java8Lexer.tokens
+++ b/src/de/dhbwstuttgart/parser/antlr/Java8Lexer.tokens
@@ -106,7 +106,7 @@ ELLIPSIS=105
WS=106
COMMENT=107
LINE_COMMENT=108
-'auto'=1
+'var'=1
'abstract'=2
'assert'=3
'boolean'=4
diff --git a/src/de/dhbwstuttgart/parser/antlr/Java8Parser.java b/src/de/dhbwstuttgart/parser/antlr/Java8Parser.java
index 1af140467..cda518734 100644
--- a/src/de/dhbwstuttgart/parser/antlr/Java8Parser.java
+++ b/src/de/dhbwstuttgart/parser/antlr/Java8Parser.java
@@ -180,7 +180,7 @@ public class Java8Parser extends Parser {
"methodInvocation_lf_primary", "methodInvocation_lfno_primary", "argumentList",
"methodReference", "methodReference_lf_primary", "methodReference_lfno_primary",
"arrayCreationExpression", "dimExprs", "dimExpr", "constantExpression",
- "name", "lambdaExpression", "lambdaParameters", "inferredFormalParameterList",
+ "expression", "lambdaExpression", "lambdaParameters", "inferredFormalParameterList",
"lambdaBody", "assignmentExpression", "assignment", "leftHandSide", "assignmentOperator",
"conditionalExpression", "conditionalOrExpression", "conditionalAndExpression",
"inclusiveOrExpression", "exclusiveOrExpression", "andExpression", "equalityExpression",
@@ -192,7 +192,7 @@ public class Java8Parser extends Parser {
};
private static final String[] _LITERAL_NAMES = {
- null, "'auto'", "'abstract'", "'assert'", "'boolean'", "'break'", "'byte'",
+ null, "'var'", "'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'",
diff --git a/src/de/dhbwstuttgart/parser/scope/GatherNames.java b/src/de/dhbwstuttgart/parser/scope/GatherNames.java
new file mode 100644
index 000000000..2ec6d8ab6
--- /dev/null
+++ b/src/de/dhbwstuttgart/parser/scope/GatherNames.java
@@ -0,0 +1,95 @@
+package de.dhbwstuttgart.parser.scope;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import de.dhbwstuttgart.parser.antlr.Java8BaseListener;
+import de.dhbwstuttgart.syntaxtree.AbstractASTWalker;
+import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
+import org.antlr.v4.runtime.tree.TerminalNode;
+
+import de.dhbwstuttgart.environment.PackageCrawler;
+import de.dhbwstuttgart.parser.antlr.Java8Parser;
+
+public class GatherNames {
+
+ public static List getNames(Java8Parser.CompilationUnitContext ctx, PackageCrawler packages) throws ClassNotFoundException{
+ List ret = new ArrayList<>();
+ String pkgName = getPackageName(ctx);
+ String nameString = "";
+ for (Java8Parser.TypeDeclarationContext typeDecl : ctx.typeDeclaration()){
+ if(typeDecl.interfaceDeclaration() != null){
+ if(typeDecl.interfaceDeclaration().normalInterfaceDeclaration() != null){
+ if(pkgName != ""){
+ nameString = pkgName + "." + typeDecl.interfaceDeclaration().normalInterfaceDeclaration().Identifier().toString();
+ }
+ else{
+ nameString = typeDecl.interfaceDeclaration().normalInterfaceDeclaration().Identifier().toString();
+ }
+ //Die Generic TypeParameter Definitionen Nicht! an die JavaClassName-Registry anfügen:
+ /* //Diese gelängen dadurch in den globalen Scope, was sie schließlich nicht sind
+ if(typeDecl.classDeclaration().normalClassDeclaration().typeParameters() != null){
+ for(Java8Parser.TypeParameterContext tp : typeDecl.classDeclaration().normalClassDeclaration().typeParameters().typeParameterList().typeParameter()){
+ //this.reg.add(tp.Identifier().toString());
+ }
+ }
+ */
+ ret.add(nameString);
+ }
+ }
+ else{
+ if(typeDecl.classDeclaration().normalClassDeclaration() != null){
+ if(pkgName != ""){
+ nameString = pkgName + "." + typeDecl.classDeclaration().normalClassDeclaration().Identifier().toString();
+ }
+ else{
+ nameString = typeDecl.classDeclaration().normalClassDeclaration().Identifier().toString();
+ }
+ //Die Generic TypeParameter Definitionen Nicht! an die JavaClassName-Registry anfügen:
+ /* //Diese gelängen dadurch in den globalen Scope, was sie schließlich nicht sind
+ if(typeDecl.classDeclaration().normalClassDeclaration().typeParameters() != null){
+ for(Java8Parser.TypeParameterContext tp : typeDecl.classDeclaration().normalClassDeclaration().typeParameters().typeParameterList().typeParameter()){
+ this.reg.add(tp.Identifier().toString());
+ }
+ }
+ */
+ ret.add(nameString);
+ }
+ }
+ }
+ ret.addAll(getImports(ctx, packages));
+ return ret;
+ }
+
+
+ private static List getImports(Java8Parser.CompilationUnitContext ctx, PackageCrawler packages) throws ClassNotFoundException {
+ List ret = new ArrayList();
+ ret.addAll(packages.getClassNames("java.lang"));
+ for(Java8Parser.ImportDeclarationContext importDeclCtx : ctx.importDeclaration()){
+ if(importDeclCtx.singleTypeImportDeclaration() != null){
+ ret.add(importDeclCtx.singleTypeImportDeclaration().typeName().getText());
+ }
+ else if(importDeclCtx.typeImportOnDemandDeclaration() != null){
+ ret.addAll(packages.getClassNames(importDeclCtx.typeImportOnDemandDeclaration().packageOrTypeName().getText()));
+ }
+ else if(importDeclCtx.singleStaticImportDeclaration() != null){
+ ret.add(importDeclCtx.singleStaticImportDeclaration().typeName().getText()+"."+importDeclCtx.singleStaticImportDeclaration().Identifier().getText());
+ }
+ else{
+ ret.addAll(packages.getClassNames(importDeclCtx.staticImportOnDemandDeclaration().typeName().getText()));
+ }
+ }
+ return ret;
+ }
+
+ private static String getPackageName(Java8Parser.CompilationUnitContext ctx){
+ String pkgName = "";
+ if(ctx.packageDeclaration() != null){
+ for(TerminalNode t : ctx.packageDeclaration().Identifier()){
+ pkgName = pkgName + "." + t.toString();
+ }
+ pkgName = pkgName.substring(1);
+ }
+ return pkgName;
+ }
+}
\ No newline at end of file
diff --git a/src/de/dhbwstuttgart/typecheck/GenericTypeName.java b/src/de/dhbwstuttgart/parser/scope/GenericTypeName.java
similarity index 89%
rename from src/de/dhbwstuttgart/typecheck/GenericTypeName.java
rename to src/de/dhbwstuttgart/parser/scope/GenericTypeName.java
index 9a19c478d..0cee932f7 100644
--- a/src/de/dhbwstuttgart/typecheck/GenericTypeName.java
+++ b/src/de/dhbwstuttgart/parser/scope/GenericTypeName.java
@@ -1,7 +1,6 @@
-package de.dhbwstuttgart.typecheck;
+package de.dhbwstuttgart.parser.scope;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.GenericContext;
-//import jdk.nashorn.internal.ir.Node;
public class GenericTypeName extends JavaClassName {
private final static String DELIMITER = "%";
diff --git a/src/de/dhbwstuttgart/parser/scope/GenericsRegistry.java b/src/de/dhbwstuttgart/parser/scope/GenericsRegistry.java
new file mode 100644
index 000000000..e0b32e64f
--- /dev/null
+++ b/src/de/dhbwstuttgart/parser/scope/GenericsRegistry.java
@@ -0,0 +1,50 @@
+package de.dhbwstuttgart.parser.scope;
+
+import de.dhbwstuttgart.parser.SyntaxTreeGenerator.GenericContext;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+public class GenericsRegistry {
+ private final List registry = new ArrayList<>();
+ public final GenericsRegistry globalRegistry;
+
+ public GenericsRegistry(GenericsRegistry globalRegistry){
+ this.globalRegistry = globalRegistry;
+ }
+
+ public void put(String name, GenericContext genericContext){
+ registry.add(new GenericVariable(genericContext,name));
+ if(globalRegistry != null)globalRegistry.put(name, genericContext);
+ }
+
+ public boolean contains(String name) {
+ Optional ret = registry.stream().map(((GenericVariable genericVariable) -> genericVariable.name.equals(name)))
+ .reduce(((a, b) -> a || b));
+ if(ret.isPresent())
+ return ret.get();
+ return false;
+ }
+
+ public GenericContext get(String name) {
+ return registry.stream()
+ .filter((genericVariable -> genericVariable.name.equals(name))).findAny().get().context;
+ }
+
+ public void putAll(GenericsRegistry generics) {
+ for(GenericVariable generic : generics.registry){
+ this.put(generic.name, generic.context);
+ }
+ }
+}
+
+class GenericVariable{
+ final GenericContext context;
+ final String name;
+
+ GenericVariable(GenericContext context, String name){
+ this.context = context;
+ this.name = name;
+ }
+}
\ No newline at end of file
diff --git a/src/de/dhbwstuttgart/typecheck/JavaClassName.java b/src/de/dhbwstuttgart/parser/scope/JavaClassName.java
similarity index 98%
rename from src/de/dhbwstuttgart/typecheck/JavaClassName.java
rename to src/de/dhbwstuttgart/parser/scope/JavaClassName.java
index 83bd566ef..8ea1c51ca 100644
--- a/src/de/dhbwstuttgart/typecheck/JavaClassName.java
+++ b/src/de/dhbwstuttgart/parser/scope/JavaClassName.java
@@ -1,4 +1,4 @@
-package de.dhbwstuttgart.typecheck;
+package de.dhbwstuttgart.parser.scope;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/de/dhbwstuttgart/typecheck/JavaClassRegistry.java b/src/de/dhbwstuttgart/parser/scope/JavaClassRegistry.java
similarity index 85%
rename from src/de/dhbwstuttgart/typecheck/JavaClassRegistry.java
rename to src/de/dhbwstuttgart/parser/scope/JavaClassRegistry.java
index cbd66d37f..d2f8bc353 100644
--- a/src/de/dhbwstuttgart/typecheck/JavaClassRegistry.java
+++ b/src/de/dhbwstuttgart/parser/scope/JavaClassRegistry.java
@@ -1,9 +1,9 @@
-package de.dhbwstuttgart.typecheck;
+package de.dhbwstuttgart.parser.scope;
import java.util.*;
/**
- * Speichert die Klassen im aktuellen Projektscope
+ * Speichert die Klassen für einen bestimmten Projektscope
*/
public class JavaClassRegistry {
final List existingClasses = new ArrayList<>();
@@ -14,15 +14,6 @@ public class JavaClassRegistry {
existingClasses.add(new JavaClassName(name));
}
}
-
- /**
- * F�gt ein gesamtes Package der ClassRegistry hinzu.
- * Dies geschieht beispielsweise, wenn der Benutzer ein "import package.*;" statement verwendet
- * @param packageName
- */
- public void addPackage(String packageName) {
- importedPackages.add(packageName);
- }
public void add(String className){
existingClasses.add(new JavaClassName(className));
diff --git a/src/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java b/src/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java
old mode 100755
new mode 100644
index 8c8dd6983..4dd9081db
--- a/src/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java
+++ b/src/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java
@@ -1,9 +1,11 @@
package de.dhbwstuttgart.syntaxtree;
import de.dhbwstuttgart.core.IItemWithOffset;
+import de.dhbwstuttgart.exceptions.DebugException;
+import de.dhbwstuttgart.parser.scope.JavaClassName;
import de.dhbwstuttgart.syntaxtree.type.RefType;
+import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.syntaxtree.visual.ASTPrinter;
-import de.dhbwstuttgart.typecheck.JavaClassName;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.typeinference.constraints.Constraint;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
@@ -16,7 +18,7 @@ import java.util.List;
/**
* Stellt jede Art von Klasse dar. Auch abstrakte Klassen und Interfaces
*/
-public class ClassOrInterface extends SyntaxTreeNode {
+public class ClassOrInterface extends SyntaxTreeNode implements TypeScope{
protected int modifiers;
protected JavaClassName name;
private List fields = new ArrayList<>();
@@ -63,7 +65,13 @@ public class ClassOrInterface extends SyntaxTreeNode {
}
public static RefType generateTypeOfClass(JavaClassName name, GenericDeclarationList genericsOfClass ,Token offset){
- return new RefType(name, offset);
+ //Hier wird immer ein generischer Typ generiert, also mit Type placeholdern
+ List params = new ArrayList<>();
+ for(GenericTypeVar genericTypeVar : genericsOfClass){
+ //params.add(genericTypeVar.getTypePlaceholder());
+ params.add(TypePlaceholder.fresh(offset));
+ }
+ return new RefType(name, params, offset);
}
public RefTypeOrTPHOrWildcardOrGeneric getSuperClass() {
@@ -74,6 +82,11 @@ public class ClassOrInterface extends SyntaxTreeNode {
return this.genericClassParameters;
}
+ @Override
+ public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
+ return null;
+ }
+
public List getConstructors() {
return constructors;
}
diff --git a/src/de/dhbwstuttgart/syntaxtree/ExceptionList.java b/src/de/dhbwstuttgart/syntaxtree/ExceptionList.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/Field.java b/src/de/dhbwstuttgart/syntaxtree/Field.java
index 82c3053f9..421f0ff33 100644
--- a/src/de/dhbwstuttgart/syntaxtree/Field.java
+++ b/src/de/dhbwstuttgart/syntaxtree/Field.java
@@ -3,13 +3,12 @@ package de.dhbwstuttgart.syntaxtree;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import org.antlr.v4.runtime.Token;
-public class Field extends SyntaxTreeNode{
+import java.util.ArrayList;
+
+public class Field extends SyntaxTreeNode implements TypeScope{
private String name;
private RefTypeOrTPHOrWildcardOrGeneric type;
-
-
- private GenericDeclarationList genericParameters;
public Field(String name, RefTypeOrTPHOrWildcardOrGeneric type, int modifier, Token offset){
super(offset);
@@ -29,5 +28,15 @@ public class Field extends SyntaxTreeNode{
public void accept(ASTVisitor visitor) {
visitor.visit(this);
}
+
+ @Override
+ public Iterable extends GenericTypeVar> getGenerics() {
+ return new ArrayList<>();
+ }
+
+ @Override
+ public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
+ return type;
+ }
}
diff --git a/src/de/dhbwstuttgart/syntaxtree/FormalParameter.java b/src/de/dhbwstuttgart/syntaxtree/FormalParameter.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/GenericTypeVar.java b/src/de/dhbwstuttgart/syntaxtree/GenericTypeVar.java
old mode 100755
new mode 100644
index 8ac65e353..c43fe068f
--- a/src/de/dhbwstuttgart/syntaxtree/GenericTypeVar.java
+++ b/src/de/dhbwstuttgart/syntaxtree/GenericTypeVar.java
@@ -1,7 +1,8 @@
package de.dhbwstuttgart.syntaxtree;
+import de.dhbwstuttgart.parser.scope.GenericTypeName;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
-import de.dhbwstuttgart.typecheck.GenericTypeName;
+
import org.antlr.v4.runtime.Token;
import java.util.ArrayList;
diff --git a/src/de/dhbwstuttgart/syntaxtree/Method.java b/src/de/dhbwstuttgart/syntaxtree/Method.java
old mode 100755
new mode 100644
index 7f74fed1d..3686fb4ee
--- a/src/de/dhbwstuttgart/syntaxtree/Method.java
+++ b/src/de/dhbwstuttgart/syntaxtree/Method.java
@@ -22,7 +22,7 @@ import de.dhbwstuttgart.syntaxtree.statement.Block;
* @author janulrich
*
*/
-public class Method extends Field implements IItemWithOffset, TypeScope
+public class Method extends Field implements IItemWithOffset
{
public final Block block;
private ParameterList parameterlist = new ParameterList(new ArrayList<>(), new NullToken());
diff --git a/src/de/dhbwstuttgart/syntaxtree/ParameterList.java b/src/de/dhbwstuttgart/syntaxtree/ParameterList.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/SourceFile.java b/src/de/dhbwstuttgart/syntaxtree/SourceFile.java
old mode 100755
new mode 100644
index 91c9b5148..439a3a8c1
--- a/src/de/dhbwstuttgart/syntaxtree/SourceFile.java
+++ b/src/de/dhbwstuttgart/syntaxtree/SourceFile.java
@@ -2,9 +2,8 @@ package de.dhbwstuttgart.syntaxtree;
import java.io.File;
import java.util.*;
-
import de.dhbwstuttgart.parser.NullToken;
-import de.dhbwstuttgart.typecheck.JavaClassName;
+import de.dhbwstuttgart.parser.scope.JavaClassName;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceInformation;
//import sun.security.x509.X509CertInfo;
diff --git a/src/de/dhbwstuttgart/syntaxtree/factory/ASTFactory.java b/src/de/dhbwstuttgart/syntaxtree/factory/ASTFactory.java
index 088af7c61..b3f628a7c 100644
--- a/src/de/dhbwstuttgart/syntaxtree/factory/ASTFactory.java
+++ b/src/de/dhbwstuttgart/syntaxtree/factory/ASTFactory.java
@@ -7,13 +7,13 @@ import java.util.List;
import de.dhbwstuttgart.parser.NullToken;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.GenericContext;
+import de.dhbwstuttgart.parser.scope.GenericTypeName;
+import de.dhbwstuttgart.parser.scope.JavaClassName;
+import de.dhbwstuttgart.parser.scope.JavaClassRegistry;
import de.dhbwstuttgart.syntaxtree.Field;
import de.dhbwstuttgart.syntaxtree.Method;
import de.dhbwstuttgart.syntaxtree.type.*;
import de.dhbwstuttgart.syntaxtree.type.Void;
-import de.dhbwstuttgart.typecheck.GenericTypeName;
-import de.dhbwstuttgart.typecheck.JavaClassName;
-import de.dhbwstuttgart.typecheck.JavaClassRegistry;
import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.statement.Block;
import de.dhbwstuttgart.syntaxtree.statement.Statement;
diff --git a/src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java b/src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
index 9775fa174..06ea16c19 100644
--- a/src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
+++ b/src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
@@ -5,12 +5,15 @@ import java.util.stream.Collectors;
import de.dhbwstuttgart.exceptions.NotImplementedException;
import de.dhbwstuttgart.parser.NullToken;
+import de.dhbwstuttgart.parser.scope.JavaClassName;
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
import de.dhbwstuttgart.syntaxtree.type.*;
import de.dhbwstuttgart.syntaxtree.type.Void;
-import de.dhbwstuttgart.typecheck.JavaClassName;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
import de.dhbwstuttgart.typeinference.constraints.Pair;
+import de.dhbwstuttgart.typeinference.result.PairTPHequalRefType;
+import de.dhbwstuttgart.typeinference.result.PairTPHsmallerTPH;
+import de.dhbwstuttgart.typeinference.result.ResultPair;
import de.dhbwstuttgart.typeinference.unify.model.ExtendsType;
import de.dhbwstuttgart.typeinference.unify.model.FiniteClosure;
import de.dhbwstuttgart.typeinference.unify.model.FunNType;
@@ -133,18 +136,24 @@ public class UnifyTypeFactory {
* Convert from
* UnifyType -> ASTType
*/
- public static Set> convert(Set> unifyPairSet, Map tphs) {
+ public static Set convert(Set unifyPairSet, Map tphs) {
return unifyPairSet.stream().map(
- set -> set.stream().map(
- unifyPair -> convert(unifyPair, tphs))
- .collect(Collectors.toSet()))
- .collect(Collectors.toSet());
+ unifyPair -> convert(unifyPair, tphs))
+ .collect(Collectors.toSet());
}
- public static Pair convert(UnifyPair mp, Map tphs) {
+ public static ResultPair convert(UnifyPair mp, Map tphs) {
RefTypeOrTPHOrWildcardOrGeneric tl = UnifyTypeFactory.convert(mp.getLhsType(), tphs);
RefTypeOrTPHOrWildcardOrGeneric tr = UnifyTypeFactory.convert(mp.getRhsType(), tphs);
- return new Pair(tl, tr, mp.getPairOp());
+ if(tl instanceof TypePlaceholder){
+ if(tr instanceof TypePlaceholder) {
+ if(mp.getPairOp().equals(PairOperator.EQUALSDOT))
+ return new PairTPHequalRefType((TypePlaceholder)tl, tr);
+ else
+ return new PairTPHsmallerTPH((TypePlaceholder)tl, (TypePlaceholder)tr);
+ }
+ return new PairTPHequalRefType((TypePlaceholder)tl, tr);
+ }else throw new NotImplementedException();
}
public static RefTypeOrTPHOrWildcardOrGeneric convert(ReferenceType t, Map tphs) {
@@ -159,12 +168,12 @@ public class UnifyTypeFactory {
}
public static RefTypeOrTPHOrWildcardOrGeneric convert(SuperType t, Map tphs) {
- RefType innerType = new RefType(new JavaClassName(t.getSuperedType().getName()), new NullToken());
+ RefTypeOrTPHOrWildcardOrGeneric innerType = convert(t.getSuperedType(), tphs);
return new SuperWildcardType(innerType, new NullToken());
}
public static RefTypeOrTPHOrWildcardOrGeneric convert(ExtendsType t, Map tphs) {
- RefType innerType = new RefType(new JavaClassName(t.getExtendedType().getName()), new NullToken());
+ RefTypeOrTPHOrWildcardOrGeneric innerType = convert(t.getExtendedType(), tphs);
return new ExtendsWildcardType(innerType, new NullToken());
}
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java b/src/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java b/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Binary.java b/src/de/dhbwstuttgart/syntaxtree/statement/Binary.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/BinaryExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/BinaryExpr.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Block.java b/src/de/dhbwstuttgart/syntaxtree/statement/Block.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/CastExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/CastExpr.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/EmptyStmt.java b/src/de/dhbwstuttgart/syntaxtree/statement/EmptyStmt.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Expression.java b/src/de/dhbwstuttgart/syntaxtree/statement/Expression.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java b/src/de/dhbwstuttgart/syntaxtree/statement/ForStmt.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java b/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java
old mode 100755
new mode 100644
index 090e954fb..5d6a46589
--- a/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java
+++ b/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java
@@ -1,22 +1,27 @@
package de.dhbwstuttgart.syntaxtree.statement;
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
+import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceInformation;
+import org.antlr.v4.runtime.Token;
public class IfStmt extends Statement
{
- public IfStmt(int offset, int variableLength)
+ public final Expression expr;
+ public final Block then_block;
+ public final Block else_block;
+
+ public IfStmt(RefTypeOrTPHOrWildcardOrGeneric type,
+ Expression expr, Block thenBlock, Block elseBlock, Token offset)
{
- super(null,null);
+ super(type,offset);
+ this.expr = expr;
+ this.then_block = thenBlock;
+ this.else_block = elseBlock;
}
-
- public boolean hamaDebug = true; //hama: Debug Ausgaben von mir ein- bzw. ausschalten
- public Expression expr;
- public Block then_block;
- public Block else_block;
@Override
public void accept(StatementVisitor visitor) {
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/InstanceOf.java b/src/de/dhbwstuttgart/syntaxtree/statement/InstanceOf.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java b/src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java b/src/de/dhbwstuttgart/syntaxtree/statement/LocalVarDecl.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java b/src/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/NegativeExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/NegativeExpr.java
old mode 100755
new mode 100644
index ac826a787..67e71e95e
--- a/src/de/dhbwstuttgart/syntaxtree/statement/NegativeExpr.java
+++ b/src/de/dhbwstuttgart/syntaxtree/statement/NegativeExpr.java
@@ -3,8 +3,6 @@ import java.util.Hashtable;
import java.util.Iterator;
import org.antlr.v4.runtime.Token;
-import org.apache.bcel.generic.ClassGen;
-import org.apache.bcel.generic.InstructionList;
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/NewArray.java b/src/de/dhbwstuttgart/syntaxtree/statement/NewArray.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/NewClass.java b/src/de/dhbwstuttgart/syntaxtree/statement/NewClass.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/NotExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/NotExpr.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/PositivExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/PositivExpr.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/PostDecExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/PostDecExpr.java
old mode 100755
new mode 100644
index 50144b26d..18b56f96f
--- a/src/de/dhbwstuttgart/syntaxtree/statement/PostDecExpr.java
+++ b/src/de/dhbwstuttgart/syntaxtree/statement/PostDecExpr.java
@@ -3,8 +3,6 @@ import java.util.Hashtable;
import java.util.Iterator;
import de.dhbwstuttgart.parser.antlr.Java8Parser;
-import org.apache.bcel.generic.ClassGen;
-import org.apache.bcel.generic.InstructionList;
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/PostIncExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/PostIncExpr.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/PreDecExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/PreDecExpr.java
old mode 100755
new mode 100644
index e1d311b8e..de0fb0b19
--- a/src/de/dhbwstuttgart/syntaxtree/statement/PreDecExpr.java
+++ b/src/de/dhbwstuttgart/syntaxtree/statement/PreDecExpr.java
@@ -3,8 +3,6 @@ import java.util.Hashtable;
import java.util.Iterator;
import org.antlr.v4.runtime.Token;
-import org.apache.bcel.generic.ClassGen;
-import org.apache.bcel.generic.InstructionList;
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/PreIncExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/PreIncExpr.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Receiver.java b/src/de/dhbwstuttgart/syntaxtree/statement/Receiver.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Return.java b/src/de/dhbwstuttgart/syntaxtree/statement/Return.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Statement.java b/src/de/dhbwstuttgart/syntaxtree/statement/Statement.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/StaticClassName.java b/src/de/dhbwstuttgart/syntaxtree/statement/StaticClassName.java
index 536b6d410..d0ddb31cf 100644
--- a/src/de/dhbwstuttgart/syntaxtree/statement/StaticClassName.java
+++ b/src/de/dhbwstuttgart/syntaxtree/statement/StaticClassName.java
@@ -1,8 +1,8 @@
package de.dhbwstuttgart.syntaxtree.statement;
+import de.dhbwstuttgart.parser.scope.JavaClassName;
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.type.RefType;
-import de.dhbwstuttgart.typecheck.JavaClassName;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceInformation;
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Super.java b/src/de/dhbwstuttgart/syntaxtree/statement/Super.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java b/src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java
index 44cf213b5..572f1b11b 100644
--- a/src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java
+++ b/src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java
@@ -4,10 +4,6 @@ import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.Void;
import org.antlr.v4.runtime.Token;
-import org.apache.bcel.Constants;
-import org.apache.bcel.generic.InstructionFactory;
-import org.apache.bcel.generic.InstructionHandle;
-import org.apache.bcel.generic.InstructionList;
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/This.java b/src/de/dhbwstuttgart/syntaxtree/statement/This.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.java b/src/de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/UnaryMinus.java b/src/de/dhbwstuttgart/syntaxtree/statement/UnaryMinus.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/UnaryNot.java b/src/de/dhbwstuttgart/syntaxtree/statement/UnaryNot.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/UnaryPlus.java b/src/de/dhbwstuttgart/syntaxtree/statement/UnaryPlus.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/WhileStmt.java b/src/de/dhbwstuttgart/syntaxtree/statement/WhileStmt.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/literal/BoolLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/literal/BoolLiteral.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/literal/CharLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/literal/CharLiteral.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/literal/Literal.java b/src/de/dhbwstuttgart/syntaxtree/statement/literal/Literal.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/literal/Null.java b/src/de/dhbwstuttgart/syntaxtree/statement/literal/Null.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/literal/NumberLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/literal/NumberLiteral.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/literal/StringLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/literal/StringLiteral.java
old mode 100755
new mode 100644
diff --git a/src/de/dhbwstuttgart/syntaxtree/type/ExtendsWildcardType.java b/src/de/dhbwstuttgart/syntaxtree/type/ExtendsWildcardType.java
old mode 100755
new mode 100644
index 0767c59d9..1852b3238
--- a/src/de/dhbwstuttgart/syntaxtree/type/ExtendsWildcardType.java
+++ b/src/de/dhbwstuttgart/syntaxtree/type/ExtendsWildcardType.java
@@ -2,6 +2,7 @@ package de.dhbwstuttgart.syntaxtree.type;
import de.dhbwstuttgart.syntaxtree.ASTVisitor;
+import de.dhbwstuttgart.typeinference.result.ResultSetVisitor;
import org.antlr.v4.runtime.Token;
/**
@@ -18,7 +19,7 @@ public class ExtendsWildcardType extends WildcardType{
* Author: Arne Lüdtke
* Standard Konstruktor für eine ExtendsWildcard
*/
- public ExtendsWildcardType (RefType extendsType, Token offset)
+ public ExtendsWildcardType (RefTypeOrTPHOrWildcardOrGeneric extendsType, Token offset)
{
super(extendsType, offset);
}
@@ -38,4 +39,9 @@ public class ExtendsWildcardType extends WildcardType{
public void accept(ASTVisitor visitor) {
visitor.visit(this);
}
+
+ @Override
+ public void accept(ResultSetVisitor visitor) {
+ visitor.visit(this);
+ }
}
diff --git a/src/de/dhbwstuttgart/syntaxtree/type/FunN.java b/src/de/dhbwstuttgart/syntaxtree/type/FunN.java
old mode 100755
new mode 100644
index d09100533..84fe1ace1
--- a/src/de/dhbwstuttgart/syntaxtree/type/FunN.java
+++ b/src/de/dhbwstuttgart/syntaxtree/type/FunN.java
@@ -2,7 +2,7 @@ package de.dhbwstuttgart.syntaxtree.type;
import de.dhbwstuttgart.parser.NullToken;
-import de.dhbwstuttgart.typecheck.JavaClassName;
+import de.dhbwstuttgart.parser.scope.JavaClassName;
import java.util.List;
diff --git a/src/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java b/src/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java
old mode 100755
new mode 100644
index ebb289469..121a6c99c
--- a/src/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java
+++ b/src/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java
@@ -1,13 +1,15 @@
package de.dhbwstuttgart.syntaxtree.type;
+import de.dhbwstuttgart.parser.scope.GenericTypeName;
+import de.dhbwstuttgart.parser.scope.JavaClassName;
import de.dhbwstuttgart.syntaxtree.ASTVisitor;
-import de.dhbwstuttgart.typecheck.GenericTypeName;
-import de.dhbwstuttgart.typecheck.JavaClassName;
+import de.dhbwstuttgart.typeinference.result.ResultSetVisitor;
import org.antlr.v4.runtime.Token;
public class GenericRefType extends RefTypeOrTPHOrWildcardOrGeneric
{
private GenericTypeName name;
+
public GenericRefType(GenericTypeName name, Token offset)
{
super(offset);
@@ -26,5 +28,10 @@ public class GenericRefType extends RefTypeOrTPHOrWildcardOrGeneric
public void accept(ASTVisitor visitor) {
visitor.visit(this);
}
+
+ @Override
+ public void accept(ResultSetVisitor visitor) {
+ visitor.visit(this);
+ }
}
diff --git a/src/de/dhbwstuttgart/syntaxtree/type/RefType.java b/src/de/dhbwstuttgart/syntaxtree/type/RefType.java
old mode 100755
new mode 100644
index e8030403d..b28761199
--- a/src/de/dhbwstuttgart/syntaxtree/type/RefType.java
+++ b/src/de/dhbwstuttgart/syntaxtree/type/RefType.java
@@ -1,7 +1,8 @@
package de.dhbwstuttgart.syntaxtree.type;
+import de.dhbwstuttgart.parser.scope.JavaClassName;
import de.dhbwstuttgart.syntaxtree.ASTVisitor;
-import de.dhbwstuttgart.typecheck.JavaClassName;
+import de.dhbwstuttgart.typeinference.result.ResultSetVisitor;
import org.antlr.v4.runtime.Token;
import java.util.ArrayList;
@@ -10,13 +11,6 @@ import java.util.List;
public class RefType extends RefTypeOrTPHOrWildcardOrGeneric
{
- /**
- * Ist IsArray auf true, muss beim Codegen ein Zeichen [ gesetzt werden
- * Bsp.: 15| tag = CONSTANT_Utf8, length = 22, ([Ljava/lang/String;)V
- * Ist IsArray auf false, muss beim Codegen ein Zeichen [ gesetzt werden
- * Bsp.: 9| tag = CONSTANT_Utf8, length = 21, (Ljava/lang/String;)V
- */
- private boolean IsArray = false;
protected final JavaClassName name;
protected final List parameter;
/**
@@ -29,7 +23,7 @@ public class RefType extends RefTypeOrTPHOrWildcardOrGeneric
public RefType(JavaClassName fullyQualifiedName, Token offset)
{
- this(fullyQualifiedName, null, offset);
+ this(fullyQualifiedName, new ArrayList<>(), offset);
}
@Override
@@ -105,5 +99,10 @@ public class RefType extends RefTypeOrTPHOrWildcardOrGeneric
public void accept(ASTVisitor visitor) {
visitor.visit(this);
}
+
+ @Override
+ public void accept(ResultSetVisitor visitor) {
+ visitor.visit(this);
+ }
}
diff --git a/src/de/dhbwstuttgart/syntaxtree/type/RefTypeOrTPHOrWildcardOrGeneric.java b/src/de/dhbwstuttgart/syntaxtree/type/RefTypeOrTPHOrWildcardOrGeneric.java
index 20bc5b457..75638712d 100644
--- a/src/de/dhbwstuttgart/syntaxtree/type/RefTypeOrTPHOrWildcardOrGeneric.java
+++ b/src/de/dhbwstuttgart/syntaxtree/type/RefTypeOrTPHOrWildcardOrGeneric.java
@@ -2,6 +2,7 @@ package de.dhbwstuttgart.syntaxtree.type;
import de.dhbwstuttgart.syntaxtree.ASTVisitor;
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
+import de.dhbwstuttgart.typeinference.result.ResultSetVisitor;
import org.antlr.v4.runtime.Token;
public abstract class RefTypeOrTPHOrWildcardOrGeneric extends SyntaxTreeNode{
@@ -11,4 +12,6 @@ public abstract class RefTypeOrTPHOrWildcardOrGeneric extends SyntaxTreeNode{
@Override
public abstract void accept(ASTVisitor visitor);
+
+ public abstract void accept(ResultSetVisitor visitor);
}
diff --git a/src/de/dhbwstuttgart/syntaxtree/type/SuperWildcardType.java b/src/de/dhbwstuttgart/syntaxtree/type/SuperWildcardType.java
old mode 100755
new mode 100644
index 4cbee79e8..3fc8ffb98
--- a/src/de/dhbwstuttgart/syntaxtree/type/SuperWildcardType.java
+++ b/src/de/dhbwstuttgart/syntaxtree/type/SuperWildcardType.java
@@ -2,6 +2,7 @@ package de.dhbwstuttgart.syntaxtree.type;
import de.dhbwstuttgart.syntaxtree.ASTVisitor;
+import de.dhbwstuttgart.typeinference.result.ResultSetVisitor;
import org.antlr.v4.runtime.Token;
/**
@@ -18,7 +19,7 @@ public class SuperWildcardType extends WildcardType{
* Author: Arne Lüdtke
* Standard Konstruktor für eine SuperWildcard
*/
- public SuperWildcardType( RefType innerType, Token offset)
+ public SuperWildcardType( RefTypeOrTPHOrWildcardOrGeneric innerType, Token offset)
{
super(innerType, offset);
}
@@ -48,4 +49,9 @@ public class SuperWildcardType extends WildcardType{
public void accept(ASTVisitor visitor) {
visitor.visit(this);
}
+
+ @Override
+ public void accept(ResultSetVisitor visitor) {
+ visitor.visit(this);
+ }
}
diff --git a/src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java b/src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java
old mode 100755
new mode 100644
index 978455454..99a34cd56
--- a/src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java
+++ b/src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java
@@ -4,6 +4,7 @@ import java.util.Hashtable;
import de.dhbwstuttgart.syntaxtree.ASTVisitor;
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
import de.dhbwstuttgart.syntaxtree.factory.NameGenerator;
+import de.dhbwstuttgart.typeinference.result.ResultSetVisitor;
import org.antlr.v4.runtime.Token;
/**
@@ -71,4 +72,9 @@ public class TypePlaceholder extends RefTypeOrTPHOrWildcardOrGeneric
public void accept(ASTVisitor visitor) {
visitor.visit(this);
}
+
+ @Override
+ public void accept(ResultSetVisitor visitor) {
+ visitor.visit(this);
+ }
}
diff --git a/src/de/dhbwstuttgart/syntaxtree/type/Void.java b/src/de/dhbwstuttgart/syntaxtree/type/Void.java
old mode 100755
new mode 100644
index 444c62647..6a322dcb4
--- a/src/de/dhbwstuttgart/syntaxtree/type/Void.java
+++ b/src/de/dhbwstuttgart/syntaxtree/type/Void.java
@@ -1,8 +1,9 @@
package de.dhbwstuttgart.syntaxtree.type;
-import de.dhbwstuttgart.typecheck.JavaClassName;
import org.antlr.v4.runtime.Token;
+import de.dhbwstuttgart.parser.scope.JavaClassName;
+
public class Void extends RefType
{
diff --git a/src/de/dhbwstuttgart/syntaxtree/type/WildcardType.java b/src/de/dhbwstuttgart/syntaxtree/type/WildcardType.java
old mode 100755
new mode 100644
index 0c9fb1ed4..208138b6b
--- a/src/de/dhbwstuttgart/syntaxtree/type/WildcardType.java
+++ b/src/de/dhbwstuttgart/syntaxtree/type/WildcardType.java
@@ -11,19 +11,19 @@ import org.antlr.v4.runtime.Token;
public abstract class WildcardType extends RefTypeOrTPHOrWildcardOrGeneric {
- protected RefType innerType = null;
+ protected RefTypeOrTPHOrWildcardOrGeneric innerType = null;
/**
* Author: Arne Lüdtke
* Standard Konstruktor für eine Wildcard
*/
- public WildcardType(RefType innerType, Token offset)
+ public WildcardType(RefTypeOrTPHOrWildcardOrGeneric innerType, Token offset)
{
super(offset);
this.innerType = innerType;
}
- public RefType getInnerType(){
+ public RefTypeOrTPHOrWildcardOrGeneric getInnerType(){
return innerType;
}
diff --git a/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java b/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java
index 046ae735e..737ef669d 100644
--- a/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java
+++ b/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java
@@ -1,10 +1,8 @@
package de.dhbwstuttgart.typedeployment;
-import de.dhbwstuttgart.exceptions.NotImplementedException;
import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.type.*;
-import de.dhbwstuttgart.typeinference.ResultSet;
-import de.dhbwstuttgart.typeinference.constraints.Pair;
+import de.dhbwstuttgart.typeinference.result.*;
import org.antlr.v4.runtime.Token;
import java.util.*;
@@ -30,98 +28,12 @@ public class TypeInsertFactory {
}
public static TypeInsert createInsertPoints(RefTypeOrTPHOrWildcardOrGeneric type, Token offset, ClassOrInterface cl, Method m,
- Set pairs) {
+ ResultSet resultSet) {
Set ret = new HashSet<>();
- TypeInsertPoint insertPoint = null;
- Set additionalInserts = new HashSet<>();
- for (Pair pair : pairs) {
- RefTypeOrTPHOrWildcardOrGeneric relatedType = null;
- if (pair.TA1.equals(type)) {
- relatedType = pair.TA2;
- } else if (pair.TA2.equals(type)) {
- relatedType = pair.TA1;
- }
- if (relatedType != null) {
- //Es wurde ein direkter Treffer gefunden:
- if (pair.OperatorEqual()) { //resolved ist vom Typ RefType
- RefType resolved = ((RefType) relatedType);
- String insert = createInsertString(resolved, additionalInserts);
- insertPoint = new TypeInsertPoint(offset, insert);
- break;
- } else { //Ansonsten ist es ein TPH
- //additionalInserts.add((TypePlaceholder) relatedType); //Sollte nicht notwendig sein
- //Dann wurde er nicht aufgelöst und es kann nur der TPH als Generic eingesetzt werden:
- insertPoint = new TypeInsertPoint(offset, ((TypePlaceholder) type).getName());
- break;
- }
- }
- }
- if(insertPoint == null ){ //Dann muss es ein TPH sein, welcher nicht im Result auftaucht
- if(type instanceof TypePlaceholder){
- insertPoint = new TypeInsertPoint(offset, ((TypePlaceholder) type).getName());
- additionalInserts.add(((TypePlaceholder) type));
- }else if(type instanceof GenericRefType){
- insertPoint = new TypeInsertPoint(offset, ((GenericRefType) type).getName().toString());
- }else if(type instanceof RefType){
- insertPoint = new TypeInsertPoint(offset, ((RefType) type).getName().toString());
- }else throw new NotImplementedException();
- }
-
- //Alle Bounds finden:
- Set newGenerics = new HashSet<>();
- boolean added = true;
- while(added){
- //Fügt alle TPHs an, welche mit den additionalInserts in Verbindung stehen.
- added = false;
- for(Pair pair : pairs){
- if (additionalInserts.contains(pair.TA1) || additionalInserts.contains(pair.TA2)) {
- newGenerics.add(new GenericInsertPair(pair));
- added |= additionalInserts.add((TypePlaceholder) pair.TA1);
- added |= additionalInserts.add((TypePlaceholder) pair.TA2);
- }
- }
- }
-
- //Fügt noch die Additional Inserts an, welche mit nichts in Verbindung stehen:
- for(TypePlaceholder additionalTPH : additionalInserts){
- boolean inside = false;
- for(GenericInsertPair p :newGenerics){
- if(p.contains(additionalTPH)){
- inside = true;
- break;
- }
- }
- if(! inside)newGenerics.add(new GenericInsertPair(additionalTPH, null));
- }
- if(newGenerics.size() > 0)
- ret.add(createGenericInsert(newGenerics, cl, m));
-
- //return ret;
- return new TypeInsert(insertPoint, ret);
- }
-
- private static String createInsertString(RefType resolved, Set additionalInserts) {
- String insert = resolved.getName().toString();
- if(resolved.getParaList().size() > 0){
- insert += "<";
- Iterator iterator = resolved.getParaList().iterator();
- while(iterator.hasNext()){
- RefTypeOrTPHOrWildcardOrGeneric typeParam = iterator.next();
- if(typeParam instanceof TypePlaceholder){
- insert += ((TypePlaceholder) typeParam).getName();
- additionalInserts.add((TypePlaceholder) typeParam);
- }else if(typeParam instanceof RefType) {
- insert += createInsertString((RefType) typeParam, additionalInserts);
- }else if(typeParam instanceof SuperWildcardType){
- insert += "? super " + createInsertString(((SuperWildcardType) typeParam).getInnerType(), additionalInserts);
- }else if(typeParam instanceof ExtendsWildcardType){
- insert += "? extends " + createInsertString(((ExtendsWildcardType) typeParam).getInnerType(), additionalInserts);
- }else throw new NotImplementedException();
- if(iterator.hasNext())insert += ", ";
- }
- insert += ">";
- }
- return insert;
+ ResolvedType resolvedType = resultSet.resolveType(type);
+ TypeInsertPoint insertPoint = new TypeInsertPoint(offset,
+ new TypeToInsertString(resolvedType.resolvedType).insert);
+ return new TypeInsert(insertPoint, new HashSet<>(Arrays.asList(createGenericInsert(resolvedType.additionalGenerics, cl, m))));
}
private static TypeInsertPoint createGenericInsert(Set toInsert, ClassOrInterface cl, Method m){
@@ -174,4 +86,57 @@ public class TypeInsertFactory {
}
return new TypeInsertPoint(offset, insert + end);
}
+}
+
+class TypeToInsertString implements ResultSetVisitor{
+ String insert = "";
+
+ TypeToInsertString(RefTypeOrTPHOrWildcardOrGeneric type){
+ type.accept(this);
+ }
+
+ @Override
+ public void visit(PairTPHsmallerTPH p) {
+
+ }
+
+ @Override
+ public void visit(PairTPHequalRefType p) {
+
+ }
+
+ @Override
+ public void visit(RefType resolved) {
+ insert = resolved.getName().toString();
+ if(resolved.getParaList().size() > 0){
+ insert += "<";
+ Iterator iterator = resolved.getParaList().iterator();
+ while(iterator.hasNext()){
+ RefTypeOrTPHOrWildcardOrGeneric typeParam = iterator.next();
+ insert += new TypeToInsertString(typeParam).insert;
+ if(iterator.hasNext())insert += ", ";
+ }
+ insert += ">";
+ }
+ }
+
+ @Override
+ public void visit(GenericRefType genericRefType) {
+ insert += genericRefType.getName();
+ }
+
+ @Override
+ public void visit(SuperWildcardType superWildcardType) {
+ insert += "? super " + new TypeToInsertString(superWildcardType.getInnerType()).insert;
+ }
+
+ @Override
+ public void visit(TypePlaceholder typePlaceholder) {
+ insert += typePlaceholder.getName();
+ }
+
+ @Override
+ public void visit(ExtendsWildcardType extendsWildcardType) {
+ insert += "? extends " + new TypeToInsertString(extendsWildcardType.getInnerType()).insert;
+ }
}
\ No newline at end of file
diff --git a/src/de/dhbwstuttgart/typedeployment/TypeInsertPlacer.java b/src/de/dhbwstuttgart/typedeployment/TypeInsertPlacer.java
index a8fc9de6e..8dea5748d 100644
--- a/src/de/dhbwstuttgart/typedeployment/TypeInsertPlacer.java
+++ b/src/de/dhbwstuttgart/typedeployment/TypeInsertPlacer.java
@@ -1,16 +1,11 @@
package de.dhbwstuttgart.typedeployment;
import de.dhbwstuttgart.syntaxtree.*;
-import de.dhbwstuttgart.syntaxtree.statement.AssignLeftSide;
import de.dhbwstuttgart.syntaxtree.statement.LambdaExpression;
-import de.dhbwstuttgart.syntaxtree.statement.SuperCall;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
-import de.dhbwstuttgart.typeinference.ResultSet;
-import de.dhbwstuttgart.typeinference.constraints.Pair;
+import de.dhbwstuttgart.typeinference.result.ResultSet;
-import java.util.ArrayList;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
public class TypeInsertPlacer extends AbstractASTWalker{
@@ -34,27 +29,29 @@ class TypeInsertPlacerClass extends AbstractASTWalker{
protected final ResultSet results;
protected final ClassOrInterface cl;
public final Set inserts = new HashSet<>();
+ private Method method;
TypeInsertPlacerClass(ClassOrInterface forClass, ResultSet withResults){
this.cl = forClass;
+ this.method = null;
this.results = withResults;
forClass.accept(this);
}
@Override
public void visit(Method method) {
- for(Set pairs : results.results)
+ this.method = method;
+ if(method.getReturnType() instanceof TypePlaceholder)
inserts.add(TypeInsertFactory.createInsertPoints(
- method.getReturnType(), method.getReturnType().getOffset(), cl, null, pairs));
+ method.getReturnType(), method.getReturnType().getOffset(), cl, method, results));
super.visit(method);
}
@Override
public void visit(Field field) {
if(field.getType() instanceof TypePlaceholder){
- for(Set pairs : results.results)
inserts.add(TypeInsertFactory.createInsertPoints(
- field.getType(), field.getType().getOffset(), cl, null, pairs));
+ field.getType(), field.getType().getOffset(), cl, method, results));
}
super.visit(field);
}
@@ -62,9 +59,9 @@ class TypeInsertPlacerClass extends AbstractASTWalker{
@Override
public void visit(ParameterList params) {
for(FormalParameter param : params){
- for(Set pairs : results.results)
+ if(param.getType() instanceof TypePlaceholder)
inserts.add(TypeInsertFactory.createInsertPoints(
- param.getType(), param.getType().getOffset(), cl, null, pairs));
+ param.getType(), param.getType().getOffset(), cl, method, results));
}
super.visit(params);
}
diff --git a/src/de/dhbwstuttgart/typeinference/ResultSet.java b/src/de/dhbwstuttgart/typeinference/ResultSet.java
deleted file mode 100644
index 915fb81fc..000000000
--- a/src/de/dhbwstuttgart/typeinference/ResultSet.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package de.dhbwstuttgart.typeinference;
-
-import de.dhbwstuttgart.exceptions.NotImplementedException;
-import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
-import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
-import de.dhbwstuttgart.typeinference.constraints.Pair;
-import de.dhbwstuttgart.typeinference.unify.model.PairOperator;
-import de.dhbwstuttgart.typeinference.unify.model.UnifyPair;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-public class ResultSet {
- public final Set> results;
- public ResultSet(Set> results){
- this.results = results;
- }
-
- public List resolveType(RefTypeOrTPHOrWildcardOrGeneric type) {
- /*//Probleme:
- * Es müssen teilweise mehrere TPH eingesetzt werden
- * Es werden alle eingesetzt, welch in der Kette stehen!
- * TPHs müssen zu eindeutigen Namen aufgelöst werden
- */
- final List ret = new ArrayList<>();
- for(Set pairs : results)for(Pair pair : pairs){
- //if(pair.OperatorEqual()){ //type ist vom Typ TypePlaceholder
- if(pair.TA1.equals(type) || pair.TA2.equals(type)){
- ret.add(pair);
- }
- //}
- }
- return ret;
- }
-}
diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/Assumption.java b/src/de/dhbwstuttgart/typeinference/assumptions/Assumption.java
new file mode 100644
index 000000000..2435f58ba
--- /dev/null
+++ b/src/de/dhbwstuttgart/typeinference/assumptions/Assumption.java
@@ -0,0 +1,15 @@
+package de.dhbwstuttgart.typeinference.assumptions;
+
+import de.dhbwstuttgart.syntaxtree.TypeScope;
+
+public class Assumption {
+ private final TypeScope typeScope;
+
+ public Assumption(TypeScope typeScope) {
+ this.typeScope = typeScope;
+ }
+
+ public TypeScope getTypeScope() {
+ return typeScope;
+ }
+}
diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/FieldAssumption.java b/src/de/dhbwstuttgart/typeinference/assumptions/FieldAssumption.java
index d0a278a5e..88b2bd4a9 100644
--- a/src/de/dhbwstuttgart/typeinference/assumptions/FieldAssumption.java
+++ b/src/de/dhbwstuttgart/typeinference/assumptions/FieldAssumption.java
@@ -1,13 +1,15 @@
package de.dhbwstuttgart.typeinference.assumptions;
+import de.dhbwstuttgart.syntaxtree.TypeScope;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
-public class FieldAssumption {
+public class FieldAssumption extends Assumption{
private RefTypeOrTPHOrWildcardOrGeneric receiverType;
private RefTypeOrTPHOrWildcardOrGeneric type;
public FieldAssumption(RefTypeOrTPHOrWildcardOrGeneric receiverType,
- RefTypeOrTPHOrWildcardOrGeneric type){
+ RefTypeOrTPHOrWildcardOrGeneric type, TypeScope scope){
+ super(scope);
this.type = type;
this.receiverType = receiverType;
}
diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/MethodAssumption.java b/src/de/dhbwstuttgart/typeinference/assumptions/MethodAssumption.java
index c878a85ec..bbeff0d71 100644
--- a/src/de/dhbwstuttgart/typeinference/assumptions/MethodAssumption.java
+++ b/src/de/dhbwstuttgart/typeinference/assumptions/MethodAssumption.java
@@ -1,18 +1,22 @@
package de.dhbwstuttgart.typeinference.assumptions;
import de.dhbwstuttgart.syntaxtree.ParameterList;
+import de.dhbwstuttgart.syntaxtree.TypeScope;
+import de.dhbwstuttgart.syntaxtree.statement.Assign;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import java.util.List;
import java.util.stream.Collectors;
-public class MethodAssumption {
+public class MethodAssumption extends Assumption{
private RefType receiver;
private RefTypeOrTPHOrWildcardOrGeneric retType;
List params;
- public MethodAssumption(RefType receiver, RefTypeOrTPHOrWildcardOrGeneric retType, List params){
+ public MethodAssumption(RefType receiver, RefTypeOrTPHOrWildcardOrGeneric retType,
+ List params, TypeScope scope){
+ super(scope);
this.receiver = receiver;
this.retType = retType;
this.params = params;
diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceBlockInformation.java b/src/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceBlockInformation.java
index b0d459df5..df280d480 100644
--- a/src/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceBlockInformation.java
+++ b/src/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceBlockInformation.java
@@ -9,6 +9,7 @@ import de.dhbwstuttgart.syntaxtree.TypeScope;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Set;
import java.util.Stack;
import java.util.stream.Collectors;
@@ -17,15 +18,14 @@ public class TypeInferenceBlockInformation extends TypeInferenceInformation {
private TypeScope methodContext;
private ClassOrInterface currentClass;
- public TypeInferenceBlockInformation(Set availableClasses,
+ public TypeInferenceBlockInformation(Collection availableClasses,
ClassOrInterface currentClass, TypeScope methodContext) {
super(availableClasses);
- this.methodContext = methodContext;
+ this.methodContext = new TypeScopeContainer(currentClass, methodContext);
this.currentClass = currentClass;
}
public TypeInferenceBlockInformation(TypeInferenceBlockInformation oldScope, TypeScope newScope) {
- this(oldScope.getAvailableClasses(), oldScope.currentClass, oldScope.methodContext);
- methodContext = new TypeScopeContainer(methodContext, newScope);
+ this(oldScope.getAvailableClasses(), oldScope.currentClass, new TypeScopeContainer(oldScope.methodContext, newScope));
}
public ClassOrInterface getCurrentClass() {
return currentClass;
@@ -33,28 +33,4 @@ public class TypeInferenceBlockInformation extends TypeInferenceInformation {
public TypeScope getCurrentTypeScope() {
return methodContext;
}
-
- private class TypeScopeContainer implements TypeScope{
- ArrayList scopes = new ArrayList<>();
- Stack types = new Stack<>();
- public TypeScopeContainer(TypeScope scope1, TypeScope scope2){
- scopes.add(scope1);
- scopes.add(scope2);
- types.push(scope1.getReturnType());
- types.push(scope2.getReturnType());
- }
- public void add(TypeScope scope){
- }
-
- @Override
- public Iterable extends GenericTypeVar> getGenerics() {
- return Iterables.concat(scopes.stream().
- map(TypeScope::getGenerics).collect(Collectors.toList()).toArray(new Iterable[0]));
- }
-
- @Override
- public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
- return types.peek();
- }
- }
}
diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceInformation.java b/src/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceInformation.java
index fe1c0cc93..90548e6d3 100644
--- a/src/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceInformation.java
+++ b/src/de/dhbwstuttgart/typeinference/assumptions/TypeInferenceInformation.java
@@ -12,6 +12,7 @@ import de.dhbwstuttgart.typeinference.constraints.Constraint;
import de.dhbwstuttgart.typeinference.constraints.Pair;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -26,9 +27,9 @@ Zweiteres hat den Vorteil, dass bei der Entwicklung leichter Dinge hinzugefügt
Die ganze Logik steckt in dieser Klasse.
*/
public class TypeInferenceInformation {
- private Set classes;
+ private Collection classes;
- public TypeInferenceInformation(Set availableClasses){
+ public TypeInferenceInformation(Collection availableClasses){
classes = availableClasses;
}
@@ -45,14 +46,14 @@ public class TypeInferenceInformation {
for(ClassOrInterface cl : classes){
for(Field m : cl.getFieldDecl()){
if(m.getName().equals(name)){
- ret.add(new FieldAssumption(cl.getType(), checkGTV(m.getType())));
+ ret.add(new FieldAssumption(cl.getType(), checkGTV(m.getType()), new TypeScopeContainer(cl, m)));
}
}
}
return ret;
}
- public Set getAvailableClasses() {
+ public Collection getAvailableClasses() {
return classes;
}
diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/TypeScopeContainer.java b/src/de/dhbwstuttgart/typeinference/assumptions/TypeScopeContainer.java
new file mode 100644
index 000000000..c315fb52c
--- /dev/null
+++ b/src/de/dhbwstuttgart/typeinference/assumptions/TypeScopeContainer.java
@@ -0,0 +1,32 @@
+package de.dhbwstuttgart.typeinference.assumptions;
+
+import com.google.common.collect.Iterables;
+import de.dhbwstuttgart.syntaxtree.GenericTypeVar;
+import de.dhbwstuttgart.syntaxtree.TypeScope;
+import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
+
+import java.util.ArrayList;
+import java.util.Stack;
+import java.util.stream.Collectors;
+
+public class TypeScopeContainer implements TypeScope {
+ ArrayList scopes = new ArrayList<>();
+ Stack types = new Stack<>();
+ public TypeScopeContainer(TypeScope scope1, TypeScope scope2){
+ scopes.add(scope1);
+ scopes.add(scope2);
+ types.push(scope1.getReturnType());
+ types.push(scope2.getReturnType());
+ }
+
+ @Override
+ public Iterable extends GenericTypeVar> getGenerics() {
+ return Iterables.concat(scopes.stream().
+ map(TypeScope::getGenerics).collect(Collectors.toList()).toArray(new Iterable[0]));
+ }
+
+ @Override
+ public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
+ return types.peek();
+ }
+}
\ No newline at end of file
diff --git a/src/de/dhbwstuttgart/typeinference/constraints/ConstraintsFactory.java b/src/de/dhbwstuttgart/typeinference/constraints/ConstraintsFactory.java
index 909f94d28..3d1058da2 100644
--- a/src/de/dhbwstuttgart/typeinference/constraints/ConstraintsFactory.java
+++ b/src/de/dhbwstuttgart/typeinference/constraints/ConstraintsFactory.java
@@ -1,6 +1,8 @@
package de.dhbwstuttgart.typeinference.constraints;
+import de.dhbwstuttgart.exceptions.DebugException;
import de.dhbwstuttgart.syntaxtree.GenericTypeVar;
+import de.dhbwstuttgart.syntaxtree.TypeScope;
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
@@ -9,27 +11,45 @@ import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation;
import de.dhbwstuttgart.typeinference.unify.model.PairOperator;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
public class ConstraintsFactory {
- public static Pair createPair(RefTypeOrTPHOrWildcardOrGeneric t1, RefTypeOrTPHOrWildcardOrGeneric t2, PairOperator equalsdot, TypeInferenceBlockInformation info){
- //Check whether Generics are in the same class:
- return new Pair(checkGeneric(t1, info), checkGeneric(t2, info), equalsdot);
+
+ public static Pair createPair(RefTypeOrTPHOrWildcardOrGeneric t1, RefTypeOrTPHOrWildcardOrGeneric t2,
+ PairOperator equalsdot, TypeScope currentScope, TypeScope additionalScope,
+ GenericsResolver resolver){
+ //Check whether Generics are in the same class and resolve all other generics:
+ return new Pair(checkGeneric(t1, currentScope, additionalScope,resolver),
+ checkGeneric(t2, currentScope,additionalScope, resolver), equalsdot);
}
public static Pair createPair(RefTypeOrTPHOrWildcardOrGeneric t1,
- RefTypeOrTPHOrWildcardOrGeneric t2, TypeInferenceBlockInformation info){
- return createPair(t1,t2,PairOperator.SMALLERDOT, info);
+ RefTypeOrTPHOrWildcardOrGeneric t2, TypeScope currentScope, TypeScope additionalScope,
+ GenericsResolver resolver){
+ return createPair(t1,t2,PairOperator.SMALLERDOT, currentScope, additionalScope, resolver);
}
- private static RefTypeOrTPHOrWildcardOrGeneric checkGeneric(RefTypeOrTPHOrWildcardOrGeneric type, TypeInferenceBlockInformation info){
+ private static RefTypeOrTPHOrWildcardOrGeneric checkGeneric(RefTypeOrTPHOrWildcardOrGeneric type,
+ TypeScope currentScope, TypeScope additionalScope,
+ GenericsResolver resolver){
if(type instanceof GenericRefType){
- for(GenericTypeVar genericTypeVar : info.getCurrentTypeScope().getGenerics()){
- if(genericTypeVar.getName().equals(((GenericRefType)type).getName())){
+ //TODO: Für Generics müssen auch noch Constraints generiert werden
+ for(GenericTypeVar genericTypeVar : currentScope.getGenerics()){
+ if(genericTypeVar.getName().toString().equals(((GenericRefType)type).getName().toString())){
return new RefType(((GenericRefType)type).getName(),type.getOffset());
}
}
//Nicht in den Generics in diesem Kontext enthalten:
- return TypePlaceholder.fresh(type.getOffset());
+ TypePlaceholder ret = null;
+ for(GenericTypeVar genericTypeVar : additionalScope.getGenerics()){
+ if(genericTypeVar.getName().equals(((GenericRefType)type).getName())){
+ ret = resolver.resolve(genericTypeVar);
+ }
+ }
+ if(ret == null)
+ throw new DebugException("Der Generic " + ((GenericRefType) type).getName() + " kommt in keine TypeScope vor!");
+ return ret;
}else{
return type;
}
diff --git a/src/de/dhbwstuttgart/typeinference/constraints/GenericsResolver.java b/src/de/dhbwstuttgart/typeinference/constraints/GenericsResolver.java
new file mode 100644
index 000000000..d72b6835a
--- /dev/null
+++ b/src/de/dhbwstuttgart/typeinference/constraints/GenericsResolver.java
@@ -0,0 +1,12 @@
+package de.dhbwstuttgart.typeinference.constraints;
+
+import de.dhbwstuttgart.syntaxtree.GenericTypeVar;
+import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
+
+/**
+ * Wird für Generics benötigt
+ * TODO: Erklörung!
+ */
+public interface GenericsResolver {
+ public TypePlaceholder resolve(GenericTypeVar generic);
+}
diff --git a/src/de/dhbwstuttgart/typedeployment/GenericInsertPair.java b/src/de/dhbwstuttgart/typeinference/result/GenericInsertPair.java
similarity index 94%
rename from src/de/dhbwstuttgart/typedeployment/GenericInsertPair.java
rename to src/de/dhbwstuttgart/typeinference/result/GenericInsertPair.java
index 9377c063c..824d20838 100644
--- a/src/de/dhbwstuttgart/typedeployment/GenericInsertPair.java
+++ b/src/de/dhbwstuttgart/typeinference/result/GenericInsertPair.java
@@ -1,4 +1,4 @@
-package de.dhbwstuttgart.typedeployment;
+package de.dhbwstuttgart.typeinference.result;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
diff --git a/src/de/dhbwstuttgart/typeinference/result/PairTPHequalRefType.java b/src/de/dhbwstuttgart/typeinference/result/PairTPHequalRefType.java
new file mode 100644
index 000000000..418dff9d7
--- /dev/null
+++ b/src/de/dhbwstuttgart/typeinference/result/PairTPHequalRefType.java
@@ -0,0 +1,24 @@
+package de.dhbwstuttgart.typeinference.result;
+
+import de.dhbwstuttgart.syntaxtree.type.RefType;
+import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
+import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
+
+/**
+ * Steht für A =. RefType
+ */
+public class PairTPHequalRefType extends ResultPair{
+ public final TypePlaceholder left;
+ public final RefTypeOrTPHOrWildcardOrGeneric right;
+
+ public PairTPHequalRefType(TypePlaceholder left, RefTypeOrTPHOrWildcardOrGeneric right){
+ super(left, right);
+ this.left = left;
+ this.right = right;
+ }
+
+ @Override
+ public void accept(ResultSetVisitor visitor) {
+ visitor.visit(this);
+ }
+}
diff --git a/src/de/dhbwstuttgart/typeinference/result/PairTPHsmallerTPH.java b/src/de/dhbwstuttgart/typeinference/result/PairTPHsmallerTPH.java
new file mode 100644
index 000000000..854d4aac4
--- /dev/null
+++ b/src/de/dhbwstuttgart/typeinference/result/PairTPHsmallerTPH.java
@@ -0,0 +1,23 @@
+package de.dhbwstuttgart.typeinference.result;
+
+import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
+import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
+
+/**
+ * Steht für: A <. B
+ */
+public class PairTPHsmallerTPH extends ResultPair{
+ public final TypePlaceholder left;
+ public final TypePlaceholder right;
+
+ public PairTPHsmallerTPH(TypePlaceholder left, TypePlaceholder right){
+ super(left, right);
+ this.left = left;
+ this.right = right;
+ }
+
+ @Override
+ public void accept(ResultSetVisitor visitor) {
+ visitor.visit(this);
+ }
+}
diff --git a/src/de/dhbwstuttgart/typeinference/result/ResolvedType.java b/src/de/dhbwstuttgart/typeinference/result/ResolvedType.java
new file mode 100644
index 000000000..b9e6985b2
--- /dev/null
+++ b/src/de/dhbwstuttgart/typeinference/result/ResolvedType.java
@@ -0,0 +1,17 @@
+package de.dhbwstuttgart.typeinference.result;
+
+import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
+import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
+import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
+
+import java.util.Set;
+
+public class ResolvedType{
+ public final RefTypeOrTPHOrWildcardOrGeneric resolvedType;
+ public final Set additionalGenerics;
+
+ public ResolvedType(RefTypeOrTPHOrWildcardOrGeneric resolvedType, Set additionalGenerics){
+ this.resolvedType = resolvedType;
+ this.additionalGenerics = additionalGenerics;
+ }
+}
diff --git a/src/de/dhbwstuttgart/typeinference/result/ResultPair.java b/src/de/dhbwstuttgart/typeinference/result/ResultPair.java
new file mode 100644
index 000000000..4c7541980
--- /dev/null
+++ b/src/de/dhbwstuttgart/typeinference/result/ResultPair.java
@@ -0,0 +1,26 @@
+package de.dhbwstuttgart.typeinference.result;
+
+import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
+
+/**
+ * Paare, welche das Unifikationsergebnis darstellen
+ */
+public abstract class ResultPair {
+ private final RefTypeOrTPHOrWildcardOrGeneric left;
+ private final RefTypeOrTPHOrWildcardOrGeneric right;
+
+ public abstract void accept(ResultSetVisitor visitor);
+
+ public ResultPair(RefTypeOrTPHOrWildcardOrGeneric left, RefTypeOrTPHOrWildcardOrGeneric right){
+ this.left = left;
+ this.right = right;
+ }
+
+ public RefTypeOrTPHOrWildcardOrGeneric getLeft() {
+ return left;
+ }
+
+ public RefTypeOrTPHOrWildcardOrGeneric getRight() {
+ return right;
+ }
+}
diff --git a/src/de/dhbwstuttgart/typeinference/result/ResultSet.java b/src/de/dhbwstuttgart/typeinference/result/ResultSet.java
new file mode 100644
index 000000000..c28570ae0
--- /dev/null
+++ b/src/de/dhbwstuttgart/typeinference/result/ResultSet.java
@@ -0,0 +1,276 @@
+package de.dhbwstuttgart.typeinference.result;
+
+import de.dhbwstuttgart.exceptions.NotImplementedException;
+import de.dhbwstuttgart.syntaxtree.ASTVisitor;
+import de.dhbwstuttgart.syntaxtree.AbstractASTWalker;
+import de.dhbwstuttgart.syntaxtree.type.*;
+import de.dhbwstuttgart.typeinference.constraints.Pair;
+
+import javax.xml.transform.Result;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class ResultSet {
+ public final Set results;
+ public ResultSet(Set results){
+ this.results = results;
+ }
+
+ public ResolvedType resolveType(RefTypeOrTPHOrWildcardOrGeneric type) {
+ if(type instanceof TypePlaceholder)
+ return new Resolver(this).resolve((TypePlaceholder)type);
+ if(type instanceof RefType){
+ RelatedTypeWalker related = new RelatedTypeWalker(null, this);
+ type.accept(related);
+ return new ResolvedType(type, related.relatedTPHs);
+ }else{
+ throw new NotImplementedException();
+ //return new ResolvedType(type,new HashSet<>());
+ }
+ }
+
+ //TODO Beim Einsetzen eines Generics, müssen die new und Methodenaufrufe verändert werden
+
+
+}
+
+class Resolver implements ResultSetVisitor {
+ private final ResultSet result;
+ private TypePlaceholder toResolve;
+ private RefTypeOrTPHOrWildcardOrGeneric resolved;
+ private final Set additionalTPHs = new HashSet<>();
+
+ public Resolver(ResultSet resultPairs){
+ this.result = resultPairs;
+ }
+
+ public ResolvedType resolve(TypePlaceholder tph){
+ toResolve = tph;
+ resolved = null;
+ for(ResultPair resultPair : result.results){
+ resultPair.accept(this);
+ }
+ if(resolved==null){//TPH kommt nicht im Result vor:
+ resolved = tph;
+ }
+
+ return new ResolvedType(resolved, additionalTPHs);//resolved;
+ }
+
+ @Override
+ public void visit(PairTPHsmallerTPH p) {
+ if(p.left.equals(toResolve)){
+ additionalTPHs.add(new GenericInsertPair(p.left, p.right));
+ additionalTPHs.addAll(new RelatedTypeWalker(p.right, result).relatedTPHs);
+ }
+ if(p.right.equals(toResolve))
+ additionalTPHs.addAll(new RelatedTypeWalker(p.left, result).relatedTPHs);
+ }
+
+ @Override
+ public void visit(PairTPHequalRefType p) {
+ RefTypeOrTPHOrWildcardOrGeneric otherSide = null;
+ if(p.left.equals(toResolve)){
+ resolved = p.right;
+ otherSide = p.left;
+ }
+ if(p.right.equals(toResolve)){
+ resolved = p.left;
+ otherSide = p.right;
+ }
+ if(otherSide != null){
+ if(resolved instanceof RefType){
+ RelatedTypeWalker related = new RelatedTypeWalker(null, result);
+ otherSide.accept(related);
+ additionalTPHs.addAll(related.relatedTPHs);
+ }else if(resolved instanceof TypePlaceholder){
+ RelatedTypeWalker related = new RelatedTypeWalker(null, result);
+ resolved.accept(related);
+ Set newResultSet = new HashSet<>(result.results);
+ newResultSet.remove(p);
+ additionalTPHs.add(new GenericInsertPair((TypePlaceholder)resolved, null));
+ ResolvedType resolvedType = new Resolver(new ResultSet(newResultSet)).resolve((TypePlaceholder) resolved);
+ this.resolved = resolvedType.resolvedType;
+ this.additionalTPHs.addAll(resolvedType.additionalGenerics);
+ resolved.accept(related);
+ this.additionalTPHs.addAll(related.relatedTPHs);
+ }else {
+ throw new NotImplementedException();
+ }
+ }
+ }
+
+ @Override
+ public void visit(RefType refType) {
+
+ }
+
+ @Override
+ public void visit(GenericRefType genericRefType) {
+
+ }
+
+ @Override
+ public void visit(SuperWildcardType superWildcardType) {
+
+ }
+
+ @Override
+ public void visit(TypePlaceholder typePlaceholder) {
+
+ }
+
+ @Override
+ public void visit(ExtendsWildcardType extendsWildcardType) {
+
+ }
+
+}
+
+/**
+ * Sucht aus dem Result Set den Sub/supertyp für einen TPH
+ */
+class TPHResolver implements ResultSetVisitor {
+
+ private final TypePlaceholder tph;
+ Set resolved = new HashSet<>();
+ private final ResultSet resultSet;
+
+ TPHResolver(TypePlaceholder tph, ResultSet resultSet){
+ this.resultSet = resultSet;
+ this.tph = tph;
+ for(ResultPair p : resultSet.results){
+ p.accept(this);
+ }
+ if(resolved.size() == 0){
+ resolved.add(new GenericInsertPair(tph, null));
+ }
+ }
+
+ @Override
+ public void visit(PairTPHsmallerTPH p) {
+ if(p.left.equals(tph) || p.right.equals(tph)){
+ resolved.add(new GenericInsertPair(p.left, p.right));
+ }
+ }
+
+ @Override
+ public void visit(PairTPHequalRefType p) {
+ TypePlaceholder otherSide = null;
+ if(p.left.equals(tph) && p.right instanceof TypePlaceholder){
+ otherSide = (TypePlaceholder) p.right;
+ }
+ if(p.right.equals(tph)){
+ otherSide = p.left;
+ }
+ if(otherSide != null){
+ resolved.add(new GenericInsertPair(p.left, (TypePlaceholder) p.right));
+ Set newResultSet = new HashSet<>(this.resultSet.results);
+ newResultSet.remove(p);
+ resolved.addAll(new TPHResolver(otherSide, new ResultSet(newResultSet)).resolved);
+ }
+ }
+
+ @Override
+ public void visit(RefType refType) {
+
+ }
+
+ @Override
+ public void visit(GenericRefType genericRefType) {
+
+ }
+
+ @Override
+ public void visit(SuperWildcardType superWildcardType) {
+
+ }
+
+ @Override
+ public void visit(TypePlaceholder typePlaceholder) {
+
+ }
+
+ @Override
+ public void visit(ExtendsWildcardType extendsWildcardType) {
+
+ }
+}
+
+class RelatedTypeWalker implements ResultSetVisitor {
+
+ final Set relatedTPHs = new HashSet<>();
+ private final TypePlaceholder toResolve;
+ private final ResultSet resultSet;
+
+ /**
+ * Läuft über das resultSet und speichert alle TPHs, welche mit start in Verbindung stehen
+ * @param start - kann null sein, wenn der Walker für einen RefType benutzt wird
+ * @param resultSet
+ */
+ RelatedTypeWalker(TypePlaceholder start, ResultSet resultSet){
+ this.toResolve = start;
+ this.resultSet = resultSet;
+ int resolved = 0;
+ do{
+ resolved = relatedTPHs.size();
+ for(ResultPair p : resultSet.results){
+ p.accept(this);
+ p.accept(this);
+ }
+ }while(resolved - relatedTPHs.size() > 0);
+ }
+
+ @Override
+ public void visit(PairTPHsmallerTPH p) {
+ if(p.getRight().equals(toResolve)){
+ relatedTPHs.addAll(new TPHResolver(p.right, resultSet).resolved);
+ //relatedTPHs.addAll(new RelatedTypeWalker(p.right, resultSet).relatedTPHs);
+ }
+ if(p.getLeft().equals(toResolve)){
+ relatedTPHs.addAll(new TPHResolver(p.left, resultSet).resolved);
+ //relatedTPHs.addAll(new RelatedTypeWalker(p.left, resultSet).relatedTPHs);
+ }
+ }
+
+ @Override
+ public void visit(PairTPHequalRefType p) {
+ if(p.getLeft().equals(toResolve)){
+ p.getRight().accept(this);
+ }
+ }
+
+ /*
+ Die folgenden Funktionen fügen alle TPHs an die relatedTPHs an, denen sie begegnen:
+ Das wird verwendet, wenn alle relatedTPHs aus den Parametern eines RefTypes angefügt werden sollen
+ */
+
+ @Override
+ public void visit(RefType refType) {
+ for(RefTypeOrTPHOrWildcardOrGeneric param : refType.getParaList()){
+ param.accept(this);
+ }
+ }
+
+ @Override
+ public void visit(SuperWildcardType superWildcardType) {
+ superWildcardType.getInnerType().accept(this);
+ }
+
+ @Override
+ public void visit(TypePlaceholder typePlaceholder) {
+ relatedTPHs.addAll(new TPHResolver(typePlaceholder, resultSet).resolved);
+ }
+
+ @Override
+ public void visit(ExtendsWildcardType extendsWildcardType) {
+ extendsWildcardType.getInnerType().accept(this);
+ }
+
+ @Override
+ public void visit(GenericRefType genericRefType) {
+ }
+}
\ No newline at end of file
diff --git a/src/de/dhbwstuttgart/typeinference/result/ResultSetVisitor.java b/src/de/dhbwstuttgart/typeinference/result/ResultSetVisitor.java
new file mode 100644
index 000000000..3f21ae314
--- /dev/null
+++ b/src/de/dhbwstuttgart/typeinference/result/ResultSetVisitor.java
@@ -0,0 +1,18 @@
+package de.dhbwstuttgart.typeinference.result;
+
+import de.dhbwstuttgart.syntaxtree.type.*;
+
+public interface ResultSetVisitor {
+ void visit(PairTPHsmallerTPH p);
+ void visit(PairTPHequalRefType p);
+
+ void visit(RefType refType);
+
+ void visit(GenericRefType genericRefType);
+
+ void visit(SuperWildcardType superWildcardType);
+
+ void visit(TypePlaceholder typePlaceholder);
+
+ void visit(ExtendsWildcardType extendsWildcardType);
+}
diff --git a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java b/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java
index 960f1ab6f..4a41176c5 100644
--- a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java
+++ b/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java
@@ -1,10 +1,10 @@
package de.dhbwstuttgart.typeinference.typeAlgo;
import de.dhbwstuttgart.exceptions.DebugException;
+import de.dhbwstuttgart.parser.scope.JavaClassName;
import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.factory.ASTFactory;
import de.dhbwstuttgart.syntaxtree.statement.Statement;
-import de.dhbwstuttgart.typecheck.JavaClassName;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceInformation;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
@@ -12,19 +12,20 @@ import java.util.*;
public class TYPE {
- private final List sfs;
+ private final Collection sfs;
+ private final TypeInferenceInformation typeInferenceInformation;
- public TYPE(List sourceFiles){
+ public TYPE(Collection sourceFiles, Collection allAvailableClasses){
sfs = sourceFiles;
+ this.typeInferenceInformation = new TypeInferenceInformation(allAvailableClasses);
}
public ConstraintSet getConstraints() {
ConstraintSet ret = new ConstraintSet();
- TypeInferenceInformation info = getTypeInferenceInformation();
for(SourceFile sf : sfs)
for (ClassOrInterface cl : sf.KlassenVektor) {
- ret.addAll(getConstraintsClass(cl ,info));
+ ret.addAll(getConstraintsClass(cl ,typeInferenceInformation));
}
return ret;
}
@@ -39,25 +40,28 @@ public class TYPE {
}
return ret;
}
+ /*
+ TODO: Hier eine Information erstellen nur mit den importierte Klassen einer einzigen SourceFile
+ private TypeInferenceInformation getTypeInferenceInformation(sourceFile) {
+ ClassLoader classLoader = ClassLoader.getSystemClassLoader();
+ Set classes = new HashSet<>();
- private TypeInferenceInformation getTypeInferenceInformation() {
- ClassLoader classLoader = ClassLoader.getSystemClassLoader();
- Set classes = new HashSet<>();
- for(SourceFile sourceFile : sfs){
- for(JavaClassName importName : sourceFile.imports){
- System.out.println(importName);
- try {
- classes.add(ASTFactory.createClass(classLoader.loadClass(importName.toString())));
- } catch (ClassNotFoundException e) {
- throw new DebugException("Klasse " + importName + " konnte nicht geladen werden");
+ for(SourceFile sourceFile : sfs){
+ for(JavaClassName importName : sourceFile.imports){
+ System.out.println(importName);
+ try {
+ classes.add(ASTFactory.createClass(classLoader.loadClass(importName.toString())));
+ } catch (ClassNotFoundException e) {
+ throw new DebugException("Klasse " + importName + " konnte nicht geladen werden");
+ }
}
+ classes.addAll(sourceFile.KlassenVektor);
}
- classes.addAll(sourceFile.KlassenVektor);
+
+ return new TypeInferenceInformation(classes);
}
- return new TypeInferenceInformation(classes);
- }
-
+ */
private ConstraintSet getConstraintsMethod(Method m, TypeInferenceInformation info, ClassOrInterface currentClass) {
if(m.block == null)return new ConstraintSet(); //Abstrakte Methoden generieren keine Constraints
TypeInferenceBlockInformation blockInfo = new TypeInferenceBlockInformation(info.getAvailableClasses(), currentClass, m);
@@ -67,7 +71,7 @@ public class TYPE {
}
private ConstraintSet getConstraintsConstructor(Constructor m, TypeInferenceInformation info, ClassOrInterface currentClass) {
- TypeInferenceBlockInformation blockInfo = new TypeInferenceBlockInformation(info.getAvailableClasses(), currentClass, null);
+ TypeInferenceBlockInformation blockInfo = new TypeInferenceBlockInformation(info.getAvailableClasses(), currentClass, m);
TYPEStmt methodScope = new TYPEStmt(blockInfo);
//for(Statement stmt : m.fieldInitializations)stmt.accept(methodScope);
ConstraintSet ret = this.getConstraintsMethod(m, info, currentClass);
diff --git a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java b/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
index 9b149620d..e50a8b1ee 100644
--- a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
+++ b/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
@@ -17,16 +17,10 @@ import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.typeinference.assumptions.FieldAssumption;
import de.dhbwstuttgart.typeinference.assumptions.MethodAssumption;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation;
-import de.dhbwstuttgart.typeinference.constraints.Constraint;
-import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
-import de.dhbwstuttgart.typeinference.constraints.ConstraintsFactory;
-import de.dhbwstuttgart.typeinference.constraints.Pair;
+import de.dhbwstuttgart.typeinference.constraints.*;
import de.dhbwstuttgart.typeinference.unify.model.PairOperator;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
import java.util.stream.Collectors;
public class TYPEStmt implements StatementVisitor{
@@ -42,6 +36,20 @@ public class TYPEStmt implements StatementVisitor{
return constraintsSet;
}
+ private static GenericsResolver getResolverInstance(){
+ Map map = new HashMap<>();
+ return generic -> {
+ if(map.containsKey(generic))return map.get(generic);
+ TypePlaceholder ret = TypePlaceholder.fresh(generic.getOffset());
+ map.put(generic, ret);
+ return ret;
+ };
+ }
+
+ private static TypeScope createTypeScope(ClassOrInterface cl, Method method) {
+ return null;
+ }
+
@Override
public void visit(ArgumentList arglist) {
for(int i = 0;i oderConstraints = new HashSet<>();
for(FieldAssumption fieldAssumption : info.getFields(fieldVar.fieldVarName)){
Constraint constraint = new Constraint();
+ GenericsResolver resolver = getResolverInstance();
constraint.add(ConstraintsFactory.createPair(
- fieldVar.receiver.getType(),fieldAssumption.getReceiverType(), info));
+ fieldVar.receiver.getType(),fieldAssumption.getReceiverType(), info.getCurrentTypeScope(), fieldAssumption.getTypeScope(), resolver));
constraint.add(ConstraintsFactory.createPair(
- fieldVar.getType(),fieldAssumption.getType(), info));
+ fieldVar.getType(),fieldAssumption.getType(), info.getCurrentTypeScope(), fieldAssumption.getTypeScope(), resolver));
oderConstraints.add(constraint);
}
if(oderConstraints.size() == 0)
@@ -146,7 +155,9 @@ public class TYPEStmt implements StatementVisitor{
//Overloading:
Set methodConstraints = new HashSet<>();
for(MethodAssumption m : this.getMethods(methodCall.name, methodCall.arglist, info)){
- methodConstraints.add(generateConstraint(methodCall, m, info));
+ GenericsResolver resolver = getResolverInstance();
+ TypeScope additionalScope = m.getTypeScope();
+ methodConstraints.add(generateConstraint(methodCall, m, info, getResolverInstance()));
}
if(methodConstraints.size()<1){
throw new TypeinferenceException("Methode "+methodCall.name+" ist nicht vorhanden!",methodCall.getOffset());
@@ -159,7 +170,7 @@ public class TYPEStmt implements StatementVisitor{
//Overloading:
Set methodConstraints = new HashSet<>();
for(MethodAssumption m : this.getConstructors(info, (RefType) methodCall.getType(), methodCall.getArgumentList())){
- methodConstraints.add(generateConstructorConstraint(methodCall, m, info));
+ methodConstraints.add(generateConstructorConstraint(methodCall, m, info, getResolverInstance()));
}
if(methodConstraints.size()<1){
throw new TypeinferenceException("Konstruktor in Klasse "+methodCall.getType().toString()+" ist nicht vorhanden!",methodCall.getOffset());
@@ -181,7 +192,8 @@ public class TYPEStmt implements StatementVisitor{
public void visit(Return returnExpr) {
returnExpr.retexpr.accept(this);
constraintsSet.addUndConstraint(ConstraintsFactory.createPair(
- returnExpr.getType(),info.getCurrentTypeScope().getReturnType(), PairOperator.EQUALSDOT, info));
+ returnExpr.getType(),info.getCurrentTypeScope().getReturnType(), PairOperator.EQUALSDOT,
+ info.getCurrentTypeScope(), createNullTypeScope(), getResolverInstance()));
}
@Override
@@ -201,7 +213,23 @@ public class TYPEStmt implements StatementVisitor{
@Override
public void visit(This aThis) {
- constraintsSet.addUndConstraint(ConstraintsFactory.createPair( aThis.getType(), info.getCurrentClass().getType(), PairOperator.EQUALSDOT, info));
+ constraintsSet.addUndConstraint(ConstraintsFactory.createPair(
+ aThis.getType(), info.getCurrentClass().getType(), PairOperator.EQUALSDOT, info.getCurrentTypeScope(),
+ createNullTypeScope(), getResolverInstance()));
+ }
+
+ private static TypeScope createNullTypeScope() {
+ return new TypeScope() {
+ @Override
+ public Iterable extends GenericTypeVar> getGenerics() {
+ return new ArrayList<>();
+ }
+
+ @Override
+ public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
+ return null;
+ }
+ };
}
@Override
@@ -226,7 +254,8 @@ public class TYPEStmt implements StatementVisitor{
@Override
public void visit(Literal literal) {
- throw new NotImplementedException();
+ //Hier gibt es nichts zu tun
+ //throw new NotImplementedException();
}
@Override
@@ -248,19 +277,24 @@ public class TYPEStmt implements StatementVisitor{
METHOD CALL Section:
*/
- protected Constraint generateConstraint(MethodCall forMethod, MethodAssumption assumption, TypeInferenceBlockInformation info){
+ protected Constraint generateConstraint(MethodCall forMethod, MethodAssumption assumption,
+ TypeInferenceBlockInformation info, GenericsResolver resolver){
Constraint methodConstraint = new Constraint();
- methodConstraint.add(ConstraintsFactory.createPair(forMethod.receiver.getType(), assumption.getReceiverType(), PairOperator.SMALLERDOT, info));
- methodConstraint.add(ConstraintsFactory.createPair(assumption.getReturnType(), forMethod.getType(), PairOperator.EQUALSDOT, info));
- methodConstraint.addAll(generateParameterConstraints(forMethod, assumption, info));
+ methodConstraint.add(ConstraintsFactory.createPair(forMethod.receiver.getType(), assumption.getReceiverType(),
+ PairOperator.SMALLERDOT, info.getCurrentTypeScope(), assumption.getTypeScope(), resolver));
+ methodConstraint.add(ConstraintsFactory.createPair(assumption.getReturnType(), forMethod.getType(),
+ PairOperator.EQUALSDOT, info.getCurrentTypeScope(), assumption.getTypeScope(), resolver));
+ methodConstraint.addAll(generateParameterConstraints(forMethod, assumption, info, resolver));
return methodConstraint;
}
- protected Set generateParameterConstraints(MethodCall foMethod, MethodAssumption assumption, TypeInferenceBlockInformation info) {
+ protected Set generateParameterConstraints(MethodCall foMethod, MethodAssumption assumption,
+ TypeInferenceBlockInformation info, GenericsResolver resolver) {
Set ret = new HashSet<>();
for(int i = 0;i getGenerics() {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
+ throw new NotImplementedException();
+ }
+ }));
}
for(ClassOrInterface cl : info.getAvailableClasses()){
for(Method m : cl.getMethods()){
@@ -281,7 +326,8 @@ public class TYPEStmt implements StatementVisitor{
m.getParameterList().getFormalparalist().size() == numArgs){
RefTypeOrTPHOrWildcardOrGeneric retType = info.checkGTV(m.getType());
- ret.add(new MethodAssumption(cl.getType(), retType, convertParams(m.getParameterList(),info)));
+ ret.add(new MethodAssumption(cl.getType(), retType, convertParams(m.getParameterList(),info),
+ createTypeScope(cl, m)));
}
}
}
@@ -292,7 +338,16 @@ public class TYPEStmt implements StatementVisitor{
return getMethods(name, arglist.getArguments().size(), info);
}
- protected static List convertParams(ParameterList parameterList, TypeInferenceBlockInformation info){
+ protected static List convertParams(ParameterList parameterList, TypeInferenceBlockInformation info){
+ //TODO: Hier müssen die Parameter mit den TPHs in den GEnerics des Receivers verknüpft werden
+ /*
+ BEispiel:
+ auto test = new List();
+ test.add("hallo");
+
+ Hier kriegt der Receiver ja den COnstraint TPH REceiver <. List
+ Dann mus bei dem Parameter der COnstraint entstehen: TPH A <. String
+ */
List params = new ArrayList<>();
for(FormalParameter fp : parameterList.getFormalparalist()){
params.add(info.checkGTV(fp.getType()));
@@ -306,7 +361,8 @@ public class TYPEStmt implements StatementVisitor{
if(cl.getClassName().equals(ofType.getName())){
for(Method m : cl.getConstructors()){
if(m.getParameterList().getFormalparalist().size() == argList.getArguments().size()){
- ret.add(new MethodAssumption(ofType, ofType, convertParams(m.getParameterList(), info)));
+ ret.add(new MethodAssumption(cl.getType(), ofType, convertParams(m.getParameterList(),
+ info), createTypeScope(cl, m)));
}
}
}
@@ -314,10 +370,12 @@ public class TYPEStmt implements StatementVisitor{
return ret;
}
- protected Constraint generateConstructorConstraint(NewClass forConstructor, MethodAssumption assumption, TypeInferenceBlockInformation info){
+ protected Constraint generateConstructorConstraint(NewClass forConstructor, MethodAssumption assumption,
+ TypeInferenceBlockInformation info, GenericsResolver resolver){
Constraint methodConstraint = new Constraint();
- methodConstraint.add(ConstraintsFactory.createPair(assumption.getReturnType(), forConstructor.getType(), PairOperator.SMALLERDOT, info));
- methodConstraint.addAll(generateParameterConstraints(forConstructor, assumption, info));
+ methodConstraint.add(ConstraintsFactory.createPair(assumption.getReturnType(), forConstructor.getType(),
+ PairOperator.SMALLERDOT, info.getCurrentTypeScope(), assumption.getTypeScope(), resolver));
+ methodConstraint.addAll(generateParameterConstraints(forConstructor, assumption, info, resolver));
return methodConstraint;
}
diff --git a/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java b/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
index 2b641125e..39ea0effc 100644
--- a/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
+++ b/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
@@ -575,8 +575,9 @@ public class RuleSet implements IRuleSet{
if(pair.getPairOp() == PairOperator.EQUALSDOT
&& pair.getLhsType() instanceof PlaceholderType)
lhsType = (PlaceholderType) pair.getLhsType();
+ rhsType = pair.getRhsType(); //PL eingefuegt 2017-09-29 statt !((rhsType = pair.getRhsType()) instanceof PlaceholderType)
if(lhsType != null
- && !((rhsType = pair.getRhsType()) instanceof PlaceholderType)
+ //&& !((rhsType = pair.getRhsType()) instanceof PlaceholderType) //PL geloescht am 2017-09-29 Begründung: auch Typvariablen muessen ersetzt werden.
&& typeMap.get(lhsType) > 1 // The type occurs in more pairs in the set than just the recent pair.
&& !rhsType.getTypeParams().occurs(lhsType)) {
Unifier uni = new Unifier(lhsType, rhsType);
@@ -688,7 +689,10 @@ public class RuleSet implements IRuleSet{
@Override
public Optional> reduceFunN(UnifyPair pair) {
- if(pair.getPairOp() != PairOperator.SMALLERDOT)
+ if((pair.getPairOp() != PairOperator.SMALLERDOT)
+ && (pair.getPairOp() != PairOperator.EQUALSDOT)) //PL 2017-10-03 hinzugefuegt
+ //da Regel auch fuer EQUALSDOT anwendbar
+ //TODO: fuer allen anderen Relationen noch pruefen
return Optional.empty();
UnifyType lhsType = pair.getLhsType();
diff --git a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
index be67ea09f..af672837d 100644
--- a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
+++ b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
@@ -73,7 +73,8 @@ public class TypeUnifyTask extends RecursiveTask>> {
* @param fc The finite closure
* @return The set of all principal type unifiers
*/
- protected Set> unify(Set eq, IFiniteClosure fc, boolean parallel) {
+ protected Set> unify(Set eq, IFiniteClosure fc, boolean parallel) {
+ System.out.println(eq);
/*
* Step 1: Repeated application of reduce, adapt, erase, swap
*/
@@ -119,7 +120,10 @@ public class TypeUnifyTask extends RecursiveTask>> {
// Sets of the "second level"
Set undefinedPairs = new HashSet<>();
Set>>> secondLevelSets = calculatePairSets(eq2s, fc, undefinedPairs);
-
+ //PL 2017-09-20: Im calculatePairSets wird möglicherweise O .< java.lang.Integer
+ //nicht ausgewertet Faculty Beispiel im 1. Schritt
+ //PL 2017-10-03 geloest, muesste noch mit FCs mit kleineren
+ //Typen getestet werden.
// If pairs occured that did not match one of the cartesian product cases,
// those pairs are contradictory and the unification is impossible.
if(!undefinedPairs.isEmpty())
@@ -158,18 +162,23 @@ public class TypeUnifyTask extends RecursiveTask>> {
// Flatten the cartesian product
Set eqPrime = new HashSet<>();
setToFlatten.stream().forEach(x -> eqPrime.addAll(x));
+ System.out.println(eqPrime);
/*
* Step 5: Substitution
*/
Optional> eqPrimePrime = rules.subst(eqPrime);
-
+ System.out.println(eq);
+ System.out.println(eqPrimePrime);
/*
* Step 6 a) Restart (fork) for pairs where subst was applied
*/
if(parallel) {
- if (eqPrime.equals(eq))
+ if //(eqPrime.equals(eq)) //PL 2017-09-29 auskommentiert und durch
+ (!eqPrimePrime.isPresent()) //PL 2071-09-29 dies ersetzt
+ //Begruendung: Wenn in der Substitution keine Veraenderung
+ //(!eqPrimePrime.isPresent()) erfolgt ist, ist das Ergebnis erzielt.
eqPrimePrimeSet.add(eqPrime);
else if(eqPrimePrime.isPresent()) {
TypeUnifyTask fork = new TypeUnifyTask(eqPrimePrime.get(), fc, true);
@@ -183,7 +192,10 @@ public class TypeUnifyTask extends RecursiveTask>> {
}
}
else { // sequentiell (Step 6b is included)
- if (eqPrime.equals(eq))
+ if //(eqPrime.equals(eq)) //PL 2017-09-29 auskommentiert und durch
+ (!eqPrimePrime.isPresent()) //PL 2071-09-29 dies ersetzt
+ //Begruendung: Wenn in der Substitution keine Veraenderung
+ //(!eqPrimePrime.isPresent()) erfolgt ist, ist das Ergebnis erzielt.
eqPrimePrimeSet.add(eqPrime);
else if(eqPrimePrime.isPresent())
eqPrimePrimeSet.addAll(unify(eqPrimePrime.get(), fc, false));
@@ -440,7 +452,8 @@ public class TypeUnifyTask extends RecursiveTask>> {
for(UnifyType c : cs) {
Set thetaQs = fc.getChildren(c).stream().collect(Collectors.toCollection(HashSet::new));
- //thetaQs.add(thetaPrime);
+ thetaQs.add(thetaPrime); //PL 2017-10-03: War auskommentiert habe ich wieder einkommentiert,
+ //da children offensichtlich ein echtes kleiner und kein kleinergleich ist
Set thetaQPrimes = new HashSet<>();
TypeParams cParams = c.getTypeParams();
if(cParams.size() == 0)
diff --git a/test/javFiles/Faculty.jav b/test/javFiles/Faculty.jav
index f69a48c74..c7cbf4077 100644
--- a/test/javFiles/Faculty.jav
+++ b/test/javFiles/Faculty.jav
@@ -5,7 +5,7 @@ class Faculty {
}
m () {
- auto fact = (Integer x) -> {
+ var fact = (Integer x) -> {
return mul(x, fact.apply(x));
};
return fact;
diff --git a/test/javFiles/Generics.jav b/test/javFiles/Generics.jav
index 9e4361a9c..958025e61 100644
--- a/test/javFiles/Generics.jav
+++ b/test/javFiles/Generics.jav
@@ -1,6 +1,6 @@
class Generics {
- A mt1(A a, B b){
+ A mt1(A a, B b){
return mt1(a, a);
}
}
@@ -10,3 +10,11 @@ class Test {
return new Generics().mt1(s,s);
}
}
+
+/*
+Problem:
+auto test = new List();
+auto test2 = new List();
+... //code, welcher möglicherweise test und test2 vertauscht
+test.add("hallo");
+*/
\ No newline at end of file
diff --git a/test/javFiles/Lambda2.jav b/test/javFiles/Lambda2.jav
index b0ef82219..fbcdaf55b 100644
--- a/test/javFiles/Lambda2.jav
+++ b/test/javFiles/Lambda2.jav
@@ -2,8 +2,8 @@
public class Lambda2
{
public static void main(List args){
- auto listOfStrings = new List();
- auto listOfObjects;
+ var listOfStrings = new List();
+ var listOfObjects;
listOfObjects = map(listOfStrings, (a) -> a);
}
diff --git a/test/javFiles/mathStruc.jav b/test/javFiles/mathStruc.jav
index adcdf6496..93f901ce5 100644
--- a/test/javFiles/mathStruc.jav
+++ b/test/javFiles/mathStruc.jav
@@ -6,7 +6,7 @@ mathStruc(A a) { }
A model(){ A a; return a; }
methode(){
-auto innerOp = o -> ms ->
+var innerOp = o -> ms ->
new mathStruc(o.apply(this.model(),ms.model()));
return innerOp;
}
diff --git a/test/javFiles/test.jav b/test/javFiles/test.jav
new file mode 100644
index 000000000..b539c15d5
--- /dev/null
+++ b/test/javFiles/test.jav
@@ -0,0 +1,15 @@
+class Test{
+ methode(param1, param2, param3) {
+ return param1.meth(param2.meth(param3));
+ }
+}
+
+interface Klasse1{
+ Klasse1 meth(Klasse1 p);
+ Klasse1 meth(Klasse2 p);
+}
+
+interface Klasse2{
+ Klasse1 meth(Klasse1 p):
+ Klasse2 meth(Klasse2 p):
+}
\ No newline at end of file
diff --git a/test/parser/FeatherWeightJavaTest.java b/test/parser/FeatherWeightJavaTest.java
deleted file mode 100644
index 84113e0cb..000000000
--- a/test/parser/FeatherWeightJavaTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package parser;
-
-import de.dhbwstuttgart.parser.JavaTXParser;
-import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
-import de.dhbwstuttgart.syntaxtree.Field;
-import de.dhbwstuttgart.syntaxtree.Method;
-import de.dhbwstuttgart.syntaxtree.SourceFile;
-import org.junit.Test;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.Modifier;
-
-public class FeatherWeightJavaTest {
- private static final String rootDirectory = System.getProperty("user.dir")+"/test/parser/";
-
- @Test
- public void test() throws IOException, ClassNotFoundException {
-
- JavaTXParser parser = new JavaTXParser();
- SourceFile f = parser.parse(new File(rootDirectory + "Methods.jav"));
-
- String pkgName = f.getPkgName();
- System.out.println("package: " + pkgName);
- System.out.println("classes:");
- for(ClassOrInterface c : f.getClasses()){
- int mod = c.getModifiers();
- System.out.println(Modifier.toString(mod));
- System.out.println(c.getClassName().toString());
- System.out.println("{");
- for(Field field : c.getFieldDecl()){
- System.out.println(field.getName());
- if(field instanceof Method){
- System.out.println(((Method) field).getParameterList().getFormalparalist().toString());
- }
- }
- System.out.println("}");
- }
- }
-}
diff --git a/test/parser/FieldTest.java b/test/parser/FieldTest.java
deleted file mode 100644
index 134943e04..000000000
--- a/test/parser/FieldTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package parser;
-
-import de.dhbwstuttgart.parser.JavaTXParser;
-import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
-import de.dhbwstuttgart.syntaxtree.Field;
-import de.dhbwstuttgart.syntaxtree.SourceFile;
-import org.junit.Test;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.Modifier;
-
-public class FieldTest {
- private static final String rootDirectory = System.getProperty("user.dir")+"/test/parser/";
-
- @Test
- public void test() throws IOException, ClassNotFoundException, ClassNotFoundException {
-
- JavaTXParser parser = new JavaTXParser();
- SourceFile f = parser.parse(new File(rootDirectory + "FieldVarTest.jav"));
-
- String pkgName = f.getPkgName();
- System.out.println("package: " + pkgName);
- System.out.println("classes:");
- for(ClassOrInterface c : f.getClasses()){
- int mod = c.getModifiers();
- System.out.println(Modifier.toString(mod));
- System.out.println(c.getClassName().toString());
- System.out.println("{");
- for(Field field : c.getFieldDecl()){
- System.out.println(field.getName());
- }
- System.out.println("}");
- }
- }
-}
diff --git a/test/parser/RunParserTest.java b/test/parser/RunParserTest.java
deleted file mode 100644
index f1c63434e..000000000
--- a/test/parser/RunParserTest.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package parser;
-
-import de.dhbwstuttgart.parser.JavaTXParser;
-import de.dhbwstuttgart.syntaxtree.SourceFile;
-import de.dhbwstuttgart.syntaxtree.visual.ASTPrinter;
-import org.junit.Test;
-
-import java.io.File;
-
-import static org.junit.Assert.*;
-
-public class RunParserTest {
-
- private static final String rootDirectory = System.getProperty("user.dir")+"/test/parser/";
-
- @Test
- public void testMain() throws Exception {
- String[] args = new String[1];
- args[0] = rootDirectory+"WhileTest.jav";
- SourceFile sf = new JavaTXParser().parse(new File(args[0]));
- System.out.println(ASTPrinter.print(sf));
- }
-}
\ No newline at end of file
diff --git a/test/typeinference/FacultyTest.java b/test/typeinference/FacultyTest.java
new file mode 100644
index 000000000..aadaf6e72
--- /dev/null
+++ b/test/typeinference/FacultyTest.java
@@ -0,0 +1,9 @@
+package typeinference;
+
+import java.io.File;
+
+public class FacultyTest extends JavaTXCompilerTest{
+ public FacultyTest() {
+ this.fileToTest = new File(rootDirectory+"Faculty.jav");
+ }
+}
\ No newline at end of file
diff --git a/test/typeinference/GenericsTest.java b/test/typeinference/GenericsTest.java
new file mode 100644
index 000000000..3811883d8
--- /dev/null
+++ b/test/typeinference/GenericsTest.java
@@ -0,0 +1,9 @@
+package typeinference;
+
+import java.io.File;
+
+public class GenericsTest extends JavaTXCompilerTest{
+ public GenericsTest() {
+ this.fileToTest = new File(rootDirectory+"Generics.jav");
+ }
+}
\ No newline at end of file
diff --git a/test/typeinference/JavaTXCompilerTest.java b/test/typeinference/JavaTXCompilerTest.java
index 2337dad64..b44a710b0 100644
--- a/test/typeinference/JavaTXCompilerTest.java
+++ b/test/typeinference/JavaTXCompilerTest.java
@@ -1,21 +1,17 @@
package typeinference;
import de.dhbwstuttgart.core.JavaTXCompiler;
-import de.dhbwstuttgart.exceptions.DebugException;
import de.dhbwstuttgart.syntaxtree.SourceFile;
-import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
-import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
-import de.dhbwstuttgart.syntaxtree.visual.ASTPrinter;
import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
-import de.dhbwstuttgart.syntaxtree.visual.OutputGenerator;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
-import de.dhbwstuttgart.typedeployment.TypeInsertPoint;
-import de.dhbwstuttgart.typeinference.ResultSet;
+import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
+import java.net.URL;
+import java.net.URLClassLoader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
@@ -24,18 +20,22 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
-import static org.junit.Assert.*;
+public class JavaTXCompilerTest {
-public class JavaTXCompilerTest extends JavaTXCompiler {
-
- private static final String rootDirectory = System.getProperty("user.dir")+"/test/javFiles/";
+ public static final String rootDirectory = System.getProperty("user.dir")+"/test/javFiles/";
private static final List filesToTest = new ArrayList<>();
+ protected File fileToTest = null;
+
+ public JavaTXCompilerTest(){
+ }
@Test
public void test() throws IOException, java.lang.ClassNotFoundException {
+ if(fileToTest != null)filesToTest.add(fileToTest);
+ else return;
//filesToTest.add(new File(rootDirectory+"Faculty.jav"));
//filesToTest.add(new File(rootDirectory+"mathStruc.jav"));
- filesToTest.add(new File(rootDirectory+"test.jav"));
+ //filesToTest.add(new File(rootDirectory+"test.jav"));
//filesToTest.add(new File(rootDirectory+"Lambda.jav"));
//filesToTest.add(new File(rootDirectory+"Lambda2.jav"));
//filesToTest.add(new File(rootDirectory+"Lambda3.jav"));
@@ -44,16 +44,23 @@ public class JavaTXCompilerTest extends JavaTXCompiler {
//filesToTest.add(new File(rootDirectory+"MethodsEasy.jav"));
//filesToTest.add(new File(rootDirectory+"Matrix.jav"));
//filesToTest.add(new File(rootDirectory+"Import.jav"));
- for(File f : filesToTest){
- SourceFile sf = this.parse(f);
- System.out.println(ASTTypePrinter.print(this.sourceFiles.get(sourceFiles.size()-1)));
- Set result = TypeInsertFactory.createTypeInsertPoints(sf, this.typeInference());
- String content = readFile(f.getPath(), StandardCharsets.UTF_8);
- for(TypeInsert tip : result){
- System.out.println(tip.insert(content));
+ JavaTXCompiler compiler = new JavaTXCompiler(fileToTest);
+ List results = compiler.typeInference();
+
+ for(File f : compiler.sourceFiles.keySet()){
+ SourceFile sf = compiler.sourceFiles.get(f);
+ System.out.println(ASTTypePrinter.print(sf));
+ //List results = compiler.typeInference(); PL 2017-10-03 vor die For-Schleife gezogen
+ assert results.size()>0;
+ for(ResultSet resultSet : results){
+ Set result = TypeInsertFactory.createTypeInsertPoints(sf, resultSet);
+ assert result.size()>0;
+ String content = readFile(f.getPath(), StandardCharsets.UTF_8);
+ for(TypeInsert tip : result){
+ System.out.println(tip.insert(content));
+ }
}
}
-
}
static String readFile(String path, Charset encoding)
@@ -63,4 +70,5 @@ public class JavaTXCompilerTest extends JavaTXCompiler {
return new String(encoded, encoding);
}
-}
\ No newline at end of file
+}
+
diff --git a/test/typeinference/Lambda2Test.java b/test/typeinference/Lambda2Test.java
new file mode 100644
index 000000000..84867cd92
--- /dev/null
+++ b/test/typeinference/Lambda2Test.java
@@ -0,0 +1,9 @@
+package typeinference;
+
+import java.io.File;
+
+public class Lambda2Test extends JavaTXCompilerTest{
+ public Lambda2Test() {
+ this.fileToTest = new File(rootDirectory+"Lambda2.jav");
+ }
+}
\ No newline at end of file
diff --git a/test/typeinference/Lambda3Test.java b/test/typeinference/Lambda3Test.java
new file mode 100644
index 000000000..843eee108
--- /dev/null
+++ b/test/typeinference/Lambda3Test.java
@@ -0,0 +1,9 @@
+package typeinference;
+
+import java.io.File;
+
+public class Lambda3Test extends JavaTXCompilerTest{
+ public Lambda3Test() {
+ this.fileToTest = new File(rootDirectory+"Lambda3.jav");
+ }
+}
\ No newline at end of file
diff --git a/test/typeinference/LambdaTest.java b/test/typeinference/LambdaTest.java
new file mode 100644
index 000000000..abdaa1404
--- /dev/null
+++ b/test/typeinference/LambdaTest.java
@@ -0,0 +1,9 @@
+package typeinference;
+
+import java.io.File;
+
+public class LambdaTest extends JavaTXCompilerTest{
+ public LambdaTest() {
+ this.fileToTest = new File(rootDirectory+"Lambda.jav");
+ }
+}
\ No newline at end of file
diff --git a/test/typeinference/VectorTest.java b/test/typeinference/VectorTest.java
new file mode 100644
index 000000000..864535b3a
--- /dev/null
+++ b/test/typeinference/VectorTest.java
@@ -0,0 +1,9 @@
+package typeinference;
+
+import java.io.File;
+
+public class VectorTest extends JavaTXCompilerTest{
+ public VectorTest() {
+ this.fileToTest = new File(rootDirectory+"Vector.jav");
+ }
+}
\ No newline at end of file
diff --git a/test/typeinference/mathStrucTest.java b/test/typeinference/mathStrucTest.java
new file mode 100644
index 000000000..0181be72d
--- /dev/null
+++ b/test/typeinference/mathStrucTest.java
@@ -0,0 +1,9 @@
+package typeinference;
+
+import java.io.File;
+
+public class mathStrucTest extends JavaTXCompilerTest{
+ public mathStrucTest() {
+ this.fileToTest = new File(rootDirectory+"mathStruc.jav");
+ }
+}
\ No newline at end of file
diff --git a/tools/.cvsignore b/tools/.cvsignore
deleted file mode 100755
index d62809ee7..000000000
--- a/tools/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-y.output
-*.java
-*.class
\ No newline at end of file
diff --git a/tools/AntParserBuilder.xml b/tools/AntParserBuilder.xml
deleted file mode 100755
index 7ec9f6164..000000000
--- a/tools/AntParserBuilder.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tools/AntParserBuilderDarwin.xml b/tools/AntParserBuilderDarwin.xml
deleted file mode 100755
index df5b31d65..000000000
--- a/tools/AntParserBuilderDarwin.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tools/AntParserBuilderLinux.xml b/tools/AntParserBuilderLinux.xml
deleted file mode 100755
index 0502bbf4f..000000000
--- a/tools/AntParserBuilderLinux.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tools/AntParserBuilderWindows.xml b/tools/AntParserBuilderWindows.xml
deleted file mode 100755
index e867e27c4..000000000
--- a/tools/AntParserBuilderWindows.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/JLex.jar b/tools/JLex.jar
deleted file mode 100755
index ae5f6d710..000000000
Binary files a/tools/JLex.jar and /dev/null differ
diff --git a/tools/JLex_neu.jar b/tools/JLex_neu.jar
deleted file mode 100755
index df8053ff7..000000000
Binary files a/tools/JLex_neu.jar and /dev/null differ
diff --git a/tools/JavaParser.jay b/tools/JavaParser.jay
deleted file mode 100755
index 1c3f562a0..000000000
--- a/tools/JavaParser.jay
+++ /dev/null
@@ -1,1509 +0,0 @@
-%{
-import de.dhbwstuttgart.typeinference.Menge;
-class JavaParser{
-public Menge path = new Menge();
-%}
-
-%token ABSTRACT
-%token BOOLEAN
-%token BREAK
-%token CASE
-%token CATCH
-%token CHAR
-%token CLASS
-%token CONTINUE
-%token DEFAULT
-%token DO
-%token ELSE
-%token EXTENDS
-%token FINALLY
-%token FOR
-%token IF
-%token INSTANCEOF
-%token INT
-%token NEW
-%token PRIVATE
-%token PROTECTED
-%token PUBLIC
-%token RETURN
-%token STATIC
-%token SUPER
-%token SWITCH
-%token THIS
-%token THROW
-%token THROWS
-%token TRY
-%token VOID
-%token WHILE
-%token INTLITERAL
-%token BOOLLITERAL
-%token JNULL
-%token CHARLITERAL
-%token STRINGLITERAL
-%token IDENTIFIER
-%token EQUAL
-%token LESSEQUAL
-%token GREATEREQUAL
-%token NOTEQUAL
-%token LOGICALOR
-%token LOGICALAND
-%token INCREMENT
-%token DECREMENT
-%token SHIFTLEFT
-%token SHIFTRIGHT
-%token UNSIGNEDSHIFTRIGHT
-%token SIGNEDSHIFTRIGHT
-%token PLUSEQUAL
-%token MINUSEQUAL
-%token TIMESEQUAL
-%token DIVIDEEQUAL
-%token ANDEQUAL
-%token OREQUAL
-%token XOREQUAL
-%token MODULOEQUAL
-%token SHIFTLEFTEQUAL
-%token SIGNEDSHIFTRIGHTEQUAL
-%token UNSIGNEDSHIFTRIGHTEQUAL
-%token BRACE
-%token RELOP
-%token OP
-%token EOF
-
-%type classdeclaration
-%type classbody
-%type fielddeclaration
-%type methodheader
-%type methoddeclaration
-%type methoddeclarator
-%type classbodydeclarations
-%type classbodydeclaration
-%type classmemberdeclaration
-%type variabledeclarators
-%type variabledeclarator
-%type variabledeclaratorid
-%type simplename
-%type qualifiedname
-%type name
-%type super
-%type classtype
-%type classorinterfacetype
-%type integraltype
-%type numerictype
-%type primitivetype
-%type referencetype
-%type classtypelist
-%type type
-%type modifiers
-%type modifier
-%type block
-%type methodbody
-%type blockstatements
-%type localvariabledeclarationstatement
-%type localvariabledeclaration
-%type throws
-%type formalparameter
-%type formalparameterlist
-%type literal
-%type primarynonewarray
-%type primary
-%type postfixexpression
-%type unaryexpressionnotplusminus
-%type unaryexpression
-%type multiplicativeexpression
-%type additiveexpression
-%type shiftexpression
-%type relationalexpression
-%type equalityexpression
-%type andexpression
-%type exclusiveorexpression
-%type inclusiveorexpression
-%type conditionalandexpression
-%type conditionalorexpression
-%type conditionalexpression
-%type assignmentexpression
-%type expression
-%type statementexpression
-%type preincrementexpression
-%type predecrementexpression
-%type postincrementexpression
-%type postdecrementexpression
-%type expressionstatement
-%type variableinitializer
-%type statementwithouttrailingsubstatement
-%type blockstatement
-%type statement
-%type statementnoshortif
-%type whilestatement
-%type whilestatementnoshortif
-%type ifthenstatement
-%type ifthenelsestatement
-%type ifthenelsestatementnoshortif
-%type emptystatement
-%type returnstatement
-%type classinstancecreationexpression
-%type compilationunit
-%type typedeclarations
-%type assignment
-%type assignmentoperator
-%type lefthandside
-%type