forked from JavaTX/JavaCompilerCore
Compare commits
367 Commits
master
...
unifyOptim
Author | SHA1 | Date | |
---|---|---|---|
2c9f085cca | |||
3e4e66d60d | |||
883ab50f94 | |||
9d37e8f637 | |||
496842a3bf | |||
608d73452a | |||
421169a72d | |||
c43d9ab9f5 | |||
4e5c75673d | |||
2421dd0222 | |||
14be882b7b | |||
448d3e04f8 | |||
fe99db81b3 | |||
c3ca4777bb | |||
16b7db9218 | |||
2d5f03a3e0 | |||
fd64b84072 | |||
2a5c727400 | |||
d373b3dbf8 | |||
7c3ca93c0b | |||
72a4c64c5c | |||
bd0bfed2cb | |||
cee86a6b61 | |||
f1f34a6733 | |||
1a2454e00b | |||
bc1a796e28 | |||
9f53d1fdc2 | |||
69706ee1d2 | |||
b8e229cf3f | |||
e0c5afcd6d | |||
9123e222f4 | |||
29bd9a3f4f | |||
7926c25c7d | |||
b4c604e2b1 | |||
d8bb4d6188 | |||
0ecaf36648 | |||
2eb7a63480 | |||
11649b39d3 | |||
303cfa5409 | |||
660ef68f7e | |||
23eab0c9a4 | |||
162ca3eb27 | |||
6d70464a1c | |||
04d3ac84e7 | |||
2db5ecc260 | |||
b325e205a1 | |||
ff2bca5ce5 | |||
5a0e53485c | |||
66078360da | |||
bb26112a9b | |||
97d893e66b | |||
57fb90afaf | |||
63ac79f02c | |||
07fa62d11d | |||
66587a8f71 | |||
581e5e574e | |||
ae14dfd947 | |||
9d53d9d5d1 | |||
58f5e17ab5 | |||
6fce2760c5 | |||
1de897fb1f | |||
87dede5d5f | |||
f085f9f499 | |||
a40d2b991f | |||
704415ae3b | |||
65531ac12e | |||
34e632b872 | |||
3470215bae | |||
f5398fa8e9 | |||
f617ad8946 | |||
876ec6a4f6 | |||
26d9b1215f | |||
0f29bc038a | |||
a5ed5a2a46 | |||
c597b0430a | |||
06a0cb8eaf | |||
b5a601d798 | |||
7ea6777906 | |||
6b1896f58c | |||
d81c06cdd9 | |||
8baff8f376 | |||
bc2cab8c95 | |||
dca5d21c23 | |||
51a2acdbaf | |||
dcc36f082f | |||
9575afd0b4 | |||
5c797a44a1 | |||
87dbcfdad4 | |||
8048af2106 | |||
e4243b612c | |||
da4c59f2cf | |||
1c22fc7d57 | |||
0b7aea21d9 | |||
521a1cbf3b | |||
22ca2cbd4a | |||
49ea4ee283 | |||
225dc16a89 | |||
4738add4fc | |||
bc99dc4c8b | |||
2bbf9eac36 | |||
a785c85d42 | |||
ec2b501e63 | |||
8be4f94edf | |||
1b6cae1be0 | |||
41774b3faf | |||
62d44eb15c | |||
5f8c73f176 | |||
0ae777b4ac | |||
087170bdbf | |||
93d0caaefb | |||
1f031149d3 | |||
fc870fd706 | |||
4450f5c0cd | |||
478a2df3dc | |||
59243d9f94 | |||
82b08c5aae | |||
615983bf37 | |||
21bc2a67a1 | |||
52a96d7253 | |||
fef4d27d21 | |||
603c4c9c46 | |||
baee0024e9 | |||
1baaf79f8c | |||
52f480147e | |||
9717c54d53 | |||
c271c689de | |||
24c27303dd | |||
117106a7b3 | |||
5680f913ef | |||
22ff521d08 | |||
32ab198f9e | |||
fae26a8f26 | |||
bb5a4e8580 | |||
000c16b907 | |||
87a2ed8117 | |||
a0de7a4467 | |||
4886976752 | |||
daf684deef | |||
0b680f831d | |||
41c87e3085 | |||
bcee5e5209 | |||
95e9b2dbda | |||
72f27fab7a | |||
06bb978cf6 | |||
dbe05bb718 | |||
9a735e86dd | |||
240d57a8ba | |||
dd18c7c40e | |||
45ccfb58e3 | |||
4ac99b61bf | |||
f107c8d1f7 | |||
161c1a1b53 | |||
6b1a4eddfc | |||
ae7a63fbca | |||
79810be94f | |||
8870bc326c | |||
e1c6369bcb | |||
46255efb70 | |||
fb77f9192f | |||
a71e56ea97 | |||
5dfa6769b2 | |||
77be216ee5 | |||
100db9baac | |||
e1f579664a | |||
7a9c0a1e69 | |||
7e5aa852d7 | |||
5d39863cc6 | |||
01dd4e57e6 | |||
6faffdf90c | |||
f4bc057aff | |||
78db0f0177 | |||
3233ccd845 | |||
b0b1426e20 | |||
103c7e4b14 | |||
3638edfa73 | |||
bd98bed5ca | |||
6299086297 | |||
de5b43d72b | |||
7e6dee8e1d | |||
dafcd2f125 | |||
6a5ababa51 | |||
273ddb92d7 | |||
4a2b901465 | |||
dea3da3b69 | |||
13c70148a8 | |||
bb5945898a | |||
123f94aea7 | |||
dff72b0c97 | |||
1667b394f2 | |||
95943b1627 | |||
0315a1f144 | |||
52a5fd7904 | |||
b5b5b5d9c9 | |||
83aaff140c | |||
3deaceec01 | |||
9862df9e63 | |||
9f2702276f | |||
87cf674352 | |||
dfd6a1f532 | |||
e8388e2748 | |||
095f9a7956 | |||
c4aec8379e | |||
ccc16fd22b | |||
54cf24926e | |||
94d39ee21a | |||
725b071d28 | |||
284af1246b | |||
f453343f1c | |||
bb016e6417 | |||
831bf1fe17 | |||
cba489f279 | |||
9f3439a15e | |||
356b8a7a34 | |||
ab37e1a607 | |||
18545cff9a | |||
9840281d83 | |||
6256bdfe2e | |||
6a9db81981 | |||
53087a8e04 | |||
aa631b5099 | |||
a3a02fe475 | |||
99ce7c1122 | |||
cef82c6359 | |||
67fe88215a | |||
f31023b4fa | |||
a733eee8b5 | |||
15f5a2dc76 | |||
6fcaafe477 | |||
35b99a4095 | |||
327f36f1c2 | |||
6b57aacef0 | |||
f023754328 | |||
77aaa0ecb6 | |||
9f9a94b5cf | |||
b66d06a165 | |||
92b110a971 | |||
2277f68509 | |||
1c0fa6a820 | |||
59569380ed | |||
4fbcf87e0c | |||
10b5d87119 | |||
73c37027d9 | |||
8e198679c7 | |||
419e4a6d0e | |||
5cd2ee7d80 | |||
9c35f04a09 | |||
6808535f67 | |||
ac4a79f0e7 | |||
89246ece5c | |||
7c2f7c54dd | |||
c747ab0885 | |||
6cf98f200b | |||
ed3a3909c0 | |||
d53faa0c86 | |||
b7bb0fa1c4 | |||
166aa5e506 | |||
5270cecec9 | |||
f6e0c561bb | |||
a45aa50574 | |||
191a1166b9 | |||
6e770b5ec5 | |||
87fe51767c | |||
f0610aeff1 | |||
e4fbd17a55 | |||
9c526f20fb | |||
1f269918fb | |||
2d5c863008 | |||
22499f09e8 | |||
1f89238fe4 | |||
c61dd5411e | |||
52487f3389 | |||
5a3dcd7100 | |||
2f994cdfa8 | |||
9c4f763c9a | |||
8f9c07d88e | |||
b32e437a05 | |||
48e2d2eec2 | |||
1a1ab2696d | |||
1888eb6d46 | |||
56d919f446 | |||
15d120d594 | |||
e556a470e7 | |||
398c1992fa | |||
9a94ba2114 | |||
cdcebdd4ac | |||
8e4791cca6 | |||
3ce4937bc1 | |||
027538a082 | |||
39793b461e | |||
29173ba172 | |||
5d94820fed | |||
c7dea4c86b | |||
ede55d228e | |||
0610ea8e63 | |||
9186f5dff5 | |||
5c9b40e0b7 | |||
8d12821c68 | |||
311d7ee63a | |||
bd0678f362 | |||
a08e2e8815 | |||
47689f2fc6 | |||
b7aca99301 | |||
8920b32020 | |||
1f5071d4e4 | |||
da41857a4f | |||
09dcdaeb96 | |||
6d0392956d | |||
542f87e8a3 | |||
57df329751 | |||
7b24e2d83f | |||
b1b1cfdc54 | |||
672373fc8d | |||
ab86cc3229 | |||
0c19cc7400 | |||
268056542b | |||
19a1ef4024 | |||
3c732346d9 | |||
01339ca7ec | |||
6ddc4983b0 | |||
719d1a5ced | |||
90a9273fc2 | |||
009a638c9a | |||
55be865ab4 | |||
01fd396d29 | |||
dccdc5da2b | |||
940c922c80 | |||
bdc2a83b1c | |||
d989100b47 | |||
f015ef75f7 | |||
5f731bb09c | |||
09bdaa6a21 | |||
e8757a179f | |||
3a444c0172 | |||
ab36050f9b | |||
9919ecd083 | |||
7d8e8249ed | |||
fb0ef510b2 | |||
72fdf2dca8 | |||
eb8db0e0eb | |||
5386227a34 | |||
5e675b9a93 | |||
fd8df92c03 | |||
eddac2c8ed | |||
a8274bdc69 | |||
e702f745c3 | |||
4616f82b09 | |||
dbe47f41c1 | |||
b55d0779e9 | |||
928396927e | |||
9a886ed223 | |||
16e14f9363 | |||
b51d8356b7 | |||
48dc76646b | |||
fea86460e8 | |||
01703a73c5 | |||
bb5e697699 | |||
5a026a431c | |||
1d767a7696 | |||
d2fa9e00f8 | |||
934e5f85f8 | |||
bfa106913b | |||
44f4aa4b27 | |||
a69b827805 | |||
0c80a4c343 | |||
e18439918c | |||
b116139357 | |||
ae02ee247a |
.gitignoreREADME.md
doc/LambdaJavadoc/de/dhbwstuttgart/syntaxtree/statement
BoolLiteral.htmlCharLiteral.htmlDoubleLiteral.htmlFloatLiteral.htmlIntLiteral.htmlLiteral.htmlLongLiteral.htmlNegativeExpr.htmlNotExpr.htmlNull.htmlPositivExpr.htmlPostDecExpr.htmlPostIncExpr.htmlPreDecExpr.htmlPreIncExpr.htmlStringLiteral.html
pom.xmlclass-use
src/de/dhbwstuttgart
.DS_Store
bytecode
AStatement.javaArgumentExpr.javaArgumentVisitor.javaAssignStmt.javaBytecodeGen.javaBytecodeGenMethod.javaClassFile.javaDescriptor.javaIStatement.javaLoopStmt.javaReturnStmt.javaTest.javaTestClass.javaTestFields.javaTestIf.javaTestMeth.javaTetsF.java
descriptor
signature
utilities
core
environment
parser
JavaTXParser.java
SyntaxTreeGenerator
FCGenerator.javaGenericContext.javaStatementGenerator.javaSyntacticSugar.javaSyntaxTreeGenerator.javaTypeGenerator.java
antlr
scope
sat
CNF
asp
syntaxtree
ASTVisitor.javaAbstractASTWalker.javaClassOrInterface.javaConstructor.javaField.javaGenericDeclarationList.javaGenericTypeVar.javaMethod.javaSourceFile.javaStatementVisitor.javaTypeScope.java
factory
statement
Assign.javaBinary.javaBinaryExpr.javaExpressionReceiver.javaFieldVar.javaIfStmt.javaInstanceOf.javaJavaInternalExpression.javaLiteral.javaMethodCall.javaNegativeExpr.javaNewClass.javaNotExpr.javaPositivExpr.javaPostDecExpr.javaPostIncExpr.javaPreDecExpr.javaPreIncExpr.javaReceiver.javaReturn.javaStaticClassName.javaSuperCall.javaThis.javaUnaryExpr.javaUnaryMinus.javaUnaryNot.javaUnaryPlus.java
literal
type
ExtendsWildcardType.javaFunN.javaGenericRefType.javaRefType.javaRefTypeOrTPHOrWildcardOrGeneric.javaSuperWildcardType.javaTypePlaceholder.javaTypeVisitor.java
visual
typedeployment
typeinference
assumptions
constraints
result
PairTPHEqualTPH.javaPairTPHequalRefTypeOrWildcardType.javaPairTPHsmallerTPH.javaResultPair.javaResultPairVisitor.javaResultSet.javaResultSetVisitor.java
typeAlgo
unify
MartelliMontanariUnify.javaMatch.javaRuleSet.javaTypeUnify.javaTypeUnify2Task.javaTypeUnifyTask.javadistributeVariance.javafreshPlaceholder.java
interfaces
model
ExtendsType.javaFiniteClosure.javaFunNType.javaNode.javaOrderingUnifyPair.javaPair.javaPairOperator.javaPlaceholderType.javaReferenceType.javaSuperType.javaTypeParams.javaUnifier.javaUnifyPair.javaUnifyType.javaWildcardType.java
visitUnifyTypeVisitor.javatarget
test
asp
bytecode
BinaryTest.javaFacTest.javaFacultyTest.javaGenTest.javaGreaterEqualTest.javaGreaterThanTest.javaJavaTXCompilerTest.javaLambdaTest.javaLessEqualTest.javaLessThanTest.javaMatrixTest.javaOLTest.javaOpTest.javaOverloadingTest.javaPlusTest.javaPostIncTest.javaPreIncTest.javaRelOpsTest.javaStaticTest.javaSubMatTest.javaTph2Test.javaTph3Test.javaTphTest.javaWhileTest.javaapplyLambdaTest.java
javFiles
AssignToLit.javBinaryInMeth.javDuMethod.javEmptyMethod.javExample.javExceptions.javFac.javFaculty.javFaculty2.javFor.javGen.javGenerics.javGenerics2.javGreaterEqual.javGreaterThan.javIfTest.javImport.javInterface1.javLamRunnable.javLambda.javLambda2.javLambda3.javLambda4.javLessEqual.javLessThan.javMatrix.javMethods.javOL.javOp.javOp2.javOverlaodGen.javOverloading.javPlus.javPostIncDec.javPreInc.javRecursiveMeth.javRelOps.javReturnMethod.javStaticM.javSubMatrix.javTph.javTph2.javTph3.javVoidMeth.javWhile.javapplyLambda.jav
finiteClosure
javFiles
AddLong.javExpressions.javFC_Matrix.javFaculty.javFacultyTyped.javGenerics.javLambda.javLambda2.javLambda3.javLambdaField.javLambdaRunnable.javMatrix.javMeth_Gen.javMethodCallGenerics.javPackage.javVector.javfc.jav
parser
typeinference
FacultyTest.javaFiniteClosureTest.javaJavaTXCompilerTest.javaLambda2Test.javaLambda3Test.javaLambdaTest.javaMeth_GenTest.javaUnifyTest.javamathStrucTest.java
visualisation
testBytecode
3
.gitignore
vendored
3
.gitignore
vendored
@ -19,4 +19,7 @@ bin
|
||||
.DS_Store
|
||||
.project
|
||||
.settings/
|
||||
/target/
|
||||
|
||||
#
|
||||
manually/
|
||||
|
19
README.md
Normal file
19
README.md
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
# plugin site erstellen
|
||||
* die JAvaTXCOmpiler DAtei in ein plugin umwandeln und deployen.
|
||||
* siehe: http://www.vogella.com/tutorials/EclipseJarToPlugin/article.html#convert-jar-files-to-osgi-bundles-with-the-p2-maven-plugin
|
||||
* AUsführung:
|
||||
* mvn deploy #erstellt die JAR-Datei und steckt sie in ein lokales Repo (maven-repository)
|
||||
* mvn p2:site
|
||||
* mvn package # hier wird die ZIP-Filf zum Einbinden in Eclipse erstellt
|
||||
|
||||
# Einbinden in Eclipse
|
||||
* In Eclipse kann die Zip-FIle wie ein Plugin installiert werden
|
||||
* Hier tritt FEhler auf. Reflections-Library kann nicht installiert werden. Möglicherweise wird sie auch nicht gebraucht
|
||||
* Nach dem installieren de.dhbwstuttagrt.JavaTXcompiler zu den DEpendencies des plugins hinzufügen
|
||||
* Anschließend unter "Overview" auf "Updata Classpath" klicken
|
||||
|
||||
# Windows
|
||||
* JAVA_HOME setzen:
|
||||
* export JAVA_HOME=/c/Program\ Files/Java/jdk1.8.0_102/
|
@ -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.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.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.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.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.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.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.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.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.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.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.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.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.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.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.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.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.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.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.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.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.Literal</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.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.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.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.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.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.NegativeExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.NotExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.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.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.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.PositivExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PostDecExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PostIncExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PreDecExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PreIncExpr</li>
|
||||
<li>de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.Literal</a></li>
|
||||
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.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.Literal">
|
||||
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.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.Literal</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.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.Literal" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.Literal</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.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.NegativeExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.NegativeExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.NegativeExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.NegativeExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.NegativeExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.NegativeExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.NotExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.NotExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.NotExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.NotExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.NotExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.NotExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PositivExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PositivExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PositivExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PositivExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PositivExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.PositivExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PostDecExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PostDecExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PostDecExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PostDecExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PostDecExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.PostDecExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PostIncExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PostIncExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PostIncExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PostIncExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PostIncExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.PostIncExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PreDecExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PreDecExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PreDecExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PreDecExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PreDecExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.PreDecExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PreIncExpr</title>
|
||||
<title>Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.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.PreIncExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PreIncExpr</h2>
|
||||
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.statement.javaInternal.PreIncExpr" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.statement.PreIncExpr</h2>
|
||||
</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.PreIncExpr</div>
|
||||
<div class="classUseContainer">No usage of de.dhbwstuttgart.syntaxtree.statement.javaInternal.PreIncExpr</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<div class="bottomNav"><a name="navbar.bottom">
|
||||
<!-- -->
|
||||
|
110
pom.xml
110
pom.xml
@ -7,6 +7,7 @@
|
||||
<groupId>de.dhbwstuttgart</groupId>
|
||||
<artifactId>JavaTXcompiler</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<version>0.1</version>
|
||||
<name>JavaTXcompiler</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
@ -22,10 +23,15 @@
|
||||
<artifactId>antlr4</artifactId>
|
||||
<version>4.7</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>19.0</version>
|
||||
<version>22.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
@ -37,12 +43,18 @@
|
||||
<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>${artifactId}-${version}</finalName>
|
||||
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||
<testOutputDirectory>target/test-classes</testOutputDirectory>
|
||||
<sourceDirectory>src/</sourceDirectory>
|
||||
<testSourceDirectory>test/</testSourceDirectory>
|
||||
@ -60,18 +72,110 @@
|
||||
<configuration>
|
||||
<sourceDirectory>src/de/dhbwstuttgart/parser/antlr/</sourceDirectory>
|
||||
<outputDirectory>src/de/dhbwstuttgart/parser/antlr/</outputDirectory>
|
||||
<arguments> <argument>-package</argument> <argument>de.dhbwstuttgart.parser.antlr</argument> </arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>aspParser</id>
|
||||
<goals>
|
||||
<goal>antlr4</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirectory>src/de/dhbwstuttgart/sat/asp/parser/antlr/</sourceDirectory>
|
||||
<outputDirectory>src/de/dhbwstuttgart/sat/asp/parser/antlr/</outputDirectory>
|
||||
<arguments>
|
||||
<argument>-package</argument>
|
||||
<argument>de.dhbwstuttgart.parser.antlr</argument>
|
||||
<argument>de.dhbwstuttgart.sat.asp.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>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.reficio</groupId>
|
||||
<artifactId>p2-maven-plugin</artifactId>
|
||||
<version>1.1.2-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-cli</id>
|
||||
<configuration>
|
||||
<artifacts>
|
||||
<!-- specify your depencies here -->
|
||||
<!-- groupId:artifactId:version -->
|
||||
<artifact>
|
||||
<id>de.dhbwstuttgart:JavaTXcompiler:0.1</id>
|
||||
</artifact>
|
||||
<artifact><id>org.reflections:reflections:0.9.11</id></artifact>
|
||||
<artifact><id>com.google.guava:guava:22.0</id></artifact>
|
||||
<artifact><id>javax.annotation:javax.annotation-api:1.3.1</id></artifact>
|
||||
<artifact><id>org.glassfish:javax.annotation:3.1.1</id></artifact>
|
||||
</artifacts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>tycho-p2-repository-plugin</artifactId>
|
||||
<version>${tycho.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>archive-repository</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>9</source>
|
||||
<target>9</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>reficio</id>
|
||||
<url>http://repo.reficio.org/maven/</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>maven-repository</id>
|
||||
<url>file:///${project.basedir}/target</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<tycho.version>0.23.0</tycho.version>
|
||||
</properties>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>maven-repository</id>
|
||||
<name>MyCo Internal Repository</name>
|
||||
<url>file:///${project.basedir}/maven-repository/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
|
BIN
src/de/dhbwstuttgart/.DS_Store
vendored
BIN
src/de/dhbwstuttgart/.DS_Store
vendored
Binary file not shown.
30
src/de/dhbwstuttgart/bytecode/AStatement.java
Normal file
30
src/de/dhbwstuttgart/bytecode/AStatement.java
Normal file
@ -0,0 +1,30 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import org.objectweb.asm.Label;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.statement.BinaryExpr;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expression;
|
||||
|
||||
public abstract class AStatement implements IStatement {
|
||||
protected Expression expr;
|
||||
|
||||
public AStatement(Expression expr) {
|
||||
this.expr = expr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExprBinary() {
|
||||
return (expr instanceof BinaryExpr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void genBCForRelOp(MethodVisitor mv,Label branchLabel, Label endLabel, BytecodeGenMethod bytecodeGenMethod) {
|
||||
mv.visitInsn(Opcodes.ICONST_1);
|
||||
mv.visitJumpInsn(Opcodes.GOTO, endLabel);
|
||||
mv.visitLabel(branchLabel);
|
||||
mv.visitInsn(Opcodes.ICONST_0);
|
||||
mv.visitLabel(endLabel);
|
||||
}
|
||||
}
|
11
src/de/dhbwstuttgart/bytecode/ArgumentExpr.java
Normal file
11
src/de/dhbwstuttgart/bytecode/ArgumentExpr.java
Normal file
@ -0,0 +1,11 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expression;
|
||||
|
||||
public class ArgumentExpr extends AStatement {
|
||||
|
||||
public ArgumentExpr(Expression expr) {
|
||||
super(expr);
|
||||
}
|
||||
|
||||
}
|
@ -1,48 +1,45 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import java.util.List;
|
||||
|
||||
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
|
||||
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.ArgumentList;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Assign;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.AssignToField;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Binary;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.BinaryExpr;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Block;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.CastExpr;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.DoStmt;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.EmptyStmt;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.ExpressionReceiver;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.FieldVar;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.ForStmt;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.IfStmt;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.InstanceOf;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.LambdaExpression;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Literal;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.LocalVar;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.LocalVarDecl;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.MethodCall;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.NewArray;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.NewClass;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Receiver;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Return;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.ReturnVoid;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.StaticClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Super;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.SuperCall;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.This;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.UnaryPlus;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.UnaryExpr;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.WhileStmt;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
|
||||
|
||||
public class BytecodeGenLambda implements StatementVisitor{
|
||||
private LambdaExpression lambdaExpression;
|
||||
private MethodVisitor mv;
|
||||
public class ArgumentVisitor implements StatementVisitor {
|
||||
private List<Boolean> argListMethCall;
|
||||
private BytecodeGenMethod bytecodeGenMethod;
|
||||
|
||||
public BytecodeGenLambda(LambdaExpression lambdaExpression, MethodVisitor mv) {
|
||||
this.lambdaExpression = lambdaExpression;
|
||||
this.mv = mv;
|
||||
|
||||
|
||||
public ArgumentVisitor(List<Boolean> argListMethCall, BytecodeGenMethod bytecodeGenMethod) {
|
||||
this.argListMethCall = argListMethCall;
|
||||
this.bytecodeGenMethod = bytecodeGenMethod;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -53,20 +50,28 @@ public class BytecodeGenLambda implements StatementVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(LambdaExpression lambdaExpression) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
lambdaExpression.accept(bytecodeGenMethod);
|
||||
// Zieltype des Lambas ist Funktionale Interface
|
||||
// kann nie primitiv sein => un-/boxing wird hier nicht gebraucht
|
||||
argListMethCall.remove(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Assign assign) {
|
||||
// TODO Auto-generated method stub
|
||||
assign.accept(bytecodeGenMethod);
|
||||
|
||||
if(argListMethCall.get(0))
|
||||
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolvedType(assign.getType()));
|
||||
argListMethCall.remove(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Binary binary) {
|
||||
// TODO Auto-generated method stub
|
||||
public void visit(BinaryExpr binary) {
|
||||
binary.accept(bytecodeGenMethod);
|
||||
|
||||
if(argListMethCall.get(0))
|
||||
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolvedType(binary.getType()));
|
||||
argListMethCall.remove(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -77,8 +82,11 @@ public class BytecodeGenLambda implements StatementVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(CastExpr castExpr) {
|
||||
// TODO Auto-generated method stub
|
||||
castExpr.accept(bytecodeGenMethod);
|
||||
|
||||
if(argListMethCall.get(0))
|
||||
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolvedType(castExpr.getType()));
|
||||
argListMethCall.remove(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -89,8 +97,11 @@ public class BytecodeGenLambda implements StatementVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(FieldVar fieldVar) {
|
||||
// TODO Auto-generated method stub
|
||||
fieldVar.accept(bytecodeGenMethod);
|
||||
|
||||
if(argListMethCall.get(0))
|
||||
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolvedType(fieldVar.getType()));
|
||||
argListMethCall.remove(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -107,14 +118,21 @@ public class BytecodeGenLambda implements StatementVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(InstanceOf instanceOf) {
|
||||
// TODO Auto-generated method stub
|
||||
instanceOf.accept(bytecodeGenMethod);
|
||||
|
||||
if(argListMethCall.get(0))
|
||||
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolvedType(instanceOf.getType()));
|
||||
argListMethCall.remove(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(LocalVar localVar) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
localVar.accept(bytecodeGenMethod);
|
||||
if(!bytecodeGenMethod.isBinaryExp) {
|
||||
if(argListMethCall.get(0))
|
||||
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolvedType(localVar.getType()));
|
||||
}
|
||||
argListMethCall.remove(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -125,14 +143,20 @@ public class BytecodeGenLambda implements StatementVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(MethodCall methodCall) {
|
||||
// TODO Auto-generated method stub
|
||||
methodCall.accept(bytecodeGenMethod);
|
||||
|
||||
if(argListMethCall.get(0))
|
||||
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolvedType(methodCall.getType()));
|
||||
argListMethCall.remove(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(NewClass methodCall) {
|
||||
// TODO Auto-generated method stub
|
||||
methodCall.accept(bytecodeGenMethod);
|
||||
|
||||
if(argListMethCall.get(0))
|
||||
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolvedType(methodCall.getType()));
|
||||
argListMethCall.remove(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -141,12 +165,6 @@ public class BytecodeGenLambda implements StatementVisitor{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Receiver receiver) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Return aReturn) {
|
||||
// TODO Auto-generated method stub
|
||||
@ -173,14 +191,11 @@ public class BytecodeGenLambda implements StatementVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(This aThis) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(UnaryPlus unaryPlus) {
|
||||
// TODO Auto-generated method stub
|
||||
aThis.accept(bytecodeGenMethod);
|
||||
|
||||
if(argListMethCall.get(0))
|
||||
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolvedType(aThis.getType()));
|
||||
argListMethCall.remove(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -195,18 +210,6 @@ public class BytecodeGenLambda implements StatementVisitor{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Null aNull) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Literal literal) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(AssignToField assignLeftSide) {
|
||||
// TODO Auto-generated method stub
|
||||
@ -224,4 +227,29 @@ public class BytecodeGenLambda implements StatementVisitor{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(ExpressionReceiver expressionReceiver) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(UnaryExpr unaryExpr) {
|
||||
unaryExpr.accept(bytecodeGenMethod);
|
||||
|
||||
if(argListMethCall.get(0))
|
||||
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolvedType(unaryExpr.getType()));
|
||||
argListMethCall.remove(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Literal literal) {
|
||||
literal.accept(bytecodeGenMethod);
|
||||
|
||||
if(argListMethCall.get(0))
|
||||
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolvedType(literal.getType()));
|
||||
argListMethCall.remove(0);
|
||||
}
|
||||
|
||||
}
|
11
src/de/dhbwstuttgart/bytecode/AssignStmt.java
Normal file
11
src/de/dhbwstuttgart/bytecode/AssignStmt.java
Normal file
@ -0,0 +1,11 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expression;
|
||||
|
||||
public class AssignStmt extends AStatement {
|
||||
|
||||
public AssignStmt(Expression rightSide) {
|
||||
super(rightSide);
|
||||
}
|
||||
|
||||
}
|
@ -1,80 +1,96 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import java.awt.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.*;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.FieldVisitor;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import org.objectweb.asm.Type;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.descriptor.DescriptorToString;
|
||||
import de.dhbwstuttgart.bytecode.descriptor.TypeToDescriptor;
|
||||
import de.dhbwstuttgart.bytecode.signature.Signature;
|
||||
import de.dhbwstuttgart.bytecode.signature.TypeToSignature;
|
||||
import de.dhbwstuttgart.bytecode.signature.TypeToString;
|
||||
import de.dhbwstuttgart.bytecode.utilities.MethodAndTPH;
|
||||
import de.dhbwstuttgart.bytecode.utilities.NormalConstructor;
|
||||
import de.dhbwstuttgart.bytecode.utilities.NormalMethod;
|
||||
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
|
||||
import de.dhbwstuttgart.syntaxtree.*;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.ArgumentList;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Assign;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.AssignToField;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Binary;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Block;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.CastExpr;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.DoStmt;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.EmptyStmt;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.FieldVar;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.ForStmt;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.IfStmt;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.InstanceOf;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.LambdaExpression;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.LocalVar;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.LocalVarDecl;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.MethodCall;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.NewArray;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.NewClass;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Receiver;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Return;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.ReturnVoid;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.StaticClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Super;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.SuperCall;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.This;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.UnaryPlus;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.WhileStmt;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Literal;
|
||||
import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
import de.dhbwstuttgart.typeinference.result.GenericInsertPair;
|
||||
import de.dhbwstuttgart.typeinference.result.ResolvedType;
|
||||
import de.dhbwstuttgart.typeinference.result.ResultPair;
|
||||
import de.dhbwstuttgart.typeinference.result.ResultSet;
|
||||
|
||||
public class BytecodeGen implements ASTVisitor {
|
||||
|
||||
ClassWriter cw =new ClassWriter(ClassWriter.COMPUTE_FRAMES|ClassWriter.COMPUTE_MAXS);
|
||||
// String methDesc;
|
||||
|
||||
String type;
|
||||
|
||||
|
||||
String className;
|
||||
private boolean isInterface;
|
||||
private List<ResultSet> listOfResultSets;
|
||||
private ResultSet resultSet;
|
||||
private SourceFile sf;
|
||||
private String path;
|
||||
|
||||
private int indexOfFirstParam = 0;
|
||||
|
||||
private String superClass;
|
||||
|
||||
// stores parameter, local vars and the next index on the local variable table, which use for aload_i, astore_i,...
|
||||
HashMap<String, Integer> paramsAndLocals;// = new HashMap<>();
|
||||
HashMap<String, Integer> paramsAndLocals = new HashMap<>();
|
||||
// stores generics and their bounds of class
|
||||
HashMap<String, String> genericsAndBounds = new HashMap<>();
|
||||
// stores generics and their bounds of method
|
||||
HashMap<String, String> genericsAndBoundsMethod = new HashMap<>();
|
||||
|
||||
private final TPHExtractor tphExtractor = new TPHExtractor();
|
||||
private final ArrayList<GenericInsertPair> commonPairs = new ArrayList<>();
|
||||
|
||||
HashMap<String,RefTypeOrTPHOrWildcardOrGeneric> methodParamsAndTypes = new HashMap<>();
|
||||
byte[] bytecode;
|
||||
HashMap<String,byte[]> classFiles;
|
||||
|
||||
public BytecodeGen(HashMap<String,byte[]> classFiles) {
|
||||
ArrayList<String> methodNameAndParamsT = new ArrayList<>();
|
||||
|
||||
public BytecodeGen(HashMap<String,byte[]> classFiles, List<ResultSet> listOfResultSets,SourceFile sf ,String path) {
|
||||
this.classFiles = classFiles;
|
||||
paramsAndLocals = new HashMap<>();
|
||||
this.listOfResultSets = listOfResultSets;
|
||||
this.sf = sf;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(SourceFile sourceFile) {
|
||||
for(ClassOrInterface cl : sourceFile.getClasses()) {
|
||||
BytecodeGen classGen = new BytecodeGen(classFiles);
|
||||
System.out.println("in Class: " + cl.getClassName().toString());
|
||||
BytecodeGen classGen = new BytecodeGen(classFiles, listOfResultSets, sf, path);
|
||||
cl.accept(classGen);
|
||||
classGen.writeClass(cl.getClassName().toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associates the bytecode of the class that was build with the classWriter {@link #cw}
|
||||
* with the class name in the map {@link #classFiles}
|
||||
*
|
||||
* @param name name of the class with which the the bytecode is to be associated
|
||||
*/
|
||||
private void writeClass(String name) {
|
||||
bytecode = cw.toByteArray();
|
||||
classFiles.put(name, bytecode);
|
||||
@ -84,63 +100,285 @@ public class BytecodeGen implements ASTVisitor {
|
||||
public HashMap<String,byte[]> getClassFiles() {
|
||||
return classFiles;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void visit(ClassOrInterface classOrInterface) {
|
||||
|
||||
className = classOrInterface.getClassName().toString();
|
||||
// access flages??
|
||||
cw.visit(Opcodes.V1_8, classOrInterface.getModifiers()+Opcodes.ACC_SUPER, classOrInterface.getClassName().toString()
|
||||
, null, classOrInterface.getSuperClass().toString(), null);
|
||||
|
||||
// for each field in the class
|
||||
for(Field f : classOrInterface.getFieldDecl()) {
|
||||
System.out.println("get Fields");
|
||||
System.out.println(f.getName());
|
||||
f.accept(this);
|
||||
cw.visitSource(className +".jav", null);
|
||||
|
||||
isInterface = (classOrInterface.getModifiers()&512)==512;
|
||||
|
||||
int acc = isInterface?classOrInterface.getModifiers()+Opcodes.ACC_ABSTRACT:classOrInterface.getModifiers()+Opcodes.ACC_SUPER;
|
||||
|
||||
|
||||
// resultSet = listOfResultSets.get(0);
|
||||
boolean isConsWithNoParamsVisited = false;
|
||||
boolean isVisited = false;
|
||||
for(ResultSet rs : listOfResultSets) {
|
||||
superClass = classOrInterface.getSuperClass().acceptTV(new TypeToDescriptor());
|
||||
resultSet = rs;
|
||||
// Nur einmal ausführen!!
|
||||
if(!isVisited) {
|
||||
classOrInterface.accept(tphExtractor);
|
||||
|
||||
getCommonTPHS(tphExtractor);
|
||||
|
||||
String sig = null;
|
||||
/* if class has generics then creates signature
|
||||
* Signature looks like:
|
||||
* <E:Ljava/...>Superclass
|
||||
*/
|
||||
if(classOrInterface.getGenerics().iterator().hasNext() || !commonPairs.isEmpty() ||
|
||||
classOrInterface.getSuperClass().acceptTV(new TypeToSignature()).contains("<")) {
|
||||
Signature signature = new Signature(classOrInterface, genericsAndBounds,commonPairs);
|
||||
sig = signature.toString();
|
||||
System.out.println("Signature: => " + sig);
|
||||
}
|
||||
|
||||
cw.visit(Opcodes.V1_8, acc, classOrInterface.getClassName().toString()
|
||||
, sig, classOrInterface.getSuperClass().acceptTV(new TypeToDescriptor()), null);
|
||||
|
||||
isVisited = true;
|
||||
}
|
||||
|
||||
for(Field f : classOrInterface.getFieldDecl()) {
|
||||
f.accept(this);
|
||||
}
|
||||
|
||||
for(Constructor c : classOrInterface.getConstructors()) {
|
||||
if(!isConsWithNoParamsVisited)
|
||||
c.accept(this);
|
||||
if(!c.getParameterList().iterator().hasNext())
|
||||
isConsWithNoParamsVisited = true;
|
||||
}
|
||||
|
||||
for(Method m : classOrInterface.getMethods()) {
|
||||
m.accept(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for(Constructor c : classOrInterface.getConstructors()) {
|
||||
c.accept(this);
|
||||
}
|
||||
|
||||
for(Method m : classOrInterface.getMethods()) {
|
||||
m.accept(this);
|
||||
}
|
||||
cw.visitSource(classOrInterface.getClassName().toString()+".jav", null);
|
||||
}
|
||||
|
||||
|
||||
private void getCommonTPHS(TPHExtractor tphExtractor) {
|
||||
// Gemeinsame TPHs
|
||||
ArrayList<TypePlaceholder> cTPHs = new ArrayList<>();
|
||||
// Alle TPHs der Felder speichern
|
||||
for(TypePlaceholder tph : tphExtractor.allTPHS.keySet()) {
|
||||
if(!tphExtractor.allTPHS.get(tph))
|
||||
cTPHs.add(tph);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Constructor field) {
|
||||
Descriptor desc = new Descriptor(field);
|
||||
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", desc.getDesc(), null, null);
|
||||
mv.visitCode();
|
||||
System.out.println("-----Constructor-----");
|
||||
BytecodeGenMethod gen = new BytecodeGenMethod(className,field, mv,paramsAndLocals,desc.getDesc(),cw);
|
||||
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Method method) {
|
||||
method.getParameterList().accept(this);
|
||||
Descriptor methDesc = new Descriptor(method);
|
||||
System.out.println("-----Method-----");
|
||||
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, method.getName(), methDesc.getDesc(), null, null);
|
||||
mv.visitCode();
|
||||
field.getParameterList().accept(this);
|
||||
|
||||
BytecodeGenMethod gen = new BytecodeGenMethod(className,method, mv,paramsAndLocals,methDesc.getDesc(),cw);
|
||||
String desc = null;
|
||||
boolean hasGen = false;
|
||||
|
||||
for(String paramName : methodParamsAndTypes.keySet()) {
|
||||
String typeOfParam = methodParamsAndTypes.get(paramName).acceptTV(new TypeToSignature());
|
||||
if(genericsAndBounds.containsKey(typeOfParam) ||typeOfParam.substring(0, 4).equals("TPH ")
|
||||
|| typeOfParam.contains("<")) {
|
||||
hasGen = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
String sig = null;
|
||||
if(hasGen) {
|
||||
ArrayList<GenericInsertPair> pairs = simplifyPairs(field.name,tphExtractor.allPairs);
|
||||
Signature signature = new Signature(field, genericsAndBounds,methodParamsAndTypes,resultSet,pairs);
|
||||
sig = signature.toString();
|
||||
}
|
||||
NormalConstructor constructor = new NormalConstructor(field,genericsAndBounds,hasGen);
|
||||
desc = constructor.accept(new DescriptorToString(resultSet));
|
||||
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", desc, sig, null);
|
||||
mv.visitCode();
|
||||
BytecodeGenMethod gen = new BytecodeGenMethod(className,superClass,resultSet,field, mv,paramsAndLocals,cw,
|
||||
genericsAndBoundsMethod,genericsAndBounds,isInterface,classFiles, sf,path);
|
||||
if(!field.getParameterList().iterator().hasNext()) {
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
}
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Method method) {
|
||||
// TODO: check if the method is static => if static then the first param will be stored in pos 0
|
||||
// else it will be stored in pos 1 and this will be stored in pos 0
|
||||
String retType = resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor());
|
||||
String methParamTypes = retType+method.name+"%%";
|
||||
method.getParameterList().accept(this);
|
||||
|
||||
Iterator<FormalParameter> itr = method.getParameterList().iterator();
|
||||
while(itr.hasNext()) {
|
||||
FormalParameter fp = itr.next();
|
||||
methParamTypes += resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+";";
|
||||
}
|
||||
|
||||
if(methodNameAndParamsT.contains(methParamTypes)) {
|
||||
return;
|
||||
}
|
||||
methodNameAndParamsT.add(methParamTypes);
|
||||
System.out.println("Method: "+method.name +" , paramsType: "+methParamTypes);
|
||||
String methDesc = null;
|
||||
|
||||
// Method getModifiers() ?
|
||||
int acc = isInterface?Opcodes.ACC_ABSTRACT:method.modifier;
|
||||
System.out.println(acc);
|
||||
|
||||
/*Prüfe, ob die Rückgabe-Type der Methode eine Type-Variable ist*/
|
||||
boolean hasGenInParameterList = genericsAndBounds.containsKey(retType) || retType.subSequence(0, 4).equals("TPH ") ||
|
||||
resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToSignature()).contains("<");
|
||||
/*Wenn die Rückgabe-Type eine Typ-variable ist, erzeuge direkt die Signature, wenn nicht,
|
||||
* prüfe, ob einer der Parameter Typ-Variable als Typ hat*/
|
||||
if(!hasGenInParameterList) {
|
||||
for(String paramName : methodParamsAndTypes.keySet()) {
|
||||
String typeOfParam = methodParamsAndTypes.get(paramName).acceptTV(new TypeToDescriptor());
|
||||
String sigOfParam = methodParamsAndTypes.get(paramName).acceptTV(new TypeToSignature());
|
||||
if(genericsAndBounds.containsKey(typeOfParam)||typeOfParam.substring(0, 4).equals("TPH ")||sigOfParam.contains("<")) {
|
||||
hasGenInParameterList = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Test if the return-type or any of the parameter is a parameterized type. (VP)
|
||||
//then create the descriptor with the new syntax.
|
||||
|
||||
String sig = null;
|
||||
/* method.getGenerics: <....> RT method(..)
|
||||
* */
|
||||
boolean hasGen = method.getGenerics().iterator().hasNext() || hasGenInParameterList;
|
||||
/* if method has generics or return type is TPH, create signature */
|
||||
// zwite operand muss weggelassen werden
|
||||
if(hasGen||resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToString()).equals("TPH")) {
|
||||
ArrayList<GenericInsertPair> pairs = simplifyPairs(method.name,tphExtractor.allPairs);
|
||||
System.out.println(method.name + " => Simplified Pairs: ");
|
||||
pairs.forEach(p->System.out.println(p.TA1.getName() + " -> "+p.TA2.getName()));
|
||||
Signature signature = new Signature(method, genericsAndBoundsMethod, genericsAndBounds,methodParamsAndTypes,resultSet, pairs);
|
||||
sig = signature.toString();
|
||||
}
|
||||
System.out.println(method.getName()+" ==> "+sig);
|
||||
NormalMethod meth = new NormalMethod(method,genericsAndBounds,genericsAndBoundsMethod,hasGen);
|
||||
methDesc = meth.accept(new DescriptorToString(resultSet));
|
||||
|
||||
// System.out.println(methDesc);
|
||||
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC+acc, method.getName(), methDesc, sig, null);
|
||||
|
||||
mv.visitCode();
|
||||
BytecodeGenMethod gen = new BytecodeGenMethod(className,superClass,resultSet,method, mv,paramsAndLocals,cw,
|
||||
genericsAndBoundsMethod,genericsAndBounds,isInterface,classFiles, sf,path);
|
||||
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
}
|
||||
|
||||
private ArrayList<GenericInsertPair> simplifyPairs(String methodName, ArrayList<GenericInsertPair> allPairs) {
|
||||
allPairs.forEach(p->System.out.print(p.TA1 + " < "+ p.TA2+ " ; "));
|
||||
|
||||
if(allPairs.size() < 2)
|
||||
return allPairs;
|
||||
|
||||
ArrayList<GenericInsertPair> simplifiedPairs = new ArrayList<>();
|
||||
|
||||
MethodAndTPH method;
|
||||
ArrayList<TypePlaceholder> methodTphs = new ArrayList<>();
|
||||
ArrayList<GenericInsertPair> methodPairs = new ArrayList<>();
|
||||
for(MethodAndTPH m : tphExtractor.ListOfMethodsAndTph) {
|
||||
if(m.getName().equals(methodName)) {
|
||||
methodTphs = m.getTphs();
|
||||
methodPairs = m.getPairs();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
HashMap<TypePlaceholder, TypePlaceholder> subAndSuperTph = new HashMap<>();
|
||||
for(GenericInsertPair p : allPairs) {
|
||||
// Tph2.jav
|
||||
if(subAndSuperTph.containsKey(p.TA1)) {
|
||||
if(methodTphs.contains(subAndSuperTph.get(p.TA1)))
|
||||
continue;
|
||||
}
|
||||
subAndSuperTph.put(p.TA1, p.TA2);
|
||||
}
|
||||
int numOfVisitedPairs = 0;
|
||||
for(TypePlaceholder subTph: subAndSuperTph.keySet()) {
|
||||
|
||||
if(numOfVisitedPairs>=subAndSuperTph.size())
|
||||
break;
|
||||
|
||||
if(!methodTphs.contains(subTph))
|
||||
continue;
|
||||
|
||||
HashMap<Integer, TypePlaceholder> tphsInRel= new HashMap<>();
|
||||
|
||||
tphsInRel.put(tphsInRel.size(), subTph);
|
||||
TypePlaceholder superTph = subAndSuperTph.get(subTph);
|
||||
tphsInRel.put(tphsInRel.size(), superTph);
|
||||
|
||||
numOfVisitedPairs++;
|
||||
|
||||
while(subAndSuperTph.containsKey(superTph)) {
|
||||
superTph = subAndSuperTph.get(superTph);
|
||||
tphsInRel.put(tphsInRel.size(), superTph);
|
||||
numOfVisitedPairs++;
|
||||
}
|
||||
|
||||
// Subtype
|
||||
TypePlaceholder subTphRes = tphsInRel.get(0);
|
||||
// Die größte Supertype
|
||||
TypePlaceholder superTphRes = tphsInRel.get(tphsInRel.size()-1);
|
||||
|
||||
while(subAndSuperTph.containsValue(subTphRes)) {
|
||||
for(TypePlaceholder tph : subAndSuperTph.keySet()) {
|
||||
if(methodTphs.contains(tph) && subAndSuperTph.get(tph).equals(subTphRes)) {
|
||||
subTphRes = tph;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(subTphRes.equals(tphsInRel.get(0))) {
|
||||
break;
|
||||
}
|
||||
tphsInRel.put(0, subTphRes);
|
||||
numOfVisitedPairs++;
|
||||
}
|
||||
|
||||
subTphRes = tphsInRel.get(0);
|
||||
|
||||
int i = 2;
|
||||
while(!methodTphs.contains(superTphRes) && (tphsInRel.size()-i) >0) {
|
||||
superTphRes = tphsInRel.get(tphsInRel.size()-i);
|
||||
i++;
|
||||
}
|
||||
// teste noch den Fall X < Y und Y nicht in TPHS der Methode
|
||||
// Dann hat man nach der While-Schleife X < Y
|
||||
// Y muss durch Object ersetzt.
|
||||
|
||||
// Zweite Operand für die Fälle wie in Lambda.jav (Paramtrisierte Typen)
|
||||
if(methodTphs.contains(superTphRes) || !tphExtractor.allTPHS.containsKey(superTphRes)) {
|
||||
GenericInsertPair sPair = new GenericInsertPair(subTphRes, superTphRes);
|
||||
simplifiedPairs.add(sPair);
|
||||
}
|
||||
}
|
||||
return simplifiedPairs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(ParameterList formalParameters) {
|
||||
paramsAndLocals = new HashMap<>();
|
||||
methodParamsAndTypes = new HashMap<>();
|
||||
Iterator<FormalParameter> itr = formalParameters.iterator();
|
||||
int i = 1;
|
||||
while(itr.hasNext()) {
|
||||
FormalParameter fp = itr.next();
|
||||
paramsAndLocals.put(fp.getName(), i);
|
||||
methodParamsAndTypes.put(fp.getName(), resultSet.resolveType(fp.getType()).resolvedType);
|
||||
fp.accept(this);
|
||||
i++;
|
||||
}
|
||||
@ -183,7 +421,6 @@ public class BytecodeGen implements ASTVisitor {
|
||||
// ??
|
||||
@Override
|
||||
public void visit(FieldVar fieldVar) {
|
||||
System.out.println("in fieldvar");
|
||||
// cw.newField(fieldVar.receiver.toString(), fieldVar.fieldVarName.toString(), fieldVar.getType().toString());
|
||||
FieldVisitor fv = cw.visitField(Opcodes.ACC_PRIVATE, fieldVar.fieldVarName, "L"+fieldVar.getType()+";", null, null);
|
||||
fv.visitEnd();
|
||||
@ -192,7 +429,6 @@ public class BytecodeGen implements ASTVisitor {
|
||||
// access flages?? modifiers
|
||||
@Override
|
||||
public void visit(Field field) {
|
||||
System.out.println("in field");
|
||||
FieldVisitor fv = cw.visitField(Opcodes.ACC_PRIVATE, field.getName(), "L"+field.getType().toString().replace(".", "/")+";", null, null);
|
||||
fv.visitEnd();
|
||||
}
|
||||
@ -210,9 +446,8 @@ public class BytecodeGen implements ASTVisitor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Binary binary) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
public void visit(BinaryExpr binary) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -281,12 +516,6 @@ public class BytecodeGen implements ASTVisitor {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Receiver receiver) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Return aReturn) {
|
||||
// TODO Auto-generated method stub
|
||||
@ -317,12 +546,6 @@ public class BytecodeGen implements ASTVisitor {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(UnaryPlus unaryPlus) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(WhileStmt whileStmt) {
|
||||
// TODO Auto-generated method stub
|
||||
@ -335,11 +558,6 @@ public class BytecodeGen implements ASTVisitor {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Null aNull) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
// ???
|
||||
@Override
|
||||
public void visit(Literal literal) {
|
||||
@ -379,7 +597,62 @@ public class BytecodeGen implements ASTVisitor {
|
||||
|
||||
@Override
|
||||
public void visit(SuperCall superCall) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(ExpressionReceiver expressionReceiver) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(UnaryExpr unaryExpr) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private class TPHExtractor extends AbstractASTWalker{
|
||||
// Alle TPHs der Felder werden iKopf der Klasse definiert
|
||||
// alle TPHs der Klasse: (TPH, is in Method?)
|
||||
final HashMap<TypePlaceholder,Boolean> allTPHS = new HashMap<>();
|
||||
MethodAndTPH methodAndTph;
|
||||
Boolean inMethod = false;
|
||||
final ArrayList<MethodAndTPH> ListOfMethodsAndTph = new ArrayList<>();
|
||||
final ArrayList<GenericInsertPair> allPairs = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void visit(TypePlaceholder tph) {
|
||||
if(resultSet.resolveType(tph).resolvedType instanceof TypePlaceholder) {
|
||||
TypePlaceholder resolvedTPH = (TypePlaceholder) resultSet.resolveType(tph).resolvedType;
|
||||
if(inMethod)
|
||||
methodAndTph.getTphs().add(resolvedTPH);
|
||||
|
||||
allTPHS.put(resolvedTPH,inMethod);
|
||||
resultSet.resolveType(tph).additionalGenerics.forEach(ag ->{
|
||||
if(ag.contains(resolvedTPH)&&ag.TA1.equals(resolvedTPH)&&!contains(allPairs,ag)) {
|
||||
if(inMethod)
|
||||
methodAndTph.getPairs().add(ag);
|
||||
allPairs.add(ag);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
private boolean contains(ArrayList<GenericInsertPair> pairs, GenericInsertPair genPair) {
|
||||
for(int i=0; i<pairs.size();++i) {
|
||||
GenericInsertPair p = pairs.get(i);
|
||||
if(p.TA1.equals(genPair.TA1) && p.TA2.equals(genPair.TA2))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public void visit(Method method) {
|
||||
inMethod = true;
|
||||
methodAndTph = new MethodAndTPH(method.name);
|
||||
super.visit(method);
|
||||
inMethod = false;
|
||||
ListOfMethodsAndTph.add(methodAndTph);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,14 +0,0 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
public class ClassFile {
|
||||
|
||||
String name;
|
||||
byte[] bytecode;
|
||||
|
||||
public ClassFile(String name, byte[] bytecode) {
|
||||
this.name = name;
|
||||
this.bytecode = bytecode;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import java.awt.List;
|
||||
import java.util.Iterator;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.Constructor;
|
||||
import de.dhbwstuttgart.syntaxtree.FormalParameter;
|
||||
import de.dhbwstuttgart.syntaxtree.Method;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.ArgumentList;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expression;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
|
||||
public class Descriptor {
|
||||
String desc;
|
||||
|
||||
public Descriptor(Method method) {
|
||||
desc = "(";
|
||||
Iterator<FormalParameter> itr = method.getParameterList().iterator();
|
||||
while(itr.hasNext()) {
|
||||
FormalParameter fp = itr.next();
|
||||
desc = desc + "L"+fp.getType().toString().replace(".", "/") + ";";
|
||||
}
|
||||
if(method.getReturnType().toString().equals("void")){
|
||||
desc = desc + ")V";
|
||||
}else {
|
||||
desc = desc + ")" + "L"+method.getReturnType().toString().replace(".", "/")+";";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Descriptor(Constructor constructor) {
|
||||
desc = "(";
|
||||
Iterator<FormalParameter> itr = constructor.getParameterList().iterator();
|
||||
while(itr.hasNext()) {
|
||||
FormalParameter fp = itr.next();
|
||||
desc = desc + "L"+fp.getType().toString().replace(".", "/") + ";";
|
||||
}
|
||||
desc = desc + ")V";
|
||||
}
|
||||
|
||||
public Descriptor(ArgumentList argList, RefTypeOrTPHOrWildcardOrGeneric returnType) {
|
||||
desc = "(";
|
||||
for(Expression e : argList.getArguments()) {
|
||||
desc = desc + "L"+e.getType().toString().replace(".", "/") + ";";
|
||||
}
|
||||
desc = desc + ")"+returnType.toString();
|
||||
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
}
|
9
src/de/dhbwstuttgart/bytecode/IStatement.java
Normal file
9
src/de/dhbwstuttgart/bytecode/IStatement.java
Normal file
@ -0,0 +1,9 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import org.objectweb.asm.Label;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
public interface IStatement {
|
||||
public boolean isExprBinary();
|
||||
public void genBCForRelOp(MethodVisitor mv, Label branchLabel, Label endLabel, BytecodeGenMethod bytecodeGenMethod);
|
||||
}
|
26
src/de/dhbwstuttgart/bytecode/LoopStmt.java
Normal file
26
src/de/dhbwstuttgart/bytecode/LoopStmt.java
Normal file
@ -0,0 +1,26 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import org.objectweb.asm.Label;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expression;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Statement;
|
||||
|
||||
public class LoopStmt extends AStatement {
|
||||
|
||||
private Statement loopBlock;
|
||||
|
||||
public LoopStmt(Expression expr, Statement loopBlock) {
|
||||
super(expr);
|
||||
this.loopBlock = loopBlock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void genBCForRelOp(MethodVisitor mv,Label branchLabel, Label endLabel, BytecodeGenMethod bytecodeGenMethod) {
|
||||
bytecodeGenMethod.isBinary(false);
|
||||
this.loopBlock.accept(bytecodeGenMethod);
|
||||
mv.visitJumpInsn(Opcodes.GOTO, endLabel);
|
||||
mv.visitLabel(branchLabel);
|
||||
}
|
||||
}
|
14
src/de/dhbwstuttgart/bytecode/ReturnStmt.java
Normal file
14
src/de/dhbwstuttgart/bytecode/ReturnStmt.java
Normal file
@ -0,0 +1,14 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.statement.BinaryExpr;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expression;
|
||||
|
||||
public class ReturnStmt extends AStatement {
|
||||
|
||||
public ReturnStmt(Expression retexpr) {
|
||||
super(retexpr);
|
||||
}
|
||||
|
||||
}
|
@ -1,150 +0,0 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.CallSite;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.Handle;
|
||||
import org.objectweb.asm.Label;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import org.objectweb.asm.Type;
|
||||
|
||||
|
||||
public class Test {
|
||||
private static final String rootDirectory = System.getProperty("user.dir") + "/bin/de/dhbwstuttgart/bytecode/";
|
||||
|
||||
protected static ClassLoader getClassLoader() throws Exception {
|
||||
File file = new File(rootDirectory);
|
||||
URL url = file.toURI().toURL();
|
||||
URL[] urls = new URL[] { url };
|
||||
System.out.println(urls[0]);
|
||||
return new URLClassLoader(urls);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Test Lambda
|
||||
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
|
||||
cw.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, "TestClass", null, "java/lang/Object", null);
|
||||
|
||||
cw.visitSource("TestClass.java", null);
|
||||
|
||||
// Create Constructor
|
||||
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
|
||||
|
||||
// mv.visitMethodInsn(INVOKEDYNAMIC, "#0", "run", "()Ljava/lang/Runnable");
|
||||
//Call site, which, when invoked, returns an instance of the functional interface to which
|
||||
//the lambda is being converted
|
||||
MethodType mt = MethodType.methodType(CallSite.class, MethodHandles.Lookup.class, String.class,
|
||||
MethodType.class, MethodType.class, MethodHandle.class, MethodType.class);
|
||||
|
||||
Handle bootstrap = new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory",
|
||||
mt.toMethodDescriptorString());
|
||||
Handle arg2 = new Handle(Opcodes.H_INVOKESTATIC, "TestClass", "lambda$0", "()V");
|
||||
|
||||
mv.visitInvokeDynamicInsn("run", "()Ljava/lang/Runnable;", bootstrap,
|
||||
Type.getMethodType("()V"), arg2,
|
||||
Type.getMethodType("()V"));
|
||||
|
||||
mv.visitVarInsn(Opcodes.ASTORE, 1);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/lang/Runnable", "run", "()V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
|
||||
// creates bridge method, contains lambdas body
|
||||
MethodVisitor mvl = cw.visitMethod(Opcodes.ACC_PRIVATE + Opcodes.ACC_STATIC + Opcodes.ACC_SYNTHETIC, "lambda$0",
|
||||
"()V", null, null);
|
||||
mvl.visitCode();
|
||||
mvl.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;");
|
||||
mvl.visitLdcInsn("lambda");
|
||||
mvl.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V");
|
||||
mvl.visitInsn(Opcodes.RETURN);
|
||||
mvl.visitMaxs(2, 0);
|
||||
mvl.visitEnd();
|
||||
|
||||
mv.visitMaxs(1, 2);
|
||||
mv.visitEnd();
|
||||
|
||||
|
||||
cw.visitInnerClass("java/lang/invoke/MethodHandles$Lookup", "java/lang/invoke/MethodHandles", "Lookup",
|
||||
Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL);
|
||||
cw.visitEnd();
|
||||
|
||||
byte[] b = cw.toByteArray();
|
||||
|
||||
// Test if statement
|
||||
/*
|
||||
* ClassWriter cw = new
|
||||
* ClassWriter(ClassWriter.COMPUTE_FRAMES|ClassWriter.COMPUTE_MAXS);
|
||||
*
|
||||
* cw.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC+Opcodes.ACC_SUPER, "TestIf", null,
|
||||
* "java/lang/Object", null); MethodVisitor mv =
|
||||
* cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "(Ljava/lang/Boolean;)V", null,
|
||||
* null); mv.visitCode();
|
||||
*
|
||||
* // Label l0 = new Label(); // mv.visitLabel(l0);
|
||||
*
|
||||
* mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
*
|
||||
* mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>",
|
||||
* "()V");
|
||||
*
|
||||
* // Label l1 = new Label(); // mv.visitLabel(l1);
|
||||
* mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,
|
||||
* "java/lang/Boolean", "booleanValue", "()Z");
|
||||
*
|
||||
* Label label = new Label(); mv.visitJumpInsn(Opcodes.IFEQ, label);
|
||||
*
|
||||
* mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/System", "out",
|
||||
* "Ljava/io/PrintStream;"); mv.visitLdcInsn("1");
|
||||
* mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/io/PrintStream", "println",
|
||||
* "(Ljava/lang/String;)V");
|
||||
*
|
||||
* Label endLabel = new Label(); mv.visitJumpInsn(Opcodes.GOTO, endLabel);
|
||||
*
|
||||
* mv.visitLabel(label); mv.visitFieldInsn(Opcodes.GETSTATIC,
|
||||
* "java/lang/System", "out", "Ljava/io/PrintStream;"); mv.visitLdcInsn("0");
|
||||
* mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/io/PrintStream", "println",
|
||||
* "(Ljava/lang/String;)V");
|
||||
*
|
||||
*
|
||||
*
|
||||
* mv.visitLabel(endLabel); mv.visitInsn(Opcodes.RETURN);
|
||||
*
|
||||
* // Label l2 = new Label(); // mv.visitLabel(l2);
|
||||
*
|
||||
* // mv.visitLocalVariable("this", "LTestIf;", null, l0, l2, 0); //
|
||||
* mv.visitLocalVariable("b", "Ljava/lang/Boolean;", null, l0, l2, 1);
|
||||
* mv.visitMaxs(2, 2); mv.visitEnd();
|
||||
*
|
||||
* cw.visitEnd(); byte[] b = cw.toByteArray();
|
||||
*/
|
||||
FileOutputStream output;
|
||||
|
||||
try {
|
||||
output = new FileOutputStream(new File(System.getProperty("user.dir") + "/testBytecode/TestClass.class"));
|
||||
output.write(b);
|
||||
output.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
public class TestClass {
|
||||
public TestClass() {
|
||||
Runnable lam = () -> System.out.println("lambda");
|
||||
lam.run();
|
||||
}
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.FieldVisitor;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import org.objectweb.asm.Type;
|
||||
|
||||
public class TestFields {
|
||||
private static final String rootDirectory = System.getProperty("user.dir") + "/bin/de/dhbwstuttgart/bytecode/";
|
||||
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES|ClassWriter.COMPUTE_MAXS);
|
||||
cw.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, "TetsF", null, "java/lang/Object", null);
|
||||
|
||||
cw.visitSource("TetsF.java", null);
|
||||
|
||||
FieldVisitor fv = cw.visitField(Opcodes.ACC_PRIVATE, "z", Type.INT_TYPE.getDescriptor(), null, null);
|
||||
fv.visitEnd();
|
||||
|
||||
FieldVisitor fvS = cw.visitField(Opcodes.ACC_PUBLIC, "s", "Ljava/lang/String;", null, null);
|
||||
fvS.visitEnd();
|
||||
// Create Constructor
|
||||
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
|
||||
mv.visitCode();
|
||||
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitLdcInsn("");
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "TetsF", "s", "Ljava/lang/String;");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(2, 1);
|
||||
mv.visitEnd();
|
||||
|
||||
byte[] b = cw.toByteArray();
|
||||
|
||||
FileOutputStream output;
|
||||
|
||||
try {
|
||||
output = new FileOutputStream(new File(System.getProperty("user.dir") + "/testBytecode/TetsF.class"));
|
||||
output.write(b);
|
||||
output.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
public class TestIf {
|
||||
public TestIf(Boolean b) {
|
||||
if(b) {
|
||||
System.out.println("1");
|
||||
}else {
|
||||
System.out.println("0");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
public class TestMeth {
|
||||
private int z;
|
||||
public String s;
|
||||
public TestMeth(int temp) {
|
||||
this.z = temp;
|
||||
}
|
||||
public void m1(int a, int b) {
|
||||
int y = m2(1,2,3,4);
|
||||
}
|
||||
|
||||
public int m2(int a, int b, int x, int y) {
|
||||
Integer c = 55;
|
||||
Integer g;
|
||||
return a+b+y+c;
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
package de.dhbwstuttgart.bytecode;
|
||||
|
||||
public class TetsF {
|
||||
private int z;
|
||||
public String s = "";
|
||||
}
|
207
src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java
Normal file
207
src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java
Normal file
@ -0,0 +1,207 @@
|
||||
package de.dhbwstuttgart.bytecode.descriptor;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.objectweb.asm.Type;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.signature.TypeToSignature;
|
||||
import de.dhbwstuttgart.bytecode.utilities.Lambda;
|
||||
import de.dhbwstuttgart.bytecode.utilities.MethodFromMethodCall;
|
||||
import de.dhbwstuttgart.bytecode.utilities.NormalConstructor;
|
||||
import de.dhbwstuttgart.bytecode.utilities.NormalMethod;
|
||||
import de.dhbwstuttgart.bytecode.utilities.SamMethod;
|
||||
import de.dhbwstuttgart.syntaxtree.FormalParameter;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expression;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
import de.dhbwstuttgart.typeinference.result.ResultSet;
|
||||
|
||||
public class DescriptorToString implements DescriptorVisitor{
|
||||
ResultSet resultSet;
|
||||
|
||||
public DescriptorToString(ResultSet resultSet) {
|
||||
this.resultSet = resultSet;
|
||||
}
|
||||
|
||||
private String addReturnType(String desc, RefTypeOrTPHOrWildcardOrGeneric returnType, ResultSet resultSet) {
|
||||
if(resultSet.resolveType(returnType).resolvedType.toString().equals("void")){
|
||||
desc = desc + ")V";
|
||||
}else {
|
||||
desc = desc + ")" + "L"+resultSet.resolveType(returnType).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(NormalMethod method) {
|
||||
|
||||
String desc = "(";
|
||||
Iterator<FormalParameter> itr = method.getParameterList().iterator();
|
||||
while(itr.hasNext()) {
|
||||
FormalParameter fp = itr.next();
|
||||
// System.out.println(resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToSignature()));
|
||||
// System.out.println("Parmetrisierte typ ? "+ ((RefType) fp.getType()).getParaList().size());
|
||||
if(method.hasGen()) {
|
||||
String fpDesc = fp.getType().acceptTV(new TypeToDescriptor());
|
||||
if(method.getGenericsAndBoundsMethod().containsKey(fpDesc)) {
|
||||
desc += "L"+method.getGenericsAndBoundsMethod().get(fpDesc)+ ";";
|
||||
}else if(method.getGenericsAndBounds().containsKey(fpDesc)){
|
||||
desc += "L"+method.getGenericsAndBounds().get(fpDesc)+ ";";
|
||||
}else {
|
||||
// desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
|
||||
String resType = resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor());
|
||||
if(resType.subSequence(0, 4).equals("TPH ")) {
|
||||
// Bound ist immer Object
|
||||
desc += "L"+Type.getInternalName(Object.class)+ ";";
|
||||
} else {
|
||||
desc += "L"+resType+ ";";
|
||||
}
|
||||
}
|
||||
}
|
||||
//TODO: generate a class java%% ... %%
|
||||
else if(resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor()).contains("<")){
|
||||
desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.toString().replace(".", "$$").replace("<", "$$$").replace(">", "$$$")+ ";";
|
||||
}
|
||||
else {
|
||||
desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
|
||||
}
|
||||
}
|
||||
|
||||
if(resultSet.resolveType(method.getReturnType()).resolvedType.toString().equals("void")) {
|
||||
desc += ")V";
|
||||
}else {
|
||||
if(method.hasGen()) {
|
||||
String ret = method.getReturnType().acceptTV(new TypeToDescriptor());
|
||||
if(method.getGenericsAndBoundsMethod().containsKey(ret)) {
|
||||
desc += ")L"+method.getGenericsAndBoundsMethod().get(ret)+ ";";
|
||||
}else if(method.getGenericsAndBounds().containsKey(ret)){
|
||||
desc += ")L"+method.getGenericsAndBounds().get(ret)+ ";";
|
||||
}else {
|
||||
String resType = resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor());
|
||||
if(resType.subSequence(0, 4).equals("TPH ")) {
|
||||
// desc += ")" + "L"+method.getGenericsAndBoundsMethod().get(resType.substring(4)+"$")+ ";";
|
||||
desc += ")" + "L"+Type.getInternalName(Object.class)+ ";";
|
||||
} else {
|
||||
desc += ")" + "L"+resType+ ";";
|
||||
}
|
||||
}
|
||||
}else {
|
||||
desc += ")" + "L"+resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
|
||||
}
|
||||
}
|
||||
// desc = addReturnType(desc,method.getReturnType(), resultSet);
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(NormalConstructor constructor) {
|
||||
String desc = "(";
|
||||
Iterator<FormalParameter> itr = constructor.getParameterList().iterator();
|
||||
while(itr.hasNext()) {
|
||||
FormalParameter fp = itr.next();
|
||||
if(constructor.hasGen()) {
|
||||
// System.out.println("Cons has Gens");
|
||||
String fpDesc = fp.getType().acceptTV(new TypeToDescriptor());
|
||||
// System.out.println(fpDesc);
|
||||
if(constructor.getGenericsAndBounds().containsKey(fpDesc)){
|
||||
desc += "L"+constructor.getGenericsAndBounds().get(fpDesc)+ ";";
|
||||
}else {
|
||||
desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
|
||||
}
|
||||
}else {
|
||||
// System.out.println("Cons has NOT Gens");
|
||||
desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
|
||||
}
|
||||
}
|
||||
desc = desc + ")V";
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(Lambda lambdaExpression) {
|
||||
String desc = "(";
|
||||
Iterator<FormalParameter> itr = lambdaExpression.getParams().iterator();
|
||||
while(itr.hasNext()) {
|
||||
FormalParameter fp = itr.next();
|
||||
String d = resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor());
|
||||
if(d.substring(0, 4).equals("TPH ") ||d.contains("<")) {
|
||||
desc += "L"+Type.getInternalName(Object.class)+ ";";
|
||||
}else {
|
||||
desc = desc + "L"+ d + ";";
|
||||
}
|
||||
}
|
||||
|
||||
String retType = resultSet.resolveType(lambdaExpression.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor());
|
||||
|
||||
if(retType.substring(0, 4).equals("TPH ")|| retType.contains("<")){
|
||||
desc += ")L"+Type.getInternalName(Object.class)+ ";";
|
||||
}else {
|
||||
desc = desc + ")"+"L"+retType+";";
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(SamMethod samMethod) {
|
||||
String desc = "(";
|
||||
Iterator<RefTypeOrTPHOrWildcardOrGeneric> itr = samMethod.getArgumentList().iterator();
|
||||
while(itr.hasNext()) {
|
||||
RefTypeOrTPHOrWildcardOrGeneric rt = itr.next();
|
||||
String d = resultSet.resolveType(rt).resolvedType.acceptTV(new TypeToDescriptor());
|
||||
|
||||
if(d.substring(0, 4).equals("TPH ") ||d.contains("<")) {
|
||||
desc += "L"+Type.getInternalName(Object.class)+ ";";
|
||||
}else {
|
||||
desc += "L"+ d + ";";
|
||||
|
||||
}
|
||||
}
|
||||
String retType = resultSet.resolveType(samMethod.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor());
|
||||
|
||||
if(retType.substring(0, 4).equals("TPH ")|| retType.contains("<")){
|
||||
desc += ")L"+Type.getInternalName(Object.class)+ ";";
|
||||
}else {
|
||||
desc = desc + ")"+"L"+retType+";";
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(MethodFromMethodCall methodFromMethodCall) {
|
||||
String desc = "(";
|
||||
for(Expression e : methodFromMethodCall.getArgList().getArguments()) {
|
||||
String d = resultSet.resolveType(e.getType()).resolvedType.acceptTV(new TypeToDescriptor());
|
||||
|
||||
if(d.substring(0, 4).equals("TPH ") ||d.contains("<") || methodFromMethodCall.getReceiverName().contains("$$")) {
|
||||
desc += "L"+Type.getInternalName(Object.class)+ ";";
|
||||
}else {
|
||||
if(methodFromMethodCall.getGenericsAndBoundsMethod().containsKey(d)) {
|
||||
desc += "L"+methodFromMethodCall.getGenericsAndBoundsMethod().get(d)+ ";";
|
||||
}else if(methodFromMethodCall.getGenericsAndBounds().containsKey(d)) {
|
||||
desc += "L"+methodFromMethodCall.getGenericsAndBounds().get(d)+ ";";
|
||||
}else {
|
||||
desc += "L"+resultSet.resolveType(e.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
String retType = resultSet.resolveType(methodFromMethodCall.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor());
|
||||
System.out.println("DescriptorToString retType = " + retType);
|
||||
if(retType.equals("void")) {
|
||||
desc += ")V";
|
||||
}else if(retType.substring(0, 4).equals("TPH ")|| retType.contains("<") || methodFromMethodCall.getReceiverName().contains("$$")){
|
||||
desc += ")L"+Type.getInternalName(Object.class)+ ";";
|
||||
}else {
|
||||
if(methodFromMethodCall.getGenericsAndBoundsMethod().containsKey(retType)) {
|
||||
desc += ")L"+methodFromMethodCall.getGenericsAndBoundsMethod().get(retType)+ ";";
|
||||
}else if(methodFromMethodCall.getGenericsAndBounds().containsKey(retType)){
|
||||
desc += ")L"+methodFromMethodCall.getGenericsAndBounds().get(retType)+ ";";
|
||||
}else {
|
||||
desc += ")" + "L"+retType+ ";";
|
||||
}
|
||||
}
|
||||
// desc = addReturnType(desc, methodFromMethodCall.getReturnType(), resultSet);
|
||||
return desc;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package de.dhbwstuttgart.bytecode.descriptor;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.utilities.Lambda;
|
||||
import de.dhbwstuttgart.bytecode.utilities.MethodFromMethodCall;
|
||||
import de.dhbwstuttgart.bytecode.utilities.NormalConstructor;
|
||||
import de.dhbwstuttgart.bytecode.utilities.NormalMethod;
|
||||
import de.dhbwstuttgart.bytecode.utilities.SamMethod;
|
||||
|
||||
public interface DescriptorVisitor {
|
||||
public String visit(NormalMethod method);
|
||||
public String visit(NormalConstructor constructor);
|
||||
public String visit(Lambda lambdaExpression);
|
||||
public String visit(SamMethod samMethod);
|
||||
public String visit(MethodFromMethodCall methodFromMethodCall);
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package de.dhbwstuttgart.bytecode.descriptor;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypeVisitor;
|
||||
|
||||
public class TypeToDescriptor implements TypeVisitor<String>{
|
||||
|
||||
@Override
|
||||
public String visit(RefType refType) {
|
||||
return refType.getName().toString().replace(".", "/");
|
||||
// String t = refType.getName().toString().replace(".", "/");
|
||||
// return t.equals("Fun1")?(t+"$$"):t;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(SuperWildcardType superWildcardType) {
|
||||
System.out.println("\nWILDCARD ="+superWildcardType.getInnerType().toString().replace(".", "/"));
|
||||
return superWildcardType.getInnerType().toString().replace(".", "/");
|
||||
//throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(TypePlaceholder typePlaceholder) {
|
||||
return typePlaceholder.toString().replace(".", "/");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(ExtendsWildcardType extendsWildcardType) {
|
||||
System.out.println("\nWILDCARD extends ="+extendsWildcardType.getInnerType().toString().replace(".", "/"));
|
||||
return extendsWildcardType.getInnerType().toString().replace(".", "/");
|
||||
//throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(GenericRefType genericRefType) {
|
||||
return genericRefType.getParsedName().replace(".", "/");
|
||||
}
|
||||
}
|
484
src/de/dhbwstuttgart/bytecode/signature/Signature.java
Normal file
484
src/de/dhbwstuttgart/bytecode/signature/Signature.java
Normal file
@ -0,0 +1,484 @@
|
||||
package de.dhbwstuttgart.bytecode.signature;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.objectweb.asm.Type;
|
||||
import org.objectweb.asm.signature.SignatureVisitor;
|
||||
import org.objectweb.asm.signature.SignatureWriter;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.descriptor.TypeToDescriptor;
|
||||
import de.dhbwstuttgart.bytecode.utilities.MethodAndTPH;
|
||||
import de.dhbwstuttgart.syntaxtree.AbstractASTWalker;
|
||||
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
|
||||
import de.dhbwstuttgart.syntaxtree.Constructor;
|
||||
import de.dhbwstuttgart.syntaxtree.GenericTypeVar;
|
||||
import de.dhbwstuttgart.syntaxtree.Method;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.LambdaExpression;
|
||||
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.typeinference.result.GenericInsertPair;
|
||||
import de.dhbwstuttgart.typeinference.result.ResolvedType;
|
||||
import de.dhbwstuttgart.typeinference.result.ResultSet;
|
||||
|
||||
public class Signature {
|
||||
private ClassOrInterface classOrInterface;
|
||||
private HashMap<String, String> genericsAndBounds;
|
||||
private HashMap<String, String> genericsAndBoundsMethod;
|
||||
private SignatureWriter sw;
|
||||
private Constructor constructor;
|
||||
private Method method;
|
||||
private HashMap<String,RefTypeOrTPHOrWildcardOrGeneric> methodParamsAndTypes;
|
||||
private ResultSet resultSet;
|
||||
private ArrayList<GenericInsertPair> commonPairs;
|
||||
private ArrayList<GenericInsertPair> methodPairs;
|
||||
|
||||
public Signature(ClassOrInterface classOrInterface, HashMap<String, String> genericsAndBounds,ArrayList<GenericInsertPair> commonPairs) {
|
||||
this.classOrInterface = classOrInterface;
|
||||
this.genericsAndBounds = genericsAndBounds;
|
||||
this.commonPairs = commonPairs;
|
||||
sw = new SignatureWriter();
|
||||
createSignatureForClassOrInterface();
|
||||
}
|
||||
|
||||
public Signature(Constructor constructor, HashMap<String, String> genericsAndBounds,
|
||||
HashMap<String,RefTypeOrTPHOrWildcardOrGeneric> methodParamsAndTypes,ResultSet resultSet,ArrayList<GenericInsertPair> methodPairs) {
|
||||
this.constructor = constructor;
|
||||
this.genericsAndBounds = genericsAndBounds;
|
||||
this.methodParamsAndTypes = methodParamsAndTypes;
|
||||
this.resultSet = resultSet;
|
||||
this.methodPairs = methodPairs;
|
||||
sw = new SignatureWriter();
|
||||
createSignatureForConsOrMethod(this.constructor,true);
|
||||
}
|
||||
|
||||
public Signature(Method method, HashMap<String, String> genericsAndBoundsMethod,HashMap<String, String> genericsAndBounds,
|
||||
HashMap<String, RefTypeOrTPHOrWildcardOrGeneric> methodParamsAndTypes, ResultSet resultSet, ArrayList<GenericInsertPair> methodPairs) {
|
||||
this.method = method;
|
||||
this.genericsAndBoundsMethod = genericsAndBoundsMethod;
|
||||
this.genericsAndBounds = genericsAndBounds;
|
||||
this.methodParamsAndTypes = methodParamsAndTypes;
|
||||
this.resultSet = resultSet;
|
||||
this.methodPairs = methodPairs;
|
||||
sw = new SignatureWriter();
|
||||
createSignatureForConsOrMethod(this.method,false);
|
||||
}
|
||||
|
||||
public Signature(LambdaExpression lambdaExpression,int numberOfParams) {
|
||||
sw = new SignatureWriter();
|
||||
createSignatureForFunN(lambdaExpression, numberOfParams);
|
||||
}
|
||||
|
||||
private void createSignatureForFunN(LambdaExpression lambdaExpression, int numberOfParams) {
|
||||
|
||||
// sw.visitClassBound().visitEnd();
|
||||
for(int i = 0;i<numberOfParams;i++) {
|
||||
int j = i+1;
|
||||
sw.visitFormalTypeParameter("T"+ j);
|
||||
// getBounds von Params
|
||||
sw.visitClassBound().visitClassType(Type.getInternalName(Object.class));
|
||||
sw.visitClassBound().visitEnd();
|
||||
}
|
||||
|
||||
sw.visitFormalTypeParameter("R");
|
||||
// getBounds vom Return-Type
|
||||
sw.visitClassBound().visitClassType(Type.getInternalName(Object.class));
|
||||
sw.visitClassBound().visitEnd();
|
||||
// TODO: prüfe ob Return-Type = void,
|
||||
sw.visitSuperclass().visitClassType(Type.getInternalName(Object.class));;
|
||||
sw.visitEnd();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates signature for a method or constructor with @see {@link SignatureWriter}
|
||||
* Signature looks like:
|
||||
* <typevaliables (K:Ljava/lang/Object "Bounds")>(params L.. OR T.. Or basistape)ReturnType
|
||||
*
|
||||
* @param method method or constructor
|
||||
* @param isConstructor true if constructor
|
||||
*/
|
||||
private void createSignatureForConsOrMethod(Method method, boolean isConstructor) {
|
||||
Iterator<? extends GenericTypeVar> itr = method.getGenerics().iterator();
|
||||
// visits all formal type parameter and visits their bounds <T:...;B:...;...>
|
||||
while(itr.hasNext()) {
|
||||
GenericTypeVar g = itr.next();
|
||||
getBoundsOfTypeVar(g,genericsAndBoundsMethod);
|
||||
}
|
||||
|
||||
// Wenn die RückgabeType eine TPH ist, wird als generic behandelt
|
||||
// z.B: Type = TPH K => wird eine Formal Type Parameter K$ erzeugt und Bound = Object
|
||||
if(!isConstructor) {
|
||||
String ret = resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToSignature());
|
||||
System.out.println("RET:::: " + ret);
|
||||
if(!ret.equals("V")) {
|
||||
// TODO TypeToSignature nochmal kontrollieren und schauen ob man dort wirklich
|
||||
// T... braucht und L ...
|
||||
if(ret.contains("$") && !ret.contains("$$")) {
|
||||
// String g = ret.substring(4,ret.length())+"$";
|
||||
if(genericsAndBounds.containsKey(ret)) {
|
||||
genericsAndBoundsMethod.put(ret.substring(1), genericsAndBounds.get(ret.substring(1)));
|
||||
}else {
|
||||
sw.visitFormalTypeParameter(ret.substring(1));
|
||||
sw.visitClassBound().visitClassType(Type.getInternalName(Object.class));
|
||||
genericsAndBoundsMethod.put(ret.substring(1), Type.getInternalName(Object.class));
|
||||
sw.visitClassBound().visitEnd();
|
||||
}
|
||||
}
|
||||
|
||||
if(ret.contains("<")) {
|
||||
RefType ref = (RefType) resultSet.resolveType(method.getReturnType()).resolvedType;
|
||||
if(hasTPHs(ref)) {
|
||||
createSignatureForParameterizedType(ref);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Parameters
|
||||
for(String paramName : methodParamsAndTypes.keySet()) {
|
||||
RefTypeOrTPHOrWildcardOrGeneric t = methodParamsAndTypes.get(paramName);
|
||||
String pT = t.acceptTV(new TypeToSignature());
|
||||
// S.o
|
||||
// if(pT.substring(0,4).equals("TPH ")) {
|
||||
if(t instanceof TypePlaceholder) {
|
||||
// String gP = pT.substring(4,pT.length())+"$";
|
||||
String gP = t.acceptTV(new TypeToSignature());
|
||||
if(!genericsAndBounds.containsKey(gP.substring(1)) && !genericsAndBoundsMethod.containsKey(gP.substring(1))) {
|
||||
sw.visitFormalTypeParameter(gP.substring(1));
|
||||
String bound = Type.getInternalName(Object.class);
|
||||
boolean isTypeVar = false;
|
||||
for(GenericInsertPair pair : methodPairs) {
|
||||
if(pT.substring(1,pT.length()-1).equals(pair.TA1.getName())) {
|
||||
bound = pair.TA2.getName()+"$";
|
||||
isTypeVar = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(isTypeVar) {
|
||||
sw.visitClassBound().visitTypeVariable(bound);
|
||||
}else {
|
||||
sw.visitClassBound().visitClassType(bound);
|
||||
sw.visitClassBound().visitEnd();
|
||||
}
|
||||
|
||||
genericsAndBoundsMethod.put(gP.substring(1), bound);
|
||||
}
|
||||
}
|
||||
|
||||
if(pT.contains("<")) {
|
||||
RefType ref = (RefType) methodParamsAndTypes.get(paramName);
|
||||
if(hasTPHs(ref))
|
||||
createSignatureForParameterizedType(ref);
|
||||
}
|
||||
|
||||
for(GenericInsertPair p:methodPairs) {
|
||||
String name = p.TA1.getName()+"$";
|
||||
if(!genericsAndBoundsMethod.containsKey(name)) {
|
||||
sw.visitFormalTypeParameter(name);
|
||||
sw.visitClassBound().visitTypeVariable(p.TA2.getName()+"$");
|
||||
genericsAndBoundsMethod.put(name, p.TA2.getName()+"$");
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<TypePlaceholder> types = new ArrayList<>();
|
||||
ArrayList<TypePlaceholder> superTypes = new ArrayList<>();
|
||||
|
||||
for(GenericInsertPair p : methodPairs) {
|
||||
types.add(p.TA1);
|
||||
superTypes.add(p.TA2);
|
||||
}
|
||||
|
||||
for(GenericInsertPair p : methodPairs) {
|
||||
String name = p.TA2.getName()+"$";
|
||||
if(!types.contains(p.TA2) && !genericsAndBoundsMethod.containsKey(name)) {
|
||||
String bound = Type.getInternalName(Object.class);
|
||||
sw.visitFormalTypeParameter(name);
|
||||
sw.visitClassBound().visitClassType(bound);
|
||||
genericsAndBoundsMethod.put(name, bound);
|
||||
sw.visitClassBound().visitEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// visit each method-parameter to create the signature
|
||||
for(String paramName : methodParamsAndTypes.keySet()) {
|
||||
RefTypeOrTPHOrWildcardOrGeneric t = methodParamsAndTypes.get(paramName);
|
||||
// parameter type deswegen ist true
|
||||
doVisitParamsOrReturn(t,true);
|
||||
}
|
||||
if(isConstructor ||
|
||||
resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToSignature()).equals("V")) {
|
||||
sw.visitReturnType().visitBaseType('V');
|
||||
}else {
|
||||
RefTypeOrTPHOrWildcardOrGeneric returnType = method.getReturnType();
|
||||
// return type deswegen ist false
|
||||
doVisitParamsOrReturn(returnType, false);
|
||||
}
|
||||
// sw.visitEnd();
|
||||
}
|
||||
|
||||
private void createSignatureForParameterizedType(RefType ref) {
|
||||
ArrayList<GenericInsertPair> allPairs = getAllPairs(ref);
|
||||
allPairs.addAll(methodPairs);
|
||||
ArrayList<GenericInsertPair> simplifiedPairs = simplifyPairs(allPairs);
|
||||
|
||||
HashMap<String, String> names = new HashMap<>();
|
||||
|
||||
for(GenericInsertPair pair : simplifiedPairs) {
|
||||
if(ref.getParaList().contains(pair.TA1)) {
|
||||
String sub = pair.TA1.getName()+"$";
|
||||
String superT = pair.TA2.getName()+"$";
|
||||
names.put(sub, superT);
|
||||
}
|
||||
}
|
||||
|
||||
for(String sub : names.keySet()) {
|
||||
if(!genericsAndBoundsMethod.containsKey(sub) && !genericsAndBounds.containsKey(sub)) {
|
||||
sw.visitFormalTypeParameter(sub);
|
||||
String bound = names.get(sub);
|
||||
sw.visitClassBound().visitTypeVariable(bound);
|
||||
genericsAndBoundsMethod.put(sub, bound);
|
||||
}
|
||||
}
|
||||
|
||||
for(String superT : names.values()) {
|
||||
if(!names.containsKey(superT)) {
|
||||
if(!genericsAndBoundsMethod.containsKey(superT) && !genericsAndBounds.containsKey(superT)) {
|
||||
sw.visitFormalTypeParameter(superT);
|
||||
sw.visitClassBound().visitClassType(Type.getInternalName(Object.class));
|
||||
sw.visitClassBound().visitEnd();
|
||||
genericsAndBoundsMethod.put(superT, Type.getInternalName(Object.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(RefTypeOrTPHOrWildcardOrGeneric p: ref.getParaList()) {
|
||||
if(p instanceof TypePlaceholder) {
|
||||
String name = ((TypePlaceholder) p).getName() + "$";
|
||||
if(!genericsAndBoundsMethod.containsKey(name) && !genericsAndBounds.containsKey(name)) {
|
||||
sw.visitFormalTypeParameter(name);
|
||||
sw.visitClassBound().visitClassType(Type.getInternalName(Object.class));
|
||||
sw.visitClassBound().visitEnd();
|
||||
genericsAndBoundsMethod.put(name, Type.getInternalName(Object.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayList<GenericInsertPair> getAllPairs(RefType ref) {
|
||||
final ArrayList<GenericInsertPair> res = new ArrayList<>();
|
||||
for(RefTypeOrTPHOrWildcardOrGeneric p : ref.getParaList()) {
|
||||
RefTypeOrTPHOrWildcardOrGeneric resolved = resultSet.resolveType(p).resolvedType;
|
||||
if(resolved instanceof TypePlaceholder) {
|
||||
resultSet.resolveType(p).additionalGenerics.forEach(ag ->{
|
||||
if(!contains(res,ag)) {
|
||||
res.add(ag);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private boolean contains(ArrayList<GenericInsertPair> pairs, GenericInsertPair genPair) {
|
||||
for(int i=0; i<pairs.size();++i) {
|
||||
GenericInsertPair p = pairs.get(i);
|
||||
if(p.TA1.equals(genPair.TA1) && p.TA2.equals(genPair.TA2))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private ArrayList<GenericInsertPair> simplifyPairs(ArrayList<GenericInsertPair> allPairs) {
|
||||
ArrayList<GenericInsertPair> simplifiedPairs = new ArrayList<>();
|
||||
|
||||
HashMap<TypePlaceholder, TypePlaceholder> subAndSuperTph = new HashMap<>();
|
||||
for(GenericInsertPair p : allPairs) {
|
||||
subAndSuperTph.put(p.TA1, p.TA2);
|
||||
}
|
||||
|
||||
subAndSuperTph.forEach((k,v)->System.out.println(k.getName() + " || " + v.getName()));
|
||||
|
||||
int numOfVisitedPairs = 0;
|
||||
for(TypePlaceholder subTph: subAndSuperTph.keySet()) {
|
||||
|
||||
if(numOfVisitedPairs>=subAndSuperTph.size())
|
||||
break;
|
||||
|
||||
HashMap<Integer, TypePlaceholder> tphsInRel= new HashMap<>();
|
||||
|
||||
tphsInRel.put(tphsInRel.size(), subTph);
|
||||
TypePlaceholder superTph = subAndSuperTph.get(subTph);
|
||||
tphsInRel.put(tphsInRel.size(), superTph);
|
||||
|
||||
numOfVisitedPairs++;
|
||||
|
||||
while(subAndSuperTph.containsKey(superTph)) {
|
||||
superTph = subAndSuperTph.get(superTph);
|
||||
tphsInRel.put(tphsInRel.size(), superTph);
|
||||
numOfVisitedPairs++;
|
||||
}
|
||||
|
||||
// Subtype
|
||||
TypePlaceholder subTphRes = tphsInRel.get(0);
|
||||
// Die größte Supertype
|
||||
TypePlaceholder superTphRes = tphsInRel.get(tphsInRel.size()-1);
|
||||
|
||||
|
||||
while(subAndSuperTph.containsValue(subTphRes)) {
|
||||
for(TypePlaceholder tph : subAndSuperTph.keySet()) {
|
||||
if(subAndSuperTph.get(tph).equals(subTphRes)) {
|
||||
subTphRes = tph;
|
||||
break;
|
||||
}
|
||||
}
|
||||
tphsInRel.put(0, subTphRes);
|
||||
numOfVisitedPairs++;
|
||||
}
|
||||
|
||||
subTphRes = tphsInRel.get(0);
|
||||
GenericInsertPair sPair = new GenericInsertPair(subTphRes, superTphRes);
|
||||
simplifiedPairs.add(sPair);
|
||||
}
|
||||
return simplifiedPairs;
|
||||
}
|
||||
|
||||
private boolean hasTPHs(RefType ref) {
|
||||
for(RefTypeOrTPHOrWildcardOrGeneric p : ref.getParaList()) {
|
||||
System.out.println(p.acceptTV(new TypeToString()));
|
||||
if(p.acceptTV(new TypeToString()).contains("WC")){
|
||||
continue;
|
||||
}
|
||||
if(resultSet.resolveType(p).resolvedType instanceof TypePlaceholder)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Visits parameter type or return type with {@link SignatureVisitor} to create
|
||||
* the method signature
|
||||
* @param t type of parameter or return type
|
||||
* @param isParameterType true if t is type of parameter
|
||||
*/
|
||||
private void doVisitParamsOrReturn(RefTypeOrTPHOrWildcardOrGeneric t, boolean isParameterType) {
|
||||
String type = t.acceptTV(new TypeToString());
|
||||
SignatureVisitor sv;
|
||||
if(isParameterType) {
|
||||
sv = sw.visitParameterType();
|
||||
}
|
||||
else {
|
||||
sv = sw.visitReturnType();
|
||||
}
|
||||
switch (type) {
|
||||
case "RT":
|
||||
String sig = t.acceptTV(new TypeToSignature());
|
||||
sv.visitClassType(sig.substring(1, sig.length()));
|
||||
break;
|
||||
case "GRT":
|
||||
GenericRefType g = (GenericRefType) t;
|
||||
sv.visitTypeVariable(g.acceptTV(new TypeToSignature()).substring(1));
|
||||
break;
|
||||
case "TPH":
|
||||
RefTypeOrTPHOrWildcardOrGeneric r = resultSet.resolveType(t).resolvedType;
|
||||
// der Fall wenn die Type eine Interface ist, muss betrachtet werden
|
||||
// Deswegen muss in ResutSet noch enthalten werden, ob die Type eine
|
||||
// Interface oder eine Klasse ist.
|
||||
|
||||
// das braucht man nicht es reicht: sv.visitTypeVariable(r.acceptTV(new TypeToSignature())
|
||||
//
|
||||
// if(!r.acceptTV(new TypeToSignature()).substring(0, 4).equals("TPH ")) {
|
||||
String sig2 = r.acceptTV(new TypeToSignature());
|
||||
if(!(r instanceof TypePlaceholder)) {
|
||||
|
||||
// sv.visitInterface().visitClassType(r.acceptTV(new TypeToSignature()));
|
||||
// sv.visitClassType(r.acceptTV(new TypeToSignature()));
|
||||
sv.visitClassType(sig2.substring(1, sig2.length()));
|
||||
} else {
|
||||
System.out.println(r.getClass()+" Signature TPH: "+r.acceptTV(new TypeToSignature()));
|
||||
// sv.visitTypeVariable(r.acceptTV(new TypeToSignature()).substring(4)+"$");
|
||||
sv.visitTypeVariable(sig2.substring(1, sig2.length()));
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
if(!isParameterType)
|
||||
sv.visitBaseType('V');
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Creates signature for class or interface with {@link SignatureWriter}
|
||||
* Signature looks like:
|
||||
* <typevaliables (K:Ljava/lang/Object "Bounds")>superclass
|
||||
*/
|
||||
private void createSignatureForClassOrInterface() {
|
||||
Iterator<GenericTypeVar> itr = classOrInterface.getGenerics().iterator();
|
||||
|
||||
while(itr.hasNext()) {
|
||||
GenericTypeVar g = itr.next();
|
||||
getBoundsOfTypeVar(g,genericsAndBounds);
|
||||
}
|
||||
if(!commonPairs.isEmpty()) {
|
||||
ArrayList<TypePlaceholder> types = new ArrayList<>();
|
||||
ArrayList<TypePlaceholder> superTypes = new ArrayList<>();
|
||||
|
||||
for(GenericInsertPair p : commonPairs) {
|
||||
types.add(p.TA1);
|
||||
superTypes.add(p.TA2);
|
||||
}
|
||||
|
||||
for(GenericInsertPair p : commonPairs) {
|
||||
String t = p.TA1.getName()+"$";
|
||||
String bound = p.TA2.getName()+"$";
|
||||
sw.visitFormalTypeParameter(t);
|
||||
sw.visitClassBound().visitTypeVariable(bound);
|
||||
genericsAndBounds.put(t, bound);
|
||||
}
|
||||
|
||||
for(GenericInsertPair p : commonPairs) {
|
||||
if(!types.contains(p.TA2)) {
|
||||
String t = p.TA2.getName()+"$";
|
||||
String bound = Type.getInternalName(Object.class);
|
||||
sw.visitFormalTypeParameter(t);
|
||||
sw.visitClassBound().visitClassType(bound);
|
||||
genericsAndBounds.put(t, bound);
|
||||
sw.visitClassBound().visitEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
String sClass = classOrInterface.getSuperClass().acceptTV(new TypeToSignature());
|
||||
sw.visitSuperclass().visitClassType(sClass.substring(1, sClass.length()-1));
|
||||
sw.visitEnd();
|
||||
}
|
||||
/**
|
||||
* Get bounds of type variable
|
||||
* @param g type variable
|
||||
* @param genAndBounds
|
||||
*/
|
||||
private void getBoundsOfTypeVar(GenericTypeVar g, HashMap<String, String> genAndBounds) {
|
||||
sw.visitFormalTypeParameter(g.getName());
|
||||
|
||||
Iterator<? extends RefTypeOrTPHOrWildcardOrGeneric> bItr = g.getBounds().iterator();
|
||||
while(bItr.hasNext()) {
|
||||
RefTypeOrTPHOrWildcardOrGeneric b =bItr.next();
|
||||
String boundDesc = b.acceptTV(new TypeToDescriptor());
|
||||
// System.out.println("GetBounds: " + boundDesc);
|
||||
// Ensure that <...> extends java.lang.Object OR ...
|
||||
sw.visitClassBound().visitClassType(boundDesc);
|
||||
genAndBounds.put(g.getName(), boundDesc);
|
||||
}
|
||||
sw.visitClassBound().visitEnd();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return sw.toString();
|
||||
}
|
||||
|
||||
}
|
69
src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java
Normal file
69
src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java
Normal file
@ -0,0 +1,69 @@
|
||||
package de.dhbwstuttgart.bytecode.signature;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypeVisitor;
|
||||
|
||||
public class TypeToSignature implements TypeVisitor<String> {
|
||||
|
||||
@Override
|
||||
public String visit(RefType refType) {
|
||||
if(refType.getName().toString().equals("void"))
|
||||
return "V";
|
||||
// return refType.toString().replace(".", "/");
|
||||
String params = "";
|
||||
if(refType.getParaList().size()>0){
|
||||
params += "<";
|
||||
Iterator<RefTypeOrTPHOrWildcardOrGeneric> it = refType.getParaList().iterator();
|
||||
while(it.hasNext()){
|
||||
RefTypeOrTPHOrWildcardOrGeneric param = it.next();
|
||||
// if(param instanceof TypePlaceholder) {
|
||||
// params += "T" + ((TypePlaceholder) param).getName() + "$";
|
||||
// } else if(param instanceof ExtendsWildcardType) {
|
||||
// params += "+" + ((ExtendsWildcardType) param).getInnerType().acceptTV(new TypeToSignature());
|
||||
// } else if(param instanceof SuperWildcardType) {
|
||||
// params += "-" + ((SuperWildcardType) param).getInnerType().acceptTV(new TypeToSignature());
|
||||
// } else {
|
||||
// params += "L"+param.toString().replace(".", "/");
|
||||
// }
|
||||
params += param.acceptTV(new TypeToSignature());
|
||||
// if(it.hasNext())params += ";";
|
||||
}
|
||||
params += ">";
|
||||
}
|
||||
// String t = refType.getName().toString().replace(".", "/");
|
||||
// return t.equals("Fun1")?t+"$$"+params+";":t+params+";";
|
||||
return "L"+refType.getName().toString().replace(".", "/") + params+";";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(SuperWildcardType superWildcardType) {
|
||||
// throw new NotImplementedException();
|
||||
return "-" + superWildcardType.getInnerType().acceptTV(new TypeToSignature());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(TypePlaceholder typePlaceholder) {
|
||||
// return typePlaceholder.toString().replace(".", "/");
|
||||
return "T" + typePlaceholder.getName() + "$";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(ExtendsWildcardType extendsWildcardType) {
|
||||
// throw new NotImplementedException();
|
||||
return "+" + extendsWildcardType.getInnerType().acceptTV(new TypeToSignature());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(GenericRefType genericRefType) {
|
||||
return genericRefType.getParsedName().replace(".", "/");
|
||||
}
|
||||
|
||||
}
|
38
src/de/dhbwstuttgart/bytecode/signature/TypeToString.java
Normal file
38
src/de/dhbwstuttgart/bytecode/signature/TypeToString.java
Normal file
@ -0,0 +1,38 @@
|
||||
package de.dhbwstuttgart.bytecode.signature;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypeVisitor;
|
||||
|
||||
public class TypeToString implements TypeVisitor<String>{
|
||||
|
||||
@Override
|
||||
public String visit(RefType refType) {
|
||||
return "RT";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(SuperWildcardType superWildcardType) {
|
||||
return "SWC";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(TypePlaceholder typePlaceholder) {
|
||||
return "TPH";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(ExtendsWildcardType extendsWildcardType) {
|
||||
return "EWC";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(GenericRefType genericRefType) {
|
||||
return "GRT";
|
||||
}
|
||||
|
||||
}
|
198
src/de/dhbwstuttgart/bytecode/utilities/KindOfLambda.java
Normal file
198
src/de/dhbwstuttgart/bytecode/utilities/KindOfLambda.java
Normal file
@ -0,0 +1,198 @@
|
||||
package de.dhbwstuttgart.bytecode.utilities;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
|
||||
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Literal;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
|
||||
public class KindOfLambda implements StatementVisitor{
|
||||
private boolean isInstanceCapturingLambda = false;
|
||||
private List<RefTypeOrTPHOrWildcardOrGeneric> argumentList = new ArrayList<>();
|
||||
|
||||
public KindOfLambda(LambdaExpression lambdaExpression) {
|
||||
lambdaExpression.methodBody.accept(this);
|
||||
|
||||
}
|
||||
|
||||
public boolean isInstanceCapturingLambda() {
|
||||
return this.isInstanceCapturingLambda;
|
||||
}
|
||||
|
||||
public List<RefTypeOrTPHOrWildcardOrGeneric> getArgumentList() {
|
||||
return argumentList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(ArgumentList argumentList) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(LambdaExpression lambdaExpression) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Assign assign) {
|
||||
assign.rightSide.accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(BinaryExpr binary) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Block block) {
|
||||
for(Statement stmt : block.getStatements()) {
|
||||
stmt.accept(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(CastExpr castExpr) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(EmptyStmt emptyStmt) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(FieldVar fieldVar) {
|
||||
fieldVar.receiver.accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(ForStmt forStmt) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(IfStmt ifStmt) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(InstanceOf instanceOf) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(LocalVar localVar) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(LocalVarDecl localVarDecl) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(MethodCall methodCall) {
|
||||
methodCall.receiver.accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(NewClass methodCall) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(NewArray newArray) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(ExpressionReceiver receiver) {
|
||||
receiver.expr.accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(UnaryExpr unaryExpr) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Return aReturn) {
|
||||
aReturn.retexpr.accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(ReturnVoid aReturn) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(StaticClassName staticClassName) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Super aSuper) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(This aThis) {
|
||||
this.isInstanceCapturingLambda = true;
|
||||
this.argumentList.add(aThis.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(WhileStmt whileStmt) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(DoStmt whileStmt) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Literal literal) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(AssignToField assignLeftSide) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(AssignToLocal assignLeftSide) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(SuperCall superCall) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
26
src/de/dhbwstuttgart/bytecode/utilities/Lambda.java
Normal file
26
src/de/dhbwstuttgart/bytecode/utilities/Lambda.java
Normal file
@ -0,0 +1,26 @@
|
||||
package de.dhbwstuttgart.bytecode.utilities;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.descriptor.DescriptorVisitor;
|
||||
import de.dhbwstuttgart.syntaxtree.ParameterList;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.LambdaExpression;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
|
||||
public class Lambda {
|
||||
private LambdaExpression lambdaExpression;
|
||||
|
||||
public Lambda(LambdaExpression lambdaExpression) {
|
||||
this.lambdaExpression = lambdaExpression;
|
||||
}
|
||||
|
||||
public ParameterList getParams() {
|
||||
return lambdaExpression.params;
|
||||
}
|
||||
|
||||
public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
|
||||
return lambdaExpression.getReturnType();
|
||||
}
|
||||
|
||||
public String accept(DescriptorVisitor descVisitor) {
|
||||
return descVisitor.visit(this);
|
||||
}
|
||||
}
|
29
src/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java
Normal file
29
src/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java
Normal file
@ -0,0 +1,29 @@
|
||||
package de.dhbwstuttgart.bytecode.utilities;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
import de.dhbwstuttgart.typeinference.result.GenericInsertPair;
|
||||
|
||||
public class MethodAndTPH {
|
||||
|
||||
private String name;
|
||||
private final ArrayList<TypePlaceholder> tphs = new ArrayList<>();
|
||||
private final ArrayList<GenericInsertPair> pairs = new ArrayList<>();
|
||||
|
||||
public MethodAndTPH(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public ArrayList<TypePlaceholder> getTphs() {
|
||||
return tphs;
|
||||
}
|
||||
|
||||
public ArrayList<GenericInsertPair> getPairs(){
|
||||
return pairs;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package de.dhbwstuttgart.bytecode.utilities;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.descriptor.DescriptorVisitor;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.ArgumentList;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
|
||||
public class MethodFromMethodCall {
|
||||
private ArgumentList argList;
|
||||
private RefTypeOrTPHOrWildcardOrGeneric returnType;
|
||||
private String receiverName;
|
||||
private HashMap<String, String> genericsAndBoundsMethod;
|
||||
private HashMap<String,String> genericsAndBounds;
|
||||
|
||||
public MethodFromMethodCall(ArgumentList argList,RefTypeOrTPHOrWildcardOrGeneric returnType,
|
||||
String receiverName, HashMap<String, String> genericsAndBoundsMethod,
|
||||
HashMap<String,String> genericsAndBounds) {
|
||||
this.argList = argList;
|
||||
this.returnType = returnType;
|
||||
this.receiverName = receiverName;
|
||||
this.genericsAndBoundsMethod = genericsAndBoundsMethod;
|
||||
this.genericsAndBounds = genericsAndBounds;
|
||||
}
|
||||
|
||||
public ArgumentList getArgList() {
|
||||
return argList;
|
||||
}
|
||||
|
||||
public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
|
||||
return returnType;
|
||||
}
|
||||
|
||||
public String getReceiverName() {
|
||||
return receiverName;
|
||||
}
|
||||
|
||||
public HashMap<String, String> getGenericsAndBoundsMethod(){
|
||||
return genericsAndBoundsMethod;
|
||||
}
|
||||
|
||||
public HashMap<String,String> getGenericsAndBounds(){
|
||||
return genericsAndBounds;
|
||||
}
|
||||
|
||||
public String accept(DescriptorVisitor descVisitor) {
|
||||
return descVisitor.visit(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package de.dhbwstuttgart.bytecode.utilities;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.descriptor.DescriptorVisitor;
|
||||
import de.dhbwstuttgart.syntaxtree.Constructor;
|
||||
import de.dhbwstuttgart.syntaxtree.ParameterList;
|
||||
|
||||
public class NormalConstructor {
|
||||
private Constructor constructor;
|
||||
private HashMap<String, String> genericsAndBounds;
|
||||
private boolean hasGenerics;
|
||||
|
||||
public NormalConstructor(Constructor constructor, boolean hasGenerics) {
|
||||
this.constructor = constructor;
|
||||
this.hasGenerics = hasGenerics;
|
||||
}
|
||||
|
||||
public NormalConstructor(Constructor constructor, HashMap<String, String> genericsAndBounds, boolean hasGenerics) {
|
||||
this.constructor = constructor;
|
||||
this.genericsAndBounds = genericsAndBounds;
|
||||
this.hasGenerics = hasGenerics;
|
||||
}
|
||||
|
||||
public HashMap<String, String> getGenericsAndBounds() {
|
||||
return genericsAndBounds;
|
||||
}
|
||||
|
||||
public boolean hasGen() {
|
||||
return hasGenerics;
|
||||
}
|
||||
|
||||
public ParameterList getParameterList() {
|
||||
return constructor.getParameterList();
|
||||
}
|
||||
|
||||
public String accept(DescriptorVisitor descVisitor) {
|
||||
return descVisitor.visit(this);
|
||||
}
|
||||
}
|
56
src/de/dhbwstuttgart/bytecode/utilities/NormalMethod.java
Normal file
56
src/de/dhbwstuttgart/bytecode/utilities/NormalMethod.java
Normal file
@ -0,0 +1,56 @@
|
||||
package de.dhbwstuttgart.bytecode.utilities;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.descriptor.DescriptorVisitor;
|
||||
import de.dhbwstuttgart.syntaxtree.Method;
|
||||
import de.dhbwstuttgart.syntaxtree.ParameterList;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
|
||||
public class NormalMethod {
|
||||
private Method method;
|
||||
private HashMap<String, String> genericsAndBounds;
|
||||
private HashMap<String, String> genericsAndBoundsMethod;
|
||||
private boolean hasGenerics;
|
||||
|
||||
public NormalMethod(Method method, boolean hasGenerics) {
|
||||
this.method = method;
|
||||
this.hasGenerics = hasGenerics;
|
||||
}
|
||||
|
||||
public NormalMethod(Method method, HashMap<String, String> genericsAndBounds,
|
||||
HashMap<String, String> genericsAndBoundsMethod,boolean hasGenerics) {
|
||||
this.method = method;
|
||||
this.genericsAndBounds = genericsAndBounds;
|
||||
this.genericsAndBoundsMethod = genericsAndBoundsMethod;
|
||||
this.hasGenerics = hasGenerics;
|
||||
}
|
||||
|
||||
public Method getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public ParameterList getParameterList() {
|
||||
return method.getParameterList();
|
||||
}
|
||||
|
||||
public HashMap<String, String> getGenericsAndBounds(){
|
||||
return genericsAndBounds;
|
||||
}
|
||||
|
||||
public HashMap<String, String> getGenericsAndBoundsMethod(){
|
||||
return genericsAndBoundsMethod;
|
||||
}
|
||||
|
||||
public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
|
||||
return method.getReturnType();
|
||||
}
|
||||
|
||||
public boolean hasGen() {
|
||||
return this.hasGenerics;
|
||||
}
|
||||
|
||||
public String accept(DescriptorVisitor descVisitor) {
|
||||
return descVisitor.visit(this);
|
||||
}
|
||||
}
|
32
src/de/dhbwstuttgart/bytecode/utilities/SamMethod.java
Normal file
32
src/de/dhbwstuttgart/bytecode/utilities/SamMethod.java
Normal file
@ -0,0 +1,32 @@
|
||||
package de.dhbwstuttgart.bytecode.utilities;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.descriptor.DescriptorVisitor;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
|
||||
public class SamMethod {
|
||||
private List<RefTypeOrTPHOrWildcardOrGeneric> argumentList;
|
||||
private RefTypeOrTPHOrWildcardOrGeneric returnType;
|
||||
|
||||
public SamMethod(List<RefTypeOrTPHOrWildcardOrGeneric> argumentList, RefTypeOrTPHOrWildcardOrGeneric returnType) {
|
||||
this.argumentList = argumentList;
|
||||
this.returnType = returnType;
|
||||
}
|
||||
|
||||
public List<RefTypeOrTPHOrWildcardOrGeneric> getArgumentList() {
|
||||
return argumentList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
|
||||
return returnType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String accept(DescriptorVisitor descVisitor) {
|
||||
return descVisitor.visit(this);
|
||||
}
|
||||
}
|
@ -1,92 +1,259 @@
|
||||
package de.dhbwstuttgart.core;
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.BytecodeGen;
|
||||
import de.dhbwstuttgart.environment.CompilationEnvironment;
|
||||
import de.dhbwstuttgart.parser.JavaTXParser;
|
||||
import de.dhbwstuttgart.parser.NullToken;
|
||||
import de.dhbwstuttgart.parser.scope.GenericsRegistry;
|
||||
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.SyntaxTreeGenerator;
|
||||
import de.dhbwstuttgart.parser.antlr.Java8Parser.CompilationUnitContext;
|
||||
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
||||
import de.dhbwstuttgart.parser.scope.JavaClassRegistry;
|
||||
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
|
||||
import de.dhbwstuttgart.syntaxtree.ParameterList;
|
||||
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
||||
import de.dhbwstuttgart.syntaxtree.factory.ASTFactory;
|
||||
import de.dhbwstuttgart.syntaxtree.factory.UnifyTypeFactory;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
|
||||
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.RuleSet;
|
||||
import de.dhbwstuttgart.typeinference.unify.TypeUnify;
|
||||
import de.dhbwstuttgart.typeinference.unify.TypeUnifyTask;
|
||||
import de.dhbwstuttgart.typeinference.unify.distributeVariance;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.FiniteClosure;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.PlaceholderType;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.UnifyPair;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class JavaTXCompiler {
|
||||
|
||||
final CompilationEnvironment environment;
|
||||
final boolean parallel = true;
|
||||
final CompilationEnvironment environment;
|
||||
public final Map<File, SourceFile> sourceFiles = new HashMap<>();
|
||||
Boolean log = true; //gibt an ob ein Log-File nach System.getProperty("user.dir")+"/test/logFiles/log" geschrieben werden soll?
|
||||
|
||||
public JavaTXCompiler(File sourceFile) throws IOException, ClassNotFoundException {
|
||||
this(Arrays.asList(sourceFile));
|
||||
}
|
||||
|
||||
public JavaTXCompiler(File sourceFile, Boolean log) throws IOException, ClassNotFoundException {
|
||||
this(sourceFile);
|
||||
this.log = log;
|
||||
}
|
||||
|
||||
public JavaTXCompiler(List<File> sources) throws IOException, ClassNotFoundException {
|
||||
environment = new CompilationEnvironment(sources);
|
||||
for(File s : sources){
|
||||
sourceFiles.put(s,parse(s));
|
||||
for (File s : sources) {
|
||||
sourceFiles.put(s, parse(s));
|
||||
}
|
||||
}
|
||||
|
||||
public List<ResultSet> typeInference() throws ClassNotFoundException {
|
||||
public ConstraintSet<Pair> getConstraints() throws ClassNotFoundException {
|
||||
List<ClassOrInterface> allClasses = new ArrayList<>();//environment.getAllAvailableClasses();
|
||||
for(SourceFile sf : sourceFiles.values()){
|
||||
for (SourceFile sf : sourceFiles.values()) {
|
||||
allClasses.addAll(sf.getClasses());
|
||||
}
|
||||
List<ClassOrInterface> importedClasses = new ArrayList<>();
|
||||
//Alle Importierten Klassen in allen geparsten Sourcefiles kommen ins FC
|
||||
for(File forSourceFile : sourceFiles.keySet())
|
||||
for(JavaClassName name : sourceFiles.get(forSourceFile).getImports()){
|
||||
for (File forSourceFile : sourceFiles.keySet())
|
||||
for (JavaClassName name : sourceFiles.get(forSourceFile).getImports()) {
|
||||
//TODO: Hier werden imports von eigenen (.jav) Klassen nicht beachtet
|
||||
ClassOrInterface importedClass = ASTFactory.createClass(
|
||||
ClassLoader.getSystemClassLoader().loadClass(name.toString()));
|
||||
importedClasses.add(importedClass);
|
||||
}
|
||||
allClasses.addAll(importedClasses);
|
||||
FiniteClosure finiteClosure = UnifyTypeFactory.generateFC(allClasses);
|
||||
|
||||
final ConstraintSet<Pair> cons = new TYPE(sourceFiles.values(), allClasses).getConstraints();
|
||||
return new TYPE(sourceFiles.values(), allClasses).getConstraints();
|
||||
}
|
||||
|
||||
public List<ClassOrInterface> getAvailableClasses(SourceFile forSourceFile) throws ClassNotFoundException {
|
||||
List<ClassOrInterface> allClasses = new ArrayList<>();//environment.getAllAvailableClasses();
|
||||
for (SourceFile sf : sourceFiles.values()) {
|
||||
allClasses.addAll(sf.getClasses());
|
||||
}
|
||||
List<ClassOrInterface> importedClasses = new ArrayList<>();
|
||||
for (JavaClassName name : forSourceFile.getImports()) {
|
||||
//TODO: Hier werden imports von eigenen (.jav) Klassen nicht beachtet
|
||||
ClassOrInterface importedClass = ASTFactory.createClass(
|
||||
ClassLoader.getSystemClassLoader().loadClass(name.toString()));
|
||||
importedClasses.add(importedClass);
|
||||
allClasses.addAll(importedClasses);
|
||||
}
|
||||
return allClasses;
|
||||
}
|
||||
|
||||
public List<ResultSet> typeInference() throws ClassNotFoundException {
|
||||
List<ClassOrInterface> allClasses = new ArrayList<>();//environment.getAllAvailableClasses();
|
||||
//Alle Importierten Klassen in allen geparsten Sourcefiles kommen ins FC
|
||||
for(SourceFile sf : this.sourceFiles.values()) {
|
||||
allClasses.addAll(getAvailableClasses(sf));
|
||||
allClasses.addAll(sf.getClasses());
|
||||
}
|
||||
|
||||
final ConstraintSet<Pair> cons = getConstraints();
|
||||
|
||||
FiniteClosure finiteClosure = UnifyTypeFactory.generateFC(allClasses);
|
||||
System.out.println(finiteClosure);
|
||||
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);
|
||||
try {
|
||||
FileWriter logFile = new FileWriter(new File(System.getProperty("user.dir")+"/test/logFiles/"+"log"));
|
||||
logFile.write("FC:\\" + finiteClosure.toString()+"\n");
|
||||
for(SourceFile sf : this.sourceFiles.values()) {
|
||||
logFile.write(ASTTypePrinter.print(sf));
|
||||
}
|
||||
logFile.flush();
|
||||
Set<TypeUnifyTask> forks = new HashSet<>();
|
||||
Set<List<Constraint<UnifyPair>>> cardProd = unifyCons.cartesianProduct();
|
||||
for (List<Constraint<UnifyPair>> xCons : cardProd ){
|
||||
Set<UnifyPair> xConsSet = new HashSet<>();
|
||||
for (Constraint<UnifyPair> constraint : xCons) {
|
||||
xConsSet.addAll(constraint);
|
||||
}
|
||||
//.collect(Collectors.toCollection(ArrayList::new))))
|
||||
System.out.println(xConsSet);
|
||||
Set<String> paraTypeVarNames = allClasses.stream().map(x -> x.getMethods().stream().map(y -> y.getParameterList().getFormalparalist()
|
||||
.stream().filter(z -> z.getType() instanceof TypePlaceholder)
|
||||
.map(z -> ((TypePlaceholder)z.getType()).getName()).collect(Collectors.toCollection(HashSet::new)))
|
||||
.reduce(new HashSet<String>(), (a,b) -> { a.addAll(b); return a;}, (a,b) -> { a.addAll(b); return a;} ) )
|
||||
.reduce(new HashSet<String>(), (a,b) -> { a.addAll(b); return a;} );
|
||||
|
||||
Set<String> returnTypeVarNames = allClasses.stream().map(x -> x.getMethods().stream().filter(y -> y.getReturnType() instanceof TypePlaceholder)
|
||||
.map(z -> ((TypePlaceholder)z.getReturnType()).getName()).collect(Collectors.toCollection(HashSet::new))).reduce((a,b) -> { a.addAll(b); return a;} ).get();
|
||||
|
||||
|
||||
xConsSet = xConsSet.stream().map(x -> {
|
||||
//Hier muss ueberlegt werden, ob
|
||||
//1. alle Argument- und Retuntyp-Variablen in allen UnifyPairs
|
||||
// mit disableWildcardtable() werden.
|
||||
//2. alle Typvariablen mit Argument- oder Retuntyp-Variablen
|
||||
//in Beziehung auch auf disableWildcardtable() gesetzt werden muessen
|
||||
//PL 2018-04-23
|
||||
if ((x.getLhsType() instanceof PlaceholderType)) {
|
||||
if (paraTypeVarNames.contains(x.getLhsType().getName())) {
|
||||
((PlaceholderType)x.getLhsType()).setVariance((byte)1);
|
||||
((PlaceholderType)x.getLhsType()).disableWildcardtable();
|
||||
}
|
||||
if (returnTypeVarNames.contains(x.getLhsType().getName())) {
|
||||
((PlaceholderType)x.getLhsType()).setVariance((byte)-1);
|
||||
((PlaceholderType)x.getLhsType()).disableWildcardtable();
|
||||
}
|
||||
}
|
||||
if ((x.getRhsType() instanceof PlaceholderType)) {
|
||||
if (paraTypeVarNames.contains(x.getRhsType().getName())) {
|
||||
((PlaceholderType)x.getRhsType()).setVariance((byte)1);
|
||||
((PlaceholderType)x.getRhsType()).disableWildcardtable();
|
||||
}
|
||||
if (returnTypeVarNames.contains(x.getRhsType().getName())) {
|
||||
((PlaceholderType)x.getRhsType()).setVariance((byte)-1);
|
||||
((PlaceholderType)x.getRhsType()).disableWildcardtable();
|
||||
}
|
||||
}
|
||||
return x;//HIER DIE JEWEILS RECHT BZW. LINKE SEITE AUF GLEICHE VARIANZ SETZEN WIE DIE JEWEILS ANDERE SEITE
|
||||
}).map( y -> {
|
||||
if ((y.getLhsType() instanceof PlaceholderType) && (y.getRhsType() instanceof PlaceholderType)) {
|
||||
if (((PlaceholderType)y.getLhsType()).getVariance() != 0 && ((PlaceholderType)y.getRhsType()).getVariance() == 0) {
|
||||
((PlaceholderType)y.getRhsType()).setVariance(((PlaceholderType)y.getLhsType()).getVariance());
|
||||
}
|
||||
if (((PlaceholderType)y.getLhsType()).getVariance() == 0 && ((PlaceholderType)y.getRhsType()).getVariance() != 0) {
|
||||
((PlaceholderType)y.getLhsType()).setVariance(((PlaceholderType)y.getRhsType()).getVariance());
|
||||
}
|
||||
}
|
||||
return y; } )
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
varianceInheritance(xConsSet);
|
||||
if (parallel) {
|
||||
//Set<Set<UnifyPair>> result = unify.unifySequential(xConsSet, finiteClosure, logFile, log);
|
||||
Set<UnifyPair> eq = new HashSet<>(xConsSet);
|
||||
TypeUnifyTask fork = new TypeUnifyTask(eq, finiteClosure, true, logFile, log);
|
||||
forks.add(fork);
|
||||
fork.fork();
|
||||
}
|
||||
else {
|
||||
Set<Set<UnifyPair>> result = unify.unifySequential(xConsSet, finiteClosure, logFile, log);
|
||||
System.out.println("RESULT: " + result);
|
||||
logFile.write("RES: " + result.toString()+"\n");
|
||||
logFile.flush();
|
||||
results.addAll(result);
|
||||
}
|
||||
}
|
||||
for (TypeUnifyTask fork : forks) {
|
||||
try {
|
||||
Set<Set<UnifyPair>> result = fork.join();
|
||||
System.out.println("RESULT: " + result);
|
||||
logFile.write("RES: " + result.toString()+"\n");
|
||||
logFile.flush();
|
||||
results.addAll(result);
|
||||
}
|
||||
catch (ConcurrentModificationException v) {
|
||||
v.printStackTrace();
|
||||
while (v.getCause() instanceof ConcurrentModificationException) {
|
||||
v = (ConcurrentModificationException)v.getCause();
|
||||
}
|
||||
System.out.println(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
return results.stream().map((unifyPairs ->
|
||||
new ResultSet(UnifyTypeFactory.convert(unifyPairs, generateTPHMap(cons))))).collect(Collectors.toList());
|
||||
catch (IOException e) { }
|
||||
|
||||
return results.stream().map((unifyPairs ->
|
||||
new ResultSet(UnifyTypeFactory.convert(unifyPairs, generateTPHMap(cons))))).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Vererbt alle Variancen
|
||||
* @param eq The set of constraints
|
||||
*/
|
||||
private void varianceInheritance(Set<UnifyPair> eq) {
|
||||
Set<PlaceholderType> usedTPH = new HashSet<>();
|
||||
Set<PlaceholderType> phSet = eq.stream().map(x -> {
|
||||
Set<PlaceholderType> pair = new HashSet<>();
|
||||
if (x.getLhsType() instanceof PlaceholderType) pair.add((PlaceholderType)x.getLhsType());
|
||||
if (x.getRhsType() instanceof PlaceholderType) pair.add((PlaceholderType)x.getRhsType());
|
||||
return pair;
|
||||
}).reduce(new HashSet<>(), (a,b) -> { a.addAll(b); return a;} , (c,d) -> { c.addAll(d); return c;});
|
||||
|
||||
ArrayList<PlaceholderType> phSetVariance = new ArrayList<>(phSet);
|
||||
phSetVariance.removeIf(x -> (x.getVariance() == 0));
|
||||
while(!phSetVariance.isEmpty()) {
|
||||
PlaceholderType a = phSetVariance.remove(0);
|
||||
usedTPH.add(a);
|
||||
//HashMap<PlaceholderType,Integer> ht = new HashMap<>();
|
||||
//ht.put(a, a.getVariance());
|
||||
Set<UnifyPair> eq1 = new HashSet<>(eq);
|
||||
eq1.removeIf(x -> !(x.getLhsType() instanceof PlaceholderType && ((PlaceholderType)x.getLhsType()).equals(a)));
|
||||
eq1.stream().forEach(x -> { x.getRhsType().accept(new distributeVariance(), a.getVariance());});
|
||||
eq1 = new HashSet<>(eq);
|
||||
eq1.removeIf(x -> !(x.getRhsType() instanceof PlaceholderType && ((PlaceholderType)x.getRhsType()).equals(a)));
|
||||
eq1.stream().forEach(x -> { x.getLhsType().accept(new distributeVariance(), a.getVariance());});
|
||||
phSetVariance = new ArrayList<>(phSet);
|
||||
phSetVariance.removeIf(x -> (x.getVariance() == 0 || usedTPH.contains(x)));
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, TypePlaceholder> generateTPHMap(ConstraintSet<Pair> constraints){
|
||||
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);
|
||||
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);
|
||||
if (p.TA2 instanceof TypePlaceholder) {
|
||||
ret.put(((TypePlaceholder) p.TA2).getName(), (TypePlaceholder) p.TA2);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
@ -96,8 +263,32 @@ public class JavaTXCompiler {
|
||||
private SourceFile parse(File sourceFile) throws IOException, java.lang.ClassNotFoundException {
|
||||
CompilationUnitContext tree = JavaTXParser.parse(sourceFile);
|
||||
SyntaxTreeGenerator generator = new SyntaxTreeGenerator(environment.getRegistry(sourceFile), new GenericsRegistry(null));
|
||||
SourceFile ret = generator.convert(tree);
|
||||
SourceFile ret = generator.convert(tree, environment.packageCrawler);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// um pfad erweitern
|
||||
public void generateBytecode(String path) throws ClassNotFoundException, IOException {
|
||||
for(File f : sourceFiles.keySet()) {
|
||||
HashMap<String,byte[]> classFiles = new HashMap<>();
|
||||
SourceFile sf = sourceFiles.get(f);
|
||||
List<ResultSet> typeinferenceResult = this.typeInference();
|
||||
BytecodeGen bytecodeGen = new BytecodeGen(classFiles,typeinferenceResult,sf,path);
|
||||
// BytecodeGen bytecodeGen = new BytecodeGen(classFiles,typeinferenceResult.get(0));
|
||||
bytecodeGen.visit(sf);
|
||||
this.writeClassFile(bytecodeGen.getClassFiles(), path);
|
||||
}
|
||||
}
|
||||
|
||||
private void writeClassFile(HashMap<String, byte[]> classFiles, String path) throws IOException {
|
||||
FileOutputStream output;
|
||||
for(String name : classFiles.keySet()) {
|
||||
byte[] bytecode = classFiles.get(name);
|
||||
System.out.println("generating "+name+ ".class file ...");
|
||||
//output = new FileOutputStream(new File(System.getProperty("user.dir") + "/testBytecode/generatedBC/" +name+".class"));
|
||||
output = new FileOutputStream(new File(path +name+".class"));
|
||||
output.write(bytecode);
|
||||
output.close();
|
||||
System.out.println(name+".class file generated");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,10 +5,7 @@ import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
|
||||
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
||||
@ -35,6 +32,7 @@ import de.dhbwstuttgart.parser.scope.JavaClassRegistry;
|
||||
public class CompilationEnvironment {
|
||||
private final List<URL> librarys;
|
||||
private final List<File> sourceFiles;
|
||||
public final PackageCrawler packageCrawler;
|
||||
|
||||
/**
|
||||
* Imitiert die Environment beim Aufruf des JavaCompilers auf einer Menge von java-Dateien
|
||||
@ -42,22 +40,46 @@ public class CompilationEnvironment {
|
||||
* @param sourceFiles die zu kompilierenden Dateien
|
||||
*/
|
||||
public CompilationEnvironment(List<File> sourceFiles) {
|
||||
String bootClassPath = System.getProperty("sun.boot.class.path");
|
||||
librarys = new ArrayList<>();
|
||||
for(String path : bootClassPath.split(File.pathSeparator)) {
|
||||
try {
|
||||
librarys.add(new URL("file:"+path));
|
||||
} catch (MalformedURLException e) {
|
||||
new DebugException("Fehler im Classpath auf diesem System");
|
||||
/**
|
||||
* Java 9 bringt einige Änderungen am Classloader
|
||||
* So funktioniert der BootClassLoader nicht mehr.
|
||||
* hier gibts ein paar Quellen zum nachlesen:
|
||||
* http://java9.wtf/class-loading/
|
||||
* https://stackoverflow.com/questions/46494112/classloaders-hierarchy-in-java-9
|
||||
*
|
||||
*/
|
||||
//String bootClassPath = System.getProperty("sun.boot.class.path");
|
||||
// ClassLoader cl = ClassLoader.getPlatformClassLoader();
|
||||
ClassLoader cl = ClassLoader.getSystemClassLoader();
|
||||
String bootClassPath = System.getProperty("java.class.path");
|
||||
librarys = new ArrayList<>();
|
||||
for(String path : bootClassPath.split(File.pathSeparator)) {
|
||||
try {
|
||||
librarys.add(new URL("file:"+path));
|
||||
} catch (MalformedURLException e) {
|
||||
new DebugException("Fehler im Classpath auf diesem System");
|
||||
}
|
||||
}
|
||||
}
|
||||
//URLClassLoader loader = new URLClassLoader(new URL[0], cl);
|
||||
//librarys = Arrays.asList(loader.getURLs());
|
||||
|
||||
this.sourceFiles = sourceFiles;
|
||||
this.packageCrawler = new PackageCrawler(librarys);
|
||||
}
|
||||
|
||||
public JavaClassRegistry getRegistry(File forSourceFile) throws ClassNotFoundException, IOException {
|
||||
List<String> allNames;
|
||||
Map<String, Integer> allNames;
|
||||
CompilationUnitContext tree = JavaTXParser.parse(forSourceFile);
|
||||
allNames = GatherNames.getNames(tree, new PackageCrawler(librarys));
|
||||
allNames = GatherNames.getNames(tree, packageCrawler);
|
||||
return new JavaClassRegistry(allNames);
|
||||
}
|
||||
|
||||
public List<ClassOrInterface> getAllAvailableClasses() {
|
||||
List<ClassOrInterface> ret = new ArrayList<>();
|
||||
for(Class c : new PackageCrawler(librarys).getAllAvailableClasses()){
|
||||
ret.add(ASTFactory.createClass(c));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
package de.dhbwstuttgart.environment;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
import org.reflections.Reflections;
|
||||
import org.reflections.scanners.ResourcesScanner;
|
||||
@ -12,6 +10,7 @@ import org.reflections.util.ConfigurationBuilder;
|
||||
import org.reflections.util.FilterBuilder;
|
||||
|
||||
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
||||
import org.reflections.vfs.SystemDir;
|
||||
|
||||
/**
|
||||
* Hilft beim Durchsuchen von Packages
|
||||
@ -54,11 +53,24 @@ public class PackageCrawler {
|
||||
return classes;
|
||||
}
|
||||
|
||||
public List<String> getClassNames(String packageName){
|
||||
List<String> nameList = new ArrayList();
|
||||
public Set<Class<?>> getAllAvailableClasses(){
|
||||
Reflections reflections = new Reflections(new ConfigurationBuilder()
|
||||
.setScanners(new SubTypesScanner(false /* don't exclude Object.class */), new ResourcesScanner())
|
||||
.setUrls(urls));
|
||||
|
||||
Set<Class<?>> classes = reflections.getSubTypesOf(Object.class);
|
||||
|
||||
return classes;
|
||||
}
|
||||
|
||||
public Map<String, Integer> getClassNames(String packageName){
|
||||
Map<String, Integer> nameList = new HashMap<>();
|
||||
Set<Class<?>> classes = getClassesInPackage(packageName);
|
||||
if(packageName.equals("java.lang") && ! classes.contains(Object.class)) {
|
||||
classes.add(Object.class);
|
||||
}
|
||||
for(Class c : classes){
|
||||
nameList.add(c.getName());
|
||||
nameList.put(c.getName(), c.getTypeParameters().length);
|
||||
}
|
||||
return nameList;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ public class JavaTXParser {
|
||||
*/
|
||||
}
|
||||
|
||||
/* F<EFBFBD>r das Typsystem ist es notwendig, dass sich der Source in einer Datei befindet:
|
||||
/* Für das Typsystem ist es notwendig, dass sich der Source in einer Datei befindet:
|
||||
public SourceFile parse(String fileContent) throws IOException, java.lang.ClassNotFoundException {
|
||||
return this.parse(new ByteArrayInputStream(fileContent.getBytes(StandardCharsets.UTF_8)));
|
||||
}
|
||||
|
168
src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/FCGenerator.java
Normal file
168
src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/FCGenerator.java
Normal file
@ -0,0 +1,168 @@
|
||||
package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.DebugException;
|
||||
import de.dhbwstuttgart.parser.NullToken;
|
||||
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
|
||||
import de.dhbwstuttgart.syntaxtree.GenericTypeVar;
|
||||
import de.dhbwstuttgart.syntaxtree.factory.ASTFactory;
|
||||
import de.dhbwstuttgart.syntaxtree.factory.UnifyTypeFactory;
|
||||
import de.dhbwstuttgart.syntaxtree.type.*;
|
||||
import de.dhbwstuttgart.typeinference.constraints.Pair;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class FCGenerator {
|
||||
/**
|
||||
* Baut die FiniteClosure aus availableClasses.
|
||||
* Klassen welche nicht in availableClasses vorkommen werden im Java Classpath nachgeschlagen.
|
||||
*
|
||||
* @param availableClasses - Alle geparsten Klassen
|
||||
*/
|
||||
public static Set<UnifyPair> toUnifyFC(Collection<ClassOrInterface> availableClasses) throws ClassNotFoundException {
|
||||
return toFC(availableClasses).stream().map(t -> UnifyTypeFactory.convert(t)).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
public static Set<Pair> toFC(Collection<ClassOrInterface> availableClasses) throws ClassNotFoundException {
|
||||
HashSet<Pair> pairs = new HashSet<>();
|
||||
for(ClassOrInterface cly : availableClasses){
|
||||
pairs.addAll(getSuperTypes(cly, availableClasses));
|
||||
}
|
||||
return pairs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bildet eine Kette vom übergebenen Typ bis hin zum höchsten bekannten Typ
|
||||
* Als Generics werden TPHs benutzt, welche der Unifikationsalgorithmus korrekt interpretieren muss.
|
||||
* Die verwendeten TPHs werden in der Kette nach oben gereicht, so erhält der selbe GTV immer den selben TPH
|
||||
* @param forType
|
||||
* @return
|
||||
*/
|
||||
private static List<Pair> getSuperTypes(ClassOrInterface forType, Collection<ClassOrInterface> availableClasses) throws ClassNotFoundException {
|
||||
return getSuperTypes(forType, availableClasses, new HashMap<>());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param forType
|
||||
* @param availableClasses
|
||||
* @param gtvs
|
||||
* @return
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
private static List<Pair> getSuperTypes(ClassOrInterface forType, Collection<ClassOrInterface> availableClasses,
|
||||
HashMap<String, RefTypeOrTPHOrWildcardOrGeneric> gtvs) throws ClassNotFoundException {
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> params = new ArrayList<>();
|
||||
//Die GTVs, die in forType hinzukommen:
|
||||
HashMap<String, RefTypeOrTPHOrWildcardOrGeneric> newGTVs = new HashMap<>();
|
||||
//Generics mit gleichem Namen müssen den selben TPH bekommen
|
||||
for(GenericTypeVar gtv : forType.getGenerics()){
|
||||
if(!gtvs.containsKey(gtv.getName())){
|
||||
TypePlaceholder replacePlaceholder = TypePlaceholder.fresh(new NullToken());
|
||||
gtvs.put(gtv.getName(), replacePlaceholder);
|
||||
newGTVs.put(gtv.getName(), replacePlaceholder);
|
||||
}
|
||||
params.add(gtvs.get(gtv.getName()));
|
||||
}
|
||||
|
||||
|
||||
List<RefType> superClasses = new ArrayList<>();
|
||||
superClasses.add(forType.getSuperClass());
|
||||
superClasses.addAll(forType.getSuperInterfaces());
|
||||
|
||||
List<Pair> retList = new ArrayList<>();
|
||||
for(RefType superType : superClasses){
|
||||
Optional<ClassOrInterface> hasSuperclass = availableClasses.stream().filter(cl -> superType.getName().equals(cl.getClassName())).findAny();
|
||||
ClassOrInterface superClass;
|
||||
if(!hasSuperclass.isPresent()) //Wenn es die Klasse in den available Klasses nicht gibt wird sie im Classpath gesucht. Ansonsten Exception
|
||||
{
|
||||
superClass = ASTFactory.createClass(ClassLoader.getSystemClassLoader().loadClass(superType.getName().toString()));
|
||||
}else{
|
||||
superClass = hasSuperclass.get();
|
||||
}
|
||||
/*
|
||||
Die Parameter der superklasse müssen jetzt nach den Angaben in der Subklasse
|
||||
modifiziert werden
|
||||
Beispie: Matrix<A> extends Vector<Vector<A>>
|
||||
Den ersten Parameter mit Vector<A> austauschen und dort alle Generics zu den Typplaceholdern in gtvs austauschen
|
||||
*/
|
||||
//Hier vermerken, welche Typen in der Superklasse ausgetauscht werden müssen
|
||||
Iterator<GenericTypeVar> itGenParams = superClass.getGenerics().iterator();
|
||||
Iterator<RefTypeOrTPHOrWildcardOrGeneric> itSetParams = superType.getParaList().iterator();
|
||||
while(itSetParams.hasNext()){
|
||||
RefTypeOrTPHOrWildcardOrGeneric setType = itSetParams.next();
|
||||
//In diesem Typ die GTVs durch TPHs und Einsetzungen austauschen:
|
||||
RefTypeOrTPHOrWildcardOrGeneric setSetType = setType.acceptTV(new TypeExchanger(gtvs));
|
||||
newGTVs.put(itGenParams.next().getName(), setSetType);
|
||||
}
|
||||
|
||||
//Für den superType kann man nun zum Austauschen der Generics wieder die gtvs nehmen:
|
||||
//Die newGTVs sind nur für den superClass ClassOrInterface welches möglicherweise per reflection geladen wurde abgestimmt
|
||||
RefTypeOrTPHOrWildcardOrGeneric superRefType = superType.acceptTV(new TypeExchanger(gtvs));
|
||||
|
||||
RefTypeOrTPHOrWildcardOrGeneric t1 = new RefType(forType.getClassName(), params, new NullToken());
|
||||
RefTypeOrTPHOrWildcardOrGeneric t2 = superRefType;
|
||||
|
||||
Pair ret = new Pair(t1, t2, PairOperator.SMALLER);
|
||||
|
||||
List<Pair> superTypes;
|
||||
//Rekursiver Aufruf. Abbruchbedingung ist Object als Superklasse:
|
||||
if(superClass.getClassName().equals(ASTFactory.createObjectClass().getClassName())){
|
||||
superTypes = Arrays.asList(new Pair(ASTFactory.createObjectType(), ASTFactory.createObjectType(), PairOperator.SMALLER));
|
||||
}else{
|
||||
superTypes = getSuperTypes(superClass, availableClasses, newGTVs);
|
||||
}
|
||||
|
||||
retList.add(ret);
|
||||
retList.addAll(superTypes);
|
||||
}
|
||||
|
||||
return retList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tauscht die GTVs in einem Typ gegen die entsprechenden Typen in der übergebenen Map aus.
|
||||
*/
|
||||
private static class TypeExchanger implements TypeVisitor<RefTypeOrTPHOrWildcardOrGeneric>{
|
||||
|
||||
private final HashMap<String, RefTypeOrTPHOrWildcardOrGeneric> gtvs;
|
||||
|
||||
TypeExchanger(HashMap<String, RefTypeOrTPHOrWildcardOrGeneric> gtvs){
|
||||
this.gtvs = gtvs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RefTypeOrTPHOrWildcardOrGeneric visit(RefType refType) {
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> params = new ArrayList<>();
|
||||
for(RefTypeOrTPHOrWildcardOrGeneric param : refType.getParaList()){
|
||||
params.add(param.acceptTV(this));
|
||||
}
|
||||
RefTypeOrTPHOrWildcardOrGeneric ret = new RefType(refType.getName(), params, new NullToken());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RefTypeOrTPHOrWildcardOrGeneric visit(SuperWildcardType superWildcardType) {
|
||||
throw new DebugException("Dieser Fall darf nicht auftreten");
|
||||
}
|
||||
|
||||
@Override
|
||||
public RefTypeOrTPHOrWildcardOrGeneric visit(TypePlaceholder typePlaceholder) {
|
||||
throw new DebugException("Dieser Fall darf nicht auftreten");
|
||||
}
|
||||
|
||||
@Override
|
||||
public RefTypeOrTPHOrWildcardOrGeneric visit(ExtendsWildcardType extendsWildcardType) {
|
||||
throw new DebugException("Dieser Fall darf nicht auftreten");
|
||||
}
|
||||
|
||||
@Override
|
||||
public RefTypeOrTPHOrWildcardOrGeneric visit(GenericRefType genericRefType) {
|
||||
if(! gtvs.containsKey(genericRefType.getParsedName()))
|
||||
throw new DebugException("Dieser Fall darf nicht auftreten");
|
||||
return gtvs.get(genericRefType.getParsedName());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -3,8 +3,8 @@ package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
|
||||
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
||||
|
||||
public class GenericContext {
|
||||
public final String parentMethod;
|
||||
public final JavaClassName parentClass;
|
||||
private final String parentMethod;
|
||||
private final JavaClassName parentClass;
|
||||
|
||||
public GenericContext(JavaClassName parentClass, String parentMethod) {
|
||||
if(parentMethod == null)parentMethod = "";
|
||||
|
@ -7,7 +7,7 @@ import de.dhbwstuttgart.parser.scope.GenericsRegistry;
|
||||
import de.dhbwstuttgart.parser.scope.JavaClassRegistry;
|
||||
import de.dhbwstuttgart.syntaxtree.*;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.*;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.*;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.UnaryExpr.Operation;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
@ -23,6 +23,7 @@ public class StatementGenerator {
|
||||
private JavaClassRegistry reg;
|
||||
private Map<String, RefTypeOrTPHOrWildcardOrGeneric> localVars;
|
||||
private GenericsRegistry generics;
|
||||
private String VAR_KEYWORD = "var";
|
||||
|
||||
public StatementGenerator(JavaClassRegistry reg, GenericsRegistry generics, Map<String, RefTypeOrTPHOrWildcardOrGeneric> localVars){
|
||||
this.reg = reg;
|
||||
@ -94,7 +95,7 @@ public class StatementGenerator {
|
||||
|
||||
private Statement convert(Java8Parser.StatementWithoutTrailingSubstatementContext stmt) {
|
||||
if(stmt.block() != null){
|
||||
return convert(stmt.block());
|
||||
return convert(stmt.block(), false);
|
||||
}else if(stmt.emptyStatement() != null){
|
||||
return new EmptyStmt(stmt.getStart());
|
||||
}else if(stmt.expressionStatement() != null){
|
||||
@ -120,14 +121,14 @@ public class StatementGenerator {
|
||||
}else throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Block convert(Java8Parser.BlockContext block) {
|
||||
public Block convert(Java8Parser.BlockContext block, boolean addTrailingReturn) {
|
||||
List<Statement> statements = new ArrayList<>();
|
||||
if(block.blockStatements() != null)
|
||||
for(Java8Parser.BlockStatementContext statementContext : block.blockStatements().blockStatement()){
|
||||
List<Statement> stmt = convert(statementContext);
|
||||
statements.addAll(stmt);
|
||||
}
|
||||
statements = SyntacticSugar.addTrailingReturn(statements);
|
||||
if(addTrailingReturn)statements = SyntacticSugar.addTrailingReturn(statements);
|
||||
return new Block(statements, block.getStart());
|
||||
}
|
||||
|
||||
@ -178,6 +179,14 @@ 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){
|
||||
@ -199,7 +208,7 @@ public class StatementGenerator {
|
||||
}else throw new NotImplementedException();
|
||||
|
||||
ArgumentList argumentList = convert(methodInvocationContext.argumentList());
|
||||
MethodCall ret = new MethodCall(TypePlaceholder.fresh(methodInvocationContext.getStart()),new Receiver(receiver), name, argumentList, methodInvocationContext.getStart());
|
||||
MethodCall ret = new MethodCall(TypePlaceholder.fresh(methodInvocationContext.getStart()), getReceiver(receiver), name, argumentList, methodInvocationContext.getStart());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -270,23 +279,24 @@ public class StatementGenerator {
|
||||
}
|
||||
|
||||
private Statement convert(Java8Parser.PreIncrementExpressionContext stmt) {
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
Expression argument = convert(stmt.unaryExpression());
|
||||
Token offset = stmt.getStart();
|
||||
return new UnaryExpr(UnaryExpr.Operation.PREINCREMENT, argument, TypePlaceholder.fresh(offset), offset);
|
||||
}
|
||||
|
||||
private Statement convert(Java8Parser.PreDecrementExpressionContext stmt) {
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
private Statement convert(Java8Parser.PreDecrementExpressionContext stmt) {
|
||||
return new UnaryExpr(UnaryExpr.Operation.PREDECREMENT, convert(stmt.unaryExpression()),
|
||||
TypePlaceholder.fresh(stmt.getStart()), stmt.getStart());
|
||||
}
|
||||
|
||||
private Statement convert(Java8Parser.PostIncrementExpressionContext stmt) {
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
return new UnaryExpr(UnaryExpr.Operation.POSTINCREMENT, convert(stmt.postfixExpression()),
|
||||
TypePlaceholder.fresh(stmt.getStart()), stmt.getStart());
|
||||
}
|
||||
|
||||
private Statement convert(Java8Parser.PostDecrementExpressionContext stmt) {
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
return new UnaryExpr(UnaryExpr.Operation.POSTDECREMENT, convert(stmt.postfixExpression()),
|
||||
TypePlaceholder.fresh(stmt.getStart()), stmt.getStart());
|
||||
}
|
||||
|
||||
private Statement convert(Java8Parser.AssignmentContext stmt) {
|
||||
@ -307,8 +317,10 @@ public class StatementGenerator {
|
||||
}
|
||||
|
||||
private Statement convert(Java8Parser.IfThenElseStatementContext stmt){
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
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());
|
||||
}
|
||||
|
||||
private Statement convert(Java8Parser.IfThenElseStatementNoShortIfContext stmt){
|
||||
@ -394,7 +406,7 @@ public class StatementGenerator {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
RefTypeOrTPHOrWildcardOrGeneric type;
|
||||
if(declaration.unannTypeOrAuto().unannType()==null){
|
||||
if(declaration.unannTypeOrAuto().unannType().getText().equals(VAR_KEYWORD)){
|
||||
type = TypePlaceholder.fresh(declaration.getStart());
|
||||
}else{
|
||||
type = TypeGenerator.convert(declaration.unannTypeOrAuto().unannType(), reg, generics);
|
||||
@ -532,8 +544,7 @@ public class StatementGenerator {
|
||||
if(expression.conditionalOrExpression() == null){
|
||||
return convert(expression.conditionalAndExpression());
|
||||
}else{
|
||||
return new Binary(convert(expression.conditionalOrExpression()),
|
||||
convert(expression.conditionalAndExpression()), Binary.Operator.OR);
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
@ -541,8 +552,7 @@ public class StatementGenerator {
|
||||
if(expression.conditionalAndExpression() == null){
|
||||
return convert(expression.inclusiveOrExpression());
|
||||
}else{
|
||||
return new Binary(convert(expression.conditionalAndExpression()),
|
||||
convert(expression.inclusiveOrExpression()), Binary.Operator.AND);
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
@ -579,11 +589,43 @@ public class StatementGenerator {
|
||||
}
|
||||
|
||||
private Expression convert(Java8Parser.RelationalExpressionContext expression) {
|
||||
if(expression.relationalExpression() == null){
|
||||
if(expression.relationalExpression() == null) {
|
||||
return convert(expression.shiftExpression());
|
||||
}else{
|
||||
throw new NotImplementedException();
|
||||
}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 {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
// throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private Expression convert(Java8Parser.ShiftExpressionContext expression) {
|
||||
@ -595,10 +637,15 @@ public class StatementGenerator {
|
||||
}
|
||||
|
||||
private Expression convert(Java8Parser.AdditiveExpressionContext expression) {
|
||||
|
||||
if(expression.additiveExpression() == null){
|
||||
return convert(expression.multiplicativeExpression());
|
||||
}else{
|
||||
throw new NotImplementedException();
|
||||
}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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -606,7 +653,11 @@ public class StatementGenerator {
|
||||
if(expression.multiplicativeExpression() == null){
|
||||
return convert(expression.unaryExpression());
|
||||
}else{
|
||||
throw new NotImplementedException();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -618,9 +669,11 @@ public class StatementGenerator {
|
||||
}else if(expression.unaryExpressionNotPlusMinus() != null){
|
||||
return convert(expression.unaryExpressionNotPlusMinus());
|
||||
}else if(expression.getText().startsWith("+")){
|
||||
return new UnaryPlus(convert(expression.unaryExpression()));
|
||||
return new UnaryExpr(UnaryExpr.Operation.PLUS, convert(expression.unaryExpression()),
|
||||
TypePlaceholder.fresh(expression.getStart()), expression.getStart());
|
||||
}else if(expression.getText().startsWith("-")){
|
||||
return new UnaryMinus(convert(expression.unaryExpression()));
|
||||
return new UnaryExpr(UnaryExpr.Operation.MINUS, convert(expression.unaryExpression()),
|
||||
TypePlaceholder.fresh(expression.getStart()), expression.getStart());
|
||||
}else{
|
||||
//Diese Exceptions sollte nie geworfen werden.
|
||||
//Der Code wurde nur noch nicht getestet. Sollte zur Sicherheit drin bleiben.
|
||||
@ -663,10 +716,10 @@ public class StatementGenerator {
|
||||
}
|
||||
|
||||
for(Java8Parser.PostIncrementExpression_lf_postfixExpressionContext inc : expression.postIncrementExpression_lf_postfixExpression()){
|
||||
expr = new PostIncExpr(expr);
|
||||
expr = new UnaryExpr(UnaryExpr.Operation.POSTINCREMENT, expr, TypePlaceholder.fresh(inc.getStart()), inc.getStart());
|
||||
}
|
||||
for(Java8Parser.PostDecrementExpression_lf_postfixExpressionContext dec : expression.postDecrementExpression_lf_postfixExpression()){
|
||||
expr = new PostDecExpr(expr);
|
||||
expr = new UnaryExpr(UnaryExpr.Operation.POSTDECREMENT, expr, TypePlaceholder.fresh(dec.getStart()), dec.getStart());
|
||||
}
|
||||
|
||||
return expr;
|
||||
@ -700,7 +753,7 @@ public class StatementGenerator {
|
||||
}else {
|
||||
Java8Parser.MethodInvocation_lf_primaryContext ctxt = e.methodInvocation_lf_primary();
|
||||
String methodName = ctxt.Identifier().toString();
|
||||
return new MethodCall(TypePlaceholder.fresh(e.getStart()), new Receiver(expr), methodName, convert(ctxt.argumentList()), e.getStart());
|
||||
return new MethodCall(TypePlaceholder.fresh(e.getStart()), getReceiver(expr), methodName, convert(ctxt.argumentList()), e.getStart());
|
||||
}
|
||||
}
|
||||
|
||||
@ -762,25 +815,27 @@ public class StatementGenerator {
|
||||
private Expression convert(Java8Parser.LiteralContext literal) {
|
||||
if(literal.IntegerLiteral() != null || literal.FloatingPointLiteral()!= null){
|
||||
Number value = Double.parseDouble(literal.IntegerLiteral().getText());
|
||||
return new NumberLiteral(TypePlaceholder.fresh(literal.getStart()),
|
||||
return new Literal(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 BoolLiteral(type,
|
||||
return new Literal(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 CharLiteral(type,
|
||||
literal.CharacterLiteral().getText().charAt(0),
|
||||
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),
|
||||
literal.getStart());
|
||||
}else if(literal.StringLiteral()!=null){
|
||||
RefType type = new RefType(reg.getName("java.lang.String"),literal.getStart());
|
||||
return new StringLiteral(type,
|
||||
literal.StringLiteral().getText(),
|
||||
return new Literal(type,
|
||||
literal.StringLiteral().getText().substring(1, literal.StringLiteral().getText().length()-1),
|
||||
literal.getStart());
|
||||
}else if(literal.NullLiteral() != null){
|
||||
return new Null(TypePlaceholder.fresh(literal.getStart()),
|
||||
return new Literal(TypePlaceholder.fresh(literal.getStart()), null,
|
||||
literal.getStart());
|
||||
}else {
|
||||
throw new NotImplementedException();
|
||||
@ -808,7 +863,7 @@ public class StatementGenerator {
|
||||
}
|
||||
|
||||
ArgumentList argumentList = convert(methodInvocationContext.argumentList());
|
||||
MethodCall ret = new MethodCall(TypePlaceholder.fresh(methodInvocationContext.getStart()), new Receiver(receiver), name, argumentList, methodInvocationContext.getStart());
|
||||
MethodCall ret = new MethodCall(TypePlaceholder.fresh(methodInvocationContext.getStart()), getReceiver(receiver), name, argumentList, methodInvocationContext.getStart());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -841,7 +896,7 @@ public class StatementGenerator {
|
||||
expression.lambdaBody().expression().getStart()));
|
||||
block = new Block(statements, expression.lambdaBody().getStart());
|
||||
}else{
|
||||
block = lambdaGenerator.convert(expression.lambdaBody().block());
|
||||
block = lambdaGenerator.convert(expression.lambdaBody().block(), true);
|
||||
}
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> funNParams = new ArrayList<>();
|
||||
funNParams.add(TypePlaceholder.fresh(expression.getStart()));//ret-Type
|
||||
@ -849,7 +904,7 @@ public class StatementGenerator {
|
||||
funNParams.add(TypePlaceholder.fresh(expression.getStart())));
|
||||
RefTypeOrTPHOrWildcardOrGeneric lambdaType = TypePlaceholder.fresh(expression.getStart());
|
||||
//RefType lambdaType = new RefType(reg.getName("Fun"+params.getFormalparalist().size()),
|
||||
//funNParams, name.getStart());
|
||||
//funNParams, name.getStart());
|
||||
return new LambdaExpression(lambdaType, params, block, expression.getStart());
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
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;
|
||||
@ -10,22 +13,27 @@ public class SyntacticSugar {
|
||||
public static List<Statement> addTrailingReturn(List<Statement> statements){
|
||||
if(statements.size()!=0) {
|
||||
Statement lastStmt = statements.get(statements.size() - 1);
|
||||
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 {
|
||||
}
|
||||
ReturnFinder hasReturn = new ReturnFinder();
|
||||
lastStmt.accept(hasReturn);
|
||||
if(hasReturn.hasReturn)return statements;
|
||||
}
|
||||
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;
|
||||
|
@ -1,9 +1,12 @@
|
||||
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.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;
|
||||
@ -15,9 +18,9 @@ import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.sql.Ref;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
//import jdk.internal.dynalink.support.TypeConverterFactory;
|
||||
import org.antlr.v4.runtime.CommonToken;
|
||||
@ -28,7 +31,7 @@ public class SyntaxTreeGenerator{
|
||||
private JavaClassRegistry reg;
|
||||
private final GenericsRegistry globalGenerics;
|
||||
private String pkgName = "";
|
||||
List<JavaClassName> imports = new ArrayList();
|
||||
Set<JavaClassName> imports = new HashSet();
|
||||
|
||||
List<Statement> fieldInitializations = new ArrayList<>();
|
||||
|
||||
@ -69,56 +72,11 @@ public class SyntaxTreeGenerator{
|
||||
return ret;
|
||||
}
|
||||
|
||||
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.addAll(convertTypeImportOnDemandDeclaration(importDeclCtx.typeImportOnDemandDeclaration()));
|
||||
}
|
||||
else if(importDeclCtx.singleStaticImportDeclaration() != null){
|
||||
newImports.add(convertSingleStaticImportDeclaration(importDeclCtx.singleStaticImportDeclaration()));
|
||||
}
|
||||
else{
|
||||
newImports.addAll(convertStaticImportOnDemandDeclaration(importDeclCtx.staticImportOnDemandDeclaration()));
|
||||
}
|
||||
}
|
||||
this.imports.addAll(newImports);
|
||||
}
|
||||
|
||||
private JavaClassName convertSingleTypeImportDeclaration(Java8Parser.SingleTypeImportDeclarationContext ctx) throws ClassNotFoundException{
|
||||
String typeName = convertTypeName(ctx.typeName());
|
||||
JavaClassName ret = reg.getName(typeName);
|
||||
return ret;
|
||||
}
|
||||
|
||||
private List<JavaClassName> convertTypeImportOnDemandDeclaration(Java8Parser.TypeImportOnDemandDeclarationContext ctx){
|
||||
return reg.getAllFromPackage(ctx.packageOrTypeName().getText());
|
||||
}
|
||||
|
||||
private JavaClassName convertSingleStaticImportDeclaration(Java8Parser.SingleStaticImportDeclarationContext ctx){
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private List<JavaClassName> convertStaticImportOnDemandDeclaration(Java8Parser.StaticImportOnDemandDeclarationContext ctx){
|
||||
return reg.getAllFromPackage(ctx.typeName().getText());
|
||||
}
|
||||
|
||||
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{
|
||||
public SourceFile convert(Java8Parser.CompilationUnitContext ctx, PackageCrawler packageCrawler) throws ClassNotFoundException{
|
||||
if(ctx.packageDeclaration()!=null)this.pkgName = convert(ctx.packageDeclaration());
|
||||
List<ClassOrInterface> classes = new ArrayList<>();
|
||||
this.setImports(ctx);
|
||||
Map<String, Integer> imports = GatherNames.getImports(ctx, packageCrawler);
|
||||
this.imports = imports.keySet().stream().map(name -> reg.getName(name)).collect(Collectors.toSet());
|
||||
for(Java8Parser.TypeDeclarationContext typeDecl : ctx.typeDeclaration()){
|
||||
ClassOrInterface newClass;
|
||||
if(typeDecl.classDeclaration() != null){
|
||||
@ -132,6 +90,15 @@ 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());
|
||||
@ -179,16 +146,16 @@ public class SyntaxTreeGenerator{
|
||||
//TODO: Error! Abstrakte Methode ohne abstrakt Keyword
|
||||
}
|
||||
}else{
|
||||
block = stmtGen.convert(body.block());
|
||||
block = stmtGen.convert(body.block(),true);
|
||||
}
|
||||
if(parentClass.equals(new JavaClassName(name))){
|
||||
return new Constructor(modifiers, name, retType, modifiers, parameterList, block, gtvDeclarations, header.getStart(), fieldInitializations, superClass);
|
||||
return new Constructor(modifiers, name, retType, parameterList, block, gtvDeclarations, header.getStart(), fieldInitializations);
|
||||
}else{
|
||||
return new Method(modifiers, name, retType, modifiers, parameterList,block, gtvDeclarations, header.getStart());
|
||||
return new Method(modifiers, name, retType, parameterList,block, gtvDeclarations, header.getStart());
|
||||
}
|
||||
}
|
||||
|
||||
private ClassOrInterface convertClass(Java8Parser.ClassDeclarationContext ctx) {
|
||||
private ClassOrInterface convertClass(Java8Parser.ClassDeclarationContext ctx) {
|
||||
ClassOrInterface newClass;
|
||||
if(ctx.normalClassDeclaration() != null){
|
||||
newClass = convertNormal(ctx.normalClassDeclaration());
|
||||
@ -199,7 +166,7 @@ public class SyntaxTreeGenerator{
|
||||
return newClass;
|
||||
}
|
||||
|
||||
private ClassOrInterface convertNormal(Java8Parser.NormalClassDeclarationContext ctx){
|
||||
private ClassOrInterface convertNormal(Java8Parser.NormalClassDeclarationContext ctx) {
|
||||
int modifiers = 0;
|
||||
if(ctx.classModifier() != null){
|
||||
for(Java8Parser.ClassModifierContext mod : ctx.classModifier()){
|
||||
@ -207,7 +174,12 @@ public class SyntaxTreeGenerator{
|
||||
modifiers += newModifier;
|
||||
}
|
||||
}
|
||||
JavaClassName name = reg.getName(ctx.Identifier().getText());
|
||||
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));
|
||||
Token offset = ctx.getStart();
|
||||
GenericDeclarationList genericClassParameters;
|
||||
@ -220,7 +192,7 @@ public class SyntaxTreeGenerator{
|
||||
if(ctx.superclass() != null){
|
||||
superClass = convert(ctx.superclass());
|
||||
}else{
|
||||
superClass = ASTFactory.createObjectClass().getType();
|
||||
superClass = new RefType(ASTFactory.createObjectClass().getClassName(), ctx.getStart());
|
||||
}
|
||||
List<Field> fielddecl = convertFields(ctx.classBody(), generics);
|
||||
List<Method> methods = convertMethods(ctx.classBody(), name, superClass, generics);
|
||||
@ -241,20 +213,20 @@ public class SyntaxTreeGenerator{
|
||||
}
|
||||
|
||||
Boolean isInterface = false;
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> implementedInterfaces = convert(ctx.superinterfaces(), generics);
|
||||
List<RefType> implementedInterfaces = convert(ctx.superinterfaces(), generics);
|
||||
return new ClassOrInterface(modifiers, name, fielddecl, methods, konstruktoren, genericClassParameters, superClass,
|
||||
isInterface, implementedInterfaces, offset);
|
||||
}
|
||||
|
||||
private List<RefTypeOrTPHOrWildcardOrGeneric> convert(Java8Parser.SuperinterfacesContext ctx, GenericsRegistry generics) {
|
||||
private List<RefType> convert(Java8Parser.SuperinterfacesContext ctx, GenericsRegistry generics) {
|
||||
if(ctx == null)return new ArrayList<>();
|
||||
return convert(ctx.interfaceTypeList(), generics);
|
||||
}
|
||||
|
||||
private List<RefTypeOrTPHOrWildcardOrGeneric> convert(Java8Parser.InterfaceTypeListContext ctx, GenericsRegistry generics) {
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> ret = new ArrayList<>();
|
||||
private List<RefType> convert(Java8Parser.InterfaceTypeListContext ctx, GenericsRegistry generics) {
|
||||
List<RefType> ret = new ArrayList<>();
|
||||
for(Java8Parser.InterfaceTypeContext interfaceType : ctx.interfaceType()){
|
||||
ret.add(TypeGenerator.convert(interfaceType.classType(), reg, generics));
|
||||
ret.add((RefType) TypeGenerator.convert(interfaceType.classType(), reg, generics));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -264,14 +236,23 @@ public class SyntaxTreeGenerator{
|
||||
*/
|
||||
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, modifiers, params, block, classGenerics, offset, fieldInitializations, superClass);
|
||||
return new Constructor(Modifier.PUBLIC, className, classType, params, block, classGenerics, offset, fieldInitializations);
|
||||
}
|
||||
|
||||
private RefType convert(Java8Parser.SuperclassContext superclass) {
|
||||
throw new NotImplementedException();
|
||||
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,
|
||||
@ -412,6 +393,8 @@ 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));
|
||||
@ -422,12 +405,12 @@ public class SyntaxTreeGenerator{
|
||||
}else{
|
||||
genericParams = createEmptyGenericDeclarationList(ctx.Identifier());
|
||||
}
|
||||
RefType superClass = ASTFactory.createObjectClass().getType();
|
||||
RefType superClass = ASTFactory.createObjectType();
|
||||
|
||||
List<Field> fields = convertFields(ctx.interfaceBody());
|
||||
List<Method> methods = convertMethods(ctx.interfaceBody(), name, superClass, generics);
|
||||
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> extendedInterfaces = convert(ctx.extendsInterfaces(), generics);
|
||||
List<RefType> extendedInterfaces = convert(ctx.extendsInterfaces(), generics);
|
||||
|
||||
return new ClassOrInterface(modifiers, name, fields, methods, new ArrayList<>(),
|
||||
genericParams, superClass, true, extendedInterfaces, ctx.getStart());
|
||||
@ -450,7 +433,7 @@ public class SyntaxTreeGenerator{
|
||||
return ret;
|
||||
}
|
||||
|
||||
private List<RefTypeOrTPHOrWildcardOrGeneric> convert(Java8Parser.ExtendsInterfacesContext extendsInterfacesContext, GenericsRegistry generics) {
|
||||
private List<RefType> convert(Java8Parser.ExtendsInterfacesContext extendsInterfacesContext, GenericsRegistry generics) {
|
||||
if(extendsInterfacesContext == null)return new ArrayList<>();
|
||||
return convert(extendsInterfacesContext.interfaceTypeList(), generics);
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.parser.antlr.Java8Parser;
|
||||
import de.dhbwstuttgart.parser.scope.GenericTypeName;
|
||||
import de.dhbwstuttgart.parser.scope.GenericsRegistry;
|
||||
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
||||
import de.dhbwstuttgart.parser.scope.JavaClassRegistry;
|
||||
@ -14,6 +13,7 @@ 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 org.antlr.v4.runtime.Token;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -22,27 +22,34 @@ 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();
|
||||
}
|
||||
/**
|
||||
* Problem sind hier die verschachtelten Typen mit verschachtelten Typargumenten
|
||||
* Beispiel: Typ<String>.InnererTyp<Integer>
|
||||
*/
|
||||
String name = unannClassOrInterfaceTypeContext.getText();
|
||||
if(name.contains("<")){
|
||||
name = name.split("<")[0]; //Der Typ ist alles vor den ersten Argumenten
|
||||
}
|
||||
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();
|
||||
if(unannTypeContext.unannPrimitiveType().getText().equals("boolean")){
|
||||
return new RefType(ASTFactory.createClass(Boolean.class).getClassName(), unannTypeContext.getStart());
|
||||
}else{
|
||||
Java8Parser.NumericTypeContext numericType = unannTypeContext.unannPrimitiveType().numericType();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}else
|
||||
if(unannTypeContext.unannReferenceType().unannArrayType()!=null){
|
||||
System.out.println(unannTypeContext.getText());
|
||||
//System.out.println(unannTypeContext.getText());
|
||||
throw new NotImplementedException();
|
||||
}else
|
||||
if(unannTypeContext.unannReferenceType().unannTypeVariable()!=null){
|
||||
@ -69,7 +76,7 @@ public class TypeGenerator {
|
||||
//Problem <A extends B, B> ist erlaubt, würde aber bei den Bounds von A den Generic B nicht als solchen erkennen
|
||||
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());
|
||||
GenericTypeVar ret = new GenericTypeVar(name, bounds, typeParameter.getStart(), typeParameter.getStop());
|
||||
generics.put(name, new GenericContext(parentClass, parentMethod));
|
||||
return ret;
|
||||
}
|
||||
@ -77,7 +84,7 @@ public class TypeGenerator {
|
||||
public static List<RefTypeOrTPHOrWildcardOrGeneric> convert(Java8Parser.TypeBoundContext typeBoundContext, JavaClassRegistry reg, GenericsRegistry generics) {
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> ret = new ArrayList<>();
|
||||
if(typeBoundContext == null){
|
||||
ret.add(ASTFactory.createObjectClass().getType());
|
||||
ret.add(ASTFactory.createObjectType());
|
||||
return ret;
|
||||
}
|
||||
if(typeBoundContext.typeVariable() != null){
|
||||
@ -105,7 +112,16 @@ public class TypeGenerator {
|
||||
}
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric convert(Java8Parser.ReferenceTypeContext referenceTypeContext, JavaClassRegistry reg, GenericsRegistry generics) {
|
||||
return convertTypeName(referenceTypeContext.getText(), referenceTypeContext.getStart(), reg, generics);
|
||||
if(referenceTypeContext.classOrInterfaceType() != null){
|
||||
if(referenceTypeContext.classOrInterfaceType().classType_lfno_classOrInterfaceType()!= null){
|
||||
Java8Parser.ClassType_lfno_classOrInterfaceTypeContext ctx = referenceTypeContext.classOrInterfaceType().classType_lfno_classOrInterfaceType();
|
||||
return convertTypeName(ctx.Identifier().toString(), ctx.typeArguments(),referenceTypeContext.getStart(), reg, generics);
|
||||
}else{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}else{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public static RefTypeOrTPHOrWildcardOrGeneric convertTypeName(String name, Token offset, JavaClassRegistry reg, GenericsRegistry generics){
|
||||
@ -116,13 +132,17 @@ public class TypeGenerator {
|
||||
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.contains(name)){
|
||||
return new GenericRefType(new GenericTypeName(generics.get(name),name), offset);
|
||||
return new GenericRefType(name, offset);
|
||||
}else{
|
||||
throw new TypeinferenceException("Der Typ "+ name + " ist nicht vorhanden",offset);
|
||||
}
|
||||
}
|
||||
if(typeArguments == null){
|
||||
return new RefType(reg.getName(name), offset);
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> params = new ArrayList<>();
|
||||
for(int i = 0; i<reg.getNumberOfGenerics(name);i++){
|
||||
params.add(TypePlaceholder.fresh(offset));
|
||||
}
|
||||
return new RefType(reg.getName(name), params, offset);
|
||||
}else{
|
||||
return new RefType(reg.getName(name), convert(typeArguments, reg, generics), offset);
|
||||
}
|
||||
|
@ -732,7 +732,6 @@ localVariableDeclarationStatement
|
||||
|
||||
unannTypeOrAuto
|
||||
: unannType
|
||||
| 'var'
|
||||
;
|
||||
|
||||
localVariableDeclaration
|
||||
@ -1739,6 +1738,7 @@ Identifier
|
||||
: JavaLetter JavaLetterOrDigit*
|
||||
;
|
||||
|
||||
|
||||
fragment
|
||||
JavaLetter
|
||||
: [a-zA-Z$_] // these are the "java letters" below 0x7F
|
||||
|
@ -1,207 +1,205 @@
|
||||
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
|
||||
'var'=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
|
||||
'null'=57
|
||||
'('=58
|
||||
')'=59
|
||||
'{'=60
|
||||
'}'=61
|
||||
'['=62
|
||||
']'=63
|
||||
';'=64
|
||||
','=65
|
||||
'.'=66
|
||||
'='=67
|
||||
'>'=68
|
||||
'<'=69
|
||||
'!'=70
|
||||
'~'=71
|
||||
'?'=72
|
||||
':'=73
|
||||
'=='=74
|
||||
'<='=75
|
||||
'>='=76
|
||||
'!='=77
|
||||
'&&'=78
|
||||
'||'=79
|
||||
'++'=80
|
||||
'--'=81
|
||||
'+'=82
|
||||
'-'=83
|
||||
'*'=84
|
||||
'/'=85
|
||||
'&'=86
|
||||
'|'=87
|
||||
'^'=88
|
||||
'%'=89
|
||||
'->'=90
|
||||
'::'=91
|
||||
'+='=92
|
||||
'-='=93
|
||||
'*='=94
|
||||
'/='=95
|
||||
'&='=96
|
||||
'|='=97
|
||||
'^='=98
|
||||
'%='=99
|
||||
'<<='=100
|
||||
'>>='=101
|
||||
'>>>='=102
|
||||
'@'=104
|
||||
'...'=105
|
||||
ABSTRACT=1
|
||||
ASSERT=2
|
||||
BOOLEAN=3
|
||||
BREAK=4
|
||||
BYTE=5
|
||||
CASE=6
|
||||
CATCH=7
|
||||
CHAR=8
|
||||
CLASS=9
|
||||
CONST=10
|
||||
CONTINUE=11
|
||||
DEFAULT=12
|
||||
DO=13
|
||||
DOUBLE=14
|
||||
ELSE=15
|
||||
ENUM=16
|
||||
EXTENDS=17
|
||||
FINAL=18
|
||||
FINALLY=19
|
||||
FLOAT=20
|
||||
FOR=21
|
||||
IF=22
|
||||
GOTO=23
|
||||
IMPLEMENTS=24
|
||||
IMPORT=25
|
||||
INSTANCEOF=26
|
||||
INT=27
|
||||
INTERFACE=28
|
||||
LONG=29
|
||||
NATIVE=30
|
||||
NEW=31
|
||||
PACKAGE=32
|
||||
PRIVATE=33
|
||||
PROTECTED=34
|
||||
PUBLIC=35
|
||||
RETURN=36
|
||||
SHORT=37
|
||||
STATIC=38
|
||||
STRICTFP=39
|
||||
SUPER=40
|
||||
SWITCH=41
|
||||
SYNCHRONIZED=42
|
||||
THIS=43
|
||||
THROW=44
|
||||
THROWS=45
|
||||
TRANSIENT=46
|
||||
TRY=47
|
||||
VOID=48
|
||||
VOLATILE=49
|
||||
WHILE=50
|
||||
IntegerLiteral=51
|
||||
FloatingPointLiteral=52
|
||||
BooleanLiteral=53
|
||||
CharacterLiteral=54
|
||||
StringLiteral=55
|
||||
NullLiteral=56
|
||||
LPAREN=57
|
||||
RPAREN=58
|
||||
LBRACE=59
|
||||
RBRACE=60
|
||||
LBRACK=61
|
||||
RBRACK=62
|
||||
SEMI=63
|
||||
COMMA=64
|
||||
DOT=65
|
||||
ASSIGN=66
|
||||
GT=67
|
||||
LT=68
|
||||
BANG=69
|
||||
TILDE=70
|
||||
QUESTION=71
|
||||
COLON=72
|
||||
EQUAL=73
|
||||
LE=74
|
||||
GE=75
|
||||
NOTEQUAL=76
|
||||
AND=77
|
||||
OR=78
|
||||
INC=79
|
||||
DEC=80
|
||||
ADD=81
|
||||
SUB=82
|
||||
MUL=83
|
||||
DIV=84
|
||||
BITAND=85
|
||||
BITOR=86
|
||||
CARET=87
|
||||
MOD=88
|
||||
ARROW=89
|
||||
COLONCOLON=90
|
||||
ADD_ASSIGN=91
|
||||
SUB_ASSIGN=92
|
||||
MUL_ASSIGN=93
|
||||
DIV_ASSIGN=94
|
||||
AND_ASSIGN=95
|
||||
OR_ASSIGN=96
|
||||
XOR_ASSIGN=97
|
||||
MOD_ASSIGN=98
|
||||
LSHIFT_ASSIGN=99
|
||||
RSHIFT_ASSIGN=100
|
||||
URSHIFT_ASSIGN=101
|
||||
Identifier=102
|
||||
AT=103
|
||||
ELLIPSIS=104
|
||||
WS=105
|
||||
COMMENT=106
|
||||
LINE_COMMENT=107
|
||||
'abstract'=1
|
||||
'assert'=2
|
||||
'boolean'=3
|
||||
'break'=4
|
||||
'byte'=5
|
||||
'case'=6
|
||||
'catch'=7
|
||||
'char'=8
|
||||
'class'=9
|
||||
'const'=10
|
||||
'continue'=11
|
||||
'default'=12
|
||||
'do'=13
|
||||
'double'=14
|
||||
'else'=15
|
||||
'enum'=16
|
||||
'extends'=17
|
||||
'final'=18
|
||||
'finally'=19
|
||||
'float'=20
|
||||
'for'=21
|
||||
'if'=22
|
||||
'goto'=23
|
||||
'implements'=24
|
||||
'import'=25
|
||||
'instanceof'=26
|
||||
'int'=27
|
||||
'interface'=28
|
||||
'long'=29
|
||||
'native'=30
|
||||
'new'=31
|
||||
'package'=32
|
||||
'private'=33
|
||||
'protected'=34
|
||||
'public'=35
|
||||
'return'=36
|
||||
'short'=37
|
||||
'static'=38
|
||||
'strictfp'=39
|
||||
'super'=40
|
||||
'switch'=41
|
||||
'synchronized'=42
|
||||
'this'=43
|
||||
'throw'=44
|
||||
'throws'=45
|
||||
'transient'=46
|
||||
'try'=47
|
||||
'void'=48
|
||||
'volatile'=49
|
||||
'while'=50
|
||||
'null'=56
|
||||
'('=57
|
||||
')'=58
|
||||
'{'=59
|
||||
'}'=60
|
||||
'['=61
|
||||
']'=62
|
||||
';'=63
|
||||
','=64
|
||||
'.'=65
|
||||
'='=66
|
||||
'>'=67
|
||||
'<'=68
|
||||
'!'=69
|
||||
'~'=70
|
||||
'?'=71
|
||||
':'=72
|
||||
'=='=73
|
||||
'<='=74
|
||||
'>='=75
|
||||
'!='=76
|
||||
'&&'=77
|
||||
'||'=78
|
||||
'++'=79
|
||||
'--'=80
|
||||
'+'=81
|
||||
'-'=82
|
||||
'*'=83
|
||||
'/'=84
|
||||
'&'=85
|
||||
'|'=86
|
||||
'^'=87
|
||||
'%'=88
|
||||
'->'=89
|
||||
'::'=90
|
||||
'+='=91
|
||||
'-='=92
|
||||
'*='=93
|
||||
'/='=94
|
||||
'&='=95
|
||||
'|='=96
|
||||
'^='=97
|
||||
'%='=98
|
||||
'<<='=99
|
||||
'>>='=100
|
||||
'>>>='=101
|
||||
'@'=103
|
||||
'...'=104
|
||||
|
@ -17,23 +17,23 @@ public class Java8Lexer extends Lexer {
|
||||
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;
|
||||
ABSTRACT=1, ASSERT=2, BOOLEAN=3, BREAK=4, BYTE=5, CASE=6, CATCH=7, CHAR=8,
|
||||
CLASS=9, CONST=10, CONTINUE=11, DEFAULT=12, DO=13, DOUBLE=14, ELSE=15,
|
||||
ENUM=16, EXTENDS=17, FINAL=18, FINALLY=19, FLOAT=20, FOR=21, IF=22, GOTO=23,
|
||||
IMPLEMENTS=24, IMPORT=25, INSTANCEOF=26, INT=27, INTERFACE=28, LONG=29,
|
||||
NATIVE=30, NEW=31, PACKAGE=32, PRIVATE=33, PROTECTED=34, PUBLIC=35, RETURN=36,
|
||||
SHORT=37, STATIC=38, STRICTFP=39, SUPER=40, SWITCH=41, SYNCHRONIZED=42,
|
||||
THIS=43, THROW=44, THROWS=45, TRANSIENT=46, TRY=47, VOID=48, VOLATILE=49,
|
||||
WHILE=50, IntegerLiteral=51, FloatingPointLiteral=52, BooleanLiteral=53,
|
||||
CharacterLiteral=54, StringLiteral=55, NullLiteral=56, LPAREN=57, RPAREN=58,
|
||||
LBRACE=59, RBRACE=60, LBRACK=61, RBRACK=62, SEMI=63, COMMA=64, DOT=65,
|
||||
ASSIGN=66, GT=67, LT=68, BANG=69, TILDE=70, QUESTION=71, COLON=72, EQUAL=73,
|
||||
LE=74, GE=75, NOTEQUAL=76, AND=77, OR=78, INC=79, DEC=80, ADD=81, SUB=82,
|
||||
MUL=83, DIV=84, BITAND=85, BITOR=86, CARET=87, MOD=88, ARROW=89, COLONCOLON=90,
|
||||
ADD_ASSIGN=91, SUB_ASSIGN=92, MUL_ASSIGN=93, DIV_ASSIGN=94, AND_ASSIGN=95,
|
||||
OR_ASSIGN=96, XOR_ASSIGN=97, MOD_ASSIGN=98, LSHIFT_ASSIGN=99, RSHIFT_ASSIGN=100,
|
||||
URSHIFT_ASSIGN=101, Identifier=102, AT=103, ELLIPSIS=104, WS=105, COMMENT=106,
|
||||
LINE_COMMENT=107;
|
||||
public static String[] channelNames = {
|
||||
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
|
||||
};
|
||||
@ -43,9 +43,9 @@ public class Java8Lexer extends Lexer {
|
||||
};
|
||||
|
||||
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",
|
||||
"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",
|
||||
@ -72,8 +72,8 @@ public class Java8Lexer extends Lexer {
|
||||
};
|
||||
|
||||
private static final String[] _LITERAL_NAMES = {
|
||||
null, "'var'", "'abstract'", "'assert'", "'boolean'", "'break'", "'byte'",
|
||||
"'case'", "'catch'", "'char'", "'class'", "'const'", "'continue'", "'default'",
|
||||
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'",
|
||||
@ -88,21 +88,21 @@ public class Java8Lexer extends Lexer {
|
||||
"'>>>='", 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"
|
||||
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);
|
||||
|
||||
@ -164,9 +164,9 @@ public class Java8Lexer extends Lexer {
|
||||
@Override
|
||||
public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
|
||||
switch (ruleIndex) {
|
||||
case 147:
|
||||
case 146:
|
||||
return JavaLetter_sempred((RuleContext)_localctx, predIndex);
|
||||
case 148:
|
||||
case 147:
|
||||
return JavaLetterOrDigit_sempred((RuleContext)_localctx, predIndex);
|
||||
}
|
||||
return true;
|
||||
@ -191,7 +191,7 @@ public class Java8Lexer extends Lexer {
|
||||
}
|
||||
|
||||
public static final String _serializedATN =
|
||||
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2n\u044e\b\1\4\2\t"+
|
||||
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2m\u0448\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"+
|
||||
@ -210,378 +210,376 @@ public class Java8Lexer extends Lexer {
|
||||
"\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\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3"+
|
||||
"\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\7"+
|
||||
"\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3"+
|
||||
"\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3"+
|
||||
"\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16"+
|
||||
"\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21"+
|
||||
"\3\21\3\22\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23"+
|
||||
"\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25"+
|
||||
"\3\26\3\26\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\27\3\30\3\30\3\30\3\31"+
|
||||
"\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32"+
|
||||
"\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\34\3\34\3\34\3\34\3\34\3\34"+
|
||||
"\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\36\3\36\3\36\3\36\3\36"+
|
||||
"\3\36\3\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3 \3 \3"+
|
||||
" \3!\3!\3!\3!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\3#\3#\3#\3#\3#"+
|
||||
"\3$\3$\3$\3$\3$\3$\3$\3$\3$\3$\3%\3%\3%\3%\3%\3%\3%\3&\3&\3&\3&\3&\3&"+
|
||||
"\3&\3\'\3\'\3\'\3\'\3\'\3\'\3(\3(\3(\3(\3(\3(\3(\3)\3)\3)\3)\3)\3)\3)"+
|
||||
"\3)\3)\3*\3*\3*\3*\3*\3*\3+\3+\3+\3+\3+\3+\3+\3,\3,\3,\3,\3,\3,\3,\3,"+
|
||||
"\3,\3,\3,\3,\3,\3-\3-\3-\3-\3-\3.\3.\3.\3.\3.\3.\3/\3/\3/\3/\3/\3/\3/"+
|
||||
"\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\61\3\61\3\61\3\61"+
|
||||
"\3\62\3\62\3\62\3\62\3\62\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63"+
|
||||
"\3\64\3\64\3\64\3\64\3\64\3\64\3\65\3\65\3\65\3\65\5\65\u0293\n\65\3\66"+
|
||||
"\3\66\5\66\u0297\n\66\3\67\3\67\5\67\u029b\n\67\38\38\58\u029f\n8\39\3"+
|
||||
"9\59\u02a3\n9\3:\3:\3;\3;\3;\5;\u02aa\n;\3;\3;\3;\5;\u02af\n;\5;\u02b1"+
|
||||
"\n;\3<\3<\5<\u02b5\n<\3<\5<\u02b8\n<\3=\3=\5=\u02bc\n=\3>\3>\3?\6?\u02c1"+
|
||||
"\n?\r?\16?\u02c2\3@\3@\5@\u02c7\n@\3A\6A\u02ca\nA\rA\16A\u02cb\3B\3B\3"+
|
||||
"B\3B\3C\3C\5C\u02d4\nC\3C\5C\u02d7\nC\3D\3D\3E\6E\u02dc\nE\rE\16E\u02dd"+
|
||||
"\3F\3F\5F\u02e2\nF\3G\3G\5G\u02e6\nG\3G\3G\3H\3H\5H\u02ec\nH\3H\5H\u02ef"+
|
||||
"\nH\3I\3I\3J\6J\u02f4\nJ\rJ\16J\u02f5\3K\3K\5K\u02fa\nK\3L\3L\3L\3L\3"+
|
||||
"M\3M\5M\u0302\nM\3M\5M\u0305\nM\3N\3N\3O\6O\u030a\nO\rO\16O\u030b\3P\3"+
|
||||
"P\5P\u0310\nP\3Q\3Q\5Q\u0314\nQ\3R\3R\3R\5R\u0319\nR\3R\5R\u031c\nR\3"+
|
||||
"R\5R\u031f\nR\3R\3R\3R\5R\u0324\nR\3R\5R\u0327\nR\3R\3R\3R\5R\u032c\n"+
|
||||
"R\3R\3R\3R\5R\u0331\nR\3S\3S\3S\3T\3T\3U\5U\u0339\nU\3U\3U\3V\3V\3W\3"+
|
||||
"W\3X\3X\3X\5X\u0344\nX\3Y\3Y\5Y\u0348\nY\3Y\3Y\3Y\5Y\u034d\nY\3Y\3Y\5"+
|
||||
"Y\u0351\nY\3Z\3Z\3Z\3[\3[\3\\\3\\\3\\\3\\\3\\\3\\\3\\\3\\\3\\\5\\\u0361"+
|
||||
"\n\\\3]\3]\3]\3]\3]\3]\3]\3]\5]\u036b\n]\3^\3^\3_\3_\5_\u0371\n_\3_\3"+
|
||||
"_\3`\6`\u0376\n`\r`\16`\u0377\3a\3a\5a\u037c\na\3b\3b\3b\3b\5b\u0382\n"+
|
||||
"b\3c\3c\3c\3c\3c\3c\3c\3c\3c\3c\3c\5c\u038f\nc\3d\3d\3e\3e\3e\3e\3e\3"+
|
||||
"e\3e\3f\3f\3f\3f\3f\3g\3g\3h\3h\3i\3i\3j\3j\3k\3k\3l\3l\3m\3m\3n\3n\3"+
|
||||
"o\3o\3p\3p\3q\3q\3r\3r\3s\3s\3t\3t\3u\3u\3v\3v\3w\3w\3w\3x\3x\3x\3y\3"+
|
||||
"y\3y\3z\3z\3z\3{\3{\3{\3|\3|\3|\3}\3}\3}\3~\3~\3~\3\177\3\177\3\u0080"+
|
||||
"\3\u0080\3\u0081\3\u0081\3\u0082\3\u0082\3\u0083\3\u0083\3\u0084\3\u0084"+
|
||||
"\3\u0085\3\u0085\3\u0086\3\u0086\3\u0087\3\u0087\3\u0087\3\u0088\3\u0088"+
|
||||
"\3\u0088\3\u0089\3\u0089\3\u0089\3\u008a\3\u008a\3\u008a\3\u008b\3\u008b"+
|
||||
"\3\u008b\3\u008c\3\u008c\3\u008c\3\u008d\3\u008d\3\u008d\3\u008e\3\u008e"+
|
||||
"\3\u008e\3\u008f\3\u008f\3\u008f\3\u0090\3\u0090\3\u0090\3\u0091\3\u0091"+
|
||||
"\3\u0091\3\u0091\3\u0092\3\u0092\3\u0092\3\u0092\3\u0093\3\u0093\3\u0093"+
|
||||
"\3\u0093\3\u0093\3\u0094\3\u0094\7\u0094\u0414\n\u0094\f\u0094\16\u0094"+
|
||||
"\u0417\13\u0094\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\5\u0095"+
|
||||
"\u041f\n\u0095\3\u0096\3\u0096\3\u0096\3\u0096\3\u0096\3\u0096\5\u0096"+
|
||||
"\u0427\n\u0096\3\u0097\3\u0097\3\u0098\3\u0098\3\u0098\3\u0098\3\u0099"+
|
||||
"\6\u0099\u0430\n\u0099\r\u0099\16\u0099\u0431\3\u0099\3\u0099\3\u009a"+
|
||||
"\3\u009a\3\u009a\3\u009a\7\u009a\u043a\n\u009a\f\u009a\16\u009a\u043d"+
|
||||
"\13\u009a\3\u009a\3\u009a\3\u009a\3\u009a\3\u009a\3\u009b\3\u009b\3\u009b"+
|
||||
"\3\u009b\7\u009b\u0448\n\u009b\f\u009b\16\u009b\u044b\13\u009b\3\u009b"+
|
||||
"\3\u009b\3\u043b\2\u009c\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f"+
|
||||
"\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63"+
|
||||
"\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a\62"+
|
||||
"c\63e\64g\65i\66k\2m\2o\2q\2s\2u\2w\2y\2{\2}\2\177\2\u0081\2\u0083\2\u0085"+
|
||||
"\2\u0087\2\u0089\2\u008b\2\u008d\2\u008f\2\u0091\2\u0093\2\u0095\2\u0097"+
|
||||
"\2\u0099\2\u009b\2\u009d\2\u009f\2\u00a1\67\u00a3\2\u00a5\2\u00a7\2\u00a9"+
|
||||
"\2\u00ab\2\u00ad\2\u00af\2\u00b1\2\u00b3\2\u00b5\2\u00b78\u00b99\u00bb"+
|
||||
"\2\u00bd:\u00bf\2\u00c1\2\u00c3\2\u00c5\2\u00c7\2\u00c9\2\u00cb;\u00cd"+
|
||||
"<\u00cf=\u00d1>\u00d3?\u00d5@\u00d7A\u00d9B\u00dbC\u00ddD\u00dfE\u00e1"+
|
||||
"F\u00e3G\u00e5H\u00e7I\u00e9J\u00ebK\u00edL\u00efM\u00f1N\u00f3O\u00f5"+
|
||||
"P\u00f7Q\u00f9R\u00fbS\u00fdT\u00ffU\u0101V\u0103W\u0105X\u0107Y\u0109"+
|
||||
"Z\u010b[\u010d\\\u010f]\u0111^\u0113_\u0115`\u0117a\u0119b\u011bc\u011d"+
|
||||
"d\u011fe\u0121f\u0123g\u0125h\u0127i\u0129\2\u012b\2\u012dj\u012fk\u0131"+
|
||||
"l\u0133m\u0135n\3\2\30\4\2NNnn\3\2\63;\4\2ZZzz\5\2\62;CHch\3\2\629\4\2"+
|
||||
"DDdd\3\2\62\63\4\2GGgg\4\2--//\6\2FFHHffhh\4\2RRrr\4\2))^^\4\2$$^^\n\2"+
|
||||
"$$))^^ddhhppttvv\3\2\62\65\6\2&&C\\aac|\4\2\2\u0081\ud802\udc01\3\2\ud802"+
|
||||
"\udc01\3\2\udc02\ue001\7\2&&\62;C\\aac|\5\2\13\f\16\17\"\"\4\2\f\f\17"+
|
||||
"\17\2\u045c\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2"+
|
||||
"\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27"+
|
||||
"\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2"+
|
||||
"\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2"+
|
||||
"\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2"+
|
||||
"\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2"+
|
||||
"\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S"+
|
||||
"\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\2]\3\2\2\2\2_\3\2"+
|
||||
"\2\2\2a\3\2\2\2\2c\3\2\2\2\2e\3\2\2\2\2g\3\2\2\2\2i\3\2\2\2\2\u00a1\3"+
|
||||
"\2\2\2\2\u00b7\3\2\2\2\2\u00b9\3\2\2\2\2\u00bd\3\2\2\2\2\u00cb\3\2\2\2"+
|
||||
"\2\u00cd\3\2\2\2\2\u00cf\3\2\2\2\2\u00d1\3\2\2\2\2\u00d3\3\2\2\2\2\u00d5"+
|
||||
"\3\2\2\2\2\u00d7\3\2\2\2\2\u00d9\3\2\2\2\2\u00db\3\2\2\2\2\u00dd\3\2\2"+
|
||||
"\2\2\u00df\3\2\2\2\2\u00e1\3\2\2\2\2\u00e3\3\2\2\2\2\u00e5\3\2\2\2\2\u00e7"+
|
||||
"\3\2\2\2\2\u00e9\3\2\2\2\2\u00eb\3\2\2\2\2\u00ed\3\2\2\2\2\u00ef\3\2\2"+
|
||||
"\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\u013b\3\2\2\2\7\u0144\3\2\2"+
|
||||
"\2\t\u014b\3\2\2\2\13\u0153\3\2\2\2\r\u0159\3\2\2\2\17\u015e\3\2\2\2\21"+
|
||||
"\u0163\3\2\2\2\23\u0169\3\2\2\2\25\u016e\3\2\2\2\27\u0174\3\2\2\2\31\u017a"+
|
||||
"\3\2\2\2\33\u0183\3\2\2\2\35\u018b\3\2\2\2\37\u018e\3\2\2\2!\u0195\3\2"+
|
||||
"\2\2#\u019a\3\2\2\2%\u019f\3\2\2\2\'\u01a7\3\2\2\2)\u01ad\3\2\2\2+\u01b5"+
|
||||
"\3\2\2\2-\u01bb\3\2\2\2/\u01bf\3\2\2\2\61\u01c2\3\2\2\2\63\u01c7\3\2\2"+
|
||||
"\2\65\u01d2\3\2\2\2\67\u01d9\3\2\2\29\u01e4\3\2\2\2;\u01e8\3\2\2\2=\u01f2"+
|
||||
"\3\2\2\2?\u01f7\3\2\2\2A\u01fe\3\2\2\2C\u0202\3\2\2\2E\u020a\3\2\2\2G"+
|
||||
"\u0212\3\2\2\2I\u021c\3\2\2\2K\u0223\3\2\2\2M\u022a\3\2\2\2O\u0230\3\2"+
|
||||
"\2\2Q\u0237\3\2\2\2S\u0240\3\2\2\2U\u0246\3\2\2\2W\u024d\3\2\2\2Y\u025a"+
|
||||
"\3\2\2\2[\u025f\3\2\2\2]\u0265\3\2\2\2_\u026c\3\2\2\2a\u0276\3\2\2\2c"+
|
||||
"\u027a\3\2\2\2e\u027f\3\2\2\2g\u0288\3\2\2\2i\u0292\3\2\2\2k\u0294\3\2"+
|
||||
"\2\2m\u0298\3\2\2\2o\u029c\3\2\2\2q\u02a0\3\2\2\2s\u02a4\3\2\2\2u\u02b0"+
|
||||
"\3\2\2\2w\u02b2\3\2\2\2y\u02bb\3\2\2\2{\u02bd\3\2\2\2}\u02c0\3\2\2\2\177"+
|
||||
"\u02c6\3\2\2\2\u0081\u02c9\3\2\2\2\u0083\u02cd\3\2\2\2\u0085\u02d1\3\2"+
|
||||
"\2\2\u0087\u02d8\3\2\2\2\u0089\u02db\3\2\2\2\u008b\u02e1\3\2\2\2\u008d"+
|
||||
"\u02e3\3\2\2\2\u008f\u02e9\3\2\2\2\u0091\u02f0\3\2\2\2\u0093\u02f3\3\2"+
|
||||
"\2\2\u0095\u02f9\3\2\2\2\u0097\u02fb\3\2\2\2\u0099\u02ff\3\2\2\2\u009b"+
|
||||
"\u0306\3\2\2\2\u009d\u0309\3\2\2\2\u009f\u030f\3\2\2\2\u00a1\u0313\3\2"+
|
||||
"\2\2\u00a3\u0330\3\2\2\2\u00a5\u0332\3\2\2\2\u00a7\u0335\3\2\2\2\u00a9"+
|
||||
"\u0338\3\2\2\2\u00ab\u033c\3\2\2\2\u00ad\u033e\3\2\2\2\u00af\u0340\3\2"+
|
||||
"\2\2\u00b1\u0350\3\2\2\2\u00b3\u0352\3\2\2\2\u00b5\u0355\3\2\2\2\u00b7"+
|
||||
"\u0360\3\2\2\2\u00b9\u036a\3\2\2\2\u00bb\u036c\3\2\2\2\u00bd\u036e\3\2"+
|
||||
"\2\2\u00bf\u0375\3\2\2\2\u00c1\u037b\3\2\2\2\u00c3\u0381\3\2\2\2\u00c5"+
|
||||
"\u038e\3\2\2\2\u00c7\u0390\3\2\2\2\u00c9\u0392\3\2\2\2\u00cb\u0399\3\2"+
|
||||
"\2\2\u00cd\u039e\3\2\2\2\u00cf\u03a0\3\2\2\2\u00d1\u03a2\3\2\2\2\u00d3"+
|
||||
"\u03a4\3\2\2\2\u00d5\u03a6\3\2\2\2\u00d7\u03a8\3\2\2\2\u00d9\u03aa\3\2"+
|
||||
"\2\2\u00db\u03ac\3\2\2\2\u00dd\u03ae\3\2\2\2\u00df\u03b0\3\2\2\2\u00e1"+
|
||||
"\u03b2\3\2\2\2\u00e3\u03b4\3\2\2\2\u00e5\u03b6\3\2\2\2\u00e7\u03b8\3\2"+
|
||||
"\2\2\u00e9\u03ba\3\2\2\2\u00eb\u03bc\3\2\2\2\u00ed\u03be\3\2\2\2\u00ef"+
|
||||
"\u03c1\3\2\2\2\u00f1\u03c4\3\2\2\2\u00f3\u03c7\3\2\2\2\u00f5\u03ca\3\2"+
|
||||
"\2\2\u00f7\u03cd\3\2\2\2\u00f9\u03d0\3\2\2\2\u00fb\u03d3\3\2\2\2\u00fd"+
|
||||
"\u03d6\3\2\2\2\u00ff\u03d8\3\2\2\2\u0101\u03da\3\2\2\2\u0103\u03dc\3\2"+
|
||||
"\2\2\u0105\u03de\3\2\2\2\u0107\u03e0\3\2\2\2\u0109\u03e2\3\2\2\2\u010b"+
|
||||
"\u03e4\3\2\2\2\u010d\u03e6\3\2\2\2\u010f\u03e9\3\2\2\2\u0111\u03ec\3\2"+
|
||||
"\2\2\u0113\u03ef\3\2\2\2\u0115\u03f2\3\2\2\2\u0117\u03f5\3\2\2\2\u0119"+
|
||||
"\u03f8\3\2\2\2\u011b\u03fb\3\2\2\2\u011d\u03fe\3\2\2\2\u011f\u0401\3\2"+
|
||||
"\2\2\u0121\u0404\3\2\2\2\u0123\u0408\3\2\2\2\u0125\u040c\3\2\2\2\u0127"+
|
||||
"\u0411\3\2\2\2\u0129\u041e\3\2\2\2\u012b\u0426\3\2\2\2\u012d\u0428\3\2"+
|
||||
"\2\2\u012f\u042a\3\2\2\2\u0131\u042f\3\2\2\2\u0133\u0435\3\2\2\2\u0135"+
|
||||
"\u0443\3\2\2\2\u0137\u0138\7x\2\2\u0138\u0139\7c\2\2\u0139\u013a\7t\2"+
|
||||
"\2\u013a\4\3\2\2\2\u013b\u013c\7c\2\2\u013c\u013d\7d\2\2\u013d\u013e\7"+
|
||||
"u\2\2\u013e\u013f\7v\2\2\u013f\u0140\7t\2\2\u0140\u0141\7c\2\2\u0141\u0142"+
|
||||
"\7e\2\2\u0142\u0143\7v\2\2\u0143\6\3\2\2\2\u0144\u0145\7c\2\2\u0145\u0146"+
|
||||
"\7u\2\2\u0146\u0147\7u\2\2\u0147\u0148\7g\2\2\u0148\u0149\7t\2\2\u0149"+
|
||||
"\u014a\7v\2\2\u014a\b\3\2\2\2\u014b\u014c\7d\2\2\u014c\u014d\7q\2\2\u014d"+
|
||||
"\u014e\7q\2\2\u014e\u014f\7n\2\2\u014f\u0150\7g\2\2\u0150\u0151\7c\2\2"+
|
||||
"\u0151\u0152\7p\2\2\u0152\n\3\2\2\2\u0153\u0154\7d\2\2\u0154\u0155\7t"+
|
||||
"\2\2\u0155\u0156\7g\2\2\u0156\u0157\7c\2\2\u0157\u0158\7m\2\2\u0158\f"+
|
||||
"\3\2\2\2\u0159\u015a\7d\2\2\u015a\u015b\7{\2\2\u015b\u015c\7v\2\2\u015c"+
|
||||
"\u015d\7g\2\2\u015d\16\3\2\2\2\u015e\u015f\7e\2\2\u015f\u0160\7c\2\2\u0160"+
|
||||
"\u0161\7u\2\2\u0161\u0162\7g\2\2\u0162\20\3\2\2\2\u0163\u0164\7e\2\2\u0164"+
|
||||
"\u0165\7c\2\2\u0165\u0166\7v\2\2\u0166\u0167\7e\2\2\u0167\u0168\7j\2\2"+
|
||||
"\u0168\22\3\2\2\2\u0169\u016a\7e\2\2\u016a\u016b\7j\2\2\u016b\u016c\7"+
|
||||
"c\2\2\u016c\u016d\7t\2\2\u016d\24\3\2\2\2\u016e\u016f\7e\2\2\u016f\u0170"+
|
||||
"\7n\2\2\u0170\u0171\7c\2\2\u0171\u0172\7u\2\2\u0172\u0173\7u\2\2\u0173"+
|
||||
"\26\3\2\2\2\u0174\u0175\7e\2\2\u0175\u0176\7q\2\2\u0176\u0177\7p\2\2\u0177"+
|
||||
"\u0178\7u\2\2\u0178\u0179\7v\2\2\u0179\30\3\2\2\2\u017a\u017b\7e\2\2\u017b"+
|
||||
"\u017c\7q\2\2\u017c\u017d\7p\2\2\u017d\u017e\7v\2\2\u017e\u017f\7k\2\2"+
|
||||
"\u017f\u0180\7p\2\2\u0180\u0181\7w\2\2\u0181\u0182\7g\2\2\u0182\32\3\2"+
|
||||
"\2\2\u0183\u0184\7f\2\2\u0184\u0185\7g\2\2\u0185\u0186\7h\2\2\u0186\u0187"+
|
||||
"\7c\2\2\u0187\u0188\7w\2\2\u0188\u0189\7n\2\2\u0189\u018a\7v\2\2\u018a"+
|
||||
"\34\3\2\2\2\u018b\u018c\7f\2\2\u018c\u018d\7q\2\2\u018d\36\3\2\2\2\u018e"+
|
||||
"\u018f\7f\2\2\u018f\u0190\7q\2\2\u0190\u0191\7w\2\2\u0191\u0192\7d\2\2"+
|
||||
"\u0192\u0193\7n\2\2\u0193\u0194\7g\2\2\u0194 \3\2\2\2\u0195\u0196\7g\2"+
|
||||
"\2\u0196\u0197\7n\2\2\u0197\u0198\7u\2\2\u0198\u0199\7g\2\2\u0199\"\3"+
|
||||
"\2\2\2\u019a\u019b\7g\2\2\u019b\u019c\7p\2\2\u019c\u019d\7w\2\2\u019d"+
|
||||
"\u019e\7o\2\2\u019e$\3\2\2\2\u019f\u01a0\7g\2\2\u01a0\u01a1\7z\2\2\u01a1"+
|
||||
"\u01a2\7v\2\2\u01a2\u01a3\7g\2\2\u01a3\u01a4\7p\2\2\u01a4\u01a5\7f\2\2"+
|
||||
"\u01a5\u01a6\7u\2\2\u01a6&\3\2\2\2\u01a7\u01a8\7h\2\2\u01a8\u01a9\7k\2"+
|
||||
"\2\u01a9\u01aa\7p\2\2\u01aa\u01ab\7c\2\2\u01ab\u01ac\7n\2\2\u01ac(\3\2"+
|
||||
"\2\2\u01ad\u01ae\7h\2\2\u01ae\u01af\7k\2\2\u01af\u01b0\7p\2\2\u01b0\u01b1"+
|
||||
"\7c\2\2\u01b1\u01b2\7n\2\2\u01b2\u01b3\7n\2\2\u01b3\u01b4\7{\2\2\u01b4"+
|
||||
"*\3\2\2\2\u01b5\u01b6\7h\2\2\u01b6\u01b7\7n\2\2\u01b7\u01b8\7q\2\2\u01b8"+
|
||||
"\u01b9\7c\2\2\u01b9\u01ba\7v\2\2\u01ba,\3\2\2\2\u01bb\u01bc\7h\2\2\u01bc"+
|
||||
"\u01bd\7q\2\2\u01bd\u01be\7t\2\2\u01be.\3\2\2\2\u01bf\u01c0\7k\2\2\u01c0"+
|
||||
"\u01c1\7h\2\2\u01c1\60\3\2\2\2\u01c2\u01c3\7i\2\2\u01c3\u01c4\7q\2\2\u01c4"+
|
||||
"\u01c5\7v\2\2\u01c5\u01c6\7q\2\2\u01c6\62\3\2\2\2\u01c7\u01c8\7k\2\2\u01c8"+
|
||||
"\u01c9\7o\2\2\u01c9\u01ca\7r\2\2\u01ca\u01cb\7n\2\2\u01cb\u01cc\7g\2\2"+
|
||||
"\u01cc\u01cd\7o\2\2\u01cd\u01ce\7g\2\2\u01ce\u01cf\7p\2\2\u01cf\u01d0"+
|
||||
"\7v\2\2\u01d0\u01d1\7u\2\2\u01d1\64\3\2\2\2\u01d2\u01d3\7k\2\2\u01d3\u01d4"+
|
||||
"\7o\2\2\u01d4\u01d5\7r\2\2\u01d5\u01d6\7q\2\2\u01d6\u01d7\7t\2\2\u01d7"+
|
||||
"\u01d8\7v\2\2\u01d8\66\3\2\2\2\u01d9\u01da\7k\2\2\u01da\u01db\7p\2\2\u01db"+
|
||||
"\u01dc\7u\2\2\u01dc\u01dd\7v\2\2\u01dd\u01de\7c\2\2\u01de\u01df\7p\2\2"+
|
||||
"\u01df\u01e0\7e\2\2\u01e0\u01e1\7g\2\2\u01e1\u01e2\7q\2\2\u01e2\u01e3"+
|
||||
"\7h\2\2\u01e38\3\2\2\2\u01e4\u01e5\7k\2\2\u01e5\u01e6\7p\2\2\u01e6\u01e7"+
|
||||
"\7v\2\2\u01e7:\3\2\2\2\u01e8\u01e9\7k\2\2\u01e9\u01ea\7p\2\2\u01ea\u01eb"+
|
||||
"\7v\2\2\u01eb\u01ec\7g\2\2\u01ec\u01ed\7t\2\2\u01ed\u01ee\7h\2\2\u01ee"+
|
||||
"\u01ef\7c\2\2\u01ef\u01f0\7e\2\2\u01f0\u01f1\7g\2\2\u01f1<\3\2\2\2\u01f2"+
|
||||
"\u01f3\7n\2\2\u01f3\u01f4\7q\2\2\u01f4\u01f5\7p\2\2\u01f5\u01f6\7i\2\2"+
|
||||
"\u01f6>\3\2\2\2\u01f7\u01f8\7p\2\2\u01f8\u01f9\7c\2\2\u01f9\u01fa\7v\2"+
|
||||
"\2\u01fa\u01fb\7k\2\2\u01fb\u01fc\7x\2\2\u01fc\u01fd\7g\2\2\u01fd@\3\2"+
|
||||
"\2\2\u01fe\u01ff\7p\2\2\u01ff\u0200\7g\2\2\u0200\u0201\7y\2\2\u0201B\3"+
|
||||
"\2\2\2\u0202\u0203\7r\2\2\u0203\u0204\7c\2\2\u0204\u0205\7e\2\2\u0205"+
|
||||
"\u0206\7m\2\2\u0206\u0207\7c\2\2\u0207\u0208\7i\2\2\u0208\u0209\7g\2\2"+
|
||||
"\u0209D\3\2\2\2\u020a\u020b\7r\2\2\u020b\u020c\7t\2\2\u020c\u020d\7k\2"+
|
||||
"\2\u020d\u020e\7x\2\2\u020e\u020f\7c\2\2\u020f\u0210\7v\2\2\u0210\u0211"+
|
||||
"\7g\2\2\u0211F\3\2\2\2\u0212\u0213\7r\2\2\u0213\u0214\7t\2\2\u0214\u0215"+
|
||||
"\7q\2\2\u0215\u0216\7v\2\2\u0216\u0217\7g\2\2\u0217\u0218\7e\2\2\u0218"+
|
||||
"\u0219\7v\2\2\u0219\u021a\7g\2\2\u021a\u021b\7f\2\2\u021bH\3\2\2\2\u021c"+
|
||||
"\u021d\7r\2\2\u021d\u021e\7w\2\2\u021e\u021f\7d\2\2\u021f\u0220\7n\2\2"+
|
||||
"\u0220\u0221\7k\2\2\u0221\u0222\7e\2\2\u0222J\3\2\2\2\u0223\u0224\7t\2"+
|
||||
"\2\u0224\u0225\7g\2\2\u0225\u0226\7v\2\2\u0226\u0227\7w\2\2\u0227\u0228"+
|
||||
"\7t\2\2\u0228\u0229\7p\2\2\u0229L\3\2\2\2\u022a\u022b\7u\2\2\u022b\u022c"+
|
||||
"\7j\2\2\u022c\u022d\7q\2\2\u022d\u022e\7t\2\2\u022e\u022f\7v\2\2\u022f"+
|
||||
"N\3\2\2\2\u0230\u0231\7u\2\2\u0231\u0232\7v\2\2\u0232\u0233\7c\2\2\u0233"+
|
||||
"\u0234\7v\2\2\u0234\u0235\7k\2\2\u0235\u0236\7e\2\2\u0236P\3\2\2\2\u0237"+
|
||||
"\u0238\7u\2\2\u0238\u0239\7v\2\2\u0239\u023a\7t\2\2\u023a\u023b\7k\2\2"+
|
||||
"\u023b\u023c\7e\2\2\u023c\u023d\7v\2\2\u023d\u023e\7h\2\2\u023e\u023f"+
|
||||
"\7r\2\2\u023fR\3\2\2\2\u0240\u0241\7u\2\2\u0241\u0242\7w\2\2\u0242\u0243"+
|
||||
"\7r\2\2\u0243\u0244\7g\2\2\u0244\u0245\7t\2\2\u0245T\3\2\2\2\u0246\u0247"+
|
||||
"\7u\2\2\u0247\u0248\7y\2\2\u0248\u0249\7k\2\2\u0249\u024a\7v\2\2\u024a"+
|
||||
"\u024b\7e\2\2\u024b\u024c\7j\2\2\u024cV\3\2\2\2\u024d\u024e\7u\2\2\u024e"+
|
||||
"\u024f\7{\2\2\u024f\u0250\7p\2\2\u0250\u0251\7e\2\2\u0251\u0252\7j\2\2"+
|
||||
"\u0252\u0253\7t\2\2\u0253\u0254\7q\2\2\u0254\u0255\7p\2\2\u0255\u0256"+
|
||||
"\7k\2\2\u0256\u0257\7|\2\2\u0257\u0258\7g\2\2\u0258\u0259\7f\2\2\u0259"+
|
||||
"X\3\2\2\2\u025a\u025b\7v\2\2\u025b\u025c\7j\2\2\u025c\u025d\7k\2\2\u025d"+
|
||||
"\u025e\7u\2\2\u025eZ\3\2\2\2\u025f\u0260\7v\2\2\u0260\u0261\7j\2\2\u0261"+
|
||||
"\u0262\7t\2\2\u0262\u0263\7q\2\2\u0263\u0264\7y\2\2\u0264\\\3\2\2\2\u0265"+
|
||||
"\u0266\7v\2\2\u0266\u0267\7j\2\2\u0267\u0268\7t\2\2\u0268\u0269\7q\2\2"+
|
||||
"\u0269\u026a\7y\2\2\u026a\u026b\7u\2\2\u026b^\3\2\2\2\u026c\u026d\7v\2"+
|
||||
"\2\u026d\u026e\7t\2\2\u026e\u026f\7c\2\2\u026f\u0270\7p\2\2\u0270\u0271"+
|
||||
"\7u\2\2\u0271\u0272\7k\2\2\u0272\u0273\7g\2\2\u0273\u0274\7p\2\2\u0274"+
|
||||
"\u0275\7v\2\2\u0275`\3\2\2\2\u0276\u0277\7v\2\2\u0277\u0278\7t\2\2\u0278"+
|
||||
"\u0279\7{\2\2\u0279b\3\2\2\2\u027a\u027b\7x\2\2\u027b\u027c\7q\2\2\u027c"+
|
||||
"\u027d\7k\2\2\u027d\u027e\7f\2\2\u027ed\3\2\2\2\u027f\u0280\7x\2\2\u0280"+
|
||||
"\u0281\7q\2\2\u0281\u0282\7n\2\2\u0282\u0283\7c\2\2\u0283\u0284\7v\2\2"+
|
||||
"\u0284\u0285\7k\2\2\u0285\u0286\7n\2\2\u0286\u0287\7g\2\2\u0287f\3\2\2"+
|
||||
"\2\u0288\u0289\7y\2\2\u0289\u028a\7j\2\2\u028a\u028b\7k\2\2\u028b\u028c"+
|
||||
"\7n\2\2\u028c\u028d\7g\2\2\u028dh\3\2\2\2\u028e\u0293\5k\66\2\u028f\u0293"+
|
||||
"\5m\67\2\u0290\u0293\5o8\2\u0291\u0293\5q9\2\u0292\u028e\3\2\2\2\u0292"+
|
||||
"\u028f\3\2\2\2\u0292\u0290\3\2\2\2\u0292\u0291\3\2\2\2\u0293j\3\2\2\2"+
|
||||
"\u0294\u0296\5u;\2\u0295\u0297\5s:\2\u0296\u0295\3\2\2\2\u0296\u0297\3"+
|
||||
"\2\2\2\u0297l\3\2\2\2\u0298\u029a\5\u0083B\2\u0299\u029b\5s:\2\u029a\u0299"+
|
||||
"\3\2\2\2\u029a\u029b\3\2\2\2\u029bn\3\2\2\2\u029c\u029e\5\u008dG\2\u029d"+
|
||||
"\u029f\5s:\2\u029e\u029d\3\2\2\2\u029e\u029f\3\2\2\2\u029fp\3\2\2\2\u02a0"+
|
||||
"\u02a2\5\u0097L\2\u02a1\u02a3\5s:\2\u02a2\u02a1\3\2\2\2\u02a2\u02a3\3"+
|
||||
"\2\2\2\u02a3r\3\2\2\2\u02a4\u02a5\t\2\2\2\u02a5t\3\2\2\2\u02a6\u02b1\7"+
|
||||
"\62\2\2\u02a7\u02ae\5{>\2\u02a8\u02aa\5w<\2\u02a9\u02a8\3\2\2\2\u02a9"+
|
||||
"\u02aa\3\2\2\2\u02aa\u02af\3\2\2\2\u02ab\u02ac\5\u0081A\2\u02ac\u02ad"+
|
||||
"\5w<\2\u02ad\u02af\3\2\2\2\u02ae\u02a9\3\2\2\2\u02ae\u02ab\3\2\2\2\u02af"+
|
||||
"\u02b1\3\2\2\2\u02b0\u02a6\3\2\2\2\u02b0\u02a7\3\2\2\2\u02b1v\3\2\2\2"+
|
||||
"\u02b2\u02b7\5y=\2\u02b3\u02b5\5}?\2\u02b4\u02b3\3\2\2\2\u02b4\u02b5\3"+
|
||||
"\2\2\2\u02b5\u02b6\3\2\2\2\u02b6\u02b8\5y=\2\u02b7\u02b4\3\2\2\2\u02b7"+
|
||||
"\u02b8\3\2\2\2\u02b8x\3\2\2\2\u02b9\u02bc\7\62\2\2\u02ba\u02bc\5{>\2\u02bb"+
|
||||
"\u02b9\3\2\2\2\u02bb\u02ba\3\2\2\2\u02bcz\3\2\2\2\u02bd\u02be\t\3\2\2"+
|
||||
"\u02be|\3\2\2\2\u02bf\u02c1\5\177@\2\u02c0\u02bf\3\2\2\2\u02c1\u02c2\3"+
|
||||
"\2\2\2\u02c2\u02c0\3\2\2\2\u02c2\u02c3\3\2\2\2\u02c3~\3\2\2\2\u02c4\u02c7"+
|
||||
"\5y=\2\u02c5\u02c7\7a\2\2\u02c6\u02c4\3\2\2\2\u02c6\u02c5\3\2\2\2\u02c7"+
|
||||
"\u0080\3\2\2\2\u02c8\u02ca\7a\2\2\u02c9\u02c8\3\2\2\2\u02ca\u02cb\3\2"+
|
||||
"\2\2\u02cb\u02c9\3\2\2\2\u02cb\u02cc\3\2\2\2\u02cc\u0082\3\2\2\2\u02cd"+
|
||||
"\u02ce\7\62\2\2\u02ce\u02cf\t\4\2\2\u02cf\u02d0\5\u0085C\2\u02d0\u0084"+
|
||||
"\3\2\2\2\u02d1\u02d6\5\u0087D\2\u02d2\u02d4\5\u0089E\2\u02d3\u02d2\3\2"+
|
||||
"\2\2\u02d3\u02d4\3\2\2\2\u02d4\u02d5\3\2\2\2\u02d5\u02d7\5\u0087D\2\u02d6"+
|
||||
"\u02d3\3\2\2\2\u02d6\u02d7\3\2\2\2\u02d7\u0086\3\2\2\2\u02d8\u02d9\t\5"+
|
||||
"\2\2\u02d9\u0088\3\2\2\2\u02da\u02dc\5\u008bF\2\u02db\u02da\3\2\2\2\u02dc"+
|
||||
"\u02dd\3\2\2\2\u02dd\u02db\3\2\2\2\u02dd\u02de\3\2\2\2\u02de\u008a\3\2"+
|
||||
"\2\2\u02df\u02e2\5\u0087D\2\u02e0\u02e2\7a\2\2\u02e1\u02df\3\2\2\2\u02e1"+
|
||||
"\u02e0\3\2\2\2\u02e2\u008c\3\2\2\2\u02e3\u02e5\7\62\2\2\u02e4\u02e6\5"+
|
||||
"\u0081A\2\u02e5\u02e4\3\2\2\2\u02e5\u02e6\3\2\2\2\u02e6\u02e7\3\2\2\2"+
|
||||
"\u02e7\u02e8\5\u008fH\2\u02e8\u008e\3\2\2\2\u02e9\u02ee\5\u0091I\2\u02ea"+
|
||||
"\u02ec\5\u0093J\2\u02eb\u02ea\3\2\2\2\u02eb\u02ec\3\2\2\2\u02ec\u02ed"+
|
||||
"\3\2\2\2\u02ed\u02ef\5\u0091I\2\u02ee\u02eb\3\2\2\2\u02ee\u02ef\3\2\2"+
|
||||
"\2\u02ef\u0090\3\2\2\2\u02f0\u02f1\t\6\2\2\u02f1\u0092\3\2\2\2\u02f2\u02f4"+
|
||||
"\5\u0095K\2\u02f3\u02f2\3\2\2\2\u02f4\u02f5\3\2\2\2\u02f5\u02f3\3\2\2"+
|
||||
"\2\u02f5\u02f6\3\2\2\2\u02f6\u0094\3\2\2\2\u02f7\u02fa\5\u0091I\2\u02f8"+
|
||||
"\u02fa\7a\2\2\u02f9\u02f7\3\2\2\2\u02f9\u02f8\3\2\2\2\u02fa\u0096\3\2"+
|
||||
"\2\2\u02fb\u02fc\7\62\2\2\u02fc\u02fd\t\7\2\2\u02fd\u02fe\5\u0099M\2\u02fe"+
|
||||
"\u0098\3\2\2\2\u02ff\u0304\5\u009bN\2\u0300\u0302\5\u009dO\2\u0301\u0300"+
|
||||
"\3\2\2\2\u0301\u0302\3\2\2\2\u0302\u0303\3\2\2\2\u0303\u0305\5\u009bN"+
|
||||
"\2\u0304\u0301\3\2\2\2\u0304\u0305\3\2\2\2\u0305\u009a\3\2\2\2\u0306\u0307"+
|
||||
"\t\b\2\2\u0307\u009c\3\2\2\2\u0308\u030a\5\u009fP\2\u0309\u0308\3\2\2"+
|
||||
"\2\u030a\u030b\3\2\2\2\u030b\u0309\3\2\2\2\u030b\u030c\3\2\2\2\u030c\u009e"+
|
||||
"\3\2\2\2\u030d\u0310\5\u009bN\2\u030e\u0310\7a\2\2\u030f\u030d\3\2\2\2"+
|
||||
"\u030f\u030e\3\2\2\2\u0310\u00a0\3\2\2\2\u0311\u0314\5\u00a3R\2\u0312"+
|
||||
"\u0314\5\u00afX\2\u0313\u0311\3\2\2\2\u0313\u0312\3\2\2\2\u0314\u00a2"+
|
||||
"\3\2\2\2\u0315\u0316\5w<\2\u0316\u0318\7\60\2\2\u0317\u0319\5w<\2\u0318"+
|
||||
"\u0317\3\2\2\2\u0318\u0319\3\2\2\2\u0319\u031b\3\2\2\2\u031a\u031c\5\u00a5"+
|
||||
"S\2\u031b\u031a\3\2\2\2\u031b\u031c\3\2\2\2\u031c\u031e\3\2\2\2\u031d"+
|
||||
"\u031f\5\u00adW\2\u031e\u031d\3\2\2\2\u031e\u031f\3\2\2\2\u031f\u0331"+
|
||||
"\3\2\2\2\u0320\u0321\7\60\2\2\u0321\u0323\5w<\2\u0322\u0324\5\u00a5S\2"+
|
||||
"\u0323\u0322\3\2\2\2\u0323\u0324\3\2\2\2\u0324\u0326\3\2\2\2\u0325\u0327"+
|
||||
"\5\u00adW\2\u0326\u0325\3\2\2\2\u0326\u0327\3\2\2\2\u0327\u0331\3\2\2"+
|
||||
"\2\u0328\u0329\5w<\2\u0329\u032b\5\u00a5S\2\u032a\u032c\5\u00adW\2\u032b"+
|
||||
"\u032a\3\2\2\2\u032b\u032c\3\2\2\2\u032c\u0331\3\2\2\2\u032d\u032e\5w"+
|
||||
"<\2\u032e\u032f\5\u00adW\2\u032f\u0331\3\2\2\2\u0330\u0315\3\2\2\2\u0330"+
|
||||
"\u0320\3\2\2\2\u0330\u0328\3\2\2\2\u0330\u032d\3\2\2\2\u0331\u00a4\3\2"+
|
||||
"\2\2\u0332\u0333\5\u00a7T\2\u0333\u0334\5\u00a9U\2\u0334\u00a6\3\2\2\2"+
|
||||
"\u0335\u0336\t\t\2\2\u0336\u00a8\3\2\2\2\u0337\u0339\5\u00abV\2\u0338"+
|
||||
"\u0337\3\2\2\2\u0338\u0339\3\2\2\2\u0339\u033a\3\2\2\2\u033a\u033b\5w"+
|
||||
"<\2\u033b\u00aa\3\2\2\2\u033c\u033d\t\n\2\2\u033d\u00ac\3\2\2\2\u033e"+
|
||||
"\u033f\t\13\2\2\u033f\u00ae\3\2\2\2\u0340\u0341\5\u00b1Y\2\u0341\u0343"+
|
||||
"\5\u00b3Z\2\u0342\u0344\5\u00adW\2\u0343\u0342\3\2\2\2\u0343\u0344\3\2"+
|
||||
"\2\2\u0344\u00b0\3\2\2\2\u0345\u0347\5\u0083B\2\u0346\u0348\7\60\2\2\u0347"+
|
||||
"\u0346\3\2\2\2\u0347\u0348\3\2\2\2\u0348\u0351\3\2\2\2\u0349\u034a\7\62"+
|
||||
"\2\2\u034a\u034c\t\4\2\2\u034b\u034d\5\u0085C\2\u034c\u034b\3\2\2\2\u034c"+
|
||||
"\u034d\3\2\2\2\u034d\u034e\3\2\2\2\u034e\u034f\7\60\2\2\u034f\u0351\5"+
|
||||
"\u0085C\2\u0350\u0345\3\2\2\2\u0350\u0349\3\2\2\2\u0351\u00b2\3\2\2\2"+
|
||||
"\u0352\u0353\5\u00b5[\2\u0353\u0354\5\u00a9U\2\u0354\u00b4\3\2\2\2\u0355"+
|
||||
"\u0356\t\f\2\2\u0356\u00b6\3\2\2\2\u0357\u0358\7v\2\2\u0358\u0359\7t\2"+
|
||||
"\2\u0359\u035a\7w\2\2\u035a\u0361\7g\2\2\u035b\u035c\7h\2\2\u035c\u035d"+
|
||||
"\7c\2\2\u035d\u035e\7n\2\2\u035e\u035f\7u\2\2\u035f\u0361\7g\2\2\u0360"+
|
||||
"\u0357\3\2\2\2\u0360\u035b\3\2\2\2\u0361\u00b8\3\2\2\2\u0362\u0363\7)"+
|
||||
"\2\2\u0363\u0364\5\u00bb^\2\u0364\u0365\7)\2\2\u0365\u036b\3\2\2\2\u0366"+
|
||||
"\u0367\7)\2\2\u0367\u0368\5\u00c3b\2\u0368\u0369\7)\2\2\u0369\u036b\3"+
|
||||
"\2\2\2\u036a\u0362\3\2\2\2\u036a\u0366\3\2\2\2\u036b\u00ba\3\2\2\2\u036c"+
|
||||
"\u036d\n\r\2\2\u036d\u00bc\3\2\2\2\u036e\u0370\7$\2\2\u036f\u0371\5\u00bf"+
|
||||
"`\2\u0370\u036f\3\2\2\2\u0370\u0371\3\2\2\2\u0371\u0372\3\2\2\2\u0372"+
|
||||
"\u0373\7$\2\2\u0373\u00be\3\2\2\2\u0374\u0376\5\u00c1a\2\u0375\u0374\3"+
|
||||
"\2\2\2\u0376\u0377\3\2\2\2\u0377\u0375\3\2\2\2\u0377\u0378\3\2\2\2\u0378"+
|
||||
"\u00c0\3\2\2\2\u0379\u037c\n\16\2\2\u037a\u037c\5\u00c3b\2\u037b\u0379"+
|
||||
"\3\2\2\2\u037b\u037a\3\2\2\2\u037c\u00c2\3\2\2\2\u037d\u037e\7^\2\2\u037e"+
|
||||
"\u0382\t\17\2\2\u037f\u0382\5\u00c5c\2\u0380\u0382\5\u00c9e\2\u0381\u037d"+
|
||||
"\3\2\2\2\u0381\u037f\3\2\2\2\u0381\u0380\3\2\2\2\u0382\u00c4\3\2\2\2\u0383"+
|
||||
"\u0384\7^\2\2\u0384\u038f\5\u0091I\2\u0385\u0386\7^\2\2\u0386\u0387\5"+
|
||||
"\u0091I\2\u0387\u0388\5\u0091I\2\u0388\u038f\3\2\2\2\u0389\u038a\7^\2"+
|
||||
"\2\u038a\u038b\5\u00c7d\2\u038b\u038c\5\u0091I\2\u038c\u038d\5\u0091I"+
|
||||
"\2\u038d\u038f\3\2\2\2\u038e\u0383\3\2\2\2\u038e\u0385\3\2\2\2\u038e\u0389"+
|
||||
"\3\2\2\2\u038f\u00c6\3\2\2\2\u0390\u0391\t\20\2\2\u0391\u00c8\3\2\2\2"+
|
||||
"\u0392\u0393\7^\2\2\u0393\u0394\7w\2\2\u0394\u0395\5\u0087D\2\u0395\u0396"+
|
||||
"\5\u0087D\2\u0396\u0397\5\u0087D\2\u0397\u0398\5\u0087D\2\u0398\u00ca"+
|
||||
"\3\2\2\2\u0399\u039a\7p\2\2\u039a\u039b\7w\2\2\u039b\u039c\7n\2\2\u039c"+
|
||||
"\u039d\7n\2\2\u039d\u00cc\3\2\2\2\u039e\u039f\7*\2\2\u039f\u00ce\3\2\2"+
|
||||
"\2\u03a0\u03a1\7+\2\2\u03a1\u00d0\3\2\2\2\u03a2\u03a3\7}\2\2\u03a3\u00d2"+
|
||||
"\3\2\2\2\u03a4\u03a5\7\177\2\2\u03a5\u00d4\3\2\2\2\u03a6\u03a7\7]\2\2"+
|
||||
"\u03a7\u00d6\3\2\2\2\u03a8\u03a9\7_\2\2\u03a9\u00d8\3\2\2\2\u03aa\u03ab"+
|
||||
"\7=\2\2\u03ab\u00da\3\2\2\2\u03ac\u03ad\7.\2\2\u03ad\u00dc\3\2\2\2\u03ae"+
|
||||
"\u03af\7\60\2\2\u03af\u00de\3\2\2\2\u03b0\u03b1\7?\2\2\u03b1\u00e0\3\2"+
|
||||
"\2\2\u03b2\u03b3\7@\2\2\u03b3\u00e2\3\2\2\2\u03b4\u03b5\7>\2\2\u03b5\u00e4"+
|
||||
"\3\2\2\2\u03b6\u03b7\7#\2\2\u03b7\u00e6\3\2\2\2\u03b8\u03b9\7\u0080\2"+
|
||||
"\2\u03b9\u00e8\3\2\2\2\u03ba\u03bb\7A\2\2\u03bb\u00ea\3\2\2\2\u03bc\u03bd"+
|
||||
"\7<\2\2\u03bd\u00ec\3\2\2\2\u03be\u03bf\7?\2\2\u03bf\u03c0\7?\2\2\u03c0"+
|
||||
"\u00ee\3\2\2\2\u03c1\u03c2\7>\2\2\u03c2\u03c3\7?\2\2\u03c3\u00f0\3\2\2"+
|
||||
"\2\u03c4\u03c5\7@\2\2\u03c5\u03c6\7?\2\2\u03c6\u00f2\3\2\2\2\u03c7\u03c8"+
|
||||
"\7#\2\2\u03c8\u03c9\7?\2\2\u03c9\u00f4\3\2\2\2\u03ca\u03cb\7(\2\2\u03cb"+
|
||||
"\u03cc\7(\2\2\u03cc\u00f6\3\2\2\2\u03cd\u03ce\7~\2\2\u03ce\u03cf\7~\2"+
|
||||
"\2\u03cf\u00f8\3\2\2\2\u03d0\u03d1\7-\2\2\u03d1\u03d2\7-\2\2\u03d2\u00fa"+
|
||||
"\3\2\2\2\u03d3\u03d4\7/\2\2\u03d4\u03d5\7/\2\2\u03d5\u00fc\3\2\2\2\u03d6"+
|
||||
"\u03d7\7-\2\2\u03d7\u00fe\3\2\2\2\u03d8\u03d9\7/\2\2\u03d9\u0100\3\2\2"+
|
||||
"\2\u03da\u03db\7,\2\2\u03db\u0102\3\2\2\2\u03dc\u03dd\7\61\2\2\u03dd\u0104"+
|
||||
"\3\2\2\2\u03de\u03df\7(\2\2\u03df\u0106\3\2\2\2\u03e0\u03e1\7~\2\2\u03e1"+
|
||||
"\u0108\3\2\2\2\u03e2\u03e3\7`\2\2\u03e3\u010a\3\2\2\2\u03e4\u03e5\7\'"+
|
||||
"\2\2\u03e5\u010c\3\2\2\2\u03e6\u03e7\7/\2\2\u03e7\u03e8\7@\2\2\u03e8\u010e"+
|
||||
"\3\2\2\2\u03e9\u03ea\7<\2\2\u03ea\u03eb\7<\2\2\u03eb\u0110\3\2\2\2\u03ec"+
|
||||
"\u03ed\7-\2\2\u03ed\u03ee\7?\2\2\u03ee\u0112\3\2\2\2\u03ef\u03f0\7/\2"+
|
||||
"\2\u03f0\u03f1\7?\2\2\u03f1\u0114\3\2\2\2\u03f2\u03f3\7,\2\2\u03f3\u03f4"+
|
||||
"\7?\2\2\u03f4\u0116\3\2\2\2\u03f5\u03f6\7\61\2\2\u03f6\u03f7\7?\2\2\u03f7"+
|
||||
"\u0118\3\2\2\2\u03f8\u03f9\7(\2\2\u03f9\u03fa\7?\2\2\u03fa\u011a\3\2\2"+
|
||||
"\2\u03fb\u03fc\7~\2\2\u03fc\u03fd\7?\2\2\u03fd\u011c\3\2\2\2\u03fe\u03ff"+
|
||||
"\7`\2\2\u03ff\u0400\7?\2\2\u0400\u011e\3\2\2\2\u0401\u0402\7\'\2\2\u0402"+
|
||||
"\u0403\7?\2\2\u0403\u0120\3\2\2\2\u0404\u0405\7>\2\2\u0405\u0406\7>\2"+
|
||||
"\2\u0406\u0407\7?\2\2\u0407\u0122\3\2\2\2\u0408\u0409\7@\2\2\u0409\u040a"+
|
||||
"\7@\2\2\u040a\u040b\7?\2\2\u040b\u0124\3\2\2\2\u040c\u040d\7@\2\2\u040d"+
|
||||
"\u040e\7@\2\2\u040e\u040f\7@\2\2\u040f\u0410\7?\2\2\u0410\u0126\3\2\2"+
|
||||
"\2\u0411\u0415\5\u0129\u0095\2\u0412\u0414\5\u012b\u0096\2\u0413\u0412"+
|
||||
"\3\2\2\2\u0414\u0417\3\2\2\2\u0415\u0413\3\2\2\2\u0415\u0416\3\2\2\2\u0416"+
|
||||
"\u0128\3\2\2\2\u0417\u0415\3\2\2\2\u0418\u041f\t\21\2\2\u0419\u041a\n"+
|
||||
"\22\2\2\u041a\u041f\6\u0095\2\2\u041b\u041c\t\23\2\2\u041c\u041d\t\24"+
|
||||
"\2\2\u041d\u041f\6\u0095\3\2\u041e\u0418\3\2\2\2\u041e\u0419\3\2\2\2\u041e"+
|
||||
"\u041b\3\2\2\2\u041f\u012a\3\2\2\2\u0420\u0427\t\25\2\2\u0421\u0422\n"+
|
||||
"\22\2\2\u0422\u0427\6\u0096\4\2\u0423\u0424\t\23\2\2\u0424\u0425\t\24"+
|
||||
"\2\2\u0425\u0427\6\u0096\5\2\u0426\u0420\3\2\2\2\u0426\u0421\3\2\2\2\u0426"+
|
||||
"\u0423\3\2\2\2\u0427\u012c\3\2\2\2\u0428\u0429\7B\2\2\u0429\u012e\3\2"+
|
||||
"\2\2\u042a\u042b\7\60\2\2\u042b\u042c\7\60\2\2\u042c\u042d\7\60\2\2\u042d"+
|
||||
"\u0130\3\2\2\2\u042e\u0430\t\26\2\2\u042f\u042e\3\2\2\2\u0430\u0431\3"+
|
||||
"\2\2\2\u0431\u042f\3\2\2\2\u0431\u0432\3\2\2\2\u0432\u0433\3\2\2\2\u0433"+
|
||||
"\u0434\b\u0099\2\2\u0434\u0132\3\2\2\2\u0435\u0436\7\61\2\2\u0436\u0437"+
|
||||
"\7,\2\2\u0437\u043b\3\2\2\2\u0438\u043a\13\2\2\2\u0439\u0438\3\2\2\2\u043a"+
|
||||
"\u043d\3\2\2\2\u043b\u043c\3\2\2\2\u043b\u0439\3\2\2\2\u043c\u043e\3\2"+
|
||||
"\2\2\u043d\u043b\3\2\2\2\u043e\u043f\7,\2\2\u043f\u0440\7\61\2\2\u0440"+
|
||||
"\u0441\3\2\2\2\u0441\u0442\b\u009a\2\2\u0442\u0134\3\2\2\2\u0443\u0444"+
|
||||
"\7\61\2\2\u0444\u0445\7\61\2\2\u0445\u0449\3\2\2\2\u0446\u0448\n\27\2"+
|
||||
"\2\u0447\u0446\3\2\2\2\u0448\u044b\3\2\2\2\u0449\u0447\3\2\2\2\u0449\u044a"+
|
||||
"\3\2\2\2\u044a\u044c\3\2\2\2\u044b\u0449\3\2\2\2\u044c\u044d\b\u009b\2"+
|
||||
"\2\u044d\u0136\3\2\2\28\2\u0292\u0296\u029a\u029e\u02a2\u02a9\u02ae\u02b0"+
|
||||
"\u02b4\u02b7\u02bb\u02c2\u02c6\u02cb\u02d3\u02d6\u02dd\u02e1\u02e5\u02eb"+
|
||||
"\u02ee\u02f5\u02f9\u0301\u0304\u030b\u030f\u0313\u0318\u031b\u031e\u0323"+
|
||||
"\u0326\u032b\u0330\u0338\u0343\u0347\u034c\u0350\u0360\u036a\u0370\u0377"+
|
||||
"\u037b\u0381\u038e\u0415\u041e\u0426\u0431\u043b\u0449\3\b\2\2";
|
||||
"\t\u0097\4\u0098\t\u0098\4\u0099\t\u0099\4\u009a\t\u009a\3\2\3\2\3\2\3"+
|
||||
"\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\4"+
|
||||
"\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3"+
|
||||
"\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n"+
|
||||
"\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f"+
|
||||
"\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3"+
|
||||
"\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\22\3"+
|
||||
"\22\3\22\3\22\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23\3\24\3"+
|
||||
"\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\25\3\25\3\26\3"+
|
||||
"\26\3\26\3\26\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\31\3\31\3\31\3"+
|
||||
"\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32\3\32\3"+
|
||||
"\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\34\3\34\3"+
|
||||
"\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\36\3\36\3"+
|
||||
"\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3!\3!\3!"+
|
||||
"\3!\3!\3!\3!\3!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\3#\3#\3#\3#\3"+
|
||||
"#\3#\3#\3$\3$\3$\3$\3$\3$\3$\3%\3%\3%\3%\3%\3%\3%\3&\3&\3&\3&\3&\3&\3"+
|
||||
"\'\3\'\3\'\3\'\3\'\3\'\3\'\3(\3(\3(\3(\3(\3(\3(\3(\3(\3)\3)\3)\3)\3)\3"+
|
||||
")\3*\3*\3*\3*\3*\3*\3*\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3,\3,\3"+
|
||||
",\3,\3,\3-\3-\3-\3-\3-\3-\3.\3.\3.\3.\3.\3.\3.\3/\3/\3/\3/\3/\3/\3/\3"+
|
||||
"/\3/\3/\3\60\3\60\3\60\3\60\3\61\3\61\3\61\3\61\3\61\3\62\3\62\3\62\3"+
|
||||
"\62\3\62\3\62\3\62\3\62\3\62\3\63\3\63\3\63\3\63\3\63\3\63\3\64\3\64\3"+
|
||||
"\64\3\64\5\64\u028d\n\64\3\65\3\65\5\65\u0291\n\65\3\66\3\66\5\66\u0295"+
|
||||
"\n\66\3\67\3\67\5\67\u0299\n\67\38\38\58\u029d\n8\39\39\3:\3:\3:\5:\u02a4"+
|
||||
"\n:\3:\3:\3:\5:\u02a9\n:\5:\u02ab\n:\3;\3;\5;\u02af\n;\3;\5;\u02b2\n;"+
|
||||
"\3<\3<\5<\u02b6\n<\3=\3=\3>\6>\u02bb\n>\r>\16>\u02bc\3?\3?\5?\u02c1\n"+
|
||||
"?\3@\6@\u02c4\n@\r@\16@\u02c5\3A\3A\3A\3A\3B\3B\5B\u02ce\nB\3B\5B\u02d1"+
|
||||
"\nB\3C\3C\3D\6D\u02d6\nD\rD\16D\u02d7\3E\3E\5E\u02dc\nE\3F\3F\5F\u02e0"+
|
||||
"\nF\3F\3F\3G\3G\5G\u02e6\nG\3G\5G\u02e9\nG\3H\3H\3I\6I\u02ee\nI\rI\16"+
|
||||
"I\u02ef\3J\3J\5J\u02f4\nJ\3K\3K\3K\3K\3L\3L\5L\u02fc\nL\3L\5L\u02ff\n"+
|
||||
"L\3M\3M\3N\6N\u0304\nN\rN\16N\u0305\3O\3O\5O\u030a\nO\3P\3P\5P\u030e\n"+
|
||||
"P\3Q\3Q\3Q\5Q\u0313\nQ\3Q\5Q\u0316\nQ\3Q\5Q\u0319\nQ\3Q\3Q\3Q\5Q\u031e"+
|
||||
"\nQ\3Q\5Q\u0321\nQ\3Q\3Q\3Q\5Q\u0326\nQ\3Q\3Q\3Q\5Q\u032b\nQ\3R\3R\3R"+
|
||||
"\3S\3S\3T\5T\u0333\nT\3T\3T\3U\3U\3V\3V\3W\3W\3W\5W\u033e\nW\3X\3X\5X"+
|
||||
"\u0342\nX\3X\3X\3X\5X\u0347\nX\3X\3X\5X\u034b\nX\3Y\3Y\3Y\3Z\3Z\3[\3["+
|
||||
"\3[\3[\3[\3[\3[\3[\3[\5[\u035b\n[\3\\\3\\\3\\\3\\\3\\\3\\\3\\\3\\\5\\"+
|
||||
"\u0365\n\\\3]\3]\3^\3^\5^\u036b\n^\3^\3^\3_\6_\u0370\n_\r_\16_\u0371\3"+
|
||||
"`\3`\5`\u0376\n`\3a\3a\3a\3a\5a\u037c\na\3b\3b\3b\3b\3b\3b\3b\3b\3b\3"+
|
||||
"b\3b\5b\u0389\nb\3c\3c\3d\3d\3d\3d\3d\3d\3d\3e\3e\3e\3e\3e\3f\3f\3g\3"+
|
||||
"g\3h\3h\3i\3i\3j\3j\3k\3k\3l\3l\3m\3m\3n\3n\3o\3o\3p\3p\3q\3q\3r\3r\3"+
|
||||
"s\3s\3t\3t\3u\3u\3v\3v\3v\3w\3w\3w\3x\3x\3x\3y\3y\3y\3z\3z\3z\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\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\u0090\3\u0091\3\u0091\3\u0091"+
|
||||
"\3\u0091\3\u0092\3\u0092\3\u0092\3\u0092\3\u0092\3\u0093\3\u0093\7\u0093"+
|
||||
"\u040e\n\u0093\f\u0093\16\u0093\u0411\13\u0093\3\u0094\3\u0094\3\u0094"+
|
||||
"\3\u0094\3\u0094\3\u0094\5\u0094\u0419\n\u0094\3\u0095\3\u0095\3\u0095"+
|
||||
"\3\u0095\3\u0095\3\u0095\5\u0095\u0421\n\u0095\3\u0096\3\u0096\3\u0097"+
|
||||
"\3\u0097\3\u0097\3\u0097\3\u0098\6\u0098\u042a\n\u0098\r\u0098\16\u0098"+
|
||||
"\u042b\3\u0098\3\u0098\3\u0099\3\u0099\3\u0099\3\u0099\7\u0099\u0434\n"+
|
||||
"\u0099\f\u0099\16\u0099\u0437\13\u0099\3\u0099\3\u0099\3\u0099\3\u0099"+
|
||||
"\3\u0099\3\u009a\3\u009a\3\u009a\3\u009a\7\u009a\u0442\n\u009a\f\u009a"+
|
||||
"\16\u009a\u0445\13\u009a\3\u009a\3\u009a\3\u0435\2\u009b\3\3\5\4\7\5\t"+
|
||||
"\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23"+
|
||||
"%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G"+
|
||||
"%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63e\64g\65i\2k\2m\2o\2q\2s\2u\2w\2"+
|
||||
"y\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"+
|
||||
"\66\u00a1\2\u00a3\2\u00a5\2\u00a7\2\u00a9\2\u00ab\2\u00ad\2\u00af\2\u00b1"+
|
||||
"\2\u00b3\2\u00b5\67\u00b78\u00b9\2\u00bb9\u00bd\2\u00bf\2\u00c1\2\u00c3"+
|
||||
"\2\u00c5\2\u00c7\2\u00c9:\u00cb;\u00cd<\u00cf=\u00d1>\u00d3?\u00d5@\u00d7"+
|
||||
"A\u00d9B\u00dbC\u00ddD\u00dfE\u00e1F\u00e3G\u00e5H\u00e7I\u00e9J\u00eb"+
|
||||
"K\u00edL\u00efM\u00f1N\u00f3O\u00f5P\u00f7Q\u00f9R\u00fbS\u00fdT\u00ff"+
|
||||
"U\u0101V\u0103W\u0105X\u0107Y\u0109Z\u010b[\u010d\\\u010f]\u0111^\u0113"+
|
||||
"_\u0115`\u0117a\u0119b\u011bc\u011dd\u011fe\u0121f\u0123g\u0125h\u0127"+
|
||||
"\2\u0129\2\u012bi\u012dj\u012fk\u0131l\u0133m\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\2FFHHf"+
|
||||
"fhh\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\2\u0456\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\2\u009f\3\2\2\2\2\u00b5\3\2\2\2\2\u00b7\3\2\2\2\2\u00bb"+
|
||||
"\3\2\2\2\2\u00c9\3\2\2\2\2\u00cb\3\2\2\2\2\u00cd\3\2\2\2\2\u00cf\3\2\2"+
|
||||
"\2\2\u00d1\3\2\2\2\2\u00d3\3\2\2\2\2\u00d5\3\2\2\2\2\u00d7\3\2\2\2\2\u00d9"+
|
||||
"\3\2\2\2\2\u00db\3\2\2\2\2\u00dd\3\2\2\2\2\u00df\3\2\2\2\2\u00e1\3\2\2"+
|
||||
"\2\2\u00e3\3\2\2\2\2\u00e5\3\2\2\2\2\u00e7\3\2\2\2\2\u00e9\3\2\2\2\2\u00eb"+
|
||||
"\3\2\2\2\2\u00ed\3\2\2\2\2\u00ef\3\2\2\2\2\u00f1\3\2\2\2\2\u00f3\3\2\2"+
|
||||
"\2\2\u00f5\3\2\2\2\2\u00f7\3\2\2\2\2\u00f9\3\2\2\2\2\u00fb\3\2\2\2\2\u00fd"+
|
||||
"\3\2\2\2\2\u00ff\3\2\2\2\2\u0101\3\2\2\2\2\u0103\3\2\2\2\2\u0105\3\2\2"+
|
||||
"\2\2\u0107\3\2\2\2\2\u0109\3\2\2\2\2\u010b\3\2\2\2\2\u010d\3\2\2\2\2\u010f"+
|
||||
"\3\2\2\2\2\u0111\3\2\2\2\2\u0113\3\2\2\2\2\u0115\3\2\2\2\2\u0117\3\2\2"+
|
||||
"\2\2\u0119\3\2\2\2\2\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\u012b\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\3\u0135\3\2\2\2\5\u013e"+
|
||||
"\3\2\2\2\7\u0145\3\2\2\2\t\u014d\3\2\2\2\13\u0153\3\2\2\2\r\u0158\3\2"+
|
||||
"\2\2\17\u015d\3\2\2\2\21\u0163\3\2\2\2\23\u0168\3\2\2\2\25\u016e\3\2\2"+
|
||||
"\2\27\u0174\3\2\2\2\31\u017d\3\2\2\2\33\u0185\3\2\2\2\35\u0188\3\2\2\2"+
|
||||
"\37\u018f\3\2\2\2!\u0194\3\2\2\2#\u0199\3\2\2\2%\u01a1\3\2\2\2\'\u01a7"+
|
||||
"\3\2\2\2)\u01af\3\2\2\2+\u01b5\3\2\2\2-\u01b9\3\2\2\2/\u01bc\3\2\2\2\61"+
|
||||
"\u01c1\3\2\2\2\63\u01cc\3\2\2\2\65\u01d3\3\2\2\2\67\u01de\3\2\2\29\u01e2"+
|
||||
"\3\2\2\2;\u01ec\3\2\2\2=\u01f1\3\2\2\2?\u01f8\3\2\2\2A\u01fc\3\2\2\2C"+
|
||||
"\u0204\3\2\2\2E\u020c\3\2\2\2G\u0216\3\2\2\2I\u021d\3\2\2\2K\u0224\3\2"+
|
||||
"\2\2M\u022a\3\2\2\2O\u0231\3\2\2\2Q\u023a\3\2\2\2S\u0240\3\2\2\2U\u0247"+
|
||||
"\3\2\2\2W\u0254\3\2\2\2Y\u0259\3\2\2\2[\u025f\3\2\2\2]\u0266\3\2\2\2_"+
|
||||
"\u0270\3\2\2\2a\u0274\3\2\2\2c\u0279\3\2\2\2e\u0282\3\2\2\2g\u028c\3\2"+
|
||||
"\2\2i\u028e\3\2\2\2k\u0292\3\2\2\2m\u0296\3\2\2\2o\u029a\3\2\2\2q\u029e"+
|
||||
"\3\2\2\2s\u02aa\3\2\2\2u\u02ac\3\2\2\2w\u02b5\3\2\2\2y\u02b7\3\2\2\2{"+
|
||||
"\u02ba\3\2\2\2}\u02c0\3\2\2\2\177\u02c3\3\2\2\2\u0081\u02c7\3\2\2\2\u0083"+
|
||||
"\u02cb\3\2\2\2\u0085\u02d2\3\2\2\2\u0087\u02d5\3\2\2\2\u0089\u02db\3\2"+
|
||||
"\2\2\u008b\u02dd\3\2\2\2\u008d\u02e3\3\2\2\2\u008f\u02ea\3\2\2\2\u0091"+
|
||||
"\u02ed\3\2\2\2\u0093\u02f3\3\2\2\2\u0095\u02f5\3\2\2\2\u0097\u02f9\3\2"+
|
||||
"\2\2\u0099\u0300\3\2\2\2\u009b\u0303\3\2\2\2\u009d\u0309\3\2\2\2\u009f"+
|
||||
"\u030d\3\2\2\2\u00a1\u032a\3\2\2\2\u00a3\u032c\3\2\2\2\u00a5\u032f\3\2"+
|
||||
"\2\2\u00a7\u0332\3\2\2\2\u00a9\u0336\3\2\2\2\u00ab\u0338\3\2\2\2\u00ad"+
|
||||
"\u033a\3\2\2\2\u00af\u034a\3\2\2\2\u00b1\u034c\3\2\2\2\u00b3\u034f\3\2"+
|
||||
"\2\2\u00b5\u035a\3\2\2\2\u00b7\u0364\3\2\2\2\u00b9\u0366\3\2\2\2\u00bb"+
|
||||
"\u0368\3\2\2\2\u00bd\u036f\3\2\2\2\u00bf\u0375\3\2\2\2\u00c1\u037b\3\2"+
|
||||
"\2\2\u00c3\u0388\3\2\2\2\u00c5\u038a\3\2\2\2\u00c7\u038c\3\2\2\2\u00c9"+
|
||||
"\u0393\3\2\2\2\u00cb\u0398\3\2\2\2\u00cd\u039a\3\2\2\2\u00cf\u039c\3\2"+
|
||||
"\2\2\u00d1\u039e\3\2\2\2\u00d3\u03a0\3\2\2\2\u00d5\u03a2\3\2\2\2\u00d7"+
|
||||
"\u03a4\3\2\2\2\u00d9\u03a6\3\2\2\2\u00db\u03a8\3\2\2\2\u00dd\u03aa\3\2"+
|
||||
"\2\2\u00df\u03ac\3\2\2\2\u00e1\u03ae\3\2\2\2\u00e3\u03b0\3\2\2\2\u00e5"+
|
||||
"\u03b2\3\2\2\2\u00e7\u03b4\3\2\2\2\u00e9\u03b6\3\2\2\2\u00eb\u03b8\3\2"+
|
||||
"\2\2\u00ed\u03bb\3\2\2\2\u00ef\u03be\3\2\2\2\u00f1\u03c1\3\2\2\2\u00f3"+
|
||||
"\u03c4\3\2\2\2\u00f5\u03c7\3\2\2\2\u00f7\u03ca\3\2\2\2\u00f9\u03cd\3\2"+
|
||||
"\2\2\u00fb\u03d0\3\2\2\2\u00fd\u03d2\3\2\2\2\u00ff\u03d4\3\2\2\2\u0101"+
|
||||
"\u03d6\3\2\2\2\u0103\u03d8\3\2\2\2\u0105\u03da\3\2\2\2\u0107\u03dc\3\2"+
|
||||
"\2\2\u0109\u03de\3\2\2\2\u010b\u03e0\3\2\2\2\u010d\u03e3\3\2\2\2\u010f"+
|
||||
"\u03e6\3\2\2\2\u0111\u03e9\3\2\2\2\u0113\u03ec\3\2\2\2\u0115\u03ef\3\2"+
|
||||
"\2\2\u0117\u03f2\3\2\2\2\u0119\u03f5\3\2\2\2\u011b\u03f8\3\2\2\2\u011d"+
|
||||
"\u03fb\3\2\2\2\u011f\u03fe\3\2\2\2\u0121\u0402\3\2\2\2\u0123\u0406\3\2"+
|
||||
"\2\2\u0125\u040b\3\2\2\2\u0127\u0418\3\2\2\2\u0129\u0420\3\2\2\2\u012b"+
|
||||
"\u0422\3\2\2\2\u012d\u0424\3\2\2\2\u012f\u0429\3\2\2\2\u0131\u042f\3\2"+
|
||||
"\2\2\u0133\u043d\3\2\2\2\u0135\u0136\7c\2\2\u0136\u0137\7d\2\2\u0137\u0138"+
|
||||
"\7u\2\2\u0138\u0139\7v\2\2\u0139\u013a\7t\2\2\u013a\u013b\7c\2\2\u013b"+
|
||||
"\u013c\7e\2\2\u013c\u013d\7v\2\2\u013d\4\3\2\2\2\u013e\u013f\7c\2\2\u013f"+
|
||||
"\u0140\7u\2\2\u0140\u0141\7u\2\2\u0141\u0142\7g\2\2\u0142\u0143\7t\2\2"+
|
||||
"\u0143\u0144\7v\2\2\u0144\6\3\2\2\2\u0145\u0146\7d\2\2\u0146\u0147\7q"+
|
||||
"\2\2\u0147\u0148\7q\2\2\u0148\u0149\7n\2\2\u0149\u014a\7g\2\2\u014a\u014b"+
|
||||
"\7c\2\2\u014b\u014c\7p\2\2\u014c\b\3\2\2\2\u014d\u014e\7d\2\2\u014e\u014f"+
|
||||
"\7t\2\2\u014f\u0150\7g\2\2\u0150\u0151\7c\2\2\u0151\u0152\7m\2\2\u0152"+
|
||||
"\n\3\2\2\2\u0153\u0154\7d\2\2\u0154\u0155\7{\2\2\u0155\u0156\7v\2\2\u0156"+
|
||||
"\u0157\7g\2\2\u0157\f\3\2\2\2\u0158\u0159\7e\2\2\u0159\u015a\7c\2\2\u015a"+
|
||||
"\u015b\7u\2\2\u015b\u015c\7g\2\2\u015c\16\3\2\2\2\u015d\u015e\7e\2\2\u015e"+
|
||||
"\u015f\7c\2\2\u015f\u0160\7v\2\2\u0160\u0161\7e\2\2\u0161\u0162\7j\2\2"+
|
||||
"\u0162\20\3\2\2\2\u0163\u0164\7e\2\2\u0164\u0165\7j\2\2\u0165\u0166\7"+
|
||||
"c\2\2\u0166\u0167\7t\2\2\u0167\22\3\2\2\2\u0168\u0169\7e\2\2\u0169\u016a"+
|
||||
"\7n\2\2\u016a\u016b\7c\2\2\u016b\u016c\7u\2\2\u016c\u016d\7u\2\2\u016d"+
|
||||
"\24\3\2\2\2\u016e\u016f\7e\2\2\u016f\u0170\7q\2\2\u0170\u0171\7p\2\2\u0171"+
|
||||
"\u0172\7u\2\2\u0172\u0173\7v\2\2\u0173\26\3\2\2\2\u0174\u0175\7e\2\2\u0175"+
|
||||
"\u0176\7q\2\2\u0176\u0177\7p\2\2\u0177\u0178\7v\2\2\u0178\u0179\7k\2\2"+
|
||||
"\u0179\u017a\7p\2\2\u017a\u017b\7w\2\2\u017b\u017c\7g\2\2\u017c\30\3\2"+
|
||||
"\2\2\u017d\u017e\7f\2\2\u017e\u017f\7g\2\2\u017f\u0180\7h\2\2\u0180\u0181"+
|
||||
"\7c\2\2\u0181\u0182\7w\2\2\u0182\u0183\7n\2\2\u0183\u0184\7v\2\2\u0184"+
|
||||
"\32\3\2\2\2\u0185\u0186\7f\2\2\u0186\u0187\7q\2\2\u0187\34\3\2\2\2\u0188"+
|
||||
"\u0189\7f\2\2\u0189\u018a\7q\2\2\u018a\u018b\7w\2\2\u018b\u018c\7d\2\2"+
|
||||
"\u018c\u018d\7n\2\2\u018d\u018e\7g\2\2\u018e\36\3\2\2\2\u018f\u0190\7"+
|
||||
"g\2\2\u0190\u0191\7n\2\2\u0191\u0192\7u\2\2\u0192\u0193\7g\2\2\u0193 "+
|
||||
"\3\2\2\2\u0194\u0195\7g\2\2\u0195\u0196\7p\2\2\u0196\u0197\7w\2\2\u0197"+
|
||||
"\u0198\7o\2\2\u0198\"\3\2\2\2\u0199\u019a\7g\2\2\u019a\u019b\7z\2\2\u019b"+
|
||||
"\u019c\7v\2\2\u019c\u019d\7g\2\2\u019d\u019e\7p\2\2\u019e\u019f\7f\2\2"+
|
||||
"\u019f\u01a0\7u\2\2\u01a0$\3\2\2\2\u01a1\u01a2\7h\2\2\u01a2\u01a3\7k\2"+
|
||||
"\2\u01a3\u01a4\7p\2\2\u01a4\u01a5\7c\2\2\u01a5\u01a6\7n\2\2\u01a6&\3\2"+
|
||||
"\2\2\u01a7\u01a8\7h\2\2\u01a8\u01a9\7k\2\2\u01a9\u01aa\7p\2\2\u01aa\u01ab"+
|
||||
"\7c\2\2\u01ab\u01ac\7n\2\2\u01ac\u01ad\7n\2\2\u01ad\u01ae\7{\2\2\u01ae"+
|
||||
"(\3\2\2\2\u01af\u01b0\7h\2\2\u01b0\u01b1\7n\2\2\u01b1\u01b2\7q\2\2\u01b2"+
|
||||
"\u01b3\7c\2\2\u01b3\u01b4\7v\2\2\u01b4*\3\2\2\2\u01b5\u01b6\7h\2\2\u01b6"+
|
||||
"\u01b7\7q\2\2\u01b7\u01b8\7t\2\2\u01b8,\3\2\2\2\u01b9\u01ba\7k\2\2\u01ba"+
|
||||
"\u01bb\7h\2\2\u01bb.\3\2\2\2\u01bc\u01bd\7i\2\2\u01bd\u01be\7q\2\2\u01be"+
|
||||
"\u01bf\7v\2\2\u01bf\u01c0\7q\2\2\u01c0\60\3\2\2\2\u01c1\u01c2\7k\2\2\u01c2"+
|
||||
"\u01c3\7o\2\2\u01c3\u01c4\7r\2\2\u01c4\u01c5\7n\2\2\u01c5\u01c6\7g\2\2"+
|
||||
"\u01c6\u01c7\7o\2\2\u01c7\u01c8\7g\2\2\u01c8\u01c9\7p\2\2\u01c9\u01ca"+
|
||||
"\7v\2\2\u01ca\u01cb\7u\2\2\u01cb\62\3\2\2\2\u01cc\u01cd\7k\2\2\u01cd\u01ce"+
|
||||
"\7o\2\2\u01ce\u01cf\7r\2\2\u01cf\u01d0\7q\2\2\u01d0\u01d1\7t\2\2\u01d1"+
|
||||
"\u01d2\7v\2\2\u01d2\64\3\2\2\2\u01d3\u01d4\7k\2\2\u01d4\u01d5\7p\2\2\u01d5"+
|
||||
"\u01d6\7u\2\2\u01d6\u01d7\7v\2\2\u01d7\u01d8\7c\2\2\u01d8\u01d9\7p\2\2"+
|
||||
"\u01d9\u01da\7e\2\2\u01da\u01db\7g\2\2\u01db\u01dc\7q\2\2\u01dc\u01dd"+
|
||||
"\7h\2\2\u01dd\66\3\2\2\2\u01de\u01df\7k\2\2\u01df\u01e0\7p\2\2\u01e0\u01e1"+
|
||||
"\7v\2\2\u01e18\3\2\2\2\u01e2\u01e3\7k\2\2\u01e3\u01e4\7p\2\2\u01e4\u01e5"+
|
||||
"\7v\2\2\u01e5\u01e6\7g\2\2\u01e6\u01e7\7t\2\2\u01e7\u01e8\7h\2\2\u01e8"+
|
||||
"\u01e9\7c\2\2\u01e9\u01ea\7e\2\2\u01ea\u01eb\7g\2\2\u01eb:\3\2\2\2\u01ec"+
|
||||
"\u01ed\7n\2\2\u01ed\u01ee\7q\2\2\u01ee\u01ef\7p\2\2\u01ef\u01f0\7i\2\2"+
|
||||
"\u01f0<\3\2\2\2\u01f1\u01f2\7p\2\2\u01f2\u01f3\7c\2\2\u01f3\u01f4\7v\2"+
|
||||
"\2\u01f4\u01f5\7k\2\2\u01f5\u01f6\7x\2\2\u01f6\u01f7\7g\2\2\u01f7>\3\2"+
|
||||
"\2\2\u01f8\u01f9\7p\2\2\u01f9\u01fa\7g\2\2\u01fa\u01fb\7y\2\2\u01fb@\3"+
|
||||
"\2\2\2\u01fc\u01fd\7r\2\2\u01fd\u01fe\7c\2\2\u01fe\u01ff\7e\2\2\u01ff"+
|
||||
"\u0200\7m\2\2\u0200\u0201\7c\2\2\u0201\u0202\7i\2\2\u0202\u0203\7g\2\2"+
|
||||
"\u0203B\3\2\2\2\u0204\u0205\7r\2\2\u0205\u0206\7t\2\2\u0206\u0207\7k\2"+
|
||||
"\2\u0207\u0208\7x\2\2\u0208\u0209\7c\2\2\u0209\u020a\7v\2\2\u020a\u020b"+
|
||||
"\7g\2\2\u020bD\3\2\2\2\u020c\u020d\7r\2\2\u020d\u020e\7t\2\2\u020e\u020f"+
|
||||
"\7q\2\2\u020f\u0210\7v\2\2\u0210\u0211\7g\2\2\u0211\u0212\7e\2\2\u0212"+
|
||||
"\u0213\7v\2\2\u0213\u0214\7g\2\2\u0214\u0215\7f\2\2\u0215F\3\2\2\2\u0216"+
|
||||
"\u0217\7r\2\2\u0217\u0218\7w\2\2\u0218\u0219\7d\2\2\u0219\u021a\7n\2\2"+
|
||||
"\u021a\u021b\7k\2\2\u021b\u021c\7e\2\2\u021cH\3\2\2\2\u021d\u021e\7t\2"+
|
||||
"\2\u021e\u021f\7g\2\2\u021f\u0220\7v\2\2\u0220\u0221\7w\2\2\u0221\u0222"+
|
||||
"\7t\2\2\u0222\u0223\7p\2\2\u0223J\3\2\2\2\u0224\u0225\7u\2\2\u0225\u0226"+
|
||||
"\7j\2\2\u0226\u0227\7q\2\2\u0227\u0228\7t\2\2\u0228\u0229\7v\2\2\u0229"+
|
||||
"L\3\2\2\2\u022a\u022b\7u\2\2\u022b\u022c\7v\2\2\u022c\u022d\7c\2\2\u022d"+
|
||||
"\u022e\7v\2\2\u022e\u022f\7k\2\2\u022f\u0230\7e\2\2\u0230N\3\2\2\2\u0231"+
|
||||
"\u0232\7u\2\2\u0232\u0233\7v\2\2\u0233\u0234\7t\2\2\u0234\u0235\7k\2\2"+
|
||||
"\u0235\u0236\7e\2\2\u0236\u0237\7v\2\2\u0237\u0238\7h\2\2\u0238\u0239"+
|
||||
"\7r\2\2\u0239P\3\2\2\2\u023a\u023b\7u\2\2\u023b\u023c\7w\2\2\u023c\u023d"+
|
||||
"\7r\2\2\u023d\u023e\7g\2\2\u023e\u023f\7t\2\2\u023fR\3\2\2\2\u0240\u0241"+
|
||||
"\7u\2\2\u0241\u0242\7y\2\2\u0242\u0243\7k\2\2\u0243\u0244\7v\2\2\u0244"+
|
||||
"\u0245\7e\2\2\u0245\u0246\7j\2\2\u0246T\3\2\2\2\u0247\u0248\7u\2\2\u0248"+
|
||||
"\u0249\7{\2\2\u0249\u024a\7p\2\2\u024a\u024b\7e\2\2\u024b\u024c\7j\2\2"+
|
||||
"\u024c\u024d\7t\2\2\u024d\u024e\7q\2\2\u024e\u024f\7p\2\2\u024f\u0250"+
|
||||
"\7k\2\2\u0250\u0251\7|\2\2\u0251\u0252\7g\2\2\u0252\u0253\7f\2\2\u0253"+
|
||||
"V\3\2\2\2\u0254\u0255\7v\2\2\u0255\u0256\7j\2\2\u0256\u0257\7k\2\2\u0257"+
|
||||
"\u0258\7u\2\2\u0258X\3\2\2\2\u0259\u025a\7v\2\2\u025a\u025b\7j\2\2\u025b"+
|
||||
"\u025c\7t\2\2\u025c\u025d\7q\2\2\u025d\u025e\7y\2\2\u025eZ\3\2\2\2\u025f"+
|
||||
"\u0260\7v\2\2\u0260\u0261\7j\2\2\u0261\u0262\7t\2\2\u0262\u0263\7q\2\2"+
|
||||
"\u0263\u0264\7y\2\2\u0264\u0265\7u\2\2\u0265\\\3\2\2\2\u0266\u0267\7v"+
|
||||
"\2\2\u0267\u0268\7t\2\2\u0268\u0269\7c\2\2\u0269\u026a\7p\2\2\u026a\u026b"+
|
||||
"\7u\2\2\u026b\u026c\7k\2\2\u026c\u026d\7g\2\2\u026d\u026e\7p\2\2\u026e"+
|
||||
"\u026f\7v\2\2\u026f^\3\2\2\2\u0270\u0271\7v\2\2\u0271\u0272\7t\2\2\u0272"+
|
||||
"\u0273\7{\2\2\u0273`\3\2\2\2\u0274\u0275\7x\2\2\u0275\u0276\7q\2\2\u0276"+
|
||||
"\u0277\7k\2\2\u0277\u0278\7f\2\2\u0278b\3\2\2\2\u0279\u027a\7x\2\2\u027a"+
|
||||
"\u027b\7q\2\2\u027b\u027c\7n\2\2\u027c\u027d\7c\2\2\u027d\u027e\7v\2\2"+
|
||||
"\u027e\u027f\7k\2\2\u027f\u0280\7n\2\2\u0280\u0281\7g\2\2\u0281d\3\2\2"+
|
||||
"\2\u0282\u0283\7y\2\2\u0283\u0284\7j\2\2\u0284\u0285\7k\2\2\u0285\u0286"+
|
||||
"\7n\2\2\u0286\u0287\7g\2\2\u0287f\3\2\2\2\u0288\u028d\5i\65\2\u0289\u028d"+
|
||||
"\5k\66\2\u028a\u028d\5m\67\2\u028b\u028d\5o8\2\u028c\u0288\3\2\2\2\u028c"+
|
||||
"\u0289\3\2\2\2\u028c\u028a\3\2\2\2\u028c\u028b\3\2\2\2\u028dh\3\2\2\2"+
|
||||
"\u028e\u0290\5s:\2\u028f\u0291\5q9\2\u0290\u028f\3\2\2\2\u0290\u0291\3"+
|
||||
"\2\2\2\u0291j\3\2\2\2\u0292\u0294\5\u0081A\2\u0293\u0295\5q9\2\u0294\u0293"+
|
||||
"\3\2\2\2\u0294\u0295\3\2\2\2\u0295l\3\2\2\2\u0296\u0298\5\u008bF\2\u0297"+
|
||||
"\u0299\5q9\2\u0298\u0297\3\2\2\2\u0298\u0299\3\2\2\2\u0299n\3\2\2\2\u029a"+
|
||||
"\u029c\5\u0095K\2\u029b\u029d\5q9\2\u029c\u029b\3\2\2\2\u029c\u029d\3"+
|
||||
"\2\2\2\u029dp\3\2\2\2\u029e\u029f\t\2\2\2\u029fr\3\2\2\2\u02a0\u02ab\7"+
|
||||
"\62\2\2\u02a1\u02a8\5y=\2\u02a2\u02a4\5u;\2\u02a3\u02a2\3\2\2\2\u02a3"+
|
||||
"\u02a4\3\2\2\2\u02a4\u02a9\3\2\2\2\u02a5\u02a6\5\177@\2\u02a6\u02a7\5"+
|
||||
"u;\2\u02a7\u02a9\3\2\2\2\u02a8\u02a3\3\2\2\2\u02a8\u02a5\3\2\2\2\u02a9"+
|
||||
"\u02ab\3\2\2\2\u02aa\u02a0\3\2\2\2\u02aa\u02a1\3\2\2\2\u02abt\3\2\2\2"+
|
||||
"\u02ac\u02b1\5w<\2\u02ad\u02af\5{>\2\u02ae\u02ad\3\2\2\2\u02ae\u02af\3"+
|
||||
"\2\2\2\u02af\u02b0\3\2\2\2\u02b0\u02b2\5w<\2\u02b1\u02ae\3\2\2\2\u02b1"+
|
||||
"\u02b2\3\2\2\2\u02b2v\3\2\2\2\u02b3\u02b6\7\62\2\2\u02b4\u02b6\5y=\2\u02b5"+
|
||||
"\u02b3\3\2\2\2\u02b5\u02b4\3\2\2\2\u02b6x\3\2\2\2\u02b7\u02b8\t\3\2\2"+
|
||||
"\u02b8z\3\2\2\2\u02b9\u02bb\5}?\2\u02ba\u02b9\3\2\2\2\u02bb\u02bc\3\2"+
|
||||
"\2\2\u02bc\u02ba\3\2\2\2\u02bc\u02bd\3\2\2\2\u02bd|\3\2\2\2\u02be\u02c1"+
|
||||
"\5w<\2\u02bf\u02c1\7a\2\2\u02c0\u02be\3\2\2\2\u02c0\u02bf\3\2\2\2\u02c1"+
|
||||
"~\3\2\2\2\u02c2\u02c4\7a\2\2\u02c3\u02c2\3\2\2\2\u02c4\u02c5\3\2\2\2\u02c5"+
|
||||
"\u02c3\3\2\2\2\u02c5\u02c6\3\2\2\2\u02c6\u0080\3\2\2\2\u02c7\u02c8\7\62"+
|
||||
"\2\2\u02c8\u02c9\t\4\2\2\u02c9\u02ca\5\u0083B\2\u02ca\u0082\3\2\2\2\u02cb"+
|
||||
"\u02d0\5\u0085C\2\u02cc\u02ce\5\u0087D\2\u02cd\u02cc\3\2\2\2\u02cd\u02ce"+
|
||||
"\3\2\2\2\u02ce\u02cf\3\2\2\2\u02cf\u02d1\5\u0085C\2\u02d0\u02cd\3\2\2"+
|
||||
"\2\u02d0\u02d1\3\2\2\2\u02d1\u0084\3\2\2\2\u02d2\u02d3\t\5\2\2\u02d3\u0086"+
|
||||
"\3\2\2\2\u02d4\u02d6\5\u0089E\2\u02d5\u02d4\3\2\2\2\u02d6\u02d7\3\2\2"+
|
||||
"\2\u02d7\u02d5\3\2\2\2\u02d7\u02d8\3\2\2\2\u02d8\u0088\3\2\2\2\u02d9\u02dc"+
|
||||
"\5\u0085C\2\u02da\u02dc\7a\2\2\u02db\u02d9\3\2\2\2\u02db\u02da\3\2\2\2"+
|
||||
"\u02dc\u008a\3\2\2\2\u02dd\u02df\7\62\2\2\u02de\u02e0\5\177@\2\u02df\u02de"+
|
||||
"\3\2\2\2\u02df\u02e0\3\2\2\2\u02e0\u02e1\3\2\2\2\u02e1\u02e2\5\u008dG"+
|
||||
"\2\u02e2\u008c\3\2\2\2\u02e3\u02e8\5\u008fH\2\u02e4\u02e6\5\u0091I\2\u02e5"+
|
||||
"\u02e4\3\2\2\2\u02e5\u02e6\3\2\2\2\u02e6\u02e7\3\2\2\2\u02e7\u02e9\5\u008f"+
|
||||
"H\2\u02e8\u02e5\3\2\2\2\u02e8\u02e9\3\2\2\2\u02e9\u008e\3\2\2\2\u02ea"+
|
||||
"\u02eb\t\6\2\2\u02eb\u0090\3\2\2\2\u02ec\u02ee\5\u0093J\2\u02ed\u02ec"+
|
||||
"\3\2\2\2\u02ee\u02ef\3\2\2\2\u02ef\u02ed\3\2\2\2\u02ef\u02f0\3\2\2\2\u02f0"+
|
||||
"\u0092\3\2\2\2\u02f1\u02f4\5\u008fH\2\u02f2\u02f4\7a\2\2\u02f3\u02f1\3"+
|
||||
"\2\2\2\u02f3\u02f2\3\2\2\2\u02f4\u0094\3\2\2\2\u02f5\u02f6\7\62\2\2\u02f6"+
|
||||
"\u02f7\t\7\2\2\u02f7\u02f8\5\u0097L\2\u02f8\u0096\3\2\2\2\u02f9\u02fe"+
|
||||
"\5\u0099M\2\u02fa\u02fc\5\u009bN\2\u02fb\u02fa\3\2\2\2\u02fb\u02fc\3\2"+
|
||||
"\2\2\u02fc\u02fd\3\2\2\2\u02fd\u02ff\5\u0099M\2\u02fe\u02fb\3\2\2\2\u02fe"+
|
||||
"\u02ff\3\2\2\2\u02ff\u0098\3\2\2\2\u0300\u0301\t\b\2\2\u0301\u009a\3\2"+
|
||||
"\2\2\u0302\u0304\5\u009dO\2\u0303\u0302\3\2\2\2\u0304\u0305\3\2\2\2\u0305"+
|
||||
"\u0303\3\2\2\2\u0305\u0306\3\2\2\2\u0306\u009c\3\2\2\2\u0307\u030a\5\u0099"+
|
||||
"M\2\u0308\u030a\7a\2\2\u0309\u0307\3\2\2\2\u0309\u0308\3\2\2\2\u030a\u009e"+
|
||||
"\3\2\2\2\u030b\u030e\5\u00a1Q\2\u030c\u030e\5\u00adW\2\u030d\u030b\3\2"+
|
||||
"\2\2\u030d\u030c\3\2\2\2\u030e\u00a0\3\2\2\2\u030f\u0310\5u;\2\u0310\u0312"+
|
||||
"\7\60\2\2\u0311\u0313\5u;\2\u0312\u0311\3\2\2\2\u0312\u0313\3\2\2\2\u0313"+
|
||||
"\u0315\3\2\2\2\u0314\u0316\5\u00a3R\2\u0315\u0314\3\2\2\2\u0315\u0316"+
|
||||
"\3\2\2\2\u0316\u0318\3\2\2\2\u0317\u0319\5\u00abV\2\u0318\u0317\3\2\2"+
|
||||
"\2\u0318\u0319\3\2\2\2\u0319\u032b\3\2\2\2\u031a\u031b\7\60\2\2\u031b"+
|
||||
"\u031d\5u;\2\u031c\u031e\5\u00a3R\2\u031d\u031c\3\2\2\2\u031d\u031e\3"+
|
||||
"\2\2\2\u031e\u0320\3\2\2\2\u031f\u0321\5\u00abV\2\u0320\u031f\3\2\2\2"+
|
||||
"\u0320\u0321\3\2\2\2\u0321\u032b\3\2\2\2\u0322\u0323\5u;\2\u0323\u0325"+
|
||||
"\5\u00a3R\2\u0324\u0326\5\u00abV\2\u0325\u0324\3\2\2\2\u0325\u0326\3\2"+
|
||||
"\2\2\u0326\u032b\3\2\2\2\u0327\u0328\5u;\2\u0328\u0329\5\u00abV\2\u0329"+
|
||||
"\u032b\3\2\2\2\u032a\u030f\3\2\2\2\u032a\u031a\3\2\2\2\u032a\u0322\3\2"+
|
||||
"\2\2\u032a\u0327\3\2\2\2\u032b\u00a2\3\2\2\2\u032c\u032d\5\u00a5S\2\u032d"+
|
||||
"\u032e\5\u00a7T\2\u032e\u00a4\3\2\2\2\u032f\u0330\t\t\2\2\u0330\u00a6"+
|
||||
"\3\2\2\2\u0331\u0333\5\u00a9U\2\u0332\u0331\3\2\2\2\u0332\u0333\3\2\2"+
|
||||
"\2\u0333\u0334\3\2\2\2\u0334\u0335\5u;\2\u0335\u00a8\3\2\2\2\u0336\u0337"+
|
||||
"\t\n\2\2\u0337\u00aa\3\2\2\2\u0338\u0339\t\13\2\2\u0339\u00ac\3\2\2\2"+
|
||||
"\u033a\u033b\5\u00afX\2\u033b\u033d\5\u00b1Y\2\u033c\u033e\5\u00abV\2"+
|
||||
"\u033d\u033c\3\2\2\2\u033d\u033e\3\2\2\2\u033e\u00ae\3\2\2\2\u033f\u0341"+
|
||||
"\5\u0081A\2\u0340\u0342\7\60\2\2\u0341\u0340\3\2\2\2\u0341\u0342\3\2\2"+
|
||||
"\2\u0342\u034b\3\2\2\2\u0343\u0344\7\62\2\2\u0344\u0346\t\4\2\2\u0345"+
|
||||
"\u0347\5\u0083B\2\u0346\u0345\3\2\2\2\u0346\u0347\3\2\2\2\u0347\u0348"+
|
||||
"\3\2\2\2\u0348\u0349\7\60\2\2\u0349\u034b\5\u0083B\2\u034a\u033f\3\2\2"+
|
||||
"\2\u034a\u0343\3\2\2\2\u034b\u00b0\3\2\2\2\u034c\u034d\5\u00b3Z\2\u034d"+
|
||||
"\u034e\5\u00a7T\2\u034e\u00b2\3\2\2\2\u034f\u0350\t\f\2\2\u0350\u00b4"+
|
||||
"\3\2\2\2\u0351\u0352\7v\2\2\u0352\u0353\7t\2\2\u0353\u0354\7w\2\2\u0354"+
|
||||
"\u035b\7g\2\2\u0355\u0356\7h\2\2\u0356\u0357\7c\2\2\u0357\u0358\7n\2\2"+
|
||||
"\u0358\u0359\7u\2\2\u0359\u035b\7g\2\2\u035a\u0351\3\2\2\2\u035a\u0355"+
|
||||
"\3\2\2\2\u035b\u00b6\3\2\2\2\u035c\u035d\7)\2\2\u035d\u035e\5\u00b9]\2"+
|
||||
"\u035e\u035f\7)\2\2\u035f\u0365\3\2\2\2\u0360\u0361\7)\2\2\u0361\u0362"+
|
||||
"\5\u00c1a\2\u0362\u0363\7)\2\2\u0363\u0365\3\2\2\2\u0364\u035c\3\2\2\2"+
|
||||
"\u0364\u0360\3\2\2\2\u0365\u00b8\3\2\2\2\u0366\u0367\n\r\2\2\u0367\u00ba"+
|
||||
"\3\2\2\2\u0368\u036a\7$\2\2\u0369\u036b\5\u00bd_\2\u036a\u0369\3\2\2\2"+
|
||||
"\u036a\u036b\3\2\2\2\u036b\u036c\3\2\2\2\u036c\u036d\7$\2\2\u036d\u00bc"+
|
||||
"\3\2\2\2\u036e\u0370\5\u00bf`\2\u036f\u036e\3\2\2\2\u0370\u0371\3\2\2"+
|
||||
"\2\u0371\u036f\3\2\2\2\u0371\u0372\3\2\2\2\u0372\u00be\3\2\2\2\u0373\u0376"+
|
||||
"\n\16\2\2\u0374\u0376\5\u00c1a\2\u0375\u0373\3\2\2\2\u0375\u0374\3\2\2"+
|
||||
"\2\u0376\u00c0\3\2\2\2\u0377\u0378\7^\2\2\u0378\u037c\t\17\2\2\u0379\u037c"+
|
||||
"\5\u00c3b\2\u037a\u037c\5\u00c7d\2\u037b\u0377\3\2\2\2\u037b\u0379\3\2"+
|
||||
"\2\2\u037b\u037a\3\2\2\2\u037c\u00c2\3\2\2\2\u037d\u037e\7^\2\2\u037e"+
|
||||
"\u0389\5\u008fH\2\u037f\u0380\7^\2\2\u0380\u0381\5\u008fH\2\u0381\u0382"+
|
||||
"\5\u008fH\2\u0382\u0389\3\2\2\2\u0383\u0384\7^\2\2\u0384\u0385\5\u00c5"+
|
||||
"c\2\u0385\u0386\5\u008fH\2\u0386\u0387\5\u008fH\2\u0387\u0389\3\2\2\2"+
|
||||
"\u0388\u037d\3\2\2\2\u0388\u037f\3\2\2\2\u0388\u0383\3\2\2\2\u0389\u00c4"+
|
||||
"\3\2\2\2\u038a\u038b\t\20\2\2\u038b\u00c6\3\2\2\2\u038c\u038d\7^\2\2\u038d"+
|
||||
"\u038e\7w\2\2\u038e\u038f\5\u0085C\2\u038f\u0390\5\u0085C\2\u0390\u0391"+
|
||||
"\5\u0085C\2\u0391\u0392\5\u0085C\2\u0392\u00c8\3\2\2\2\u0393\u0394\7p"+
|
||||
"\2\2\u0394\u0395\7w\2\2\u0395\u0396\7n\2\2\u0396\u0397\7n\2\2\u0397\u00ca"+
|
||||
"\3\2\2\2\u0398\u0399\7*\2\2\u0399\u00cc\3\2\2\2\u039a\u039b\7+\2\2\u039b"+
|
||||
"\u00ce\3\2\2\2\u039c\u039d\7}\2\2\u039d\u00d0\3\2\2\2\u039e\u039f\7\177"+
|
||||
"\2\2\u039f\u00d2\3\2\2\2\u03a0\u03a1\7]\2\2\u03a1\u00d4\3\2\2\2\u03a2"+
|
||||
"\u03a3\7_\2\2\u03a3\u00d6\3\2\2\2\u03a4\u03a5\7=\2\2\u03a5\u00d8\3\2\2"+
|
||||
"\2\u03a6\u03a7\7.\2\2\u03a7\u00da\3\2\2\2\u03a8\u03a9\7\60\2\2\u03a9\u00dc"+
|
||||
"\3\2\2\2\u03aa\u03ab\7?\2\2\u03ab\u00de\3\2\2\2\u03ac\u03ad\7@\2\2\u03ad"+
|
||||
"\u00e0\3\2\2\2\u03ae\u03af\7>\2\2\u03af\u00e2\3\2\2\2\u03b0\u03b1\7#\2"+
|
||||
"\2\u03b1\u00e4\3\2\2\2\u03b2\u03b3\7\u0080\2\2\u03b3\u00e6\3\2\2\2\u03b4"+
|
||||
"\u03b5\7A\2\2\u03b5\u00e8\3\2\2\2\u03b6\u03b7\7<\2\2\u03b7\u00ea\3\2\2"+
|
||||
"\2\u03b8\u03b9\7?\2\2\u03b9\u03ba\7?\2\2\u03ba\u00ec\3\2\2\2\u03bb\u03bc"+
|
||||
"\7>\2\2\u03bc\u03bd\7?\2\2\u03bd\u00ee\3\2\2\2\u03be\u03bf\7@\2\2\u03bf"+
|
||||
"\u03c0\7?\2\2\u03c0\u00f0\3\2\2\2\u03c1\u03c2\7#\2\2\u03c2\u03c3\7?\2"+
|
||||
"\2\u03c3\u00f2\3\2\2\2\u03c4\u03c5\7(\2\2\u03c5\u03c6\7(\2\2\u03c6\u00f4"+
|
||||
"\3\2\2\2\u03c7\u03c8\7~\2\2\u03c8\u03c9\7~\2\2\u03c9\u00f6\3\2\2\2\u03ca"+
|
||||
"\u03cb\7-\2\2\u03cb\u03cc\7-\2\2\u03cc\u00f8\3\2\2\2\u03cd\u03ce\7/\2"+
|
||||
"\2\u03ce\u03cf\7/\2\2\u03cf\u00fa\3\2\2\2\u03d0\u03d1\7-\2\2\u03d1\u00fc"+
|
||||
"\3\2\2\2\u03d2\u03d3\7/\2\2\u03d3\u00fe\3\2\2\2\u03d4\u03d5\7,\2\2\u03d5"+
|
||||
"\u0100\3\2\2\2\u03d6\u03d7\7\61\2\2\u03d7\u0102\3\2\2\2\u03d8\u03d9\7"+
|
||||
"(\2\2\u03d9\u0104\3\2\2\2\u03da\u03db\7~\2\2\u03db\u0106\3\2\2\2\u03dc"+
|
||||
"\u03dd\7`\2\2\u03dd\u0108\3\2\2\2\u03de\u03df\7\'\2\2\u03df\u010a\3\2"+
|
||||
"\2\2\u03e0\u03e1\7/\2\2\u03e1\u03e2\7@\2\2\u03e2\u010c\3\2\2\2\u03e3\u03e4"+
|
||||
"\7<\2\2\u03e4\u03e5\7<\2\2\u03e5\u010e\3\2\2\2\u03e6\u03e7\7-\2\2\u03e7"+
|
||||
"\u03e8\7?\2\2\u03e8\u0110\3\2\2\2\u03e9\u03ea\7/\2\2\u03ea\u03eb\7?\2"+
|
||||
"\2\u03eb\u0112\3\2\2\2\u03ec\u03ed\7,\2\2\u03ed\u03ee\7?\2\2\u03ee\u0114"+
|
||||
"\3\2\2\2\u03ef\u03f0\7\61\2\2\u03f0\u03f1\7?\2\2\u03f1\u0116\3\2\2\2\u03f2"+
|
||||
"\u03f3\7(\2\2\u03f3\u03f4\7?\2\2\u03f4\u0118\3\2\2\2\u03f5\u03f6\7~\2"+
|
||||
"\2\u03f6\u03f7\7?\2\2\u03f7\u011a\3\2\2\2\u03f8\u03f9\7`\2\2\u03f9\u03fa"+
|
||||
"\7?\2\2\u03fa\u011c\3\2\2\2\u03fb\u03fc\7\'\2\2\u03fc\u03fd\7?\2\2\u03fd"+
|
||||
"\u011e\3\2\2\2\u03fe\u03ff\7>\2\2\u03ff\u0400\7>\2\2\u0400\u0401\7?\2"+
|
||||
"\2\u0401\u0120\3\2\2\2\u0402\u0403\7@\2\2\u0403\u0404\7@\2\2\u0404\u0405"+
|
||||
"\7?\2\2\u0405\u0122\3\2\2\2\u0406\u0407\7@\2\2\u0407\u0408\7@\2\2\u0408"+
|
||||
"\u0409\7@\2\2\u0409\u040a\7?\2\2\u040a\u0124\3\2\2\2\u040b\u040f\5\u0127"+
|
||||
"\u0094\2\u040c\u040e\5\u0129\u0095\2\u040d\u040c\3\2\2\2\u040e\u0411\3"+
|
||||
"\2\2\2\u040f\u040d\3\2\2\2\u040f\u0410\3\2\2\2\u0410\u0126\3\2\2\2\u0411"+
|
||||
"\u040f\3\2\2\2\u0412\u0419\t\21\2\2\u0413\u0414\n\22\2\2\u0414\u0419\6"+
|
||||
"\u0094\2\2\u0415\u0416\t\23\2\2\u0416\u0417\t\24\2\2\u0417\u0419\6\u0094"+
|
||||
"\3\2\u0418\u0412\3\2\2\2\u0418\u0413\3\2\2\2\u0418\u0415\3\2\2\2\u0419"+
|
||||
"\u0128\3\2\2\2\u041a\u0421\t\25\2\2\u041b\u041c\n\22\2\2\u041c\u0421\6"+
|
||||
"\u0095\4\2\u041d\u041e\t\23\2\2\u041e\u041f\t\24\2\2\u041f\u0421\6\u0095"+
|
||||
"\5\2\u0420\u041a\3\2\2\2\u0420\u041b\3\2\2\2\u0420\u041d\3\2\2\2\u0421"+
|
||||
"\u012a\3\2\2\2\u0422\u0423\7B\2\2\u0423\u012c\3\2\2\2\u0424\u0425\7\60"+
|
||||
"\2\2\u0425\u0426\7\60\2\2\u0426\u0427\7\60\2\2\u0427\u012e\3\2\2\2\u0428"+
|
||||
"\u042a\t\26\2\2\u0429\u0428\3\2\2\2\u042a\u042b\3\2\2\2\u042b\u0429\3"+
|
||||
"\2\2\2\u042b\u042c\3\2\2\2\u042c\u042d\3\2\2\2\u042d\u042e\b\u0098\2\2"+
|
||||
"\u042e\u0130\3\2\2\2\u042f\u0430\7\61\2\2\u0430\u0431\7,\2\2\u0431\u0435"+
|
||||
"\3\2\2\2\u0432\u0434\13\2\2\2\u0433\u0432\3\2\2\2\u0434\u0437\3\2\2\2"+
|
||||
"\u0435\u0436\3\2\2\2\u0435\u0433\3\2\2\2\u0436\u0438\3\2\2\2\u0437\u0435"+
|
||||
"\3\2\2\2\u0438\u0439\7,\2\2\u0439\u043a\7\61\2\2\u043a\u043b\3\2\2\2\u043b"+
|
||||
"\u043c\b\u0099\2\2\u043c\u0132\3\2\2\2\u043d\u043e\7\61\2\2\u043e\u043f"+
|
||||
"\7\61\2\2\u043f\u0443\3\2\2\2\u0440\u0442\n\27\2\2\u0441\u0440\3\2\2\2"+
|
||||
"\u0442\u0445\3\2\2\2\u0443\u0441\3\2\2\2\u0443\u0444\3\2\2\2\u0444\u0446"+
|
||||
"\3\2\2\2\u0445\u0443\3\2\2\2\u0446\u0447\b\u009a\2\2\u0447\u0134\3\2\2"+
|
||||
"\28\2\u028c\u0290\u0294\u0298\u029c\u02a3\u02a8\u02aa\u02ae\u02b1\u02b5"+
|
||||
"\u02bc\u02c0\u02c5\u02cd\u02d0\u02d7\u02db\u02df\u02e5\u02e8\u02ef\u02f3"+
|
||||
"\u02fb\u02fe\u0305\u0309\u030d\u0312\u0315\u0318\u031d\u0320\u0325\u032a"+
|
||||
"\u0332\u033d\u0341\u0346\u034a\u035a\u0364\u036a\u0371\u0375\u037b\u0388"+
|
||||
"\u040f\u0418\u0420\u042b\u0435\u0443\3\b\2\2";
|
||||
public static final ATN _ATN =
|
||||
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
|
||||
static {
|
||||
|
@ -1,207 +1,205 @@
|
||||
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
|
||||
'var'=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
|
||||
'null'=57
|
||||
'('=58
|
||||
')'=59
|
||||
'{'=60
|
||||
'}'=61
|
||||
'['=62
|
||||
']'=63
|
||||
';'=64
|
||||
','=65
|
||||
'.'=66
|
||||
'='=67
|
||||
'>'=68
|
||||
'<'=69
|
||||
'!'=70
|
||||
'~'=71
|
||||
'?'=72
|
||||
':'=73
|
||||
'=='=74
|
||||
'<='=75
|
||||
'>='=76
|
||||
'!='=77
|
||||
'&&'=78
|
||||
'||'=79
|
||||
'++'=80
|
||||
'--'=81
|
||||
'+'=82
|
||||
'-'=83
|
||||
'*'=84
|
||||
'/'=85
|
||||
'&'=86
|
||||
'|'=87
|
||||
'^'=88
|
||||
'%'=89
|
||||
'->'=90
|
||||
'::'=91
|
||||
'+='=92
|
||||
'-='=93
|
||||
'*='=94
|
||||
'/='=95
|
||||
'&='=96
|
||||
'|='=97
|
||||
'^='=98
|
||||
'%='=99
|
||||
'<<='=100
|
||||
'>>='=101
|
||||
'>>>='=102
|
||||
'@'=104
|
||||
'...'=105
|
||||
ABSTRACT=1
|
||||
ASSERT=2
|
||||
BOOLEAN=3
|
||||
BREAK=4
|
||||
BYTE=5
|
||||
CASE=6
|
||||
CATCH=7
|
||||
CHAR=8
|
||||
CLASS=9
|
||||
CONST=10
|
||||
CONTINUE=11
|
||||
DEFAULT=12
|
||||
DO=13
|
||||
DOUBLE=14
|
||||
ELSE=15
|
||||
ENUM=16
|
||||
EXTENDS=17
|
||||
FINAL=18
|
||||
FINALLY=19
|
||||
FLOAT=20
|
||||
FOR=21
|
||||
IF=22
|
||||
GOTO=23
|
||||
IMPLEMENTS=24
|
||||
IMPORT=25
|
||||
INSTANCEOF=26
|
||||
INT=27
|
||||
INTERFACE=28
|
||||
LONG=29
|
||||
NATIVE=30
|
||||
NEW=31
|
||||
PACKAGE=32
|
||||
PRIVATE=33
|
||||
PROTECTED=34
|
||||
PUBLIC=35
|
||||
RETURN=36
|
||||
SHORT=37
|
||||
STATIC=38
|
||||
STRICTFP=39
|
||||
SUPER=40
|
||||
SWITCH=41
|
||||
SYNCHRONIZED=42
|
||||
THIS=43
|
||||
THROW=44
|
||||
THROWS=45
|
||||
TRANSIENT=46
|
||||
TRY=47
|
||||
VOID=48
|
||||
VOLATILE=49
|
||||
WHILE=50
|
||||
IntegerLiteral=51
|
||||
FloatingPointLiteral=52
|
||||
BooleanLiteral=53
|
||||
CharacterLiteral=54
|
||||
StringLiteral=55
|
||||
NullLiteral=56
|
||||
LPAREN=57
|
||||
RPAREN=58
|
||||
LBRACE=59
|
||||
RBRACE=60
|
||||
LBRACK=61
|
||||
RBRACK=62
|
||||
SEMI=63
|
||||
COMMA=64
|
||||
DOT=65
|
||||
ASSIGN=66
|
||||
GT=67
|
||||
LT=68
|
||||
BANG=69
|
||||
TILDE=70
|
||||
QUESTION=71
|
||||
COLON=72
|
||||
EQUAL=73
|
||||
LE=74
|
||||
GE=75
|
||||
NOTEQUAL=76
|
||||
AND=77
|
||||
OR=78
|
||||
INC=79
|
||||
DEC=80
|
||||
ADD=81
|
||||
SUB=82
|
||||
MUL=83
|
||||
DIV=84
|
||||
BITAND=85
|
||||
BITOR=86
|
||||
CARET=87
|
||||
MOD=88
|
||||
ARROW=89
|
||||
COLONCOLON=90
|
||||
ADD_ASSIGN=91
|
||||
SUB_ASSIGN=92
|
||||
MUL_ASSIGN=93
|
||||
DIV_ASSIGN=94
|
||||
AND_ASSIGN=95
|
||||
OR_ASSIGN=96
|
||||
XOR_ASSIGN=97
|
||||
MOD_ASSIGN=98
|
||||
LSHIFT_ASSIGN=99
|
||||
RSHIFT_ASSIGN=100
|
||||
URSHIFT_ASSIGN=101
|
||||
Identifier=102
|
||||
AT=103
|
||||
ELLIPSIS=104
|
||||
WS=105
|
||||
COMMENT=106
|
||||
LINE_COMMENT=107
|
||||
'abstract'=1
|
||||
'assert'=2
|
||||
'boolean'=3
|
||||
'break'=4
|
||||
'byte'=5
|
||||
'case'=6
|
||||
'catch'=7
|
||||
'char'=8
|
||||
'class'=9
|
||||
'const'=10
|
||||
'continue'=11
|
||||
'default'=12
|
||||
'do'=13
|
||||
'double'=14
|
||||
'else'=15
|
||||
'enum'=16
|
||||
'extends'=17
|
||||
'final'=18
|
||||
'finally'=19
|
||||
'float'=20
|
||||
'for'=21
|
||||
'if'=22
|
||||
'goto'=23
|
||||
'implements'=24
|
||||
'import'=25
|
||||
'instanceof'=26
|
||||
'int'=27
|
||||
'interface'=28
|
||||
'long'=29
|
||||
'native'=30
|
||||
'new'=31
|
||||
'package'=32
|
||||
'private'=33
|
||||
'protected'=34
|
||||
'public'=35
|
||||
'return'=36
|
||||
'short'=37
|
||||
'static'=38
|
||||
'strictfp'=39
|
||||
'super'=40
|
||||
'switch'=41
|
||||
'synchronized'=42
|
||||
'this'=43
|
||||
'throw'=44
|
||||
'throws'=45
|
||||
'transient'=46
|
||||
'try'=47
|
||||
'void'=48
|
||||
'volatile'=49
|
||||
'while'=50
|
||||
'null'=56
|
||||
'('=57
|
||||
')'=58
|
||||
'{'=59
|
||||
'}'=60
|
||||
'['=61
|
||||
']'=62
|
||||
';'=63
|
||||
','=64
|
||||
'.'=65
|
||||
'='=66
|
||||
'>'=67
|
||||
'<'=68
|
||||
'!'=69
|
||||
'~'=70
|
||||
'?'=71
|
||||
':'=72
|
||||
'=='=73
|
||||
'<='=74
|
||||
'>='=75
|
||||
'!='=76
|
||||
'&&'=77
|
||||
'||'=78
|
||||
'++'=79
|
||||
'--'=80
|
||||
'+'=81
|
||||
'-'=82
|
||||
'*'=83
|
||||
'/'=84
|
||||
'&'=85
|
||||
'|'=86
|
||||
'^'=87
|
||||
'%'=88
|
||||
'->'=89
|
||||
'::'=90
|
||||
'+='=91
|
||||
'-='=92
|
||||
'*='=93
|
||||
'/='=94
|
||||
'&='=95
|
||||
'|='=96
|
||||
'^='=97
|
||||
'%='=98
|
||||
'<<='=99
|
||||
'>>='=100
|
||||
'>>>='=101
|
||||
'@'=103
|
||||
'...'=104
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,9 @@
|
||||
package de.dhbwstuttgart.parser.scope;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import de.dhbwstuttgart.parser.antlr.Java8BaseListener;
|
||||
import de.dhbwstuttgart.syntaxtree.AbstractASTWalker;
|
||||
@ -13,8 +15,8 @@ import de.dhbwstuttgart.parser.antlr.Java8Parser;
|
||||
|
||||
public class GatherNames {
|
||||
|
||||
public static List<String> getNames(Java8Parser.CompilationUnitContext ctx, PackageCrawler packages) throws ClassNotFoundException{
|
||||
List<String> ret = new ArrayList<>();
|
||||
public static Map<String, Integer> getNames(Java8Parser.CompilationUnitContext ctx, PackageCrawler packages) throws ClassNotFoundException{
|
||||
Map<String, Integer> ret = new HashMap<>();
|
||||
String pkgName = getPackageName(ctx);
|
||||
String nameString = "";
|
||||
for (Java8Parser.TypeDeclarationContext typeDecl : ctx.typeDeclaration()){
|
||||
@ -26,6 +28,8 @@ public class GatherNames {
|
||||
else{
|
||||
nameString = typeDecl.interfaceDeclaration().normalInterfaceDeclaration().Identifier().toString();
|
||||
}
|
||||
int numGenerics = typeDecl.interfaceDeclaration().normalInterfaceDeclaration().typeParameters()!=null?
|
||||
typeDecl.interfaceDeclaration().normalInterfaceDeclaration().typeParameters().typeParameterList().typeParameter().size():0;
|
||||
//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){
|
||||
@ -34,7 +38,7 @@ public class GatherNames {
|
||||
}
|
||||
}
|
||||
*/
|
||||
ret.add(nameString);
|
||||
ret.put(nameString, numGenerics);
|
||||
}
|
||||
}
|
||||
else{
|
||||
@ -53,30 +57,36 @@ public class GatherNames {
|
||||
}
|
||||
}
|
||||
*/
|
||||
ret.add(nameString);
|
||||
int numGenerics = typeDecl.classDeclaration().normalClassDeclaration().typeParameters()!=null?
|
||||
typeDecl.classDeclaration().normalClassDeclaration().typeParameters().typeParameterList().typeParameter().size():0;
|
||||
|
||||
ret.put(nameString, numGenerics);
|
||||
}
|
||||
}
|
||||
}
|
||||
ret.addAll(getImports(ctx, packages));
|
||||
ret.putAll(getImports(ctx, packages));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
private static List<String> getImports(Java8Parser.CompilationUnitContext ctx, PackageCrawler packages) throws ClassNotFoundException {
|
||||
List<String> ret = new ArrayList();
|
||||
ret.addAll(packages.getClassNames("java.lang"));
|
||||
for(Java8Parser.ImportDeclarationContext importDeclCtx : ctx.importDeclaration()){
|
||||
public static Map<String, Integer> getImports(Java8Parser.CompilationUnitContext ctx, PackageCrawler packages) throws ClassNotFoundException {
|
||||
Map<String, Integer> ret = new HashMap<>();
|
||||
ClassLoader classLoader = ClassLoader.getSystemClassLoader();
|
||||
//ret.putAll(packages.getClassNames("java.lang"));
|
||||
for(Java8Parser.ImportDeclarationContext importDeclCtx : ctx.importDeclaration()){
|
||||
if(importDeclCtx.singleTypeImportDeclaration() != null){
|
||||
ret.add(importDeclCtx.singleTypeImportDeclaration().typeName().getText());
|
||||
Class cl = classLoader.loadClass(importDeclCtx.singleTypeImportDeclaration().typeName().getText());
|
||||
ret.put(cl.getName(), cl.getTypeParameters().length);
|
||||
}
|
||||
else if(importDeclCtx.typeImportOnDemandDeclaration() != null){
|
||||
ret.addAll(packages.getClassNames(importDeclCtx.typeImportOnDemandDeclaration().packageOrTypeName().getText()));
|
||||
ret.putAll(packages.getClassNames(importDeclCtx.typeImportOnDemandDeclaration().packageOrTypeName().getText()));
|
||||
}
|
||||
else if(importDeclCtx.singleStaticImportDeclaration() != null){
|
||||
ret.add(importDeclCtx.singleStaticImportDeclaration().typeName().getText()+"."+importDeclCtx.singleStaticImportDeclaration().Identifier().getText());
|
||||
}
|
||||
Class cl = classLoader.loadClass(importDeclCtx.singleStaticImportDeclaration().typeName().getText()+"."+importDeclCtx.singleStaticImportDeclaration().Identifier().getText());
|
||||
ret.put(cl.getName(), cl.getTypeParameters().length);
|
||||
}
|
||||
else{
|
||||
ret.addAll(packages.getClassNames(importDeclCtx.staticImportOnDemandDeclaration().typeName().getText()));
|
||||
ret.putAll(packages.getClassNames(importDeclCtx.staticImportOnDemandDeclaration().typeName().getText()));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
@ -1,22 +0,0 @@
|
||||
package de.dhbwstuttgart.parser.scope;
|
||||
|
||||
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.GenericContext;
|
||||
|
||||
public class GenericTypeName extends JavaClassName {
|
||||
private final static String DELIMITER = "%";
|
||||
|
||||
private final JavaClassName parentClass;
|
||||
private final String methodName;
|
||||
|
||||
public GenericTypeName(GenericContext genericContext, String name) {
|
||||
super(name);
|
||||
this.parentClass = genericContext.parentClass;
|
||||
this.methodName = genericContext.parentMethod;
|
||||
}
|
||||
|
||||
public String getUniqueIdentifier() {
|
||||
return parentClass.toString()
|
||||
+ DELIMITER + methodName
|
||||
+ DELIMITER + super.toString();
|
||||
}
|
||||
}
|
@ -49,8 +49,10 @@ public class JavaClassName {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
||||
/*
|
||||
result = prime * result
|
||||
+ ((packageName == null) ? 0 : packageName.hashCode()); //PackageName does not infect hashCode
|
||||
*/
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -8,20 +8,16 @@ import java.util.*;
|
||||
* Speichert die Klassen f<>r einen bestimmten Projektscope
|
||||
*/
|
||||
public class JavaClassRegistry {
|
||||
final List<JavaClassName> existingClasses = new ArrayList<>();
|
||||
final Map<JavaClassName, Integer> existingClasses = new HashMap<>();
|
||||
|
||||
public JavaClassRegistry(List<String> initialNames){
|
||||
for(String name : initialNames){
|
||||
existingClasses.add(new JavaClassName(name));
|
||||
public JavaClassRegistry(Map<String, Integer> initialNames){
|
||||
for(String name : initialNames.keySet()){
|
||||
existingClasses.put(new JavaClassName(name), initialNames.get(name));
|
||||
}
|
||||
}
|
||||
|
||||
public void add(String className){
|
||||
existingClasses.add(new JavaClassName(className));
|
||||
}
|
||||
|
||||
public JavaClassName getName(String className) {
|
||||
for(JavaClassName name : existingClasses){
|
||||
for(JavaClassName name : existingClasses.keySet()){
|
||||
if(name.equals(new JavaClassName(className)))return name;
|
||||
}
|
||||
throw new NotImplementedException();
|
||||
@ -34,7 +30,7 @@ public class JavaClassRegistry {
|
||||
|
||||
public List<JavaClassName> getAllFromPackage(String packageName) {
|
||||
List<JavaClassName> ret = new ArrayList<>();
|
||||
for(JavaClassName className : this.existingClasses){
|
||||
for(JavaClassName className : this.existingClasses.keySet()){
|
||||
JavaClassName toCompare = new JavaClassName(packageName + "." + JavaClassName.stripClassName(className.toString()));
|
||||
if(toCompare.toString().equals(className.toString())){
|
||||
ret.add(className);
|
||||
@ -44,6 +40,10 @@ public class JavaClassRegistry {
|
||||
}
|
||||
|
||||
public boolean contains(String whole) {
|
||||
return existingClasses.contains(new JavaClassName(whole));
|
||||
return existingClasses.containsKey(new JavaClassName(whole));
|
||||
}
|
||||
|
||||
public int getNumberOfGenerics(String name) {
|
||||
return existingClasses.get(new JavaClassName(name));
|
||||
}
|
||||
}
|
||||
|
8
src/de/dhbwstuttgart/sat/CNF/CNF.java
Normal file
8
src/de/dhbwstuttgart/sat/CNF/CNF.java
Normal file
@ -0,0 +1,8 @@
|
||||
package de.dhbwstuttgart.sat.CNF;
|
||||
|
||||
public class CNF {
|
||||
/*
|
||||
Baut die CNF Datei.
|
||||
Hier muss man überlegen, in welchem Form die Constraints gebaut werden
|
||||
*/
|
||||
}
|
12
src/de/dhbwstuttgart/sat/CNF/Writer.java
Normal file
12
src/de/dhbwstuttgart/sat/CNF/Writer.java
Normal file
@ -0,0 +1,12 @@
|
||||
package de.dhbwstuttgart.sat.CNF;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* Schreibt CNFs in eine Datei im DIMACS CNF Format
|
||||
*/
|
||||
public class Writer {
|
||||
public Writer(FileWriter output){
|
||||
|
||||
}
|
||||
}
|
40
src/de/dhbwstuttgart/sat/asp/ASPStringConverter.java
Normal file
40
src/de/dhbwstuttgart/sat/asp/ASPStringConverter.java
Normal file
@ -0,0 +1,40 @@
|
||||
package de.dhbwstuttgart.sat.asp;
|
||||
|
||||
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ASPStringConverter {
|
||||
private static final Map<String, String> replacements = new HashMap<>();
|
||||
static{
|
||||
replacements.put(".", "_DOT_");
|
||||
replacements.put("$", "_DOLLAR_");
|
||||
}
|
||||
|
||||
public static String toConstant(JavaClassName name){
|
||||
return toConstant(name.toString());
|
||||
}
|
||||
|
||||
public static String toConstant(String name){
|
||||
return "c" + replace(name);
|
||||
}
|
||||
|
||||
public static String fromConstant(String s){
|
||||
return unReplace(s).substring(1);
|
||||
}
|
||||
|
||||
private static String replace(String input){
|
||||
for(String toReplace : replacements.keySet()){
|
||||
input = input.replace(toReplace, replacements.get(toReplace));
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
private static String unReplace(String input){
|
||||
for(String toReplace : replacements.keySet()){
|
||||
input = input.replace(replacements.get(toReplace), toReplace);
|
||||
}
|
||||
return input;
|
||||
}
|
||||
}
|
52
src/de/dhbwstuttgart/sat/asp/Clingo.java
Normal file
52
src/de/dhbwstuttgart/sat/asp/Clingo.java
Normal file
@ -0,0 +1,52 @@
|
||||
package de.dhbwstuttgart.sat.asp;
|
||||
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Clingo {
|
||||
private final List<File> input;
|
||||
private static final List<File> programFiles = new ArrayList<>();
|
||||
static{
|
||||
programFiles.add(new File("/home/janulrich/Sync/HiwiJob/ResearchPapers/MasterarbeitStadelmeier/asp/unifyWithoutWildcards/basis.lp"));
|
||||
programFiles.add(new File("/home/janulrich/Sync/HiwiJob/ResearchPapers/MasterarbeitStadelmeier/asp/unifyWithoutWildcards/finiteclosure.lp"));
|
||||
programFiles.add(new File("/home/janulrich/Sync/HiwiJob/ResearchPapers/MasterarbeitStadelmeier/asp/unifyWithoutWildcards/subst.lp"));
|
||||
programFiles.add(new File("/home/janulrich/Sync/HiwiJob/ResearchPapers/MasterarbeitStadelmeier/asp/unifyWithoutWildcards/reduce.lp"));
|
||||
programFiles.add(new File("/home/janulrich/Sync/HiwiJob/ResearchPapers/MasterarbeitStadelmeier/asp/unifyWithoutWildcards/unify.lp"));
|
||||
programFiles.add(new File("/home/janulrich/Sync/HiwiJob/ResearchPapers/MasterarbeitStadelmeier/asp/unifyWithoutWildcards/adapt.lp"));
|
||||
}
|
||||
|
||||
public Clingo(List<File> inputFiles){
|
||||
this.input = inputFiles;
|
||||
}
|
||||
|
||||
/*
|
||||
TODO: Clingo per Java Wrapper https://stackoverflow.com/questions/3356200/using-java-to-wrap-over-c
|
||||
*/
|
||||
public String runClingo() throws IOException, InterruptedException {
|
||||
String pathToClingo =
|
||||
"/home/janulrich/Sync/HiwiJob/ResearchPapers/MasterarbeitStadelmeier/asp/clingo-5.2.1-linux-x86_64/clingo";
|
||||
List<String> commands = new ArrayList<>();
|
||||
commands.add(pathToClingo);
|
||||
//commands.add("--outf=2"); //use JSON-Output
|
||||
commands.add("--outf=1"); //use JSON-Output
|
||||
for(File file : input){
|
||||
commands.add(file.getPath());
|
||||
}
|
||||
commands.addAll(programFiles.stream().map(f->f.getPath()).collect(Collectors.toList()));
|
||||
|
||||
Process clingo = new ProcessBuilder( commands.toArray(new String[0])).start();
|
||||
InputStream output = clingo.getInputStream();
|
||||
clingo.waitFor();
|
||||
String result = IOUtils.toString(output, StandardCharsets.UTF_8);
|
||||
return result;
|
||||
}
|
||||
}
|
26
src/de/dhbwstuttgart/sat/asp/model/ASPGencayRule.java
Normal file
26
src/de/dhbwstuttgart/sat/asp/model/ASPGencayRule.java
Normal file
@ -0,0 +1,26 @@
|
||||
package de.dhbwstuttgart.sat.asp.model;
|
||||
|
||||
public enum ASPGencayRule {
|
||||
ASP_PAIR_EQUALS_NAME("equals"),
|
||||
ASP_PAIR_SMALLER_NAME("sub"),
|
||||
ASP_PAIR_SMALLER_DOT_NAME("subEq"),
|
||||
ASP_PARAMLIST_NAME("paramEq"),
|
||||
ASP_FC_PARAMLIST_NAME("param"),
|
||||
ASP_PARAMLIST_END_POINTER("null"),
|
||||
ASP_TYPE("typeEq"),
|
||||
ASP_FCTYPE("type"),
|
||||
ASP_TYPE_VAR("var"),
|
||||
ASP_GENERIC_VAR("pph"),
|
||||
ASP_PARAMLIST_ORDER("paramOrder");
|
||||
|
||||
private final String text;
|
||||
|
||||
private ASPGencayRule(final String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return text;
|
||||
}
|
||||
}
|
23
src/de/dhbwstuttgart/sat/asp/model/ASPRule.java
Normal file
23
src/de/dhbwstuttgart/sat/asp/model/ASPRule.java
Normal file
@ -0,0 +1,23 @@
|
||||
package de.dhbwstuttgart.sat.asp.model;
|
||||
|
||||
public enum ASPRule {
|
||||
ASP_PAIR_EQUALS_NAME("equals"),
|
||||
ASP_PAIR_SMALLER_NAME("smaller"),
|
||||
ASP_PAIR_SMALLER_DOT_NAME("smallerDot"),
|
||||
ASP_PARAMLIST_NAME("param"),
|
||||
ASP_PARAMLIST_END_POINTER("null"),
|
||||
ASP_TYPE("type"),
|
||||
ASP_FCTYPE("typeFC"),
|
||||
ASP_TYPE_VAR("typeVar");
|
||||
|
||||
private final String text;
|
||||
|
||||
private ASPRule(final String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return text;
|
||||
}
|
||||
}
|
231
src/de/dhbwstuttgart/sat/asp/parser/ASPParser.java
Normal file
231
src/de/dhbwstuttgart/sat/asp/parser/ASPParser.java
Normal file
@ -0,0 +1,231 @@
|
||||
package de.dhbwstuttgart.sat.asp.parser;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.DebugException;
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.parser.NullToken;
|
||||
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
||||
import de.dhbwstuttgart.sat.asp.ASPStringConverter;
|
||||
import de.dhbwstuttgart.sat.asp.model.ASPRule;
|
||||
import de.dhbwstuttgart.sat.asp.parser.antlr.UnifyResultBaseListener;
|
||||
import de.dhbwstuttgart.sat.asp.parser.antlr.UnifyResultLexer;
|
||||
import de.dhbwstuttgart.sat.asp.parser.antlr.UnifyResultParser;
|
||||
import de.dhbwstuttgart.sat.asp.parser.model.ParsedType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.*;
|
||||
import de.dhbwstuttgart.typeinference.result.*;
|
||||
import org.antlr.v4.runtime.CharStreams;
|
||||
import org.antlr.v4.runtime.CommonTokenStream;
|
||||
import org.antlr.v4.runtime.tree.ParseTreeWalker;
|
||||
|
||||
import javax.json.Json;
|
||||
import javax.json.JsonArray;
|
||||
import javax.json.JsonObject;
|
||||
import java.io.StringReader;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Ablauf:
|
||||
* - Erst werden alle benötigten Statements eingelesen. Die Pointer bleiben als Strings erhalten
|
||||
* - Anschließend müssen diese wieder zu einem Unify Ergebnis zurückgewandelt werden
|
||||
* - Hier nicht die Typen aus dem unify.model packages verwenden.
|
||||
* TODO: Überlegen welche Informationen noch nach der Unifizierung gebraucht werden
|
||||
* -> Eigentlich nur die korrekten Namen der Typen und TPHs
|
||||
*/
|
||||
public class ASPParser extends UnifyResultBaseListener {
|
||||
private Collection<TypePlaceholder> originalTPHs;
|
||||
private ResultSet resultSet;
|
||||
private Map<String, ParsedType> types = new HashMap<>();
|
||||
private Set<String> tphs = new HashSet<>();
|
||||
private Map<String, ParameterListNode> parameterLists = new HashMap<>();
|
||||
private Set<Relation> equalsRelations = new HashSet<>();
|
||||
private Set<Relation> smallerRelations = new HashSet<>();
|
||||
|
||||
/**
|
||||
* Parst clingo output welcher als JSON (option --outf=2) ausgibt
|
||||
* @param toParse
|
||||
* @return
|
||||
*/
|
||||
public static ResultSet parse(String toParse, Collection<TypePlaceholder> oldPlaceholders){
|
||||
return new ASPParser(toParse, oldPlaceholders).resultSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterParameter(UnifyResultParser.ParameterContext ctx) {
|
||||
//Linked List (pointer, Type, nextPointer)
|
||||
List<String> params = parseParameterList(ctx.parameterList());
|
||||
parameterLists.put(params.get(0), new ParameterListNode(params.get(1), params.get(2)));
|
||||
}
|
||||
|
||||
private static class Relation {
|
||||
public final String right;
|
||||
public final String left;
|
||||
|
||||
Relation(String leftType, String rightType){
|
||||
this.left = leftType;
|
||||
this.right = rightType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (left+right).hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if(obj instanceof Relation)
|
||||
return (right+left).equals(((Relation) obj).left+((Relation) obj).right);
|
||||
return super.equals(obj);
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> parseParameterList(UnifyResultParser.ParameterListContext ctx){
|
||||
return ctx.value().stream().map(v ->
|
||||
//ASPStringConverter.fromConstant(v.getText())
|
||||
v.getText()
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterEquals(UnifyResultParser.EqualsContext ctx) {
|
||||
List<String> parameterList = parseParameterList(ctx.parameterList());
|
||||
if(parameterList.size()<2)throw new DebugException("Fehler in Equals-Regel");
|
||||
String ls = parameterList.get(0);
|
||||
String rs = parameterList.get(1);
|
||||
equalsRelations.add(new Relation(ls, rs));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterSmaller(UnifyResultParser.SmallerContext ctx) {
|
||||
List<String> parameterList = parseParameterList(ctx.parameterList());
|
||||
if(parameterList.size()<2)throw new DebugException("Fehler in Smaller-Regel");
|
||||
String ls = parameterList.get(0);
|
||||
String rs = parameterList.get(1);
|
||||
smallerRelations.add(new Relation(ls, rs));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterTypeVar(UnifyResultParser.TypeVarContext ctx) {
|
||||
List<String> parameterList = parseParameterList(ctx.parameterList());
|
||||
if(parameterList.size()<1)throw new DebugException("Fehler in typeVar-Regel");
|
||||
tphs.add(parameterList.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterType(UnifyResultParser.TypeContext ctx){
|
||||
List<String> parameterList = parseParameterList(ctx.parameterList());
|
||||
if(parameterList.size()<3)throw new DebugException("Fehler in Type-Regel");
|
||||
String name = parameterList.get(0);
|
||||
String typeName = parameterList.get(1);
|
||||
String paramPointer = parameterList.get(2);
|
||||
types.put(name, new ParsedType(typeName, paramPointer));
|
||||
}
|
||||
|
||||
/*
|
||||
private List<String> parsedRule;
|
||||
private List<String> parseRule(String rule){
|
||||
UnifyResultLexer lexer = new UnifyResultLexer(CharStreams.fromString(rule));
|
||||
UnifyResultParser.AspruleContext parseTree = new UnifyResultParser(new CommonTokenStream(lexer)).asprule();
|
||||
parsedRule = new ArrayList<>();
|
||||
new ParseTreeWalker().walk(this, parseTree);
|
||||
return parsedRule;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterAsprule(UnifyResultParser.AspruleContext ctx) {
|
||||
super.enterAsprule(ctx);
|
||||
for(int i = 0; i< ctx.getChildCount();i++){
|
||||
parsedRule.add(ctx.getChild(i).getText());
|
||||
}
|
||||
}
|
||||
*/
|
||||
private ASPParser(String toParse, Collection<TypePlaceholder> oldPlaceholders){
|
||||
//System.out.println(toParse);
|
||||
this.originalTPHs = oldPlaceholders;
|
||||
|
||||
/*
|
||||
JsonObject jsonResult = Json.createReader(new StringReader(toParse)).readObject();
|
||||
JsonArray results = jsonResult.getJsonArray("Call").getJsonObject(0).
|
||||
getJsonArray("Witnesses").getJsonObject(0).
|
||||
getJsonArray("Value");
|
||||
|
||||
//Im ersten Schritt werden alle Regeln geparst
|
||||
String completeResult = "";
|
||||
for(int i = 0; i<results.size();i++){
|
||||
String aspStatement = results.getString(i);
|
||||
completeResult += aspStatement + " ";
|
||||
}
|
||||
System.out.println(completeResult);
|
||||
*/
|
||||
UnifyResultLexer lexer = new UnifyResultLexer(CharStreams.fromString(toParse));
|
||||
UnifyResultParser.AnswerContext parseTree = new UnifyResultParser(new CommonTokenStream(lexer)).answer();
|
||||
new ParseTreeWalker().walk(this, parseTree);
|
||||
|
||||
/*
|
||||
Diese Funktion läuft im folgenden mehrmals über das Result aus dem ASP Programm.
|
||||
Dabei werden Schritt für Schritt die Felder dieser Klasse befüllt die am Schluss das ResultSet ergeben
|
||||
*/
|
||||
Set<ResultPair> ret = new HashSet<>();
|
||||
//Zuerst die params und typeVars:
|
||||
//for(String paramPointer : types.values().stream().map(parsedType -> parsedType.params).collect(Collectors.toList())){ }
|
||||
|
||||
//Dann die Equalsdot Statements
|
||||
for(Relation eq : equalsRelations){
|
||||
RefTypeOrTPHOrWildcardOrGeneric lsType = this.getType(eq.left);
|
||||
RefTypeOrTPHOrWildcardOrGeneric rsType = this.getType(eq.right);
|
||||
if(lsType instanceof TypePlaceholder && rsType instanceof RefType)
|
||||
ret.add(new PairTPHequalRefTypeOrWildcardType((TypePlaceholder) lsType, rsType));
|
||||
else if(lsType instanceof TypePlaceholder && rsType instanceof TypePlaceholder)
|
||||
ret.add(new PairTPHEqualTPH((TypePlaceholder)lsType, (TypePlaceholder)rsType));
|
||||
else throw new NotImplementedException();
|
||||
}
|
||||
this.resultSet = new ResultSet(ret);
|
||||
}
|
||||
|
||||
private RefTypeOrTPHOrWildcardOrGeneric getType(String name) {
|
||||
if(tphs.contains(name)){
|
||||
name = ASPStringConverter.fromConstant(name);
|
||||
for(TypePlaceholder tph : originalTPHs){
|
||||
if(tph.getName().equals(name))return tph;
|
||||
}
|
||||
return TypePlaceholder.fresh(new NullToken());
|
||||
}else
|
||||
if(types.containsKey(name)){
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> params = new ArrayList<>();
|
||||
ParsedType t = types.get(name);
|
||||
|
||||
for(String param : getParams(t.params)){
|
||||
params.add(this.getType(param));
|
||||
}
|
||||
return new RefType(new JavaClassName(ASPStringConverter.fromConstant(t.name)), params, new NullToken());
|
||||
}else throw new DebugException("Der Typ " + name + " konnte nicht bestimmt werden");
|
||||
}
|
||||
|
||||
private static class ParameterListNode{
|
||||
final String type;
|
||||
final String nextNode;
|
||||
|
||||
public ParameterListNode(String type, String next) {
|
||||
this.type = type;
|
||||
this.nextNode = next;
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> getParams(String pointer) {
|
||||
List<String> params = new ArrayList<>();
|
||||
while(pointer != null){
|
||||
if(pointer.equals(ASPRule.ASP_PARAMLIST_END_POINTER.toString()))return params;
|
||||
if(!parameterLists.containsKey(pointer))
|
||||
throw new DebugException("Fehler in Ergebnisparsen");
|
||||
//TODO: Fehler in ASP. Die adapt Regel muss erkennen, wenn die Parameterliste auf der linken Seite kürzer ist und diese Rechtzeitig beenden
|
||||
ParameterListNode param = parameterLists.get(pointer);
|
||||
pointer = param.nextNode;
|
||||
params.add(param.type);
|
||||
}
|
||||
return params;
|
||||
//Optional<ASPParameterList> ret = parameterLists.stream().filter(aspParameterList -> aspParameterList.name.equals(rs)).findAny();
|
||||
//return ret.get();
|
||||
}
|
||||
}
|
37
src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResult.g4
Normal file
37
src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResult.g4
Normal file
@ -0,0 +1,37 @@
|
||||
grammar UnifyResult;
|
||||
|
||||
answer : 'ANSWER' (resultSetRule '.')*;
|
||||
|
||||
resultSetRule :
|
||||
parameter
|
||||
| equals
|
||||
| smaller
|
||||
| typeVar
|
||||
| type
|
||||
| otherRule
|
||||
;
|
||||
|
||||
parameterList : '(' value (',' value)* ')';
|
||||
value : NAME
|
||||
| resultSetRule ;
|
||||
|
||||
parameter : PARAMLIST_NAME parameterList;
|
||||
equals : EQUALS_NAME parameterList;
|
||||
smaller : SMALLER_NAME parameterList;
|
||||
typeVar : TYPEVAR_NAME parameterList;
|
||||
type : TYPE_NAME parameterList;
|
||||
otherRule : NAME parameterList;
|
||||
|
||||
//TODO: Es sollte Regeln für das Result set geben, welche sich nicht mit den anderen überdecken, dann auch nur diese im Result ausgeben
|
||||
PARAMLIST_NAME : 'param';
|
||||
EQUALS_NAME : 'equals';
|
||||
SMALLER_NAME : 'smaller';
|
||||
TYPEVAR_NAME : 'typeVar';
|
||||
TYPE_NAME : 'type';
|
||||
NAME : [a-zA-Z0-9_]+;
|
||||
|
||||
WS : [ \t\r\n\u000C]+ -> skip
|
||||
;
|
||||
LINE_COMMENT
|
||||
: '%' ~[\r\n]* -> skip
|
||||
;
|
23
src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResult.tokens
Normal file
23
src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResult.tokens
Normal file
@ -0,0 +1,23 @@
|
||||
T__0=1
|
||||
T__1=2
|
||||
T__2=3
|
||||
T__3=4
|
||||
T__4=5
|
||||
PARAMLIST_NAME=6
|
||||
EQUALS_NAME=7
|
||||
SMALLER_NAME=8
|
||||
TYPEVAR_NAME=9
|
||||
TYPE_NAME=10
|
||||
NAME=11
|
||||
WS=12
|
||||
LINE_COMMENT=13
|
||||
'ANSWER'=1
|
||||
'.'=2
|
||||
'('=3
|
||||
','=4
|
||||
')'=5
|
||||
'param'=6
|
||||
'equals'=7
|
||||
'smaller'=8
|
||||
'typeVar'=9
|
||||
'type'=10
|
@ -0,0 +1,159 @@
|
||||
// Generated from UnifyResult.g4 by ANTLR 4.7
|
||||
package de.dhbwstuttgart.sat.asp.parser.antlr;
|
||||
|
||||
import org.antlr.v4.runtime.ParserRuleContext;
|
||||
import org.antlr.v4.runtime.tree.ErrorNode;
|
||||
import org.antlr.v4.runtime.tree.TerminalNode;
|
||||
|
||||
/**
|
||||
* This class provides an empty implementation of {@link UnifyResultListener},
|
||||
* which can be extended to create a listener which only needs to handle a subset
|
||||
* of the available methods.
|
||||
*/
|
||||
public class UnifyResultBaseListener implements UnifyResultListener {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterAnswer(UnifyResultParser.AnswerContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitAnswer(UnifyResultParser.AnswerContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterResultSetRule(UnifyResultParser.ResultSetRuleContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitResultSetRule(UnifyResultParser.ResultSetRuleContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterParameterList(UnifyResultParser.ParameterListContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitParameterList(UnifyResultParser.ParameterListContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterValue(UnifyResultParser.ValueContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitValue(UnifyResultParser.ValueContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterParameter(UnifyResultParser.ParameterContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitParameter(UnifyResultParser.ParameterContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterEquals(UnifyResultParser.EqualsContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitEquals(UnifyResultParser.EqualsContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterSmaller(UnifyResultParser.SmallerContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitSmaller(UnifyResultParser.SmallerContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterTypeVar(UnifyResultParser.TypeVarContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitTypeVar(UnifyResultParser.TypeVarContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterType(UnifyResultParser.TypeContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitType(UnifyResultParser.TypeContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterOtherRule(UnifyResultParser.OtherRuleContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitOtherRule(UnifyResultParser.OtherRuleContext ctx) { }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterEveryRule(ParserRuleContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitEveryRule(ParserRuleContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void visitTerminal(TerminalNode node) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void visitErrorNode(ErrorNode node) { }
|
||||
}
|
134
src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultLexer.java
Normal file
134
src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultLexer.java
Normal file
@ -0,0 +1,134 @@
|
||||
// Generated from UnifyResult.g4 by ANTLR 4.7
|
||||
package de.dhbwstuttgart.sat.asp.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 UnifyResultLexer extends Lexer {
|
||||
static { RuntimeMetaData.checkVersion("4.7", RuntimeMetaData.VERSION); }
|
||||
|
||||
protected static final DFA[] _decisionToDFA;
|
||||
protected static final PredictionContextCache _sharedContextCache =
|
||||
new PredictionContextCache();
|
||||
public static final int
|
||||
T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, PARAMLIST_NAME=6, EQUALS_NAME=7,
|
||||
SMALLER_NAME=8, TYPEVAR_NAME=9, TYPE_NAME=10, NAME=11, WS=12, LINE_COMMENT=13;
|
||||
public static String[] channelNames = {
|
||||
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
|
||||
};
|
||||
|
||||
public static String[] modeNames = {
|
||||
"DEFAULT_MODE"
|
||||
};
|
||||
|
||||
public static final String[] ruleNames = {
|
||||
"T__0", "T__1", "T__2", "T__3", "T__4", "PARAMLIST_NAME", "EQUALS_NAME",
|
||||
"SMALLER_NAME", "TYPEVAR_NAME", "TYPE_NAME", "NAME", "WS", "LINE_COMMENT"
|
||||
};
|
||||
|
||||
private static final String[] _LITERAL_NAMES = {
|
||||
null, "'ANSWER'", "'.'", "'('", "','", "')'", "'param'", "'equals'", "'smaller'",
|
||||
"'typeVar'", "'type'"
|
||||
};
|
||||
private static final String[] _SYMBOLIC_NAMES = {
|
||||
null, null, null, null, null, null, "PARAMLIST_NAME", "EQUALS_NAME", "SMALLER_NAME",
|
||||
"TYPEVAR_NAME", "TYPE_NAME", "NAME", "WS", "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 UnifyResultLexer(CharStream input) {
|
||||
super(input);
|
||||
_interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGrammarFileName() { return "UnifyResult.g4"; }
|
||||
|
||||
@Override
|
||||
public String[] getRuleNames() { return ruleNames; }
|
||||
|
||||
@Override
|
||||
public String getSerializedATN() { return _serializedATN; }
|
||||
|
||||
@Override
|
||||
public String[] getChannelNames() { return channelNames; }
|
||||
|
||||
@Override
|
||||
public String[] getModeNames() { return modeNames; }
|
||||
|
||||
@Override
|
||||
public ATN getATN() { return _ATN; }
|
||||
|
||||
public static final String _serializedATN =
|
||||
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\17c\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\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\4"+
|
||||
"\3\4\3\5\3\5\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3"+
|
||||
"\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13"+
|
||||
"\3\13\3\13\3\13\3\13\3\f\6\fP\n\f\r\f\16\fQ\3\r\6\rU\n\r\r\r\16\rV\3\r"+
|
||||
"\3\r\3\16\3\16\7\16]\n\16\f\16\16\16`\13\16\3\16\3\16\2\2\17\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\3\2\5\6\2\62;C\\"+
|
||||
"aac|\5\2\13\f\16\17\"\"\4\2\f\f\17\17\2e\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\3\35"+
|
||||
"\3\2\2\2\5$\3\2\2\2\7&\3\2\2\2\t(\3\2\2\2\13*\3\2\2\2\r,\3\2\2\2\17\62"+
|
||||
"\3\2\2\2\219\3\2\2\2\23A\3\2\2\2\25I\3\2\2\2\27O\3\2\2\2\31T\3\2\2\2\33"+
|
||||
"Z\3\2\2\2\35\36\7C\2\2\36\37\7P\2\2\37 \7U\2\2 !\7Y\2\2!\"\7G\2\2\"#\7"+
|
||||
"T\2\2#\4\3\2\2\2$%\7\60\2\2%\6\3\2\2\2&\'\7*\2\2\'\b\3\2\2\2()\7.\2\2"+
|
||||
")\n\3\2\2\2*+\7+\2\2+\f\3\2\2\2,-\7r\2\2-.\7c\2\2./\7t\2\2/\60\7c\2\2"+
|
||||
"\60\61\7o\2\2\61\16\3\2\2\2\62\63\7g\2\2\63\64\7s\2\2\64\65\7w\2\2\65"+
|
||||
"\66\7c\2\2\66\67\7n\2\2\678\7u\2\28\20\3\2\2\29:\7u\2\2:;\7o\2\2;<\7c"+
|
||||
"\2\2<=\7n\2\2=>\7n\2\2>?\7g\2\2?@\7t\2\2@\22\3\2\2\2AB\7v\2\2BC\7{\2\2"+
|
||||
"CD\7r\2\2DE\7g\2\2EF\7X\2\2FG\7c\2\2GH\7t\2\2H\24\3\2\2\2IJ\7v\2\2JK\7"+
|
||||
"{\2\2KL\7r\2\2LM\7g\2\2M\26\3\2\2\2NP\t\2\2\2ON\3\2\2\2PQ\3\2\2\2QO\3"+
|
||||
"\2\2\2QR\3\2\2\2R\30\3\2\2\2SU\t\3\2\2TS\3\2\2\2UV\3\2\2\2VT\3\2\2\2V"+
|
||||
"W\3\2\2\2WX\3\2\2\2XY\b\r\2\2Y\32\3\2\2\2Z^\7\'\2\2[]\n\4\2\2\\[\3\2\2"+
|
||||
"\2]`\3\2\2\2^\\\3\2\2\2^_\3\2\2\2_a\3\2\2\2`^\3\2\2\2ab\b\16\2\2b\34\3"+
|
||||
"\2\2\2\6\2QV^\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);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
T__0=1
|
||||
T__1=2
|
||||
T__2=3
|
||||
T__3=4
|
||||
T__4=5
|
||||
PARAMLIST_NAME=6
|
||||
EQUALS_NAME=7
|
||||
SMALLER_NAME=8
|
||||
TYPEVAR_NAME=9
|
||||
TYPE_NAME=10
|
||||
NAME=11
|
||||
WS=12
|
||||
LINE_COMMENT=13
|
||||
'ANSWER'=1
|
||||
'.'=2
|
||||
'('=3
|
||||
','=4
|
||||
')'=5
|
||||
'param'=6
|
||||
'equals'=7
|
||||
'smaller'=8
|
||||
'typeVar'=9
|
||||
'type'=10
|
@ -0,0 +1,110 @@
|
||||
// Generated from UnifyResult.g4 by ANTLR 4.7
|
||||
package de.dhbwstuttgart.sat.asp.parser.antlr;
|
||||
import org.antlr.v4.runtime.tree.ParseTreeListener;
|
||||
|
||||
/**
|
||||
* This interface defines a complete listener for a parse tree produced by
|
||||
* {@link UnifyResultParser}.
|
||||
*/
|
||||
public interface UnifyResultListener extends ParseTreeListener {
|
||||
/**
|
||||
* Enter a parse tree produced by {@link UnifyResultParser#answer}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterAnswer(UnifyResultParser.AnswerContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link UnifyResultParser#answer}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitAnswer(UnifyResultParser.AnswerContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link UnifyResultParser#resultSetRule}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterResultSetRule(UnifyResultParser.ResultSetRuleContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link UnifyResultParser#resultSetRule}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitResultSetRule(UnifyResultParser.ResultSetRuleContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link UnifyResultParser#parameterList}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterParameterList(UnifyResultParser.ParameterListContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link UnifyResultParser#parameterList}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitParameterList(UnifyResultParser.ParameterListContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link UnifyResultParser#value}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterValue(UnifyResultParser.ValueContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link UnifyResultParser#value}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitValue(UnifyResultParser.ValueContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link UnifyResultParser#parameter}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterParameter(UnifyResultParser.ParameterContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link UnifyResultParser#parameter}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitParameter(UnifyResultParser.ParameterContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link UnifyResultParser#equals}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterEquals(UnifyResultParser.EqualsContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link UnifyResultParser#equals}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitEquals(UnifyResultParser.EqualsContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link UnifyResultParser#smaller}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterSmaller(UnifyResultParser.SmallerContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link UnifyResultParser#smaller}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitSmaller(UnifyResultParser.SmallerContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link UnifyResultParser#typeVar}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterTypeVar(UnifyResultParser.TypeVarContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link UnifyResultParser#typeVar}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitTypeVar(UnifyResultParser.TypeVarContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link UnifyResultParser#type}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterType(UnifyResultParser.TypeContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link UnifyResultParser#type}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitType(UnifyResultParser.TypeContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link UnifyResultParser#otherRule}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterOtherRule(UnifyResultParser.OtherRuleContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link UnifyResultParser#otherRule}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitOtherRule(UnifyResultParser.OtherRuleContext ctx);
|
||||
}
|
639
src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultParser.java
Normal file
639
src/de/dhbwstuttgart/sat/asp/parser/antlr/UnifyResultParser.java
Normal file
@ -0,0 +1,639 @@
|
||||
// Generated from UnifyResult.g4 by ANTLR 4.7
|
||||
package de.dhbwstuttgart.sat.asp.parser.antlr;
|
||||
import org.antlr.v4.runtime.atn.*;
|
||||
import org.antlr.v4.runtime.dfa.DFA;
|
||||
import org.antlr.v4.runtime.*;
|
||||
import org.antlr.v4.runtime.misc.*;
|
||||
import org.antlr.v4.runtime.tree.*;
|
||||
import java.util.List;
|
||||
import java.util.Iterator;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
|
||||
public class UnifyResultParser extends Parser {
|
||||
static { RuntimeMetaData.checkVersion("4.7", RuntimeMetaData.VERSION); }
|
||||
|
||||
protected static final DFA[] _decisionToDFA;
|
||||
protected static final PredictionContextCache _sharedContextCache =
|
||||
new PredictionContextCache();
|
||||
public static final int
|
||||
T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, PARAMLIST_NAME=6, EQUALS_NAME=7,
|
||||
SMALLER_NAME=8, TYPEVAR_NAME=9, TYPE_NAME=10, NAME=11, WS=12, LINE_COMMENT=13;
|
||||
public static final int
|
||||
RULE_answer = 0, RULE_resultSetRule = 1, RULE_parameterList = 2, RULE_value = 3,
|
||||
RULE_parameter = 4, RULE_equals = 5, RULE_smaller = 6, RULE_typeVar = 7,
|
||||
RULE_type = 8, RULE_otherRule = 9;
|
||||
public static final String[] ruleNames = {
|
||||
"answer", "resultSetRule", "parameterList", "value", "parameter", "equals",
|
||||
"smaller", "typeVar", "type", "otherRule"
|
||||
};
|
||||
|
||||
private static final String[] _LITERAL_NAMES = {
|
||||
null, "'ANSWER'", "'.'", "'('", "','", "')'", "'param'", "'equals'", "'smaller'",
|
||||
"'typeVar'", "'type'"
|
||||
};
|
||||
private static final String[] _SYMBOLIC_NAMES = {
|
||||
null, null, null, null, null, null, "PARAMLIST_NAME", "EQUALS_NAME", "SMALLER_NAME",
|
||||
"TYPEVAR_NAME", "TYPE_NAME", "NAME", "WS", "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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGrammarFileName() { return "UnifyResult.g4"; }
|
||||
|
||||
@Override
|
||||
public String[] getRuleNames() { return ruleNames; }
|
||||
|
||||
@Override
|
||||
public String getSerializedATN() { return _serializedATN; }
|
||||
|
||||
@Override
|
||||
public ATN getATN() { return _ATN; }
|
||||
|
||||
public UnifyResultParser(TokenStream input) {
|
||||
super(input);
|
||||
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
|
||||
}
|
||||
public static class AnswerContext extends ParserRuleContext {
|
||||
public List<ResultSetRuleContext> resultSetRule() {
|
||||
return getRuleContexts(ResultSetRuleContext.class);
|
||||
}
|
||||
public ResultSetRuleContext resultSetRule(int i) {
|
||||
return getRuleContext(ResultSetRuleContext.class,i);
|
||||
}
|
||||
public AnswerContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_answer; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).enterAnswer(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).exitAnswer(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final AnswerContext answer() throws RecognitionException {
|
||||
AnswerContext _localctx = new AnswerContext(_ctx, getState());
|
||||
enterRule(_localctx, 0, RULE_answer);
|
||||
int _la;
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(20);
|
||||
match(T__0);
|
||||
setState(26);
|
||||
_errHandler.sync(this);
|
||||
_la = _input.LA(1);
|
||||
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << PARAMLIST_NAME) | (1L << EQUALS_NAME) | (1L << SMALLER_NAME) | (1L << TYPEVAR_NAME) | (1L << TYPE_NAME) | (1L << NAME))) != 0)) {
|
||||
{
|
||||
{
|
||||
setState(21);
|
||||
resultSetRule();
|
||||
setState(22);
|
||||
match(T__1);
|
||||
}
|
||||
}
|
||||
setState(28);
|
||||
_errHandler.sync(this);
|
||||
_la = _input.LA(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class ResultSetRuleContext extends ParserRuleContext {
|
||||
public ParameterContext parameter() {
|
||||
return getRuleContext(ParameterContext.class,0);
|
||||
}
|
||||
public EqualsContext equals() {
|
||||
return getRuleContext(EqualsContext.class,0);
|
||||
}
|
||||
public SmallerContext smaller() {
|
||||
return getRuleContext(SmallerContext.class,0);
|
||||
}
|
||||
public TypeVarContext typeVar() {
|
||||
return getRuleContext(TypeVarContext.class,0);
|
||||
}
|
||||
public TypeContext type() {
|
||||
return getRuleContext(TypeContext.class,0);
|
||||
}
|
||||
public OtherRuleContext otherRule() {
|
||||
return getRuleContext(OtherRuleContext.class,0);
|
||||
}
|
||||
public ResultSetRuleContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_resultSetRule; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).enterResultSetRule(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).exitResultSetRule(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final ResultSetRuleContext resultSetRule() throws RecognitionException {
|
||||
ResultSetRuleContext _localctx = new ResultSetRuleContext(_ctx, getState());
|
||||
enterRule(_localctx, 2, RULE_resultSetRule);
|
||||
try {
|
||||
setState(35);
|
||||
_errHandler.sync(this);
|
||||
switch (_input.LA(1)) {
|
||||
case PARAMLIST_NAME:
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(29);
|
||||
parameter();
|
||||
}
|
||||
break;
|
||||
case EQUALS_NAME:
|
||||
enterOuterAlt(_localctx, 2);
|
||||
{
|
||||
setState(30);
|
||||
equals();
|
||||
}
|
||||
break;
|
||||
case SMALLER_NAME:
|
||||
enterOuterAlt(_localctx, 3);
|
||||
{
|
||||
setState(31);
|
||||
smaller();
|
||||
}
|
||||
break;
|
||||
case TYPEVAR_NAME:
|
||||
enterOuterAlt(_localctx, 4);
|
||||
{
|
||||
setState(32);
|
||||
typeVar();
|
||||
}
|
||||
break;
|
||||
case TYPE_NAME:
|
||||
enterOuterAlt(_localctx, 5);
|
||||
{
|
||||
setState(33);
|
||||
type();
|
||||
}
|
||||
break;
|
||||
case NAME:
|
||||
enterOuterAlt(_localctx, 6);
|
||||
{
|
||||
setState(34);
|
||||
otherRule();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new NoViableAltException(this);
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class ParameterListContext extends ParserRuleContext {
|
||||
public List<ValueContext> value() {
|
||||
return getRuleContexts(ValueContext.class);
|
||||
}
|
||||
public ValueContext value(int i) {
|
||||
return getRuleContext(ValueContext.class,i);
|
||||
}
|
||||
public ParameterListContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_parameterList; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).enterParameterList(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).exitParameterList(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final ParameterListContext parameterList() throws RecognitionException {
|
||||
ParameterListContext _localctx = new ParameterListContext(_ctx, getState());
|
||||
enterRule(_localctx, 4, RULE_parameterList);
|
||||
int _la;
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(37);
|
||||
match(T__2);
|
||||
setState(38);
|
||||
value();
|
||||
setState(43);
|
||||
_errHandler.sync(this);
|
||||
_la = _input.LA(1);
|
||||
while (_la==T__3) {
|
||||
{
|
||||
{
|
||||
setState(39);
|
||||
match(T__3);
|
||||
setState(40);
|
||||
value();
|
||||
}
|
||||
}
|
||||
setState(45);
|
||||
_errHandler.sync(this);
|
||||
_la = _input.LA(1);
|
||||
}
|
||||
setState(46);
|
||||
match(T__4);
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class ValueContext extends ParserRuleContext {
|
||||
public TerminalNode NAME() { return getToken(UnifyResultParser.NAME, 0); }
|
||||
public ResultSetRuleContext resultSetRule() {
|
||||
return getRuleContext(ResultSetRuleContext.class,0);
|
||||
}
|
||||
public ValueContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_value; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).enterValue(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).exitValue(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final ValueContext value() throws RecognitionException {
|
||||
ValueContext _localctx = new ValueContext(_ctx, getState());
|
||||
enterRule(_localctx, 6, RULE_value);
|
||||
try {
|
||||
setState(50);
|
||||
_errHandler.sync(this);
|
||||
switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) {
|
||||
case 1:
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(48);
|
||||
match(NAME);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
enterOuterAlt(_localctx, 2);
|
||||
{
|
||||
setState(49);
|
||||
resultSetRule();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class ParameterContext extends ParserRuleContext {
|
||||
public TerminalNode PARAMLIST_NAME() { return getToken(UnifyResultParser.PARAMLIST_NAME, 0); }
|
||||
public ParameterListContext parameterList() {
|
||||
return getRuleContext(ParameterListContext.class,0);
|
||||
}
|
||||
public ParameterContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_parameter; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).enterParameter(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).exitParameter(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final ParameterContext parameter() throws RecognitionException {
|
||||
ParameterContext _localctx = new ParameterContext(_ctx, getState());
|
||||
enterRule(_localctx, 8, RULE_parameter);
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(52);
|
||||
match(PARAMLIST_NAME);
|
||||
setState(53);
|
||||
parameterList();
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class EqualsContext extends ParserRuleContext {
|
||||
public TerminalNode EQUALS_NAME() { return getToken(UnifyResultParser.EQUALS_NAME, 0); }
|
||||
public ParameterListContext parameterList() {
|
||||
return getRuleContext(ParameterListContext.class,0);
|
||||
}
|
||||
public EqualsContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_equals; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).enterEquals(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).exitEquals(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final EqualsContext equals() throws RecognitionException {
|
||||
EqualsContext _localctx = new EqualsContext(_ctx, getState());
|
||||
enterRule(_localctx, 10, RULE_equals);
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(55);
|
||||
match(EQUALS_NAME);
|
||||
setState(56);
|
||||
parameterList();
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class SmallerContext extends ParserRuleContext {
|
||||
public TerminalNode SMALLER_NAME() { return getToken(UnifyResultParser.SMALLER_NAME, 0); }
|
||||
public ParameterListContext parameterList() {
|
||||
return getRuleContext(ParameterListContext.class,0);
|
||||
}
|
||||
public SmallerContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_smaller; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).enterSmaller(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).exitSmaller(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final SmallerContext smaller() throws RecognitionException {
|
||||
SmallerContext _localctx = new SmallerContext(_ctx, getState());
|
||||
enterRule(_localctx, 12, RULE_smaller);
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(58);
|
||||
match(SMALLER_NAME);
|
||||
setState(59);
|
||||
parameterList();
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class TypeVarContext extends ParserRuleContext {
|
||||
public TerminalNode TYPEVAR_NAME() { return getToken(UnifyResultParser.TYPEVAR_NAME, 0); }
|
||||
public ParameterListContext parameterList() {
|
||||
return getRuleContext(ParameterListContext.class,0);
|
||||
}
|
||||
public TypeVarContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_typeVar; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).enterTypeVar(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).exitTypeVar(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final TypeVarContext typeVar() throws RecognitionException {
|
||||
TypeVarContext _localctx = new TypeVarContext(_ctx, getState());
|
||||
enterRule(_localctx, 14, RULE_typeVar);
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(61);
|
||||
match(TYPEVAR_NAME);
|
||||
setState(62);
|
||||
parameterList();
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class TypeContext extends ParserRuleContext {
|
||||
public TerminalNode TYPE_NAME() { return getToken(UnifyResultParser.TYPE_NAME, 0); }
|
||||
public ParameterListContext parameterList() {
|
||||
return getRuleContext(ParameterListContext.class,0);
|
||||
}
|
||||
public TypeContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_type; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).enterType(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).exitType(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final TypeContext type() throws RecognitionException {
|
||||
TypeContext _localctx = new TypeContext(_ctx, getState());
|
||||
enterRule(_localctx, 16, RULE_type);
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(64);
|
||||
match(TYPE_NAME);
|
||||
setState(65);
|
||||
parameterList();
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class OtherRuleContext extends ParserRuleContext {
|
||||
public TerminalNode NAME() { return getToken(UnifyResultParser.NAME, 0); }
|
||||
public ParameterListContext parameterList() {
|
||||
return getRuleContext(ParameterListContext.class,0);
|
||||
}
|
||||
public OtherRuleContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_otherRule; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).enterOtherRule(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof UnifyResultListener ) ((UnifyResultListener)listener).exitOtherRule(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final OtherRuleContext otherRule() throws RecognitionException {
|
||||
OtherRuleContext _localctx = new OtherRuleContext(_ctx, getState());
|
||||
enterRule(_localctx, 18, RULE_otherRule);
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(67);
|
||||
match(NAME);
|
||||
setState(68);
|
||||
parameterList();
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static final String _serializedATN =
|
||||
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\17I\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\3"+
|
||||
"\2\3\2\3\2\3\2\7\2\33\n\2\f\2\16\2\36\13\2\3\3\3\3\3\3\3\3\3\3\3\3\5\3"+
|
||||
"&\n\3\3\4\3\4\3\4\3\4\7\4,\n\4\f\4\16\4/\13\4\3\4\3\4\3\5\3\5\5\5\65\n"+
|
||||
"\5\3\6\3\6\3\6\3\7\3\7\3\7\3\b\3\b\3\b\3\t\3\t\3\t\3\n\3\n\3\n\3\13\3"+
|
||||
"\13\3\13\3\13\2\2\f\2\4\6\b\n\f\16\20\22\24\2\2\2F\2\26\3\2\2\2\4%\3\2"+
|
||||
"\2\2\6\'\3\2\2\2\b\64\3\2\2\2\n\66\3\2\2\2\f9\3\2\2\2\16<\3\2\2\2\20?"+
|
||||
"\3\2\2\2\22B\3\2\2\2\24E\3\2\2\2\26\34\7\3\2\2\27\30\5\4\3\2\30\31\7\4"+
|
||||
"\2\2\31\33\3\2\2\2\32\27\3\2\2\2\33\36\3\2\2\2\34\32\3\2\2\2\34\35\3\2"+
|
||||
"\2\2\35\3\3\2\2\2\36\34\3\2\2\2\37&\5\n\6\2 &\5\f\7\2!&\5\16\b\2\"&\5"+
|
||||
"\20\t\2#&\5\22\n\2$&\5\24\13\2%\37\3\2\2\2% \3\2\2\2%!\3\2\2\2%\"\3\2"+
|
||||
"\2\2%#\3\2\2\2%$\3\2\2\2&\5\3\2\2\2\'(\7\5\2\2(-\5\b\5\2)*\7\6\2\2*,\5"+
|
||||
"\b\5\2+)\3\2\2\2,/\3\2\2\2-+\3\2\2\2-.\3\2\2\2.\60\3\2\2\2/-\3\2\2\2\60"+
|
||||
"\61\7\7\2\2\61\7\3\2\2\2\62\65\7\r\2\2\63\65\5\4\3\2\64\62\3\2\2\2\64"+
|
||||
"\63\3\2\2\2\65\t\3\2\2\2\66\67\7\b\2\2\678\5\6\4\28\13\3\2\2\29:\7\t\2"+
|
||||
"\2:;\5\6\4\2;\r\3\2\2\2<=\7\n\2\2=>\5\6\4\2>\17\3\2\2\2?@\7\13\2\2@A\5"+
|
||||
"\6\4\2A\21\3\2\2\2BC\7\f\2\2CD\5\6\4\2D\23\3\2\2\2EF\7\r\2\2FG\5\6\4\2"+
|
||||
"G\25\3\2\2\2\6\34%-\64";
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
12
src/de/dhbwstuttgart/sat/asp/parser/model/ParsedType.java
Normal file
12
src/de/dhbwstuttgart/sat/asp/parser/model/ParsedType.java
Normal file
@ -0,0 +1,12 @@
|
||||
package de.dhbwstuttgart.sat.asp.parser.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ParsedType {
|
||||
public final String name;
|
||||
public final String params;
|
||||
public ParsedType(String name, String params){
|
||||
this.name = name;
|
||||
this.params = params;
|
||||
}
|
||||
}
|
127
src/de/dhbwstuttgart/sat/asp/writer/ASPFactory.java
Normal file
127
src/de/dhbwstuttgart/sat/asp/writer/ASPFactory.java
Normal file
@ -0,0 +1,127 @@
|
||||
package de.dhbwstuttgart.sat.asp.writer;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.FCGenerator;
|
||||
import de.dhbwstuttgart.sat.asp.ASPStringConverter;
|
||||
import de.dhbwstuttgart.sat.asp.model.ASPRule;
|
||||
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
|
||||
import de.dhbwstuttgart.syntaxtree.factory.NameGenerator;
|
||||
import de.dhbwstuttgart.syntaxtree.type.*;
|
||||
import de.dhbwstuttgart.typeinference.constraints.Constraint;
|
||||
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
|
||||
import de.dhbwstuttgart.typeinference.constraints.Pair;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.PairOperator;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class ASPFactory implements TypeVisitor<String>{
|
||||
|
||||
public static String generateASP(ConstraintSet<Pair> constraints, Collection<ClassOrInterface> fcClasses) throws ClassNotFoundException{
|
||||
ASPFactory factory = new ASPFactory();
|
||||
factory.convertFC(fcClasses);
|
||||
List<Constraint<Pair>> constraints1 = constraints.cartesianProduct().iterator().next();
|
||||
for(Constraint<Pair> constraint : constraints1){
|
||||
for(Pair p : constraint){
|
||||
factory.convertPair(p);
|
||||
}
|
||||
}
|
||||
|
||||
return factory.writer.getASPFile();
|
||||
}
|
||||
|
||||
ASPWriter writer = new ASPWriter();
|
||||
boolean isFCType = false;
|
||||
|
||||
private void convertFC(Collection<ClassOrInterface> classes) throws ClassNotFoundException {
|
||||
Set<Pair> fc = FCGenerator.toFC(classes);
|
||||
isFCType = true;
|
||||
for(Pair fcp : fc){
|
||||
convertPair(fcp);
|
||||
}
|
||||
isFCType = false;
|
||||
}
|
||||
|
||||
private void convertPair(Pair p){
|
||||
String ls = p.TA1.acceptTV(this);
|
||||
String rs = p.TA2.acceptTV(this);
|
||||
ASPStatement pairStmt = null;
|
||||
if(p.GetOperator().equals(PairOperator.SMALLERDOT)){
|
||||
pairStmt = makeStatement(ASPRule.ASP_PAIR_SMALLER_DOT_NAME.toString(), ls, rs);
|
||||
}else if(p.GetOperator().equals(PairOperator.EQUALSDOT)){
|
||||
pairStmt = makeStatement(ASPRule.ASP_PAIR_EQUALS_NAME.toString(), ls, rs);
|
||||
}else if(p.GetOperator().equals(PairOperator.SMALLER)){
|
||||
pairStmt = makeStatement(ASPRule.ASP_PAIR_SMALLER_NAME.toString(), ls, rs);
|
||||
}else throw new NotImplementedException();
|
||||
writer.add(pairStmt);
|
||||
}
|
||||
|
||||
private ASPStatement makeStatement(String rule, String... params){
|
||||
String stmt = rule + "(";
|
||||
for(String param : params){
|
||||
stmt += param + ",";
|
||||
}
|
||||
stmt = stmt.substring(0,stmt.length()-1);
|
||||
stmt += ")";
|
||||
return new ASPStatement(stmt);
|
||||
}
|
||||
|
||||
private String convertParameterlist(List<String> pointers){
|
||||
String pointer = ASPStringConverter.toConstant(NameGenerator.makeNewName());
|
||||
Iterator<String> it = pointers.iterator();
|
||||
String p = pointer;
|
||||
if(!it.hasNext()){
|
||||
return ASPRule.ASP_PARAMLIST_END_POINTER.toString();
|
||||
}
|
||||
while (it.hasNext()){
|
||||
ASPStatement stmt;
|
||||
String type = it.next();
|
||||
String nextP = ASPStringConverter.toConstant(NameGenerator.makeNewName());
|
||||
if(it.hasNext()){
|
||||
stmt = makeStatement(ASPRule.ASP_PARAMLIST_NAME.toString(), p, type, nextP);
|
||||
}else{
|
||||
stmt = makeStatement(ASPRule.ASP_PARAMLIST_NAME.toString(), p, type,
|
||||
ASPRule.ASP_PARAMLIST_END_POINTER.toString());
|
||||
}
|
||||
p = nextP;
|
||||
writer.add(stmt);
|
||||
}
|
||||
return pointer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(RefType refType) {
|
||||
String pointer = ASPStringConverter.toConstant(NameGenerator.makeNewName());
|
||||
List<String> params = new ArrayList<>();
|
||||
for(RefTypeOrTPHOrWildcardOrGeneric param : refType.getParaList()){
|
||||
params.add(param.acceptTV(this));
|
||||
}
|
||||
String typeName = ASPStringConverter.toConstant(refType.getName());
|
||||
String ruleName = isFCType?ASPRule.ASP_FCTYPE.toString():ASPRule.ASP_TYPE.toString();
|
||||
ASPStatement stmt = makeStatement(ruleName, pointer, typeName, convertParameterlist(params));
|
||||
writer.add(stmt);
|
||||
return pointer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(SuperWildcardType superWildcardType) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(TypePlaceholder typePlaceholder) {
|
||||
String name = ASPStringConverter.toConstant(typePlaceholder.getName());
|
||||
ASPStatement stmt = makeStatement(ASPRule.ASP_TYPE_VAR.toString(), name);
|
||||
writer.add(stmt);
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(ExtendsWildcardType extendsWildcardType) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(GenericRefType genericRefType) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
264
src/de/dhbwstuttgart/sat/asp/writer/ASPGencayFactory.java
Normal file
264
src/de/dhbwstuttgart/sat/asp/writer/ASPGencayFactory.java
Normal file
@ -0,0 +1,264 @@
|
||||
package de.dhbwstuttgart.sat.asp.writer;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.FCGenerator;
|
||||
import de.dhbwstuttgart.sat.asp.ASPStringConverter;
|
||||
import de.dhbwstuttgart.sat.asp.model.ASPGencayRule;
|
||||
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
|
||||
import de.dhbwstuttgart.syntaxtree.factory.NameGenerator;
|
||||
import de.dhbwstuttgart.syntaxtree.type.*;
|
||||
import de.dhbwstuttgart.typeinference.constraints.Constraint;
|
||||
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
|
||||
import de.dhbwstuttgart.typeinference.constraints.Pair;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.PairOperator;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
||||
public class ASPGencayFactory implements TypeVisitor<String> {
|
||||
/* TODO:
|
||||
* Alle TPHs müssen als var(tph) definiert sein
|
||||
* Wenn es eine Variable ist, dann direkt in die type-Regel schreiben: type(p, type, tph)
|
||||
* Für die FCTypen eindeutige Namen für die pph-Regeln
|
||||
* (ergibt sich von selbst, weil man einfach den Namen der TPH in der FC verwenden kann)
|
||||
* paramOrder wird benötigt!
|
||||
* Nur bei parameterlisten > 1
|
||||
* paramOrder(paralistPointer, parameter, num)
|
||||
* (ähnlich meiner paramNum)
|
||||
* Trennung von FC und Eq:
|
||||
* sub -> type -> param
|
||||
* ...Eq -> typeEq -> paramEq
|
||||
* type..(_,_,_p): p kann sein:
|
||||
* 1. Variable
|
||||
* 2. ParameterPointer
|
||||
* 3. null
|
||||
*/
|
||||
ASPWriter writer = new ASPWriter();
|
||||
boolean isFCType = false;
|
||||
|
||||
private static List<ASPStatement> generateVar(ConstraintSet<Pair> constraints){
|
||||
List<ASPStatement> ret = new ArrayList<>();
|
||||
for(TypePlaceholder tph : getInvolvedTPHS(constraints)){
|
||||
ret.add(makeStatement(ASPGencayRule.ASP_TYPE_VAR.toString(),
|
||||
ASPStringConverter.toConstant(tph.getName())));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
protected static Collection<TypePlaceholder> getInvolvedTPHS(ConstraintSet<Pair> toTest) {
|
||||
List<TypePlaceholder> ret = new ArrayList<>();
|
||||
toTest.map((Pair p)-> {
|
||||
ret.addAll(p.TA1.acceptTV(new TPHExtractor()));
|
||||
ret.addAll(p.TA2.acceptTV(new TPHExtractor()));
|
||||
return p;
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static String generateASP(ConstraintSet<Pair> constraints, Collection<ClassOrInterface> fcClasses) throws ClassNotFoundException{
|
||||
ASPGencayFactory factory = new ASPGencayFactory();
|
||||
factory.convertFC(fcClasses);
|
||||
List<Constraint<Pair>> constraints1 = constraints.cartesianProduct().iterator().next();
|
||||
for(Constraint<Pair> constraint : constraints1){
|
||||
for(Pair p : constraint){
|
||||
factory.convertPair(p);
|
||||
}
|
||||
}
|
||||
factory.writer.addAll(generateVar(constraints));
|
||||
|
||||
return factory.writer.getASPFile();
|
||||
}
|
||||
|
||||
private void convertFC(Collection<ClassOrInterface> classes) throws ClassNotFoundException {
|
||||
Set<Pair> fc = FCGenerator.toFC(classes);
|
||||
isFCType = true;
|
||||
for(Pair fcp : fc){
|
||||
generateTheta((RefType) fcp.TA1);
|
||||
generateTheta((RefType) fcp.TA2);
|
||||
convertPair(fcp);
|
||||
}
|
||||
isFCType = false;
|
||||
}
|
||||
|
||||
private void generateTheta(RefType t){
|
||||
String rule = "theta"+t.getParaList().size() ;
|
||||
String name = ASPStringConverter.toConstant(t.getName());
|
||||
writer.add(makeStatement(rule, name));
|
||||
}
|
||||
|
||||
private void convertPair(Pair p){
|
||||
String ls = p.TA1.acceptTV(this);
|
||||
String rs = p.TA2.acceptTV(this);
|
||||
ASPStatement pairStmt = null;
|
||||
if(p.GetOperator().equals(PairOperator.SMALLERDOT)){
|
||||
pairStmt = makeStatement(ASPGencayRule.ASP_PAIR_SMALLER_DOT_NAME.toString(), ls, rs);
|
||||
}else if(p.GetOperator().equals(PairOperator.EQUALSDOT)){
|
||||
pairStmt = makeStatement(ASPGencayRule.ASP_PAIR_EQUALS_NAME.toString(), ls, rs);
|
||||
}else if(p.GetOperator().equals(PairOperator.SMALLER)){
|
||||
pairStmt = makeStatement(ASPGencayRule.ASP_PAIR_SMALLER_NAME.toString(), ls, rs);
|
||||
}else throw new NotImplementedException();
|
||||
writer.add(pairStmt);
|
||||
}
|
||||
|
||||
private static ASPStatement makeStatement(String rule, String... params){
|
||||
String stmt = rule + "(";
|
||||
for(String param : params){
|
||||
stmt += param + ",";
|
||||
}
|
||||
stmt = stmt.substring(0,stmt.length()-1);
|
||||
stmt += ")";
|
||||
return new ASPStatement(stmt);
|
||||
}
|
||||
|
||||
private String convertParameterlist(List<String> pointers){
|
||||
//if(pointers.size()==1)return pointers.get(0);
|
||||
String pointer = ASPStringConverter.toConstant(NameGenerator.makeNewName());
|
||||
Iterator<String> it = pointers.iterator();
|
||||
String p = pointer;
|
||||
String paramname = ASPGencayRule.ASP_PARAMLIST_NAME.toString();
|
||||
if(this.isFCType)paramname = ASPGencayRule.ASP_FC_PARAMLIST_NAME.toString();
|
||||
if(!it.hasNext()){
|
||||
return ASPGencayRule.ASP_PARAMLIST_END_POINTER.toString();
|
||||
}
|
||||
while (it.hasNext()){
|
||||
ASPStatement stmt;
|
||||
String type = it.next();
|
||||
String nextP = ASPStringConverter.toConstant(NameGenerator.makeNewName());
|
||||
if(it.hasNext()){
|
||||
stmt = makeStatement(paramname, p, type, nextP);
|
||||
}else{
|
||||
stmt = makeStatement(paramname, p, type,
|
||||
ASPGencayRule.ASP_PARAMLIST_END_POINTER.toString());
|
||||
}
|
||||
p = nextP;
|
||||
writer.add(stmt);
|
||||
}
|
||||
return pointer;
|
||||
}
|
||||
|
||||
//Wird zum erstellen der pph(..) Regeln gebraucht
|
||||
private String currentFCTypePointer = "";
|
||||
@Override
|
||||
public String visit(RefType refType) {
|
||||
String pointer = ASPStringConverter.toConstant(NameGenerator.makeNewName());
|
||||
currentFCTypePointer = pointer;
|
||||
String paramPointer = ASPGencayRule.ASP_PARAMLIST_END_POINTER.toString();
|
||||
if(refType.getParaList().size() == 1 ){
|
||||
if(refType.getParaList().get(0) instanceof TypePlaceholder){
|
||||
TypePlaceholder typePlaceholder = (TypePlaceholder) refType.getParaList().get(0);
|
||||
paramPointer = typePlaceholder.acceptTV(this);
|
||||
}
|
||||
}else{
|
||||
List<String> params = null;
|
||||
params = generateParameter(refType);
|
||||
params.remove(0);
|
||||
paramPointer = convertParameterlist(params);
|
||||
if(refType.getParaList().size()>1){
|
||||
//paramOrder generieren:
|
||||
for(String param : params) {
|
||||
ASPStatement pOstmt = makeStatement(ASPGencayRule.ASP_PARAMLIST_ORDER.toString(),
|
||||
paramPointer, param);
|
||||
writer.add(pOstmt);
|
||||
}
|
||||
}
|
||||
}
|
||||
String typeName = ASPStringConverter.toConstant(refType.getName());
|
||||
String ruleName = isFCType? ASPGencayRule.ASP_FCTYPE.toString(): ASPGencayRule.ASP_TYPE.toString();
|
||||
ASPStatement stmt = makeStatement(ruleName, pointer, typeName, paramPointer);
|
||||
writer.add(stmt);
|
||||
return pointer;
|
||||
/*
|
||||
String pointer = ASPStringConverter.toConstant(NameGenerator.makeNewName());
|
||||
List<String> params = null;
|
||||
params = generateParameter(refType);
|
||||
params.remove(0); //Das erste ist der eigentliche Typ kein parameter
|
||||
String typeName = ASPStringConverter.toConstant(refType.getName());
|
||||
String ruleName = isFCType? ASPGencayRule.ASP_FCTYPE.toString(): ASPGencayRule.ASP_TYPE.toString();
|
||||
ASPStatement stmt = makeStatement(ruleName, pointer, typeName, convertParameterlist(params));
|
||||
writer.add(stmt);
|
||||
return pointer;
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Erstellt die Parameterliste, wobei type auch schon als Parameter betrachtet wird.
|
||||
* Die RefTypes werden nicht zu extra type-Regeln umgewandelt. Es wird nur ihr Name als Konstante benutzt
|
||||
* Das funktioniert, weil nacher das ParamOrder zuteilt, welche Typen zusammenhängen.
|
||||
* Diese funktion nur verwenden, wenn auch ein paramOrder generiert wird
|
||||
*/
|
||||
private List<String> generateParameter(RefType type){
|
||||
List<String> ret = new ArrayList<>();
|
||||
ret.add(ASPStringConverter.toConstant(type.getName()));
|
||||
for(RefTypeOrTPHOrWildcardOrGeneric param : type.getParaList()){
|
||||
if(param instanceof RefType){
|
||||
ret.addAll(generateParameter((RefType) param));
|
||||
}else if(param instanceof TypePlaceholder){
|
||||
ret.add(param.acceptTV(this));
|
||||
}else throw new NotImplementedException();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(SuperWildcardType superWildcardType) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(TypePlaceholder typePlaceholder) {
|
||||
String name = ASPStringConverter.toConstant(typePlaceholder.getName());
|
||||
|
||||
ASPStatement stmt = null;
|
||||
if(isFCType){
|
||||
stmt = makeStatement(ASPGencayRule.ASP_GENERIC_VAR.toString(),
|
||||
currentFCTypePointer, name);
|
||||
} else {
|
||||
stmt = makeStatement(ASPGencayRule.ASP_TYPE_VAR.toString(), name);
|
||||
}
|
||||
|
||||
writer.add(stmt);
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(ExtendsWildcardType extendsWildcardType) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visit(GenericRefType genericRefType) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private static class TPHExtractor implements TypeVisitor<List<TypePlaceholder>>{
|
||||
@Override
|
||||
public List<TypePlaceholder> visit(RefType refType) {
|
||||
ArrayList<TypePlaceholder> ret = new ArrayList<>();
|
||||
for(RefTypeOrTPHOrWildcardOrGeneric param : refType.getParaList()){
|
||||
ret.addAll(param.acceptTV(this));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TypePlaceholder> visit(SuperWildcardType superWildcardType) {
|
||||
return superWildcardType.getInnerType().acceptTV(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TypePlaceholder> visit(TypePlaceholder typePlaceholder) {
|
||||
return Arrays.asList(typePlaceholder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TypePlaceholder> visit(ExtendsWildcardType extendsWildcardType) {
|
||||
return extendsWildcardType.getInnerType().acceptTV(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TypePlaceholder> visit(GenericRefType genericRefType) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
27
src/de/dhbwstuttgart/sat/asp/writer/ASPStatement.java
Normal file
27
src/de/dhbwstuttgart/sat/asp/writer/ASPStatement.java
Normal file
@ -0,0 +1,27 @@
|
||||
package de.dhbwstuttgart.sat.asp.writer;
|
||||
|
||||
public class ASPStatement {
|
||||
private final String stmt;
|
||||
public ASPStatement(String stmt) {
|
||||
this.stmt = stmt;
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return stmt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return stmt.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if(obj instanceof ASPStatement)return stmt.equals(((ASPStatement) obj).stmt);
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getASP() {
|
||||
return stmt;
|
||||
}
|
||||
}
|
26
src/de/dhbwstuttgart/sat/asp/writer/ASPWriter.java
Normal file
26
src/de/dhbwstuttgart/sat/asp/writer/ASPWriter.java
Normal file
@ -0,0 +1,26 @@
|
||||
package de.dhbwstuttgart.sat.asp.writer;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
public class ASPWriter {
|
||||
|
||||
private HashSet<ASPStatement> content = new HashSet<>();
|
||||
|
||||
public void add(ASPStatement stmt){
|
||||
content.add(stmt);
|
||||
}
|
||||
|
||||
public String getASPFile(){
|
||||
String ret = "";
|
||||
for(ASPStatement statement : content){
|
||||
ret += statement.getASP() + ".\n";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void addAll(Collection<ASPStatement> aspStatements) {
|
||||
content.addAll(aspStatements);
|
||||
}
|
||||
}
|
@ -1,10 +1,6 @@
|
||||
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{
|
||||
|
||||
|
@ -1,13 +1,10 @@
|
||||
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.Literal;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Literal;
|
||||
import de.dhbwstuttgart.syntaxtree.type.*;
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Iterator;
|
||||
|
||||
public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
@ -37,7 +34,7 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(FormalParameter formalParameter) {
|
||||
formalParameter.getType().accept(this);
|
||||
formalParameter.getType().accept((ASTVisitor) this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -61,7 +58,7 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
}
|
||||
|
||||
private void visitMethod(Method method){
|
||||
method.getType().accept(this);
|
||||
method.getReturnType().accept(this);
|
||||
method.getParameterList().accept(this);
|
||||
if(method.block != null)
|
||||
method.block.accept(this);
|
||||
@ -105,7 +102,6 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(TypePlaceholder typePlaceholder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -115,7 +111,6 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
|
||||
@Override
|
||||
public void visit(GenericRefType genericRefType) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,7 +126,7 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Binary binary) {
|
||||
public void visit(BinaryExpr binary) {
|
||||
|
||||
}
|
||||
|
||||
@ -159,12 +154,13 @@ 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
|
||||
@ -200,10 +196,15 @@ public abstract class AbstractASTWalker implements ASTVisitor{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Receiver receiver) {
|
||||
public void visit(ExpressionReceiver 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);
|
||||
@ -229,24 +230,14 @@ 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) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Null aNull) {
|
||||
|
||||
whileStmt.loopBlock.accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -13,6 +13,7 @@ import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceInformation;
|
||||
import org.antlr.v4.runtime.Token;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -26,11 +27,11 @@ public class ClassOrInterface extends SyntaxTreeNode implements TypeScope{
|
||||
private GenericDeclarationList genericClassParameters;
|
||||
private RefType superClass;
|
||||
protected boolean isInterface;
|
||||
private List<? extends RefTypeOrTPHOrWildcardOrGeneric> implementedInterfaces;
|
||||
private List<RefType> implementedInterfaces;
|
||||
private List<Constructor> constructors;
|
||||
|
||||
public ClassOrInterface(int modifiers, JavaClassName name, List<Field> fielddecl, List<Method> methods, List<Constructor> constructors, GenericDeclarationList genericClassParameters,
|
||||
RefType superClass, Boolean isInterface, List<? extends RefTypeOrTPHOrWildcardOrGeneric> implementedInterfaces, Token offset){
|
||||
RefType superClass, Boolean isInterface, List<RefType> implementedInterfaces, Token offset){
|
||||
super(offset);
|
||||
this.modifiers = modifiers;
|
||||
this.name = name;
|
||||
@ -60,10 +61,12 @@ public class ClassOrInterface extends SyntaxTreeNode implements TypeScope{
|
||||
return this.methods;
|
||||
}
|
||||
|
||||
/*
|
||||
public RefType getType() {
|
||||
return generateTypeOfClass(this.getClassName(), this.getGenerics(), this.getOffset());
|
||||
}
|
||||
|
||||
*/
|
||||
//TODO: Das hier ist ein Problem. Je nach Kontext wird hier ein anderer Typ benötigt
|
||||
public static RefType generateTypeOfClass(JavaClassName name, GenericDeclarationList genericsOfClass ,Token offset){
|
||||
//Hier wird immer ein generischer Typ generiert, also mit Type placeholdern
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> params = new ArrayList<>();
|
||||
@ -74,6 +77,10 @@ public class ClassOrInterface extends SyntaxTreeNode implements TypeScope{
|
||||
return new RefType(name, params, offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Die Superklasse im Kontext dieser ClassOrInterface
|
||||
* Das bedeutet, dass generische Variablen als GenericRefTypes dargestellt sind
|
||||
*/
|
||||
public RefType getSuperClass() {
|
||||
return superClass;
|
||||
}
|
||||
@ -95,4 +102,12 @@ public class ClassOrInterface extends SyntaxTreeNode implements TypeScope{
|
||||
public void accept(ASTVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
}
|
||||
|
||||
public Collection<RefType> getSuperInterfaces() {
|
||||
return implementedInterfaces;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.name.toString() + this.genericClassParameters.toString();
|
||||
}
|
||||
}
|
||||
|
@ -14,9 +14,9 @@ public class Constructor extends Method {
|
||||
|
||||
|
||||
//TODO: Constructor braucht ein super-Statement
|
||||
public Constructor(int modifier, String name, RefTypeOrTPHOrWildcardOrGeneric returnType, int modifiers, ParameterList parameterList, Block codeInsideConstructor,
|
||||
GenericDeclarationList gtvDeclarations, Token offset, List<Statement> fieldInitializations, RefType superClass) {
|
||||
super(modifier, name, returnType, modifiers, parameterList, prepareBlock(codeInsideConstructor,fieldInitializations, superClass), gtvDeclarations, offset);
|
||||
public Constructor(int modifier, String name, RefTypeOrTPHOrWildcardOrGeneric returnType, ParameterList parameterList, Block codeInsideConstructor,
|
||||
GenericDeclarationList gtvDeclarations, Token offset, List<Statement> fieldInitializations) {
|
||||
super(modifier, name, returnType, parameterList, prepareBlock(codeInsideConstructor,fieldInitializations), gtvDeclarations, offset);
|
||||
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ public class Constructor extends Method {
|
||||
* welche die Felder der zugehörigen Klasse dieses
|
||||
* Konstruktor initialisieren
|
||||
*/
|
||||
protected static Block prepareBlock(Block constructorBlock, List<Statement> fieldInitializations, RefType superClass){
|
||||
protected static Block prepareBlock(Block constructorBlock, List<Statement> fieldInitializations){
|
||||
List<Statement> statements = constructorBlock.getStatements();
|
||||
statements.add(0, new SuperCall(constructorBlock.getOffset()));
|
||||
return new Block(statements, constructorBlock.getOffset());
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user