Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 998c146f4b | |||
| 88c78342d5 | |||
| 86b2118770 | |||
| 03080c43cb | |||
| df1c19e60d | |||
| 07303ffa71 | |||
| 881830235a | |||
| b88b9e2534 | |||
| 8e1c1765ff |
+21
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="test"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="lib" path="lib/bcel-6.1-SNAPSHOT.jar" sourcepath="lib/bcel-6.1-SNAPSHOT-sources.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
||||
<classpathentry kind="lib" path="lib/antlr-complete.jar"/>
|
||||
<classpathentry kind="lib" path="lib/annotations-2.0.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/bcel-6.1-SNAPSHOT-sources.jar"/>
|
||||
<classpathentry kind="lib" path="lib/cloning.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-bcel6-6.0-SNAPSHOT.jar"/>
|
||||
<classpathentry kind="lib" path="lib/javassist-3.19.0-GA.jar"/>
|
||||
<classpathentry kind="lib" path="lib/junit-4.0.jar"/>
|
||||
<classpathentry kind="lib" path="lib/log4j-1.2.12.jar"/>
|
||||
<classpathentry kind="lib" path="lib/reflections-0.9.10-javadoc.jar"/>
|
||||
<classpathentry kind="lib" path="lib/reflections-0.9.10-sources.jar"/>
|
||||
<classpathentry kind="lib" path="lib/reflections-0.9.10.jar" sourcepath="/reflections/src"/>
|
||||
<classpathentry kind="lib" path="lib/guava-22.0.jar" sourcepath="lib/guava-22.0-sources.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
-19
@@ -10,22 +10,3 @@ bin
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
# IDEs
|
||||
.classpath
|
||||
*.iml
|
||||
.idea/
|
||||
/target/
|
||||
.DS_Store
|
||||
.project
|
||||
.settings/
|
||||
/target/
|
||||
|
||||
#
|
||||
manually/
|
||||
|
||||
logFiles/**
|
||||
!logFiles/.gitkeep
|
||||
|
||||
src/main/java/de/dhbwstuttgart/parser/antlr/
|
||||
src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/
|
||||
|
||||
Generated
+22
@@ -0,0 +1,22 @@
|
||||
<component name="libraryTable">
|
||||
<library name="lib">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/lib/log4j-1.2.12.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/guava-10.0.1.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/bcel-6.1-SNAPSHOT.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/bcel-6.1-SNAPSHOT-sources.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/annotations-2.0.1.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/guava-15.0.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/junit-4.0.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/commons-bcel6-6.0-SNAPSHOT.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/reflections-0.9.10-javadoc.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/reflections-0.9.10.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/cloning.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/javassist-3.19.0-GA.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/reflections-0.9.10-sources.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/antlr-complete.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>JavaCompilerCore</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,12 @@
|
||||
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
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,25 +0,0 @@
|
||||
\documentclass{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\section{Generics sind notwendig}
|
||||
Generics können nicht ignoriert werden.
|
||||
Folgender Fall ist Typisierbar:
|
||||
|
||||
\begin{program}
|
||||
<T> T m1(T x){
|
||||
return m2(x);
|
||||
}
|
||||
|
||||
m2(x){
|
||||
m1(1);
|
||||
m2("Test");
|
||||
return m1(x);
|
||||
}
|
||||
\end{program}
|
||||
|
||||
Beim weglassen des Generics T wäre es aber nicht mehr möglich.
|
||||
Dann erhält jeder Constraint, welcher in Verbindung mit der Methode m1 steht
|
||||
den selben TPH.
|
||||
|
||||
\end{document}
|
||||
@@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.literal.BoolLiteral</li>
|
||||
@@ -253,7 +253,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
|
||||
</tr>
|
||||
</table>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>
|
||||
|
||||
@@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.literal.CharLiteral</li>
|
||||
@@ -253,7 +253,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
|
||||
</tr>
|
||||
</table>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>
|
||||
|
||||
@@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.literal.DoubleLiteral</li>
|
||||
@@ -263,7 +263,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
|
||||
</tr>
|
||||
</table>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>
|
||||
|
||||
@@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.literal.FloatLiteral</li>
|
||||
@@ -263,7 +263,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
|
||||
</tr>
|
||||
</table>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>
|
||||
|
||||
@@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.literal.NumberLiteral</li>
|
||||
@@ -263,7 +263,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
|
||||
</tr>
|
||||
</table>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>
|
||||
|
||||
@@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.Literal</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.literal.Literal</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.LongLiteral</li>
|
||||
@@ -263,7 +263,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
|
||||
</tr>
|
||||
</table>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>
|
||||
|
||||
@@ -115,7 +115,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.UnaryExpr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.NegativeExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.NegativeExpr</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -115,7 +115,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.UnaryExpr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.NotExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.NotExpr</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.literal.Null</li>
|
||||
@@ -245,7 +245,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
|
||||
</tr>
|
||||
</table>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>
|
||||
|
||||
@@ -115,7 +115,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.UnaryExpr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.PositivExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.PositivExpr</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -115,7 +115,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.UnaryExpr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.PostDecExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.PostDecExpr</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -115,7 +115,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.UnaryExpr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.PostIncExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.PostIncExpr</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -115,7 +115,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.UnaryExpr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.PreDecExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.PreDecExpr</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -115,7 +115,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/UnaryExpr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.UnaryExpr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.PreIncExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.PreIncExpr</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.literal.StringLiteral</li>
|
||||
@@ -253,7 +253,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
|
||||
</tr>
|
||||
</table>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html lang="de">
|
||||
<head>
|
||||
<!-- Generated by javadoc (1.8.0_05) on Tue May 12 19:56:24 CEST 2015 -->
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.Literal</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.literal.Literal</title>
|
||||
<meta name="date" content="2015-05-12">
|
||||
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
|
||||
<script type="text/javascript" src="../../../../../script.js"></script>
|
||||
@@ -70,7 +70,7 @@
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
<div class="header">
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.Literal" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.Literal</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.literal.Literal" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.Literal</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">
|
||||
<ul class="blockList">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html lang="de">
|
||||
<head>
|
||||
<!-- Generated by javadoc (1.8.0_05) on Tue May 12 19:56:24 CEST 2015 -->
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.NegativeExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.NegativeExpr</title>
|
||||
<meta name="date" content="2015-05-12">
|
||||
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
|
||||
<script type="text/javascript" src="../../../../../script.js"></script>
|
||||
@@ -70,9 +70,9 @@
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
<div class="header">
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.NegativeExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.NegativeExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.NegativeExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.NegativeExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.NegativeExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.NegativeExpr</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<div class="bottomNav"><a name="navbar.bottom">
|
||||
<!-- -->
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html lang="de">
|
||||
<head>
|
||||
<!-- Generated by javadoc (1.8.0_05) on Tue May 12 19:56:24 CEST 2015 -->
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.NotExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.NotExpr</title>
|
||||
<meta name="date" content="2015-05-12">
|
||||
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
|
||||
<script type="text/javascript" src="../../../../../script.js"></script>
|
||||
@@ -70,9 +70,9 @@
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
<div class="header">
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.NotExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.NotExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.NotExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.NotExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.NotExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.NotExpr</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<div class="bottomNav"><a name="navbar.bottom">
|
||||
<!-- -->
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html lang="de">
|
||||
<head>
|
||||
<!-- Generated by javadoc (1.8.0_05) on Tue May 12 19:56:24 CEST 2015 -->
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PositivExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.PositivExpr</title>
|
||||
<meta name="date" content="2015-05-12">
|
||||
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
|
||||
<script type="text/javascript" src="../../../../../script.js"></script>
|
||||
@@ -70,9 +70,9 @@
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
<div class="header">
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PositivExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PositivExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.PositivExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PositivExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.PositivExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.PositivExpr</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<div class="bottomNav"><a name="navbar.bottom">
|
||||
<!-- -->
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html lang="de">
|
||||
<head>
|
||||
<!-- Generated by javadoc (1.8.0_05) on Tue May 12 19:56:24 CEST 2015 -->
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PostDecExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.PostDecExpr</title>
|
||||
<meta name="date" content="2015-05-12">
|
||||
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
|
||||
<script type="text/javascript" src="../../../../../script.js"></script>
|
||||
@@ -70,9 +70,9 @@
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
<div class="header">
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PostDecExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PostDecExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.PostDecExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PostDecExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.PostDecExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.PostDecExpr</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<div class="bottomNav"><a name="navbar.bottom">
|
||||
<!-- -->
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html lang="de">
|
||||
<head>
|
||||
<!-- Generated by javadoc (1.8.0_05) on Tue May 12 19:56:24 CEST 2015 -->
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PostIncExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.PostIncExpr</title>
|
||||
<meta name="date" content="2015-05-12">
|
||||
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
|
||||
<script type="text/javascript" src="../../../../../script.js"></script>
|
||||
@@ -70,9 +70,9 @@
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
<div class="header">
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PostIncExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PostIncExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.PostIncExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PostIncExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.PostIncExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.PostIncExpr</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<div class="bottomNav"><a name="navbar.bottom">
|
||||
<!-- -->
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html lang="de">
|
||||
<head>
|
||||
<!-- Generated by javadoc (1.8.0_05) on Tue May 12 19:56:24 CEST 2015 -->
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PreDecExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.PreDecExpr</title>
|
||||
<meta name="date" content="2015-05-12">
|
||||
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
|
||||
<script type="text/javascript" src="../../../../../script.js"></script>
|
||||
@@ -70,9 +70,9 @@
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
<div class="header">
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PreDecExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PreDecExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.PreDecExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PreDecExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.PreDecExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.PreDecExpr</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<div class="bottomNav"><a name="navbar.bottom">
|
||||
<!-- -->
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html lang="de">
|
||||
<head>
|
||||
<!-- Generated by javadoc (1.8.0_05) on Tue May 12 19:56:24 CEST 2015 -->
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PreIncExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.PreIncExpr</title>
|
||||
<meta name="date" content="2015-05-12">
|
||||
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
|
||||
<script type="text/javascript" src="../../../../../script.js"></script>
|
||||
@@ -70,9 +70,9 @@
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
<div class="header">
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PreIncExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PreIncExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.PreIncExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PreIncExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.PreIncExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.PreIncExpr</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<div class="bottomNav"><a name="navbar.bottom">
|
||||
<!-- -->
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,24 +0,0 @@
|
||||
# Dateien
|
||||
* sämtliche Datein im Ordner de.dhbwstuttgart.parser gehören zum Parser
|
||||
* Auch zu beachten: pom.xml
|
||||
* Ein Teil der pom.xml instruiert maven zur Kompilierung der Java8.g4 Datei
|
||||
* VORSICHT! Wird nicht zwangsläufig von der IDE ausgeführt
|
||||
* siehe Kapitel "Grammatik -> Parser"
|
||||
|
||||
|
||||
## Unterordner antlr
|
||||
* Java8.g4
|
||||
* die eigentliche Java Grammatik
|
||||
* hier wurden Anpassungen vorgenommen, damit sie auch typloses Java annimmt
|
||||
* alle anderen Dateien in diesem Ordner sind vom ANTLR-Parsergenerator autogeneriert
|
||||
|
||||
## Unterordner SyntaxTreeGenerator
|
||||
* SyntaxTreeGenerator
|
||||
* TODO
|
||||
|
||||
# Grammatik -> Parser
|
||||
* Die Antlr-Grammatik (Java8.g4) wandelt
|
||||
* Folgende Stellen sind relevant
|
||||
* TODO
|
||||
|
||||
|
||||
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,152 +0,0 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||
http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>de.dhbwstuttgart</groupId>
|
||||
<artifactId>JavaTXcompiler</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<version>0.1</version>
|
||||
<name>JavaTXcompiler</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4</artifactId>
|
||||
<version>4.8-1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>22.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
<version>0.9.11</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.ow2.asm/asm -->
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
<version>7.0</version>
|
||||
</dependency>
|
||||
<!-- <dependency> <groupId>org.ow2.asm</groupId> <artifactId>asm-all</artifactId>
|
||||
<version>[4.0.0,)</version> </dependency> -->
|
||||
<!-- <dependency> <groupId>org.bitbucket.mstrobel</groupId> <artifactId>procyon-reflection</artifactId>
|
||||
<version>[0.5.32,)</version> </dependency> -->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<directory>target</directory>
|
||||
<outputDirectory>target/classes</outputDirectory>
|
||||
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||
<testOutputDirectory>target/test-classes</testOutputDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.0.0-M3</version>
|
||||
<configuration>
|
||||
<skipTests>true</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<verbose>true</verbose>
|
||||
<fork>true</fork>
|
||||
<executable>/home/michael/programs/jdk/jdk8u232-b09/bin/javac</executable>
|
||||
<compilerVersion>1.8</compilerVersion>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin -->
|
||||
<plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-maven-plugin</artifactId>
|
||||
<version>4.8-1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>antlr</id>
|
||||
<goals>
|
||||
<goal>antlr4</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirectory>src/main/antlr4/java8</sourceDirectory>
|
||||
<outputDirectory>${project.basedir}/src/main/java/de/dhbwstuttgart/parser/antlr</outputDirectory>
|
||||
<arguments>
|
||||
<argument>-package</argument>
|
||||
<argument>de.dhbwstuttgart.parser.antlr</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>de.dhbwstuttgart.core.ConsoleInterface</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>9</source>
|
||||
<target>9</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>maven-repository</id>
|
||||
<url>file:///${project.basedir}/target</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<tycho.version>0.23.0</tycho.version>
|
||||
<mainClass>de.dhbwstuttgart.core.ConsoleInterface</mainClass>
|
||||
</properties>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>maven-repository</id>
|
||||
<name>MyCo Internal Repository</name>
|
||||
<url>file:///${project.basedir}/maven-repository/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# A basic script to compile the necessary packages and their subpackages to work with the parser.
|
||||
# Messages are logged to stderr.
|
||||
>&2 echo "Building de.dhbwstuttgart.typecheck..."
|
||||
javac -d ../bin ./de/dhbwstuttgart/typecheck/*.java
|
||||
>&2 echo "Building de.dhbwstuttgart.syntaxtree..."
|
||||
javac -d ../bin ./de/dhbwstuttgart/syntaxtree/*.java
|
||||
>&2 echo "Building de.dhbwstuttgart.syntaxtree.factory..."
|
||||
javac -d ../bin ./de/dhbwstuttgart/syntaxtree/factory/*.java
|
||||
>&2 echo "Building de.dhbwstuttgart.syntaxtree.operator..."
|
||||
javac -d ../bin ./de/dhbwstuttgart/syntaxtree/operator/*.java
|
||||
>&2 echo "Building de.dhbwstuttgart.syntaxtree.statement..."
|
||||
javac -d ../bin ./de/dhbwstuttgart/syntaxtree/statement/*.java
|
||||
>&2 echo "Building de.dhbwstuttgart.syntaxtree.statement.literal..."
|
||||
javac -d ../bin ./de/dhbwstuttgart/syntaxtree/statement/literal/*.java
|
||||
>&2 echo "Building de.dhbwstuttgart.syntaxtree.type..."
|
||||
javac -d ../bin ./de/dhbwstuttgart/syntaxtree/type/*.java
|
||||
>&2 echo "Building de.dhbwstuttgart.parser..."
|
||||
javac -d ../bin ./de/dhbwstuttgart/parser/*.java
|
||||
>&2 echo "Building de.dhbwstuttgart.parser.SyntaxTreeGenerator..."
|
||||
javac -d ../bin ./de/dhbwstuttgart/parser/SyntaxTreeGenerator/*.java
|
||||
>&2 echo "Building de.dhbwstuttgart.parser.antlr..."
|
||||
javac -d ../bin ./de/dhbwstuttgart/parser/antlr/*.java
|
||||
echo "Done. Now its your turn to debug:)."
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package de.dhbwstuttgart.core;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
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));
|
||||
}
|
||||
compiler.typeInference();
|
||||
}
|
||||
}
|
||||
Regular → Executable
@@ -0,0 +1,78 @@
|
||||
package de.dhbwstuttgart.core;
|
||||
|
||||
import de.dhbwstuttgart.parser.JavaTXParser;
|
||||
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
|
||||
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
||||
import de.dhbwstuttgart.syntaxtree.factory.UnifyTypeFactory;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
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.model.FiniteClosure;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.UnifyPair;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class JavaTXCompiler {
|
||||
|
||||
protected List<SourceFile> sourceFiles = new ArrayList<>();
|
||||
|
||||
public List<ResultSet> typeInference(){
|
||||
List<ClassOrInterface> allClasses = new ArrayList<>();
|
||||
for(SourceFile sf : sourceFiles){
|
||||
allClasses.addAll(sf.getClasses());
|
||||
}
|
||||
FiniteClosure finiteClosure = UnifyTypeFactory.generateFC(allClasses);
|
||||
final ConstraintSet<Pair> cons = new TYPE(sourceFiles).getConstraints();
|
||||
ConstraintSet<UnifyPair> unifyCons = UnifyTypeFactory.convert(cons);
|
||||
|
||||
TypeUnify unify = new TypeUnify();
|
||||
Set<Set<UnifyPair>> results = new HashSet<>();
|
||||
for(List<Constraint<UnifyPair>> xCons : unifyCons.cartesianProduct()){
|
||||
Set<UnifyPair> xConsSet = new HashSet<>();
|
||||
for(Constraint<UnifyPair> constraint : xCons){
|
||||
xConsSet.addAll(constraint);
|
||||
}
|
||||
|
||||
System.out.println(xConsSet);
|
||||
Set<Set<UnifyPair>> result = unify.unify(xConsSet, finiteClosure);
|
||||
System.out.println("RESULT: " + result);
|
||||
results.addAll(result);
|
||||
}
|
||||
return results.stream().map((unifyPairs ->
|
||||
new ResultSet(UnifyTypeFactory.convert(unifyPairs, generateTPHMap(cons))))).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private Map<String, TypePlaceholder> generateTPHMap(ConstraintSet<Pair> constraints){
|
||||
HashMap<String, TypePlaceholder> ret = new HashMap<>();
|
||||
constraints.map((Pair p)->{
|
||||
if(p.TA1 instanceof TypePlaceholder){
|
||||
ret.put(((TypePlaceholder)p.TA1).getName(), (TypePlaceholder) p.TA1);
|
||||
}
|
||||
if(p.TA2 instanceof TypePlaceholder){
|
||||
ret.put(((TypePlaceholder)p.TA2).getName(), (TypePlaceholder) p.TA2);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
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);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
Regular → Executable
+12
-11
@@ -1,12 +1,10 @@
|
||||
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;
|
||||
|
||||
@@ -16,22 +14,25 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class JavaTXParser {
|
||||
public static Java8Parser.CompilationUnitContext parse(File source) throws IOException, java.lang.ClassNotFoundException {
|
||||
InputStream stream = new FileInputStream(source);
|
||||
public SourceFile parse(InputStream source) throws IOException, java.lang.ClassNotFoundException {
|
||||
InputStream stream = source;//new FileInputStream(sourceFile);
|
||||
ANTLRInputStream input = new ANTLRInputStream(stream);
|
||||
Java8Lexer lexer = new Java8Lexer(input);
|
||||
CommonTokenStream tokens = new CommonTokenStream(lexer);
|
||||
Java8Parser parser = new Java8Parser(tokens);
|
||||
return parser.compilationUnit();
|
||||
/*
|
||||
SyntaxTreeGenerator generator = new SyntaxTreeGenerator(environment.getRegistry(source));
|
||||
Java8Parser.CompilationUnitContext tree = parser.compilationUnit();
|
||||
|
||||
JavaClassRegistry reg = new JavaClassRegistry(new ArrayList<>());
|
||||
reg.addPackage("java.lang");
|
||||
SyntaxTreeGenerator generator = new SyntaxTreeGenerator(reg);
|
||||
return generator.convert(tree);
|
||||
*/
|
||||
}
|
||||
|
||||
/* Für das Typsystem ist es notwendig, dass sich der Source in einer Datei befindet:
|
||||
public SourceFile parse(File file) throws IOException, java.lang.ClassNotFoundException {
|
||||
return this.parse(new FileInputStream(file));
|
||||
}
|
||||
|
||||
public SourceFile parse(String fileContent) throws IOException, java.lang.ClassNotFoundException {
|
||||
return this.parse(new ByteArrayInputStream(fileContent.getBytes(StandardCharsets.UTF_8)));
|
||||
}
|
||||
*/
|
||||
}
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
|
||||
|
||||
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
||||
import de.dhbwstuttgart.typecheck.JavaClassName;
|
||||
|
||||
public class GenericContext {
|
||||
private final String parentMethod;
|
||||
private final JavaClassName parentClass;
|
||||
public final String parentMethod;
|
||||
public final JavaClassName parentClass;
|
||||
|
||||
public GenericContext(JavaClassName parentClass, String parentMethod) {
|
||||
if(parentMethod == null)parentMethod = "";
|
||||
@@ -0,0 +1,7 @@
|
||||
package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class GenericsRegistry extends HashMap<String, GenericContext> {
|
||||
|
||||
}
|
||||
+130
-187
@@ -1,35 +1,31 @@
|
||||
package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
|
||||
|
||||
import com.sun.javafx.fxml.expression.UnaryExpression;
|
||||
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.UnaryExpr.Operation;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.*;
|
||||
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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class StatementGenerator {
|
||||
|
||||
private JavaClassRegistry reg;
|
||||
private Map<String, RefTypeOrTPHOrWildcardOrGeneric> fields; //PL 2018-11-01 fields eingefuegt, damit die fields immer die gleiche TPH bekommen
|
||||
private Map<String, RefTypeOrTPHOrWildcardOrGeneric> localVars;
|
||||
private GenericsRegistry generics;
|
||||
|
||||
public StatementGenerator(JavaClassRegistry reg, GenericsRegistry generics, Map<String, RefTypeOrTPHOrWildcardOrGeneric> fields, Map<String, RefTypeOrTPHOrWildcardOrGeneric> localVars){
|
||||
public StatementGenerator(JavaClassRegistry reg, GenericsRegistry generics, Map<String, RefTypeOrTPHOrWildcardOrGeneric> localVars){
|
||||
this.reg = reg;
|
||||
this.generics = generics;
|
||||
this.fields = fields;
|
||||
this.localVars = localVars;
|
||||
}
|
||||
|
||||
@@ -97,7 +93,7 @@ public class StatementGenerator {
|
||||
|
||||
private Statement convert(Java8Parser.StatementWithoutTrailingSubstatementContext stmt) {
|
||||
if(stmt.block() != null){
|
||||
return convert(stmt.block(), false);
|
||||
return convert(stmt.block());
|
||||
}else if(stmt.emptyStatement() != null){
|
||||
return new EmptyStmt(stmt.getStart());
|
||||
}else if(stmt.expressionStatement() != null){
|
||||
@@ -123,14 +119,14 @@ public class StatementGenerator {
|
||||
}else throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Block convert(Java8Parser.BlockContext block, boolean addTrailingReturn) {
|
||||
public Block convert(Java8Parser.BlockContext block) {
|
||||
List<Statement> statements = new ArrayList<>();
|
||||
if(block.blockStatements() != null)
|
||||
for(Java8Parser.BlockStatementContext statementContext : block.blockStatements().blockStatement()){
|
||||
List<Statement> stmt = convert(statementContext);
|
||||
statements.addAll(stmt);
|
||||
}
|
||||
if(addTrailingReturn)statements = SyntacticSugar.addTrailingReturn(statements);
|
||||
statements = SyntacticSugar.addTrailingReturn(statements);
|
||||
return new Block(statements, block.getStart());
|
||||
}
|
||||
|
||||
@@ -181,14 +177,6 @@ public class StatementGenerator {
|
||||
}else throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Receiver getReceiver(Expression expr){
|
||||
if(expr instanceof StaticClassName){
|
||||
return (Receiver) expr;
|
||||
}else {
|
||||
return new ExpressionReceiver(expr);
|
||||
}
|
||||
}
|
||||
|
||||
private Statement convert(Java8Parser.MethodInvocationContext methodInvocationContext) {
|
||||
String name;
|
||||
if(methodInvocationContext.methodName()!=null){
|
||||
@@ -210,12 +198,7 @@ public class StatementGenerator {
|
||||
}else throw new NotImplementedException();
|
||||
|
||||
ArgumentList argumentList = convert(methodInvocationContext.argumentList());
|
||||
ArrayList<RefTypeOrTPHOrWildcardOrGeneric> argTypes = argumentList.getArguments().stream()
|
||||
.map(x -> TypePlaceholder.fresh(methodInvocationContext.getStart()))
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
MethodCall ret = new MethodCall(TypePlaceholder.fresh(methodInvocationContext.getStart()),
|
||||
getReceiver(receiver), name, argumentList, TypePlaceholder.fresh(methodInvocationContext.getStart()),
|
||||
argTypes, methodInvocationContext.getStart());
|
||||
MethodCall ret = new MethodCall(TypePlaceholder.fresh(methodInvocationContext.getStart()),new Receiver(receiver), name, argumentList, methodInvocationContext.getStart());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -246,14 +229,9 @@ public class StatementGenerator {
|
||||
if(localVars.get(expression) != null){
|
||||
return new LocalVar(expression, localVars.get(expression), offset);
|
||||
}else{
|
||||
if(fields.get(expression) != null){//PL 2018-11-01 fields eingefuegt, damit die fields immer die gleiche TPH bekommen
|
||||
return new FieldVar(new This(offset), expression, fields.get(expression), offset);
|
||||
|
||||
} else {
|
||||
//kann eigentlich nicht vorkommen
|
||||
//Dann Muss es ein Feld sein!
|
||||
return new FieldVar(new This(offset), expression, TypePlaceholder.fresh(offset), offset);
|
||||
}}
|
||||
}
|
||||
}
|
||||
return generateFieldVarOrClassname(expression, offset);
|
||||
}
|
||||
@@ -285,45 +263,25 @@ public class StatementGenerator {
|
||||
}
|
||||
|
||||
|
||||
private Statement convert(Java8Parser.ClassInstanceCreationExpressionContext newExpression) {
|
||||
Java8Parser.TypeArgumentsContext genericArgs = null;
|
||||
if(newExpression.expressionName()!= null)throw new NotImplementedException();
|
||||
if(newExpression.typeArgumentsOrDiamond()!= null){
|
||||
if(newExpression.typeArgumentsOrDiamond().typeArguments()!=null){
|
||||
genericArgs = newExpression.typeArgumentsOrDiamond().typeArguments();
|
||||
private Statement convert(Java8Parser.ClassInstanceCreationExpressionContext stmt) {
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
if(newExpression.typeArguments()!= null)throw new NotImplementedException();
|
||||
|
||||
TerminalNode identifier = newExpression.Identifier(0);
|
||||
RefType newClass = (RefType) TypeGenerator.convertTypeName(identifier.getText(),genericArgs,identifier.getSymbol(),reg,generics);
|
||||
|
||||
ArgumentList args = convert(newExpression.argumentList());
|
||||
ArrayList<RefTypeOrTPHOrWildcardOrGeneric> argTypes = args.getArguments().stream()
|
||||
.map(x -> TypePlaceholder.fresh(newExpression.getStart()))
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
return new NewClass(newClass, args, null, argTypes, newExpression.getStart());
|
||||
}
|
||||
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.PreIncrementExpressionContext stmt) {
|
||||
Expression argument = convert(stmt.unaryExpression());
|
||||
Token offset = stmt.getStart();
|
||||
return new UnaryExpr(UnaryExpr.Operation.PREINCREMENT, argument, TypePlaceholder.fresh(offset), offset);
|
||||
return new PreIncExpr(convert(stmt.unaryExpression()),stmt.getStart());
|
||||
}
|
||||
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.PreDecrementExpressionContext stmt) {
|
||||
return new UnaryExpr(UnaryExpr.Operation.PREDECREMENT, convert(stmt.unaryExpression()),
|
||||
TypePlaceholder.fresh(stmt.getStart()), stmt.getStart());
|
||||
return new PreDecExpr(convert(stmt.unaryExpression()),stmt.getStart());
|
||||
}
|
||||
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.PostIncrementExpressionContext stmt) {
|
||||
return new UnaryExpr(UnaryExpr.Operation.POSTINCREMENT, convert(stmt.postfixExpression()),
|
||||
TypePlaceholder.fresh(stmt.getStart()), stmt.getStart());
|
||||
return new PostIncExpr(convert(stmt.postfixExpression()));
|
||||
}
|
||||
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.PostDecrementExpressionContext stmt) {
|
||||
return new UnaryExpr(UnaryExpr.Operation.POSTDECREMENT, convert(stmt.postfixExpression()),
|
||||
TypePlaceholder.fresh(stmt.getStart()), stmt.getStart());
|
||||
return new PostDecExpr(convert(stmt.postfixExpression()));
|
||||
}
|
||||
|
||||
private Statement convert(Java8Parser.AssignmentContext stmt) {
|
||||
@@ -337,32 +295,45 @@ public class StatementGenerator {
|
||||
else if (leftSide instanceof LocalVar)return new AssignToLocal((LocalVar) leftSide);
|
||||
else throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.IfThenStatementContext stmt){
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
Expression expr = convert(stmt.expression());
|
||||
Statement thenBlock = convert(stmt.statement());
|
||||
Statement elseBlock = new EmptyStmt(stmt.getStart());
|
||||
return new IfStmt(TypePlaceholder.fresh(stmt.getStart()),expr,thenBlock,elseBlock,stmt.getStart());
|
||||
}
|
||||
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.IfThenElseStatementContext stmt){
|
||||
Expression expr = convert(stmt.expression());
|
||||
Statement thenBlock = convert(stmt.statementNoShortIf());
|
||||
Statement elseBlock = convert(stmt.statement());
|
||||
return new IfStmt(TypePlaceholder.fresh(stmt.getStart()),expr,thenBlock,elseBlock,stmt.getStart());
|
||||
}
|
||||
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.IfThenElseStatementNoShortIfContext stmt){
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
Expression expr = convert(stmt.expression());
|
||||
Statement thenBlock = convert(stmt.statementNoShortIf().get(0));
|
||||
Statement elseBlock = convert(stmt.statementNoShortIf().get(1));
|
||||
return new IfStmt(TypePlaceholder.fresh(stmt.getStart()),expr,thenBlock,elseBlock,stmt.getStart());
|
||||
}
|
||||
|
||||
private Statement convert(Java8Parser.AssertStatementContext stmt){
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.AssertStatementContext stmt)
|
||||
{
|
||||
List<Expression> exprList= new ArrayList<Expression>();
|
||||
for (int i =0; i<stmt.expression().size();i++){
|
||||
exprList.add(convert(stmt.expression(i)));
|
||||
}
|
||||
|
||||
return new AssertStmt(TypePlaceholder.fresh(stmt.getStart()),exprList,stmt.getStart());
|
||||
}
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.SwitchStatementContext stmt){
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
Expression expr = convert(stmt.expression());
|
||||
List<Statement> statementList = new ArrayList<Statement>();
|
||||
statementList.add( convert(stmt.switchBlock()));
|
||||
statementList.add(new BreakStmt(TypePlaceholder.fresh(stmt.getStart()),"",stmt.getStart()));
|
||||
Block block = new Block(statementList, stmt.getStart());
|
||||
return new SwitchStmt(TypePlaceholder.fresh(stmt.getStart()),expr,block,stmt.getStart());
|
||||
|
||||
}
|
||||
|
||||
private Statement convert(Java8Parser.SwitchBlockContext stmt){
|
||||
@@ -380,12 +351,13 @@ public class StatementGenerator {
|
||||
Statement block = convert(stmt.statement());
|
||||
return new WhileStmt(expr, block,stmt.getStart());
|
||||
}
|
||||
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.WhileStatementNoShortIfContext stmt){
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
Expression expr = convert(stmt.expression());
|
||||
Statement block = convert(stmt.statementNoShortIf());
|
||||
return new WhileStmt(expr, block, stmt.getStart());
|
||||
}
|
||||
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.DoStatementContext stmt){
|
||||
Statement block = convert(stmt.statement());
|
||||
Expression expr = convert(stmt.expression());
|
||||
@@ -407,15 +379,43 @@ public class StatementGenerator {
|
||||
return convert(stmt.enhancedForStatementNoShortIf());
|
||||
}else throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.BasicForStatementContext stmt){
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
List<Statement> stateList = new ArrayList<>();
|
||||
List<Statement> whileList = new ArrayList<>();
|
||||
if (stmt.forInit().localVariableDeclaration()==null)
|
||||
{
|
||||
whileList.addAll(convert(stmt.forInit().localVariableDeclaration()));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
whileList.add(convert(stmt.forInit().statementExpressionList()));
|
||||
}
|
||||
Expression expr = convert(stmt.expression());
|
||||
stateList.add(convert(stmt.statement()));
|
||||
stateList.add(convert(stmt.forUpdate()));
|
||||
Block forBlock = new Block(stateList,stmt.getStart());
|
||||
whileList.add(new WhileStmt(expr,forBlock,stmt.getStart()));
|
||||
return new Block(whileList,stmt.getStart());
|
||||
}
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.BasicForStatementNoShortIfContext stmt){
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
List<Statement> stateList = new ArrayList<>();
|
||||
List<Statement> whileList = new ArrayList<>();
|
||||
if (stmt.forInit().localVariableDeclaration()==null)
|
||||
{
|
||||
whileList.addAll(convert(stmt.forInit().localVariableDeclaration()));
|
||||
}
|
||||
else
|
||||
{
|
||||
whileList.add(convert(stmt.forInit().statementExpressionList()));
|
||||
}
|
||||
Expression expr = convert(stmt.expression());
|
||||
stateList.add(convert(stmt.statementNoShortIf()));
|
||||
stateList.add(convert(stmt.forUpdate()));
|
||||
Block forBlock = new Block(stateList,stmt.getStart());
|
||||
whileList.add(new WhileStmt(expr,forBlock,stmt.getStart()));
|
||||
return new Block(whileList,stmt.getStart());
|
||||
}
|
||||
|
||||
private List<Statement> convert(Java8Parser.ForInitContext stmt){
|
||||
@@ -425,7 +425,7 @@ public class StatementGenerator {
|
||||
return convert(stmt.localVariableDeclaration());
|
||||
}else throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//TODO Felix_K
|
||||
private List<Statement> convert(Java8Parser.LocalVariableDeclarationContext declaration) {
|
||||
List<Statement> ret = new ArrayList<>();
|
||||
if(declaration.variableModifier() != null && declaration.variableModifier().size() > 0){
|
||||
@@ -473,7 +473,7 @@ public class StatementGenerator {
|
||||
}
|
||||
return (new Assign(new AssignToField(
|
||||
new FieldVar(new This(varDecl.getStart()), name.getText(),
|
||||
type, varDecl.getStart())),
|
||||
new Void(varDecl.getStart()), varDecl.getStart())),
|
||||
initValue, name.getSymbol()));
|
||||
}
|
||||
|
||||
@@ -495,15 +495,22 @@ public class StatementGenerator {
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.BreakStatementContext stmt){
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
if (stmt.Identifier()==null)
|
||||
{
|
||||
String indentifier = "";
|
||||
return new BreakStmt(TypePlaceholder.fresh(stmt.getStart()),indentifier,stmt.getStart());
|
||||
}
|
||||
|
||||
return new BreakStmt(TypePlaceholder.fresh(stmt.getStart()),stmt.Identifier().getText(),stmt.getStart());
|
||||
}
|
||||
//TODO Felix_K
|
||||
private Statement convert(Java8Parser.ContinueStatementContext stmt){
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
if (stmt.Identifier()==null){
|
||||
String indentifier = "";
|
||||
return new ContinueStmt(TypePlaceholder.fresh(stmt.getStart()),indentifier, stmt.getStart());
|
||||
}
|
||||
return new BreakStmt(TypePlaceholder.fresh(stmt.getStart()),stmt.Identifier().getText(),stmt.getStart());
|
||||
}
|
||||
|
||||
private Statement convert(Java8Parser.ReturnStatementContext stmt){
|
||||
@@ -529,7 +536,8 @@ public class StatementGenerator {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private Statement convert(Java8Parser.CatchesContext stmt){
|
||||
private Statement convert(Java8Parser.CatchesContext stmt)
|
||||
{
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -571,7 +579,8 @@ public class StatementGenerator {
|
||||
if(expression.conditionalOrExpression() == null){
|
||||
return convert(expression.conditionalAndExpression());
|
||||
}else{
|
||||
throw new NotImplementedException();
|
||||
return new Binary(convert(expression.conditionalOrExpression()),
|
||||
convert(expression.conditionalAndExpression()), Binary.Operator.OR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -579,7 +588,8 @@ public class StatementGenerator {
|
||||
if(expression.conditionalAndExpression() == null){
|
||||
return convert(expression.inclusiveOrExpression());
|
||||
}else{
|
||||
throw new NotImplementedException();
|
||||
return new Binary(convert(expression.conditionalAndExpression()),
|
||||
convert(expression.inclusiveOrExpression()), Binary.Operator.AND);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -611,55 +621,16 @@ public class StatementGenerator {
|
||||
if(expression.equalityExpression() == null){
|
||||
return convert(expression.relationalExpression());
|
||||
}else{
|
||||
String operator = expression.getChild(1).getText();
|
||||
Expression leftSide = convert(expression.equalityExpression());
|
||||
Expression rightSide = convert(expression.relationalExpression());
|
||||
return new BinaryExpr(convertBinaryOperator(operator), TypePlaceholder.fresh(expression.getStart()), leftSide, rightSide, expression.getStart());
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
private Expression convert(Java8Parser.RelationalExpressionContext expression) {
|
||||
if(expression.relationalExpression() == null){
|
||||
return convert(expression.shiftExpression());
|
||||
}else {
|
||||
String operator = expression.getChild(1).getText();
|
||||
return new BinaryExpr(convertBinaryOperator(operator), TypePlaceholder.fresh(expression.getStart()),
|
||||
convert(expression.relationalExpression()),
|
||||
convert(expression.shiftExpression()), expression.getStart());
|
||||
}
|
||||
//}else throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private BinaryExpr.Operator convertBinaryOperator(String operator) {
|
||||
//return BinaryExpr.Operator.ADD;
|
||||
if(operator.equals("+")) {
|
||||
return BinaryExpr.Operator.ADD;
|
||||
}else if(operator.equals("-")) {
|
||||
return BinaryExpr.Operator.SUB;
|
||||
}else if(operator.equals("*")) {
|
||||
return BinaryExpr.Operator.MUL;
|
||||
}else if(operator.equals("&")) {
|
||||
return BinaryExpr.Operator.AND;
|
||||
}else if(operator.equals("|")) {
|
||||
return BinaryExpr.Operator.OR;
|
||||
}else if(operator.equals("/")) {
|
||||
return BinaryExpr.Operator.DIV;
|
||||
}else if(operator.equals("<")) {
|
||||
return BinaryExpr.Operator.LESSTHAN;
|
||||
}else if(operator.equals(">")) {
|
||||
return BinaryExpr.Operator.BIGGERTHAN;
|
||||
}else if(operator.equals(">=")) {
|
||||
return BinaryExpr.Operator.BIGGEREQUAL;
|
||||
} else if(operator.equals("<=")) {
|
||||
return BinaryExpr.Operator.LESSEQUAL;
|
||||
} else if(operator.equals("==")) {
|
||||
return BinaryExpr.Operator.EQUAL;
|
||||
} else if(operator.equals("!=")) {
|
||||
return BinaryExpr.Operator.NOTEQUAL;
|
||||
}else{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
// throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private Expression convert(Java8Parser.ShiftExpressionContext expression) {
|
||||
@@ -671,15 +642,10 @@ public class StatementGenerator {
|
||||
}
|
||||
|
||||
private Expression convert(Java8Parser.AdditiveExpressionContext expression) {
|
||||
|
||||
if(expression.additiveExpression() == null){
|
||||
return convert(expression.multiplicativeExpression());
|
||||
}else{
|
||||
Expression leftSide = convert(expression.additiveExpression());
|
||||
Expression rightSide = convert(expression.multiplicativeExpression());
|
||||
BinaryExpr.Operator op = convertBinaryOperator(expression.getChild(1).getText());
|
||||
Token offset = expression.getStart();
|
||||
return new BinaryExpr(op, TypePlaceholder.fresh(expression.getStart()), leftSide, rightSide, offset);
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -687,11 +653,7 @@ public class StatementGenerator {
|
||||
if(expression.multiplicativeExpression() == null){
|
||||
return convert(expression.unaryExpression());
|
||||
}else{
|
||||
Expression leftSide = convert(expression.multiplicativeExpression());
|
||||
Expression rightSide = convert(expression.unaryExpression());
|
||||
BinaryExpr.Operator op = convertBinaryOperator(expression.getChild(1).getText());
|
||||
Token offset = expression.getStart();
|
||||
return new BinaryExpr(op, TypePlaceholder.fresh(offset), leftSide, rightSide, offset);
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -703,11 +665,9 @@ public class StatementGenerator {
|
||||
}else if(expression.unaryExpressionNotPlusMinus() != null){
|
||||
return convert(expression.unaryExpressionNotPlusMinus());
|
||||
}else if(expression.getText().startsWith("+")){
|
||||
return new UnaryExpr(UnaryExpr.Operation.PLUS, convert(expression.unaryExpression()),
|
||||
TypePlaceholder.fresh(expression.getStart()), expression.getStart());
|
||||
return new UnaryPlus(convert(expression.unaryExpression()));
|
||||
}else if(expression.getText().startsWith("-")){
|
||||
return new UnaryExpr(UnaryExpr.Operation.MINUS, convert(expression.unaryExpression()),
|
||||
TypePlaceholder.fresh(expression.getStart()), expression.getStart());
|
||||
return new UnaryMinus(convert(expression.unaryExpression()));
|
||||
}else{
|
||||
//Diese Exceptions sollte nie geworfen werden.
|
||||
//Der Code wurde nur noch nicht getestet. Sollte zur Sicherheit drin bleiben.
|
||||
@@ -750,10 +710,10 @@ public class StatementGenerator {
|
||||
}
|
||||
|
||||
for(Java8Parser.PostIncrementExpression_lf_postfixExpressionContext inc : expression.postIncrementExpression_lf_postfixExpression()){
|
||||
expr = new UnaryExpr(UnaryExpr.Operation.POSTINCREMENT, expr, TypePlaceholder.fresh(inc.getStart()), inc.getStart());
|
||||
expr = new PostIncExpr(expr);
|
||||
}
|
||||
for(Java8Parser.PostDecrementExpression_lf_postfixExpressionContext dec : expression.postDecrementExpression_lf_postfixExpression()){
|
||||
expr = new UnaryExpr(UnaryExpr.Operation.POSTDECREMENT, expr, TypePlaceholder.fresh(dec.getStart()), dec.getStart());
|
||||
expr = new PostDecExpr(expr);
|
||||
}
|
||||
|
||||
return expr;
|
||||
@@ -779,7 +739,6 @@ public class StatementGenerator {
|
||||
if(e.classInstanceCreationExpression_lf_primary() != null){
|
||||
throw new NotImplementedException();
|
||||
}else if(e.fieldAccess_lf_primary() != null){
|
||||
|
||||
throw new NotImplementedException();
|
||||
}else if(e.arrayAccess_lf_primary() != null){
|
||||
throw new NotImplementedException();
|
||||
@@ -788,11 +747,7 @@ public class StatementGenerator {
|
||||
}else {
|
||||
Java8Parser.MethodInvocation_lf_primaryContext ctxt = e.methodInvocation_lf_primary();
|
||||
String methodName = ctxt.Identifier().toString();
|
||||
ArrayList<RefTypeOrTPHOrWildcardOrGeneric> argTypes = ctxt.argumentList().expression().stream()
|
||||
.map(x -> TypePlaceholder.fresh(e.getStart()))
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
return new MethodCall(TypePlaceholder.fresh(e.getStart()), getReceiver(expr), methodName,
|
||||
convert(ctxt.argumentList()), TypePlaceholder.fresh(e.getStart()), argTypes, e.getStart());
|
||||
return new MethodCall(TypePlaceholder.fresh(e.getStart()), new Receiver(expr), methodName, convert(ctxt.argumentList()), e.getStart());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -838,6 +793,8 @@ public class StatementGenerator {
|
||||
if(newExpression.typeArgumentsOrDiamond()!= null){
|
||||
if(newExpression.typeArgumentsOrDiamond().typeArguments()!=null){
|
||||
genericArgs = newExpression.typeArgumentsOrDiamond().typeArguments();
|
||||
}else {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
if(newExpression.typeArguments()!= null)throw new NotImplementedException();
|
||||
@@ -846,40 +803,31 @@ public class StatementGenerator {
|
||||
RefType newClass = (RefType) TypeGenerator.convertTypeName(identifier.getText(),genericArgs,identifier.getSymbol(),reg,generics);
|
||||
|
||||
ArgumentList args = convert(newExpression.argumentList());
|
||||
ArrayList<RefTypeOrTPHOrWildcardOrGeneric> argTypes = args.getArguments().stream()
|
||||
.map(x -> TypePlaceholder.fresh(newExpression.getStart()))
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
return new NewClass(newClass, args, null, argTypes, newExpression.getStart());
|
||||
return new NewClass(newClass, args, newExpression.getStart());
|
||||
}
|
||||
|
||||
private Expression convert(Java8Parser.LiteralContext literal) {
|
||||
if(literal.IntegerLiteral() != null){
|
||||
Number value = Integer.parseInt(literal.IntegerLiteral().getText());
|
||||
return new Literal(TypePlaceholder.fresh(literal.getStart()),
|
||||
value, literal.getStart());
|
||||
} else if(literal.FloatingPointLiteral()!= null){
|
||||
Number value = Double.parseDouble(literal.FloatingPointLiteral().getText());
|
||||
return new Literal(TypePlaceholder.fresh(literal.getStart()),
|
||||
if(literal.IntegerLiteral() != null || literal.FloatingPointLiteral()!= null){
|
||||
Number value = Double.parseDouble(literal.IntegerLiteral().getText());
|
||||
return new NumberLiteral(TypePlaceholder.fresh(literal.getStart()),
|
||||
value, literal.getStart());
|
||||
}else if(literal.BooleanLiteral() != null){
|
||||
RefType type = new RefType(reg.getName("java.lang.Boolean"),literal.getStart());
|
||||
return new Literal(type,
|
||||
return new BoolLiteral(type,
|
||||
Boolean.parseBoolean(literal.BooleanLiteral().getText()),
|
||||
literal.getStart());
|
||||
}else if(literal.CharacterLiteral() != null){
|
||||
RefType type = new RefType(reg.getName("java.lang.Character"),literal.getStart());
|
||||
return new Literal(type,
|
||||
// das gibt immer ' zurück, der Char befindet sich in Position 1
|
||||
//literal.CharacterLiteral().getText().charAt(0),
|
||||
literal.CharacterLiteral().getText().charAt(1),
|
||||
return new CharLiteral(type,
|
||||
literal.CharacterLiteral().getText().charAt(0),
|
||||
literal.getStart());
|
||||
}else if(literal.StringLiteral()!=null){
|
||||
RefType type = new RefType(reg.getName("java.lang.String"),literal.getStart());
|
||||
return new Literal(type,
|
||||
literal.StringLiteral().getText().substring(1, literal.StringLiteral().getText().length()-1),
|
||||
return new StringLiteral(type,
|
||||
literal.StringLiteral().getText(),
|
||||
literal.getStart());
|
||||
}else if(literal.NullLiteral() != null){
|
||||
return new Literal(TypePlaceholder.fresh(literal.getStart()), null,
|
||||
return new Null(TypePlaceholder.fresh(literal.getStart()),
|
||||
literal.getStart());
|
||||
}else {
|
||||
throw new NotImplementedException();
|
||||
@@ -907,12 +855,7 @@ public class StatementGenerator {
|
||||
}
|
||||
|
||||
ArgumentList argumentList = convert(methodInvocationContext.argumentList());
|
||||
ArrayList<RefTypeOrTPHOrWildcardOrGeneric> argTypes = argumentList.getArguments().stream()
|
||||
.map(x -> TypePlaceholder.fresh(methodInvocationContext.getStart()))
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
MethodCall ret = new MethodCall(TypePlaceholder.fresh(methodInvocationContext.getStart()),
|
||||
getReceiver(receiver), name, argumentList, TypePlaceholder.fresh(methodInvocationContext.getStart()),
|
||||
argTypes, methodInvocationContext.getStart());
|
||||
MethodCall ret = new MethodCall(TypePlaceholder.fresh(methodInvocationContext.getStart()), new Receiver(receiver), name, argumentList, methodInvocationContext.getStart());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -936,7 +879,7 @@ public class StatementGenerator {
|
||||
for(FormalParameter param : params.getFormalparalist()){
|
||||
lambdaLocals.put(param.getName(), param.getType());
|
||||
}
|
||||
StatementGenerator lambdaGenerator = new StatementGenerator(reg, generics, fields, lambdaLocals);
|
||||
StatementGenerator lambdaGenerator = new StatementGenerator(reg, generics, lambdaLocals);
|
||||
|
||||
Block block;
|
||||
if(expression.lambdaBody().expression() != null){
|
||||
@@ -945,7 +888,7 @@ public class StatementGenerator {
|
||||
expression.lambdaBody().expression().getStart()));
|
||||
block = new Block(statements, expression.lambdaBody().getStart());
|
||||
}else{
|
||||
block = lambdaGenerator.convert(expression.lambdaBody().block(), true);
|
||||
block = lambdaGenerator.convert(expression.lambdaBody().block());
|
||||
}
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> funNParams = new ArrayList<>();
|
||||
funNParams.add(TypePlaceholder.fresh(expression.getStart()));//ret-Type
|
||||
+11
-19
@@ -1,9 +1,6 @@
|
||||
package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.parser.NullToken;
|
||||
import de.dhbwstuttgart.syntaxtree.AbstractASTWalker;
|
||||
import de.dhbwstuttgart.syntaxtree.Constructor;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -13,27 +10,22 @@ public class SyntacticSugar {
|
||||
public static List<Statement> addTrailingReturn(List<Statement> statements){
|
||||
if(statements.size()!=0) {
|
||||
Statement lastStmt = statements.get(statements.size() - 1);
|
||||
ReturnFinder hasReturn = new ReturnFinder();
|
||||
lastStmt.accept(hasReturn);
|
||||
if(hasReturn.hasReturn)return statements;
|
||||
if (lastStmt instanceof Return) return statements;
|
||||
if (lastStmt instanceof WhileStmt) {
|
||||
//TODO
|
||||
//if (hasReturn(((WhileStmt) lastStmt).loopBlock)) return statements;
|
||||
} else if (lastStmt instanceof IfStmt) {
|
||||
//if (hasReturn(((IfStmt) lastStmt).then_block)
|
||||
//&& hasReturn(((IfStmt) lastStmt).else_block)) return statements;
|
||||
} else if (lastStmt instanceof ForStmt) {
|
||||
if (hasReturn(((ForStmt) lastStmt).body_Loop_block)) return statements;
|
||||
} else {
|
||||
}
|
||||
}
|
||||
statements.add(new ReturnVoid(new NullToken()));
|
||||
return statements;
|
||||
}
|
||||
|
||||
private static class ReturnFinder extends AbstractASTWalker{
|
||||
public boolean hasReturn = false;
|
||||
@Override
|
||||
public void visit(Return aReturn) {
|
||||
hasReturn = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(ReturnVoid aReturn) {
|
||||
hasReturn = true;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean hasReturn(Block block){
|
||||
for(Statement s : block.getStatements())
|
||||
if(s instanceof Return)return true;
|
||||
+147
-132
@@ -1,28 +1,23 @@
|
||||
package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
|
||||
|
||||
import de.dhbwstuttgart.environment.PackageCrawler;
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import java.lang.ClassNotFoundException;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.parser.NullToken;
|
||||
import de.dhbwstuttgart.parser.antlr.Java8Parser;
|
||||
import de.dhbwstuttgart.parser.scope.GatherNames;
|
||||
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.net.URL;
|
||||
import java.sql.Ref;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
//import jdk.internal.dynalink.support.TypeConverterFactory;
|
||||
import org.antlr.v4.runtime.CommonToken;
|
||||
@@ -31,21 +26,68 @@ import org.antlr.v4.runtime.tree.TerminalNode;
|
||||
|
||||
public class SyntaxTreeGenerator{
|
||||
private JavaClassRegistry reg;
|
||||
private final GenericsRegistry globalGenerics;
|
||||
private String pkgName = "";
|
||||
Set<JavaClassName> imports = new HashSet();
|
||||
private Map<String, RefTypeOrTPHOrWildcardOrGeneric> fields = new HashMap<>(); //PL 2018-11-01 fields eingefuegt, damit die fields immer die gleiche TPH bekommen
|
||||
List<JavaClassName> imports = new ArrayList();
|
||||
|
||||
List<Statement> fieldInitializations = new ArrayList<>(); //PL 2019-10-23: Muss für jede Klasse neu initilisiert werden
|
||||
List<Statement> fieldInitializations = new ArrayList<>();
|
||||
|
||||
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;
|
||||
public SyntaxTreeGenerator(JavaClassRegistry reg){
|
||||
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;
|
||||
@@ -75,11 +117,59 @@ public class SyntaxTreeGenerator{
|
||||
return ret;
|
||||
}
|
||||
|
||||
public SourceFile convert(Java8Parser.CompilationUnitContext ctx, PackageCrawler packageCrawler, ClassLoader classLoader) throws ClassNotFoundException{
|
||||
if(ctx.packageDeclaration()!=null)this.pkgName = convert(ctx.packageDeclaration());
|
||||
public void setImports(Java8Parser.CompilationUnitContext ctx) throws ClassNotFoundException {
|
||||
List<JavaClassName> newImports = new ArrayList();
|
||||
for(Java8Parser.ImportDeclarationContext importDeclCtx : ctx.importDeclaration()){
|
||||
if(importDeclCtx.singleTypeImportDeclaration() != null){
|
||||
newImports.add(convertSingleTypeImportDeclaration(importDeclCtx.singleTypeImportDeclaration()));
|
||||
}
|
||||
else if(importDeclCtx.typeImportOnDemandDeclaration() != null){
|
||||
newImports.add(convertTypeImportOnDemandDeclaration(importDeclCtx.typeImportOnDemandDeclaration()));
|
||||
}
|
||||
else if(importDeclCtx.singleStaticImportDeclaration() != null){
|
||||
newImports.add(convertSingleStaticImportDeclaration(importDeclCtx.singleStaticImportDeclaration()));
|
||||
}
|
||||
else{
|
||||
newImports.add(convertStaticImportOnDemandDeclaration(importDeclCtx.staticImportOnDemandDeclaration()));
|
||||
}
|
||||
}
|
||||
this.imports.addAll(newImports);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
private JavaClassName convertTypeImportOnDemandDeclaration(Java8Parser.TypeImportOnDemandDeclarationContext ctx){
|
||||
return null;
|
||||
}
|
||||
|
||||
private JavaClassName convertSingleStaticImportDeclaration(Java8Parser.SingleStaticImportDeclarationContext ctx){
|
||||
return null;
|
||||
}
|
||||
|
||||
private JavaClassName convertStaticImportOnDemandDeclaration(Java8Parser.StaticImportOnDemandDeclarationContext ctx){
|
||||
return null;
|
||||
}
|
||||
|
||||
private String getPackageFromClass(String cls){
|
||||
String ret = "";
|
||||
String[] parts = cls.split("\\.");
|
||||
for(int i = 0; i < parts.length - 1; i++){
|
||||
ret = ret + "." + parts[i];
|
||||
}
|
||||
ret = ret.substring(1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public SourceFile convert(Java8Parser.CompilationUnitContext ctx) throws ClassNotFoundException{
|
||||
List<ClassOrInterface> classes = new ArrayList<>();
|
||||
Map<String, Integer> imports = GatherNames.getImports(ctx, packageCrawler, classLoader);
|
||||
this.imports = imports.keySet().stream().map(name -> reg.getName(name)).collect(Collectors.toSet());
|
||||
this.getNames(ctx);
|
||||
this.setImports(ctx);
|
||||
for(Java8Parser.TypeDeclarationContext typeDecl : ctx.typeDeclaration()){
|
||||
ClassOrInterface newClass;
|
||||
if(typeDecl.classDeclaration() != null){
|
||||
@@ -93,20 +183,11 @@ public class SyntaxTreeGenerator{
|
||||
return new SourceFile(this.pkgName, classes, this.imports);
|
||||
}
|
||||
|
||||
private String convert(Java8Parser.PackageDeclarationContext packageDeclarationContext) {
|
||||
String ret = "";
|
||||
for(TerminalNode identifier : packageDeclarationContext.Identifier()){
|
||||
ret += identifier.getText()+".";
|
||||
}
|
||||
ret = ret.substring(0, ret.length()-1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Method convert(Java8Parser.MethodDeclarationContext methodDeclarationContext, JavaClassName parentClass, RefType superClass, GenericsRegistry generics) {
|
||||
Java8Parser.MethodHeaderContext header = methodDeclarationContext.methodHeader();
|
||||
int modifiers = SyntaxTreeGenerator.convert(methodDeclarationContext.methodModifier());
|
||||
GenericsRegistry localGenerics = createGenerics(methodDeclarationContext.methodHeader().typeParameters(),
|
||||
parentClass, header.methodDeclarator().Identifier().getText(), reg, generics);
|
||||
parentClass, header.methodDeclarator().Identifier().getText());
|
||||
localGenerics.putAll(generics);
|
||||
return convert(modifiers, header, methodDeclarationContext.methodBody(),parentClass, superClass, localGenerics);
|
||||
}
|
||||
@@ -115,7 +196,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(), reg, generics);
|
||||
GenericsRegistry localGenerics = createGenerics(header.typeParameters(), parentClass, header.methodDeclarator().Identifier().getText());
|
||||
localGenerics.putAll(generics);
|
||||
|
||||
return convert(modifiers, header, ctx.methodBody(),parentClass, superClass, localGenerics);
|
||||
@@ -124,7 +205,7 @@ public class SyntaxTreeGenerator{
|
||||
private Method convert(int modifiers, Java8Parser.MethodHeaderContext header, Java8Parser.MethodBodyContext body,
|
||||
JavaClassName parentClass, RefType superClass, GenericsRegistry localGenerics) {
|
||||
|
||||
StatementGenerator stmtGen = new StatementGenerator(reg, localGenerics, fields, new HashMap<>());
|
||||
StatementGenerator stmtGen = new StatementGenerator(reg, localGenerics, new HashMap<>());
|
||||
|
||||
String name = header.methodDeclarator().Identifier().getText();
|
||||
GenericDeclarationList gtvDeclarations = new GenericDeclarationList(new ArrayList<>(), header.getStart());
|
||||
@@ -149,18 +230,17 @@ public class SyntaxTreeGenerator{
|
||||
//TODO: Error! Abstrakte Methode ohne abstrakt Keyword
|
||||
}
|
||||
}else{
|
||||
block = stmtGen.convert(body.block(),true);
|
||||
block = stmtGen.convert(body.block());
|
||||
}
|
||||
if(parentClass.equals(new JavaClassName(name))){
|
||||
return new Constructor(modifiers, name, retType, parameterList, block, gtvDeclarations, header.getStart() /*, fieldInitializations geloescht PL 2018-11-24 */);
|
||||
return new Constructor(name, retType, modifiers, parameterList, block, gtvDeclarations, header.getStart(), fieldInitializations, superClass);
|
||||
}else{
|
||||
return new Method(modifiers, name, retType, parameterList,block, gtvDeclarations, header.getStart());
|
||||
return new Method(name, retType, modifiers, parameterList,block, gtvDeclarations, header.getStart());
|
||||
}
|
||||
}
|
||||
|
||||
private ClassOrInterface convertClass(Java8Parser.ClassDeclarationContext ctx) {
|
||||
ClassOrInterface newClass;
|
||||
fieldInitializations = new ArrayList<>(); //PL 2019-10-22: muss für jede Klasse neu initilisiert werden
|
||||
if(ctx.normalClassDeclaration() != null){
|
||||
newClass = convertNormal(ctx.normalClassDeclaration());
|
||||
}
|
||||
@@ -178,13 +258,8 @@ public class SyntaxTreeGenerator{
|
||||
modifiers += newModifier;
|
||||
}
|
||||
}
|
||||
String className = this.pkgName + (this.pkgName.length()>0?".":"") + ctx.Identifier().getText();
|
||||
JavaClassName name = reg.getName(className); //Holt den Package Namen mit dazu
|
||||
if(! name.toString().equals(className)){ //Kommt die Klasse schon in einem anderen Package vor?
|
||||
throw new TypeinferenceException("Name " + className + " bereits vorhanden in " + reg.getName(className).toString()
|
||||
,ctx.getStart());
|
||||
}
|
||||
GenericsRegistry generics = createGenerics(ctx.typeParameters(), name, "", reg, new GenericsRegistry(globalGenerics));
|
||||
JavaClassName name = reg.getName(ctx.Identifier().getText());
|
||||
GenericsRegistry generics = createGenerics(ctx.typeParameters(), name, "");
|
||||
Token offset = ctx.getStart();
|
||||
GenericDeclarationList genericClassParameters;
|
||||
if(ctx.typeParameters() == null){
|
||||
@@ -196,22 +271,17 @@ public class SyntaxTreeGenerator{
|
||||
if(ctx.superclass() != null){
|
||||
superClass = convert(ctx.superclass());
|
||||
}else{
|
||||
superClass = new RefType(ASTFactory.createObjectClass().getClassName(), ctx.getStart());
|
||||
superClass = ASTFactory.createObjectClass().getType();
|
||||
}
|
||||
List<Field> fielddecl = convertFields(ctx.classBody(), generics);
|
||||
//fieldInitializations = generateFieldInitializations(ctx.classBody(), generics);
|
||||
List<Method> methodsAndConstructors = convertMethods(ctx.classBody(), name, superClass, generics);
|
||||
List<Method> methods = new ArrayList<>();
|
||||
List<Method> methods = convertMethods(ctx.classBody(), name, superClass, generics);
|
||||
List<Constructor> konstruktoren = new ArrayList<>();
|
||||
//int noOfMethods = methods.size();
|
||||
for(int i = 0; i < methodsAndConstructors.size(); i++){
|
||||
Method m = methodsAndConstructors.get(i);
|
||||
for(int i = 0; i<methods.size();i++){
|
||||
Method m = methods.get(i);
|
||||
if(m instanceof Constructor){
|
||||
methods.remove(i);
|
||||
konstruktoren.add((Constructor) m);
|
||||
}
|
||||
else {
|
||||
methods.add(m);
|
||||
}
|
||||
}
|
||||
if(konstruktoren.size()<1){//Standardkonstruktor anfügen:
|
||||
konstruktoren.add(
|
||||
@@ -222,83 +292,34 @@ public class SyntaxTreeGenerator{
|
||||
}
|
||||
|
||||
Boolean isInterface = false;
|
||||
List<RefType> implementedInterfaces = convert(ctx.superinterfaces(), generics);
|
||||
|
||||
return new ClassOrInterface(modifiers, name, fielddecl,
|
||||
Optional.of(this.generatePseudoConstructor(ctx.Identifier().getText(), name, superClass, genericClassParameters, offset)),
|
||||
methods, konstruktoren, genericClassParameters, superClass,
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> implementedInterfaces = convert(ctx.superinterfaces(), generics);
|
||||
return new ClassOrInterface(modifiers, name, fielddecl, methods, konstruktoren, genericClassParameters, superClass,
|
||||
isInterface, implementedInterfaces, offset);
|
||||
}
|
||||
|
||||
/*
|
||||
private List<Statement> generateFieldInitializations(Java8Parser.ClassBodyContext classBodyContext, GenericsRegistry generics) {
|
||||
List<Statement> ret = new ArrayList<>();
|
||||
for(Java8Parser.ClassBodyDeclarationContext classMember : classBodyContext.classBodyDeclaration()){
|
||||
if(classMember.classMemberDeclaration() != null){
|
||||
Java8Parser.ClassMemberDeclarationContext classMemberDeclarationContext = classMember.classMemberDeclaration();
|
||||
if(classMemberDeclarationContext.fieldDeclaration() != null
|
||||
&& classMemberDeclarationContext.fieldDeclaration().variableDeclaratorList() != null){
|
||||
for(Java8Parser.VariableDeclaratorContext ctx : classMemberDeclarationContext.fieldDeclaration().variableDeclaratorList().variableDeclarator()) {
|
||||
String fieldName = ctx.variableDeclaratorId().Identifier().getText();
|
||||
if(ctx.variableDeclaratorId().dims() != null)throw new NotImplementedException();
|
||||
Token offset = ctx.getStart();
|
||||
RefTypeOrTPHOrWildcardOrGeneric fieldType;
|
||||
for(Field f : fields)
|
||||
AssignToField leftSide = new AssignToField(new FieldVar(new This(offset), fieldName, ));
|
||||
ret.addAll();
|
||||
}
|
||||
}else if(classMemberDeclarationContext.methodDeclaration()!= null){
|
||||
//Do nothing!
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
*/
|
||||
|
||||
private List<RefType> convert(Java8Parser.SuperinterfacesContext ctx, GenericsRegistry generics) {
|
||||
private List<RefTypeOrTPHOrWildcardOrGeneric> convert(Java8Parser.SuperinterfacesContext ctx, GenericsRegistry generics) {
|
||||
if(ctx == null)return new ArrayList<>();
|
||||
return convert(ctx.interfaceTypeList(), generics);
|
||||
}
|
||||
|
||||
private List<RefType> convert(Java8Parser.InterfaceTypeListContext ctx, GenericsRegistry generics) {
|
||||
List<RefType> ret = new ArrayList<>();
|
||||
private List<RefTypeOrTPHOrWildcardOrGeneric> convert(Java8Parser.InterfaceTypeListContext ctx, GenericsRegistry generics) {
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> ret = new ArrayList<>();
|
||||
for(Java8Parser.InterfaceTypeContext interfaceType : ctx.interfaceType()){
|
||||
ret.add((RefType) TypeGenerator.convert(interfaceType.classType(), reg, generics));
|
||||
ret.add(TypeGenerator.convert(interfaceType.classType(), reg, generics));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.8.9
|
||||
*/
|
||||
private Constructor generateStandardConstructor(String className, JavaClassName parentClass, RefType superClass, GenericDeclarationList classGenerics, Token offset){
|
||||
RefType classType = ClassOrInterface.generateTypeOfClass(reg.getName(className), classGenerics, offset);
|
||||
int modifiers = 0;
|
||||
ParameterList params = new ParameterList(new ArrayList<>(), offset);
|
||||
Block block = new Block(new ArrayList<>(), offset);
|
||||
return new Constructor(Modifier.PUBLIC, className, classType, params, block, classGenerics, offset /*, fieldInitializations geloescht PL 2018-11-24 */);
|
||||
}
|
||||
|
||||
/* fieldInitializations werden in einem Psedokonstruktor in der abstrakten Syntax gespeichert */
|
||||
private Constructor generatePseudoConstructor(String className, JavaClassName parentClass, RefType superClass, GenericDeclarationList classGenerics, Token offset){
|
||||
RefType classType = ClassOrInterface.generateTypeOfClass(reg.getName(className), classGenerics, offset);
|
||||
ParameterList params = new ParameterList(new ArrayList<>(), offset);
|
||||
Block block = new Block(new ArrayList<>(fieldInitializations), offset);
|
||||
return new Constructor(Modifier.PUBLIC, className, classType, params, block, classGenerics, offset /*, fieldInitializations geloescht PL 2018-11-24 */);
|
||||
return new Constructor(className, classType, modifiers, params, block, classGenerics, offset, fieldInitializations, superClass);
|
||||
}
|
||||
|
||||
private RefType convert(Java8Parser.SuperclassContext superclass) {
|
||||
if(superclass.classType().classOrInterfaceType() != null){
|
||||
throw new NotImplementedException();
|
||||
}else{
|
||||
RefTypeOrTPHOrWildcardOrGeneric ret = TypeGenerator.convertTypeName(superclass.classType().Identifier().getText(), superclass.classType().typeArguments(),
|
||||
superclass.getStart(), reg, globalGenerics);
|
||||
if(ret instanceof RefType){
|
||||
return (RefType) ret;
|
||||
}else{
|
||||
throw new TypeinferenceException(superclass.getText() + " ist kein gültiger Supertyp", superclass.getStart());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<Method> convertMethods(Java8Parser.ClassBodyContext classBodyContext,
|
||||
@@ -356,20 +377,20 @@ public class SyntaxTreeGenerator{
|
||||
modifiers+=(convert(fieldModifierContext));
|
||||
}
|
||||
RefTypeOrTPHOrWildcardOrGeneric fieldType;
|
||||
if(fieldDeclarationContext.unannTypeOrAuto() != null
|
||||
&& fieldDeclarationContext.unannTypeOrAuto().unannType() != null){
|
||||
fieldType = TypeGenerator.convert(fieldDeclarationContext.unannTypeOrAuto().unannType(), reg, generics);
|
||||
if(fieldDeclarationContext.unannType() != null){
|
||||
fieldType = TypeGenerator.convert(fieldDeclarationContext.unannType(), reg, generics);
|
||||
}else{
|
||||
fieldType = TypePlaceholder.fresh(fieldDeclarationContext.variableDeclaratorList().getStart()); //PL 2019-12-06: variableDeclaratorList() eingefuegt, um als Token nicht die Modifier zu bekommen
|
||||
fieldType = TypePlaceholder.fresh(fieldDeclarationContext.getStart());
|
||||
}
|
||||
for(Java8Parser.VariableDeclaratorContext varCtx : fieldDeclarationContext.variableDeclaratorList().variableDeclarator()){
|
||||
String fieldName = convert(varCtx.variableDeclaratorId());
|
||||
fields.put(fieldName, fieldType);
|
||||
if(varCtx.variableInitializer() != null){
|
||||
initializeField(varCtx, fieldType, generics);
|
||||
}
|
||||
else{
|
||||
ret.add(new Field(fieldName,fieldType,modifiers,varCtx.getStart()));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -379,7 +400,7 @@ public class SyntaxTreeGenerator{
|
||||
|
||||
// Initialize a field by creating implicit constructor.
|
||||
private void initializeField(Java8Parser.VariableDeclaratorContext ctx, RefTypeOrTPHOrWildcardOrGeneric typeOfField, GenericsRegistry generics){
|
||||
StatementGenerator statementGenerator = new StatementGenerator(reg, generics, fields, new HashMap<>());
|
||||
StatementGenerator statementGenerator = new StatementGenerator(reg, generics, new HashMap<>());
|
||||
fieldInitializations.add(statementGenerator.generateFieldAssignment(ctx, typeOfField));
|
||||
}
|
||||
|
||||
@@ -439,11 +460,9 @@ public class SyntaxTreeGenerator{
|
||||
modifiers += newModifier;
|
||||
}
|
||||
}
|
||||
if(!Modifier.isInterface(modifiers))modifiers += Modifier.INTERFACE;
|
||||
|
||||
JavaClassName name = reg.getName(ctx.Identifier().getText());
|
||||
|
||||
GenericsRegistry generics = createGenerics(ctx.typeParameters(), name, "", reg, new GenericsRegistry(globalGenerics));
|
||||
GenericsRegistry generics = createGenerics(ctx.typeParameters(), name, "");
|
||||
|
||||
GenericDeclarationList genericParams;
|
||||
if(ctx.typeParameters() != null){
|
||||
@@ -451,14 +470,14 @@ public class SyntaxTreeGenerator{
|
||||
}else{
|
||||
genericParams = createEmptyGenericDeclarationList(ctx.Identifier());
|
||||
}
|
||||
RefType superClass = ASTFactory.createObjectType();
|
||||
RefType superClass = ASTFactory.createObjectClass().getType();
|
||||
|
||||
List<Field> fields = convertFields(ctx.interfaceBody());
|
||||
List<Method> methods = convertMethods(ctx.interfaceBody(), name, superClass, generics);
|
||||
|
||||
List<RefType> extendedInterfaces = convert(ctx.extendsInterfaces(), generics);
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> extendedInterfaces = convert(ctx.extendsInterfaces(), generics);
|
||||
|
||||
return new ClassOrInterface(modifiers, name, fields, Optional.empty(), methods, new ArrayList<>(),
|
||||
return new ClassOrInterface(modifiers, name, fields, methods, new ArrayList<>(),
|
||||
genericParams, superClass, true, extendedInterfaces, ctx.getStart());
|
||||
}
|
||||
|
||||
@@ -469,20 +488,16 @@ public class SyntaxTreeGenerator{
|
||||
return new GenericDeclarationList(new ArrayList<>(), gtvOffset);
|
||||
}
|
||||
|
||||
private GenericsRegistry createGenerics(Java8Parser.TypeParametersContext ctx, JavaClassName parentClass, String parentMethod, JavaClassRegistry reg, GenericsRegistry generics) {
|
||||
GenericsRegistry ret = new GenericsRegistry(this.globalGenerics);
|
||||
ret.putAll(generics);
|
||||
private GenericsRegistry createGenerics(Java8Parser.TypeParametersContext ctx, JavaClassName parentClass, String parentMethod) {
|
||||
GenericsRegistry ret = new GenericsRegistry();
|
||||
if(ctx == null || ctx.typeParameterList() == null)return ret;
|
||||
for(Java8Parser.TypeParameterContext tp : ctx.typeParameterList().typeParameter()){
|
||||
ret.put(tp.Identifier().getText(), new GenericContext(parentClass, parentMethod));
|
||||
}
|
||||
for(Java8Parser.TypeParameterContext tp : ctx.typeParameterList().typeParameter()){
|
||||
TypeGenerator.convert(tp, parentClass, parentMethod, reg, ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private List<RefType> convert(Java8Parser.ExtendsInterfacesContext extendsInterfacesContext, GenericsRegistry generics) {
|
||||
private List<RefTypeOrTPHOrWildcardOrGeneric> convert(Java8Parser.ExtendsInterfacesContext extendsInterfacesContext, GenericsRegistry generics) {
|
||||
if(extendsInterfacesContext == null)return new ArrayList<>();
|
||||
return convert(extendsInterfacesContext.interfaceTypeList(), generics);
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
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.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 {
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric convert(Java8Parser.UnannClassOrInterfaceTypeContext unannClassOrInterfaceTypeContext, JavaClassRegistry reg, GenericsRegistry generics) {
|
||||
String name;
|
||||
if(unannClassOrInterfaceTypeContext.unannInterfaceType_lfno_unannClassOrInterfaceType() != null){
|
||||
name = unannClassOrInterfaceTypeContext.unannInterfaceType_lfno_unannClassOrInterfaceType().unannClassType_lfno_unannClassOrInterfaceType().Identifier().getText();
|
||||
}
|
||||
Java8Parser.TypeArgumentsContext arguments;
|
||||
if(unannClassOrInterfaceTypeContext.unannClassType_lfno_unannClassOrInterfaceType() != null){
|
||||
name = unannClassOrInterfaceTypeContext.unannClassType_lfno_unannClassOrInterfaceType().Identifier().getText();
|
||||
arguments = unannClassOrInterfaceTypeContext.unannClassType_lfno_unannClassOrInterfaceType().typeArguments();
|
||||
}else{// if(unannClassOrInterfaceTypeContext.unannInterfaceType_lfno_unannClassOrInterfaceType() != null){
|
||||
name = unannClassOrInterfaceTypeContext.unannInterfaceType_lfno_unannClassOrInterfaceType().unannClassType_lfno_unannClassOrInterfaceType().getText();
|
||||
arguments = unannClassOrInterfaceTypeContext.unannInterfaceType_lfno_unannClassOrInterfaceType().unannClassType_lfno_unannClassOrInterfaceType().typeArguments();
|
||||
}
|
||||
return convertTypeName(name, arguments, unannClassOrInterfaceTypeContext.getStart(), reg, generics);
|
||||
}
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric convert(Java8Parser.UnannTypeContext unannTypeContext, JavaClassRegistry reg, GenericsRegistry genericsRegistry) {
|
||||
if(unannTypeContext.unannPrimitiveType()!=null){
|
||||
throw new NotImplementedException();
|
||||
}else
|
||||
if(unannTypeContext.unannReferenceType().unannArrayType()!=null){
|
||||
System.out.println(unannTypeContext.getText());
|
||||
throw new NotImplementedException();
|
||||
}else
|
||||
if(unannTypeContext.unannReferenceType().unannTypeVariable()!=null){
|
||||
JavaClassName name = reg.getName(unannTypeContext.unannReferenceType().unannTypeVariable().Identifier().toString());
|
||||
return new RefType(name, unannTypeContext.getStart());
|
||||
}
|
||||
return TypeGenerator.convert(unannTypeContext.unannReferenceType().unannClassOrInterfaceType(), reg, genericsRegistry);
|
||||
}
|
||||
|
||||
public static GenericDeclarationList convert(Java8Parser.TypeParametersContext typeParametersContext,
|
||||
JavaClassName parentClass, String parentMethod, JavaClassRegistry reg, GenericsRegistry generics) {
|
||||
Token endOffset = typeParametersContext.getStop();
|
||||
List<GenericTypeVar> typeVars = new ArrayList<>();
|
||||
for(Java8Parser.TypeParameterContext typeParameter : typeParametersContext.typeParameterList().typeParameter()){
|
||||
typeVars.add(convert(typeParameter, parentClass, parentMethod, reg, generics));
|
||||
endOffset = typeParameter.getStop();
|
||||
}
|
||||
return new GenericDeclarationList(typeVars, endOffset);
|
||||
}
|
||||
|
||||
public static GenericTypeVar convert(Java8Parser.TypeParameterContext typeParameter, JavaClassName parentClass, String parentMethod, JavaClassRegistry reg, GenericsRegistry generics) {
|
||||
String name = typeParameter.Identifier().getText();
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> bounds = TypeGenerator.convert(typeParameter.typeBound(),reg, generics);
|
||||
|
||||
GenericTypeVar ret = new GenericTypeVar(new GenericTypeName(new GenericContext(parentClass, parentMethod), name), bounds, typeParameter.getStart(), typeParameter.getStop());
|
||||
generics.put(name, new GenericContext(parentClass, parentMethod));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static List<RefTypeOrTPHOrWildcardOrGeneric> convert(Java8Parser.TypeBoundContext typeBoundContext, JavaClassRegistry reg, GenericsRegistry generics) {
|
||||
if(typeBoundContext == null){
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> ret = new ArrayList<>();
|
||||
ret.add(ASTFactory.createObjectClass().getType());
|
||||
return ret;
|
||||
}
|
||||
|
||||
throw new de.dhbwstuttgart.exceptions.NotImplementedException();
|
||||
}
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric convert(Java8Parser.ReferenceTypeContext referenceTypeContext, JavaClassRegistry reg, GenericsRegistry generics) {
|
||||
return convertTypeName(referenceTypeContext.getText(), referenceTypeContext.getStart(), reg, generics);
|
||||
}
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric convertTypeName(String name, Token offset, JavaClassRegistry reg, GenericsRegistry generics){
|
||||
return convertTypeName(name, null, offset, reg, generics);
|
||||
}
|
||||
|
||||
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)){
|
||||
return new GenericRefType(new GenericTypeName(generics.get(name),name), offset);
|
||||
}else{
|
||||
throw new TypeinferenceException("Der Typ "+ name + " ist nicht vorhanden",offset);
|
||||
}
|
||||
}
|
||||
if(typeArguments == null){
|
||||
return new RefType(reg.getName(name), offset);
|
||||
}else{
|
||||
return new RefType(reg.getName(name), convert(typeArguments, reg, generics), offset);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<RefTypeOrTPHOrWildcardOrGeneric> convert(Java8Parser.TypeArgumentsContext typeArguments,
|
||||
JavaClassRegistry reg, GenericsRegistry generics){
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> ret = new ArrayList<>();
|
||||
for(Java8Parser.TypeArgumentContext arg : typeArguments.typeArgumentList().typeArgument()){
|
||||
if(arg.wildcard() != null){
|
||||
throw new NotImplementedException();
|
||||
}else{
|
||||
ret.add(convert(arg.referenceType(), reg, generics));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric convert(Java8Parser.ClassTypeContext ctx, JavaClassRegistry reg, GenericsRegistry generics) {
|
||||
if(ctx.classOrInterfaceType() != null)throw new NotImplementedException();
|
||||
return convertTypeName(ctx.Identifier().getText(), ctx.typeArguments(), ctx.getStart(), reg, generics);
|
||||
}
|
||||
}
|
||||
@@ -109,6 +109,7 @@ classOrInterfaceType
|
||||
| interfaceType_lfno_classOrInterfaceType
|
||||
)
|
||||
( classType_lf_classOrInterfaceType
|
||||
| interfaceType_lf_classOrInterfaceType
|
||||
)*
|
||||
;
|
||||
|
||||
@@ -332,7 +333,7 @@ classMemberDeclaration
|
||||
;
|
||||
|
||||
fieldDeclaration
|
||||
: fieldModifier* unannTypeOrAuto? variableDeclaratorList ';'
|
||||
: fieldModifier* unannType? variableDeclaratorList ';'
|
||||
;
|
||||
|
||||
fieldModifier
|
||||
@@ -731,7 +732,7 @@ localVariableDeclarationStatement
|
||||
|
||||
unannTypeOrAuto
|
||||
: unannType
|
||||
| 'var'
|
||||
| 'auto'
|
||||
;
|
||||
|
||||
localVariableDeclaration
|
||||
@@ -1738,7 +1739,6 @@ Identifier
|
||||
: JavaLetter JavaLetterOrDigit*
|
||||
;
|
||||
|
||||
|
||||
fragment
|
||||
JavaLetter
|
||||
: [a-zA-Z$_] // these are the "java letters" below 0x7F
|
||||
@@ -106,7 +106,7 @@ ELLIPSIS=105
|
||||
WS=106
|
||||
COMMENT=107
|
||||
LINE_COMMENT=108
|
||||
'var'=1
|
||||
'auto'=1
|
||||
'abstract'=2
|
||||
'assert'=3
|
||||
'boolean'=4
|
||||
+1
-13
@@ -1,4 +1,4 @@
|
||||
// Generated from Java8.g4 by ANTLR 4.7
|
||||
// Generated from Java8.g4 by ANTLR 4.5.3
|
||||
package de.dhbwstuttgart.parser.antlr;
|
||||
|
||||
import org.antlr.v4.runtime.ParserRuleContext;
|
||||
@@ -1571,18 +1571,6 @@ public class Java8BaseListener implements Java8Listener {
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitLocalVariableDeclarationStatement(Java8Parser.LocalVariableDeclarationStatementContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterUnannTypeOrAuto(Java8Parser.UnannTypeOrAutoContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitUnannTypeOrAuto(Java8Parser.UnannTypeOrAutoContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
@@ -0,0 +1,586 @@
|
||||
// Generated from /home/janulrich/Development/intellijworkspace/JavaCompilerCore/src/de/dhbwstuttgart/parser/antlr/Java8.g4 by ANTLR 4.5.1
|
||||
package de.dhbwstuttgart.parser.antlr;
|
||||
import org.antlr.v4.runtime.Lexer;
|
||||
import org.antlr.v4.runtime.CharStream;
|
||||
import org.antlr.v4.runtime.Token;
|
||||
import org.antlr.v4.runtime.TokenStream;
|
||||
import org.antlr.v4.runtime.*;
|
||||
import org.antlr.v4.runtime.atn.*;
|
||||
import org.antlr.v4.runtime.dfa.DFA;
|
||||
import org.antlr.v4.runtime.misc.*;
|
||||
|
||||
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
|
||||
public class Java8Lexer extends Lexer {
|
||||
static { RuntimeMetaData.checkVersion("4.5.1", RuntimeMetaData.VERSION); }
|
||||
|
||||
protected static final DFA[] _decisionToDFA;
|
||||
protected static final PredictionContextCache _sharedContextCache =
|
||||
new PredictionContextCache();
|
||||
public static final int
|
||||
T__0=1, ABSTRACT=2, ASSERT=3, BOOLEAN=4, BREAK=5, BYTE=6, CASE=7, CATCH=8,
|
||||
CHAR=9, CLASS=10, CONST=11, CONTINUE=12, DEFAULT=13, DO=14, DOUBLE=15,
|
||||
ELSE=16, ENUM=17, EXTENDS=18, FINAL=19, FINALLY=20, FLOAT=21, FOR=22,
|
||||
IF=23, GOTO=24, IMPLEMENTS=25, IMPORT=26, INSTANCEOF=27, INT=28, INTERFACE=29,
|
||||
LONG=30, NATIVE=31, NEW=32, PACKAGE=33, PRIVATE=34, PROTECTED=35, PUBLIC=36,
|
||||
RETURN=37, SHORT=38, STATIC=39, STRICTFP=40, SUPER=41, SWITCH=42, SYNCHRONIZED=43,
|
||||
THIS=44, THROW=45, THROWS=46, TRANSIENT=47, TRY=48, VOID=49, VOLATILE=50,
|
||||
WHILE=51, IntegerLiteral=52, FloatingPointLiteral=53, BooleanLiteral=54,
|
||||
CharacterLiteral=55, StringLiteral=56, NullLiteral=57, LPAREN=58, RPAREN=59,
|
||||
LBRACE=60, RBRACE=61, LBRACK=62, RBRACK=63, SEMI=64, COMMA=65, DOT=66,
|
||||
ASSIGN=67, GT=68, LT=69, BANG=70, TILDE=71, QUESTION=72, COLON=73, EQUAL=74,
|
||||
LE=75, GE=76, NOTEQUAL=77, AND=78, OR=79, INC=80, DEC=81, ADD=82, SUB=83,
|
||||
MUL=84, DIV=85, BITAND=86, BITOR=87, CARET=88, MOD=89, ARROW=90, COLONCOLON=91,
|
||||
ADD_ASSIGN=92, SUB_ASSIGN=93, MUL_ASSIGN=94, DIV_ASSIGN=95, AND_ASSIGN=96,
|
||||
OR_ASSIGN=97, XOR_ASSIGN=98, MOD_ASSIGN=99, LSHIFT_ASSIGN=100, RSHIFT_ASSIGN=101,
|
||||
URSHIFT_ASSIGN=102, Identifier=103, AT=104, ELLIPSIS=105, WS=106, COMMENT=107,
|
||||
LINE_COMMENT=108;
|
||||
public static String[] modeNames = {
|
||||
"DEFAULT_MODE"
|
||||
};
|
||||
|
||||
public static final String[] ruleNames = {
|
||||
"T__0", "ABSTRACT", "ASSERT", "BOOLEAN", "BREAK", "BYTE", "CASE", "CATCH",
|
||||
"CHAR", "CLASS", "CONST", "CONTINUE", "DEFAULT", "DO", "DOUBLE", "ELSE",
|
||||
"ENUM", "EXTENDS", "FINAL", "FINALLY", "FLOAT", "FOR", "IF", "GOTO", "IMPLEMENTS",
|
||||
"IMPORT", "INSTANCEOF", "INT", "INTERFACE", "LONG", "NATIVE", "NEW", "PACKAGE",
|
||||
"PRIVATE", "PROTECTED", "PUBLIC", "RETURN", "SHORT", "STATIC", "STRICTFP",
|
||||
"SUPER", "SWITCH", "SYNCHRONIZED", "THIS", "THROW", "THROWS", "TRANSIENT",
|
||||
"TRY", "VOID", "VOLATILE", "WHILE", "IntegerLiteral", "DecimalIntegerLiteral",
|
||||
"HexIntegerLiteral", "OctalIntegerLiteral", "BinaryIntegerLiteral", "IntegerTypeSuffix",
|
||||
"DecimalNumeral", "Digits", "Digit", "NonZeroDigit", "DigitsAndUnderscores",
|
||||
"DigitOrUnderscore", "Underscores", "HexNumeral", "HexDigits", "HexDigit",
|
||||
"HexDigitsAndUnderscores", "HexDigitOrUnderscore", "OctalNumeral", "OctalDigits",
|
||||
"OctalDigit", "OctalDigitsAndUnderscores", "OctalDigitOrUnderscore", "BinaryNumeral",
|
||||
"BinaryDigits", "BinaryDigit", "BinaryDigitsAndUnderscores", "BinaryDigitOrUnderscore",
|
||||
"FloatingPointLiteral", "DecimalFloatingPointLiteral", "ExponentPart",
|
||||
"ExponentIndicator", "SignedInteger", "Sign", "FloatTypeSuffix", "HexadecimalFloatingPointLiteral",
|
||||
"HexSignificand", "BinaryExponent", "BinaryExponentIndicator", "BooleanLiteral",
|
||||
"CharacterLiteral", "SingleCharacter", "StringLiteral", "StringCharacters",
|
||||
"StringCharacter", "EscapeSequence", "OctalEscape", "ZeroToThree", "UnicodeEscape",
|
||||
"NullLiteral", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", "RBRACK",
|
||||
"SEMI", "COMMA", "DOT", "ASSIGN", "GT", "LT", "BANG", "TILDE", "QUESTION",
|
||||
"COLON", "EQUAL", "LE", "GE", "NOTEQUAL", "AND", "OR", "INC", "DEC", "ADD",
|
||||
"SUB", "MUL", "DIV", "BITAND", "BITOR", "CARET", "MOD", "ARROW", "COLONCOLON",
|
||||
"ADD_ASSIGN", "SUB_ASSIGN", "MUL_ASSIGN", "DIV_ASSIGN", "AND_ASSIGN",
|
||||
"OR_ASSIGN", "XOR_ASSIGN", "MOD_ASSIGN", "LSHIFT_ASSIGN", "RSHIFT_ASSIGN",
|
||||
"URSHIFT_ASSIGN", "Identifier", "JavaLetter", "JavaLetterOrDigit", "AT",
|
||||
"ELLIPSIS", "WS", "COMMENT", "LINE_COMMENT"
|
||||
};
|
||||
|
||||
private static final String[] _LITERAL_NAMES = {
|
||||
null, "'auto'", "'abstract'", "'assert'", "'boolean'", "'break'", "'byte'",
|
||||
"'case'", "'catch'", "'char'", "'class'", "'const'", "'continue'", "'default'",
|
||||
"'do'", "'double'", "'else'", "'enum'", "'extends'", "'final'", "'finally'",
|
||||
"'float'", "'for'", "'if'", "'goto'", "'implements'", "'import'", "'instanceof'",
|
||||
"'int'", "'interface'", "'long'", "'native'", "'new'", "'package'", "'private'",
|
||||
"'protected'", "'public'", "'return'", "'short'", "'static'", "'strictfp'",
|
||||
"'super'", "'switch'", "'synchronized'", "'this'", "'throw'", "'throws'",
|
||||
"'transient'", "'try'", "'void'", "'volatile'", "'while'", null, null,
|
||||
null, null, null, "'null'", "'('", "')'", "'{'", "'}'", "'['", "']'",
|
||||
"';'", "','", "'.'", "'='", "'>'", "'<'", "'!'", "'~'", "'?'", "':'",
|
||||
"'=='", "'<='", "'>='", "'!='", "'&&'", "'||'", "'++'", "'--'", "'+'",
|
||||
"'-'", "'*'", "'/'", "'&'", "'|'", "'^'", "'%'", "'->'", "'::'", "'+='",
|
||||
"'-='", "'*='", "'/='", "'&='", "'|='", "'^='", "'%='", "'<<='", "'>>='",
|
||||
"'>>>='", null, "'@'", "'...'"
|
||||
};
|
||||
private static final String[] _SYMBOLIC_NAMES = {
|
||||
null, null, "ABSTRACT", "ASSERT", "BOOLEAN", "BREAK", "BYTE", "CASE",
|
||||
"CATCH", "CHAR", "CLASS", "CONST", "CONTINUE", "DEFAULT", "DO", "DOUBLE",
|
||||
"ELSE", "ENUM", "EXTENDS", "FINAL", "FINALLY", "FLOAT", "FOR", "IF", "GOTO",
|
||||
"IMPLEMENTS", "IMPORT", "INSTANCEOF", "INT", "INTERFACE", "LONG", "NATIVE",
|
||||
"NEW", "PACKAGE", "PRIVATE", "PROTECTED", "PUBLIC", "RETURN", "SHORT",
|
||||
"STATIC", "STRICTFP", "SUPER", "SWITCH", "SYNCHRONIZED", "THIS", "THROW",
|
||||
"THROWS", "TRANSIENT", "TRY", "VOID", "VOLATILE", "WHILE", "IntegerLiteral",
|
||||
"FloatingPointLiteral", "BooleanLiteral", "CharacterLiteral", "StringLiteral",
|
||||
"NullLiteral", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", "RBRACK",
|
||||
"SEMI", "COMMA", "DOT", "ASSIGN", "GT", "LT", "BANG", "TILDE", "QUESTION",
|
||||
"COLON", "EQUAL", "LE", "GE", "NOTEQUAL", "AND", "OR", "INC", "DEC", "ADD",
|
||||
"SUB", "MUL", "DIV", "BITAND", "BITOR", "CARET", "MOD", "ARROW", "COLONCOLON",
|
||||
"ADD_ASSIGN", "SUB_ASSIGN", "MUL_ASSIGN", "DIV_ASSIGN", "AND_ASSIGN",
|
||||
"OR_ASSIGN", "XOR_ASSIGN", "MOD_ASSIGN", "LSHIFT_ASSIGN", "RSHIFT_ASSIGN",
|
||||
"URSHIFT_ASSIGN", "Identifier", "AT", "ELLIPSIS", "WS", "COMMENT", "LINE_COMMENT"
|
||||
};
|
||||
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #VOCABULARY} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String[] tokenNames;
|
||||
static {
|
||||
tokenNames = new String[_SYMBOLIC_NAMES.length];
|
||||
for (int i = 0; i < tokenNames.length; i++) {
|
||||
tokenNames[i] = VOCABULARY.getLiteralName(i);
|
||||
if (tokenNames[i] == null) {
|
||||
tokenNames[i] = VOCABULARY.getSymbolicName(i);
|
||||
}
|
||||
|
||||
if (tokenNames[i] == null) {
|
||||
tokenNames[i] = "<INVALID>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public String[] getTokenNames() {
|
||||
return tokenNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public Vocabulary getVocabulary() {
|
||||
return VOCABULARY;
|
||||
}
|
||||
|
||||
|
||||
public Java8Lexer(CharStream input) {
|
||||
super(input);
|
||||
_interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGrammarFileName() { return "Java8.g4"; }
|
||||
|
||||
@Override
|
||||
public String[] getRuleNames() { return ruleNames; }
|
||||
|
||||
@Override
|
||||
public String getSerializedATN() { return _serializedATN; }
|
||||
|
||||
@Override
|
||||
public String[] getModeNames() { return modeNames; }
|
||||
|
||||
@Override
|
||||
public ATN getATN() { return _ATN; }
|
||||
|
||||
@Override
|
||||
public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
|
||||
switch (ruleIndex) {
|
||||
case 147:
|
||||
return JavaLetter_sempred((RuleContext)_localctx, predIndex);
|
||||
case 148:
|
||||
return JavaLetterOrDigit_sempred((RuleContext)_localctx, predIndex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private boolean JavaLetter_sempred(RuleContext _localctx, int predIndex) {
|
||||
switch (predIndex) {
|
||||
case 0:
|
||||
return Character.isJavaIdentifierStart(_input.LA(-1));
|
||||
case 1:
|
||||
return Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private boolean JavaLetterOrDigit_sempred(RuleContext _localctx, int predIndex) {
|
||||
switch (predIndex) {
|
||||
case 2:
|
||||
return Character.isJavaIdentifierPart(_input.LA(-1));
|
||||
case 3:
|
||||
return Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static final String _serializedATN =
|
||||
"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2n\u044f\b\1\4\2\t"+
|
||||
"\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+
|
||||
"\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
|
||||
"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+
|
||||
"\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+
|
||||
"\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+
|
||||
",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+
|
||||
"\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+
|
||||
"\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4I"+
|
||||
"\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\tT"+
|
||||
"\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\\4]\t]\4^\t^\4_\t_\4"+
|
||||
"`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\4g\tg\4h\th\4i\ti\4j\tj\4k\t"+
|
||||
"k\4l\tl\4m\tm\4n\tn\4o\to\4p\tp\4q\tq\4r\tr\4s\ts\4t\tt\4u\tu\4v\tv\4"+
|
||||
"w\tw\4x\tx\4y\ty\4z\tz\4{\t{\4|\t|\4}\t}\4~\t~\4\177\t\177\4\u0080\t\u0080"+
|
||||
"\4\u0081\t\u0081\4\u0082\t\u0082\4\u0083\t\u0083\4\u0084\t\u0084\4\u0085"+
|
||||
"\t\u0085\4\u0086\t\u0086\4\u0087\t\u0087\4\u0088\t\u0088\4\u0089\t\u0089"+
|
||||
"\4\u008a\t\u008a\4\u008b\t\u008b\4\u008c\t\u008c\4\u008d\t\u008d\4\u008e"+
|
||||
"\t\u008e\4\u008f\t\u008f\4\u0090\t\u0090\4\u0091\t\u0091\4\u0092\t\u0092"+
|
||||
"\4\u0093\t\u0093\4\u0094\t\u0094\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\2\2\2\u00d7\3\2\2\2\2\u00d9\3\2\2\2\2\u00db\3\2\2\2\2\u00dd\3\2\2"+
|
||||
"\2\2\u00df\3\2\2\2\2\u00e1\3\2\2\2\2\u00e3\3\2\2\2\2\u00e5\3\2\2\2\2\u00e7"+
|
||||
"\3\2\2\2\2\u00e9\3\2\2\2\2\u00eb\3\2\2\2\2\u00ed\3\2\2\2\2\u00ef\3\2\2"+
|
||||
"\2\2\u00f1\3\2\2\2\2\u00f3\3\2\2\2\2\u00f5\3\2\2\2\2\u00f7\3\2\2\2\2\u00f9"+
|
||||
"\3\2\2\2\2\u00fb\3\2\2\2\2\u00fd\3\2\2\2\2\u00ff\3\2\2\2\2\u0101\3\2\2"+
|
||||
"\2\2\u0103\3\2\2\2\2\u0105\3\2\2\2\2\u0107\3\2\2\2\2\u0109\3\2\2\2\2\u010b"+
|
||||
"\3\2\2\2\2\u010d\3\2\2\2\2\u010f\3\2\2\2\2\u0111\3\2\2\2\2\u0113\3\2\2"+
|
||||
"\2\2\u0115\3\2\2\2\2\u0117\3\2\2\2\2\u0119\3\2\2\2\2\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";
|
||||
public static final ATN _ATN =
|
||||
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
|
||||
static {
|
||||
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
|
||||
for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
|
||||
_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -106,7 +106,7 @@ ELLIPSIS=105
|
||||
WS=106
|
||||
COMMENT=107
|
||||
LINE_COMMENT=108
|
||||
'var'=1
|
||||
'auto'=1
|
||||
'abstract'=2
|
||||
'assert'=3
|
||||
'boolean'=4
|
||||
+1
-11
@@ -1,4 +1,4 @@
|
||||
// Generated from Java8.g4 by ANTLR 4.7
|
||||
// Generated from Java8.g4 by ANTLR 4.5.3
|
||||
package de.dhbwstuttgart.parser.antlr;
|
||||
import org.antlr.v4.runtime.tree.ParseTreeListener;
|
||||
|
||||
@@ -1307,16 +1307,6 @@ public interface Java8Listener extends ParseTreeListener {
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitLocalVariableDeclarationStatement(Java8Parser.LocalVariableDeclarationStatementContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link Java8Parser#unannTypeOrAuto}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterUnannTypeOrAuto(Java8Parser.UnannTypeOrAutoContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link Java8Parser#unannTypeOrAuto}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitUnannTypeOrAuto(Java8Parser.UnannTypeOrAutoContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link Java8Parser#localVariableDeclaration}.
|
||||
* @param ctx the parse tree
|
||||
+2974
-5096
File diff suppressed because it is too large
Load Diff
+6
@@ -1,6 +1,10 @@
|
||||
package de.dhbwstuttgart.syntaxtree;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.statement.*;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
|
||||
import de.dhbwstuttgart.syntaxtree.type.*;
|
||||
import de.dhbwstuttgart.typeinference.constraints.Constraint;
|
||||
|
||||
public interface ASTVisitor extends StatementVisitor{
|
||||
|
||||
@@ -31,4 +35,6 @@ public interface ASTVisitor extends StatementVisitor{
|
||||
void visit(ExtendsWildcardType extendsWildcardType);
|
||||
|
||||
void visit(GenericRefType genericRefType);
|
||||
|
||||
void visit(BreakStmt breakStmt);
|
||||
}
|
||||
+32
-22
@@ -1,10 +1,13 @@
|
||||
package de.dhbwstuttgart.syntaxtree;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.*;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Literal;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
|
||||
import de.dhbwstuttgart.syntaxtree.type.*;
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Iterator;
|
||||
|
||||
public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
@@ -34,7 +37,7 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(FormalParameter formalParameter) {
|
||||
formalParameter.getType().accept((ASTVisitor) this);
|
||||
formalParameter.getType().accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,7 +61,7 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
}
|
||||
|
||||
private void visitMethod(Method method){
|
||||
method.getReturnType().accept(this);
|
||||
method.getType().accept(this);
|
||||
method.getParameterList().accept(this);
|
||||
if(method.block != null)
|
||||
method.block.accept(this);
|
||||
@@ -66,10 +69,10 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(ParameterList formalParameters) {
|
||||
Iterator<FormalParameter> it = formalParameters.getFormalparalist().iterator();
|
||||
if(it.hasNext()){
|
||||
while(it.hasNext()){
|
||||
it.next().accept(this);
|
||||
Iterator<FormalParameter> genericIterator = formalParameters.getFormalparalist().iterator();
|
||||
if(genericIterator.hasNext()){
|
||||
while(genericIterator.hasNext()){
|
||||
genericIterator.next().accept(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,9 +83,6 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
for(Field f : classOrInterface.getFieldDecl()){
|
||||
f.accept(this);
|
||||
}
|
||||
for(Constructor c : classOrInterface.getConstructors()){
|
||||
c.accept(this);
|
||||
}
|
||||
for(Method m : classOrInterface.getMethods()){
|
||||
m.accept(this);
|
||||
}
|
||||
@@ -105,6 +105,7 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(TypePlaceholder typePlaceholder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,6 +115,7 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(GenericRefType genericRefType) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,7 +131,7 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(BinaryExpr binary) {
|
||||
public void visit(Binary binary) {
|
||||
|
||||
}
|
||||
|
||||
@@ -157,13 +159,12 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(ForStmt forStmt) {
|
||||
forStmt.body_Loop_block.accept(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(IfStmt ifStmt) {
|
||||
ifStmt.then_block.accept(this);
|
||||
ifStmt.else_block.accept(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -199,15 +200,10 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(ExpressionReceiver receiver) {
|
||||
public void visit(Receiver receiver) {
|
||||
receiver.expr.accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(UnaryExpr unaryExpr) {
|
||||
unaryExpr.expr.accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Return aReturn) {
|
||||
aReturn.retexpr.accept(this);
|
||||
@@ -233,14 +229,24 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(UnaryPlus unaryPlus) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(WhileStmt whileStmt) {
|
||||
whileStmt.loopBlock.accept(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(DoStmt whileStmt) {
|
||||
whileStmt.loopBlock.accept(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Null aNull) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -262,4 +268,8 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
public void visit(SuperCall superCall) {
|
||||
this.visit((MethodCall)superCall);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(BreakStmt breakStmt) {
|
||||
}
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
package de.dhbwstuttgart.syntaxtree;
|
||||
|
||||
import de.dhbwstuttgart.core.IItemWithOffset;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
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;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceInformation;
|
||||
import org.antlr.v4.runtime.Token;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Stellt jede Art von Klasse dar. Auch abstrakte Klassen und Interfaces
|
||||
*/
|
||||
public class ClassOrInterface extends SyntaxTreeNode {
|
||||
protected int modifiers;
|
||||
protected JavaClassName name;
|
||||
private List<Field> fields = new ArrayList<>();
|
||||
private List<Method> methods = new ArrayList<>();
|
||||
private GenericDeclarationList genericClassParameters;
|
||||
private RefTypeOrTPHOrWildcardOrGeneric superClass;
|
||||
protected boolean isInterface;
|
||||
private List<? extends RefTypeOrTPHOrWildcardOrGeneric> implementedInterfaces;
|
||||
private List<Constructor> constructors;
|
||||
|
||||
public ClassOrInterface(int modifiers, JavaClassName name, List<Field> fielddecl, List<Method> methods, List<Constructor> constructors, GenericDeclarationList genericClassParameters,
|
||||
RefTypeOrTPHOrWildcardOrGeneric superClass, Boolean isInterface, List<? extends RefTypeOrTPHOrWildcardOrGeneric> implementedInterfaces, Token offset){
|
||||
super(offset);
|
||||
this.modifiers = modifiers;
|
||||
this.name = name;
|
||||
this.fields = fielddecl;
|
||||
this.genericClassParameters = genericClassParameters;
|
||||
this.superClass = superClass;
|
||||
this.isInterface = isInterface;
|
||||
this.implementedInterfaces = implementedInterfaces;
|
||||
this.methods = methods;
|
||||
this.constructors = constructors;
|
||||
}
|
||||
|
||||
// Gets class name
|
||||
public JavaClassName getClassName(){
|
||||
return this.name;
|
||||
}
|
||||
|
||||
// Get modifiers
|
||||
public int getModifiers(){
|
||||
return this.modifiers;
|
||||
}
|
||||
|
||||
public List<Field> getFieldDecl(){
|
||||
return this.fields;
|
||||
}
|
||||
public List<Method> getMethods(){
|
||||
return this.methods;
|
||||
}
|
||||
|
||||
public RefType getType() {
|
||||
return generateTypeOfClass(this.getClassName(), this.getGenerics(), this.getOffset());
|
||||
}
|
||||
|
||||
public static RefType generateTypeOfClass(JavaClassName name, GenericDeclarationList genericsOfClass ,Token offset){
|
||||
return new RefType(name, offset);
|
||||
}
|
||||
|
||||
public RefTypeOrTPHOrWildcardOrGeneric getSuperClass() {
|
||||
return superClass;
|
||||
}
|
||||
|
||||
public GenericDeclarationList getGenerics() {
|
||||
return this.genericClassParameters;
|
||||
}
|
||||
|
||||
public List<Constructor> getConstructors() {
|
||||
return constructors;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ASTVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
}
|
||||
}
|
||||
+5
-6
@@ -14,9 +14,9 @@ public class Constructor extends Method {
|
||||
|
||||
|
||||
//TODO: Constructor braucht ein super-Statement
|
||||
public Constructor(int modifier, String name, RefTypeOrTPHOrWildcardOrGeneric returnType, ParameterList parameterList, Block codeInsideConstructor,
|
||||
GenericDeclarationList gtvDeclarations, Token offset /*, List<Statement> fieldInitializations geloescht PL 2018-11-24 */) {
|
||||
super(modifier, name, returnType, parameterList, /*codeInsideConstructor,*/ prepareBlock(codeInsideConstructor ) /*,fieldInitializations )geloescht PL 2018-11-24 )*/, gtvDeclarations, offset);
|
||||
public Constructor(String name, RefTypeOrTPHOrWildcardOrGeneric returnType, int modifiers, ParameterList parameterList, Block codeInsideConstructor,
|
||||
GenericDeclarationList gtvDeclarations, Token offset, List<Statement> fieldInitializations, RefType superClass) {
|
||||
super(name, returnType, modifiers, parameterList, prepareBlock(codeInsideConstructor,fieldInitializations, superClass), gtvDeclarations, offset);
|
||||
|
||||
}
|
||||
|
||||
@@ -25,10 +25,9 @@ public class Constructor extends Method {
|
||||
* welche die Felder der zugehörigen Klasse dieses
|
||||
* Konstruktor initialisieren
|
||||
*/
|
||||
protected static Block prepareBlock(Block constructorBlock /*, List<Statement> fieldInitializations new ArrayList<>() geloescht PL 2018-11-24 */){
|
||||
protected static Block prepareBlock(Block constructorBlock, List<Statement> fieldInitializations, RefType superClass){
|
||||
List<Statement> statements = constructorBlock.getStatements();
|
||||
statements.add(0, new SuperCall(null, null, constructorBlock.getOffset()));
|
||||
/* statements.addAll(fieldInitializations); geloescht PL 2018-11-24 */
|
||||
statements.add(0, new SuperCall(constructorBlock.getOffset()));
|
||||
return new Block(statements, constructorBlock.getOffset());
|
||||
}
|
||||
|
||||
Regular → Executable
+4
-15
@@ -3,19 +3,18 @@ package de.dhbwstuttgart.syntaxtree;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
import org.antlr.v4.runtime.Token;
|
||||
|
||||
import java.util.ArrayList;
|
||||
public class Field extends SyntaxTreeNode{
|
||||
|
||||
public class Field extends SyntaxTreeNode implements TypeScope{
|
||||
|
||||
public final int modifier;
|
||||
private String name;
|
||||
private RefTypeOrTPHOrWildcardOrGeneric type;
|
||||
|
||||
|
||||
private GenericDeclarationList genericParameters;
|
||||
|
||||
public Field(String name, RefTypeOrTPHOrWildcardOrGeneric type, int modifier, Token offset){
|
||||
super(offset);
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.modifier = modifier;
|
||||
}
|
||||
|
||||
public String getName(){
|
||||
@@ -30,15 +29,5 @@ public class Field extends SyntaxTreeNode implements TypeScope{
|
||||
public void accept(ASTVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<? extends GenericTypeVar> getGenerics() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ import org.antlr.v4.runtime.Token;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
|
||||
/**
|
||||
* Eine Feldinitialisation steht für eine Felddeklaration mit gleichzeitiger Wertzuweisung
|
||||
* Eine Feldinitialisation steht für eine Felddeklaration mit gleichzeitiger Wertzuweisung
|
||||
* Beispiel: 'public Feld FeldVar = FeldWert;'
|
||||
* @author janulrich
|
||||
*
|
||||
@@ -17,7 +17,7 @@ public class FieldDeclaration extends Field{
|
||||
|
||||
/**
|
||||
* Dieser Konstruktor der FieldDeclaration erstellt den Syntaxknoten vollständig.
|
||||
* Kein nachträgliches hinzfügen von Informationen oder aufrufen von parserPostProcessing ist notwendig.
|
||||
* Kein nachträgliches hinzfügen von Informationen oder aufrufen von parserPostProcessing ist notwendig.
|
||||
*/
|
||||
public FieldDeclaration(String name, RefTypeOrTPHOrWildcardOrGeneric typ, int modifier, Expression value, Token offset){
|
||||
super(name, typ, modifier, offset);//Dieser Deklarator wird nicht vom Parser aufgerufen. Dadurch gibt es auch keinen Offset
|
||||
Regular → Executable
@@ -0,0 +1,34 @@
|
||||
package de.dhbwstuttgart.syntaxtree;
|
||||
|
||||
import org.antlr.v4.runtime.Token;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* Stellt eine Deklarations-Liste von Generischen Variablen dar.
|
||||
* Kann vor Methoden und Klassen auftauchen. (<....>)
|
||||
* @author janulrich
|
||||
*
|
||||
*/
|
||||
public class GenericDeclarationList extends SyntaxTreeNode implements Iterable<GenericTypeVar>{
|
||||
|
||||
private Token offsetOfLastElement;
|
||||
private List<GenericTypeVar> gtvs = new ArrayList<>();
|
||||
|
||||
public GenericDeclarationList(List<GenericTypeVar> values, Token endOffset) {
|
||||
super(endOffset);
|
||||
gtvs = values;
|
||||
this.offsetOfLastElement = endOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<GenericTypeVar> iterator() {
|
||||
return gtvs.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ASTVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
}
|
||||
}
|
||||
Regular → Executable
+5
-10
@@ -1,7 +1,7 @@
|
||||
package de.dhbwstuttgart.syntaxtree;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
|
||||
import de.dhbwstuttgart.typecheck.GenericTypeName;
|
||||
import org.antlr.v4.runtime.Token;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -24,9 +24,9 @@ public class GenericTypeVar extends SyntaxTreeNode
|
||||
*/
|
||||
List<? extends RefTypeOrTPHOrWildcardOrGeneric> bounds=new ArrayList<RefTypeOrTPHOrWildcardOrGeneric>();
|
||||
private Token endOffset;
|
||||
private String name;
|
||||
private GenericTypeName name;
|
||||
|
||||
public GenericTypeVar(String s, List<? extends RefTypeOrTPHOrWildcardOrGeneric> bounds, Token offset, Token endOffset)
|
||||
public GenericTypeVar(GenericTypeName s, List<? extends RefTypeOrTPHOrWildcardOrGeneric> bounds, Token offset, Token endOffset)
|
||||
{
|
||||
super(offset);
|
||||
name = s;
|
||||
@@ -48,15 +48,10 @@ public class GenericTypeVar extends SyntaxTreeNode
|
||||
return "BoGTV " + this.name;
|
||||
}
|
||||
|
||||
public String getName(){
|
||||
return name.toString();
|
||||
public GenericTypeName getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/*
|
||||
public JavaClassName definingClass(){
|
||||
return name.getParentClass();
|
||||
}
|
||||
*/
|
||||
@Override
|
||||
public void accept(ASTVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
Regular → Executable
+4
-33
@@ -22,39 +22,19 @@ import de.dhbwstuttgart.syntaxtree.statement.Block;
|
||||
* @author janulrich
|
||||
*
|
||||
*/
|
||||
public class Method extends SyntaxTreeNode implements IItemWithOffset, TypeScope
|
||||
public class Method extends Field implements IItemWithOffset, TypeScope
|
||||
{
|
||||
public final Block block;
|
||||
public final int modifier;
|
||||
public final String name;
|
||||
private ParameterList parameterlist = new ParameterList(new ArrayList<>(), new NullToken());
|
||||
private ExceptionList exceptionlist;
|
||||
private GenericDeclarationList generics;
|
||||
private final RefTypeOrTPHOrWildcardOrGeneric returnType;
|
||||
public final Boolean isInherited;
|
||||
|
||||
public Method(int modifier, String name, RefTypeOrTPHOrWildcardOrGeneric returnType, ParameterList parameterList, Block block,
|
||||
public Method(String name, RefTypeOrTPHOrWildcardOrGeneric returnType, int modifiers, ParameterList parameterList, Block block,
|
||||
GenericDeclarationList gtvDeclarations, Token offset) {
|
||||
super(offset);
|
||||
this.name = name;
|
||||
this.modifier = modifier;
|
||||
this.returnType = returnType;
|
||||
super(name, returnType, modifiers, offset);
|
||||
this.parameterlist = parameterList;
|
||||
this.block = block;
|
||||
this.generics = gtvDeclarations;
|
||||
this.isInherited = false;
|
||||
}
|
||||
|
||||
public Method(int modifier, String name, RefTypeOrTPHOrWildcardOrGeneric returnType, ParameterList parameterList, Block block,
|
||||
GenericDeclarationList gtvDeclarations, Token offset, Boolean isInherited) {
|
||||
super(offset);
|
||||
this.name = name;
|
||||
this.modifier = modifier;
|
||||
this.returnType = returnType;
|
||||
this.parameterlist = parameterList;
|
||||
this.block = block;
|
||||
this.generics = gtvDeclarations;
|
||||
this.isInherited = isInherited;
|
||||
}
|
||||
|
||||
public ParameterList getParameterList() {
|
||||
@@ -67,20 +47,11 @@ public class Method extends SyntaxTreeNode implements IItemWithOffset, TypeScope
|
||||
|
||||
@Override
|
||||
public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
|
||||
return this.returnType;
|
||||
return this.getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ASTVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Token getOffset() {
|
||||
return super.getOffset();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
Regular → Executable
Regular → Executable
+5
-11
@@ -2,8 +2,9 @@ package de.dhbwstuttgart.syntaxtree;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
import de.dhbwstuttgart.parser.NullToken;
|
||||
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
||||
import de.dhbwstuttgart.typecheck.JavaClassName;
|
||||
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceInformation;
|
||||
//import sun.security.x509.X509CertInfo;
|
||||
@@ -13,32 +14,25 @@ public class SourceFile extends SyntaxTreeNode{
|
||||
private String pkgName;
|
||||
|
||||
public final List<ClassOrInterface> KlassenVektor;
|
||||
public final Set<JavaClassName> imports;
|
||||
public final List<JavaClassName> imports;
|
||||
|
||||
/**
|
||||
* Die SourceFile repräsntiert eine zu einem Syntaxbaum eingelesene Java-Datei.
|
||||
* SourceFile stellt dabei den Wurzelknoten des Syntaxbaumes dar.
|
||||
*/
|
||||
public SourceFile(String pkgName, List<ClassOrInterface> classDefinitions, Set<JavaClassName> imports){
|
||||
public SourceFile(String pkgName, List<ClassOrInterface> classDefinitions, List<JavaClassName> imports){
|
||||
super(new NullToken());
|
||||
this.KlassenVektor = classDefinitions;
|
||||
this.pkgName = pkgName;
|
||||
this.imports = imports;
|
||||
}
|
||||
|
||||
public SourceFile(SourceFile sf) {
|
||||
super(new NullToken());
|
||||
this.KlassenVektor = new ArrayList<>(sf.KlassenVektor);
|
||||
this.imports = new HashSet<>(sf.imports);
|
||||
}
|
||||
|
||||
|
||||
public String getPkgName(){
|
||||
return this.pkgName;
|
||||
}
|
||||
|
||||
// Get imports (to test implementation)
|
||||
public Set<JavaClassName> getImports(){
|
||||
public List<JavaClassName> getImports(){
|
||||
return this.imports;
|
||||
}
|
||||
|
||||
+14
-7
@@ -2,6 +2,9 @@ package de.dhbwstuttgart.syntaxtree;
|
||||
|
||||
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.*;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.StringLiteral;
|
||||
|
||||
public interface StatementVisitor {
|
||||
|
||||
@@ -11,10 +14,12 @@ public interface StatementVisitor {
|
||||
|
||||
void visit(Assign assign);
|
||||
|
||||
void visit(BinaryExpr binary);
|
||||
void visit(Binary binary);
|
||||
|
||||
void visit(Block block);
|
||||
|
||||
void visit(BreakStmt breakStmt);
|
||||
|
||||
void visit(CastExpr castExpr);
|
||||
|
||||
void visit(EmptyStmt emptyStmt);
|
||||
@@ -37,6 +42,8 @@ public interface StatementVisitor {
|
||||
|
||||
void visit(NewArray newArray);
|
||||
|
||||
void visit(Receiver receiver);
|
||||
|
||||
void visit(Return aReturn);
|
||||
|
||||
void visit(ReturnVoid aReturn);
|
||||
@@ -47,19 +54,19 @@ public interface StatementVisitor {
|
||||
|
||||
void visit(This aThis);
|
||||
|
||||
void visit(UnaryPlus unaryPlus);
|
||||
|
||||
void visit(WhileStmt whileStmt);
|
||||
|
||||
void visit(DoStmt whileStmt);
|
||||
|
||||
void visit(Null aNull);
|
||||
|
||||
void visit(Literal literal);
|
||||
|
||||
void visit(AssignToField assignLeftSide);
|
||||
|
||||
void visit(AssignToLocal assignLeftSide);
|
||||
|
||||
void visit(SuperCall superCall);
|
||||
|
||||
void visit(ExpressionReceiver expressionReceiver);
|
||||
|
||||
void visit(UnaryExpr unaryExpr);
|
||||
|
||||
void visit(Literal literal);
|
||||
}
|
||||
-2
@@ -2,8 +2,6 @@ package de.dhbwstuttgart.syntaxtree;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
|
||||
public interface TypeScope {
|
||||
Iterable<? extends GenericTypeVar> getGenerics();
|
||||
+52
-85
@@ -3,25 +3,20 @@ package de.dhbwstuttgart.syntaxtree.factory;
|
||||
import java.lang.reflect.*;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.parser.NullToken;
|
||||
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.GenericContext;
|
||||
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;
|
||||
import de.dhbwstuttgart.syntaxtree.type.WildcardType;
|
||||
import org.antlr.v4.runtime.Token;
|
||||
|
||||
/**
|
||||
@@ -38,66 +33,45 @@ public class ASTFactory {
|
||||
for(java.lang.reflect.Constructor constructor : jreClass.getConstructors()){
|
||||
konstruktoren.add(createConstructor(constructor, jreClass));
|
||||
}
|
||||
Set<java.lang.reflect.Method> allMethods = new HashSet<>(Arrays.asList(jreClass.getMethods()));
|
||||
Set<java.lang.reflect.Method> allDeclaredMethods = new HashSet<>(Arrays.asList(jreClass.getDeclaredMethods()));
|
||||
Set<java.lang.reflect.Method> allInheritedMethods = new HashSet<>(allMethods);
|
||||
allInheritedMethods.removeAll(allDeclaredMethods);
|
||||
for(java.lang.reflect.Method method : allDeclaredMethods){
|
||||
methoden.add(createMethod(method, jreClass, false));
|
||||
}
|
||||
for(java.lang.reflect.Method method : allInheritedMethods){
|
||||
methoden.add(createMethod(method, jreClass, true));
|
||||
for(java.lang.reflect.Method method : jreClass.getMethods()){
|
||||
methoden.add(createMethod(method, jreClass));
|
||||
}
|
||||
List<Field> felder = new ArrayList<>();
|
||||
for(java.lang.reflect.Field field : jreClass.getDeclaredFields()){
|
||||
for(java.lang.reflect.Field field : jreClass.getFields()){
|
||||
felder.add(createField(field, name));
|
||||
}
|
||||
int modifier = jreClass.getModifiers();
|
||||
boolean isInterface = jreClass.isInterface();
|
||||
//see: https://stackoverflow.com/questions/9934774/getting-generic-parameter-from-supertype-class
|
||||
ParameterizedType parameterSuperClass = null;
|
||||
Type tempSuperClass = jreClass.getGenericSuperclass();
|
||||
if(tempSuperClass != null && tempSuperClass instanceof ParameterizedType)
|
||||
parameterSuperClass = (ParameterizedType) tempSuperClass;
|
||||
java.lang.Class superjreClass = jreClass.getSuperclass();
|
||||
RefType superClass;
|
||||
if(parameterSuperClass != null){
|
||||
superClass = (RefType) createType(parameterSuperClass);
|
||||
}else if(superjreClass != null){
|
||||
superClass = (RefType) createType(superjreClass);
|
||||
if(superjreClass != null){
|
||||
superClass = (RefType) createType(superjreClass, name, "");
|
||||
}else{//Jede Klasse und jedes Interface erbt von Object: (auch Object selbst!)
|
||||
superClass = (RefType) createType(java.lang.Object.class);
|
||||
superClass = (RefType) createType(java.lang.Object.class, name, "");
|
||||
}
|
||||
List<RefType> implementedInterfaces = new ArrayList<>();
|
||||
for(Type jreInterface : jreClass.getGenericInterfaces()){
|
||||
implementedInterfaces.add((RefType) createType(jreInterface));
|
||||
for(java.lang.Class jreInterface : jreClass.getInterfaces()){
|
||||
implementedInterfaces.add((RefType) createType(jreInterface, name, ""));
|
||||
}
|
||||
GenericDeclarationList genericDeclarationList = createGenerics(jreClass.getTypeParameters(), jreClass, null);
|
||||
|
||||
Token offset = new NullToken(); //Braucht keinen Offset, da diese Klasse nicht aus einem Quellcode geparst wurde
|
||||
|
||||
return new ClassOrInterface(modifier, name, felder, Optional.empty() /* eingefuegt PL 2018-11-24 */,methoden, konstruktoren, genericDeclarationList, superClass,isInterface, implementedInterfaces, offset);
|
||||
return new ClassOrInterface(modifier, name, felder, methoden, konstruktoren, genericDeclarationList, superClass,isInterface, implementedInterfaces, offset);
|
||||
}
|
||||
|
||||
private static Field createField(java.lang.reflect.Field field, JavaClassName jreClass) {
|
||||
return new Field(field.getName(), createType(field.getGenericType()), field.getModifiers(), new NullToken());
|
||||
return new Field(field.getName(), createType(field.getType(), jreClass, null), field.getModifiers(), new NullToken());
|
||||
}
|
||||
|
||||
//private static RefType createType(Class classType) {
|
||||
// return createClass(classType).getType();
|
||||
//}
|
||||
|
||||
private static de.dhbwstuttgart.syntaxtree.Constructor createConstructor(Constructor constructor, Class inClass) {
|
||||
String name = constructor.getName();
|
||||
RefTypeOrTPHOrWildcardOrGeneric returnType = createType(inClass);
|
||||
RefTypeOrTPHOrWildcardOrGeneric returnType = createType(inClass, new JavaClassName(inClass.getName()), name);
|
||||
Parameter[] jreParams = constructor.getParameters();
|
||||
Type[] jreGenericParams = constructor.getGenericParameterTypes();
|
||||
List<FormalParameter> params = new ArrayList<>();
|
||||
int i = 0;
|
||||
for(Type jreParam : jreGenericParams){
|
||||
RefTypeOrTPHOrWildcardOrGeneric paramType = createType(jreParam);
|
||||
params.add(new FormalParameter(jreParams[i].getName(),paramType, new NullToken()));
|
||||
i++;
|
||||
for(Parameter jreParam : jreParams){
|
||||
RefTypeOrTPHOrWildcardOrGeneric paramType = createType(jreParam.getType(),new JavaClassName(inClass.getName()), name);
|
||||
params.add(new FormalParameter(jreParam.getName(),paramType, new NullToken()));
|
||||
}
|
||||
ParameterList parameterList = new ParameterList(params, new NullToken());
|
||||
Block block = new Block(new ArrayList<Statement>(), new NullToken());
|
||||
@@ -109,34 +83,31 @@ public class ASTFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new de.dhbwstuttgart.syntaxtree.Constructor(modifier, name,returnType, parameterList, block, gtvDeclarations, offset /*, new ArrayList<>() geloescht PL 2018-11-24 */);
|
||||
return new de.dhbwstuttgart.syntaxtree.Constructor(name,returnType, modifier, parameterList, block, gtvDeclarations, offset, new ArrayList<>(),
|
||||
createType(inClass.getSuperclass()));
|
||||
}
|
||||
|
||||
public static Method createMethod(java.lang.reflect.Method jreMethod, java.lang.Class inClass, Boolean isInherited){
|
||||
private static RefType createType(Class classType) {
|
||||
return createClass(classType).getType();
|
||||
}
|
||||
|
||||
public static Method createMethod(java.lang.reflect.Method jreMethod, java.lang.Class inClass){
|
||||
String name = jreMethod.getName();
|
||||
RefTypeOrTPHOrWildcardOrGeneric returnType;
|
||||
Type jreRetType;
|
||||
if(jreMethod.getGenericReturnType()!=null){
|
||||
jreRetType = jreMethod.getGenericReturnType();
|
||||
}else{
|
||||
jreRetType = jreMethod.getReturnType();
|
||||
}
|
||||
returnType = createType(jreRetType);
|
||||
returnType = createType(jreMethod.getReturnType(),new JavaClassName(inClass.getName()), name);
|
||||
Parameter[] jreParams = jreMethod.getParameters();
|
||||
Type[] jreGenericParams = jreMethod.getGenericParameterTypes();
|
||||
List<FormalParameter> params = new ArrayList<>();
|
||||
int i = 0;
|
||||
for(Type jreParam : jreGenericParams){
|
||||
RefTypeOrTPHOrWildcardOrGeneric paramType = createType(jreParam);
|
||||
params.add(new FormalParameter(jreParams[i].getName(),paramType, new NullToken()));
|
||||
i++;
|
||||
for(Parameter jreParam : jreParams){
|
||||
RefTypeOrTPHOrWildcardOrGeneric paramType = createType(jreParam.getType(),new JavaClassName(inClass.getName()), name);
|
||||
params.add(new FormalParameter(jreParam.getName(),paramType, new NullToken()));
|
||||
}
|
||||
ParameterList parameterList = new ParameterList(params, new NullToken());
|
||||
Block block = new Block(new ArrayList<Statement>(), new NullToken());
|
||||
GenericDeclarationList gtvDeclarations = createGenerics(jreMethod.getTypeParameters(), inClass, jreMethod.getName());
|
||||
Token offset = new NullToken();
|
||||
int modifier = jreMethod.getModifiers();
|
||||
|
||||
return new Method(jreMethod.getModifiers(), name,returnType, parameterList, block, gtvDeclarations, offset, isInherited);
|
||||
return new Method(name,returnType, modifier, parameterList, block, gtvDeclarations, offset);
|
||||
}
|
||||
|
||||
public static GenericDeclarationList createGenerics(TypeVariable[] typeParameters, Class context, String methodName){
|
||||
@@ -148,7 +119,18 @@ public class ASTFactory {
|
||||
return new GenericDeclarationList(gtvs,new NullToken());
|
||||
}
|
||||
|
||||
private static RefTypeOrTPHOrWildcardOrGeneric createType(java.lang.reflect.Type type){
|
||||
/*
|
||||
public RefType createType(java.lang.Class jreClass){
|
||||
List<RefTypeOrTPH> params = new ArrayList<>();
|
||||
for(TypeVariable jreTV : jreClass.getTypeParameters()){
|
||||
RefType gtv = createType(jreTV);
|
||||
params.add(gtv);
|
||||
}
|
||||
return new RefType(names.getName(jreClass.getName()), params, new NullToken());
|
||||
}
|
||||
*/
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric createType(java.lang.reflect.Type type, JavaClassName parentClass, String parentMethod){
|
||||
if(type.getTypeName().equals("void")){
|
||||
return new Void(new NullToken());
|
||||
}else if(type.getTypeName().equals("int")){
|
||||
@@ -168,53 +150,38 @@ public class ASTFactory {
|
||||
}else{
|
||||
if(type instanceof TypeVariable){
|
||||
//GTVDeclarationContext via "(TypeVariable) type).getGenericDeclaration()"
|
||||
return new GenericRefType(type.getTypeName(), new NullToken());
|
||||
return new GenericRefType(
|
||||
new GenericTypeName(new GenericContext(parentClass, parentMethod),type.getTypeName()),
|
||||
new NullToken());
|
||||
}
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> params = new ArrayList<>();
|
||||
if(type instanceof ParameterizedType){
|
||||
for(Type t : ((ParameterizedType)type).getActualTypeArguments()){
|
||||
params.add(createType(t));
|
||||
params.add(createType(t, parentClass, parentMethod));
|
||||
}
|
||||
}
|
||||
String name = type.getTypeName();
|
||||
if(name.contains("<")){ //Komischer fix. Type von Generischen Typen kann die Generics im Namen enthalten Type<A>
|
||||
//Diese entfernen:
|
||||
name = name.split("<")[0];
|
||||
}
|
||||
if(type instanceof java.lang.reflect.WildcardType){
|
||||
java.lang.reflect.WildcardType wildcardType = (java.lang.reflect.WildcardType) type;
|
||||
if(wildcardType.getLowerBounds().length > 0){
|
||||
return new SuperWildcardType(createType(wildcardType.getLowerBounds()[0]), new NullToken());
|
||||
}else if(wildcardType.getUpperBounds().length > 0){
|
||||
return new ExtendsWildcardType(createType(wildcardType.getUpperBounds()[0]), new NullToken());
|
||||
}else{//Es handelt sich um den '?'-Typ:
|
||||
return new ExtendsWildcardType(createObjectType(), new NullToken());
|
||||
}
|
||||
}else{
|
||||
RefType ret = new RefType(new JavaClassName(name), params, new NullToken());
|
||||
RefType ret = new RefType(new JavaClassName(type.getTypeName()), params, new NullToken());
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static de.dhbwstuttgart.syntaxtree.GenericTypeVar createGeneric(TypeVariable jreTypeVar, String jreTVName, Class context, String parentMethod){
|
||||
JavaClassName parentClass = new JavaClassName(context.getName());
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> genericBounds = new ArrayList<>();
|
||||
List<RefType> genericBounds = new ArrayList<>();
|
||||
java.lang.reflect.Type[] bounds = jreTypeVar.getBounds();
|
||||
if(bounds.length > 0){
|
||||
for(java.lang.reflect.Type bound : bounds){
|
||||
genericBounds.add(createType(bound));
|
||||
genericBounds.add((RefType) createType(bound, parentClass, parentMethod));
|
||||
}
|
||||
}
|
||||
return new de.dhbwstuttgart.syntaxtree.GenericTypeVar(jreTVName, genericBounds, new NullToken(), new NullToken());
|
||||
return new de.dhbwstuttgart.syntaxtree.GenericTypeVar(
|
||||
new GenericTypeName(new GenericContext(parentClass, parentMethod), jreTVName)
|
||||
, genericBounds, new NullToken(), new NullToken());
|
||||
}
|
||||
|
||||
public static ClassOrInterface createObjectClass() {
|
||||
return createClass(Object.class);
|
||||
}
|
||||
public static RefType createObjectType() {
|
||||
return new RefType(createClass(Object.class).getClassName(), new NullToken());
|
||||
}
|
||||
|
||||
/*
|
||||
public Constructor createEmptyConstructor(Class parent){
|
||||
@@ -0,0 +1,202 @@
|
||||
package de.dhbwstuttgart.syntaxtree.factory;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.parser.NullToken;
|
||||
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;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.UnifyPair;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.PairOperator;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.PlaceholderType;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.ReferenceType;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.SuperType;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.TypeParams;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.UnifyType;
|
||||
|
||||
|
||||
public class UnifyTypeFactory {
|
||||
|
||||
public static FiniteClosure generateFC(List<ClassOrInterface> fromAvailableClasses){
|
||||
HashSet<UnifyPair> pairs = new HashSet<>();
|
||||
for(ClassOrInterface cl : fromAvailableClasses){
|
||||
UnifyType t1 = UnifyTypeFactory.convert(cl.getType());
|
||||
UnifyType t2 = UnifyTypeFactory.convert(cl.getSuperClass());
|
||||
pairs.add(generateSmallerPair(t1, t2));
|
||||
}
|
||||
return new FiniteClosure(pairs);
|
||||
}
|
||||
|
||||
public static UnifyPair generateSmallerPair(UnifyType tl, UnifyType tr){
|
||||
return new UnifyPair(tl, tr, PairOperator.SMALLER);
|
||||
}
|
||||
|
||||
public static UnifyPair generateSmallerDotPair(UnifyType tl, UnifyType tr){
|
||||
return new UnifyPair(tl, tr, PairOperator.SMALLERDOT);
|
||||
}
|
||||
|
||||
public static UnifyPair generateEqualDotPair(UnifyType tl, UnifyType tr){
|
||||
return new UnifyPair(tl, tr, PairOperator.EQUALSDOT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert from
|
||||
* ASTType -> UnifyType
|
||||
*/
|
||||
public static UnifyType convert(RefTypeOrTPHOrWildcardOrGeneric t){
|
||||
if(t instanceof GenericRefType){
|
||||
return UnifyTypeFactory.convert((GenericRefType)t);
|
||||
}else
|
||||
if(t instanceof FunN){
|
||||
return UnifyTypeFactory.convert((FunN)t);
|
||||
}else if(t instanceof TypePlaceholder){
|
||||
return UnifyTypeFactory.convert((TypePlaceholder)t);
|
||||
}else if(t instanceof ExtendsWildcardType){
|
||||
return UnifyTypeFactory.convert((ExtendsWildcardType)t);
|
||||
}else if(t instanceof SuperWildcardType){
|
||||
return UnifyTypeFactory.convert((SuperWildcardType)t);
|
||||
}else if(t instanceof RefType){
|
||||
return UnifyTypeFactory.convert((RefType)t);
|
||||
}
|
||||
//Es wurde versucht ein Typ umzuwandeln, welcher noch nicht von der Factory abgedeckt ist
|
||||
throw new NotImplementedException("Der Typ "+t+" kann nicht umgewandelt werden");
|
||||
}
|
||||
|
||||
public static UnifyType convert(RefType t){
|
||||
UnifyType ret;
|
||||
if(t.getParaList() != null && t.getParaList().size() > 0){
|
||||
List<UnifyType> params = new ArrayList<>();
|
||||
for(RefTypeOrTPHOrWildcardOrGeneric pT : t.getParaList()){
|
||||
params.add(UnifyTypeFactory.convert(pT));
|
||||
}
|
||||
ret = new ReferenceType(t.getName().toString(),new TypeParams(params));
|
||||
}else{
|
||||
ret = new ReferenceType(t.getName().toString());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static UnifyType convert(FunN t){
|
||||
UnifyType ret;
|
||||
List<UnifyType> params = new ArrayList<>();
|
||||
if(t.getParaList() != null && t.getParaList().size() > 0){
|
||||
for(RefTypeOrTPHOrWildcardOrGeneric pT : t.getParaList()){
|
||||
params.add(UnifyTypeFactory.convert(pT));
|
||||
}
|
||||
}
|
||||
ret = FunNType.getFunNType(new TypeParams(params));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static UnifyType convert(TypePlaceholder tph){
|
||||
return new PlaceholderType(tph.getName());
|
||||
}
|
||||
|
||||
public static UnifyType convert(GenericRefType t){
|
||||
return new ReferenceType(t.getUniqueIdentifier());
|
||||
}
|
||||
|
||||
public static UnifyType convert(WildcardType t){
|
||||
if(t.isExtends())
|
||||
return new ExtendsType(UnifyTypeFactory.convert(t.getInnerType()));
|
||||
else if(t.isSuper())
|
||||
return new SuperType(UnifyTypeFactory.convert(t.getInnerType()));
|
||||
else throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
public static ConstraintSet<UnifyPair> convert(ConstraintSet<Pair> constraints) {
|
||||
return constraints.map(UnifyTypeFactory::convert);
|
||||
}
|
||||
|
||||
public static UnifyPair convert(Pair p) {
|
||||
if(p.GetOperator().equals(PairOperator.SMALLERDOT)) {
|
||||
UnifyPair ret = generateSmallerDotPair(UnifyTypeFactory.convert(p.TA1)
|
||||
, UnifyTypeFactory.convert(p.TA2));
|
||||
return ret;
|
||||
}else if(p.GetOperator().equals(PairOperator.EQUALSDOT)){
|
||||
UnifyPair ret = generateEqualDotPair(UnifyTypeFactory.convert(p.TA1)
|
||||
, UnifyTypeFactory.convert(p.TA2));
|
||||
return ret;
|
||||
}else throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert from
|
||||
* UnifyType -> ASTType
|
||||
*/
|
||||
public static Set<ResultPair> convert(Set<UnifyPair> unifyPairSet, Map<String,TypePlaceholder> tphs) {
|
||||
return unifyPairSet.stream().map(
|
||||
unifyPair -> convert(unifyPair, tphs))
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
public static ResultPair convert(UnifyPair mp, Map<String,TypePlaceholder> tphs) {
|
||||
RefTypeOrTPHOrWildcardOrGeneric tl = UnifyTypeFactory.convert(mp.getLhsType(), tphs);
|
||||
RefTypeOrTPHOrWildcardOrGeneric tr = UnifyTypeFactory.convert(mp.getRhsType(), tphs);
|
||||
if(tl instanceof TypePlaceholder){
|
||||
if(tr instanceof TypePlaceholder) return new PairTPHsmallerTPH((TypePlaceholder)tl, (TypePlaceholder)tr);
|
||||
return new PairTPHequalRefType((TypePlaceholder)tl, tr);
|
||||
}else throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric convert(ReferenceType t, Map<String,TypePlaceholder> tphs) {
|
||||
if(JavaClassName.Void.equals(t.getName()))return new Void(new NullToken());
|
||||
RefType ret = new RefType(new JavaClassName(t.getName()),convert(t.getTypeParams(), tphs),new NullToken());
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric convert(FunNType t, Map<String,TypePlaceholder> tphs) {
|
||||
RefType ret = new RefType(new JavaClassName(t.getName()), convert(t.getTypeParams(), tphs), new NullToken());
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric convert(SuperType t, Map<String,TypePlaceholder> tphs) {
|
||||
RefTypeOrTPHOrWildcardOrGeneric innerType = convert(t.getSuperedType(), tphs);
|
||||
return new SuperWildcardType(innerType, new NullToken());
|
||||
}
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric convert(ExtendsType t, Map<String,TypePlaceholder> tphs) {
|
||||
RefTypeOrTPHOrWildcardOrGeneric innerType = convert(t.getExtendedType(), tphs);
|
||||
return new ExtendsWildcardType(innerType, new NullToken());
|
||||
}
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric convert(PlaceholderType t, Map<String,TypePlaceholder> tphs) {
|
||||
TypePlaceholder ret = tphs.get(t.getName());
|
||||
if(ret == null){ //Dieser TPH wurde vom Unifikationsalgorithmus erstellt
|
||||
ret = TypePlaceholder.fresh(new NullToken());
|
||||
tphs.put(t.getName(), ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric convert(UnifyType t, Map<String,TypePlaceholder> tphs) {
|
||||
if(t instanceof FunNType)return convert((FunNType) t, tphs);
|
||||
if(t instanceof ReferenceType)return convert((ReferenceType) t, tphs);
|
||||
if(t instanceof SuperType)return convert((SuperType) t, tphs);
|
||||
if(t instanceof ExtendsType)return convert((ExtendsType) t, tphs);
|
||||
if(t instanceof PlaceholderType)return convert((PlaceholderType) t, tphs);
|
||||
throw new NotImplementedException("Der Typ "+t+" kann nicht umgewandelt werden");
|
||||
}
|
||||
|
||||
private static List<RefTypeOrTPHOrWildcardOrGeneric> convert(TypeParams typeParams, Map<String,TypePlaceholder> tphs) {
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> ret = new ArrayList<>();
|
||||
for(UnifyType uT : typeParams){
|
||||
RefTypeOrTPHOrWildcardOrGeneric toAdd = convert(uT, tphs);
|
||||
ret.add(toAdd);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user