forked from JavaTX/JavaCompilerCore
Compare commits
258 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e1007cce30 | |||
| 4cfc070289 | |||
| 2920dfe68f | |||
| acce38e8b1 | |||
| dbd7f4fcfe | |||
| 9114642370 | |||
| 8ac0f96bd6 | |||
| c9d38728af | |||
| b7fad6e3c7 | |||
| 3cb9b74df1 | |||
| effc31782f | |||
| 2a24eab9d3 | |||
| b29eb71238 | |||
| e9ce071e2b | |||
| 3567bae0d7 | |||
| a314013f40 | |||
| 37c58be1f3 | |||
| 24920330c6 | |||
| bc43ea749d | |||
| 9160c99cf2 | |||
| c72a14cab3 | |||
| 10bb5d1d11 | |||
| 2842fc5069 | |||
| 5c5e0bd1e9 | |||
| 3d81318e01 | |||
| 53e2c20608 | |||
| 86e467fd82 | |||
| 25b14e9342 | |||
| d0de0b31e4 | |||
| dd180524b2 | |||
| b3744bf5f7 | |||
| fda16978c2 | |||
| a485cd8fa6 | |||
| f8c708f0f4 | |||
| 28d9946bbb | |||
| 7b4ca8f177 | |||
| b879d7743d | |||
| e26a43b400 | |||
| 5deed725ae | |||
| 8ae15f9d41 | |||
| 8c8e088612 | |||
| 2814c6538e | |||
| dcbc29b49b | |||
| 05033bcb9d | |||
| 814f5dd5fa | |||
| 24ca985ccc | |||
| d6ed0689bc | |||
| d7676f36e3 | |||
| c479b044b3 | |||
| 9046fb09e5 | |||
| 9e323759d6 | |||
| 558083166d | |||
| aec2f9a399 | |||
| 31df7a65f0 | |||
| 185989ba62 | |||
| 0eb48ba425 | |||
| ceee9a49c4 | |||
| ee64218a5f | |||
| c50f14a4a3 | |||
| 1f4250ff84 | |||
| ae41c7f19d | |||
| 2416c80c20 | |||
| 4cc55c0059 | |||
| 9434facfa0 | |||
| 09a6b9a788 | |||
| 8b342c5604 | |||
| cdb93b5155 | |||
| b07e848fa2 | |||
| 313cd20f36 | |||
| 567fcc3b9a | |||
| d9936e7197 | |||
| 8f194b3102 | |||
| 1391206dfe | |||
| 659bf6b500 | |||
| 42e31a3471 | |||
| d3b3f92193 | |||
| 8208abcaea | |||
| e4a3939ce9 | |||
| d903ec0ebb | |||
| 61de81cf92 | |||
| 59888006e0 | |||
| 94034912b4 | |||
| f303163118 | |||
| 7d99fba044 | |||
| 3740d34954 | |||
| d8b861ea95 | |||
| 33ed22c06a | |||
| 70f7857661 | |||
| cf45ea68bd | |||
| be72e4d7fb | |||
| 45275b6888 | |||
| 2144dd9341 | |||
| 69c2bb3dc9 | |||
| 3a57d5e025 | |||
| 1e37538fde | |||
| 4cdd5d016c | |||
| 4318856fa8 | |||
| 1ace099d72 | |||
| b76e1e46f0 | |||
| 09c483542d | |||
| 77411973be | |||
| d0d9c46a67 | |||
| 24bf3d350f | |||
| b9f9994de3 | |||
| f0287c4611 | |||
| edf609f916 | |||
| 14e2af7d2a | |||
| 158adf837a | |||
| 46b378e3a5 | |||
| 484a70c15c | |||
| c461e89336 | |||
| f846142ee1 | |||
| 443b8b0c09 | |||
| ff715a22cf | |||
| 170955b333 | |||
| 88d81f4af7 | |||
| bb11d24101 | |||
| e2bf09548f | |||
| c33e372446 | |||
| 7c546834c0 | |||
| aa61f90fb1 | |||
| b4da20e1d4 | |||
| 4d1950d0ba | |||
| cc204f659a | |||
| 5893338783 | |||
| e1e744152a | |||
| fc22299af5 | |||
| 7811ecce63 | |||
| 44754e73ac | |||
| 6ee308a712 | |||
| 85d70378ca | |||
| 89bbbdacd8 | |||
| fbde5afb1b | |||
| 6ccf2a3df6 | |||
| b7979ac7e7 | |||
| 9ede47c2d6 | |||
| 406f98e55d | |||
| a9d836ce25 | |||
| fd8a66dd59 | |||
| 929392b7d4 | |||
| f57c8aa5a9 | |||
| daa38183fa | |||
| eb454aa5b2 | |||
| 72035c48f2 | |||
| 54f258e333 | |||
| 114de0b236 | |||
| 8f094eb025 | |||
| 3ac3af2327 | |||
| fbc9f1e755 | |||
| 94c359f7a1 | |||
| 3be557a32b | |||
| 9801f8a5ae | |||
| f0b9bea23e | |||
| 96eb504174 | |||
| ce4347dd96 | |||
| 4f0162ba64 | |||
| 6e1198ab3d | |||
| 7785c2d0aa | |||
| cc8f36d3ec | |||
| 139325e78f | |||
| b18b0a38cf | |||
| a654f55deb | |||
| be60261795 | |||
| c7f4a2d4c1 | |||
| 7037bdf9ef | |||
| d9860497df | |||
| fdffc11580 | |||
| c10de35ca2 | |||
| 56b73332c0 | |||
| bdcd5ea3cf | |||
| edafbbc5a0 | |||
| ba8810e5df | |||
| 63493ed0f7 | |||
| 5f944e441c | |||
| 4dba867f9e | |||
| 06caf0ff66 | |||
| ec92b5d5e1 | |||
| 091a6b8f1f | |||
| 60a1f3b220 | |||
| 7e6aeaf728 | |||
| 0d572ed9b6 | |||
| ea217d16d5 | |||
| 7650813bb7 | |||
| 5d03995f10 | |||
| 1bc58573c7 | |||
| 4880527d4d | |||
| 50f2a29e1e | |||
| 99f219de3b | |||
| 12bb613eb0 | |||
| 141e1cbc94 | |||
| 5b4ea5a0c5 | |||
| b824680508 | |||
| 295bf079b9 | |||
| 974582f7e5 | |||
| 2ded0c9044 | |||
| c3343959c5 | |||
| 39f04b1a1b | |||
| 3d2b935c60 | |||
| db01b0c8dd | |||
| 662756ac18 | |||
| b0bf41968e | |||
| 2221b559ca | |||
| 021b7ec9fe | |||
| 154d4823e4 | |||
| 71dfe5d9e1 | |||
| 58110c474a | |||
| df2ec4b1ba | |||
| 2c66a1d6e6 | |||
| c76ee355d8 | |||
| a5c314c5c5 | |||
| cba35a4bec | |||
| b774281cbb | |||
| 9358130468 | |||
| 708aa64283 | |||
| c21e5202d6 | |||
| b3bd5cde10 | |||
| df78937ef3 | |||
| 7fb4824f8d | |||
| e0d71a6003 | |||
| 49803385cf | |||
| 39d02f792c | |||
| 4fc78f494c | |||
| b752219d8c | |||
| ec890356e4 | |||
| d405b0c3a2 | |||
| 6c8657b7a8 | |||
| bcce4cee19 | |||
| e6cd4038e2 | |||
| e50f941b79 | |||
| cb7d0e22cc | |||
| 0d5be89310 | |||
| 0b7f07108f | |||
| 6b0816c1c4 | |||
| f66b9099f3 | |||
| da74898f9d | |||
| 46a7f61234 | |||
| e59accf7ee | |||
| 4b110244f2 | |||
| e37040f367 | |||
| 6850a8fa21 | |||
| 877e5ed38a | |||
| 82b4450857 | |||
| b70e435120 | |||
| 3b14cd609f | |||
| 8fdfbf875b | |||
| bc61fc2e1d | |||
| 62f2e05f35 | |||
| 606ce8b82d | |||
| c84befae51 | |||
| 7f3c1686ec | |||
| 43da2ffbdc | |||
| 9472b5c86f | |||
| 7cb0e9dbb7 | |||
| e07521d9b6 | |||
| c2ee12397f | |||
| e6321ff8bc | |||
| 786e0a7a23 | |||
| 1c63321b30 |
@@ -1,5 +1,8 @@
|
|||||||
name: Build and Test with Maven
|
name: Build and Test with Maven
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Build-and-test-with-Maven:
|
Build-and-test-with-Maven:
|
||||||
@@ -15,7 +18,7 @@ jobs:
|
|||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '21'
|
java-version: '24'
|
||||||
cache: 'maven'
|
cache: 'maven'
|
||||||
- name: Compile project
|
- name: Compile project
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
|
name: SonarQube Scan
|
||||||
|
jobs:
|
||||||
|
sonarqube:
|
||||||
|
name: SonarQube Trigger
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checking out
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
# Disabling shallow clone is recommended for improving relevancy of reporting
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install maven
|
||||||
|
run: |
|
||||||
|
apt update
|
||||||
|
apt install -y maven
|
||||||
|
- name: Install java
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: '24'
|
||||||
|
cache: 'maven'
|
||||||
|
- name: Compile project
|
||||||
|
run: |
|
||||||
|
mvn clean dependency:copy-dependencies verify
|
||||||
|
- name: SonarQube Scan
|
||||||
|
uses: SonarSource/sonarqube-scan-action@v5.3.0
|
||||||
|
env:
|
||||||
|
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||||
|
with:
|
||||||
|
args: >
|
||||||
|
-Dsonar.projectKey=Java-TX
|
||||||
|
-Dsonar.sources=src/main/java
|
||||||
|
-Dsonar.tests=src/test/java
|
||||||
|
-Dsonar.junit.reportPaths=target/test-reports
|
||||||
|
-Dsonar.java.binaries=target/classes
|
||||||
|
-Dsonar.java.libraries=target/dependency/*.jar
|
||||||
|
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
## Java-TX Compiler
|
||||||
|
|
||||||
|
[](https://gitea.hb.dhbw-stuttgart.de/sonarqube/dashboard?id=Java-TX)
|
||||||
|
[](https://gitea.hb.dhbw-stuttgart.de/sonarqube/dashboard?id=Java-TX)
|
||||||
|
[](https://gitea.hb.dhbw-stuttgart.de/sonarqube/dashboard?id=Java-TX)
|
||||||
|
|
||||||
|
Work in Progress Java-TX Compiler repository!
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,873 @@
|
|||||||
|
// Generated from C:/Users/ruben/IdeaProjects/JavaCompilerCore/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Lexer.g4 by ANTLR 4.13.1
|
||||||
|
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", "CheckReturnValue", "this-escape"})
|
||||||
|
public class Java17Lexer extends Lexer {
|
||||||
|
static { RuntimeMetaData.checkVersion("4.13.1", RuntimeMetaData.VERSION); }
|
||||||
|
|
||||||
|
protected static final DFA[] _decisionToDFA;
|
||||||
|
protected static final PredictionContextCache _sharedContextCache =
|
||||||
|
new PredictionContextCache();
|
||||||
|
public static final int
|
||||||
|
ABSTRACT=1, ASSERT=2, BOOLEAN=3, BREAK=4, BYTE=5, CASE=6, CATCH=7, CHAR=8,
|
||||||
|
CLASS=9, CONST=10, CONTINUE=11, DEFAULT=12, DO=13, DOUBLE=14, ELSE=15,
|
||||||
|
ENUM=16, EXTENDS=17, FINAL=18, FINALLY=19, FLOAT=20, FOR=21, IF=22, GOTO=23,
|
||||||
|
IMPLEMENTS=24, IMPORT=25, INSTANCEOF=26, INT=27, INTERFACE=28, LONG=29,
|
||||||
|
NATIVE=30, NEW=31, PACKAGE=32, PRIVATE=33, PROTECTED=34, PUBLIC=35, RETURN=36,
|
||||||
|
SHORT=37, STATIC=38, STRICTFP=39, SUPER=40, SWITCH=41, SYNCHRONIZED=42,
|
||||||
|
THIS=43, THROW=44, THROWS=45, TRANSIENT=46, TRY=47, VOID=48, VOLATILE=49,
|
||||||
|
WHILE=50, MODULE=51, OPEN=52, REQUIRES=53, EXPORTS=54, OPENS=55, TO=56,
|
||||||
|
USES=57, PROVIDES=58, WITH=59, TRANSITIVE=60, VAR=61, YIELD=62, RECORD=63,
|
||||||
|
SEALED=64, PERMITS=65, NON_SEALED=66, DECIMAL_LITERAL=67, HEX_LITERAL=68,
|
||||||
|
OCT_LITERAL=69, BINARY_LITERAL=70, FLOAT_LITERAL=71, HEX_FLOAT_LITERAL=72,
|
||||||
|
BOOL_LITERAL=73, CHAR_LITERAL=74, STRING_LITERAL=75, TEXT_BLOCK=76, NULL_LITERAL=77,
|
||||||
|
LPAREN=78, RPAREN=79, LBRACE=80, RBRACE=81, LBRACK=82, RBRACK=83, SEMI=84,
|
||||||
|
COMMA=85, DOT=86, ASSIGN=87, GT=88, LT=89, BANG=90, TILDE=91, QUESTION=92,
|
||||||
|
COLON=93, EQUAL=94, LE=95, GE=96, NOTEQUAL=97, AND=98, OR=99, INC=100,
|
||||||
|
DEC=101, ADD=102, SUB=103, MUL=104, DIV=105, BITAND=106, BITOR=107, CARET=108,
|
||||||
|
MOD=109, ADD_ASSIGN=110, SUB_ASSIGN=111, MUL_ASSIGN=112, DIV_ASSIGN=113,
|
||||||
|
AND_ASSIGN=114, OR_ASSIGN=115, XOR_ASSIGN=116, MOD_ASSIGN=117, LSHIFT_ASSIGN=118,
|
||||||
|
RSHIFT_ASSIGN=119, URSHIFT_ASSIGN=120, ARROW=121, COLONCOLON=122, AT=123,
|
||||||
|
ELLIPSIS=124, WS=125, COMMENT=126, LINE_COMMENT=127, IDENTIFIER=128;
|
||||||
|
public static String[] channelNames = {
|
||||||
|
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static String[] modeNames = {
|
||||||
|
"DEFAULT_MODE"
|
||||||
|
};
|
||||||
|
|
||||||
|
private static String[] makeRuleNames() {
|
||||||
|
return new String[] {
|
||||||
|
"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", "MODULE", "OPEN", "REQUIRES",
|
||||||
|
"EXPORTS", "OPENS", "TO", "USES", "PROVIDES", "WITH", "TRANSITIVE", "VAR",
|
||||||
|
"YIELD", "RECORD", "SEALED", "PERMITS", "NON_SEALED", "DECIMAL_LITERAL",
|
||||||
|
"HEX_LITERAL", "OCT_LITERAL", "BINARY_LITERAL", "FLOAT_LITERAL", "HEX_FLOAT_LITERAL",
|
||||||
|
"BOOL_LITERAL", "CHAR_LITERAL", "STRING_LITERAL", "TEXT_BLOCK", "NULL_LITERAL",
|
||||||
|
"LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", "RBRACK", "SEMI", "COMMA",
|
||||||
|
"DOT", "ASSIGN", "GT", "LT", "BANG", "TILDE", "QUESTION", "COLON", "EQUAL",
|
||||||
|
"LE", "GE", "NOTEQUAL", "AND", "OR", "INC", "DEC", "ADD", "SUB", "MUL",
|
||||||
|
"DIV", "BITAND", "BITOR", "CARET", "MOD", "ADD_ASSIGN", "SUB_ASSIGN",
|
||||||
|
"MUL_ASSIGN", "DIV_ASSIGN", "AND_ASSIGN", "OR_ASSIGN", "XOR_ASSIGN",
|
||||||
|
"MOD_ASSIGN", "LSHIFT_ASSIGN", "RSHIFT_ASSIGN", "URSHIFT_ASSIGN", "ARROW",
|
||||||
|
"COLONCOLON", "AT", "ELLIPSIS", "WS", "COMMENT", "LINE_COMMENT", "IDENTIFIER",
|
||||||
|
"ExponentPart", "EscapeSequence", "HexDigits", "HexDigit", "Digits",
|
||||||
|
"LetterOrDigit", "Letter"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public static final String[] ruleNames = makeRuleNames();
|
||||||
|
|
||||||
|
private static String[] makeLiteralNames() {
|
||||||
|
return new String[] {
|
||||||
|
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'", "'module'",
|
||||||
|
"'open'", "'requires'", "'exports'", "'opens'", "'to'", "'uses'", "'provides'",
|
||||||
|
"'with'", "'transitive'", "'var'", "'yield'", "'record'", "'sealed'",
|
||||||
|
"'permits'", "'non-sealed'", null, null, null, null, null, null, null,
|
||||||
|
null, null, null, "'null'", "'('", "')'", "'{'", "'}'", "'['", "']'",
|
||||||
|
"';'", "','", "'.'", "'='", "'>'", "'<'", "'!'", "'~'", "'?'", "':'",
|
||||||
|
"'=='", "'<='", "'>='", "'!='", "'&&'", "'||'", "'++'", "'--'", "'+'",
|
||||||
|
"'-'", "'*'", "'/'", "'&'", "'|'", "'^'", "'%'", "'+='", "'-='", "'*='",
|
||||||
|
"'/='", "'&='", "'|='", "'^='", "'%='", "'<<='", "'>>='", "'>>>='", "'->'",
|
||||||
|
"'::'", "'@'", "'...'"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
private static final String[] _LITERAL_NAMES = makeLiteralNames();
|
||||||
|
private static String[] makeSymbolicNames() {
|
||||||
|
return new String[] {
|
||||||
|
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", "MODULE",
|
||||||
|
"OPEN", "REQUIRES", "EXPORTS", "OPENS", "TO", "USES", "PROVIDES", "WITH",
|
||||||
|
"TRANSITIVE", "VAR", "YIELD", "RECORD", "SEALED", "PERMITS", "NON_SEALED",
|
||||||
|
"DECIMAL_LITERAL", "HEX_LITERAL", "OCT_LITERAL", "BINARY_LITERAL", "FLOAT_LITERAL",
|
||||||
|
"HEX_FLOAT_LITERAL", "BOOL_LITERAL", "CHAR_LITERAL", "STRING_LITERAL",
|
||||||
|
"TEXT_BLOCK", "NULL_LITERAL", "LPAREN", "RPAREN", "LBRACE", "RBRACE",
|
||||||
|
"LBRACK", "RBRACK", "SEMI", "COMMA", "DOT", "ASSIGN", "GT", "LT", "BANG",
|
||||||
|
"TILDE", "QUESTION", "COLON", "EQUAL", "LE", "GE", "NOTEQUAL", "AND",
|
||||||
|
"OR", "INC", "DEC", "ADD", "SUB", "MUL", "DIV", "BITAND", "BITOR", "CARET",
|
||||||
|
"MOD", "ADD_ASSIGN", "SUB_ASSIGN", "MUL_ASSIGN", "DIV_ASSIGN", "AND_ASSIGN",
|
||||||
|
"OR_ASSIGN", "XOR_ASSIGN", "MOD_ASSIGN", "LSHIFT_ASSIGN", "RSHIFT_ASSIGN",
|
||||||
|
"URSHIFT_ASSIGN", "ARROW", "COLONCOLON", "AT", "ELLIPSIS", "WS", "COMMENT",
|
||||||
|
"LINE_COMMENT", "IDENTIFIER"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
|
||||||
|
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 Java17Lexer(CharStream input) {
|
||||||
|
super(input);
|
||||||
|
_interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGrammarFileName() { return "Java17Lexer.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 =
|
||||||
|
"\u0004\u0000\u0080\u0458\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002"+
|
||||||
|
"\u0001\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002"+
|
||||||
|
"\u0004\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002"+
|
||||||
|
"\u0007\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002"+
|
||||||
|
"\u000b\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e"+
|
||||||
|
"\u0002\u000f\u0007\u000f\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011"+
|
||||||
|
"\u0002\u0012\u0007\u0012\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014"+
|
||||||
|
"\u0002\u0015\u0007\u0015\u0002\u0016\u0007\u0016\u0002\u0017\u0007\u0017"+
|
||||||
|
"\u0002\u0018\u0007\u0018\u0002\u0019\u0007\u0019\u0002\u001a\u0007\u001a"+
|
||||||
|
"\u0002\u001b\u0007\u001b\u0002\u001c\u0007\u001c\u0002\u001d\u0007\u001d"+
|
||||||
|
"\u0002\u001e\u0007\u001e\u0002\u001f\u0007\u001f\u0002 \u0007 \u0002!"+
|
||||||
|
"\u0007!\u0002\"\u0007\"\u0002#\u0007#\u0002$\u0007$\u0002%\u0007%\u0002"+
|
||||||
|
"&\u0007&\u0002\'\u0007\'\u0002(\u0007(\u0002)\u0007)\u0002*\u0007*\u0002"+
|
||||||
|
"+\u0007+\u0002,\u0007,\u0002-\u0007-\u0002.\u0007.\u0002/\u0007/\u0002"+
|
||||||
|
"0\u00070\u00021\u00071\u00022\u00072\u00023\u00073\u00024\u00074\u0002"+
|
||||||
|
"5\u00075\u00026\u00076\u00027\u00077\u00028\u00078\u00029\u00079\u0002"+
|
||||||
|
":\u0007:\u0002;\u0007;\u0002<\u0007<\u0002=\u0007=\u0002>\u0007>\u0002"+
|
||||||
|
"?\u0007?\u0002@\u0007@\u0002A\u0007A\u0002B\u0007B\u0002C\u0007C\u0002"+
|
||||||
|
"D\u0007D\u0002E\u0007E\u0002F\u0007F\u0002G\u0007G\u0002H\u0007H\u0002"+
|
||||||
|
"I\u0007I\u0002J\u0007J\u0002K\u0007K\u0002L\u0007L\u0002M\u0007M\u0002"+
|
||||||
|
"N\u0007N\u0002O\u0007O\u0002P\u0007P\u0002Q\u0007Q\u0002R\u0007R\u0002"+
|
||||||
|
"S\u0007S\u0002T\u0007T\u0002U\u0007U\u0002V\u0007V\u0002W\u0007W\u0002"+
|
||||||
|
"X\u0007X\u0002Y\u0007Y\u0002Z\u0007Z\u0002[\u0007[\u0002\\\u0007\\\u0002"+
|
||||||
|
"]\u0007]\u0002^\u0007^\u0002_\u0007_\u0002`\u0007`\u0002a\u0007a\u0002"+
|
||||||
|
"b\u0007b\u0002c\u0007c\u0002d\u0007d\u0002e\u0007e\u0002f\u0007f\u0002"+
|
||||||
|
"g\u0007g\u0002h\u0007h\u0002i\u0007i\u0002j\u0007j\u0002k\u0007k\u0002"+
|
||||||
|
"l\u0007l\u0002m\u0007m\u0002n\u0007n\u0002o\u0007o\u0002p\u0007p\u0002"+
|
||||||
|
"q\u0007q\u0002r\u0007r\u0002s\u0007s\u0002t\u0007t\u0002u\u0007u\u0002"+
|
||||||
|
"v\u0007v\u0002w\u0007w\u0002x\u0007x\u0002y\u0007y\u0002z\u0007z\u0002"+
|
||||||
|
"{\u0007{\u0002|\u0007|\u0002}\u0007}\u0002~\u0007~\u0002\u007f\u0007\u007f"+
|
||||||
|
"\u0002\u0080\u0007\u0080\u0002\u0081\u0007\u0081\u0002\u0082\u0007\u0082"+
|
||||||
|
"\u0002\u0083\u0007\u0083\u0002\u0084\u0007\u0084\u0002\u0085\u0007\u0085"+
|
||||||
|
"\u0002\u0086\u0007\u0086\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000"+
|
||||||
|
"\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0001"+
|
||||||
|
"\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+
|
||||||
|
"\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002"+
|
||||||
|
"\u0001\u0002\u0001\u0002\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003"+
|
||||||
|
"\u0001\u0003\u0001\u0003\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004"+
|
||||||
|
"\u0001\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005"+
|
||||||
|
"\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+
|
||||||
|
"\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\b\u0001"+
|
||||||
|
"\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001\t\u0001\t\u0001\t\u0001\t\u0001"+
|
||||||
|
"\t\u0001\t\u0001\n\u0001\n\u0001\n\u0001\n\u0001\n\u0001\n\u0001\n\u0001"+
|
||||||
|
"\n\u0001\n\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b"+
|
||||||
|
"\u0001\u000b\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001\f\u0001\r\u0001"+
|
||||||
|
"\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\u000e\u0001\u000e\u0001"+
|
||||||
|
"\u000e\u0001\u000e\u0001\u000e\u0001\u000f\u0001\u000f\u0001\u000f\u0001"+
|
||||||
|
"\u000f\u0001\u000f\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001"+
|
||||||
|
"\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0011\u0001\u0011\u0001"+
|
||||||
|
"\u0011\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0012\u0001\u0012\u0001"+
|
||||||
|
"\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001"+
|
||||||
|
"\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001"+
|
||||||
|
"\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0015\u0001\u0015\u0001"+
|
||||||
|
"\u0015\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001"+
|
||||||
|
"\u0017\u0001\u0017\u0001\u0017\u0001\u0017\u0001\u0017\u0001\u0017\u0001"+
|
||||||
|
"\u0017\u0001\u0017\u0001\u0017\u0001\u0017\u0001\u0017\u0001\u0018\u0001"+
|
||||||
|
"\u0018\u0001\u0018\u0001\u0018\u0001\u0018\u0001\u0018\u0001\u0018\u0001"+
|
||||||
|
"\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001"+
|
||||||
|
"\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u001a\u0001"+
|
||||||
|
"\u001a\u0001\u001a\u0001\u001a\u0001\u001b\u0001\u001b\u0001\u001b\u0001"+
|
||||||
|
"\u001b\u0001\u001b\u0001\u001b\u0001\u001b\u0001\u001b\u0001\u001b\u0001"+
|
||||||
|
"\u001b\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001c\u0001"+
|
||||||
|
"\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0001"+
|
||||||
|
"\u001d\u0001\u001e\u0001\u001e\u0001\u001e\u0001\u001e\u0001\u001f\u0001"+
|
||||||
|
"\u001f\u0001\u001f\u0001\u001f\u0001\u001f\u0001\u001f\u0001\u001f\u0001"+
|
||||||
|
"\u001f\u0001 \u0001 \u0001 \u0001 \u0001 \u0001 \u0001 \u0001 \u0001!"+
|
||||||
|
"\u0001!\u0001!\u0001!\u0001!\u0001!\u0001!\u0001!\u0001!\u0001!\u0001"+
|
||||||
|
"\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001#\u0001#\u0001"+
|
||||||
|
"#\u0001#\u0001#\u0001#\u0001#\u0001$\u0001$\u0001$\u0001$\u0001$\u0001"+
|
||||||
|
"$\u0001%\u0001%\u0001%\u0001%\u0001%\u0001%\u0001%\u0001&\u0001&\u0001"+
|
||||||
|
"&\u0001&\u0001&\u0001&\u0001&\u0001&\u0001&\u0001\'\u0001\'\u0001\'\u0001"+
|
||||||
|
"\'\u0001\'\u0001\'\u0001(\u0001(\u0001(\u0001(\u0001(\u0001(\u0001(\u0001"+
|
||||||
|
")\u0001)\u0001)\u0001)\u0001)\u0001)\u0001)\u0001)\u0001)\u0001)\u0001"+
|
||||||
|
")\u0001)\u0001)\u0001*\u0001*\u0001*\u0001*\u0001*\u0001+\u0001+\u0001"+
|
||||||
|
"+\u0001+\u0001+\u0001+\u0001,\u0001,\u0001,\u0001,\u0001,\u0001,\u0001"+
|
||||||
|
",\u0001-\u0001-\u0001-\u0001-\u0001-\u0001-\u0001-\u0001-\u0001-\u0001"+
|
||||||
|
"-\u0001.\u0001.\u0001.\u0001.\u0001/\u0001/\u0001/\u0001/\u0001/\u0001"+
|
||||||
|
"0\u00010\u00010\u00010\u00010\u00010\u00010\u00010\u00010\u00011\u0001"+
|
||||||
|
"1\u00011\u00011\u00011\u00011\u00012\u00012\u00012\u00012\u00012\u0001"+
|
||||||
|
"2\u00012\u00013\u00013\u00013\u00013\u00013\u00014\u00014\u00014\u0001"+
|
||||||
|
"4\u00014\u00014\u00014\u00014\u00014\u00015\u00015\u00015\u00015\u0001"+
|
||||||
|
"5\u00015\u00015\u00015\u00016\u00016\u00016\u00016\u00016\u00016\u0001"+
|
||||||
|
"7\u00017\u00017\u00018\u00018\u00018\u00018\u00018\u00019\u00019\u0001"+
|
||||||
|
"9\u00019\u00019\u00019\u00019\u00019\u00019\u0001:\u0001:\u0001:\u0001"+
|
||||||
|
":\u0001:\u0001;\u0001;\u0001;\u0001;\u0001;\u0001;\u0001;\u0001;\u0001"+
|
||||||
|
";\u0001;\u0001;\u0001<\u0001<\u0001<\u0001<\u0001=\u0001=\u0001=\u0001"+
|
||||||
|
"=\u0001=\u0001=\u0001>\u0001>\u0001>\u0001>\u0001>\u0001>\u0001>\u0001"+
|
||||||
|
"?\u0001?\u0001?\u0001?\u0001?\u0001?\u0001?\u0001@\u0001@\u0001@\u0001"+
|
||||||
|
"@\u0001@\u0001@\u0001@\u0001@\u0001A\u0001A\u0001A\u0001A\u0001A\u0001"+
|
||||||
|
"A\u0001A\u0001A\u0001A\u0001A\u0001A\u0001B\u0001B\u0001B\u0003B\u02d5"+
|
||||||
|
"\bB\u0001B\u0004B\u02d8\bB\u000bB\fB\u02d9\u0001B\u0003B\u02dd\bB\u0003"+
|
||||||
|
"B\u02df\bB\u0001B\u0003B\u02e2\bB\u0001C\u0001C\u0001C\u0001C\u0005C\u02e8"+
|
||||||
|
"\bC\nC\fC\u02eb\tC\u0001C\u0003C\u02ee\bC\u0001C\u0003C\u02f1\bC\u0001"+
|
||||||
|
"D\u0001D\u0005D\u02f5\bD\nD\fD\u02f8\tD\u0001D\u0001D\u0005D\u02fc\bD"+
|
||||||
|
"\nD\fD\u02ff\tD\u0001D\u0003D\u0302\bD\u0001D\u0003D\u0305\bD\u0001E\u0001"+
|
||||||
|
"E\u0001E\u0001E\u0005E\u030b\bE\nE\fE\u030e\tE\u0001E\u0003E\u0311\bE"+
|
||||||
|
"\u0001E\u0003E\u0314\bE\u0001F\u0001F\u0001F\u0003F\u0319\bF\u0001F\u0001"+
|
||||||
|
"F\u0003F\u031d\bF\u0001F\u0003F\u0320\bF\u0001F\u0003F\u0323\bF\u0001"+
|
||||||
|
"F\u0001F\u0001F\u0003F\u0328\bF\u0001F\u0003F\u032b\bF\u0003F\u032d\b"+
|
||||||
|
"F\u0001G\u0001G\u0001G\u0001G\u0003G\u0333\bG\u0001G\u0003G\u0336\bG\u0001"+
|
||||||
|
"G\u0001G\u0003G\u033a\bG\u0001G\u0001G\u0003G\u033e\bG\u0001G\u0001G\u0003"+
|
||||||
|
"G\u0342\bG\u0001H\u0001H\u0001H\u0001H\u0001H\u0001H\u0001H\u0001H\u0001"+
|
||||||
|
"H\u0003H\u034d\bH\u0001I\u0001I\u0001I\u0003I\u0352\bI\u0001I\u0001I\u0001"+
|
||||||
|
"J\u0001J\u0001J\u0005J\u0359\bJ\nJ\fJ\u035c\tJ\u0001J\u0001J\u0001K\u0001"+
|
||||||
|
"K\u0001K\u0001K\u0001K\u0005K\u0365\bK\nK\fK\u0368\tK\u0001K\u0001K\u0001"+
|
||||||
|
"K\u0005K\u036d\bK\nK\fK\u0370\tK\u0001K\u0001K\u0001K\u0001K\u0001L\u0001"+
|
||||||
|
"L\u0001L\u0001L\u0001L\u0001M\u0001M\u0001N\u0001N\u0001O\u0001O\u0001"+
|
||||||
|
"P\u0001P\u0001Q\u0001Q\u0001R\u0001R\u0001S\u0001S\u0001T\u0001T\u0001"+
|
||||||
|
"U\u0001U\u0001V\u0001V\u0001W\u0001W\u0001X\u0001X\u0001Y\u0001Y\u0001"+
|
||||||
|
"Z\u0001Z\u0001[\u0001[\u0001\\\u0001\\\u0001]\u0001]\u0001]\u0001^\u0001"+
|
||||||
|
"^\u0001^\u0001_\u0001_\u0001_\u0001`\u0001`\u0001`\u0001a\u0001a\u0001"+
|
||||||
|
"a\u0001b\u0001b\u0001b\u0001c\u0001c\u0001c\u0001d\u0001d\u0001d\u0001"+
|
||||||
|
"e\u0001e\u0001f\u0001f\u0001g\u0001g\u0001h\u0001h\u0001i\u0001i\u0001"+
|
||||||
|
"j\u0001j\u0001k\u0001k\u0001l\u0001l\u0001m\u0001m\u0001m\u0001n\u0001"+
|
||||||
|
"n\u0001n\u0001o\u0001o\u0001o\u0001p\u0001p\u0001p\u0001q\u0001q\u0001"+
|
||||||
|
"q\u0001r\u0001r\u0001r\u0001s\u0001s\u0001s\u0001t\u0001t\u0001t\u0001"+
|
||||||
|
"u\u0001u\u0001u\u0001u\u0001v\u0001v\u0001v\u0001v\u0001w\u0001w\u0001"+
|
||||||
|
"w\u0001w\u0001w\u0001x\u0001x\u0001x\u0001y\u0001y\u0001y\u0001z\u0001"+
|
||||||
|
"z\u0001{\u0001{\u0001{\u0001{\u0001|\u0004|\u03f5\b|\u000b|\f|\u03f6\u0001"+
|
||||||
|
"|\u0001|\u0001}\u0001}\u0001}\u0001}\u0005}\u03ff\b}\n}\f}\u0402\t}\u0001"+
|
||||||
|
"}\u0001}\u0001}\u0001}\u0001}\u0001~\u0001~\u0001~\u0001~\u0005~\u040d"+
|
||||||
|
"\b~\n~\f~\u0410\t~\u0001~\u0001~\u0001\u007f\u0001\u007f\u0005\u007f\u0416"+
|
||||||
|
"\b\u007f\n\u007f\f\u007f\u0419\t\u007f\u0001\u0080\u0001\u0080\u0003\u0080"+
|
||||||
|
"\u041d\b\u0080\u0001\u0080\u0001\u0080\u0001\u0081\u0001\u0081\u0001\u0081"+
|
||||||
|
"\u0001\u0081\u0003\u0081\u0425\b\u0081\u0001\u0081\u0003\u0081\u0428\b"+
|
||||||
|
"\u0081\u0001\u0081\u0001\u0081\u0001\u0081\u0004\u0081\u042d\b\u0081\u000b"+
|
||||||
|
"\u0081\f\u0081\u042e\u0001\u0081\u0001\u0081\u0001\u0081\u0001\u0081\u0001"+
|
||||||
|
"\u0081\u0003\u0081\u0436\b\u0081\u0001\u0082\u0001\u0082\u0001\u0082\u0005"+
|
||||||
|
"\u0082\u043b\b\u0082\n\u0082\f\u0082\u043e\t\u0082\u0001\u0082\u0003\u0082"+
|
||||||
|
"\u0441\b\u0082\u0001\u0083\u0001\u0083\u0001\u0084\u0001\u0084\u0005\u0084"+
|
||||||
|
"\u0447\b\u0084\n\u0084\f\u0084\u044a\t\u0084\u0001\u0084\u0003\u0084\u044d"+
|
||||||
|
"\b\u0084\u0001\u0085\u0001\u0085\u0003\u0085\u0451\b\u0085\u0001\u0086"+
|
||||||
|
"\u0001\u0086\u0001\u0086\u0001\u0086\u0003\u0086\u0457\b\u0086\u0002\u036e"+
|
||||||
|
"\u0400\u0000\u0087\u0001\u0001\u0003\u0002\u0005\u0003\u0007\u0004\t\u0005"+
|
||||||
|
"\u000b\u0006\r\u0007\u000f\b\u0011\t\u0013\n\u0015\u000b\u0017\f\u0019"+
|
||||||
|
"\r\u001b\u000e\u001d\u000f\u001f\u0010!\u0011#\u0012%\u0013\'\u0014)\u0015"+
|
||||||
|
"+\u0016-\u0017/\u00181\u00193\u001a5\u001b7\u001c9\u001d;\u001e=\u001f"+
|
||||||
|
"? A!C\"E#G$I%K&M\'O(Q)S*U+W,Y-[.]/_0a1c2e3g4i5k6m7o8q9s:u;w<y={>}?\u007f"+
|
||||||
|
"@\u0081A\u0083B\u0085C\u0087D\u0089E\u008bF\u008dG\u008fH\u0091I\u0093"+
|
||||||
|
"J\u0095K\u0097L\u0099M\u009bN\u009dO\u009fP\u00a1Q\u00a3R\u00a5S\u00a7"+
|
||||||
|
"T\u00a9U\u00abV\u00adW\u00afX\u00b1Y\u00b3Z\u00b5[\u00b7\\\u00b9]\u00bb"+
|
||||||
|
"^\u00bd_\u00bf`\u00c1a\u00c3b\u00c5c\u00c7d\u00c9e\u00cbf\u00cdg\u00cf"+
|
||||||
|
"h\u00d1i\u00d3j\u00d5k\u00d7l\u00d9m\u00dbn\u00ddo\u00dfp\u00e1q\u00e3"+
|
||||||
|
"r\u00e5s\u00e7t\u00e9u\u00ebv\u00edw\u00efx\u00f1y\u00f3z\u00f5{\u00f7"+
|
||||||
|
"|\u00f9}\u00fb~\u00fd\u007f\u00ff\u0080\u0101\u0000\u0103\u0000\u0105"+
|
||||||
|
"\u0000\u0107\u0000\u0109\u0000\u010b\u0000\u010d\u0000\u0001\u0000\u001b"+
|
||||||
|
"\u0001\u000019\u0002\u0000LLll\u0002\u0000XXxx\u0003\u000009AFaf\u0004"+
|
||||||
|
"\u000009AF__af\u0001\u000007\u0002\u000007__\u0002\u0000BBbb\u0001\u0000"+
|
||||||
|
"01\u0002\u000001__\u0004\u0000DDFFddff\u0002\u0000PPpp\u0002\u0000++-"+
|
||||||
|
"-\u0004\u0000\n\n\r\r\'\'\\\\\u0004\u0000\n\n\r\r\"\"\\\\\u0002\u0000"+
|
||||||
|
"\t\t \u0002\u0000\n\n\r\r\u0003\u0000\t\n\f\r \u0002\u0000EEee\b\u0000"+
|
||||||
|
"\"\"\'\'\\\\bbffnnrrtt\u0001\u000003\u0001\u000009\u0002\u000009__\u0004"+
|
||||||
|
"\u0000$$AZ__az\u0002\u0000\u0000\u007f\u8000\ud800\u8000\udbff\u0001\u0000"+
|
||||||
|
"\u8000\ud800\u8000\udbff\u0001\u0000\u8000\udc00\u8000\udfff\u0484\u0000"+
|
||||||
|
"\u0001\u0001\u0000\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000"+
|
||||||
|
"\u0005\u0001\u0000\u0000\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0000"+
|
||||||
|
"\t\u0001\u0000\u0000\u0000\u0000\u000b\u0001\u0000\u0000\u0000\u0000\r"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0000\u000f\u0001\u0000\u0000\u0000\u0000\u0011"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0000\u0013\u0001\u0000\u0000\u0000\u0000\u0015"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0000\u0017\u0001\u0000\u0000\u0000\u0000\u0019"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0000\u001b\u0001\u0000\u0000\u0000\u0000\u001d"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0000\u001f\u0001\u0000\u0000\u0000\u0000!\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u0000#\u0001\u0000\u0000\u0000\u0000%\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0000\'\u0001\u0000\u0000\u0000\u0000)\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000+\u0001\u0000\u0000\u0000\u0000-\u0001\u0000\u0000\u0000\u0000/"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u00001\u0001\u0000\u0000\u0000\u00003\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u00005\u0001\u0000\u0000\u0000\u00007\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00009\u0001\u0000\u0000\u0000\u0000;\u0001\u0000\u0000\u0000\u0000="+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0000?\u0001\u0000\u0000\u0000\u0000A\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0000C\u0001\u0000\u0000\u0000\u0000E\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000G\u0001\u0000\u0000\u0000\u0000I\u0001\u0000\u0000\u0000\u0000K"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0000M\u0001\u0000\u0000\u0000\u0000O\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0000Q\u0001\u0000\u0000\u0000\u0000S\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000U\u0001\u0000\u0000\u0000\u0000W\u0001\u0000\u0000\u0000\u0000Y"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0000[\u0001\u0000\u0000\u0000\u0000]\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0000_\u0001\u0000\u0000\u0000\u0000a\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000c\u0001\u0000\u0000\u0000\u0000e\u0001\u0000\u0000\u0000\u0000g"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0000i\u0001\u0000\u0000\u0000\u0000k\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0000m\u0001\u0000\u0000\u0000\u0000o\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000q\u0001\u0000\u0000\u0000\u0000s\u0001\u0000\u0000\u0000\u0000u"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0000w\u0001\u0000\u0000\u0000\u0000y\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0000{\u0001\u0000\u0000\u0000\u0000}\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u007f\u0001\u0000\u0000\u0000\u0000\u0081\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u0083\u0001\u0000\u0000\u0000\u0000\u0085\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u0087\u0001\u0000\u0000\u0000\u0000\u0089\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u008b\u0001\u0000\u0000\u0000\u0000\u008d\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u008f\u0001\u0000\u0000\u0000\u0000\u0091\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u0093\u0001\u0000\u0000\u0000\u0000\u0095\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u0097\u0001\u0000\u0000\u0000\u0000\u0099\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u009b\u0001\u0000\u0000\u0000\u0000\u009d\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u009f\u0001\u0000\u0000\u0000\u0000\u00a1\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00a3\u0001\u0000\u0000\u0000\u0000\u00a5\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00a7\u0001\u0000\u0000\u0000\u0000\u00a9\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00ab\u0001\u0000\u0000\u0000\u0000\u00ad\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00af\u0001\u0000\u0000\u0000\u0000\u00b1\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00b3\u0001\u0000\u0000\u0000\u0000\u00b5\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00b7\u0001\u0000\u0000\u0000\u0000\u00b9\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00bb\u0001\u0000\u0000\u0000\u0000\u00bd\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00bf\u0001\u0000\u0000\u0000\u0000\u00c1\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00c3\u0001\u0000\u0000\u0000\u0000\u00c5\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00c7\u0001\u0000\u0000\u0000\u0000\u00c9\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00cb\u0001\u0000\u0000\u0000\u0000\u00cd\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00cf\u0001\u0000\u0000\u0000\u0000\u00d1\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00d3\u0001\u0000\u0000\u0000\u0000\u00d5\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00d7\u0001\u0000\u0000\u0000\u0000\u00d9\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00db\u0001\u0000\u0000\u0000\u0000\u00dd\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00df\u0001\u0000\u0000\u0000\u0000\u00e1\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00e3\u0001\u0000\u0000\u0000\u0000\u00e5\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00e7\u0001\u0000\u0000\u0000\u0000\u00e9\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00eb\u0001\u0000\u0000\u0000\u0000\u00ed\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00ef\u0001\u0000\u0000\u0000\u0000\u00f1\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00f3\u0001\u0000\u0000\u0000\u0000\u00f5\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00f7\u0001\u0000\u0000\u0000\u0000\u00f9\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00fb\u0001\u0000\u0000\u0000\u0000\u00fd\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0000\u00ff\u0001\u0000\u0000\u0000\u0001\u010f\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0003\u0118\u0001\u0000\u0000\u0000\u0005\u011f\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0007\u0127\u0001\u0000\u0000\u0000\t\u012d\u0001\u0000\u0000\u0000\u000b"+
|
||||||
|
"\u0132\u0001\u0000\u0000\u0000\r\u0137\u0001\u0000\u0000\u0000\u000f\u013d"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0011\u0142\u0001\u0000\u0000\u0000\u0013\u0148"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0015\u014e\u0001\u0000\u0000\u0000\u0017\u0157"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0019\u015f\u0001\u0000\u0000\u0000\u001b\u0162"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u001d\u0169\u0001\u0000\u0000\u0000\u001f\u016e"+
|
||||||
|
"\u0001\u0000\u0000\u0000!\u0173\u0001\u0000\u0000\u0000#\u017b\u0001\u0000"+
|
||||||
|
"\u0000\u0000%\u0181\u0001\u0000\u0000\u0000\'\u0189\u0001\u0000\u0000"+
|
||||||
|
"\u0000)\u018f\u0001\u0000\u0000\u0000+\u0193\u0001\u0000\u0000\u0000-"+
|
||||||
|
"\u0196\u0001\u0000\u0000\u0000/\u019b\u0001\u0000\u0000\u00001\u01a6\u0001"+
|
||||||
|
"\u0000\u0000\u00003\u01ad\u0001\u0000\u0000\u00005\u01b8\u0001\u0000\u0000"+
|
||||||
|
"\u00007\u01bc\u0001\u0000\u0000\u00009\u01c6\u0001\u0000\u0000\u0000;"+
|
||||||
|
"\u01cb\u0001\u0000\u0000\u0000=\u01d2\u0001\u0000\u0000\u0000?\u01d6\u0001"+
|
||||||
|
"\u0000\u0000\u0000A\u01de\u0001\u0000\u0000\u0000C\u01e6\u0001\u0000\u0000"+
|
||||||
|
"\u0000E\u01f0\u0001\u0000\u0000\u0000G\u01f7\u0001\u0000\u0000\u0000I"+
|
||||||
|
"\u01fe\u0001\u0000\u0000\u0000K\u0204\u0001\u0000\u0000\u0000M\u020b\u0001"+
|
||||||
|
"\u0000\u0000\u0000O\u0214\u0001\u0000\u0000\u0000Q\u021a\u0001\u0000\u0000"+
|
||||||
|
"\u0000S\u0221\u0001\u0000\u0000\u0000U\u022e\u0001\u0000\u0000\u0000W"+
|
||||||
|
"\u0233\u0001\u0000\u0000\u0000Y\u0239\u0001\u0000\u0000\u0000[\u0240\u0001"+
|
||||||
|
"\u0000\u0000\u0000]\u024a\u0001\u0000\u0000\u0000_\u024e\u0001\u0000\u0000"+
|
||||||
|
"\u0000a\u0253\u0001\u0000\u0000\u0000c\u025c\u0001\u0000\u0000\u0000e"+
|
||||||
|
"\u0262\u0001\u0000\u0000\u0000g\u0269\u0001\u0000\u0000\u0000i\u026e\u0001"+
|
||||||
|
"\u0000\u0000\u0000k\u0277\u0001\u0000\u0000\u0000m\u027f\u0001\u0000\u0000"+
|
||||||
|
"\u0000o\u0285\u0001\u0000\u0000\u0000q\u0288\u0001\u0000\u0000\u0000s"+
|
||||||
|
"\u028d\u0001\u0000\u0000\u0000u\u0296\u0001\u0000\u0000\u0000w\u029b\u0001"+
|
||||||
|
"\u0000\u0000\u0000y\u02a6\u0001\u0000\u0000\u0000{\u02aa\u0001\u0000\u0000"+
|
||||||
|
"\u0000}\u02b0\u0001\u0000\u0000\u0000\u007f\u02b7\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0081\u02be\u0001\u0000\u0000\u0000\u0083\u02c6\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0085\u02de\u0001\u0000\u0000\u0000\u0087\u02e3\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0089\u02f2\u0001\u0000\u0000\u0000\u008b\u0306\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u008d\u032c\u0001\u0000\u0000\u0000\u008f\u032e\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0091\u034c\u0001\u0000\u0000\u0000\u0093\u034e\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0095\u0355\u0001\u0000\u0000\u0000\u0097\u035f\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0099\u0375\u0001\u0000\u0000\u0000\u009b\u037a\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u009d\u037c\u0001\u0000\u0000\u0000\u009f\u037e\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00a1\u0380\u0001\u0000\u0000\u0000\u00a3\u0382\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00a5\u0384\u0001\u0000\u0000\u0000\u00a7\u0386\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00a9\u0388\u0001\u0000\u0000\u0000\u00ab\u038a\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00ad\u038c\u0001\u0000\u0000\u0000\u00af\u038e\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00b1\u0390\u0001\u0000\u0000\u0000\u00b3\u0392\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00b5\u0394\u0001\u0000\u0000\u0000\u00b7\u0396\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00b9\u0398\u0001\u0000\u0000\u0000\u00bb\u039a\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00bd\u039d\u0001\u0000\u0000\u0000\u00bf\u03a0\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00c1\u03a3\u0001\u0000\u0000\u0000\u00c3\u03a6\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00c5\u03a9\u0001\u0000\u0000\u0000\u00c7\u03ac\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00c9\u03af\u0001\u0000\u0000\u0000\u00cb\u03b2\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00cd\u03b4\u0001\u0000\u0000\u0000\u00cf\u03b6\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00d1\u03b8\u0001\u0000\u0000\u0000\u00d3\u03ba\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00d5\u03bc\u0001\u0000\u0000\u0000\u00d7\u03be\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00d9\u03c0\u0001\u0000\u0000\u0000\u00db\u03c2\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00dd\u03c5\u0001\u0000\u0000\u0000\u00df\u03c8\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00e1\u03cb\u0001\u0000\u0000\u0000\u00e3\u03ce\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00e5\u03d1\u0001\u0000\u0000\u0000\u00e7\u03d4\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00e9\u03d7\u0001\u0000\u0000\u0000\u00eb\u03da\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00ed\u03de\u0001\u0000\u0000\u0000\u00ef\u03e2\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00f1\u03e7\u0001\u0000\u0000\u0000\u00f3\u03ea\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00f5\u03ed\u0001\u0000\u0000\u0000\u00f7\u03ef\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00f9\u03f4\u0001\u0000\u0000\u0000\u00fb\u03fa\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u00fd\u0408\u0001\u0000\u0000\u0000\u00ff\u0413\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0101\u041a\u0001\u0000\u0000\u0000\u0103\u0435\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0105\u0437\u0001\u0000\u0000\u0000\u0107\u0442\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0109\u0444\u0001\u0000\u0000\u0000\u010b\u0450\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u010d\u0456\u0001\u0000\u0000\u0000\u010f\u0110\u0005a\u0000\u0000\u0110"+
|
||||||
|
"\u0111\u0005b\u0000\u0000\u0111\u0112\u0005s\u0000\u0000\u0112\u0113\u0005"+
|
||||||
|
"t\u0000\u0000\u0113\u0114\u0005r\u0000\u0000\u0114\u0115\u0005a\u0000"+
|
||||||
|
"\u0000\u0115\u0116\u0005c\u0000\u0000\u0116\u0117\u0005t\u0000\u0000\u0117"+
|
||||||
|
"\u0002\u0001\u0000\u0000\u0000\u0118\u0119\u0005a\u0000\u0000\u0119\u011a"+
|
||||||
|
"\u0005s\u0000\u0000\u011a\u011b\u0005s\u0000\u0000\u011b\u011c\u0005e"+
|
||||||
|
"\u0000\u0000\u011c\u011d\u0005r\u0000\u0000\u011d\u011e\u0005t\u0000\u0000"+
|
||||||
|
"\u011e\u0004\u0001\u0000\u0000\u0000\u011f\u0120\u0005b\u0000\u0000\u0120"+
|
||||||
|
"\u0121\u0005o\u0000\u0000\u0121\u0122\u0005o\u0000\u0000\u0122\u0123\u0005"+
|
||||||
|
"l\u0000\u0000\u0123\u0124\u0005e\u0000\u0000\u0124\u0125\u0005a\u0000"+
|
||||||
|
"\u0000\u0125\u0126\u0005n\u0000\u0000\u0126\u0006\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0127\u0128\u0005b\u0000\u0000\u0128\u0129\u0005r\u0000\u0000\u0129\u012a"+
|
||||||
|
"\u0005e\u0000\u0000\u012a\u012b\u0005a\u0000\u0000\u012b\u012c\u0005k"+
|
||||||
|
"\u0000\u0000\u012c\b\u0001\u0000\u0000\u0000\u012d\u012e\u0005b\u0000"+
|
||||||
|
"\u0000\u012e\u012f\u0005y\u0000\u0000\u012f\u0130\u0005t\u0000\u0000\u0130"+
|
||||||
|
"\u0131\u0005e\u0000\u0000\u0131\n\u0001\u0000\u0000\u0000\u0132\u0133"+
|
||||||
|
"\u0005c\u0000\u0000\u0133\u0134\u0005a\u0000\u0000\u0134\u0135\u0005s"+
|
||||||
|
"\u0000\u0000\u0135\u0136\u0005e\u0000\u0000\u0136\f\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0137\u0138\u0005c\u0000\u0000\u0138\u0139\u0005a\u0000\u0000\u0139"+
|
||||||
|
"\u013a\u0005t\u0000\u0000\u013a\u013b\u0005c\u0000\u0000\u013b\u013c\u0005"+
|
||||||
|
"h\u0000\u0000\u013c\u000e\u0001\u0000\u0000\u0000\u013d\u013e\u0005c\u0000"+
|
||||||
|
"\u0000\u013e\u013f\u0005h\u0000\u0000\u013f\u0140\u0005a\u0000\u0000\u0140"+
|
||||||
|
"\u0141\u0005r\u0000\u0000\u0141\u0010\u0001\u0000\u0000\u0000\u0142\u0143"+
|
||||||
|
"\u0005c\u0000\u0000\u0143\u0144\u0005l\u0000\u0000\u0144\u0145\u0005a"+
|
||||||
|
"\u0000\u0000\u0145\u0146\u0005s\u0000\u0000\u0146\u0147\u0005s\u0000\u0000"+
|
||||||
|
"\u0147\u0012\u0001\u0000\u0000\u0000\u0148\u0149\u0005c\u0000\u0000\u0149"+
|
||||||
|
"\u014a\u0005o\u0000\u0000\u014a\u014b\u0005n\u0000\u0000\u014b\u014c\u0005"+
|
||||||
|
"s\u0000\u0000\u014c\u014d\u0005t\u0000\u0000\u014d\u0014\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u014e\u014f\u0005c\u0000\u0000\u014f\u0150\u0005o\u0000\u0000\u0150"+
|
||||||
|
"\u0151\u0005n\u0000\u0000\u0151\u0152\u0005t\u0000\u0000\u0152\u0153\u0005"+
|
||||||
|
"i\u0000\u0000\u0153\u0154\u0005n\u0000\u0000\u0154\u0155\u0005u\u0000"+
|
||||||
|
"\u0000\u0155\u0156\u0005e\u0000\u0000\u0156\u0016\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0157\u0158\u0005d\u0000\u0000\u0158\u0159\u0005e\u0000\u0000\u0159\u015a"+
|
||||||
|
"\u0005f\u0000\u0000\u015a\u015b\u0005a\u0000\u0000\u015b\u015c\u0005u"+
|
||||||
|
"\u0000\u0000\u015c\u015d\u0005l\u0000\u0000\u015d\u015e\u0005t\u0000\u0000"+
|
||||||
|
"\u015e\u0018\u0001\u0000\u0000\u0000\u015f\u0160\u0005d\u0000\u0000\u0160"+
|
||||||
|
"\u0161\u0005o\u0000\u0000\u0161\u001a\u0001\u0000\u0000\u0000\u0162\u0163"+
|
||||||
|
"\u0005d\u0000\u0000\u0163\u0164\u0005o\u0000\u0000\u0164\u0165\u0005u"+
|
||||||
|
"\u0000\u0000\u0165\u0166\u0005b\u0000\u0000\u0166\u0167\u0005l\u0000\u0000"+
|
||||||
|
"\u0167\u0168\u0005e\u0000\u0000\u0168\u001c\u0001\u0000\u0000\u0000\u0169"+
|
||||||
|
"\u016a\u0005e\u0000\u0000\u016a\u016b\u0005l\u0000\u0000\u016b\u016c\u0005"+
|
||||||
|
"s\u0000\u0000\u016c\u016d\u0005e\u0000\u0000\u016d\u001e\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u016e\u016f\u0005e\u0000\u0000\u016f\u0170\u0005n\u0000\u0000\u0170"+
|
||||||
|
"\u0171\u0005u\u0000\u0000\u0171\u0172\u0005m\u0000\u0000\u0172 \u0001"+
|
||||||
|
"\u0000\u0000\u0000\u0173\u0174\u0005e\u0000\u0000\u0174\u0175\u0005x\u0000"+
|
||||||
|
"\u0000\u0175\u0176\u0005t\u0000\u0000\u0176\u0177\u0005e\u0000\u0000\u0177"+
|
||||||
|
"\u0178\u0005n\u0000\u0000\u0178\u0179\u0005d\u0000\u0000\u0179\u017a\u0005"+
|
||||||
|
"s\u0000\u0000\u017a\"\u0001\u0000\u0000\u0000\u017b\u017c\u0005f\u0000"+
|
||||||
|
"\u0000\u017c\u017d\u0005i\u0000\u0000\u017d\u017e\u0005n\u0000\u0000\u017e"+
|
||||||
|
"\u017f\u0005a\u0000\u0000\u017f\u0180\u0005l\u0000\u0000\u0180$\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u0181\u0182\u0005f\u0000\u0000\u0182\u0183\u0005i\u0000"+
|
||||||
|
"\u0000\u0183\u0184\u0005n\u0000\u0000\u0184\u0185\u0005a\u0000\u0000\u0185"+
|
||||||
|
"\u0186\u0005l\u0000\u0000\u0186\u0187\u0005l\u0000\u0000\u0187\u0188\u0005"+
|
||||||
|
"y\u0000\u0000\u0188&\u0001\u0000\u0000\u0000\u0189\u018a\u0005f\u0000"+
|
||||||
|
"\u0000\u018a\u018b\u0005l\u0000\u0000\u018b\u018c\u0005o\u0000\u0000\u018c"+
|
||||||
|
"\u018d\u0005a\u0000\u0000\u018d\u018e\u0005t\u0000\u0000\u018e(\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u018f\u0190\u0005f\u0000\u0000\u0190\u0191\u0005o\u0000"+
|
||||||
|
"\u0000\u0191\u0192\u0005r\u0000\u0000\u0192*\u0001\u0000\u0000\u0000\u0193"+
|
||||||
|
"\u0194\u0005i\u0000\u0000\u0194\u0195\u0005f\u0000\u0000\u0195,\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u0196\u0197\u0005g\u0000\u0000\u0197\u0198\u0005o\u0000"+
|
||||||
|
"\u0000\u0198\u0199\u0005t\u0000\u0000\u0199\u019a\u0005o\u0000\u0000\u019a"+
|
||||||
|
".\u0001\u0000\u0000\u0000\u019b\u019c\u0005i\u0000\u0000\u019c\u019d\u0005"+
|
||||||
|
"m\u0000\u0000\u019d\u019e\u0005p\u0000\u0000\u019e\u019f\u0005l\u0000"+
|
||||||
|
"\u0000\u019f\u01a0\u0005e\u0000\u0000\u01a0\u01a1\u0005m\u0000\u0000\u01a1"+
|
||||||
|
"\u01a2\u0005e\u0000\u0000\u01a2\u01a3\u0005n\u0000\u0000\u01a3\u01a4\u0005"+
|
||||||
|
"t\u0000\u0000\u01a4\u01a5\u0005s\u0000\u0000\u01a50\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u01a6\u01a7\u0005i\u0000\u0000\u01a7\u01a8\u0005m\u0000\u0000\u01a8"+
|
||||||
|
"\u01a9\u0005p\u0000\u0000\u01a9\u01aa\u0005o\u0000\u0000\u01aa\u01ab\u0005"+
|
||||||
|
"r\u0000\u0000\u01ab\u01ac\u0005t\u0000\u0000\u01ac2\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u01ad\u01ae\u0005i\u0000\u0000\u01ae\u01af\u0005n\u0000\u0000\u01af"+
|
||||||
|
"\u01b0\u0005s\u0000\u0000\u01b0\u01b1\u0005t\u0000\u0000\u01b1\u01b2\u0005"+
|
||||||
|
"a\u0000\u0000\u01b2\u01b3\u0005n\u0000\u0000\u01b3\u01b4\u0005c\u0000"+
|
||||||
|
"\u0000\u01b4\u01b5\u0005e\u0000\u0000\u01b5\u01b6\u0005o\u0000\u0000\u01b6"+
|
||||||
|
"\u01b7\u0005f\u0000\u0000\u01b74\u0001\u0000\u0000\u0000\u01b8\u01b9\u0005"+
|
||||||
|
"i\u0000\u0000\u01b9\u01ba\u0005n\u0000\u0000\u01ba\u01bb\u0005t\u0000"+
|
||||||
|
"\u0000\u01bb6\u0001\u0000\u0000\u0000\u01bc\u01bd\u0005i\u0000\u0000\u01bd"+
|
||||||
|
"\u01be\u0005n\u0000\u0000\u01be\u01bf\u0005t\u0000\u0000\u01bf\u01c0\u0005"+
|
||||||
|
"e\u0000\u0000\u01c0\u01c1\u0005r\u0000\u0000\u01c1\u01c2\u0005f\u0000"+
|
||||||
|
"\u0000\u01c2\u01c3\u0005a\u0000\u0000\u01c3\u01c4\u0005c\u0000\u0000\u01c4"+
|
||||||
|
"\u01c5\u0005e\u0000\u0000\u01c58\u0001\u0000\u0000\u0000\u01c6\u01c7\u0005"+
|
||||||
|
"l\u0000\u0000\u01c7\u01c8\u0005o\u0000\u0000\u01c8\u01c9\u0005n\u0000"+
|
||||||
|
"\u0000\u01c9\u01ca\u0005g\u0000\u0000\u01ca:\u0001\u0000\u0000\u0000\u01cb"+
|
||||||
|
"\u01cc\u0005n\u0000\u0000\u01cc\u01cd\u0005a\u0000\u0000\u01cd\u01ce\u0005"+
|
||||||
|
"t\u0000\u0000\u01ce\u01cf\u0005i\u0000\u0000\u01cf\u01d0\u0005v\u0000"+
|
||||||
|
"\u0000\u01d0\u01d1\u0005e\u0000\u0000\u01d1<\u0001\u0000\u0000\u0000\u01d2"+
|
||||||
|
"\u01d3\u0005n\u0000\u0000\u01d3\u01d4\u0005e\u0000\u0000\u01d4\u01d5\u0005"+
|
||||||
|
"w\u0000\u0000\u01d5>\u0001\u0000\u0000\u0000\u01d6\u01d7\u0005p\u0000"+
|
||||||
|
"\u0000\u01d7\u01d8\u0005a\u0000\u0000\u01d8\u01d9\u0005c\u0000\u0000\u01d9"+
|
||||||
|
"\u01da\u0005k\u0000\u0000\u01da\u01db\u0005a\u0000\u0000\u01db\u01dc\u0005"+
|
||||||
|
"g\u0000\u0000\u01dc\u01dd\u0005e\u0000\u0000\u01dd@\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u01de\u01df\u0005p\u0000\u0000\u01df\u01e0\u0005r\u0000\u0000\u01e0"+
|
||||||
|
"\u01e1\u0005i\u0000\u0000\u01e1\u01e2\u0005v\u0000\u0000\u01e2\u01e3\u0005"+
|
||||||
|
"a\u0000\u0000\u01e3\u01e4\u0005t\u0000\u0000\u01e4\u01e5\u0005e\u0000"+
|
||||||
|
"\u0000\u01e5B\u0001\u0000\u0000\u0000\u01e6\u01e7\u0005p\u0000\u0000\u01e7"+
|
||||||
|
"\u01e8\u0005r\u0000\u0000\u01e8\u01e9\u0005o\u0000\u0000\u01e9\u01ea\u0005"+
|
||||||
|
"t\u0000\u0000\u01ea\u01eb\u0005e\u0000\u0000\u01eb\u01ec\u0005c\u0000"+
|
||||||
|
"\u0000\u01ec\u01ed\u0005t\u0000\u0000\u01ed\u01ee\u0005e\u0000\u0000\u01ee"+
|
||||||
|
"\u01ef\u0005d\u0000\u0000\u01efD\u0001\u0000\u0000\u0000\u01f0\u01f1\u0005"+
|
||||||
|
"p\u0000\u0000\u01f1\u01f2\u0005u\u0000\u0000\u01f2\u01f3\u0005b\u0000"+
|
||||||
|
"\u0000\u01f3\u01f4\u0005l\u0000\u0000\u01f4\u01f5\u0005i\u0000\u0000\u01f5"+
|
||||||
|
"\u01f6\u0005c\u0000\u0000\u01f6F\u0001\u0000\u0000\u0000\u01f7\u01f8\u0005"+
|
||||||
|
"r\u0000\u0000\u01f8\u01f9\u0005e\u0000\u0000\u01f9\u01fa\u0005t\u0000"+
|
||||||
|
"\u0000\u01fa\u01fb\u0005u\u0000\u0000\u01fb\u01fc\u0005r\u0000\u0000\u01fc"+
|
||||||
|
"\u01fd\u0005n\u0000\u0000\u01fdH\u0001\u0000\u0000\u0000\u01fe\u01ff\u0005"+
|
||||||
|
"s\u0000\u0000\u01ff\u0200\u0005h\u0000\u0000\u0200\u0201\u0005o\u0000"+
|
||||||
|
"\u0000\u0201\u0202\u0005r\u0000\u0000\u0202\u0203\u0005t\u0000\u0000\u0203"+
|
||||||
|
"J\u0001\u0000\u0000\u0000\u0204\u0205\u0005s\u0000\u0000\u0205\u0206\u0005"+
|
||||||
|
"t\u0000\u0000\u0206\u0207\u0005a\u0000\u0000\u0207\u0208\u0005t\u0000"+
|
||||||
|
"\u0000\u0208\u0209\u0005i\u0000\u0000\u0209\u020a\u0005c\u0000\u0000\u020a"+
|
||||||
|
"L\u0001\u0000\u0000\u0000\u020b\u020c\u0005s\u0000\u0000\u020c\u020d\u0005"+
|
||||||
|
"t\u0000\u0000\u020d\u020e\u0005r\u0000\u0000\u020e\u020f\u0005i\u0000"+
|
||||||
|
"\u0000\u020f\u0210\u0005c\u0000\u0000\u0210\u0211\u0005t\u0000\u0000\u0211"+
|
||||||
|
"\u0212\u0005f\u0000\u0000\u0212\u0213\u0005p\u0000\u0000\u0213N\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u0214\u0215\u0005s\u0000\u0000\u0215\u0216\u0005u\u0000"+
|
||||||
|
"\u0000\u0216\u0217\u0005p\u0000\u0000\u0217\u0218\u0005e\u0000\u0000\u0218"+
|
||||||
|
"\u0219\u0005r\u0000\u0000\u0219P\u0001\u0000\u0000\u0000\u021a\u021b\u0005"+
|
||||||
|
"s\u0000\u0000\u021b\u021c\u0005w\u0000\u0000\u021c\u021d\u0005i\u0000"+
|
||||||
|
"\u0000\u021d\u021e\u0005t\u0000\u0000\u021e\u021f\u0005c\u0000\u0000\u021f"+
|
||||||
|
"\u0220\u0005h\u0000\u0000\u0220R\u0001\u0000\u0000\u0000\u0221\u0222\u0005"+
|
||||||
|
"s\u0000\u0000\u0222\u0223\u0005y\u0000\u0000\u0223\u0224\u0005n\u0000"+
|
||||||
|
"\u0000\u0224\u0225\u0005c\u0000\u0000\u0225\u0226\u0005h\u0000\u0000\u0226"+
|
||||||
|
"\u0227\u0005r\u0000\u0000\u0227\u0228\u0005o\u0000\u0000\u0228\u0229\u0005"+
|
||||||
|
"n\u0000\u0000\u0229\u022a\u0005i\u0000\u0000\u022a\u022b\u0005z\u0000"+
|
||||||
|
"\u0000\u022b\u022c\u0005e\u0000\u0000\u022c\u022d\u0005d\u0000\u0000\u022d"+
|
||||||
|
"T\u0001\u0000\u0000\u0000\u022e\u022f\u0005t\u0000\u0000\u022f\u0230\u0005"+
|
||||||
|
"h\u0000\u0000\u0230\u0231\u0005i\u0000\u0000\u0231\u0232\u0005s\u0000"+
|
||||||
|
"\u0000\u0232V\u0001\u0000\u0000\u0000\u0233\u0234\u0005t\u0000\u0000\u0234"+
|
||||||
|
"\u0235\u0005h\u0000\u0000\u0235\u0236\u0005r\u0000\u0000\u0236\u0237\u0005"+
|
||||||
|
"o\u0000\u0000\u0237\u0238\u0005w\u0000\u0000\u0238X\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0239\u023a\u0005t\u0000\u0000\u023a\u023b\u0005h\u0000\u0000\u023b"+
|
||||||
|
"\u023c\u0005r\u0000\u0000\u023c\u023d\u0005o\u0000\u0000\u023d\u023e\u0005"+
|
||||||
|
"w\u0000\u0000\u023e\u023f\u0005s\u0000\u0000\u023fZ\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0240\u0241\u0005t\u0000\u0000\u0241\u0242\u0005r\u0000\u0000\u0242"+
|
||||||
|
"\u0243\u0005a\u0000\u0000\u0243\u0244\u0005n\u0000\u0000\u0244\u0245\u0005"+
|
||||||
|
"s\u0000\u0000\u0245\u0246\u0005i\u0000\u0000\u0246\u0247\u0005e\u0000"+
|
||||||
|
"\u0000\u0247\u0248\u0005n\u0000\u0000\u0248\u0249\u0005t\u0000\u0000\u0249"+
|
||||||
|
"\\\u0001\u0000\u0000\u0000\u024a\u024b\u0005t\u0000\u0000\u024b\u024c"+
|
||||||
|
"\u0005r\u0000\u0000\u024c\u024d\u0005y\u0000\u0000\u024d^\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u024e\u024f\u0005v\u0000\u0000\u024f\u0250\u0005o\u0000\u0000"+
|
||||||
|
"\u0250\u0251\u0005i\u0000\u0000\u0251\u0252\u0005d\u0000\u0000\u0252`"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0253\u0254\u0005v\u0000\u0000\u0254\u0255\u0005"+
|
||||||
|
"o\u0000\u0000\u0255\u0256\u0005l\u0000\u0000\u0256\u0257\u0005a\u0000"+
|
||||||
|
"\u0000\u0257\u0258\u0005t\u0000\u0000\u0258\u0259\u0005i\u0000\u0000\u0259"+
|
||||||
|
"\u025a\u0005l\u0000\u0000\u025a\u025b\u0005e\u0000\u0000\u025bb\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u025c\u025d\u0005w\u0000\u0000\u025d\u025e\u0005h\u0000"+
|
||||||
|
"\u0000\u025e\u025f\u0005i\u0000\u0000\u025f\u0260\u0005l\u0000\u0000\u0260"+
|
||||||
|
"\u0261\u0005e\u0000\u0000\u0261d\u0001\u0000\u0000\u0000\u0262\u0263\u0005"+
|
||||||
|
"m\u0000\u0000\u0263\u0264\u0005o\u0000\u0000\u0264\u0265\u0005d\u0000"+
|
||||||
|
"\u0000\u0265\u0266\u0005u\u0000\u0000\u0266\u0267\u0005l\u0000\u0000\u0267"+
|
||||||
|
"\u0268\u0005e\u0000\u0000\u0268f\u0001\u0000\u0000\u0000\u0269\u026a\u0005"+
|
||||||
|
"o\u0000\u0000\u026a\u026b\u0005p\u0000\u0000\u026b\u026c\u0005e\u0000"+
|
||||||
|
"\u0000\u026c\u026d\u0005n\u0000\u0000\u026dh\u0001\u0000\u0000\u0000\u026e"+
|
||||||
|
"\u026f\u0005r\u0000\u0000\u026f\u0270\u0005e\u0000\u0000\u0270\u0271\u0005"+
|
||||||
|
"q\u0000\u0000\u0271\u0272\u0005u\u0000\u0000\u0272\u0273\u0005i\u0000"+
|
||||||
|
"\u0000\u0273\u0274\u0005r\u0000\u0000\u0274\u0275\u0005e\u0000\u0000\u0275"+
|
||||||
|
"\u0276\u0005s\u0000\u0000\u0276j\u0001\u0000\u0000\u0000\u0277\u0278\u0005"+
|
||||||
|
"e\u0000\u0000\u0278\u0279\u0005x\u0000\u0000\u0279\u027a\u0005p\u0000"+
|
||||||
|
"\u0000\u027a\u027b\u0005o\u0000\u0000\u027b\u027c\u0005r\u0000\u0000\u027c"+
|
||||||
|
"\u027d\u0005t\u0000\u0000\u027d\u027e\u0005s\u0000\u0000\u027el\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u027f\u0280\u0005o\u0000\u0000\u0280\u0281\u0005p\u0000"+
|
||||||
|
"\u0000\u0281\u0282\u0005e\u0000\u0000\u0282\u0283\u0005n\u0000\u0000\u0283"+
|
||||||
|
"\u0284\u0005s\u0000\u0000\u0284n\u0001\u0000\u0000\u0000\u0285\u0286\u0005"+
|
||||||
|
"t\u0000\u0000\u0286\u0287\u0005o\u0000\u0000\u0287p\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0288\u0289\u0005u\u0000\u0000\u0289\u028a\u0005s\u0000\u0000\u028a"+
|
||||||
|
"\u028b\u0005e\u0000\u0000\u028b\u028c\u0005s\u0000\u0000\u028cr\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u028d\u028e\u0005p\u0000\u0000\u028e\u028f\u0005r\u0000"+
|
||||||
|
"\u0000\u028f\u0290\u0005o\u0000\u0000\u0290\u0291\u0005v\u0000\u0000\u0291"+
|
||||||
|
"\u0292\u0005i\u0000\u0000\u0292\u0293\u0005d\u0000\u0000\u0293\u0294\u0005"+
|
||||||
|
"e\u0000\u0000\u0294\u0295\u0005s\u0000\u0000\u0295t\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0296\u0297\u0005w\u0000\u0000\u0297\u0298\u0005i\u0000\u0000\u0298"+
|
||||||
|
"\u0299\u0005t\u0000\u0000\u0299\u029a\u0005h\u0000\u0000\u029av\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u029b\u029c\u0005t\u0000\u0000\u029c\u029d\u0005r\u0000"+
|
||||||
|
"\u0000\u029d\u029e\u0005a\u0000\u0000\u029e\u029f\u0005n\u0000\u0000\u029f"+
|
||||||
|
"\u02a0\u0005s\u0000\u0000\u02a0\u02a1\u0005i\u0000\u0000\u02a1\u02a2\u0005"+
|
||||||
|
"t\u0000\u0000\u02a2\u02a3\u0005i\u0000\u0000\u02a3\u02a4\u0005v\u0000"+
|
||||||
|
"\u0000\u02a4\u02a5\u0005e\u0000\u0000\u02a5x\u0001\u0000\u0000\u0000\u02a6"+
|
||||||
|
"\u02a7\u0005v\u0000\u0000\u02a7\u02a8\u0005a\u0000\u0000\u02a8\u02a9\u0005"+
|
||||||
|
"r\u0000\u0000\u02a9z\u0001\u0000\u0000\u0000\u02aa\u02ab\u0005y\u0000"+
|
||||||
|
"\u0000\u02ab\u02ac\u0005i\u0000\u0000\u02ac\u02ad\u0005e\u0000\u0000\u02ad"+
|
||||||
|
"\u02ae\u0005l\u0000\u0000\u02ae\u02af\u0005d\u0000\u0000\u02af|\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u02b0\u02b1\u0005r\u0000\u0000\u02b1\u02b2\u0005e\u0000"+
|
||||||
|
"\u0000\u02b2\u02b3\u0005c\u0000\u0000\u02b3\u02b4\u0005o\u0000\u0000\u02b4"+
|
||||||
|
"\u02b5\u0005r\u0000\u0000\u02b5\u02b6\u0005d\u0000\u0000\u02b6~\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u02b7\u02b8\u0005s\u0000\u0000\u02b8\u02b9\u0005e\u0000"+
|
||||||
|
"\u0000\u02b9\u02ba\u0005a\u0000\u0000\u02ba\u02bb\u0005l\u0000\u0000\u02bb"+
|
||||||
|
"\u02bc\u0005e\u0000\u0000\u02bc\u02bd\u0005d\u0000\u0000\u02bd\u0080\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u02be\u02bf\u0005p\u0000\u0000\u02bf\u02c0\u0005e\u0000"+
|
||||||
|
"\u0000\u02c0\u02c1\u0005r\u0000\u0000\u02c1\u02c2\u0005m\u0000\u0000\u02c2"+
|
||||||
|
"\u02c3\u0005i\u0000\u0000\u02c3\u02c4\u0005t\u0000\u0000\u02c4\u02c5\u0005"+
|
||||||
|
"s\u0000\u0000\u02c5\u0082\u0001\u0000\u0000\u0000\u02c6\u02c7\u0005n\u0000"+
|
||||||
|
"\u0000\u02c7\u02c8\u0005o\u0000\u0000\u02c8\u02c9\u0005n\u0000\u0000\u02c9"+
|
||||||
|
"\u02ca\u0005-\u0000\u0000\u02ca\u02cb\u0005s\u0000\u0000\u02cb\u02cc\u0005"+
|
||||||
|
"e\u0000\u0000\u02cc\u02cd\u0005a\u0000\u0000\u02cd\u02ce\u0005l\u0000"+
|
||||||
|
"\u0000\u02ce\u02cf\u0005e\u0000\u0000\u02cf\u02d0\u0005d\u0000\u0000\u02d0"+
|
||||||
|
"\u0084\u0001\u0000\u0000\u0000\u02d1\u02df\u00050\u0000\u0000\u02d2\u02dc"+
|
||||||
|
"\u0007\u0000\u0000\u0000\u02d3\u02d5\u0003\u0109\u0084\u0000\u02d4\u02d3"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u02d4\u02d5\u0001\u0000\u0000\u0000\u02d5\u02dd"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u02d6\u02d8\u0005_\u0000\u0000\u02d7\u02d6\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u02d8\u02d9\u0001\u0000\u0000\u0000\u02d9\u02d7\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u02d9\u02da\u0001\u0000\u0000\u0000\u02da\u02db\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u02db\u02dd\u0003\u0109\u0084\u0000\u02dc\u02d4\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u02dc\u02d7\u0001\u0000\u0000\u0000\u02dd\u02df\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u02de\u02d1\u0001\u0000\u0000\u0000\u02de\u02d2\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u02df\u02e1\u0001\u0000\u0000\u0000\u02e0\u02e2\u0007"+
|
||||||
|
"\u0001\u0000\u0000\u02e1\u02e0\u0001\u0000\u0000\u0000\u02e1\u02e2\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u02e2\u0086\u0001\u0000\u0000\u0000\u02e3\u02e4\u0005"+
|
||||||
|
"0\u0000\u0000\u02e4\u02e5\u0007\u0002\u0000\u0000\u02e5\u02ed\u0007\u0003"+
|
||||||
|
"\u0000\u0000\u02e6\u02e8\u0007\u0004\u0000\u0000\u02e7\u02e6\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u02e8\u02eb\u0001\u0000\u0000\u0000\u02e9\u02e7\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u02e9\u02ea\u0001\u0000\u0000\u0000\u02ea\u02ec\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u02eb\u02e9\u0001\u0000\u0000\u0000\u02ec\u02ee\u0007\u0003"+
|
||||||
|
"\u0000\u0000\u02ed\u02e9\u0001\u0000\u0000\u0000\u02ed\u02ee\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u02ee\u02f0\u0001\u0000\u0000\u0000\u02ef\u02f1\u0007\u0001"+
|
||||||
|
"\u0000\u0000\u02f0\u02ef\u0001\u0000\u0000\u0000\u02f0\u02f1\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u02f1\u0088\u0001\u0000\u0000\u0000\u02f2\u02f6\u00050\u0000"+
|
||||||
|
"\u0000\u02f3\u02f5\u0005_\u0000\u0000\u02f4\u02f3\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u02f5\u02f8\u0001\u0000\u0000\u0000\u02f6\u02f4\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u02f6\u02f7\u0001\u0000\u0000\u0000\u02f7\u02f9\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u02f8\u02f6\u0001\u0000\u0000\u0000\u02f9\u0301\u0007\u0005\u0000\u0000"+
|
||||||
|
"\u02fa\u02fc\u0007\u0006\u0000\u0000\u02fb\u02fa\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u02fc\u02ff\u0001\u0000\u0000\u0000\u02fd\u02fb\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u02fd\u02fe\u0001\u0000\u0000\u0000\u02fe\u0300\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u02ff\u02fd\u0001\u0000\u0000\u0000\u0300\u0302\u0007\u0005\u0000\u0000"+
|
||||||
|
"\u0301\u02fd\u0001\u0000\u0000\u0000\u0301\u0302\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0302\u0304\u0001\u0000\u0000\u0000\u0303\u0305\u0007\u0001\u0000\u0000"+
|
||||||
|
"\u0304\u0303\u0001\u0000\u0000\u0000\u0304\u0305\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0305\u008a\u0001\u0000\u0000\u0000\u0306\u0307\u00050\u0000\u0000\u0307"+
|
||||||
|
"\u0308\u0007\u0007\u0000\u0000\u0308\u0310\u0007\b\u0000\u0000\u0309\u030b"+
|
||||||
|
"\u0007\t\u0000\u0000\u030a\u0309\u0001\u0000\u0000\u0000\u030b\u030e\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u030c\u030a\u0001\u0000\u0000\u0000\u030c\u030d\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u030d\u030f\u0001\u0000\u0000\u0000\u030e\u030c\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u030f\u0311\u0007\b\u0000\u0000\u0310\u030c\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0310\u0311\u0001\u0000\u0000\u0000\u0311\u0313\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0312\u0314\u0007\u0001\u0000\u0000\u0313\u0312\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0313\u0314\u0001\u0000\u0000\u0000\u0314\u008c\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0315\u0316\u0003\u0109\u0084\u0000\u0316\u0318\u0005.\u0000"+
|
||||||
|
"\u0000\u0317\u0319\u0003\u0109\u0084\u0000\u0318\u0317\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0318\u0319\u0001\u0000\u0000\u0000\u0319\u031d\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u031a\u031b\u0005.\u0000\u0000\u031b\u031d\u0003\u0109\u0084\u0000"+
|
||||||
|
"\u031c\u0315\u0001\u0000\u0000\u0000\u031c\u031a\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u031d\u031f\u0001\u0000\u0000\u0000\u031e\u0320\u0003\u0101\u0080\u0000"+
|
||||||
|
"\u031f\u031e\u0001\u0000\u0000\u0000\u031f\u0320\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0320\u0322\u0001\u0000\u0000\u0000\u0321\u0323\u0007\n\u0000\u0000\u0322"+
|
||||||
|
"\u0321\u0001\u0000\u0000\u0000\u0322\u0323\u0001\u0000\u0000\u0000\u0323"+
|
||||||
|
"\u032d\u0001\u0000\u0000\u0000\u0324\u032a\u0003\u0109\u0084\u0000\u0325"+
|
||||||
|
"\u0327\u0003\u0101\u0080\u0000\u0326\u0328\u0007\n\u0000\u0000\u0327\u0326"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0327\u0328\u0001\u0000\u0000\u0000\u0328\u032b"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0329\u032b\u0007\n\u0000\u0000\u032a\u0325\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u032a\u0329\u0001\u0000\u0000\u0000\u032b\u032d\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u032c\u031c\u0001\u0000\u0000\u0000\u032c\u0324\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u032d\u008e\u0001\u0000\u0000\u0000\u032e\u032f\u0005"+
|
||||||
|
"0\u0000\u0000\u032f\u0339\u0007\u0002\u0000\u0000\u0330\u0332\u0003\u0105"+
|
||||||
|
"\u0082\u0000\u0331\u0333\u0005.\u0000\u0000\u0332\u0331\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0332\u0333\u0001\u0000\u0000\u0000\u0333\u033a\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0334\u0336\u0003\u0105\u0082\u0000\u0335\u0334\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0335\u0336\u0001\u0000\u0000\u0000\u0336\u0337\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0337\u0338\u0005.\u0000\u0000\u0338\u033a\u0003\u0105\u0082\u0000"+
|
||||||
|
"\u0339\u0330\u0001\u0000\u0000\u0000\u0339\u0335\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u033a\u033b\u0001\u0000\u0000\u0000\u033b\u033d\u0007\u000b\u0000\u0000"+
|
||||||
|
"\u033c\u033e\u0007\f\u0000\u0000\u033d\u033c\u0001\u0000\u0000\u0000\u033d"+
|
||||||
|
"\u033e\u0001\u0000\u0000\u0000\u033e\u033f\u0001\u0000\u0000\u0000\u033f"+
|
||||||
|
"\u0341\u0003\u0109\u0084\u0000\u0340\u0342\u0007\n\u0000\u0000\u0341\u0340"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0341\u0342\u0001\u0000\u0000\u0000\u0342\u0090"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0343\u0344\u0005t\u0000\u0000\u0344\u0345\u0005"+
|
||||||
|
"r\u0000\u0000\u0345\u0346\u0005u\u0000\u0000\u0346\u034d\u0005e\u0000"+
|
||||||
|
"\u0000\u0347\u0348\u0005f\u0000\u0000\u0348\u0349\u0005a\u0000\u0000\u0349"+
|
||||||
|
"\u034a\u0005l\u0000\u0000\u034a\u034b\u0005s\u0000\u0000\u034b\u034d\u0005"+
|
||||||
|
"e\u0000\u0000\u034c\u0343\u0001\u0000\u0000\u0000\u034c\u0347\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u034d\u0092\u0001\u0000\u0000\u0000\u034e\u0351\u0005\'\u0000"+
|
||||||
|
"\u0000\u034f\u0352\b\r\u0000\u0000\u0350\u0352\u0003\u0103\u0081\u0000"+
|
||||||
|
"\u0351\u034f\u0001\u0000\u0000\u0000\u0351\u0350\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0352\u0353\u0001\u0000\u0000\u0000\u0353\u0354\u0005\'\u0000\u0000\u0354"+
|
||||||
|
"\u0094\u0001\u0000\u0000\u0000\u0355\u035a\u0005\"\u0000\u0000\u0356\u0359"+
|
||||||
|
"\b\u000e\u0000\u0000\u0357\u0359\u0003\u0103\u0081\u0000\u0358\u0356\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u0358\u0357\u0001\u0000\u0000\u0000\u0359\u035c\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u035a\u0358\u0001\u0000\u0000\u0000\u035a\u035b\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u035b\u035d\u0001\u0000\u0000\u0000\u035c\u035a\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u035d\u035e\u0005\"\u0000\u0000\u035e\u0096\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u035f\u0360\u0005\"\u0000\u0000\u0360\u0361\u0005\"\u0000"+
|
||||||
|
"\u0000\u0361\u0362\u0005\"\u0000\u0000\u0362\u0366\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0363\u0365\u0007\u000f\u0000\u0000\u0364\u0363\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0365\u0368\u0001\u0000\u0000\u0000\u0366\u0364\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0366\u0367\u0001\u0000\u0000\u0000\u0367\u0369\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0368\u0366\u0001\u0000\u0000\u0000\u0369\u036e\u0007\u0010\u0000\u0000"+
|
||||||
|
"\u036a\u036d\t\u0000\u0000\u0000\u036b\u036d\u0003\u0103\u0081\u0000\u036c"+
|
||||||
|
"\u036a\u0001\u0000\u0000\u0000\u036c\u036b\u0001\u0000\u0000\u0000\u036d"+
|
||||||
|
"\u0370\u0001\u0000\u0000\u0000\u036e\u036f\u0001\u0000\u0000\u0000\u036e"+
|
||||||
|
"\u036c\u0001\u0000\u0000\u0000\u036f\u0371\u0001\u0000\u0000\u0000\u0370"+
|
||||||
|
"\u036e\u0001\u0000\u0000\u0000\u0371\u0372\u0005\"\u0000\u0000\u0372\u0373"+
|
||||||
|
"\u0005\"\u0000\u0000\u0373\u0374\u0005\"\u0000\u0000\u0374\u0098\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u0375\u0376\u0005n\u0000\u0000\u0376\u0377\u0005u\u0000"+
|
||||||
|
"\u0000\u0377\u0378\u0005l\u0000\u0000\u0378\u0379\u0005l\u0000\u0000\u0379"+
|
||||||
|
"\u009a\u0001\u0000\u0000\u0000\u037a\u037b\u0005(\u0000\u0000\u037b\u009c"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u037c\u037d\u0005)\u0000\u0000\u037d\u009e\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u037e\u037f\u0005{\u0000\u0000\u037f\u00a0\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0380\u0381\u0005}\u0000\u0000\u0381\u00a2\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0382\u0383\u0005[\u0000\u0000\u0383\u00a4\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0384\u0385\u0005]\u0000\u0000\u0385\u00a6\u0001\u0000\u0000\u0000\u0386"+
|
||||||
|
"\u0387\u0005;\u0000\u0000\u0387\u00a8\u0001\u0000\u0000\u0000\u0388\u0389"+
|
||||||
|
"\u0005,\u0000\u0000\u0389\u00aa\u0001\u0000\u0000\u0000\u038a\u038b\u0005"+
|
||||||
|
".\u0000\u0000\u038b\u00ac\u0001\u0000\u0000\u0000\u038c\u038d\u0005=\u0000"+
|
||||||
|
"\u0000\u038d\u00ae\u0001\u0000\u0000\u0000\u038e\u038f\u0005>\u0000\u0000"+
|
||||||
|
"\u038f\u00b0\u0001\u0000\u0000\u0000\u0390\u0391\u0005<\u0000\u0000\u0391"+
|
||||||
|
"\u00b2\u0001\u0000\u0000\u0000\u0392\u0393\u0005!\u0000\u0000\u0393\u00b4"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u0394\u0395\u0005~\u0000\u0000\u0395\u00b6\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u0396\u0397\u0005?\u0000\u0000\u0397\u00b8\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0398\u0399\u0005:\u0000\u0000\u0399\u00ba\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u039a\u039b\u0005=\u0000\u0000\u039b\u039c\u0005=\u0000\u0000\u039c"+
|
||||||
|
"\u00bc\u0001\u0000\u0000\u0000\u039d\u039e\u0005<\u0000\u0000\u039e\u039f"+
|
||||||
|
"\u0005=\u0000\u0000\u039f\u00be\u0001\u0000\u0000\u0000\u03a0\u03a1\u0005"+
|
||||||
|
">\u0000\u0000\u03a1\u03a2\u0005=\u0000\u0000\u03a2\u00c0\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u03a3\u03a4\u0005!\u0000\u0000\u03a4\u03a5\u0005=\u0000\u0000\u03a5"+
|
||||||
|
"\u00c2\u0001\u0000\u0000\u0000\u03a6\u03a7\u0005&\u0000\u0000\u03a7\u03a8"+
|
||||||
|
"\u0005&\u0000\u0000\u03a8\u00c4\u0001\u0000\u0000\u0000\u03a9\u03aa\u0005"+
|
||||||
|
"|\u0000\u0000\u03aa\u03ab\u0005|\u0000\u0000\u03ab\u00c6\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u03ac\u03ad\u0005+\u0000\u0000\u03ad\u03ae\u0005+\u0000\u0000\u03ae"+
|
||||||
|
"\u00c8\u0001\u0000\u0000\u0000\u03af\u03b0\u0005-\u0000\u0000\u03b0\u03b1"+
|
||||||
|
"\u0005-\u0000\u0000\u03b1\u00ca\u0001\u0000\u0000\u0000\u03b2\u03b3\u0005"+
|
||||||
|
"+\u0000\u0000\u03b3\u00cc\u0001\u0000\u0000\u0000\u03b4\u03b5\u0005-\u0000"+
|
||||||
|
"\u0000\u03b5\u00ce\u0001\u0000\u0000\u0000\u03b6\u03b7\u0005*\u0000\u0000"+
|
||||||
|
"\u03b7\u00d0\u0001\u0000\u0000\u0000\u03b8\u03b9\u0005/\u0000\u0000\u03b9"+
|
||||||
|
"\u00d2\u0001\u0000\u0000\u0000\u03ba\u03bb\u0005&\u0000\u0000\u03bb\u00d4"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u03bc\u03bd\u0005|\u0000\u0000\u03bd\u00d6\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u03be\u03bf\u0005^\u0000\u0000\u03bf\u00d8\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u03c0\u03c1\u0005%\u0000\u0000\u03c1\u00da\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u03c2\u03c3\u0005+\u0000\u0000\u03c3\u03c4\u0005=\u0000\u0000\u03c4"+
|
||||||
|
"\u00dc\u0001\u0000\u0000\u0000\u03c5\u03c6\u0005-\u0000\u0000\u03c6\u03c7"+
|
||||||
|
"\u0005=\u0000\u0000\u03c7\u00de\u0001\u0000\u0000\u0000\u03c8\u03c9\u0005"+
|
||||||
|
"*\u0000\u0000\u03c9\u03ca\u0005=\u0000\u0000\u03ca\u00e0\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u03cb\u03cc\u0005/\u0000\u0000\u03cc\u03cd\u0005=\u0000\u0000\u03cd"+
|
||||||
|
"\u00e2\u0001\u0000\u0000\u0000\u03ce\u03cf\u0005&\u0000\u0000\u03cf\u03d0"+
|
||||||
|
"\u0005=\u0000\u0000\u03d0\u00e4\u0001\u0000\u0000\u0000\u03d1\u03d2\u0005"+
|
||||||
|
"|\u0000\u0000\u03d2\u03d3\u0005=\u0000\u0000\u03d3\u00e6\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u03d4\u03d5\u0005^\u0000\u0000\u03d5\u03d6\u0005=\u0000\u0000\u03d6"+
|
||||||
|
"\u00e8\u0001\u0000\u0000\u0000\u03d7\u03d8\u0005%\u0000\u0000\u03d8\u03d9"+
|
||||||
|
"\u0005=\u0000\u0000\u03d9\u00ea\u0001\u0000\u0000\u0000\u03da\u03db\u0005"+
|
||||||
|
"<\u0000\u0000\u03db\u03dc\u0005<\u0000\u0000\u03dc\u03dd\u0005=\u0000"+
|
||||||
|
"\u0000\u03dd\u00ec\u0001\u0000\u0000\u0000\u03de\u03df\u0005>\u0000\u0000"+
|
||||||
|
"\u03df\u03e0\u0005>\u0000\u0000\u03e0\u03e1\u0005=\u0000\u0000\u03e1\u00ee"+
|
||||||
|
"\u0001\u0000\u0000\u0000\u03e2\u03e3\u0005>\u0000\u0000\u03e3\u03e4\u0005"+
|
||||||
|
">\u0000\u0000\u03e4\u03e5\u0005>\u0000\u0000\u03e5\u03e6\u0005=\u0000"+
|
||||||
|
"\u0000\u03e6\u00f0\u0001\u0000\u0000\u0000\u03e7\u03e8\u0005-\u0000\u0000"+
|
||||||
|
"\u03e8\u03e9\u0005>\u0000\u0000\u03e9\u00f2\u0001\u0000\u0000\u0000\u03ea"+
|
||||||
|
"\u03eb\u0005:\u0000\u0000\u03eb\u03ec\u0005:\u0000\u0000\u03ec\u00f4\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u03ed\u03ee\u0005@\u0000\u0000\u03ee\u00f6\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u03ef\u03f0\u0005.\u0000\u0000\u03f0\u03f1\u0005.\u0000\u0000"+
|
||||||
|
"\u03f1\u03f2\u0005.\u0000\u0000\u03f2\u00f8\u0001\u0000\u0000\u0000\u03f3"+
|
||||||
|
"\u03f5\u0007\u0011\u0000\u0000\u03f4\u03f3\u0001\u0000\u0000\u0000\u03f5"+
|
||||||
|
"\u03f6\u0001\u0000\u0000\u0000\u03f6\u03f4\u0001\u0000\u0000\u0000\u03f6"+
|
||||||
|
"\u03f7\u0001\u0000\u0000\u0000\u03f7\u03f8\u0001\u0000\u0000\u0000\u03f8"+
|
||||||
|
"\u03f9\u0006|\u0000\u0000\u03f9\u00fa\u0001\u0000\u0000\u0000\u03fa\u03fb"+
|
||||||
|
"\u0005/\u0000\u0000\u03fb\u03fc\u0005*\u0000\u0000\u03fc\u0400\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u03fd\u03ff\t\u0000\u0000\u0000\u03fe\u03fd\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u03ff\u0402\u0001\u0000\u0000\u0000\u0400\u0401\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0400\u03fe\u0001\u0000\u0000\u0000\u0401\u0403\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0402\u0400\u0001\u0000\u0000\u0000\u0403\u0404\u0005*\u0000\u0000"+
|
||||||
|
"\u0404\u0405\u0005/\u0000\u0000\u0405\u0406\u0001\u0000\u0000\u0000\u0406"+
|
||||||
|
"\u0407\u0006}\u0000\u0000\u0407\u00fc\u0001\u0000\u0000\u0000\u0408\u0409"+
|
||||||
|
"\u0005/\u0000\u0000\u0409\u040a\u0005/\u0000\u0000\u040a\u040e\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u040b\u040d\b\u0010\u0000\u0000\u040c\u040b\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u040d\u0410\u0001\u0000\u0000\u0000\u040e\u040c\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u040e\u040f\u0001\u0000\u0000\u0000\u040f\u0411\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0410\u040e\u0001\u0000\u0000\u0000\u0411\u0412\u0006~\u0000\u0000"+
|
||||||
|
"\u0412\u00fe\u0001\u0000\u0000\u0000\u0413\u0417\u0003\u010d\u0086\u0000"+
|
||||||
|
"\u0414\u0416\u0003\u010b\u0085\u0000\u0415\u0414\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0416\u0419\u0001\u0000\u0000\u0000\u0417\u0415\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0417\u0418\u0001\u0000\u0000\u0000\u0418\u0100\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0419\u0417\u0001\u0000\u0000\u0000\u041a\u041c\u0007\u0012\u0000\u0000"+
|
||||||
|
"\u041b\u041d\u0007\f\u0000\u0000\u041c\u041b\u0001\u0000\u0000\u0000\u041c"+
|
||||||
|
"\u041d\u0001\u0000\u0000\u0000\u041d\u041e\u0001\u0000\u0000\u0000\u041e"+
|
||||||
|
"\u041f\u0003\u0109\u0084\u0000\u041f\u0102\u0001\u0000\u0000\u0000\u0420"+
|
||||||
|
"\u0421\u0005\\\u0000\u0000\u0421\u0436\u0007\u0013\u0000\u0000\u0422\u0427"+
|
||||||
|
"\u0005\\\u0000\u0000\u0423\u0425\u0007\u0014\u0000\u0000\u0424\u0423\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u0424\u0425\u0001\u0000\u0000\u0000\u0425\u0426\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u0426\u0428\u0007\u0005\u0000\u0000\u0427\u0424\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u0427\u0428\u0001\u0000\u0000\u0000\u0428\u0429\u0001"+
|
||||||
|
"\u0000\u0000\u0000\u0429\u0436\u0007\u0005\u0000\u0000\u042a\u042c\u0005"+
|
||||||
|
"\\\u0000\u0000\u042b\u042d\u0005u\u0000\u0000\u042c\u042b\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u042d\u042e\u0001\u0000\u0000\u0000\u042e\u042c\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u042e\u042f\u0001\u0000\u0000\u0000\u042f\u0430\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0430\u0431\u0003\u0107\u0083\u0000\u0431\u0432\u0003\u0107"+
|
||||||
|
"\u0083\u0000\u0432\u0433\u0003\u0107\u0083\u0000\u0433\u0434\u0003\u0107"+
|
||||||
|
"\u0083\u0000\u0434\u0436\u0001\u0000\u0000\u0000\u0435\u0420\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0435\u0422\u0001\u0000\u0000\u0000\u0435\u042a\u0001\u0000"+
|
||||||
|
"\u0000\u0000\u0436\u0104\u0001\u0000\u0000\u0000\u0437\u0440\u0003\u0107"+
|
||||||
|
"\u0083\u0000\u0438\u043b\u0003\u0107\u0083\u0000\u0439\u043b\u0005_\u0000"+
|
||||||
|
"\u0000\u043a\u0438\u0001\u0000\u0000\u0000\u043a\u0439\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u043b\u043e\u0001\u0000\u0000\u0000\u043c\u043a\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u043c\u043d\u0001\u0000\u0000\u0000\u043d\u043f\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u043e\u043c\u0001\u0000\u0000\u0000\u043f\u0441\u0003\u0107\u0083"+
|
||||||
|
"\u0000\u0440\u043c\u0001\u0000\u0000\u0000\u0440\u0441\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0441\u0106\u0001\u0000\u0000\u0000\u0442\u0443\u0007\u0003\u0000"+
|
||||||
|
"\u0000\u0443\u0108\u0001\u0000\u0000\u0000\u0444\u044c\u0007\u0015\u0000"+
|
||||||
|
"\u0000\u0445\u0447\u0007\u0016\u0000\u0000\u0446\u0445\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0447\u044a\u0001\u0000\u0000\u0000\u0448\u0446\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0448\u0449\u0001\u0000\u0000\u0000\u0449\u044b\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u044a\u0448\u0001\u0000\u0000\u0000\u044b\u044d\u0007\u0015\u0000"+
|
||||||
|
"\u0000\u044c\u0448\u0001\u0000\u0000\u0000\u044c\u044d\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u044d\u010a\u0001\u0000\u0000\u0000\u044e\u0451\u0003\u010d\u0086"+
|
||||||
|
"\u0000\u044f\u0451\u0007\u0015\u0000\u0000\u0450\u044e\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0450\u044f\u0001\u0000\u0000\u0000\u0451\u010c\u0001\u0000\u0000"+
|
||||||
|
"\u0000\u0452\u0457\u0007\u0017\u0000\u0000\u0453\u0457\b\u0018\u0000\u0000"+
|
||||||
|
"\u0454\u0455\u0007\u0019\u0000\u0000\u0455\u0457\u0007\u001a\u0000\u0000"+
|
||||||
|
"\u0456\u0452\u0001\u0000\u0000\u0000\u0456\u0453\u0001\u0000\u0000\u0000"+
|
||||||
|
"\u0456\u0454\u0001\u0000\u0000\u0000\u0457\u010e\u0001\u0000\u0000\u0000"+
|
||||||
|
"3\u0000\u02d4\u02d9\u02dc\u02de\u02e1\u02e9\u02ed\u02f0\u02f6\u02fd\u0301"+
|
||||||
|
"\u0304\u030c\u0310\u0313\u0318\u031c\u031f\u0322\u0327\u032a\u032c\u0332"+
|
||||||
|
"\u0335\u0339\u033d\u0341\u034c\u0351\u0358\u035a\u0366\u036c\u036e\u03f6"+
|
||||||
|
"\u0400\u040e\u0417\u041c\u0424\u0427\u042e\u0435\u043a\u043c\u0440\u0448"+
|
||||||
|
"\u044c\u0450\u0456\u0001\u0000\u0001\u0000";
|
||||||
|
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,242 @@
|
|||||||
|
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
|
||||||
|
MODULE=51
|
||||||
|
OPEN=52
|
||||||
|
REQUIRES=53
|
||||||
|
EXPORTS=54
|
||||||
|
OPENS=55
|
||||||
|
TO=56
|
||||||
|
USES=57
|
||||||
|
PROVIDES=58
|
||||||
|
WITH=59
|
||||||
|
TRANSITIVE=60
|
||||||
|
VAR=61
|
||||||
|
YIELD=62
|
||||||
|
RECORD=63
|
||||||
|
SEALED=64
|
||||||
|
PERMITS=65
|
||||||
|
NON_SEALED=66
|
||||||
|
DECIMAL_LITERAL=67
|
||||||
|
HEX_LITERAL=68
|
||||||
|
OCT_LITERAL=69
|
||||||
|
BINARY_LITERAL=70
|
||||||
|
FLOAT_LITERAL=71
|
||||||
|
HEX_FLOAT_LITERAL=72
|
||||||
|
BOOL_LITERAL=73
|
||||||
|
CHAR_LITERAL=74
|
||||||
|
STRING_LITERAL=75
|
||||||
|
TEXT_BLOCK=76
|
||||||
|
NULL_LITERAL=77
|
||||||
|
LPAREN=78
|
||||||
|
RPAREN=79
|
||||||
|
LBRACE=80
|
||||||
|
RBRACE=81
|
||||||
|
LBRACK=82
|
||||||
|
RBRACK=83
|
||||||
|
SEMI=84
|
||||||
|
COMMA=85
|
||||||
|
DOT=86
|
||||||
|
ASSIGN=87
|
||||||
|
GT=88
|
||||||
|
LT=89
|
||||||
|
BANG=90
|
||||||
|
TILDE=91
|
||||||
|
QUESTION=92
|
||||||
|
COLON=93
|
||||||
|
EQUAL=94
|
||||||
|
LE=95
|
||||||
|
GE=96
|
||||||
|
NOTEQUAL=97
|
||||||
|
AND=98
|
||||||
|
OR=99
|
||||||
|
INC=100
|
||||||
|
DEC=101
|
||||||
|
ADD=102
|
||||||
|
SUB=103
|
||||||
|
MUL=104
|
||||||
|
DIV=105
|
||||||
|
BITAND=106
|
||||||
|
BITOR=107
|
||||||
|
CARET=108
|
||||||
|
MOD=109
|
||||||
|
ADD_ASSIGN=110
|
||||||
|
SUB_ASSIGN=111
|
||||||
|
MUL_ASSIGN=112
|
||||||
|
DIV_ASSIGN=113
|
||||||
|
AND_ASSIGN=114
|
||||||
|
OR_ASSIGN=115
|
||||||
|
XOR_ASSIGN=116
|
||||||
|
MOD_ASSIGN=117
|
||||||
|
LSHIFT_ASSIGN=118
|
||||||
|
RSHIFT_ASSIGN=119
|
||||||
|
URSHIFT_ASSIGN=120
|
||||||
|
ARROW=121
|
||||||
|
COLONCOLON=122
|
||||||
|
AT=123
|
||||||
|
ELLIPSIS=124
|
||||||
|
WS=125
|
||||||
|
COMMENT=126
|
||||||
|
LINE_COMMENT=127
|
||||||
|
IDENTIFIER=128
|
||||||
|
'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
|
||||||
|
'module'=51
|
||||||
|
'open'=52
|
||||||
|
'requires'=53
|
||||||
|
'exports'=54
|
||||||
|
'opens'=55
|
||||||
|
'to'=56
|
||||||
|
'uses'=57
|
||||||
|
'provides'=58
|
||||||
|
'with'=59
|
||||||
|
'transitive'=60
|
||||||
|
'var'=61
|
||||||
|
'yield'=62
|
||||||
|
'record'=63
|
||||||
|
'sealed'=64
|
||||||
|
'permits'=65
|
||||||
|
'non-sealed'=66
|
||||||
|
'null'=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
|
||||||
|
'-'=103
|
||||||
|
'*'=104
|
||||||
|
'/'=105
|
||||||
|
'&'=106
|
||||||
|
'|'=107
|
||||||
|
'^'=108
|
||||||
|
'%'=109
|
||||||
|
'+='=110
|
||||||
|
'-='=111
|
||||||
|
'*='=112
|
||||||
|
'/='=113
|
||||||
|
'&='=114
|
||||||
|
'|='=115
|
||||||
|
'^='=116
|
||||||
|
'%='=117
|
||||||
|
'<<='=118
|
||||||
|
'>>='=119
|
||||||
|
'>>>='=120
|
||||||
|
'->'=121
|
||||||
|
'::'=122
|
||||||
|
'@'=123
|
||||||
|
'...'=124
|
||||||
File diff suppressed because one or more lines are too long
+15685
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,242 @@
|
|||||||
|
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
|
||||||
|
MODULE=51
|
||||||
|
OPEN=52
|
||||||
|
REQUIRES=53
|
||||||
|
EXPORTS=54
|
||||||
|
OPENS=55
|
||||||
|
TO=56
|
||||||
|
USES=57
|
||||||
|
PROVIDES=58
|
||||||
|
WITH=59
|
||||||
|
TRANSITIVE=60
|
||||||
|
VAR=61
|
||||||
|
YIELD=62
|
||||||
|
RECORD=63
|
||||||
|
SEALED=64
|
||||||
|
PERMITS=65
|
||||||
|
NON_SEALED=66
|
||||||
|
DECIMAL_LITERAL=67
|
||||||
|
HEX_LITERAL=68
|
||||||
|
OCT_LITERAL=69
|
||||||
|
BINARY_LITERAL=70
|
||||||
|
FLOAT_LITERAL=71
|
||||||
|
HEX_FLOAT_LITERAL=72
|
||||||
|
BOOL_LITERAL=73
|
||||||
|
CHAR_LITERAL=74
|
||||||
|
STRING_LITERAL=75
|
||||||
|
TEXT_BLOCK=76
|
||||||
|
NULL_LITERAL=77
|
||||||
|
LPAREN=78
|
||||||
|
RPAREN=79
|
||||||
|
LBRACE=80
|
||||||
|
RBRACE=81
|
||||||
|
LBRACK=82
|
||||||
|
RBRACK=83
|
||||||
|
SEMI=84
|
||||||
|
COMMA=85
|
||||||
|
DOT=86
|
||||||
|
ASSIGN=87
|
||||||
|
GT=88
|
||||||
|
LT=89
|
||||||
|
BANG=90
|
||||||
|
TILDE=91
|
||||||
|
QUESTION=92
|
||||||
|
COLON=93
|
||||||
|
EQUAL=94
|
||||||
|
LE=95
|
||||||
|
GE=96
|
||||||
|
NOTEQUAL=97
|
||||||
|
AND=98
|
||||||
|
OR=99
|
||||||
|
INC=100
|
||||||
|
DEC=101
|
||||||
|
ADD=102
|
||||||
|
SUB=103
|
||||||
|
MUL=104
|
||||||
|
DIV=105
|
||||||
|
BITAND=106
|
||||||
|
BITOR=107
|
||||||
|
CARET=108
|
||||||
|
MOD=109
|
||||||
|
ADD_ASSIGN=110
|
||||||
|
SUB_ASSIGN=111
|
||||||
|
MUL_ASSIGN=112
|
||||||
|
DIV_ASSIGN=113
|
||||||
|
AND_ASSIGN=114
|
||||||
|
OR_ASSIGN=115
|
||||||
|
XOR_ASSIGN=116
|
||||||
|
MOD_ASSIGN=117
|
||||||
|
LSHIFT_ASSIGN=118
|
||||||
|
RSHIFT_ASSIGN=119
|
||||||
|
URSHIFT_ASSIGN=120
|
||||||
|
ARROW=121
|
||||||
|
COLONCOLON=122
|
||||||
|
AT=123
|
||||||
|
ELLIPSIS=124
|
||||||
|
WS=125
|
||||||
|
COMMENT=126
|
||||||
|
LINE_COMMENT=127
|
||||||
|
IDENTIFIER=128
|
||||||
|
'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
|
||||||
|
'module'=51
|
||||||
|
'open'=52
|
||||||
|
'requires'=53
|
||||||
|
'exports'=54
|
||||||
|
'opens'=55
|
||||||
|
'to'=56
|
||||||
|
'uses'=57
|
||||||
|
'provides'=58
|
||||||
|
'with'=59
|
||||||
|
'transitive'=60
|
||||||
|
'var'=61
|
||||||
|
'yield'=62
|
||||||
|
'record'=63
|
||||||
|
'sealed'=64
|
||||||
|
'permits'=65
|
||||||
|
'non-sealed'=66
|
||||||
|
'null'=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
|
||||||
|
'-'=103
|
||||||
|
'*'=104
|
||||||
|
'/'=105
|
||||||
|
'&'=106
|
||||||
|
'|'=107
|
||||||
|
'^'=108
|
||||||
|
'%'=109
|
||||||
|
'+='=110
|
||||||
|
'-='=111
|
||||||
|
'*='=112
|
||||||
|
'/='=113
|
||||||
|
'&='=114
|
||||||
|
'|='=115
|
||||||
|
'^='=116
|
||||||
|
'%='=117
|
||||||
|
'<<='=118
|
||||||
|
'>>='=119
|
||||||
|
'>>>='=120
|
||||||
|
'->'=121
|
||||||
|
'::'=122
|
||||||
|
'@'=123
|
||||||
|
'...'=124
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -12,61 +12,80 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
|||||||
<url>http://maven.apache.org</url>
|
<url>http://maven.apache.org</url>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
<version>4.11</version>
|
<version>5.13.2</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/org.antlr/antlr4 -->
|
<!-- https://mvnrepository.com/artifact/org.antlr/antlr4 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.antlr</groupId>
|
<groupId>org.antlr</groupId>
|
||||||
<artifactId>antlr4</artifactId>
|
<artifactId>antlr4</artifactId>
|
||||||
<version>4.11.1</version>
|
<version>4.13.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>2.6</version>
|
<version>2.19.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.github.classgraph</groupId>
|
||||||
|
<artifactId>classgraph</artifactId>
|
||||||
|
<version>4.8.180</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.guava</groupId>
|
<groupId>com.google.guava</groupId>
|
||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
<version>22.0</version>
|
<version>33.4.8-jre</version>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.reflections</groupId>
|
|
||||||
<artifactId>reflections</artifactId>
|
|
||||||
<version>0.9.11</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/org.ow2.asm/asm -->
|
<!-- https://mvnrepository.com/artifact/org.ow2.asm/asm -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.ow2.asm</groupId>
|
<groupId>org.ow2.asm</groupId>
|
||||||
<artifactId>asm</artifactId>
|
<artifactId>asm</artifactId>
|
||||||
<version>9.5</version>
|
<version>9.8</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.jacoco</groupId>
|
||||||
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
|
<version>0.8.13</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>prepare-agent</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>report</id>
|
||||||
|
<phase>prepare-package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>report</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.11.0</version>
|
<version>3.14.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<compilerArgs>--enable-preview</compilerArgs>
|
<compilerArgs>--enable-preview</compilerArgs>
|
||||||
<source>21</source>
|
<source>24</source>
|
||||||
<target>21</target>
|
<target>24</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>3.1.0</version>
|
<version>3.5.3</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<redirectTestOutputToFile>true</redirectTestOutputToFile>
|
<redirectTestOutputToFile>true</redirectTestOutputToFile>
|
||||||
<reportsDirectory>${project.build.directory}/test-reports</reportsDirectory>
|
<reportsDirectory>${project.build.directory}/test-reports</reportsDirectory>
|
||||||
<argLine>--enable-preview</argLine>
|
<argLine>${argLine} --enable-preview</argLine>
|
||||||
<trimStackTrace>true</trimStackTrace>
|
<trimStackTrace>false</trimStackTrace>
|
||||||
<excludes>
|
<excludes>
|
||||||
<exclude>**/JavaTXCompilerTest.java</exclude>
|
<exclude>**/JavaTXCompilerTest.java</exclude>
|
||||||
<exclude>**/AllgemeinTest.java</exclude>
|
<exclude>**/AllgemeinTest.java</exclude>
|
||||||
@@ -77,7 +96,7 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.antlr</groupId>
|
<groupId>org.antlr</groupId>
|
||||||
<artifactId>antlr4-maven-plugin</artifactId>
|
<artifactId>antlr4-maven-plugin</artifactId>
|
||||||
<version>4.11.1</version>
|
<version>4.13.2</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>antlr</id>
|
<id>antlr</id>
|
||||||
@@ -90,7 +109,7 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
<version>3.3.0</version>
|
<version>3.4.2</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<archive>
|
<archive>
|
||||||
<manifest>
|
<manifest>
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
public class Bar{
|
||||||
|
|
||||||
|
void visit(Object o){
|
||||||
|
System.out.println("Object");
|
||||||
|
}
|
||||||
|
|
||||||
|
void visit(Bla f){
|
||||||
|
System.out.println("Foo");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
public class Box {
|
||||||
|
|
||||||
|
a;
|
||||||
|
|
||||||
|
public Box() { }
|
||||||
|
public Box(a) {
|
||||||
|
//this.a = a;
|
||||||
|
}
|
||||||
|
set(x) {
|
||||||
|
a = x;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
public class Foo{
|
||||||
|
|
||||||
|
public accept(Bar b){
|
||||||
|
b.visit(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import java.lang.Boolean;
|
||||||
|
import java.lang.Object;
|
||||||
|
|
||||||
|
class List {
|
||||||
|
elem;
|
||||||
|
next;
|
||||||
|
|
||||||
|
List() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
List(elem, next) {
|
||||||
|
this.elem = elem;
|
||||||
|
this.next = next;
|
||||||
|
}
|
||||||
|
|
||||||
|
addElement(newElem) {
|
||||||
|
return new List(newElem, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
append(l) {
|
||||||
|
if (next == null) {
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return new List(elem, next.append(l));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
addAll(l) {
|
||||||
|
var nextLoc = next;
|
||||||
|
while (//nextLoc != null
|
||||||
|
true) {
|
||||||
|
nextLoc = nextLoc.next;
|
||||||
|
}
|
||||||
|
nextLoc = l;
|
||||||
|
}
|
||||||
|
|
||||||
|
void m() {
|
||||||
|
List<? extends Object> l; // = new List<Integer>(1, null);
|
||||||
|
List<? extends Object> l2; // = new List<String>("SSS", null);
|
||||||
|
l.addAll(l2);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
public class Assign {
|
||||||
|
public x = 10;
|
||||||
|
public y = this;
|
||||||
|
|
||||||
|
public call() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public m() {
|
||||||
|
this.call().call().y.x = 20;
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
class B { }
|
public class Box<A> {
|
||||||
class Box_Main extends B {
|
|
||||||
m(b) {
|
A a;
|
||||||
b.m(new Box_Main());
|
|
||||||
b.m(new B());
|
public Box() { }
|
||||||
}
|
public Box(A a) {
|
||||||
|
//this.a = a;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
class Box<A> {
|
|
||||||
void m(A a) { }
|
|
||||||
}
|
|
||||||
@@ -2,18 +2,16 @@ import java.util.List;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.lang.Integer;
|
import java.lang.Integer;
|
||||||
import java.lang.System;
|
import java.lang.System;
|
||||||
|
import java.lang.Boolean;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
public class Bug298 {
|
public class Bug298 {
|
||||||
public <R, T> Stream<R> takes(Stream<T> s, Function<? super T, ? super R> fun) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void m() {
|
public void m() {
|
||||||
List<Integer> list = new ArrayList<>();
|
List<Integer> list = new ArrayList<>();
|
||||||
Stream<Integer> a = list.stream();
|
list.stream().map(x -> 2 * x);
|
||||||
takes(a, x -> 2 * x);
|
|
||||||
|
Function<Integer, Boolean> filter = x -> true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import java.lang.String;
|
||||||
|
|
||||||
|
class Base {
|
||||||
|
toString() {
|
||||||
|
return "Base";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Bug300 extends Base {
|
||||||
|
public m() {
|
||||||
|
return super.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
toString() {
|
||||||
|
return "Derived";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
public class Bug301<A> extends HashSet<A> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
public class Bug302 {
|
||||||
|
public Bug302(List<Integer> a){}
|
||||||
|
|
||||||
|
public static m() {
|
||||||
|
new Bug302(new ArrayList<Integer>());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
class Base {
|
||||||
|
m(List<Integer> a) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Bug306 extends Base {
|
||||||
|
@Override
|
||||||
|
m(List<Integer> b) {
|
||||||
|
b.add(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
public class Bug307 {
|
||||||
|
public void main() {
|
||||||
|
IVisitor v = new Visitor();
|
||||||
|
Impl2 f = new Impl2();
|
||||||
|
Impl1 g = new Impl1();
|
||||||
|
|
||||||
|
f.accept(v);
|
||||||
|
g.accept(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IVisitor {
|
||||||
|
void visit(Impl1 f);
|
||||||
|
void visit(Impl2 fb);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IAcceptor {
|
||||||
|
void accept(IVisitor v);
|
||||||
|
}
|
||||||
|
|
||||||
|
class Visitor implements IVisitor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void visit(Impl1 f) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void visit(Impl2 fb) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Impl1 implements IAcceptor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void accept(IVisitor v) {
|
||||||
|
v.visit(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Impl2 implements IAcceptor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void accept(IVisitor v) {
|
||||||
|
v.visit(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import java.util.List;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.lang.Integer;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
public class Bug309 {
|
||||||
|
public main() {
|
||||||
|
List<Integer> list = new ArrayList<>(List.of(1,2,3,4,5,6,7,8,9));
|
||||||
|
var res = list.stream().filter(x -> x == 5).map(x -> x * 2).findFirst();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.String;
|
||||||
|
|
||||||
|
public class Bug310 {
|
||||||
|
Integer i = 3;
|
||||||
|
public toString() {
|
||||||
|
return i.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import java.lang.String;
|
||||||
|
|
||||||
|
public class Bug311 {
|
||||||
|
Bug311A i = new Bug311A();
|
||||||
|
public toString() {
|
||||||
|
return i.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Bug311A {}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
public class Bug312 {
|
||||||
|
Bug312A i = new Bug312A();
|
||||||
|
public main() {
|
||||||
|
if (i == null) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Bug312A {}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
public class Bug314 {
|
||||||
|
public List<Integer> convert(List<Integer> in) {
|
||||||
|
return in.stream().filter(x -> x > 5).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
public class Bug325 {
|
||||||
|
public main() {
|
||||||
|
var list = new ArrayList<>(List.of(1,2,3,4,5));
|
||||||
|
var func = x -> x*2;
|
||||||
|
return list.stream().map(func).toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
public class Bug326 {
|
||||||
|
public Bug326() {
|
||||||
|
var func = x -> y -> x * y;
|
||||||
|
return func.apply(3).apply(4);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import Bug328B;
|
||||||
|
|
||||||
|
public class Bug328 extends Bug328B {
|
||||||
|
public Bug328() {
|
||||||
|
super(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
|||||||
|
public class Bug328B {
|
||||||
|
public Bug328B(int a) {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import java.lang.Object;
|
||||||
|
|
||||||
|
interface Visitor {
|
||||||
|
public void visit(Object obj);
|
||||||
|
public void visit(ClassA a);
|
||||||
|
}
|
||||||
|
|
||||||
|
class ClassA {
|
||||||
|
void accept(Visitor v) {
|
||||||
|
v.visit(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Bug332 {
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import java.lang.String;
|
||||||
|
|
||||||
|
public class Bug333 {
|
||||||
|
public static String Bar = "Bar";
|
||||||
|
}
|
||||||
|
|
||||||
|
class Bar {
|
||||||
|
public bar() {
|
||||||
|
String s = Bug333.Bar;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.Number;
|
||||||
|
import java.lang.Object;
|
||||||
|
|
||||||
|
public class Bug337 {
|
||||||
|
public void main() {
|
||||||
|
Fun1$$<Object, Integer> fun1 = x -> x.hashCode() + 1;
|
||||||
|
Fun1$$<Number, Number> fun2 = fun1;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import java.util.List;
|
||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.String;
|
||||||
|
import java.lang.Object;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Bug338 {
|
||||||
|
public hashCode() {
|
||||||
|
return List.of(42);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
public record Bug343() {
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import java.lang.String;
|
||||||
|
|
||||||
|
|
||||||
|
public class Bug363 {
|
||||||
|
uncurry (f){
|
||||||
|
return x -> f.apply(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
uncurry (f){
|
||||||
|
return (x, y) -> f.apply(x).apply(y);
|
||||||
|
}
|
||||||
|
|
||||||
|
uncurry (f){
|
||||||
|
return (x, y, z) -> f.apply(x).apply(y).apply(z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public test(){
|
||||||
|
var f = x -> y -> z -> x + y + z;
|
||||||
|
var g = uncurry(f);
|
||||||
|
return g.apply("A", "B", "C"); // Outputs: 6
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import java.lang.String;
|
||||||
|
|
||||||
|
public class Bug364{
|
||||||
|
public main(){
|
||||||
|
var f = x -> y -> z -> x + y + z;
|
||||||
|
return f.apply("A").apply("B").apply("C");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import java.lang.String;
|
||||||
|
import java.lang.Object;
|
||||||
|
|
||||||
|
public class Bug365{
|
||||||
|
swap(f){
|
||||||
|
return x -> y -> f.apply(y).apply(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
swap(Fun1$$<String, Fun1$$<String, Fun1$$<String, Object>>> f){
|
||||||
|
return x -> y -> z -> f.apply(z).apply(y).apply(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ex1() {
|
||||||
|
var func = x -> y -> z -> x + y + z;
|
||||||
|
return func.apply("A").apply("B").apply("C");
|
||||||
|
}
|
||||||
|
public ex2() {
|
||||||
|
var func = x -> y -> z -> x + y + z;
|
||||||
|
return swap(func).apply("A").apply("B").apply("C");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
public class Bug366 {
|
||||||
|
public static lambda() {
|
||||||
|
return (a, b) -> a + b;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static test() {
|
||||||
|
var l = lambda();
|
||||||
|
return l.apply(10, 20);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import java.lang.Boolean;
|
||||||
|
|
||||||
|
public class Bug371 {
|
||||||
|
static m1(x, y) { return x || y; }
|
||||||
|
static m2(x, y) { return x && y; }
|
||||||
|
|
||||||
|
public static test() {
|
||||||
|
return m2(m1(true, false), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import java.lang.Boolean;
|
||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.System;
|
||||||
|
import java.io.PrintStream;
|
||||||
|
import java.lang.Character;
|
||||||
|
|
||||||
|
public class Bug373 {
|
||||||
|
public static main() {
|
||||||
|
System.out.println(true);
|
||||||
|
System.out.println(false);
|
||||||
|
System.out.println(1);
|
||||||
|
System.out.println(1l);
|
||||||
|
System.out.println(1.0);
|
||||||
|
System.out.println(1.0f);
|
||||||
|
System.out.println('a');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
public record GenericRecord<T>(T a) {}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import java.lang.String;
|
||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
sealed interface List permits LinkedElem, Elem {}
|
||||||
|
|
||||||
|
|
||||||
|
public record LinkedElem<T>(T a,List l) implements List{}
|
||||||
|
public record Elem<T>(T c) implements List{}
|
||||||
|
|
||||||
|
public class GenericRecordSwitchCase {
|
||||||
|
public main(o) {
|
||||||
|
return switch(o) {
|
||||||
|
case LinkedElem(a, Elem(e)) -> a ;
|
||||||
|
case LinkedElem(a, LinkedElem(e, Elem(f))) -> a;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import java.lang.*;
|
||||||
|
|
||||||
|
public class ImportWildcard {
|
||||||
|
m(a, b) { return a * b; }
|
||||||
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import java.lang.Runnable;
|
|
||||||
import java.lang.System;
|
|
||||||
import java.lang.String;
|
|
||||||
import java.io.PrintStream;
|
|
||||||
|
|
||||||
public class LamRunnable {
|
|
||||||
|
|
||||||
public LamRunnable() {
|
|
||||||
Runnable lam = () -> {
|
|
||||||
System.out.println("lambda");
|
|
||||||
};
|
|
||||||
|
|
||||||
lam.run();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -3,4 +3,6 @@ import java.lang.Character;
|
|||||||
public class Literal {
|
public class Literal {
|
||||||
public m() { return null; }
|
public m() { return null; }
|
||||||
public m2() { return 'C'; }
|
public m2() { return 'C'; }
|
||||||
|
public m3() { return 10L; }
|
||||||
|
public m4() { return 10.5F; }
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import java.lang.Object;
|
||||||
|
import java.lang.System;
|
||||||
|
import java.lang.Iterable;
|
||||||
|
import java.io.PrintStream;
|
||||||
|
import java.util.List;
|
||||||
|
import java.lang.String;
|
||||||
|
|
||||||
|
class Main {
|
||||||
|
static main(args) {
|
||||||
|
for (var arg : args) {
|
||||||
|
System.out.println(arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import java.util.List;
|
||||||
|
import java.util.AbstractList;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.lang.Integer;
|
import java.lang.Integer;
|
||||||
//import java.lang.Float;
|
//import java.lang.Float;
|
||||||
@@ -30,8 +32,8 @@ public class Matrix extends Vector<Vector<Integer>> {
|
|||||||
var erg = 0;
|
var erg = 0;
|
||||||
var k = 0;
|
var k = 0;
|
||||||
while(k < v1.size()) {
|
while(k < v1.size()) {
|
||||||
erg = erg + v1.elementAt(k)
|
erg = erg + v1.get(k)
|
||||||
* m.elementAt(k).elementAt(j);
|
* m.get(k).get(j);
|
||||||
k++; }
|
k++; }
|
||||||
// v2.addElement(new Integer(erg));
|
// v2.addElement(new Integer(erg));
|
||||||
v2.addElement(erg);
|
v2.addElement(erg);
|
||||||
|
|||||||
@@ -1,11 +1,34 @@
|
|||||||
public class Op1{
|
import java.lang.Boolean;
|
||||||
public Op1() {
|
import java.lang.Integer;
|
||||||
|
|
||||||
Runnable lam = () -> {
|
public class Op1 {
|
||||||
String test = "";
|
public not() {
|
||||||
String b = "b";
|
var b = false;
|
||||||
test = b;
|
var c = !b;
|
||||||
System.out.println(test);};
|
return c;
|
||||||
//lam.run();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public or() {
|
||||||
|
var a = 10;
|
||||||
|
var b = 20;
|
||||||
|
return a | b;
|
||||||
|
}
|
||||||
|
|
||||||
|
public and() {
|
||||||
|
var a = 10;
|
||||||
|
var b = 20;
|
||||||
|
return a & b;
|
||||||
|
}
|
||||||
|
|
||||||
|
public xor() {
|
||||||
|
var a = 10;
|
||||||
|
var b = 20;
|
||||||
|
return a ^ b;
|
||||||
|
}
|
||||||
|
|
||||||
|
public mod() {
|
||||||
|
var a = 10;
|
||||||
|
var b = 2;
|
||||||
|
return a % b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import java.lang.Object;
|
||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.Float;
|
||||||
|
|
||||||
|
public record R(Object nested) {}
|
||||||
|
|
||||||
|
public class OverloadNestedPattern {
|
||||||
|
|
||||||
|
public Integer m(R(R(Integer a)), R(Integer b)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer m(R(R(Float a)), R(Float b)) {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer m(R(Integer a), R(Integer b)) {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,15 +2,31 @@ import java.lang.Integer;
|
|||||||
import java.lang.Number;
|
import java.lang.Number;
|
||||||
import java.lang.Float;
|
import java.lang.Float;
|
||||||
|
|
||||||
record Point(Number x, Number y) {}
|
public record Point(Number x, Number y) {}
|
||||||
|
|
||||||
public class OverloadPattern {
|
public class OverloadPattern {
|
||||||
public m(Point(Integer x, Integer y)) {
|
public Number m(Point(Integer x, Integer y), Point(Float a, Float b)) {
|
||||||
return x + y;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public m(Point(Float x, Float y)) {
|
public Number m(Point(Integer x, Integer y), Point(Integer a, Integer b)) {
|
||||||
return x * y;
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Number m(Point(Float x, Float y), Point(Integer a, Integer b)) {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Number m(Point(Float x, Float y), Point(Float a, Float b)) {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Number m(Point(Integer x, Integer y)) {
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Number m(Point(Float x, Float y)) {
|
||||||
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
public m(Integer x) {
|
public m(Integer x) {
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import java.lang.Object;
|
||||||
|
import java.lang.Boolean;
|
||||||
|
|
||||||
|
public class OverrideEquals extends OverrideRoot {
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int method(int var1, float var2) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
|||||||
|
public abstract class OverrideRoot {
|
||||||
|
public abstract int method(int a, float b);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import java.lang.Boolean;
|
||||||
|
|
||||||
|
sealed interface List<T> permits LinkedElem, Elem {}
|
||||||
|
|
||||||
|
public record LinkedElem<T>(T a, List<T> l) implements List<T> {}
|
||||||
|
public record Elem<T>(T a) implements List<T> {}
|
||||||
|
|
||||||
|
public class PatternMatchingHaskellStyle {
|
||||||
|
|
||||||
|
public append(LinkedElem(a, b), list2) {
|
||||||
|
return handleAppend(a, b, list2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleAppend(a, Elem(e), list2) {
|
||||||
|
return new LinkedElem<>(a, new LinkedElem<>(e, list2));
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleAppend(a, LinkedElem(e,r), list2) {
|
||||||
|
return new LinkedElem<>(a, append(new LinkedElem(e, r), list2));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import java.lang.Boolean;
|
||||||
|
import java.lang.Object;
|
||||||
|
|
||||||
|
sealed interface List<T> permits Cons, Empty {}
|
||||||
|
|
||||||
|
public record Cons<T>(T a, List<T> l) implements List<T> {}
|
||||||
|
public record Empty<T>() implements List<T> {}
|
||||||
|
|
||||||
|
public class PatternMatchingListAppend {
|
||||||
|
|
||||||
|
public append(Cons(a, b), list2) {
|
||||||
|
return new Cons<>(a, append(b, list2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public append(Empty(), list2) {
|
||||||
|
return list2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*public append(a, list2) {
|
||||||
|
switch(a) {
|
||||||
|
case Cons(x, y) -> ...
|
||||||
|
case Empty() ->
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.Double;
|
||||||
|
import java.lang.Number;
|
||||||
|
import java.lang.String;
|
||||||
|
|
||||||
|
public record R(Number n) {}
|
||||||
|
|
||||||
|
public class SwitchOverload {
|
||||||
|
|
||||||
|
public f(){}
|
||||||
|
|
||||||
|
public m(r) {
|
||||||
|
return switch(r) {
|
||||||
|
case R("test") -> f();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,9 +11,9 @@ record Rec(Integer a, Integer b) {}
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
public class RecordTest {
|
public class RecordTest {
|
||||||
a = new Rec(10, 20);
|
Rec a = new Rec(10, 20);
|
||||||
b = new Rec(10, 20);
|
Rec b = new Rec(10, 20);
|
||||||
c = new Rec(20, 40);
|
Rec c = new Rec(20, 40);
|
||||||
|
|
||||||
public doesEqual() { return a.equals(b); }
|
public doesEqual() { return a.equals(b); }
|
||||||
public doesNotEqual() { return b.equals(c); }
|
public doesNotEqual() { return b.equals(c); }
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public class Switch {
|
|||||||
case Rec(Integer a, Float b) -> a + 10;
|
case Rec(Integer a, Float b) -> a + 10;
|
||||||
case Rec(Integer a, Rec(Integer b, Integer c)) -> a + b + c;
|
case Rec(Integer a, Rec(Integer b, Integer c)) -> a + b + c;
|
||||||
case Integer i -> i;
|
case Integer i -> i;
|
||||||
default -> 0;
|
//default -> 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
sealed interface List<T> permits LinkedElem, Elem {}
|
||||||
|
|
||||||
|
public record LinkedElem<T>(T a, List<T> l) implements List<T> {}
|
||||||
|
public record Elem<T>(T a) implements List<T> {}
|
||||||
|
|
||||||
|
public class SwitchAppend {
|
||||||
|
public append(l1, l2) {
|
||||||
|
return switch(l1) {
|
||||||
|
case LinkedElem(a, Elem(e)) -> new LinkedElem<>(a, new LinkedElem<>(e, l2));
|
||||||
|
case LinkedElem(a, r) -> new LinkedElem<>(a, append(r, l2));
|
||||||
|
//Alternativ:
|
||||||
|
//case LinkedElem(a, LinkedElem(e, r)) -> new LinkedElem<>(a, append(new LinkedElem(e, r), l2));
|
||||||
|
//default -> null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.Object;
|
||||||
|
import java.lang.Float;
|
||||||
|
import java.lang.String;
|
||||||
|
|
||||||
|
public class NumberOrText{}
|
||||||
|
public class Text extends NumberOrText{};
|
||||||
|
public class Number extends NumberOrText{};
|
||||||
|
|
||||||
|
|
||||||
|
public record Cons(Integer a, NumberOrText l){}
|
||||||
|
|
||||||
|
|
||||||
|
public class SwitchCaseHeritageDetection {
|
||||||
|
public main(o) {
|
||||||
|
return switch(o) {
|
||||||
|
case Cons(a, Text b) -> "Second Element is a Text";
|
||||||
|
case Cons(a, Number b) -> "Second Element is a Number";
|
||||||
|
default -> "None of the above cases";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.Object;
|
||||||
|
import java.lang.Float;
|
||||||
|
import java.lang.String;
|
||||||
|
|
||||||
|
public record Rec(Object a, Object b) {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class SwitchInfered {
|
||||||
|
public main(o) {
|
||||||
|
return switch (o) {
|
||||||
|
case Rec(a, b) -> "asd";
|
||||||
|
default -> "cde";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import java.lang.Object;
|
||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
public record R(Integer i) {}
|
||||||
|
|
||||||
|
public class SwitchNestedValue {
|
||||||
|
public main(r) {
|
||||||
|
return switch(r) {
|
||||||
|
case R(10) -> 1;
|
||||||
|
case R(20) -> 2;
|
||||||
|
case R(i) -> 3;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.Double;
|
||||||
|
import java.lang.Number;
|
||||||
|
|
||||||
|
public record R(Number n) {}
|
||||||
|
|
||||||
|
public class SwitchOverload {
|
||||||
|
|
||||||
|
Number f(Double d) { return d * 2; }
|
||||||
|
Number f(Integer i) { return i * 5; }
|
||||||
|
|
||||||
|
public m(r, x) {
|
||||||
|
x = x + x;
|
||||||
|
return switch(r) {
|
||||||
|
case R(o) -> {
|
||||||
|
x = x + x;
|
||||||
|
yield f(o);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.Object;
|
||||||
|
import java.lang.Float;
|
||||||
|
import java.lang.String;
|
||||||
|
|
||||||
|
sealed interface List permits LinkedElem, Elem {}
|
||||||
|
|
||||||
|
|
||||||
|
public record LinkedElem(Integer a,List l) implements List{} //Implementiert List und wird auch permittet
|
||||||
|
public record Elem(Integer c) implements List{} //Implementiert List, wird aber nicht permittet
|
||||||
|
|
||||||
|
public class SwitchCaseHeritageDetection {
|
||||||
|
public main(o) {
|
||||||
|
return switch(o) {
|
||||||
|
case LinkedElem(a, Elem(e)) -> a + e;
|
||||||
|
case LinkedElem(a, LinkedElem(e, Elem(f))) -> a + e + f;
|
||||||
|
default -> 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import java.lang.Boolean;
|
||||||
|
import java.lang.String;
|
||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
public class Ternary {
|
||||||
|
public main(x) {
|
||||||
|
return x > 10 ? "big" : "small";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,4 +9,13 @@ public class While {
|
|||||||
}
|
}
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public m2() {
|
||||||
|
int i = 0;
|
||||||
|
do {
|
||||||
|
++i;
|
||||||
|
} while(i < 10);
|
||||||
|
|
||||||
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,41 +2,21 @@ import java.lang.Integer;
|
|||||||
|
|
||||||
public class Y {
|
public class Y {
|
||||||
y;
|
y;
|
||||||
//factorial;
|
|
||||||
|
|
||||||
public Y() {
|
public Y() {
|
||||||
y = f -> t -> f.apply(y.apply(f)).apply(t);
|
y = f -> t -> f.apply(y.apply(f)).apply(t);
|
||||||
//factorial = y.apply(f -> n -> { if (n == 0) return 1; else return n * f.apply(n - 1); });
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
getY() {
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
class fac1 {
|
|
||||||
factorial;
|
|
||||||
|
|
||||||
fac1() {
|
|
||||||
var y;
|
|
||||||
y = new Y<Integer,Integer,Integer,Integer,Integer>().getY();
|
|
||||||
factorial = y.apply(f -> n -> { if (n == 0) return 1; else return n * f.apply(n - 1); });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ergibt Parse-Error
|
public class Fac1 {
|
||||||
class fac1 {
|
public factorial;
|
||||||
factorial;
|
public Fac1() {
|
||||||
|
|
||||||
fac1() {
|
|
||||||
var y;
|
var y;
|
||||||
y = new Y<>().y;
|
var tmp = new Y<>(); // TODO Having new Y<>().y on one line doesn't work, see FIXME in StatementGenerator
|
||||||
|
y = tmp.y;
|
||||||
factorial = y.apply(f -> n -> { if (n == 0) return 1; else return n * f.apply(n - 1); });
|
factorial = y.apply(f -> n -> { if (n == 0) return 1; else return n * f.apply(n - 1); });
|
||||||
}
|
}
|
||||||
public static void main(String args[]) {
|
|
||||||
System.out.println(new fac1().factorial.apply(3));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public fac(v) {
|
||||||
|
return factorial.apply(v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package pkg.sub;
|
||||||
|
|
||||||
|
public interface Interface {}
|
||||||
@@ -654,14 +654,17 @@ primaryPattern
|
|||||||
: typePattern #tPattern
|
: typePattern #tPattern
|
||||||
| recordPattern #rPattern
|
| recordPattern #rPattern
|
||||||
| '(' pattern ')' #enclosedPattern
|
| '(' pattern ')' #enclosedPattern
|
||||||
|
| literal (',' literal)* #lPattern
|
||||||
;
|
;
|
||||||
|
|
||||||
recordPattern
|
recordPattern
|
||||||
: typeType recordStructurePattern identifier?
|
: typeType recordStructurePattern identifier?
|
||||||
|
//| recordStructurePattern identifier?
|
||||||
;
|
;
|
||||||
|
|
||||||
typePattern
|
typePattern
|
||||||
: variableModifier* typeType identifier
|
: variableModifier* typeType identifier
|
||||||
|
| variableModifier* identifier
|
||||||
;
|
;
|
||||||
|
|
||||||
recordStructurePattern
|
recordStructurePattern
|
||||||
@@ -717,10 +720,10 @@ switchLabeledRule
|
|||||||
;
|
;
|
||||||
|
|
||||||
switchLabelCase
|
switchLabelCase
|
||||||
: CASE expressionList (ARROW | COLON) #labeledRuleExprList
|
: CASE NULL_LITERAL (ARROW | COLON) #labeledRuleNull
|
||||||
| CASE NULL_LITERAL (ARROW | COLON) #labeledRuleNull
|
|
||||||
| CASE pattern (ARROW | COLON) #labeledRulePattern
|
| CASE pattern (ARROW | COLON) #labeledRulePattern
|
||||||
| DEFAULT (ARROW | COLON) #labeledRuleDefault
|
| DEFAULT (ARROW | COLON) #labeledRuleDefault
|
||||||
|
| CASE expressionList (ARROW | COLON) #labeledRuleExprList
|
||||||
;
|
;
|
||||||
|
|
||||||
// Java20
|
// Java20
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ package de.dhbwstuttgart.bytecode;
|
|||||||
|
|
||||||
import de.dhbwstuttgart.core.JavaTXCompiler;
|
import de.dhbwstuttgart.core.JavaTXCompiler;
|
||||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||||
import de.dhbwstuttgart.parser.NullToken;
|
|
||||||
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
||||||
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
|
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
|
||||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
import de.dhbwstuttgart.target.generate.ASTToTargetAST;
|
||||||
import de.dhbwstuttgart.target.tree.*;
|
import de.dhbwstuttgart.target.tree.*;
|
||||||
import de.dhbwstuttgart.target.tree.expression.*;
|
import de.dhbwstuttgart.target.tree.expression.*;
|
||||||
import de.dhbwstuttgart.target.tree.type.*;
|
import de.dhbwstuttgart.target.tree.type.*;
|
||||||
@@ -14,6 +13,7 @@ import org.objectweb.asm.*;
|
|||||||
import java.lang.invoke.*;
|
import java.lang.invoke.*;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static org.objectweb.asm.Opcodes.*;
|
import static org.objectweb.asm.Opcodes.*;
|
||||||
import static de.dhbwstuttgart.target.tree.expression.TargetBinaryOp.*;
|
import static de.dhbwstuttgart.target.tree.expression.TargetBinaryOp.*;
|
||||||
@@ -26,17 +26,25 @@ public class Codegen {
|
|||||||
private int lambdaCounter = 0;
|
private int lambdaCounter = 0;
|
||||||
private final HashMap<TargetLambdaExpression, TargetMethod> lambdas = new HashMap<>();
|
private final HashMap<TargetLambdaExpression, TargetMethod> lambdas = new HashMap<>();
|
||||||
private final JavaTXCompiler compiler;
|
private final JavaTXCompiler compiler;
|
||||||
|
private final ASTToTargetAST converter;
|
||||||
|
|
||||||
public Codegen(TargetStructure clazz, JavaTXCompiler compiler) {
|
private class CustomClassWriter extends ClassWriter {
|
||||||
|
public CustomClassWriter() {
|
||||||
|
super(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ClassLoader getClassLoader() {
|
||||||
|
return compiler.getClassLoader();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Codegen(TargetStructure clazz, JavaTXCompiler compiler, ASTToTargetAST converter) {
|
||||||
this.clazz = clazz;
|
this.clazz = clazz;
|
||||||
this.className = clazz.qualifiedName().getClassName();
|
this.className = clazz.qualifiedName().getClassName();
|
||||||
this.cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS) {
|
this.cw = new CustomClassWriter();
|
||||||
@Override
|
|
||||||
protected ClassLoader getClassLoader() {
|
|
||||||
return compiler.getClassLoader();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
this.compiler = compiler;
|
this.compiler = compiler;
|
||||||
|
this.converter = converter;
|
||||||
}
|
}
|
||||||
|
|
||||||
private record LocalVar(int index, String name, TargetType type) {
|
private record LocalVar(int index, String name, TargetType type) {
|
||||||
@@ -77,16 +85,16 @@ public class Codegen {
|
|||||||
int localCounter;
|
int localCounter;
|
||||||
MethodVisitor mv;
|
MethodVisitor mv;
|
||||||
TargetType returnType;
|
TargetType returnType;
|
||||||
// This is used to remember the type from lambda expressions
|
boolean isStatic = false;
|
||||||
TargetType contextType;
|
|
||||||
|
|
||||||
Stack<BreakEnv> breakStack = new Stack<>();
|
Stack<BreakEnv> breakStack = new Stack<>();
|
||||||
Stack<Integer> switchResultValue = new Stack<>();
|
Stack<Integer> switchResultValue = new Stack<>();
|
||||||
|
|
||||||
State(TargetType returnType, MethodVisitor mv, int localCounter) {
|
State(TargetType returnType, MethodVisitor mv, int localCounter, boolean isStatic) {
|
||||||
this.returnType = returnType;
|
this.returnType = returnType;
|
||||||
this.mv = mv;
|
this.mv = mv;
|
||||||
this.localCounter = localCounter;
|
this.localCounter = localCounter;
|
||||||
|
this.isStatic = isStatic;
|
||||||
}
|
}
|
||||||
|
|
||||||
void enterScope() {
|
void enterScope() {
|
||||||
@@ -97,6 +105,10 @@ public class Codegen {
|
|||||||
this.scope = this.scope.parent;
|
this.scope = this.scope.parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LocalVar createVariable(TargetType type) {
|
||||||
|
return createVariable("__var" + this.localCounter, type);
|
||||||
|
}
|
||||||
|
|
||||||
LocalVar createVariable(String name, TargetType type) {
|
LocalVar createVariable(String name, TargetType type) {
|
||||||
var local = new LocalVar(localCounter, name, type);
|
var local = new LocalVar(localCounter, name, type);
|
||||||
scope.add(local);
|
scope.add(local);
|
||||||
@@ -120,6 +132,7 @@ public class Codegen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void boxPrimitive(State state, TargetType type) {
|
private void boxPrimitive(State state, TargetType type) {
|
||||||
|
if (type instanceof TargetExtendsWildcard ew) type = ew.innerType();
|
||||||
var mv = state.mv;
|
var mv = state.mv;
|
||||||
if (type.equals(TargetType.Boolean) || type.equals(TargetType.boolean_)) {
|
if (type.equals(TargetType.Boolean) || type.equals(TargetType.boolean_)) {
|
||||||
mv.visitMethodInsn(INVOKESTATIC, "java/lang/Boolean", "valueOf", "(Z)Ljava/lang/Boolean;", false);
|
mv.visitMethodInsn(INVOKESTATIC, "java/lang/Boolean", "valueOf", "(Z)Ljava/lang/Boolean;", false);
|
||||||
@@ -141,6 +154,7 @@ public class Codegen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void unboxPrimitive(State state, TargetType type) {
|
private void unboxPrimitive(State state, TargetType type) {
|
||||||
|
if (type instanceof TargetExtendsWildcard ew) type = ew.innerType();
|
||||||
var mv = state.mv;
|
var mv = state.mv;
|
||||||
if (type.equals(TargetType.Boolean)) {
|
if (type.equals(TargetType.Boolean)) {
|
||||||
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Boolean", "booleanValue", "()Z", false);
|
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Boolean", "booleanValue", "()Z", false);
|
||||||
@@ -216,13 +230,16 @@ public class Codegen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void convertTo(State state, TargetType source, TargetType dest) {
|
private void convertTo(State state, TargetType source, TargetType dest) {
|
||||||
|
if (source instanceof TargetExtendsWildcard ew) source = ew.innerType();
|
||||||
|
if (dest instanceof TargetExtendsWildcard ew) dest = ew.innerType();
|
||||||
|
|
||||||
var mv = state.mv;
|
var mv = state.mv;
|
||||||
if (source.equals(dest))
|
if (source.equals(dest))
|
||||||
return;
|
return;
|
||||||
if (source.equals(TargetType.Long)) {
|
if (source.equals(TargetType.Long)) {
|
||||||
if (dest.equals(TargetType.Integer)) {
|
if (dest.equals(TargetType.Integer))
|
||||||
mv.visitInsn(L2I);
|
mv.visitInsn(L2I);
|
||||||
} else if (dest.equals(TargetType.Float))
|
else if (dest.equals(TargetType.Float))
|
||||||
mv.visitInsn(L2F);
|
mv.visitInsn(L2F);
|
||||||
else if (dest.equals(TargetType.Double))
|
else if (dest.equals(TargetType.Double))
|
||||||
mv.visitInsn(L2D);
|
mv.visitInsn(L2D);
|
||||||
@@ -265,13 +282,45 @@ public class Codegen {
|
|||||||
mv.visitInsn(I2F);
|
mv.visitInsn(I2F);
|
||||||
else if (dest.equals(TargetType.Double))
|
else if (dest.equals(TargetType.Double))
|
||||||
mv.visitInsn(I2D);
|
mv.visitInsn(I2D);
|
||||||
|
} else if (source.equals(TargetType.Boolean)) {
|
||||||
|
unboxPrimitive(state, dest);
|
||||||
|
} else if (isFunctionalInterface(source) && isFunctionalInterface(dest) &&
|
||||||
|
!(source instanceof TargetFunNType && dest instanceof TargetFunNType)) {
|
||||||
|
boxFunctionalInterface(state, source, dest);
|
||||||
} else if (!(dest instanceof TargetGenericType)) {
|
} else if (!(dest instanceof TargetGenericType)) {
|
||||||
boxPrimitive(state, source);
|
//boxPrimitive(state, source);
|
||||||
mv.visitTypeInsn(CHECKCAST, dest.getInternalName());
|
mv.visitTypeInsn(CHECKCAST, dest.getInternalName());
|
||||||
unboxPrimitive(state, dest);
|
unboxPrimitive(state, dest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
record TypePair(TargetType from, TargetType to) {}
|
||||||
|
private Map<TypePair, String> funWrapperClasses = new HashMap<>();
|
||||||
|
|
||||||
|
private void boxFunctionalInterface(State state, TargetType source, TargetType dest) {
|
||||||
|
var mv = state.mv;
|
||||||
|
var className = "FunWrapper$$" +
|
||||||
|
source.name().replaceAll("\\.", "\\$") +
|
||||||
|
"$_$" +
|
||||||
|
dest.name().replaceAll("\\.", "\\$");
|
||||||
|
|
||||||
|
funWrapperClasses.put(new TypePair(source, dest), className);
|
||||||
|
mv.visitTypeInsn(NEW, className);
|
||||||
|
mv.visitInsn(DUP_X1);
|
||||||
|
mv.visitInsn(SWAP);
|
||||||
|
mv.visitMethodInsn(INVOKESPECIAL, className, "<init>", "(" + source.toDescriptor() + ")V", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isFunctionalInterface(TargetType type) {
|
||||||
|
if (type instanceof TargetFunNType) return true;
|
||||||
|
if (type instanceof TargetRefType) {
|
||||||
|
var clazz = compiler.getClass(new JavaClassName(type.name()));
|
||||||
|
return (clazz.getModifiers() & Modifier.INTERFACE) != 0 && clazz.isFunctionalInterface();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private TargetType largerType(TargetType left, TargetType right) {
|
private TargetType largerType(TargetType left, TargetType right) {
|
||||||
if (left.equals(TargetType.String) || right.equals(TargetType.String)) {
|
if (left.equals(TargetType.String) || right.equals(TargetType.String)) {
|
||||||
return TargetType.String;
|
return TargetType.String;
|
||||||
@@ -281,9 +330,12 @@ public class Codegen {
|
|||||||
return TargetType.Float;
|
return TargetType.Float;
|
||||||
} else if (left.equals(TargetType.Long) || right.equals(TargetType.Long)) {
|
} else if (left.equals(TargetType.Long) || right.equals(TargetType.Long)) {
|
||||||
return TargetType.Long;
|
return TargetType.Long;
|
||||||
} else {
|
} else if (left.equals(TargetType.Integer) || right.equals(TargetType.Integer)) {
|
||||||
return TargetType.Integer;
|
return TargetType.Integer;
|
||||||
|
} else if (left.equals(TargetType.Short) || right.equals(TargetType.Short)) {
|
||||||
|
return TargetType.Short;
|
||||||
}
|
}
|
||||||
|
return left;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateBinaryOp(State state, TargetBinaryOp op) {
|
private void generateBinaryOp(State state, TargetBinaryOp op) {
|
||||||
@@ -593,7 +645,7 @@ public class Codegen {
|
|||||||
} else if (op.expr() instanceof TargetFieldVar fieldVar) {
|
} else if (op.expr() instanceof TargetFieldVar fieldVar) {
|
||||||
generate(state, fieldVar.left());
|
generate(state, fieldVar.left());
|
||||||
mv.visitInsn(SWAP);
|
mv.visitInsn(SWAP);
|
||||||
mv.visitFieldInsn(PUTFIELD, fieldVar.owner().getInternalName(), fieldVar.right(), fieldVar.type().toSignature());
|
mv.visitFieldInsn(PUTFIELD, fieldVar.owner().getInternalName(), fieldVar.right(), fieldVar.type().toDescriptor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -715,54 +767,94 @@ public class Codegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static TargetType removeGenerics(TargetType param) {
|
||||||
|
return switch (param) {
|
||||||
|
case null -> null;
|
||||||
|
case TargetFunNType funNType -> new TargetFunNType(funNType.name(), funNType.funNParams(), List.of(), funNType.returnArguments());
|
||||||
|
case TargetRefType refType -> new TargetRefType(refType.name());
|
||||||
|
case TargetGenericType targetGenericType -> TargetType.Object;
|
||||||
|
default -> param;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
private void generateLambdaExpression(State state, TargetLambdaExpression lambda) {
|
private void generateLambdaExpression(State state, TargetLambdaExpression lambda) {
|
||||||
var mv = state.mv;
|
var mv = state.mv;
|
||||||
|
|
||||||
|
String methodName = "apply";
|
||||||
|
TargetMethod.Signature signature = new TargetMethod.Signature(Set.of(),
|
||||||
|
lambda.signature().parameters().stream().map(
|
||||||
|
par -> par.withType(TargetType.Object)).toList(),
|
||||||
|
lambda.signature().returnType() != null ? TargetType.Object : null);
|
||||||
|
|
||||||
|
var parameters = new ArrayList<>(lambda.captures());
|
||||||
|
parameters.addAll(signature.parameters());
|
||||||
|
parameters = parameters.stream().map(param -> param.withType(removeGenerics(param.pattern().type()))).collect(Collectors.toCollection(ArrayList::new));
|
||||||
|
var implSignature = new TargetMethod.Signature(Set.of(), parameters, removeGenerics(lambda.signature().returnType()));
|
||||||
|
|
||||||
TargetMethod impl;
|
TargetMethod impl;
|
||||||
if (lambdas.containsKey(lambda)) {
|
if (lambdas.containsKey(lambda)) {
|
||||||
impl = lambdas.get(lambda);
|
impl = lambdas.get(lambda);
|
||||||
} else {
|
} else {
|
||||||
var name = "lambda$" + lambdaCounter++;
|
var name = "lambda$" + lambdaCounter++;
|
||||||
var parameters = new ArrayList<>(lambda.captures());
|
|
||||||
parameters.addAll(lambda.params().stream().map(param -> param.pattern().type() instanceof TargetGenericType ? param.withType(TargetType.Object) : param).toList());
|
|
||||||
|
|
||||||
impl = new TargetMethod(0, name, lambda.block(), new TargetMethod.Signature(Set.of(), parameters, lambda.returnType() instanceof TargetGenericType ? TargetType.Object : lambda.returnType()), null);
|
impl = new TargetMethod(state.isStatic ? ACC_STATIC : 0, name, lambda.block(), implSignature, null);
|
||||||
generateMethod(impl);
|
generateMethod(impl, state);
|
||||||
lambdas.put(lambda, impl);
|
lambdas.put(lambda, impl);
|
||||||
}
|
}
|
||||||
|
|
||||||
var mt = MethodType.methodType(CallSite.class, MethodHandles.Lookup.class, String.class, MethodType.class, MethodType.class, MethodHandle.class, MethodType.class);
|
var mt = MethodType.methodType(CallSite.class, MethodHandles.Lookup.class, String.class, MethodType.class, MethodType.class, MethodHandle.class, MethodType.class);
|
||||||
|
|
||||||
var bootstrap = new Handle(H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory", mt.toMethodDescriptorString(), false);
|
var bootstrap = new Handle(H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory", mt.toMethodDescriptorString(), false);
|
||||||
var handle = new Handle(H_INVOKEVIRTUAL, clazz.getName(), impl.name(), impl.getDescriptor(), false);
|
var handle = new Handle(state.isStatic ? H_INVOKESTATIC : H_INVOKEVIRTUAL, clazz.getName(), impl.name(), implSignature.getDescriptor(), false);
|
||||||
|
|
||||||
// TODO maybe make this a function?
|
|
||||||
var desugared = "(";
|
|
||||||
for (var param : lambda.params())
|
|
||||||
desugared += "Ljava/lang/Object;";
|
|
||||||
desugared += ")";
|
|
||||||
if (lambda.returnType() != null)
|
|
||||||
desugared += "Ljava/lang/Object;";
|
|
||||||
else
|
|
||||||
desugared += "V";
|
|
||||||
|
|
||||||
var params = new ArrayList<TargetType>();
|
var params = new ArrayList<TargetType>();
|
||||||
params.add(new TargetRefType(clazz.qualifiedName().getClassName()));
|
if(!state.isStatic) params.add(new TargetRefType(clazz.qualifiedName().toString()));
|
||||||
params.addAll(lambda.captures().stream().map(mp -> mp.pattern().type()).toList());
|
params.addAll(lambda.captures().stream().map(mp -> mp.pattern().type()).toList());
|
||||||
|
|
||||||
var descriptor = TargetMethod.getDescriptor(state.contextType, params.toArray(TargetType[]::new));
|
if (!state.isStatic)
|
||||||
mv.visitVarInsn(ALOAD, 0);
|
mv.visitVarInsn(ALOAD, 0);
|
||||||
for (var capture : lambda.captures()) {
|
for (var index = 0; index < lambda.captures().size(); index++) {
|
||||||
|
var capture = lambda.captures().get(index);
|
||||||
var pattern = (TargetTypePattern) capture.pattern();
|
var pattern = (TargetTypePattern) capture.pattern();
|
||||||
mv.visitVarInsn(ALOAD, state.scope.get(pattern.name()).index);
|
var variable = state.scope.get(pattern.name());
|
||||||
|
mv.visitVarInsn(ALOAD, variable.index);
|
||||||
|
mv.visitTypeInsn(CHECKCAST, capture.pattern().type().getInternalName());
|
||||||
}
|
}
|
||||||
|
|
||||||
String methodName;
|
var descriptor = TargetMethod.getDescriptor(lambda.type(), params.toArray(TargetType[]::new));
|
||||||
var intf = compiler.getClass(new JavaClassName(state.contextType.name()));
|
mv.visitInvokeDynamicInsn(methodName, descriptor, bootstrap, Type.getType(signature.getSignature()), handle, Type.getType(signature.getDescriptor()));
|
||||||
if (intf == null) methodName = "apply"; // TODO Weird fallback logic here
|
}
|
||||||
else methodName = intf.getMethods().stream().filter(m -> Modifier.isAbstract(m.modifier)).findFirst().orElseThrow().getName();
|
|
||||||
|
|
||||||
mv.visitInvokeDynamicInsn(methodName, descriptor, bootstrap, Type.getType(desugared), handle, Type.getType(TargetMethod.getDescriptor(impl.signature().returnType(), lambda.params().stream().map(mp -> mp.pattern().type()).toArray(TargetType[]::new))));
|
private int findReturnCode(TargetType returnType) {
|
||||||
|
if (returnType.equals(TargetType.boolean_)
|
||||||
|
|| returnType.equals(TargetType.char_)
|
||||||
|
|| returnType.equals(TargetType.int_)
|
||||||
|
|| returnType.equals(TargetType.short_)
|
||||||
|
|| returnType.equals(TargetType.byte_))
|
||||||
|
return IRETURN;
|
||||||
|
else if (returnType.equals(TargetType.long_))
|
||||||
|
return LRETURN;
|
||||||
|
else if (returnType.equals(TargetType.float_))
|
||||||
|
return FRETURN;
|
||||||
|
else if (returnType.equals(TargetType.double_))
|
||||||
|
return DRETURN;
|
||||||
|
return ARETURN;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int findLoadCode(TargetType loadType) {
|
||||||
|
if (loadType.equals(TargetType.boolean_)
|
||||||
|
|| loadType.equals(TargetType.char_)
|
||||||
|
|| loadType.equals(TargetType.int_)
|
||||||
|
|| loadType.equals(TargetType.short_)
|
||||||
|
|| loadType.equals(TargetType.byte_))
|
||||||
|
return ILOAD;
|
||||||
|
else if (loadType.equals(TargetType.long_))
|
||||||
|
return LLOAD;
|
||||||
|
else if (loadType.equals(TargetType.float_))
|
||||||
|
return FLOAD;
|
||||||
|
else if (loadType.equals(TargetType.double_))
|
||||||
|
return DLOAD;
|
||||||
|
return ALOAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generate(State state, TargetExpression expr) {
|
private void generate(State state, TargetExpression expr) {
|
||||||
@@ -789,10 +881,7 @@ public class Codegen {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetCast cast:
|
case TargetCast cast:
|
||||||
var ctx = state.contextType;
|
|
||||||
state.contextType = cast.type();
|
|
||||||
generate(state, cast.expr());
|
generate(state, cast.expr());
|
||||||
state.contextType = ctx;
|
|
||||||
convertTo(state, cast.expr().type(), cast.type());
|
convertTo(state, cast.expr().type(), cast.type());
|
||||||
break;
|
break;
|
||||||
case TargetInstanceOf instanceOf:
|
case TargetInstanceOf instanceOf:
|
||||||
@@ -837,10 +926,7 @@ public class Codegen {
|
|||||||
case TargetAssign assign: {
|
case TargetAssign assign: {
|
||||||
switch (assign.left()) {
|
switch (assign.left()) {
|
||||||
case TargetLocalVar localVar -> {
|
case TargetLocalVar localVar -> {
|
||||||
var ctype = state.contextType;
|
|
||||||
state.contextType = localVar.type();
|
|
||||||
generate(state, assign.right());
|
generate(state, assign.right());
|
||||||
state.contextType = ctype;
|
|
||||||
|
|
||||||
convertTo(state, assign.right().type(), localVar.type());
|
convertTo(state, assign.right().type(), localVar.type());
|
||||||
boxPrimitive(state, localVar.type());
|
boxPrimitive(state, localVar.type());
|
||||||
@@ -853,10 +939,7 @@ public class Codegen {
|
|||||||
if (!(dot.left() instanceof TargetThis && dot.isStatic()))
|
if (!(dot.left() instanceof TargetThis && dot.isStatic()))
|
||||||
generate(state, dot.left());
|
generate(state, dot.left());
|
||||||
|
|
||||||
var ctype = state.contextType;
|
|
||||||
state.contextType = fieldType;
|
|
||||||
generate(state, assign.right());
|
generate(state, assign.right());
|
||||||
state.contextType = ctype;
|
|
||||||
|
|
||||||
convertTo(state, assign.right().type(), fieldType);
|
convertTo(state, assign.right().type(), fieldType);
|
||||||
boxPrimitive(state, fieldType);
|
boxPrimitive(state, fieldType);
|
||||||
@@ -864,7 +947,7 @@ public class Codegen {
|
|||||||
mv.visitInsn(DUP);
|
mv.visitInsn(DUP);
|
||||||
else
|
else
|
||||||
mv.visitInsn(DUP_X1);
|
mv.visitInsn(DUP_X1);
|
||||||
mv.visitFieldInsn(dot.isStatic() ? PUTSTATIC : PUTFIELD, dot.owner().getInternalName(), dot.right(), fieldType.toSignature());
|
mv.visitFieldInsn(dot.isStatic() ? PUTSTATIC : PUTFIELD, dot.owner().getInternalName(), dot.right(), fieldType.toDescriptor());
|
||||||
}
|
}
|
||||||
default -> throw new CodeGenException("Invalid assignment");
|
default -> throw new CodeGenException("Invalid assignment");
|
||||||
}
|
}
|
||||||
@@ -873,13 +956,15 @@ public class Codegen {
|
|||||||
case TargetLocalVar localVar: {
|
case TargetLocalVar localVar: {
|
||||||
LocalVar local = state.scope.get(localVar.name());
|
LocalVar local = state.scope.get(localVar.name());
|
||||||
mv.visitVarInsn(ALOAD, local.index());
|
mv.visitVarInsn(ALOAD, local.index());
|
||||||
|
// This is a bit weird but sometimes the types don't match (see lambda expressions)
|
||||||
|
convertTo(state, local.type(), localVar.type());
|
||||||
unboxPrimitive(state, local.type());
|
unboxPrimitive(state, local.type());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetFieldVar dot: {
|
case TargetFieldVar dot: {
|
||||||
if (!dot.isStatic())
|
if (!dot.isStatic())
|
||||||
generate(state, dot.left());
|
generate(state, dot.left());
|
||||||
mv.visitFieldInsn(dot.isStatic() ? GETSTATIC : GETFIELD, dot.left().type().getInternalName(), dot.right(), dot.type().toSignature());
|
mv.visitFieldInsn(dot.isStatic() ? GETSTATIC : GETFIELD, dot.left().type().getInternalName(), dot.right(), dot.type().toDescriptor());
|
||||||
unboxPrimitive(state, dot.type());
|
unboxPrimitive(state, dot.type());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -946,6 +1031,27 @@ public class Codegen {
|
|||||||
mv.visitLabel(end);
|
mv.visitLabel(end);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case TargetDo _do: {
|
||||||
|
Label start = new Label();
|
||||||
|
Label end = new Label();
|
||||||
|
Label check = new Label();
|
||||||
|
|
||||||
|
var env = new BreakEnv();
|
||||||
|
env.startLabel = check;
|
||||||
|
env.endLabel = end;
|
||||||
|
|
||||||
|
mv.visitLabel(start);
|
||||||
|
state.breakStack.push(env);
|
||||||
|
generate(state, _do.body());
|
||||||
|
state.breakStack.pop();
|
||||||
|
|
||||||
|
mv.visitLabel(check);
|
||||||
|
generate(state, _do.cond());
|
||||||
|
mv.visitJumpInsn(IFEQ, end);
|
||||||
|
mv.visitJumpInsn(GOTO, start);
|
||||||
|
mv.visitLabel(end);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case TargetIf _if: {
|
case TargetIf _if: {
|
||||||
generate(state, _if.cond());
|
generate(state, _if.cond());
|
||||||
Label _else = new Label();
|
Label _else = new Label();
|
||||||
@@ -962,13 +1068,17 @@ public class Codegen {
|
|||||||
}
|
}
|
||||||
case TargetReturn ret: {
|
case TargetReturn ret: {
|
||||||
if (ret.expression() != null && state.returnType != null) {
|
if (ret.expression() != null && state.returnType != null) {
|
||||||
var ctype = state.contextType;
|
if (state.returnType instanceof TargetPrimitiveType) {
|
||||||
state.contextType = state.returnType;
|
generate(state, ret.expression());
|
||||||
generate(state, ret.expression());
|
|
||||||
state.contextType = ctype;
|
unboxPrimitive(state, state.returnType);
|
||||||
boxPrimitive(state, ret.expression().type());
|
mv.visitInsn(findReturnCode(state.returnType));
|
||||||
convertTo(state, ret.expression().type(), state.returnType);
|
} else {
|
||||||
mv.visitInsn(ARETURN);
|
generate(state, ret.expression());
|
||||||
|
boxPrimitive(state, ret.expression().type());
|
||||||
|
convertTo(state, ret.expression().type(), state.returnType);
|
||||||
|
mv.visitInsn(ARETURN);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
mv.visitInsn(RETURN);
|
mv.visitInsn(RETURN);
|
||||||
break;
|
break;
|
||||||
@@ -1008,23 +1118,28 @@ public class Codegen {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetMethodCall call: {
|
case TargetMethodCall call: {
|
||||||
if (!call.isStatic())
|
if (!call.isStatic()) {
|
||||||
generate(state, call.expr());
|
generate(state, call.expr());
|
||||||
|
boxPrimitive(state, call.expr().type());
|
||||||
|
}
|
||||||
for (var i = 0; i < call.args().size(); i++) {
|
for (var i = 0; i < call.args().size(); i++) {
|
||||||
var e = call.args().get(i);
|
var e = call.args().get(i);
|
||||||
var arg = call.parameterTypes().get(i);
|
var arg = call.parameterTypes().get(i);
|
||||||
var ctype = state.contextType;
|
|
||||||
state.contextType = arg;
|
|
||||||
generate(state, e);
|
generate(state, e);
|
||||||
|
convertTo(state, e.type(), arg);
|
||||||
if (!(arg instanceof TargetPrimitiveType))
|
if (!(arg instanceof TargetPrimitiveType))
|
||||||
boxPrimitive(state, e.type());
|
boxPrimitive(state, e.type());
|
||||||
state.contextType = ctype;
|
|
||||||
}
|
}
|
||||||
var descriptor = call.getDescriptor();
|
var descriptor = call.getDescriptor();
|
||||||
if (call.owner() instanceof TargetFunNType) // Decay FunN
|
if (call.owner() instanceof TargetFunNType) // Decay FunN
|
||||||
descriptor = TargetMethod.getDescriptor(call.returnType() == null ? null : TargetType.Object, call.parameterTypes().stream().map(x -> TargetType.Object).toArray(TargetType[]::new));
|
descriptor = TargetMethod.getDescriptor(call.returnType() == null ? null : TargetType.Object, call.parameterTypes().stream().map(x -> TargetType.Object).toArray(TargetType[]::new));
|
||||||
|
|
||||||
mv.visitMethodInsn(call.isInterface() ? INVOKEINTERFACE : call.isStatic() ? INVOKESTATIC : call.name().equals("<init>") ? INVOKESPECIAL : INVOKEVIRTUAL, call.owner().getInternalName(), call.name(), descriptor, call.isInterface());
|
int insn = INVOKEVIRTUAL;
|
||||||
|
if (call.isStatic()) insn = INVOKESTATIC;
|
||||||
|
else if (call.isInterface()) insn = INVOKEINTERFACE;
|
||||||
|
else if (call.name().equals("<init>") || call.expr() instanceof TargetSuper || call.isPrivate()) insn = INVOKESPECIAL;
|
||||||
|
|
||||||
|
mv.visitMethodInsn(insn, call.owner().getInternalName(), call.name(), descriptor, call.isInterface());
|
||||||
|
|
||||||
if (call.type() != null && call.returnType() != null && !(call.returnType() instanceof TargetPrimitiveType)) {
|
if (call.type() != null && call.returnType() != null && !(call.returnType() instanceof TargetPrimitiveType)) {
|
||||||
if (!call.returnType().equals(call.type()) && !(call.type() instanceof TargetGenericType))
|
if (!call.returnType().equals(call.type()) && !(call.type() instanceof TargetGenericType))
|
||||||
@@ -1051,6 +1166,20 @@ public class Codegen {
|
|||||||
mv.visitInsn(ATHROW);
|
mv.visitInsn(ATHROW);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case TargetTernary ternary: {
|
||||||
|
generate(state, ternary.cond());
|
||||||
|
var iffalse = new Label();
|
||||||
|
var end = new Label();
|
||||||
|
mv.visitJumpInsn(IFEQ, iffalse);
|
||||||
|
generate(state, ternary.iftrue());
|
||||||
|
convertTo(state, ternary.iftrue().type(), ternary.type());
|
||||||
|
mv.visitJumpInsn(GOTO, end);
|
||||||
|
mv.visitLabel(iffalse);
|
||||||
|
generate(state, ternary.iffalse());
|
||||||
|
convertTo(state, ternary.iffalse().type(), ternary.type());
|
||||||
|
mv.visitLabel(end);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
throw new CodeGenException("Unexpected value: " + expr);
|
throw new CodeGenException("Unexpected value: " + expr);
|
||||||
}
|
}
|
||||||
@@ -1185,8 +1314,7 @@ public class Codegen {
|
|||||||
state.enterScope();
|
state.enterScope();
|
||||||
// This is the index to start the switch from
|
// This is the index to start the switch from
|
||||||
mv.visitInsn(ICONST_0);
|
mv.visitInsn(ICONST_0);
|
||||||
if (aSwitch.isExpression())
|
state.pushSwitch();
|
||||||
state.pushSwitch();
|
|
||||||
|
|
||||||
// To be able to skip ahead to the next case
|
// To be able to skip ahead to the next case
|
||||||
var start = new Label();
|
var start = new Label();
|
||||||
@@ -1200,16 +1328,17 @@ public class Codegen {
|
|||||||
var mt = MethodType.methodType(CallSite.class, MethodHandles.Lookup.class, String.class, MethodType.class, Object[].class);
|
var mt = MethodType.methodType(CallSite.class, MethodHandles.Lookup.class, String.class, MethodType.class, Object[].class);
|
||||||
var bootstrap = new Handle(H_INVOKESTATIC, "java/lang/runtime/SwitchBootstraps", "typeSwitch", mt.toMethodDescriptorString(), false);
|
var bootstrap = new Handle(H_INVOKESTATIC, "java/lang/runtime/SwitchBootstraps", "typeSwitch", mt.toMethodDescriptorString(), false);
|
||||||
|
|
||||||
var types = new ArrayList<Object>(aSwitch.cases().size());
|
var types = new ArrayList<>(aSwitch.cases().size());
|
||||||
for (var cse : aSwitch.cases()) for (var label : cse.labels()) {
|
for (var cse : aSwitch.cases()) for (var label : cse.labels()) {
|
||||||
if (label instanceof TargetTypePattern || label instanceof TargetComplexPattern)
|
if (label instanceof TargetTypePattern || label instanceof TargetComplexPattern) {
|
||||||
types.add(Type.getObjectType(label.type().getInternalName()));
|
if (label.type() instanceof TargetGenericType) types.add(Type.getType(Object.class));
|
||||||
else if (label instanceof TargetLiteral lit)
|
else types.add(Type.getObjectType(label.type().getInternalName()));
|
||||||
|
} else if (label instanceof TargetLiteral lit) {
|
||||||
types.add(lit.value());
|
types.add(lit.value());
|
||||||
else if (label instanceof TargetGuard guard)
|
} else if (label instanceof TargetGuard guard) {
|
||||||
types.add(Type.getObjectType(guard.inner().type().getInternalName()));
|
types.add(Type.getObjectType(guard.inner().type().getInternalName()));
|
||||||
// TODO Same here we need to evaluate constant;
|
// TODO Same here we need to evaluate constant;
|
||||||
else {
|
} else {
|
||||||
System.out.println(label);
|
System.out.println(label);
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
@@ -1230,11 +1359,7 @@ public class Codegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var defaultLabel = end;
|
var defaultLabel = new Label();
|
||||||
if (aSwitch.default_() != null) {
|
|
||||||
defaultLabel = new Label();
|
|
||||||
}
|
|
||||||
|
|
||||||
mv.visitTableSwitchInsn(0, labels.length - 1, defaultLabel, labels);
|
mv.visitTableSwitchInsn(0, labels.length - 1, defaultLabel, labels);
|
||||||
|
|
||||||
for (var i = 0; i < aSwitch.cases().size(); i++) {
|
for (var i = 0; i < aSwitch.cases().size(); i++) {
|
||||||
@@ -1269,11 +1394,18 @@ public class Codegen {
|
|||||||
if (aSwitch.isExpression()) mv.visitJumpInsn(GOTO, end);
|
if (aSwitch.isExpression()) mv.visitJumpInsn(GOTO, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mv.visitLabel(defaultLabel);
|
||||||
if (aSwitch.default_() != null) {
|
if (aSwitch.default_() != null) {
|
||||||
mv.visitLabel(defaultLabel);
|
|
||||||
generate(state, aSwitch.default_().body());
|
generate(state, aSwitch.default_().body());
|
||||||
if (aSwitch.default_().isSingleExpression() && aSwitch.isExpression())
|
if (aSwitch.default_().isSingleExpression() && aSwitch.isExpression())
|
||||||
yieldValue(state, aSwitch.default_().body().statements().get(0).type());
|
yieldValue(state, aSwitch.default_().body().statements().get(0).type());
|
||||||
|
} else {
|
||||||
|
// throw illegal argument exception on missing default case
|
||||||
|
mv.visitTypeInsn(NEW, "java/lang/IllegalArgumentException");
|
||||||
|
mv.visitInsn(DUP);
|
||||||
|
mv.visitLdcInsn("Unhandled case value");
|
||||||
|
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/IllegalArgumentException", "<init>", "(Ljava/lang/String;)V", false);
|
||||||
|
mv.visitInsn(ATHROW);
|
||||||
}
|
}
|
||||||
|
|
||||||
mv.visitLabel(end);
|
mv.visitLabel(end);
|
||||||
@@ -1281,8 +1413,10 @@ public class Codegen {
|
|||||||
|
|
||||||
state.breakStack.pop();
|
state.breakStack.pop();
|
||||||
if (aSwitch.isExpression()) {
|
if (aSwitch.isExpression()) {
|
||||||
mv.visitVarInsn(ALOAD, state.switchResultValue.peek());
|
if (aSwitch.type() != null) {
|
||||||
unboxPrimitive(state, aSwitch.type());
|
mv.visitVarInsn(ALOAD, state.switchResultValue.peek());
|
||||||
|
unboxPrimitive(state, aSwitch.type());
|
||||||
|
}
|
||||||
state.popSwitch();
|
state.popSwitch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1293,7 +1427,7 @@ public class Codegen {
|
|||||||
if (i >= clazz.getFieldDecl().size())
|
if (i >= clazz.getFieldDecl().size())
|
||||||
throw new CodeGenException("Couldn't find suitable field accessor for '" + type.name() + "'");
|
throw new CodeGenException("Couldn't find suitable field accessor for '" + type.name() + "'");
|
||||||
var field = clazz.getFieldDecl().get(i);
|
var field = clazz.getFieldDecl().get(i);
|
||||||
var fieldType = new TargetRefType(((RefType) field.getType()).getName().toString());
|
var fieldType = converter.convert(field.getType());
|
||||||
state.mv.visitMethodInsn(INVOKEVIRTUAL, type.getInternalName(), field.getName(), "()" + fieldType.toDescriptor(), false);
|
state.mv.visitMethodInsn(INVOKEVIRTUAL, type.getInternalName(), field.getName(), "()" + fieldType.toDescriptor(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1301,22 +1435,42 @@ public class Codegen {
|
|||||||
if (pat.type() instanceof TargetPrimitiveType)
|
if (pat.type() instanceof TargetPrimitiveType)
|
||||||
boxPrimitive(state, pat.type());
|
boxPrimitive(state, pat.type());
|
||||||
|
|
||||||
state.mv.visitInsn(DUP);
|
if (pat.type() instanceof TargetRefType) {
|
||||||
state.mv.visitTypeInsn(INSTANCEOF, pat.type().getInternalName());
|
state.mv.visitInsn(DUP);
|
||||||
|
state.mv.visitTypeInsn(INSTANCEOF, pat.type().getInternalName());
|
||||||
|
|
||||||
var cont = new Label();
|
var cont = new Label();
|
||||||
state.mv.visitJumpInsn(IFNE, cont);
|
state.mv.visitJumpInsn(IFNE, cont);
|
||||||
for (var i = 0; i < depth; i++) {
|
for (var i = 0; i < depth; i++) {
|
||||||
state.mv.visitInsn(POP);
|
state.mv.visitInsn(POP);
|
||||||
|
}
|
||||||
|
|
||||||
|
state.mv.visitVarInsn(ALOAD, state.switchResultValue.peek());
|
||||||
|
state.mv.visitLdcInsn(index + 1);
|
||||||
|
state.mv.visitJumpInsn(GOTO, start);
|
||||||
|
state.mv.visitLabel(cont);
|
||||||
|
|
||||||
|
state.mv.visitTypeInsn(CHECKCAST, pat.type().getInternalName());
|
||||||
}
|
}
|
||||||
state.mv.visitVarInsn(ALOAD, state.switchResultValue.peek());
|
|
||||||
state.mv.visitLdcInsn(index + 1);
|
|
||||||
state.mv.visitJumpInsn(GOTO, start);
|
|
||||||
state.mv.visitLabel(cont);
|
|
||||||
|
|
||||||
state.mv.visitTypeInsn(CHECKCAST, pat.type().getInternalName());
|
if (pat instanceof TargetExpressionPattern ep) {
|
||||||
|
var cur = state.createVariable(pat.type());
|
||||||
|
state.mv.visitVarInsn(ASTORE, cur.index);
|
||||||
|
|
||||||
if (pat instanceof TargetTypePattern sp) {
|
var expr = new Equal(pat.type(), new TargetLocalVar(cur.type, cur.name), ep.expression());
|
||||||
|
generate(state, expr);
|
||||||
|
|
||||||
|
var cont = new Label();
|
||||||
|
state.mv.visitJumpInsn(IFNE, cont);
|
||||||
|
for (var i = 0; i < depth - 1; i++) {
|
||||||
|
state.mv.visitInsn(POP);
|
||||||
|
}
|
||||||
|
|
||||||
|
state.mv.visitVarInsn(ALOAD, state.switchResultValue.peek());
|
||||||
|
state.mv.visitLdcInsn(index + 1);
|
||||||
|
state.mv.visitJumpInsn(GOTO, start);
|
||||||
|
state.mv.visitLabel(cont);
|
||||||
|
} else if (pat instanceof TargetTypePattern sp) {
|
||||||
var local = state.createVariable(sp.name(), sp.type());
|
var local = state.createVariable(sp.name(), sp.type());
|
||||||
state.mv.visitVarInsn(ASTORE, local.index);
|
state.mv.visitVarInsn(ASTORE, local.index);
|
||||||
} else if (pat instanceof TargetComplexPattern cp) {
|
} else if (pat instanceof TargetComplexPattern cp) {
|
||||||
@@ -1331,10 +1485,27 @@ public class Codegen {
|
|||||||
// TODO Check if class is a Record
|
// TODO Check if class is a Record
|
||||||
|
|
||||||
for (var i = 0; i < cp.subPatterns().size(); i++) {
|
for (var i = 0; i < cp.subPatterns().size(); i++) {
|
||||||
state.mv.visitInsn(DUP);
|
|
||||||
|
|
||||||
var subPattern = cp.subPatterns().get(i);
|
var subPattern = cp.subPatterns().get(i);
|
||||||
|
|
||||||
|
state.mv.visitInsn(DUP);
|
||||||
extractField(state, cp.type(), i, clazz);
|
extractField(state, cp.type(), i, clazz);
|
||||||
|
|
||||||
|
if (subPattern.type() instanceof TargetRefType || subPattern.type() instanceof TargetExtendsWildcard) {
|
||||||
|
state.mv.visitInsn(DUP);
|
||||||
|
state.mv.visitTypeInsn(INSTANCEOF, subPattern.type().getInternalName());
|
||||||
|
|
||||||
|
var cont = new Label();
|
||||||
|
state.mv.visitJumpInsn(IFNE, cont);
|
||||||
|
for (var j = 0; j < depth + 1; j++) {
|
||||||
|
state.mv.visitInsn(POP);
|
||||||
|
}
|
||||||
|
|
||||||
|
state.mv.visitVarInsn(ALOAD, state.switchResultValue.peek());
|
||||||
|
state.mv.visitLdcInsn(index + 1);
|
||||||
|
state.mv.visitJumpInsn(GOTO, start);
|
||||||
|
state.mv.visitLabel(cont);
|
||||||
|
}
|
||||||
|
|
||||||
bindPattern(state, subPattern.type(), subPattern, start, index, depth + 1);
|
bindPattern(state, subPattern.type(), subPattern, start, index, depth + 1);
|
||||||
}
|
}
|
||||||
state.mv.visitInsn(POP);
|
state.mv.visitInsn(POP);
|
||||||
@@ -1362,14 +1533,14 @@ public class Codegen {
|
|||||||
//if ((access & ACC_PRIVATE) == 0 && (access & ACC_PROTECTED) == 0) // TODO Implement access modifiers properly
|
//if ((access & ACC_PRIVATE) == 0 && (access & ACC_PROTECTED) == 0) // TODO Implement access modifiers properly
|
||||||
// access |= ACC_PUBLIC;
|
// access |= ACC_PUBLIC;
|
||||||
|
|
||||||
cw.visitField(access, field.name(), field.type().toSignature(), field.type().toDescriptor(), null);
|
cw.visitField(access, field.name(), field.type().toDescriptor(), field.type().toSignature(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateStaticConstructor(TargetMethod constructor) {
|
private void generateStaticConstructor(TargetMethod constructor) {
|
||||||
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "<clinit>", "()V", null, null);
|
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "<clinit>", "()V", null, null);
|
||||||
mv.visitCode();
|
mv.visitCode();
|
||||||
|
|
||||||
var state = new State(null, mv, 0);
|
var state = new State(null, mv, 0, true);
|
||||||
generate(state, constructor.block());
|
generate(state, constructor.block());
|
||||||
|
|
||||||
mv.visitInsn(RETURN);
|
mv.visitInsn(RETURN);
|
||||||
@@ -1383,7 +1554,7 @@ public class Codegen {
|
|||||||
mv.visitAttribute(new JavaTXSignatureAttribute(constructor.getTXSignature()));
|
mv.visitAttribute(new JavaTXSignatureAttribute(constructor.getTXSignature()));
|
||||||
|
|
||||||
mv.visitCode();
|
mv.visitCode();
|
||||||
var state = new State(null, mv, 1);
|
var state = new State(null, mv, 1, false);
|
||||||
for (var param : constructor.parameters()) {
|
for (var param : constructor.parameters()) {
|
||||||
var pattern = param.pattern();
|
var pattern = param.pattern();
|
||||||
if (pattern instanceof TargetTypePattern tp)
|
if (pattern instanceof TargetTypePattern tp)
|
||||||
@@ -1407,33 +1578,53 @@ public class Codegen {
|
|||||||
mv.visitEnd();
|
mv.visitEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int bindLocalVariables(State state, TargetPattern pattern, int offset, int field) {
|
private void bindLocalVariables(State state, TargetComplexPattern cp, int offset) {
|
||||||
if (pattern instanceof TargetComplexPattern cp) {
|
state.mv.visitVarInsn(ALOAD, offset);
|
||||||
state.mv.visitVarInsn(ALOAD, offset);
|
|
||||||
|
|
||||||
var clazz = findClass(new JavaClassName(cp.type().name()));
|
var clazz = findClass(new JavaClassName(cp.type().name()));
|
||||||
if (clazz == null) throw new CodeGenException("Class definition for '" + cp.type().name() + "' not found");
|
if (clazz == null) throw new CodeGenException("Class definition for '" + cp.type().name() + "' not found");
|
||||||
|
|
||||||
for (var i = 0; i < cp.subPatterns().size(); i++) {
|
for (var i = 0; i < cp.subPatterns().size(); i++) {
|
||||||
var subPattern = cp.subPatterns().get(i);
|
var subPattern = cp.subPatterns().get(i);
|
||||||
|
|
||||||
if (i < cp.subPatterns().size() - 1)
|
if (i < cp.subPatterns().size() - 1)
|
||||||
state.mv.visitInsn(DUP);
|
state.mv.visitInsn(DUP);
|
||||||
|
|
||||||
extractField(state, cp.type(), i, clazz);
|
extractField(state, cp.type(), i, clazz);
|
||||||
|
if (subPattern.type() instanceof TargetRefType)
|
||||||
state.mv.visitTypeInsn(CHECKCAST, subPattern.type().getInternalName());
|
state.mv.visitTypeInsn(CHECKCAST, subPattern.type().getInternalName());
|
||||||
state.mv.visitVarInsn(ASTORE, offset);
|
offset = state.createVariable(subPattern.name(), subPattern.type()).index;
|
||||||
offset = bindLocalVariables(state, subPattern, offset, i);
|
state.mv.visitVarInsn(ASTORE, offset);
|
||||||
|
if (subPattern instanceof TargetComplexPattern cp2) {
|
||||||
|
bindLocalVariables(state, cp2, offset);
|
||||||
}
|
}
|
||||||
} else if (pattern instanceof TargetTypePattern tp) {
|
}
|
||||||
offset++;
|
}
|
||||||
state.createVariable(tp.name(), tp.type());
|
private void generateMethod(TargetMethod method) {
|
||||||
} else throw new NotImplementedException();
|
generateMethod(method, null);
|
||||||
return offset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateMethod(TargetMethod method) {
|
private void generateMainMethod() {
|
||||||
|
var mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "main", "([Ljava/lang/String;)V", null, null);
|
||||||
|
mv.visitCode();
|
||||||
|
mv.visitVarInsn(ALOAD, 0);
|
||||||
|
mv.visitMethodInsn(INVOKESTATIC, "java/util/List", "of", "([Ljava/lang/Object;)Ljava/util/List;", true);
|
||||||
|
mv.visitMethodInsn(INVOKESTATIC, new TargetRefType(clazz.qualifiedName().toString()).getInternalName(), "main", "(Ljava/util/List;)V", false);
|
||||||
|
mv.visitInsn(RETURN);
|
||||||
|
mv.visitMaxs(0, 0);
|
||||||
|
mv.visitEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void generateMethod(TargetMethod method, State parent) {
|
||||||
var access = method.access();
|
var access = method.access();
|
||||||
|
|
||||||
|
var params = method.signature().parameters();
|
||||||
|
if (method.name().equals("main") && method.isStatic() && params.size() == 1 &&
|
||||||
|
params.getFirst().pattern().type().equals(new TargetRefType("java.util.List", List.of(new TargetRefType("java.lang.String"))))) {
|
||||||
|
|
||||||
|
generateMainMethod();
|
||||||
|
}
|
||||||
|
|
||||||
if (method.block() == null)
|
if (method.block() == null)
|
||||||
access |= ACC_ABSTRACT;
|
access |= ACC_ABSTRACT;
|
||||||
if (clazz instanceof TargetInterface)
|
if (clazz instanceof TargetInterface)
|
||||||
@@ -1447,10 +1638,21 @@ public class Codegen {
|
|||||||
|
|
||||||
if (method.block() != null) {
|
if (method.block() != null) {
|
||||||
mv.visitCode();
|
mv.visitCode();
|
||||||
var state = new State(method.signature().returnType(), mv, method.isStatic() ? 0 : 1);
|
var state = new State(method.signature().returnType(), mv, method.isStatic() ? 0 : 1, method.isStatic());
|
||||||
for (var param : method.signature().parameters()) {
|
if (parent != null) {
|
||||||
bindLocalVariables(state, param.pattern(), 1, 0);
|
state.scope.parent = parent.scope;
|
||||||
}
|
}
|
||||||
|
var offset = 1;
|
||||||
|
for (var param : method.signature().parameters()) {
|
||||||
|
state.createVariable(param.pattern().name(), param.pattern().type());
|
||||||
|
}
|
||||||
|
for (var param : method.signature().parameters()) {
|
||||||
|
if (param.pattern() instanceof TargetComplexPattern cp)
|
||||||
|
bindLocalVariables(state, cp, offset);
|
||||||
|
offset++;
|
||||||
|
}
|
||||||
|
//if (parent != null) System.out.println("parent: " + parent.scope.locals.keySet());
|
||||||
|
//System.out.println(state.scope.locals.keySet());
|
||||||
generate(state, method.block());
|
generate(state, method.block());
|
||||||
if (method.signature().returnType() == null)
|
if (method.signature().returnType() == null)
|
||||||
mv.visitInsn(RETURN);
|
mv.visitInsn(RETURN);
|
||||||
@@ -1464,12 +1666,12 @@ public class Codegen {
|
|||||||
if (!generics.isEmpty()) {
|
if (!generics.isEmpty()) {
|
||||||
ret += "<";
|
ret += "<";
|
||||||
for (var generic : generics) {
|
for (var generic : generics) {
|
||||||
ret += generic.name() + ":" + generic.bound().toDescriptor();
|
ret += generic.name() + ":" + generic.bound().toSignature();
|
||||||
}
|
}
|
||||||
ret += ">";
|
ret += ">";
|
||||||
}
|
}
|
||||||
if (clazz.superType() != null)
|
if (clazz.superType() != null)
|
||||||
ret += clazz.superType().toDescriptor();
|
ret += clazz.superType().toSignature();
|
||||||
for (var intf : clazz.implementingInterfaces()) {
|
for (var intf : clazz.implementingInterfaces()) {
|
||||||
ret += intf.toSignature();
|
ret += intf.toSignature();
|
||||||
}
|
}
|
||||||
@@ -1484,13 +1686,26 @@ public class Codegen {
|
|||||||
if (!(clazz instanceof TargetInterface))
|
if (!(clazz instanceof TargetInterface))
|
||||||
access |= ACC_SUPER;
|
access |= ACC_SUPER;
|
||||||
|
|
||||||
|
// Check sealed
|
||||||
|
for (var intf : clazz.implementingInterfaces()) {
|
||||||
|
var intfClass = compiler.getClass(new JavaClassName(intf.name()));
|
||||||
|
if (intfClass.isSealed()) {
|
||||||
|
if (intfClass.getPermittedSubtypes().stream().noneMatch(type -> type.getName().equals(new JavaClassName(className)))) {
|
||||||
|
throw new CodeGenException("Sealed interface " + intfClass.getClassName() + " doesn't permit class " + className);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var signature = generateSignature(clazz, clazz.generics());
|
var signature = generateSignature(clazz, clazz.generics());
|
||||||
var interfaces = clazz.implementingInterfaces().stream().map(TargetType::getInternalName).toArray(String[]::new);
|
var interfaces = clazz.implementingInterfaces().stream().map(TargetType::getInternalName).toArray(String[]::new);
|
||||||
var superType = clazz.superType() != null ? clazz.superType().getInternalName() : "java/lang/Object";
|
var superType = clazz.superType() != null ? clazz.superType().getInternalName() : "java/lang/Object";
|
||||||
|
|
||||||
cw.visit(V1_8, access, clazz.qualifiedName().toString().replaceAll("\\.", "/"), signature, superType, interfaces);
|
cw.visit(V1_8, access, clazz.qualifiedName().toString().replaceAll("\\.", "/"), signature, superType, interfaces);
|
||||||
if (clazz.txGenerics() != null && signature != null)
|
if (clazz.txGenerics() != null && signature != null) {
|
||||||
cw.visitAttribute(new JavaTXSignatureAttribute(generateSignature(clazz, clazz.txGenerics())));
|
var txSignature = generateSignature(clazz, clazz.txGenerics());
|
||||||
|
if (txSignature != null)
|
||||||
|
cw.visitAttribute(new JavaTXSignatureAttribute(txSignature));
|
||||||
|
}
|
||||||
|
|
||||||
clazz.fields().forEach(this::generateField);
|
clazz.fields().forEach(this::generateField);
|
||||||
clazz.constructors().forEach(this::generateConstructor);
|
clazz.constructors().forEach(this::generateConstructor);
|
||||||
@@ -1502,6 +1717,85 @@ public class Codegen {
|
|||||||
if (clazz instanceof TargetRecord)
|
if (clazz instanceof TargetRecord)
|
||||||
generateRecordMethods();
|
generateRecordMethods();
|
||||||
|
|
||||||
|
// Generate wrapper classes for function types
|
||||||
|
for (var pair : funWrapperClasses.keySet()) {
|
||||||
|
var className = funWrapperClasses.get(pair);
|
||||||
|
ClassWriter cw2 = new CustomClassWriter();
|
||||||
|
cw2.visit(V1_8, ACC_PUBLIC, className, null, "java/lang/Object", new String[] { pair.to.getInternalName() });
|
||||||
|
cw2.visitField(ACC_PRIVATE, "wrapped", pair.from.toDescriptor(), null, null).visitEnd();
|
||||||
|
|
||||||
|
// Generate constructor
|
||||||
|
var ctor = cw2.visitMethod(ACC_PUBLIC, "<init>", "(" + pair.from.toDescriptor() + ")V", null, null);
|
||||||
|
ctor.visitVarInsn(ALOAD, 0);
|
||||||
|
ctor.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
|
||||||
|
ctor.visitVarInsn(ALOAD, 0);
|
||||||
|
ctor.visitVarInsn(ALOAD, 1);
|
||||||
|
ctor.visitFieldInsn(PUTFIELD, className, "wrapped", pair.from.toDescriptor());
|
||||||
|
ctor.visitInsn(RETURN);
|
||||||
|
ctor.visitMaxs(0, 0);
|
||||||
|
ctor.visitEnd();
|
||||||
|
|
||||||
|
String methodName = "apply";
|
||||||
|
String fromDescriptor = null;
|
||||||
|
TargetType fromReturn = null;
|
||||||
|
if (!(pair.from instanceof TargetFunNType funNType)) {
|
||||||
|
var fromClass = compiler.getClass(new JavaClassName(pair.from.name()));
|
||||||
|
var fromMethod = fromClass.getMethods().stream().filter(m -> (m.modifier & ACC_ABSTRACT) != 0).findFirst().orElseThrow();
|
||||||
|
methodName = fromMethod.name;
|
||||||
|
|
||||||
|
fromReturn = converter.convert(fromMethod.getReturnType());
|
||||||
|
var fromParams = converter.convert(fromMethod.getParameterList(), converter.generics.javaGenerics()).stream().map(m -> m.pattern().type()).toArray(TargetType[]::new);
|
||||||
|
fromDescriptor = TargetMethod.getDescriptor(fromReturn, fromParams);
|
||||||
|
} else {
|
||||||
|
fromReturn = funNType.returnArguments() > 0 ? TargetType.Object : null;
|
||||||
|
fromDescriptor = funNType.toMethodDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
var toClass = compiler.getClass(new JavaClassName(pair.to.name()));
|
||||||
|
var toMethod = toClass.getMethods().stream().filter(m -> (m.modifier & ACC_ABSTRACT) != 0).findFirst().orElseThrow();
|
||||||
|
var toReturn = converter.convert(toMethod.getReturnType());
|
||||||
|
var toParams = converter.convert(toMethod.getParameterList(), converter.generics.javaGenerics()).stream().map(m -> m.pattern().type()).toArray(TargetType[]::new);
|
||||||
|
var toDescriptor = TargetMethod.getDescriptor(toReturn, toParams);
|
||||||
|
|
||||||
|
// Generate wrapper method
|
||||||
|
var mv = cw2.visitMethod(ACC_PUBLIC, toMethod.name, toDescriptor, null, null);
|
||||||
|
var state = new State(null, mv, 0, false);
|
||||||
|
|
||||||
|
mv.visitVarInsn(ALOAD, 0);
|
||||||
|
mv.visitFieldInsn(GETFIELD, className, "wrapped", pair.from.toDescriptor());
|
||||||
|
for (var i = 0; i < toParams.length; i++) {
|
||||||
|
var arg = toParams[i];
|
||||||
|
mv.visitVarInsn(findLoadCode(arg), i + 1);
|
||||||
|
}
|
||||||
|
mv.visitMethodInsn(INVOKEINTERFACE, pair.from.getInternalName(), methodName, fromDescriptor, true);
|
||||||
|
if (fromReturn != null) {
|
||||||
|
if (toReturn instanceof TargetPrimitiveType) {
|
||||||
|
convertTo(state, fromReturn, TargetType.toWrapper(toReturn));
|
||||||
|
} else convertTo(state, fromReturn, toReturn);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toReturn != null)
|
||||||
|
mv.visitInsn(findReturnCode(toReturn));
|
||||||
|
|
||||||
|
else mv.visitInsn(RETURN);
|
||||||
|
mv.visitMaxs(0, 0);
|
||||||
|
mv.visitEnd();
|
||||||
|
|
||||||
|
cw2.visitEnd();
|
||||||
|
var bytes = cw2.toByteArray();
|
||||||
|
compiler.auxiliaries.put(className, bytes);
|
||||||
|
|
||||||
|
// TODO These class loading shenanigans happen in a few places, the tests load the classes individually.
|
||||||
|
// Instead we should just look at the folder.
|
||||||
|
try {
|
||||||
|
converter.classLoader.findClass(className);
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
try {
|
||||||
|
converter.classLoader.loadClass(className, bytes);
|
||||||
|
} catch (LinkageError ignored) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cw.visitEnd();
|
cw.visitEnd();
|
||||||
return cw.toByteArray();
|
return cw.toByteArray();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package de.dhbwstuttgart.bytecode;
|
package de.dhbwstuttgart.bytecode;
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.syntaxtree.statement.Break;
|
||||||
import de.dhbwstuttgart.target.tree.TargetGeneric;
|
import de.dhbwstuttgart.target.tree.TargetGeneric;
|
||||||
import de.dhbwstuttgart.target.tree.type.*;
|
import de.dhbwstuttgart.target.tree.type.*;
|
||||||
import org.objectweb.asm.ClassWriter;
|
import org.objectweb.asm.ClassWriter;
|
||||||
import org.objectweb.asm.MethodVisitor;
|
import org.objectweb.asm.MethodVisitor;
|
||||||
import org.objectweb.asm.Type;
|
import org.objectweb.asm.Type;
|
||||||
|
|
||||||
|
import java.sql.Array;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -33,6 +35,40 @@ public class FunNGenerator {
|
|||||||
public static class GenericParameters {
|
public static class GenericParameters {
|
||||||
int start;
|
int start;
|
||||||
public List<TargetType> parameters = new ArrayList<>();
|
public List<TargetType> parameters = new ArrayList<>();
|
||||||
|
final String descriptor;
|
||||||
|
public final List<TargetType> inParams;
|
||||||
|
public final List<TargetType> realParams;
|
||||||
|
|
||||||
|
public GenericParameters(TargetFunNType funNType) {
|
||||||
|
this(funNType.funNParams(), funNType.returnArguments());
|
||||||
|
}
|
||||||
|
|
||||||
|
public GenericParameters(List<TargetType> params, int numReturns) {
|
||||||
|
this.realParams = params;
|
||||||
|
this.inParams = flattenTypeParams(params);
|
||||||
|
var type = new TargetRefType(FunNGenerator.getSuperClassName(params.size() - 1, numReturns), params);
|
||||||
|
descriptor = applyDescriptor(type, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<TargetType> flattenTypeParams(List<TargetType> params) {
|
||||||
|
var res = new ArrayList<TargetType>();
|
||||||
|
for (var param : params) {
|
||||||
|
if (param instanceof TargetSpecializedType tspec) {
|
||||||
|
res.addAll(flattenTypeParams(tspec.params()));
|
||||||
|
} else {
|
||||||
|
res.add(param);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TargetType getReturnType() {
|
||||||
|
return FunNGenerator.getReturnType(realParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TargetType> getArguments() {
|
||||||
|
return FunNGenerator.getArguments(realParams);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String applyDescriptor(TargetType type, GenericParameters gep) {
|
private static String applyDescriptor(TargetType type, GenericParameters gep) {
|
||||||
@@ -62,14 +98,14 @@ public class FunNGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String applySignature(TargetType a) { return a.toSignature(); }
|
private static String applySignature(TargetType a) { return a.toSignature(); }
|
||||||
private static String applyNameDescriptor(TargetType a){ return a instanceof TargetGenericType ? "LTPH;" : String.format("%s", applySignature(a)); }
|
private static String applyNameDescriptor(TargetType a){ return a instanceof TargetGenericType ? "LTPH;" : String.format("%s", a.toDescriptor()); }
|
||||||
|
|
||||||
public static String encodeType(TargetType type) {
|
public static String encodeType(TargetType type) {
|
||||||
if (type == null) return VOID;
|
if (type == null) return VOID;
|
||||||
return applyNameDescriptor(type).replace("/", "$").replace(";", "$_$");
|
return applyNameDescriptor(type).replace("/", "$").replace(";", "$_$");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] generateSuperBytecode(int numberArguments) {
|
public static byte[] generateSuperBytecode(int numberArguments, int numReturnTypes) {
|
||||||
StringBuilder superFunNClassSignature = new StringBuilder("<");
|
StringBuilder superFunNClassSignature = new StringBuilder("<");
|
||||||
StringBuilder superFunNMethodSignature = new StringBuilder("(");
|
StringBuilder superFunNMethodSignature = new StringBuilder("(");
|
||||||
StringBuilder superFunNMethodDescriptor = new StringBuilder("(");
|
StringBuilder superFunNMethodDescriptor = new StringBuilder("(");
|
||||||
@@ -80,30 +116,34 @@ public class FunNGenerator {
|
|||||||
superFunNMethodDescriptor.append(objectSignature);
|
superFunNMethodDescriptor.append(objectSignature);
|
||||||
}
|
}
|
||||||
superFunNClassSignature.append(String.format("%s:%s>%s", returnGeneric, objectSignature, objectSignature));
|
superFunNClassSignature.append(String.format("%s:%s>%s", returnGeneric, objectSignature, objectSignature));
|
||||||
superFunNMethodSignature.append(String.format(")T%s;", returnGeneric));
|
if (numReturnTypes > 0) {
|
||||||
superFunNMethodDescriptor.append(String.format(")%s", objectSignature));
|
superFunNMethodSignature.append(String.format(")T%s;", returnGeneric));
|
||||||
|
superFunNMethodDescriptor.append(String.format(")%s", objectSignature));
|
||||||
|
} else {
|
||||||
|
superFunNMethodSignature.append(")V");
|
||||||
|
superFunNMethodDescriptor.append(")V");
|
||||||
|
}
|
||||||
|
|
||||||
System.out.println(superFunNMethodSignature);
|
System.out.println(superFunNMethodSignature);
|
||||||
|
|
||||||
ClassWriter classWriter = new ClassWriter(0);
|
ClassWriter classWriter = new ClassWriter(0);
|
||||||
MethodVisitor methodVisitor;
|
MethodVisitor methodVisitor;
|
||||||
classWriter.visit(bytecodeVersion, ACC_PUBLIC | ACC_ABSTRACT | ACC_INTERFACE, getSuperClassName(numberArguments), superFunNClassSignature.toString(), objectSuperType, null);
|
classWriter.visit(bytecodeVersion, ACC_PUBLIC | ACC_ABSTRACT | ACC_INTERFACE, getSuperClassName(numberArguments, numReturnTypes), superFunNClassSignature.toString(), objectSuperType, null);
|
||||||
methodVisitor = classWriter.visitMethod(ACC_PUBLIC | ACC_ABSTRACT, methodName, superFunNMethodDescriptor.toString(), superFunNMethodSignature.toString(), null);
|
methodVisitor = classWriter.visitMethod(ACC_PUBLIC | ACC_ABSTRACT, methodName, superFunNMethodDescriptor.toString(), superFunNMethodSignature.toString(), null);
|
||||||
methodVisitor.visitEnd();
|
methodVisitor.visitEnd();
|
||||||
classWriter.visitEnd();
|
classWriter.visitEnd();
|
||||||
return classWriter.toByteArray();
|
return classWriter.toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getSuperClassName(int numberArguments) {
|
public static String getSuperClassName(int numberArguments, int returnArguments) {
|
||||||
return String.format("Fun%d$$", numberArguments);
|
return returnArguments > 0 ? String.format("Fun%d$$", numberArguments) : String.format("FunVoid%d$$", numberArguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] generateSpecializedBytecode(List<TargetType> argumentTypes, TargetType returnType, GenericParameters gep) {
|
public static byte[] generateSpecializedBytecode(GenericParameters gep, List<String> superInterfaces) {
|
||||||
List<TargetType> parameters = Stream
|
var argumentTypes = gep.getArguments();
|
||||||
.concat(argumentTypes.stream(), Stream.of(returnType))
|
var returnType = gep.getReturnType();
|
||||||
.toList();
|
|
||||||
|
|
||||||
StringBuilder funNClassSignature = new StringBuilder(objectSignature + applyDescriptor(new TargetRefType(getSuperClassName(argumentTypes.size()), parameters), gep));
|
StringBuilder funNClassSignature = new StringBuilder(objectSignature + gep.descriptor);
|
||||||
boolean containsGeneric = false;
|
boolean containsGeneric = false;
|
||||||
|
|
||||||
String genericSignature = "<";
|
String genericSignature = "<";
|
||||||
@@ -114,10 +154,18 @@ public class FunNGenerator {
|
|||||||
|
|
||||||
genericSignature += ">";
|
genericSignature += ">";
|
||||||
if (containsGeneric) funNClassSignature.insert(0, genericSignature);
|
if (containsGeneric) funNClassSignature.insert(0, genericSignature);
|
||||||
System.out.println(funNClassSignature.toString());
|
|
||||||
|
for (var superInterface : superInterfaces) {
|
||||||
|
funNClassSignature.append('L');
|
||||||
|
funNClassSignature.append(superInterface);
|
||||||
|
funNClassSignature.append(';');
|
||||||
|
}
|
||||||
|
|
||||||
|
var interfaces = new ArrayList<>(superInterfaces);
|
||||||
|
interfaces.add(getSuperClassName(argumentTypes.size(), returnType != null ? 1 : 0));
|
||||||
|
|
||||||
ClassWriter classWriter = new ClassWriter(0);
|
ClassWriter classWriter = new ClassWriter(0);
|
||||||
classWriter.visit(bytecodeVersion, ACC_PUBLIC | ACC_ABSTRACT | ACC_INTERFACE, getSpecializedClassName(argumentTypes, returnType), funNClassSignature.toString(), objectSuperType, new String[]{getSuperClassName(argumentTypes.size())});
|
classWriter.visit(bytecodeVersion, ACC_PUBLIC | ACC_ABSTRACT | ACC_INTERFACE, getSpecializedClassName(argumentTypes, returnType), funNClassSignature.toString(), objectSuperType, interfaces.toArray(String[]::new));
|
||||||
classWriter.visitEnd();
|
classWriter.visitEnd();
|
||||||
return classWriter.toByteArray();
|
return classWriter.toByteArray();
|
||||||
}
|
}
|
||||||
@@ -133,14 +181,24 @@ public class FunNGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getSpecializedClassName(GenericParameters gep) {
|
||||||
|
return getSpecializedClassName(gep.getArguments(), gep.getReturnType());
|
||||||
|
}
|
||||||
|
|
||||||
public static String getSpecializedClassName(List<TargetType> argumentTypes, TargetType returnType) {
|
public static String getSpecializedClassName(List<TargetType> argumentTypes, TargetType returnType) {
|
||||||
return String.format("Fun%d$$%s%s",
|
var arguments = argumentTypes
|
||||||
|
.stream()
|
||||||
|
.map(FunNGenerator::encodeType)
|
||||||
|
.collect(Collectors.joining());
|
||||||
|
|
||||||
|
if (returnType != null)
|
||||||
|
return String.format("Fun%d$$%s%s",
|
||||||
|
argumentTypes.size(),
|
||||||
|
arguments,
|
||||||
|
encodeType(returnType));
|
||||||
|
else return String.format("FunVoidImpl%d$$%s",
|
||||||
argumentTypes.size(),
|
argumentTypes.size(),
|
||||||
argumentTypes
|
arguments);
|
||||||
.stream()
|
|
||||||
.map(FunNGenerator::encodeType)
|
|
||||||
.collect(Collectors.joining()),
|
|
||||||
encodeType(returnType));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<TargetType> getArguments(List<TargetType> list) {
|
public static List<TargetType> getArguments(List<TargetType> list) {
|
||||||
@@ -151,8 +209,8 @@ public class FunNGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static TargetType getReturnType(List<TargetType> list) {
|
public static TargetType getReturnType(List<TargetType> list) {
|
||||||
if(list.size() == 0)
|
if(list.isEmpty())
|
||||||
throw new IndexOutOfBoundsException();
|
throw new IndexOutOfBoundsException();
|
||||||
return list.get(list.size() - 1);
|
return list.getLast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package de.dhbwstuttgart.core;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.io.PrintStream;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
public class ConsoleInterface {
|
public class ConsoleInterface {
|
||||||
private static final String directory = System.getProperty("user.dir");
|
private static final String directory = System.getProperty("user.dir");
|
||||||
@@ -35,9 +37,9 @@ public class ConsoleInterface {
|
|||||||
input.add(new File(arg));
|
input.add(new File(arg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
JavaTXCompiler compiler = new JavaTXCompiler(input, classpath);
|
JavaTXCompiler compiler = new JavaTXCompiler(input, classpath, outputPath != null ? new File(outputPath) : null);
|
||||||
//compiler.typeInference();
|
//compiler.typeInference();
|
||||||
compiler.generateBytecode(outputPath);
|
compiler.generateBytecode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
//PL 2018-12-19: typeInferenceOld nach typeInference uebertragen
|
//PL 2018-12-19: typeInferenceOld nach typeInference uebertragen
|
||||||
package de.dhbwstuttgart.core;
|
package de.dhbwstuttgart.core;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import de.dhbwstuttgart.bytecode.Codegen;
|
import de.dhbwstuttgart.bytecode.Codegen;
|
||||||
|
import de.dhbwstuttgart.bytecode.FunNGenerator;
|
||||||
import de.dhbwstuttgart.environment.CompilationEnvironment;
|
import de.dhbwstuttgart.environment.CompilationEnvironment;
|
||||||
import de.dhbwstuttgart.environment.DirectoryClassLoader;
|
import de.dhbwstuttgart.environment.DirectoryClassLoader;
|
||||||
import de.dhbwstuttgart.exceptions.DebugException;
|
import de.dhbwstuttgart.exceptions.DebugException;
|
||||||
|
import de.dhbwstuttgart.languageServerInterface.model.LanguageServerTransferObject;
|
||||||
import de.dhbwstuttgart.parser.JavaTXParser;
|
import de.dhbwstuttgart.parser.JavaTXParser;
|
||||||
import de.dhbwstuttgart.parser.NullToken;
|
import de.dhbwstuttgart.parser.NullToken;
|
||||||
import de.dhbwstuttgart.parser.scope.GenericsRegistry;
|
import de.dhbwstuttgart.parser.scope.GenericsRegistry;
|
||||||
@@ -31,7 +32,6 @@ import de.dhbwstuttgart.syntaxtree.type.TypeVisitor;
|
|||||||
import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
|
import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
|
||||||
import de.dhbwstuttgart.target.generate.ASTToTargetAST;
|
import de.dhbwstuttgart.target.generate.ASTToTargetAST;
|
||||||
import de.dhbwstuttgart.target.generate.GenericsResult;
|
import de.dhbwstuttgart.target.generate.GenericsResult;
|
||||||
import de.dhbwstuttgart.target.tree.expression.TargetBinaryOp;
|
|
||||||
import de.dhbwstuttgart.typeinference.constraints.Constraint;
|
import de.dhbwstuttgart.typeinference.constraints.Constraint;
|
||||||
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
|
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
|
||||||
import de.dhbwstuttgart.typeinference.constraints.Pair;
|
import de.dhbwstuttgart.typeinference.constraints.Pair;
|
||||||
@@ -51,13 +51,9 @@ import de.dhbwstuttgart.typeinference.unify.UnifyResultListenerImpl;
|
|||||||
import de.dhbwstuttgart.typeinference.unify.UnifyResultModel;
|
import de.dhbwstuttgart.typeinference.unify.UnifyResultModel;
|
||||||
import de.dhbwstuttgart.typeinference.unify.UnifyTaskModel;
|
import de.dhbwstuttgart.typeinference.unify.UnifyTaskModel;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.*;
|
||||||
import java.io.FileOutputStream;
|
import java.lang.reflect.Modifier;
|
||||||
import java.io.FileWriter;
|
import java.nio.file.Path;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.OutputStreamWriter;
|
|
||||||
import java.io.Writer;
|
|
||||||
import java.sql.Array;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@@ -74,16 +70,22 @@ public class JavaTXCompiler {
|
|||||||
|
|
||||||
Boolean log = false; //gibt an ob ein Log-File nach System.getProperty("user.dir")+""/logFiles/"" geschrieben werden soll?
|
Boolean log = false; //gibt an ob ein Log-File nach System.getProperty("user.dir")+""/logFiles/"" geschrieben werden soll?
|
||||||
public volatile UnifyTaskModel usedTasks = new UnifyTaskModel();
|
public volatile UnifyTaskModel usedTasks = new UnifyTaskModel();
|
||||||
private final DirectoryClassLoader classLoader;
|
public final DirectoryClassLoader classLoader;
|
||||||
|
|
||||||
private final List<File> classPath;
|
public final List<File> classPath;
|
||||||
|
private final File outputPath;
|
||||||
|
|
||||||
|
public final Map<String, FunNGenerator.GenericParameters> usedFunN = new HashMap<>();
|
||||||
|
public final Set<Integer> usedFunNSuperTypes = new HashSet<>();
|
||||||
|
|
||||||
|
public Map<String, byte[]> auxiliaries = new HashMap<>();
|
||||||
|
|
||||||
public DirectoryClassLoader getClassLoader() {
|
public DirectoryClassLoader getClassLoader() {
|
||||||
return classLoader;
|
return classLoader;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JavaTXCompiler(File sourceFile) throws IOException, ClassNotFoundException {
|
public JavaTXCompiler(File sourceFile) throws IOException, ClassNotFoundException {
|
||||||
this(Arrays.asList(sourceFile), null);
|
this(Arrays.asList(sourceFile), List.of(), new File("."));
|
||||||
}
|
}
|
||||||
|
|
||||||
public JavaTXCompiler(File sourceFile, Boolean log) throws IOException, ClassNotFoundException {
|
public JavaTXCompiler(File sourceFile, Boolean log) throws IOException, ClassNotFoundException {
|
||||||
@@ -92,17 +94,20 @@ public class JavaTXCompiler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public JavaTXCompiler(List<File> sourceFiles) throws IOException, ClassNotFoundException {
|
public JavaTXCompiler(List<File> sourceFiles) throws IOException, ClassNotFoundException {
|
||||||
this(sourceFiles, null);
|
this(sourceFiles, List.of(), new File("."));
|
||||||
}
|
}
|
||||||
|
|
||||||
public JavaTXCompiler(List<File> sources, List<File> contextPath) throws IOException, ClassNotFoundException {
|
public JavaTXCompiler(List<File> sources, List<File> contextPath, File outputPath) throws IOException, ClassNotFoundException {
|
||||||
if (contextPath == null || contextPath.isEmpty()) {
|
var path = new ArrayList<>(contextPath);
|
||||||
|
if (contextPath.isEmpty()) {
|
||||||
// When no contextPaths are given, the working directory is the sources root
|
// When no contextPaths are given, the working directory is the sources root
|
||||||
contextPath = Lists.newArrayList(new File(System.getProperty("user.dir")));
|
path.add(new File(System.getProperty("user.dir")));
|
||||||
}
|
}
|
||||||
classLoader = new DirectoryClassLoader(contextPath, ClassLoader.getSystemClassLoader());
|
if (outputPath != null) path.add(outputPath);
|
||||||
environment = new CompilationEnvironment(sources);
|
classLoader = new DirectoryClassLoader(path, ClassLoader.getSystemClassLoader());
|
||||||
classPath = contextPath;
|
environment = new CompilationEnvironment(sources, classLoader);
|
||||||
|
classPath = path;
|
||||||
|
this.outputPath = outputPath;
|
||||||
|
|
||||||
for (File s : sources) {
|
for (File s : sources) {
|
||||||
parse(s);
|
parse(s);
|
||||||
@@ -115,6 +120,7 @@ public class JavaTXCompiler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ClassOrInterface getClass(JavaClassName name) {
|
public ClassOrInterface getClass(JavaClassName name) {
|
||||||
|
if (loadedClasses.containsKey(name)) return loadedClasses.get(name).cif();
|
||||||
for (var sf : sourceFiles.values()) {
|
for (var sf : sourceFiles.values()) {
|
||||||
for (var clazz : sf.KlassenVektor) {
|
for (var clazz : sf.KlassenVektor) {
|
||||||
if (clazz.getClassName().equals(name)) return clazz;
|
if (clazz.getClassName().equals(name)) return clazz;
|
||||||
@@ -128,32 +134,48 @@ public class JavaTXCompiler {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConstraintSet<Pair> getConstraints() throws ClassNotFoundException, IOException {
|
public ConstraintSet<Pair> getConstraints(File sourceFile) throws ClassNotFoundException, IOException {
|
||||||
Set<ClassOrInterface> allClasses = new HashSet<>();// environment.getAllAvailableClasses();
|
Set<ClassOrInterface> allClasses = new HashSet<>();// environment.getAllAvailableClasses();
|
||||||
ClassOrInterface objectClass = ASTFactory.createClass(classLoader.loadClass(new JavaClassName("java.lang.Object").toString()));
|
ClassOrInterface objectClass = ASTFactory.createClass(Object.class);
|
||||||
// Alle Importierten Klassen in allen geparsten Sourcefiles kommen ins FC
|
var recordClass = ASTFactory.createClass(Record.class);
|
||||||
for (Entry<File, SourceFile> source : sourceFiles.entrySet()) {
|
allClasses.add(objectClass);
|
||||||
var importedClasses = new ArrayList<ClassOrInterface>();
|
allClasses.add(recordClass);
|
||||||
for (JavaClassName name : source.getValue().getImports()) {
|
|
||||||
importedClasses.addAll(getAvailableClasses(name));
|
var sf = sourceFiles.get(sourceFile);
|
||||||
}
|
var importedClasses = new ArrayList<ClassOrInterface>();
|
||||||
for (Class c : CompilationEnvironment.loadDefaultPackageClasses(source.getValue().getPkgName(), source.getKey(), this)) {
|
for (JavaClassName name : sf.getImports()) {
|
||||||
ClassOrInterface importedClass = ASTFactory.createClass(c);
|
importedClasses.addAll(getAvailableClasses(name));
|
||||||
importedClasses.add(importedClass);
|
|
||||||
}
|
|
||||||
source.getValue().availableClasses.addAll(importedClasses);
|
|
||||||
}
|
}
|
||||||
for (File f : this.sourceFiles.keySet()) {
|
for (Class c : CompilationEnvironment.loadDefaultPackageClasses(sf.getPkgName(), sourceFile, this)) {
|
||||||
SourceFile sf = sourceFiles.get(f);
|
ClassOrInterface importedClass = ASTFactory.createClass(c);
|
||||||
SourceFile sf_new = new SourceFile(sf.getPkgName(), sf.KlassenVektor.stream().map(cl -> new ClassOrInterface(cl)).collect(Collectors.toCollection(ArrayList::new)), sf.imports);
|
importedClasses.add(importedClass);
|
||||||
// sf enthaelt neues Source-File, neue Klassen-Objekte und neue
|
}
|
||||||
// ArrayListen-Objekte fuer Fields, Construktoren und Methoden
|
sf.availableClasses.addAll(importedClasses);
|
||||||
// Alle anderen Objekte werden nur kopiert.
|
|
||||||
|
SourceFile sf_new = new SourceFile(sf.getPkgName(), sf.KlassenVektor.stream().map(cl -> new ClassOrInterface(cl)).collect(Collectors.toCollection(ArrayList::new)), sf.imports);
|
||||||
|
// sf enthaelt neues Source-File, neue Klassen-Objekte und neue
|
||||||
|
// ArrayListen-Objekte fuer Fields, Construktoren und Methoden
|
||||||
|
// Alle anderen Objekte werden nur kopiert.
|
||||||
|
var isCached = false;
|
||||||
|
for (var clazz : sf.availableClasses) {
|
||||||
|
if (loadedClasses.containsKey(clazz.getClassName())) {
|
||||||
|
allClasses.removeIf(cl -> cl.getClassName().equals(clazz.getClassName()));
|
||||||
|
var cif = loadedClasses.get(clazz.getClassName()).cif();
|
||||||
|
allClasses.add(cif);
|
||||||
|
isCached = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isCached) {
|
||||||
sf_new.KlassenVektor.forEach(cl -> addMethods(sf_new, cl, sf.availableClasses, objectClass));
|
sf_new.KlassenVektor.forEach(cl -> addMethods(sf_new, cl, sf.availableClasses, objectClass));
|
||||||
allClasses.addAll(sf_new.getClasses());
|
allClasses.addAll(sf_new.getClasses());
|
||||||
}
|
}
|
||||||
TYPE ty = new TYPE(sourceFiles.values(), allClasses);
|
|
||||||
return ty.getConstraints();
|
allClasses.addAll(sf.KlassenVektor);
|
||||||
|
|
||||||
|
TYPE ty = new TYPE(sf, allClasses);
|
||||||
|
var constraints = ty.getConstraints();
|
||||||
|
return constraints;
|
||||||
}
|
}
|
||||||
|
|
||||||
void addMethods(SourceFile sf, ClassOrInterface cl, List<ClassOrInterface> importedClasses, ClassOrInterface objectClass) {
|
void addMethods(SourceFile sf, ClassOrInterface cl, List<ClassOrInterface> importedClasses, ClassOrInterface objectClass) {
|
||||||
@@ -183,36 +205,35 @@ public class JavaTXCompiler {
|
|||||||
while (paraIt.hasNext()) {
|
while (paraIt.hasNext()) {
|
||||||
gtvs.put(tvarVarIt.next().getName(), paraIt.next());
|
gtvs.put(tvarVarIt.next().getName(), paraIt.next());
|
||||||
}
|
}
|
||||||
Iterator<Method> methodIt = superclass.getMethods().iterator();
|
|
||||||
// TODO: PL 2020-05-06: Hier müssen ueberschriebene Methoden noch rausgefiltert
|
for (Method m : superclass.getMethods()) {
|
||||||
// werden
|
if (m.isInherited || Modifier.isStatic(m.modifier)) continue;
|
||||||
while (methodIt.hasNext()) {
|
// TODO: Add gtvs from method itself
|
||||||
Method m = methodIt.next();
|
|
||||||
ParameterList newParaList = new ParameterList(m.getParameterList().getFormalparalist().stream().map(fp -> fp.withType(fp.getType().acceptTV(new TypeExchanger(gtvs)))).collect(Collectors.toCollection(ArrayList::new)), m.getParameterList().getOffset());
|
ParameterList newParaList = new ParameterList(m.getParameterList().getFormalparalist().stream().map(fp -> fp.withType(fp.getType().acceptTV(new TypeExchanger(gtvs)))).collect(Collectors.toCollection(ArrayList::new)), m.getParameterList().getOffset());
|
||||||
cl.getMethods().add(new Method(m.modifier, m.name, m.getReturnType().acceptTV(new TypeExchanger(gtvs)), newParaList, m.block,
|
cl.getMethods().add(new Method(m.modifier, m.name, m.getReturnType().acceptTV(new TypeExchanger(gtvs)), newParaList, m.block,
|
||||||
// new GenericDeclarationList(newGenericsList,
|
// new GenericDeclarationList(newGenericsList,
|
||||||
// ((GenericDeclarationList)m.getGenerics()).getOffset()),
|
// ((GenericDeclarationList)m.getGenerics()).getOffset()),
|
||||||
(GenericDeclarationList) m.getGenerics(), m.getOffset(), true));
|
(GenericDeclarationList) m.getGenerics(), m.getOffset(), true, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
cl.setMethodsAdded();
|
cl.setMethodsAdded();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ClassOrInterface> getAvailableClasses(JavaClassName name) throws ClassNotFoundException {
|
private Set<ClassOrInterface> getAvailableClasses(JavaClassName name) throws ClassNotFoundException {
|
||||||
Set<ClassOrInterface> allClasses = new HashSet<>();
|
Set<ClassOrInterface> allClasses = new HashSet<>();
|
||||||
if (loadJavaTXClass(name)) {
|
var clazz = loadJavaTXClass(name);
|
||||||
var file = findFileForClass(name);
|
if (clazz == null) {
|
||||||
var sf = sourceFiles.get(file);
|
|
||||||
if (sf != null) allClasses.addAll(sf.KlassenVektor);
|
|
||||||
} else {
|
|
||||||
ClassOrInterface importedClass = ASTFactory.createClass(classLoader.loadClass(name.toString()));
|
ClassOrInterface importedClass = ASTFactory.createClass(classLoader.loadClass(name.toString()));
|
||||||
allClasses.add(importedClass);
|
allClasses.add(importedClass);
|
||||||
|
} else {
|
||||||
|
allClasses.add(clazz);
|
||||||
}
|
}
|
||||||
return new ArrayList<>(allClasses);
|
return allClasses;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ClassOrInterface> getAvailableClasses(SourceFile forSourceFile) throws ClassNotFoundException {
|
public Set<ClassOrInterface> getAvailableClasses(SourceFile forSourceFile) throws ClassNotFoundException {
|
||||||
// PL 2018-09-18: List durch Set ersetzt, damit die Klassen nur einmal
|
// PL 2018-09-18: List durch Set ersetzt, damit die Klassen nur einmal
|
||||||
// hinzugefuegt werden
|
// hinzugefuegt werden
|
||||||
// List<ClassOrInterface> allClasses = new
|
// List<ClassOrInterface> allClasses = new
|
||||||
@@ -222,7 +243,7 @@ public class JavaTXCompiler {
|
|||||||
for (JavaClassName name : forSourceFile.getImports()) {
|
for (JavaClassName name : forSourceFile.getImports()) {
|
||||||
allClasses.addAll(getAvailableClasses(name));
|
allClasses.addAll(getAvailableClasses(name));
|
||||||
}
|
}
|
||||||
return new ArrayList<>(allClasses);
|
return allClasses;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -278,17 +299,21 @@ public class JavaTXCompiler {
|
|||||||
allClasses.addAll(CompilationEnvironment.loadDefaultPackageClasses(sf.getPkgName(), source.getKey(), this).stream().map(ASTFactory::createClass).collect(Collectors.toList()));
|
allClasses.addAll(CompilationEnvironment.loadDefaultPackageClasses(sf.getPkgName(), source.getKey(), this).stream().map(ASTFactory::createClass).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
final ConstraintSet<Pair> cons = getConstraints();
|
final ConstraintSet<Pair> cons = new ConstraintSet<>();
|
||||||
|
for (var f : this.sourceFiles.keySet()) {
|
||||||
|
cons.addAll(getConstraints(f));
|
||||||
|
}
|
||||||
|
|
||||||
Set<Set<UnifyPair>> results = new HashSet<>();
|
Set<Set<UnifyPair>> results = new HashSet<>();
|
||||||
UnifyResultModel urm = null;
|
UnifyResultModel urm = null;
|
||||||
// urm.addUnifyResultListener(resultListener);
|
// urm.addUnifyResultListener(resultListener);
|
||||||
try {
|
try {
|
||||||
logFile = logFile == null ? new FileWriter(new File("log_" + sourceFiles.keySet().iterator().next().getName())) : logFile;
|
logFile = logFile == null ? new FileWriter(new File("log_" + sourceFiles.keySet().iterator().next().getName())) : logFile;
|
||||||
IFiniteClosure finiteClosure = UnifyTypeFactory.generateFC(allClasses, logFile, getClassLoader());
|
IFiniteClosure finiteClosure = UnifyTypeFactory.generateFC(allClasses, logFile, getClassLoader(), this);
|
||||||
System.out.println(finiteClosure);
|
System.out.println(finiteClosure);
|
||||||
urm = new UnifyResultModel(cons, finiteClosure);
|
urm = new UnifyResultModel(cons, finiteClosure);
|
||||||
urm.addUnifyResultListener(resultListener);
|
urm.addUnifyResultListener(resultListener);
|
||||||
ConstraintSet<UnifyPair> unifyCons = UnifyTypeFactory.convert(cons);
|
ConstraintSet<UnifyPair> unifyCons = UnifyTypeFactory.convert(this, cons);
|
||||||
|
|
||||||
Function<UnifyPair, UnifyPair> distributeInnerVars = x -> {
|
Function<UnifyPair, UnifyPair> distributeInnerVars = x -> {
|
||||||
UnifyType lhs, rhs;
|
UnifyType lhs, rhs;
|
||||||
@@ -305,78 +330,10 @@ public class JavaTXCompiler {
|
|||||||
TypeUnify unify = new TypeUnify();
|
TypeUnify unify = new TypeUnify();
|
||||||
// Set<Set<UnifyPair>> results = new HashSet<>(); Nach vorne gezogen
|
// Set<Set<UnifyPair>> results = new HashSet<>(); Nach vorne gezogen
|
||||||
logFile.write("FC:\\" + finiteClosure.toString() + "\n");
|
logFile.write("FC:\\" + finiteClosure.toString() + "\n");
|
||||||
for (SourceFile sf : this.sourceFiles.values()) {
|
for (SourceFile f : this.sourceFiles.values()) {
|
||||||
logFile.write(ASTTypePrinter.print(sf));
|
logFile.write(ASTTypePrinter.print(f));
|
||||||
}
|
}
|
||||||
logFile.flush();
|
logFile.flush();
|
||||||
|
|
||||||
Set<String> methodParaTypeVarNames = 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> constructorParaTypeVarNames = allClasses.stream().map(x -> x.getConstructors().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> paraTypeVarNames = methodParaTypeVarNames;
|
|
||||||
paraTypeVarNames.addAll(constructorParaTypeVarNames);
|
|
||||||
|
|
||||||
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();
|
|
||||||
|
|
||||||
Set<String> fieldTypeVarNames = allClasses.stream().map(x -> x.getFieldDecl().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();
|
|
||||||
|
|
||||||
returnTypeVarNames.addAll(fieldTypeVarNames);
|
|
||||||
|
|
||||||
unifyCons = unifyCons.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
|
|
||||||
});
|
|
||||||
Set<PlaceholderType> varianceTPHold;
|
Set<PlaceholderType> varianceTPHold;
|
||||||
Set<PlaceholderType> varianceTPH = new HashSet<>();
|
Set<PlaceholderType> varianceTPH = new HashSet<>();
|
||||||
varianceTPH = varianceInheritanceConstraintSet(unifyCons);
|
varianceTPH = varianceInheritanceConstraintSet(unifyCons);
|
||||||
@@ -399,32 +356,29 @@ public class JavaTXCompiler {
|
|||||||
return urm;
|
return urm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ResultSet> typeInference() throws ClassNotFoundException, IOException {
|
public List<ResultSet> typeInference(File file) throws ClassNotFoundException, IOException {
|
||||||
List<ClassOrInterface> allClasses = new ArrayList<>();// environment.getAllAvailableClasses();
|
var sf = sourceFiles.get(file);
|
||||||
// Alle Importierten Klassen in allen geparsten Sourcefiles kommen ins FC
|
Set<ClassOrInterface> allClasses = new HashSet<>();// environment.getAllAvailableClasses();
|
||||||
for (Entry<File, SourceFile> source : this.sourceFiles.entrySet()) {
|
allClasses.addAll(getAvailableClasses(sf));
|
||||||
SourceFile sf = source.getValue();
|
allClasses.addAll(sf.getClasses());
|
||||||
allClasses.addAll(getAvailableClasses(sf));
|
var newClasses = CompilationEnvironment.loadDefaultPackageClasses(sf.getPkgName(), file, this).stream().map(ASTFactory::createClass).collect(Collectors.toSet());
|
||||||
allClasses.addAll(sf.getClasses());
|
for (var clazz : newClasses) {
|
||||||
var newClasses = CompilationEnvironment.loadDefaultPackageClasses(sf.getPkgName(), source.getKey(), this).stream().map(ASTFactory::createClass).collect(Collectors.toList());
|
// Don't load classes that get recompiled
|
||||||
for (var clazz : newClasses) {
|
if (sf.getClasses().stream().anyMatch(nf -> nf.getClassName().equals(clazz.getClassName())))
|
||||||
// Don't load classes that get recompiled
|
continue;
|
||||||
if (sf.getClasses().stream().anyMatch(nf -> nf.getClassName().equals(clazz.getClassName())))
|
if (allClasses.stream().noneMatch(old -> old.getClassName().equals(clazz.getClassName())))
|
||||||
continue;
|
allClasses.add(clazz);
|
||||||
if (allClasses.stream().noneMatch(old -> old.getClassName().equals(clazz.getClassName())))
|
|
||||||
allClasses.add(clazz);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final ConstraintSet<Pair> cons = getConstraints();
|
final ConstraintSet<Pair> cons = getConstraints(file);
|
||||||
Set<Set<UnifyPair>> results = new HashSet<>();
|
Set<Set<UnifyPair>> results = new HashSet<>();
|
||||||
try {
|
try {
|
||||||
var logFolder = new File(System.getProperty("user.dir") + "/logFiles/");
|
var logFolder = new File(System.getProperty("user.dir") + "/logFiles/");
|
||||||
if (log) logFolder.mkdirs();
|
if (log) logFolder.mkdirs();
|
||||||
Writer logFile = log ? new FileWriter(new File(logFolder, "log_" + sourceFiles.keySet().iterator().next().getName())) : new OutputStreamWriter(new NullOutputStream());
|
Writer logFile = log ? new FileWriter(new File(logFolder, "log_" + sourceFiles.keySet().iterator().next().getName())) : new OutputStreamWriter(new NullOutputStream());
|
||||||
IFiniteClosure finiteClosure = UnifyTypeFactory.generateFC(allClasses, logFile, classLoader);
|
IFiniteClosure finiteClosure = UnifyTypeFactory.generateFC(allClasses.stream().toList(), logFile, classLoader, this);
|
||||||
System.out.println(finiteClosure);
|
System.out.println(finiteClosure);
|
||||||
ConstraintSet<UnifyPair> unifyCons = UnifyTypeFactory.convert(cons);
|
ConstraintSet<UnifyPair> unifyCons = UnifyTypeFactory.convert(this, cons);
|
||||||
System.out.println("xxx1");
|
System.out.println("xxx1");
|
||||||
Function<UnifyPair, UnifyPair> distributeInnerVars = x -> {
|
Function<UnifyPair, UnifyPair> distributeInnerVars = x -> {
|
||||||
UnifyType lhs, rhs;
|
UnifyType lhs, rhs;
|
||||||
@@ -443,91 +397,15 @@ public class JavaTXCompiler {
|
|||||||
TypeUnify unify = new TypeUnify();
|
TypeUnify unify = new TypeUnify();
|
||||||
// Set<Set<UnifyPair>> results = new HashSet<>(); Nach vorne gezogen
|
// Set<Set<UnifyPair>> results = new HashSet<>(); Nach vorne gezogen
|
||||||
logFile.write("FC:\\" + finiteClosure.toString() + "\n");
|
logFile.write("FC:\\" + finiteClosure.toString() + "\n");
|
||||||
for (SourceFile sf : this.sourceFiles.values()) {
|
logFile.write(ASTTypePrinter.print(sf));
|
||||||
logFile.write(ASTTypePrinter.print(sf));
|
System.out.println(ASTTypePrinter.print(sf));
|
||||||
System.out.println(ASTTypePrinter.print(sf));
|
|
||||||
}
|
|
||||||
logFile.flush();
|
logFile.flush();
|
||||||
|
List<UnifyPair> andConstraintsSorted = unifyCons.getUndConstraints().stream()
|
||||||
|
.sorted(Comparator.comparing(UnifyPair::getPairOp).thenComparing(UnifyPair::getLhsType, Comparator.comparing(UnifyType::getName)))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
Set<String> methodParaTypeVarNames = 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) -> {
|
System.out.println(andConstraintsSorted);
|
||||||
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> constructorParaTypeVarNames = allClasses.stream().map(x -> x.getConstructors().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> paraTypeVarNames = methodParaTypeVarNames;
|
|
||||||
paraTypeVarNames.addAll(constructorParaTypeVarNames);
|
|
||||||
|
|
||||||
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();
|
|
||||||
|
|
||||||
Set<String> fieldTypeVarNames = allClasses.stream().map(x -> x.getFieldDecl().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();
|
|
||||||
|
|
||||||
returnTypeVarNames.addAll(fieldTypeVarNames);
|
|
||||||
|
|
||||||
unifyCons = unifyCons.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
|
|
||||||
});
|
|
||||||
|
|
||||||
// PL 2020-02-05 alle Oder-Constraints Receiver und Parameter werden auf
|
|
||||||
// variance 1 gesetzt
|
|
||||||
// Es wird davon ausgegangen, dass in OderConstraints in Bedingungen für
|
|
||||||
// Parameter die Typen der Argumente links stehen
|
|
||||||
// und die Typen der Rückgabewerte immer rechts stehen
|
|
||||||
|
|
||||||
/*
|
|
||||||
* unifyCons.getOderConstraints().forEach(z -> z.forEach(y -> y.forEach(x -> { if ((x.getLhsType() instanceof PlaceholderType) && x.getPairOp().compareTo(PairOperator.SMALLERDOT) == 0) { ((PlaceholderType) x.getLhsType()).setVariance((byte)1); } else if ((x.getRhsType() instanceof PlaceholderType) && x.getPairOp().compareTo(PairOperator.EQUALSDOT) == 0) { ((PlaceholderType) x.getRhsType()).setVariance((byte)-1); } })));
|
|
||||||
*/
|
|
||||||
|
|
||||||
System.out.println("Unify nach Oder-Constraints-Anpassung:" + unifyCons.toString());
|
|
||||||
Set<PlaceholderType> varianceTPHold;
|
Set<PlaceholderType> varianceTPHold;
|
||||||
Set<PlaceholderType> varianceTPH = new HashSet<>();
|
Set<PlaceholderType> varianceTPH = new HashSet<>();
|
||||||
varianceTPH = varianceInheritanceConstraintSet(unifyCons);
|
varianceTPH = varianceInheritanceConstraintSet(unifyCons);
|
||||||
@@ -550,7 +428,14 @@ public class JavaTXCompiler {
|
|||||||
UnifyResultListenerImpl li = new UnifyResultListenerImpl();
|
UnifyResultListenerImpl li = new UnifyResultListenerImpl();
|
||||||
urm.addUnifyResultListener(li);
|
urm.addUnifyResultListener(li);
|
||||||
unify.unifyParallel(unifyCons.getUndConstraints(), oderConstraints, finiteClosure, logFile, log, urm, usedTasks);
|
unify.unifyParallel(unifyCons.getUndConstraints(), oderConstraints, finiteClosure, logFile, log, urm, usedTasks);
|
||||||
System.out.println("RESULT Final: " + li.getResults());
|
//System.out.println("RESULT Final: " + li.getResults());
|
||||||
|
var finalResults = li.getResults().stream().sorted().toList();
|
||||||
|
int i = 0;
|
||||||
|
System.out.println("RESULT Final: ");
|
||||||
|
for (var result : finalResults){
|
||||||
|
System.out.println("Result: " + i++);
|
||||||
|
System.out.println(result.getSortedResults());
|
||||||
|
}
|
||||||
System.out.println("Constraints for Generated Generics: " + " ???");
|
System.out.println("Constraints for Generated Generics: " + " ???");
|
||||||
logFile.write("RES_FINAL: " + li.getResults().toString() + "\n");
|
logFile.write("RES_FINAL: " + li.getResults().toString() + "\n");
|
||||||
logFile.flush();
|
logFile.flush();
|
||||||
@@ -591,6 +476,85 @@ public class JavaTXCompiler {
|
|||||||
return results.stream().map((unifyPairs -> new ResultSet(UnifyTypeFactory.convert(unifyPairs, Pair.generateTPHMap(cons))))).collect(Collectors.toList());
|
return results.stream().map((unifyPairs -> new ResultSet(UnifyTypeFactory.convert(unifyPairs, Pair.generateTPHMap(cons))))).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TEMPORARY - Only for Language Server Usage
|
||||||
|
*/
|
||||||
|
public LanguageServerTransferObject getResultSetAndAbstractSyntax(File file) throws IOException, ClassNotFoundException {
|
||||||
|
var sf = sourceFiles.get(file);
|
||||||
|
if(sf == null){
|
||||||
|
sf = sourceFiles.values().stream().findFirst().get();
|
||||||
|
}
|
||||||
|
Set<ClassOrInterface> allClasses = new HashSet<>();
|
||||||
|
allClasses.addAll(getAvailableClasses(sf));
|
||||||
|
allClasses.addAll(sf.getClasses());
|
||||||
|
var newClasses = CompilationEnvironment.loadDefaultPackageClasses(sf.getPkgName(), file, this).stream().map(ASTFactory::createClass).collect(Collectors.toSet());
|
||||||
|
for (var clazz : newClasses) {
|
||||||
|
// Don't load classes that get recompiled
|
||||||
|
if (sf.getClasses().stream().anyMatch(nf -> nf.getClassName().equals(clazz.getClassName())))
|
||||||
|
continue;
|
||||||
|
if (allClasses.stream().noneMatch(old -> old.getClassName().equals(clazz.getClassName())))
|
||||||
|
allClasses.add(clazz);
|
||||||
|
}
|
||||||
|
|
||||||
|
final ConstraintSet<Pair> cons = getConstraints(file);
|
||||||
|
Set<Set<UnifyPair>> results = new HashSet<>();
|
||||||
|
try {
|
||||||
|
Writer logFile = new OutputStreamWriter(new NullOutputStream());
|
||||||
|
IFiniteClosure finiteClosure = UnifyTypeFactory.generateFC(allClasses.stream().toList(), logFile, classLoader, this);
|
||||||
|
ConstraintSet<UnifyPair> unifyCons = UnifyTypeFactory.convert(this, cons);
|
||||||
|
Function<UnifyPair, UnifyPair> distributeInnerVars = x -> {
|
||||||
|
UnifyType lhs, rhs;
|
||||||
|
if (((lhs = x.getLhsType()) instanceof PlaceholderType) && ((rhs = x.getRhsType()) instanceof PlaceholderType) && (((PlaceholderType) lhs).isInnerType() || ((PlaceholderType) rhs).isInnerType())) {
|
||||||
|
((PlaceholderType) lhs).setInnerType(true);
|
||||||
|
((PlaceholderType) rhs).setInnerType(true);
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
unifyCons = unifyCons.map(distributeInnerVars);
|
||||||
|
TypeUnify unify = new TypeUnify();
|
||||||
|
Set<PlaceholderType> varianceTPHold;
|
||||||
|
Set<PlaceholderType> varianceTPH = new HashSet<>();
|
||||||
|
varianceTPH = varianceInheritanceConstraintSet(unifyCons);
|
||||||
|
|
||||||
|
List<Set<Constraint<UnifyPair>>> oderConstraints = unifyCons.getOderConstraints();
|
||||||
|
|
||||||
|
if (resultmodel) {
|
||||||
|
/* UnifyResultModel Anfang */
|
||||||
|
UnifyResultModel urm = new UnifyResultModel(cons, finiteClosure);
|
||||||
|
UnifyResultListenerImpl li = new UnifyResultListenerImpl();
|
||||||
|
urm.addUnifyResultListener(li);
|
||||||
|
unify.unifyParallel(unifyCons.getUndConstraints(), oderConstraints, finiteClosure, logFile, log, urm, usedTasks);
|
||||||
|
generateBytecode(sf, li.getResults());
|
||||||
|
return new LanguageServerTransferObject(li.getResults(), sf, ASTTypePrinter.print(sf), generatedGenerics);
|
||||||
|
}
|
||||||
|
/* UnifyResultModel End */
|
||||||
|
else {
|
||||||
|
Set<Set<UnifyPair>> result = unify.unifyOderConstraints(unifyCons.getUndConstraints(), oderConstraints, finiteClosure, logFile, log, new UnifyResultModel(cons, finiteClosure), usedTasks);
|
||||||
|
results.addAll(result);
|
||||||
|
|
||||||
|
results = results.stream().map(x -> {
|
||||||
|
Optional<Set<UnifyPair>> res = new RuleSet().subst(x.stream().map(y -> {
|
||||||
|
if (y.getPairOp() == PairOperator.SMALLERDOTWC)
|
||||||
|
y.setPairOp(PairOperator.EQUALSDOT);
|
||||||
|
return y; // alle Paare a <.? b erden durch a =. b ersetzt
|
||||||
|
}).collect(Collectors.toCollection(HashSet::new)));
|
||||||
|
if (res.isPresent()) {// wenn subst ein Erg liefert wurde was veraendert
|
||||||
|
return new TypeUnifyTask().applyTypeUnificationRules(res.get(), finiteClosure);
|
||||||
|
} else
|
||||||
|
return x; // wenn nichts veraendert wurde wird x zurueckgegeben
|
||||||
|
}).collect(Collectors.toCollection(HashSet::new));
|
||||||
|
}
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
}
|
||||||
|
generateBytecode(sf, results.stream().map((unifyPairs -> new ResultSet(UnifyTypeFactory.convert(unifyPairs, Pair.generateTPHMap(cons))))).collect(Collectors.toList()));
|
||||||
|
return new LanguageServerTransferObject(results.stream().map((unifyPairs -> new ResultSet(UnifyTypeFactory.convert(unifyPairs, Pair.generateTPHMap(cons))))).collect(Collectors.toList()), sf, ASTTypePrinter.print(sf), generatedGenerics);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vererbt alle Variancen bei Paaren (a <. theta) oder (Theta <. a) wenn a eine Variance !=0 hat auf alle Typvariablen in Theta.
|
* Vererbt alle Variancen bei Paaren (a <. theta) oder (Theta <. a) wenn a eine Variance !=0 hat auf alle Typvariablen in Theta.
|
||||||
*
|
*
|
||||||
@@ -648,14 +612,20 @@ public class JavaTXCompiler {
|
|||||||
|
|
||||||
public final JavaClassRegistry classRegistry = new JavaClassRegistry();
|
public final JavaClassRegistry classRegistry = new JavaClassRegistry();
|
||||||
|
|
||||||
|
public record ClassEntry(File classFile, ClassOrInterface cif) {}
|
||||||
|
|
||||||
|
public final Map<JavaClassName, ClassEntry> loadedClasses = new HashMap<>();
|
||||||
|
|
||||||
private SourceFile parse(File sourceFile) throws IOException, java.lang.ClassNotFoundException {
|
private SourceFile parse(File sourceFile) throws IOException, java.lang.ClassNotFoundException {
|
||||||
|
if (sourceFiles.containsKey(sourceFile)) return sourceFiles.get(sourceFile);
|
||||||
SourceFileContext tree = JavaTXParser.parse(sourceFile);
|
SourceFileContext tree = JavaTXParser.parse(sourceFile);
|
||||||
environment.addClassesToRegistry(classRegistry, tree, sourceFile, this);
|
environment.addClassesToRegistry(classRegistry, tree, sourceFile, this);
|
||||||
SyntaxTreeGenerator generator = new SyntaxTreeGenerator(this, classRegistry, new GenericsRegistry(null), sourceFile.getName());
|
SyntaxTreeGenerator generator = new SyntaxTreeGenerator(this, classRegistry, new GenericsRegistry(null), sourceFile.getName());
|
||||||
var classes = new ArrayList<ClassOrInterface>();
|
var classes = new ArrayList<ClassOrInterface>();
|
||||||
var sf = new SourceFile(generator.pkgName, classes, generator.imports);
|
var sf = new SourceFile("", classes, generator.imports);
|
||||||
addSourceFile(sourceFile, sf);
|
addSourceFile(sourceFile, sf);
|
||||||
generator.convert(classes, tree, environment.packageCrawler);
|
generator.convert(classes, tree, environment.packageCrawler);
|
||||||
|
sf.setPackageName(generator.pkgName);
|
||||||
sf.imports.addAll(generator.imports);
|
sf.imports.addAll(generator.imports);
|
||||||
return sf;
|
return sf;
|
||||||
}
|
}
|
||||||
@@ -665,25 +635,33 @@ public class JavaTXCompiler {
|
|||||||
* if it doesn't exist it's going to compile it and add it to the source files list
|
* if it doesn't exist it's going to compile it and add it to the source files list
|
||||||
* @param name
|
* @param name
|
||||||
*/
|
*/
|
||||||
public boolean loadJavaTXClass(JavaClassName name) {
|
public ClassOrInterface loadJavaTXClass(JavaClassName name) {
|
||||||
var file = findFileForClass(name);
|
var file = findFileForClass(name);
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
if (classRegistry.contains(name)) return true;
|
if (loadedClasses.containsKey(name)) return loadedClasses.get(name).cif();
|
||||||
try {
|
try {
|
||||||
var tree = JavaTXParser.parse(file);
|
var tree = JavaTXParser.parse(file);
|
||||||
classRegistry.addName(name.toString(), 0); // TODO This gets overwritten later, is it bad if we don't know this right away?
|
classRegistry.addName(name.toString(), 0); // TODO This gets overwritten later, is it bad if we don't know this right away?
|
||||||
environment.addClassesToRegistry(classRegistry, tree, file, this);
|
environment.addClassesToRegistry(classRegistry, tree, file, this);
|
||||||
SyntaxTreeGenerator generator = new SyntaxTreeGenerator(this, classRegistry, new GenericsRegistry(null), file.getName());
|
SyntaxTreeGenerator generator = new SyntaxTreeGenerator(this, classRegistry, new GenericsRegistry(null), file.getName());
|
||||||
var classes = new ArrayList<ClassOrInterface>();
|
var classes = new ArrayList<ClassOrInterface>();
|
||||||
var sf = new SourceFile(generator.pkgName, classes, generator.imports);
|
var sf = new SourceFile("", classes, generator.imports);
|
||||||
addSourceFile(file, sf);
|
addSourceFile(file, sf);
|
||||||
generator.convert(classes, tree, environment.packageCrawler);
|
generator.convert(classes, tree, environment.packageCrawler);
|
||||||
return true;
|
sf.setPackageName(generator.pkgName);
|
||||||
|
var classFiles = generateBytecode(file);
|
||||||
|
|
||||||
|
sf.setGenerated();
|
||||||
|
writeClassFile(classFiles, outputPath != null ? outputPath : new File("."), false);
|
||||||
|
var clazz = classLoader.loadClass(name.toString());
|
||||||
|
var classOrInterface = ASTFactory.createClass(clazz);
|
||||||
|
loadedClasses.put(name, new ClassEntry(new File(outputPath, clazz.getName() + ".class"), classOrInterface));
|
||||||
|
return classOrInterface;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public File findFileForClass(JavaClassName name) {
|
public File findFileForClass(JavaClassName name) {
|
||||||
@@ -697,25 +675,26 @@ public class JavaTXCompiler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void generateBytecode() throws ClassNotFoundException, IOException {
|
public void generateBytecode() throws ClassNotFoundException, IOException {
|
||||||
generateBytecode((File) null);
|
for (var file : sourceFiles.keySet()) {
|
||||||
}
|
var sf = sourceFiles.get(file);
|
||||||
|
if (sf.isGenerated()) continue;
|
||||||
/**
|
var classes = generateBytecode(file);
|
||||||
* @param path - can be null, then class file output is in the same directory as the parsed source files
|
sf.setGenerated();
|
||||||
*/
|
writeClassFile(classes, outputPath == null ? file.getParentFile() : outputPath, outputPath == null);
|
||||||
public void generateBytecode(String path) throws ClassNotFoundException, IOException {
|
}
|
||||||
if (path != null)
|
|
||||||
generateBytecode(new File(path));
|
|
||||||
else
|
|
||||||
generateBytecode();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param path - output-Directory can be null, then class file output is in the same directory as the parsed source files
|
* @param path - output-Directory can be null, then class file output is in the same directory as the parsed source files
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public void generateBytecode(File path) throws ClassNotFoundException, IOException {
|
public Map<JavaClassName, byte[]> generateBytecode(File sourceFile) throws ClassNotFoundException, IOException {
|
||||||
List<ResultSet> typeinferenceResult = this.typeInference();
|
var sf = sourceFiles.get(sourceFile);
|
||||||
generateBytecode(path, typeinferenceResult);
|
if (sf.isGenerated()) return null;
|
||||||
|
List<ResultSet> typeinferenceResult = this.typeInference(sourceFile);
|
||||||
|
var classes = generateBytecode(sf, typeinferenceResult);
|
||||||
|
sf.setGenerated();
|
||||||
|
return classes;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<SourceFile, List<GenericsResult>> generatedGenerics = new HashMap<>();
|
private Map<SourceFile, List<GenericsResult>> generatedGenerics = new HashMap<>();
|
||||||
@@ -733,15 +712,13 @@ public class JavaTXCompiler {
|
|||||||
for (File f : sourceFiles.keySet()) {
|
for (File f : sourceFiles.keySet()) {
|
||||||
HashMap<JavaClassName, byte[]> classFiles = new HashMap<>();
|
HashMap<JavaClassName, byte[]> classFiles = new HashMap<>();
|
||||||
SourceFile sf = sourceFiles.get(f);
|
SourceFile sf = sourceFiles.get(f);
|
||||||
File path;
|
File path = outputPath;
|
||||||
if (outputPath == null) {
|
if (outputPath == null) {
|
||||||
path = f.getParentFile(); // Set path to path of the parsed .jav file
|
path = f.getParentFile(); // Set path to path of the parsed .jav file
|
||||||
} else {
|
|
||||||
path = new File(outputPath, sf.getPkgName().replace(".", "/")); // add package path to root path
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var generatedClasses = generateBytecode(sf, typeinferenceResult);
|
var generatedClasses = generateBytecode(sf, typeinferenceResult);
|
||||||
writeClassFile(generatedClasses, path);
|
writeClassFile(generatedClasses, path, outputPath == null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -749,26 +726,27 @@ public class JavaTXCompiler {
|
|||||||
var converter = new ASTToTargetAST(this, typeInferenceResult, sf, classLoader);
|
var converter = new ASTToTargetAST(this, typeInferenceResult, sf, classLoader);
|
||||||
var generatedClasses = new HashMap<JavaClassName, byte[]>();
|
var generatedClasses = new HashMap<JavaClassName, byte[]>();
|
||||||
for (var clazz : sf.getClasses()) {
|
for (var clazz : sf.getClasses()) {
|
||||||
var codegen = new Codegen(converter.convert(clazz), this);
|
var codegen = new Codegen(converter.convert(clazz), this, converter);
|
||||||
var code = codegen.generate();
|
var code = codegen.generate();
|
||||||
generatedClasses.put(clazz.getClassName(), code);
|
generatedClasses.put(clazz.getClassName(), code);
|
||||||
converter.auxiliaries.forEach((name, source) -> {
|
|
||||||
generatedClasses.put(new JavaClassName(name), source);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
generatedGenerics.put(sf, converter.javaGenerics());
|
generatedGenerics.put(sf, converter.javaGenerics());
|
||||||
|
converter.generateFunNTypes();
|
||||||
|
auxiliaries.forEach((name, source) -> {
|
||||||
|
generatedClasses.put(new JavaClassName(name), source);
|
||||||
|
});
|
||||||
return generatedClasses;
|
return generatedClasses;
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void writeClassFile(Map<JavaClassName, byte[]> classFiles, File path) throws IOException {
|
public synchronized void writeClassFile(Map<JavaClassName, byte[]> classFiles, File path, boolean preserveHierarchy) throws IOException {
|
||||||
FileOutputStream output;
|
FileOutputStream output;
|
||||||
for (JavaClassName name : classFiles.keySet()) {
|
for (JavaClassName name : classFiles.keySet()) {
|
||||||
byte[] bytecode = classFiles.get(name);
|
byte[] bytecode = classFiles.get(name);
|
||||||
System.out.println("generating " + name + ".class file ...");
|
System.out.println("generating " + name + ".class file ...");
|
||||||
// output = new FileOutputStream(new File(System.getProperty("user.dir") +
|
var subPath = preserveHierarchy ? path : Path.of(path.toString(), name.getPackageName().split("\\.")).toFile();
|
||||||
// "/testBytecode/generatedBC/" +name+".class"));
|
File outputFile = new File(subPath, name.getClassName() + ".class");
|
||||||
File outputFile = new File(path, name.getClassName() + ".class");
|
|
||||||
outputFile.getAbsoluteFile().getParentFile().mkdirs();
|
outputFile.getAbsoluteFile().getParentFile().mkdirs();
|
||||||
|
System.out.println(outputFile);
|
||||||
output = new FileOutputStream(outputFile);
|
output = new FileOutputStream(outputFile);
|
||||||
output.write(bytecode);
|
output.write(bytecode);
|
||||||
output.close();
|
output.close();
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
package de.dhbwstuttgart.environment;
|
|
||||||
|
|
||||||
public class ByteArrayClassLoader extends ClassLoader implements IByteArrayClassLoader {
|
|
||||||
@Override
|
|
||||||
public Class _defineClass(String name, byte[] code, int i, int length) throws ClassFormatError {
|
|
||||||
return defineClass(name, code, i, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<?> findClass(String name) throws ClassNotFoundException {
|
|
||||||
return super.findClass(name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -30,11 +30,11 @@ public class CompilationEnvironment {
|
|||||||
public final PackageCrawler packageCrawler;
|
public final PackageCrawler packageCrawler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Imitiert die Environment beim Aufruf des JavaCompilers auf einer Menge von java-Dateien Die Environment enth�lt automatisch die Java Standard Library
|
* Imitiert die Environment beim Aufruf des JavaCompilers auf einer Menge von java-Dateien Die Environment enthält automatisch die Java Standard Library
|
||||||
*
|
*
|
||||||
* @param sourceFiles die zu kompilierenden Dateien
|
* @param sourceFiles die zu kompilierenden Dateien
|
||||||
*/
|
*/
|
||||||
public CompilationEnvironment(List<File> sourceFiles) {
|
public CompilationEnvironment(List<File> sourceFiles, DirectoryClassLoader classLoader) {
|
||||||
/**
|
/**
|
||||||
* 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
|
* 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
|
||||||
*
|
*
|
||||||
@@ -54,7 +54,7 @@ public class CompilationEnvironment {
|
|||||||
// librarys = Arrays.asList(loader.getURLs());
|
// librarys = Arrays.asList(loader.getURLs());
|
||||||
|
|
||||||
this.sourceFiles = sourceFiles;
|
this.sourceFiles = sourceFiles;
|
||||||
this.packageCrawler = new PackageCrawler(librarys);
|
this.packageCrawler = new PackageCrawler(classLoader);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addClassesToRegistry(JavaClassRegistry registry, SourceFileContext tree, File sourceFile, JavaTXCompiler compiler) throws ClassNotFoundException, IOException {
|
public void addClassesToRegistry(JavaClassRegistry registry, SourceFileContext tree, File sourceFile, JavaTXCompiler compiler) throws ClassNotFoundException, IOException {
|
||||||
@@ -77,7 +77,7 @@ public class CompilationEnvironment {
|
|||||||
// Set classLoader to include default package for this specific source file
|
// Set classLoader to include default package for this specific source file
|
||||||
File dir = sourceFile.getAbsoluteFile().getParentFile();
|
File dir = sourceFile.getAbsoluteFile().getParentFile();
|
||||||
String dirPath = dir.toString() + "/";
|
String dirPath = dir.toString() + "/";
|
||||||
if (packageName.length() > 0)
|
if (!packageName.isEmpty())
|
||||||
dirPath = dirPath.substring(0, dirPath.length() - packageName.length() - 1);
|
dirPath = dirPath.substring(0, dirPath.length() - packageName.length() - 1);
|
||||||
String path = dirPath;
|
String path = dirPath;
|
||||||
ArrayList<File> defaultPath = Lists.newArrayList(new File(path));
|
ArrayList<File> defaultPath = Lists.newArrayList(new File(path));
|
||||||
@@ -89,7 +89,10 @@ public class CompilationEnvironment {
|
|||||||
String className = classFile.getName().substring(0, classFile.getName().length() - 6);
|
String className = classFile.getName().substring(0, classFile.getName().length() - 6);
|
||||||
if (className.matches("Fun\\d+\\$\\$.*"))
|
if (className.matches("Fun\\d+\\$\\$.*"))
|
||||||
continue;
|
continue;
|
||||||
ret.add(classLoader.loadClass(packageName + className));
|
var name = packageName;
|
||||||
|
if (!packageName.isEmpty()) name += ".";
|
||||||
|
name += className;
|
||||||
|
ret.add(classLoader.loadClass(name));
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -101,12 +104,4 @@ public class CompilationEnvironment {
|
|||||||
return packageName;
|
return packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ClassOrInterface> getAllAvailableClasses() {
|
|
||||||
List<ClassOrInterface> ret = new ArrayList<>();
|
|
||||||
for (Class c : new PackageCrawler(librarys).getAllAvailableClasses()) {
|
|
||||||
ret.add(ASTFactory.createClass(c));
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,31 +5,61 @@ import java.io.IOException;
|
|||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLClassLoader;
|
import java.net.URLClassLoader;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.*;
|
||||||
import java.nio.file.Path;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class DirectoryClassLoader extends URLClassLoader implements IByteArrayClassLoader {
|
public class DirectoryClassLoader extends URLClassLoader implements IByteArrayClassLoader {
|
||||||
public DirectoryClassLoader(File directory, java.lang.ClassLoader parent) {
|
// public DirectoryClassLoader(File directory, java.lang.ClassLoader parent) {
|
||||||
super(generateURLArray(dirToURL(directory)), parent);
|
// super(generateURLArray(dirToURL(directory)), parent);
|
||||||
}
|
// }
|
||||||
|
|
||||||
public DirectoryClassLoader(List<File> directory, java.lang.ClassLoader parent) {
|
public DirectoryClassLoader(List<File> directory, java.lang.ClassLoader parent) {
|
||||||
super(directory.stream().map(DirectoryClassLoader::dirToURL).collect(Collectors.toList()).toArray(new URL[0]), parent);
|
super(directory.stream().map(DirectoryClassLoader::dirToURL).flatMap(List::stream).collect(Collectors.toList()).toArray(new URL[0]), parent.getParent());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static URL[] generateURLArray(URL url) {
|
private static URL[] generateURLArray(URL url) {
|
||||||
return new URL[]{url};
|
return new URL[]{url};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static URL dirToURL(File url){
|
private static List<URL> dirToURL(File file) {
|
||||||
if(!url.isDirectory())throw new RuntimeException(url.toString() + " is not a directory");
|
//if(!url.isDirectory())throw new RuntimeException(url.toString() + " is not a directory");
|
||||||
try {
|
|
||||||
return url.toURI().toURL();
|
Path dir;
|
||||||
} catch (MalformedURLException e) {
|
if (file.isDirectory()) {
|
||||||
throw new RuntimeException(e);
|
try {
|
||||||
|
return List.of(file.toURI().toURL()); // if file is a directory, use it as is
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dir = file.toPath().getParent(); // if file is not a directory, get its parent directory
|
||||||
|
String pattern = file.toPath().getFileName().toString(); // use the file name as a glob pattern
|
||||||
|
|
||||||
|
List<URL> urls = new ArrayList<>();
|
||||||
|
|
||||||
|
try {
|
||||||
|
urls = Files.walk(dir)
|
||||||
|
.filter(Files::isRegularFile) // only consider files (not directories)
|
||||||
|
.filter(path -> {
|
||||||
|
PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:" + pattern);
|
||||||
|
return matcher.matches(path.getFileName()); // match the file name against the pattern
|
||||||
|
})
|
||||||
|
.map(path -> {
|
||||||
|
try {
|
||||||
|
return path.toUri().toURL();
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}) // convert the path to a URL
|
||||||
|
.toList(); // print the path of each matching file
|
||||||
|
} catch (IOException | RuntimeException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return urls;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -41,4 +71,8 @@ public class DirectoryClassLoader extends URLClassLoader implements IByteArrayCl
|
|||||||
public Class<?> findClass(String name) throws ClassNotFoundException {
|
public Class<?> findClass(String name) throws ClassNotFoundException {
|
||||||
return super.findClass(name);
|
return super.findClass(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Class<?> _findLoadedClass(String name) throws ClassNotFoundException {
|
||||||
|
return super.findLoadedClass(name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,18 +6,22 @@ import java.nio.file.Path;
|
|||||||
|
|
||||||
public interface IByteArrayClassLoader {
|
public interface IByteArrayClassLoader {
|
||||||
|
|
||||||
Class loadClass(String path) throws ClassNotFoundException;
|
Class<?> loadClass(String path) throws ClassNotFoundException;
|
||||||
|
|
||||||
default Class loadClass(byte[] code) {
|
default Class<?> loadClass(byte[] code) {
|
||||||
return this._defineClass(null, code, 0, code.length);
|
return this.loadClass(null, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
default Class loadClass(Path path) throws IOException {
|
default Class<?> loadClass(String name, byte[] code) {
|
||||||
|
return this._defineClass(name, code, 0, code.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
default Class<?> loadClass(Path path) throws IOException {
|
||||||
var code = Files.readAllBytes(path);
|
var code = Files.readAllBytes(path);
|
||||||
return this._defineClass(null, code, 0, code.length);
|
return this._defineClass(null, code, 0, code.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Class<?> findClass(String name) throws ClassNotFoundException;
|
public Class<?> findClass(String name) throws ClassNotFoundException;
|
||||||
|
|
||||||
Class _defineClass(String name, byte[] code, int i, int length) throws ClassFormatError;
|
Class<?> _defineClass(String name, byte[] code, int i, int length) throws ClassFormatError;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,10 @@
|
|||||||
package de.dhbwstuttgart.environment;
|
package de.dhbwstuttgart.environment;
|
||||||
|
|
||||||
import java.net.URL;
|
import io.github.classgraph.ClassGraph;
|
||||||
|
import io.github.classgraph.ScanResult;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import org.reflections.Reflections;
|
|
||||||
import org.reflections.scanners.ResourcesScanner;
|
|
||||||
import org.reflections.scanners.SubTypesScanner;
|
|
||||||
import org.reflections.util.ConfigurationBuilder;
|
|
||||||
import org.reflections.util.FilterBuilder;
|
|
||||||
|
|
||||||
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
|
||||||
import org.reflections.vfs.SystemDir;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hilft beim Durchsuchen von Packages
|
* Hilft beim Durchsuchen von Packages
|
||||||
* Benutzt die Reflections-Library (https://github.com/ronmamo/reflections)
|
* Benutzt die Reflections-Library (https://github.com/ronmamo/reflections)
|
||||||
@@ -19,48 +12,30 @@ import org.reflections.vfs.SystemDir;
|
|||||||
*/
|
*/
|
||||||
public class PackageCrawler {
|
public class PackageCrawler {
|
||||||
|
|
||||||
final URL[] urls;
|
final DirectoryClassLoader classLoader;
|
||||||
public PackageCrawler(List<URL> urlList) {
|
public PackageCrawler(DirectoryClassLoader classLoader) {
|
||||||
urls = urlList.toArray(new URL[0]);
|
this.classLoader = classLoader;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<Class<?>> getClassesInPackage(String packageName){
|
public Set<Class<?>> getClassesInPackage(String packageName) {
|
||||||
/*
|
var res = new HashSet<Class<?>>();
|
||||||
List<DirectoryClassLoader> classLoadersList = new LinkedList<DirectoryClassLoader>();
|
|
||||||
classLoadersList.add(Thread.currentThread().getContextClassLoader());
|
|
||||||
classLoadersList.add(ClasspathHelper.staticClassLoader());
|
|
||||||
classLoadersList.add(Thread.currentThread().getContextClassLoader().getParent());
|
|
||||||
classLoadersList.add(DirectoryClassLoader.getSystemClassLoader());
|
|
||||||
String bootClassPath = System.getProperty("sun.boot.class.path");
|
|
||||||
ArrayList<URL> urlList = new ArrayList<>();
|
|
||||||
for(String path : bootClassPath.split(";")) {
|
|
||||||
try {
|
|
||||||
urlList.add(new URL("file:"+path));
|
|
||||||
} catch (MalformedURLException e) {
|
|
||||||
new DebugException("Fehler im Classpath auf diesem System");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
URL[] urls = urlList.toArray(new URL[0]);
|
|
||||||
classLoadersList.add(new URLClassLoader(urls, DirectoryClassLoader.getSystemClassLoader()));
|
|
||||||
*/
|
|
||||||
Reflections reflections = new Reflections(new ConfigurationBuilder()
|
|
||||||
.setScanners(new SubTypesScanner(false /* don't exclude Object.class */), new ResourcesScanner())
|
|
||||||
.setUrls(urls)
|
|
||||||
.filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(packageName))));
|
|
||||||
|
|
||||||
Set<Class<?>> classes = reflections.getSubTypesOf(Object.class);
|
try (ScanResult result = new ClassGraph()
|
||||||
|
.enableClassInfo()
|
||||||
|
.enableSystemJarsAndModules()
|
||||||
|
.addClassLoader(classLoader)
|
||||||
|
.acceptPackages(packageName)
|
||||||
|
.scan()) {
|
||||||
|
|
||||||
return classes;
|
for (var info : result.getAllClasses()) {
|
||||||
}
|
try {
|
||||||
|
var clazz = Class.forName(info.getName());
|
||||||
|
res.add(clazz);
|
||||||
|
} catch (ClassNotFoundException ignored) {}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public Set<Class<?>> getAllAvailableClasses(){
|
return res;
|
||||||
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){
|
public Map<String, Integer> getClassNames(String packageName){
|
||||||
|
|||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package de.dhbwstuttgart.languageServerInterface;
|
||||||
|
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.bytecode.Codegen;
|
||||||
|
import de.dhbwstuttgart.core.JavaTXCompiler;
|
||||||
|
import de.dhbwstuttgart.environment.IByteArrayClassLoader;
|
||||||
|
import de.dhbwstuttgart.languageServerInterface.model.LanguageServerTransferObject;
|
||||||
|
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
||||||
|
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
||||||
|
import de.dhbwstuttgart.syntaxtree.factory.NameGenerator;
|
||||||
|
import de.dhbwstuttgart.target.generate.ASTToTargetAST;
|
||||||
|
import de.dhbwstuttgart.target.generate.GenericsResult;
|
||||||
|
import de.dhbwstuttgart.target.tree.TargetStructure;
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.nio.file.DirectoryStream;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation of an Interface for the Language-Server to get the Resultset and abstract Syntax.
|
||||||
|
*/
|
||||||
|
public class LanguageServerInterface {
|
||||||
|
|
||||||
|
|
||||||
|
public LanguageServerTransferObject getResultSetAndAbastractSyntax(String path, String resetNamesTo) throws IOException, URISyntaxException, ClassNotFoundException {
|
||||||
|
NameGenerator.resetTo(resetNamesTo);
|
||||||
|
return getResultSetAndAbstractSyntax(path);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public SourceFile getAst(String path, String resetNamesTo) throws IOException, URISyntaxException, ClassNotFoundException {
|
||||||
|
NameGenerator.resetTo(resetNamesTo);
|
||||||
|
return getAST(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns the ResultSets, GenericResultSet and the AST
|
||||||
|
* You have to give the input as well as the path because of potential locks when the File is currently opened in an IDE.
|
||||||
|
* Example: file:///c:/test/main.jav -> file:///c:/test/out/main.class
|
||||||
|
*
|
||||||
|
* @param pathAsString the URI of the File. See Example.
|
||||||
|
*/
|
||||||
|
public LanguageServerTransferObject getResultSetAndAbstractSyntax(String pathAsString){
|
||||||
|
System.setOut(new PrintStream(OutputStream.nullOutputStream()));
|
||||||
|
try {
|
||||||
|
var uri = new URI(pathAsString);
|
||||||
|
var path = Path.of(uri);
|
||||||
|
var file = path.toFile();
|
||||||
|
Files.createDirectories(path.getParent().resolve("out"));
|
||||||
|
var compiler = new JavaTXCompiler(List.of(file), List.of(path.getParent().toFile()), path.getParent().resolve("out").toFile());
|
||||||
|
|
||||||
|
var parsedSource = compiler.sourceFiles.get(file);
|
||||||
|
var tiResults = compiler.typeInference(file);
|
||||||
|
|
||||||
|
Map<JavaClassName, byte[]> bytecode = compiler.generateBytecode(parsedSource, tiResults);
|
||||||
|
Files.createDirectories(path.getParent().resolve("out"));
|
||||||
|
compiler.writeClassFile(bytecode, path.getParent().resolve("out").toFile(), false);
|
||||||
|
|
||||||
|
return new LanguageServerTransferObject(tiResults, parsedSource, "", compiler.getGeneratedGenerics());
|
||||||
|
}catch (Exception e){
|
||||||
|
throw new RuntimeException(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns the AST without calculating the result
|
||||||
|
* You have to give the input as well as the path because of potential locks when the File is currently opened in an IDE.
|
||||||
|
* Example: file:///c:/test/main.jav -> file:///c:/test/out/main.class
|
||||||
|
*
|
||||||
|
* @param path the URI of the File. See Example.
|
||||||
|
* @throws IOException
|
||||||
|
* @throws ClassNotFoundException
|
||||||
|
* @throws URISyntaxException
|
||||||
|
*/
|
||||||
|
public SourceFile getAST(String path) throws IOException, ClassNotFoundException, URISyntaxException {
|
||||||
|
|
||||||
|
|
||||||
|
System.setOut(new PrintStream(OutputStream.nullOutputStream()));
|
||||||
|
|
||||||
|
|
||||||
|
URI uri = new URI(path);
|
||||||
|
ArrayList<String> pathWithoutName = new ArrayList<>(List.of(uri.getPath().split("/")));
|
||||||
|
pathWithoutName.remove(List.of(uri.getPath().split("/")).size() - 1);
|
||||||
|
String stringPathWithoutName = "";
|
||||||
|
|
||||||
|
for (String i : pathWithoutName) {
|
||||||
|
stringPathWithoutName += "/" + i;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
FileUtils.cleanDirectory(new File(stringPathWithoutName + "/out"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
(new File(stringPathWithoutName + "/out")).mkdirs();
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
var test = getAST(uri.getPath().split("/")[uri.getPath().split("/").length - 1], new File(stringPathWithoutName).getPath());
|
||||||
|
System.setOut(System.out);
|
||||||
|
return test;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SourceFile getAST(String filename, String filePath) throws IOException, ClassNotFoundException {
|
||||||
|
var file = Path.of(filePath, filename).toFile();
|
||||||
|
var compiler = new JavaTXCompiler(List.of(file), List.of(file.getParentFile()), Path.of(filePath + "/out").toFile());
|
||||||
|
return compiler.sourceFiles.get(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package de.dhbwstuttgart.languageServerInterface;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.languageServerInterface.model.CustomParserErrorHandler;
|
||||||
|
import de.dhbwstuttgart.languageServerInterface.model.ParserError;
|
||||||
|
import de.dhbwstuttgart.parser.antlr.Java17Lexer;
|
||||||
|
import de.dhbwstuttgart.parser.antlr.Java17Parser;
|
||||||
|
import de.dhbwstuttgart.parser.antlr.Java17ParserBaseListener;
|
||||||
|
import org.antlr.v4.runtime.CharStream;
|
||||||
|
import org.antlr.v4.runtime.CharStreams;
|
||||||
|
import org.antlr.v4.runtime.CommonTokenStream;
|
||||||
|
import org.antlr.v4.runtime.tree.ParseTree;
|
||||||
|
import org.antlr.v4.runtime.tree.ParseTreeWalker;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ParserInterface {
|
||||||
|
|
||||||
|
public List<ParserError> getParseErrors(String input){
|
||||||
|
|
||||||
|
CustomParserErrorHandler errorListener = new CustomParserErrorHandler();
|
||||||
|
CharStream charStream = CharStreams.fromString(input);
|
||||||
|
|
||||||
|
Java17Lexer lexer = new Java17Lexer(charStream);
|
||||||
|
CommonTokenStream tokens = new CommonTokenStream(lexer);
|
||||||
|
|
||||||
|
Java17Parser parser = new Java17Parser(tokens);
|
||||||
|
parser.removeErrorListeners();
|
||||||
|
parser.addErrorListener(errorListener);
|
||||||
|
|
||||||
|
|
||||||
|
ParseTree tree = parser.sourceFile();
|
||||||
|
ParseTreeWalker walker = new ParseTreeWalker();
|
||||||
|
Java17ParserBaseListener listener = new Java17ParserBaseListener();
|
||||||
|
walker.walk(listener, tree);
|
||||||
|
|
||||||
|
return errorListener.getErrorMessages();
|
||||||
|
}
|
||||||
|
}
|
||||||
+47
@@ -0,0 +1,47 @@
|
|||||||
|
package de.dhbwstuttgart.languageServerInterface.model;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import org.antlr.v4.runtime.*;
|
||||||
|
import org.antlr.v4.runtime.atn.ATNConfigSet;
|
||||||
|
import org.antlr.v4.runtime.dfa.DFA;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.BitSet;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class CustomParserErrorHandler implements ANTLRErrorListener {
|
||||||
|
private final List<ParserError> errorMessages = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) {
|
||||||
|
int endCharPosition = charPositionInLine;
|
||||||
|
if (offendingSymbol instanceof Token) {
|
||||||
|
Token offendingToken = (Token) offendingSymbol;
|
||||||
|
endCharPosition = charPositionInLine + offendingToken.getText().length();
|
||||||
|
}
|
||||||
|
|
||||||
|
ParserError parserError = new ParserError(line, charPositionInLine, endCharPosition, msg);
|
||||||
|
errorMessages.add(parserError);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reportAmbiguity(Parser parser, DFA dfa, int i, int i1, boolean b, BitSet bitSet, ATNConfigSet atnConfigSet) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reportAttemptingFullContext(Parser parser, DFA dfa, int i, int i1, BitSet bitSet, ATNConfigSet atnConfigSet) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reportContextSensitivity(Parser parser, DFA dfa, int i, int i1, int i2, ATNConfigSet atnConfigSet) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ParserError> getErrorMessages() {
|
||||||
|
return errorMessages;
|
||||||
|
}
|
||||||
|
}
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
package de.dhbwstuttgart.languageServerInterface.model;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
||||||
|
import de.dhbwstuttgart.target.generate.GenericsResult;
|
||||||
|
import de.dhbwstuttgart.typeinference.result.ResultSet;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class LanguageServerTransferObject {
|
||||||
|
List<ResultSet> resultSets;
|
||||||
|
SourceFile Ast;
|
||||||
|
String printedAst;
|
||||||
|
Map<SourceFile, List<GenericsResult>> generatedGenerics = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
public LanguageServerTransferObject(List<ResultSet> resultSets, SourceFile Ast, String printedAst, Map<SourceFile, List<GenericsResult>> generatedGenerics) {
|
||||||
|
this.resultSets = resultSets;
|
||||||
|
this.Ast = Ast;
|
||||||
|
this.printedAst = printedAst;
|
||||||
|
this.generatedGenerics = generatedGenerics;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ResultSet> getResultSets() {return resultSets;}
|
||||||
|
public SourceFile getAst() {return Ast;}
|
||||||
|
public String getPrintedAst() {return printedAst;}
|
||||||
|
public Map<SourceFile, List<GenericsResult>> getGeneratedGenerics() {return generatedGenerics;}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package de.dhbwstuttgart.languageServerInterface.model;
|
||||||
|
|
||||||
|
public class ParserError {
|
||||||
|
|
||||||
|
private int line;
|
||||||
|
private int charPositionInLine;
|
||||||
|
private int endCharPosition;
|
||||||
|
String msg;
|
||||||
|
|
||||||
|
public ParserError(int line, int charPositionInLine, int endCharPosition, String msg) {
|
||||||
|
this.line = line;
|
||||||
|
this.charPositionInLine = charPositionInLine;
|
||||||
|
this. endCharPosition = endCharPosition;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getEndCharPosition() {
|
||||||
|
return endCharPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndCharPosition(int endCharPosition) {
|
||||||
|
this.endCharPosition = endCharPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCharPositionInLine(int charPositionInLine) {
|
||||||
|
this.charPositionInLine = charPositionInLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLine(int line) {
|
||||||
|
this.line = line;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCharPositionInLine() {
|
||||||
|
return charPositionInLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLine() {
|
||||||
|
return line;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package de.dhbwstuttgart.languageServerInterface.model;
|
||||||
|
|
||||||
|
|
||||||
|
import com.google.common.reflect.TypeResolver;
|
||||||
|
import de.dhbwstuttgart.typeinference.unify.UnifyResultEvent;
|
||||||
|
import de.dhbwstuttgart.typeinference.unify.UnifyResultListener;
|
||||||
|
|
||||||
|
public class ResultSetListener implements UnifyResultListener {
|
||||||
|
|
||||||
|
TypeResolver typeResolver;
|
||||||
|
|
||||||
|
public ResultSetListener(TypeResolver typeResolver){
|
||||||
|
this.typeResolver = typeResolver;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNewTypeResultFound(UnifyResultEvent evt) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
|
package de.dhbwstuttgart.parser.SyntaxTreeGenerator;
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.core.JavaTXCompiler;
|
||||||
import de.dhbwstuttgart.exceptions.DebugException;
|
import de.dhbwstuttgart.exceptions.DebugException;
|
||||||
import de.dhbwstuttgart.parser.NullToken;
|
import de.dhbwstuttgart.parser.NullToken;
|
||||||
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
||||||
@@ -25,8 +26,8 @@ public class FCGenerator {
|
|||||||
*
|
*
|
||||||
* @param availableClasses - Alle geparsten Klassen
|
* @param availableClasses - Alle geparsten Klassen
|
||||||
*/
|
*/
|
||||||
public static Set<UnifyPair> toUnifyFC(Collection<ClassOrInterface> availableClasses, ClassLoader classLoader) throws ClassNotFoundException {
|
public static Set<UnifyPair> toUnifyFC(JavaTXCompiler compiler, Collection<ClassOrInterface> availableClasses, ClassLoader classLoader) throws ClassNotFoundException {
|
||||||
return toFC(availableClasses, classLoader).stream().map(t -> UnifyTypeFactory.convert(t)).collect(Collectors.toSet());
|
return toFC(availableClasses, classLoader).stream().map(t -> UnifyTypeFactory.convert(compiler, t)).collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Set<Pair> toFC(Collection<ClassOrInterface> availableClasses, ClassLoader classLoader) throws ClassNotFoundException {
|
public static Set<Pair> toFC(Collection<ClassOrInterface> availableClasses, ClassLoader classLoader) throws ClassNotFoundException {
|
||||||
@@ -157,7 +158,8 @@ public class FCGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tauscht die GTVs in einem Typ gegen die entsprechenden Typen in der übergebenen Map aus.
|
* Tauscht die GTVs in einem Typ gegen die entsprechenden Typen in der übergebenen Map aus auf der direkten Argumentebene.
|
||||||
|
* Hier sind keine Wildcards zulässig
|
||||||
*/
|
*/
|
||||||
private static class TypeExchanger implements TypeVisitor<RefTypeOrTPHOrWildcardOrGeneric>{
|
private static class TypeExchanger implements TypeVisitor<RefTypeOrTPHOrWildcardOrGeneric>{
|
||||||
|
|
||||||
@@ -171,7 +173,7 @@ public class FCGenerator {
|
|||||||
public RefTypeOrTPHOrWildcardOrGeneric visit(RefType refType) {
|
public RefTypeOrTPHOrWildcardOrGeneric visit(RefType refType) {
|
||||||
List<RefTypeOrTPHOrWildcardOrGeneric> params = new ArrayList<>();
|
List<RefTypeOrTPHOrWildcardOrGeneric> params = new ArrayList<>();
|
||||||
for(RefTypeOrTPHOrWildcardOrGeneric param : refType.getParaList()){
|
for(RefTypeOrTPHOrWildcardOrGeneric param : refType.getParaList()){
|
||||||
params.add(param.acceptTV(this));
|
params.add(param.acceptTV(new TypeExchangerInner(gtvs)));
|
||||||
}
|
}
|
||||||
RefTypeOrTPHOrWildcardOrGeneric ret = new RefType(refType.getName(), params, new NullToken());
|
RefTypeOrTPHOrWildcardOrGeneric ret = new RefType(refType.getName(), params, new NullToken());
|
||||||
return ret;
|
return ret;
|
||||||
@@ -200,4 +202,51 @@ public class FCGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tauscht die GTVs in einem Typ gegen die entsprechenden Typen in der übergebenen Map aus auf den Argumenten der Argumente.
|
||||||
|
* Hier sind Wildcards zulässig
|
||||||
|
*/
|
||||||
|
private static class TypeExchangerInner implements TypeVisitor<RefTypeOrTPHOrWildcardOrGeneric>{
|
||||||
|
|
||||||
|
private final HashMap<String, RefTypeOrTPHOrWildcardOrGeneric> gtvs;
|
||||||
|
|
||||||
|
TypeExchangerInner(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) {
|
||||||
|
return superWildcardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RefTypeOrTPHOrWildcardOrGeneric visit(TypePlaceholder typePlaceholder) {
|
||||||
|
throw new DebugException("Dieser Fall darf nicht auftreten");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RefTypeOrTPHOrWildcardOrGeneric visit(ExtendsWildcardType extendsWildcardType) {
|
||||||
|
return extendsWildcardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RefTypeOrTPHOrWildcardOrGeneric visit(GenericRefType genericRefType) {
|
||||||
|
if(! gtvs.containsKey(genericRefType.getParsedName()))
|
||||||
|
throw new DebugException("Dieser Fall darf nicht auftreten");
|
||||||
|
return gtvs.get(genericRefType.getParsedName());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import de.dhbwstuttgart.core.JavaTXCompiler;
|
|||||||
import de.dhbwstuttgart.syntaxtree.*;
|
import de.dhbwstuttgart.syntaxtree.*;
|
||||||
import de.dhbwstuttgart.syntaxtree.statement.*;
|
import de.dhbwstuttgart.syntaxtree.statement.*;
|
||||||
import de.dhbwstuttgart.syntaxtree.type.Void;
|
import de.dhbwstuttgart.syntaxtree.type.Void;
|
||||||
|
import de.dhbwstuttgart.target.tree.expression.TargetUnaryOp;
|
||||||
|
import de.dhbwstuttgart.target.generate.StatementToTargetExpression;
|
||||||
import org.antlr.v4.runtime.Token;
|
import org.antlr.v4.runtime.Token;
|
||||||
|
|
||||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||||
@@ -101,7 +103,6 @@ import de.dhbwstuttgart.parser.scope.JavaClassRegistry;
|
|||||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||||
import org.stringtemplate.v4.ST;
|
|
||||||
|
|
||||||
public class StatementGenerator {
|
public class StatementGenerator {
|
||||||
|
|
||||||
@@ -125,7 +126,7 @@ public class StatementGenerator {
|
|||||||
this.superClass = superType;
|
this.superClass = superType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ParameterList convert(Java17Parser.FormalParameterListContext formalParameterListContext) {
|
public ParameterList convert(Java17Parser.FormalParameterListContext formalParameterListContext, boolean methodparameters) {
|
||||||
List<Pattern> ret = new ArrayList<>();
|
List<Pattern> ret = new ArrayList<>();
|
||||||
List<Java17Parser.FormalParameterContext> fps = new ArrayList<>();
|
List<Java17Parser.FormalParameterContext> fps = new ArrayList<>();
|
||||||
if (Objects.isNull(formalParameterListContext))
|
if (Objects.isNull(formalParameterListContext))
|
||||||
@@ -147,7 +148,9 @@ public class StatementGenerator {
|
|||||||
if (fp.typeType() != null) {
|
if (fp.typeType() != null) {
|
||||||
type = TypeGenerator.convert(fp.typeType(), reg, generics);
|
type = TypeGenerator.convert(fp.typeType(), reg, generics);
|
||||||
} else {
|
} else {
|
||||||
type = TypePlaceholder.fresh(fp.getStart());
|
type = methodparameters?
|
||||||
|
TypePlaceholder.fresh(fp.getStart(), 1, false)
|
||||||
|
: TypePlaceholder.fresh(fp.getStart(), 1, false);
|
||||||
}
|
}
|
||||||
ret.add(new FormalParameter(paramName, type, fp.getStart()));
|
ret.add(new FormalParameter(paramName, type, fp.getStart()));
|
||||||
localVars.put(paramName, type);
|
localVars.put(paramName, type);
|
||||||
@@ -279,7 +282,8 @@ public class StatementGenerator {
|
|||||||
|
|
||||||
if (!Objects.isNull(creator.classCreatorRest())) {
|
if (!Objects.isNull(creator.classCreatorRest())) {
|
||||||
ArgumentList args = convertArguments(creator.classCreatorRest().arguments().expressionList());
|
ArgumentList args = convertArguments(creator.classCreatorRest().arguments().expressionList());
|
||||||
ArrayList<RefTypeOrTPHOrWildcardOrGeneric> argTypes = args.getArguments().stream().map(x -> TypePlaceholder.fresh(creator.getStart())).collect(Collectors.toCollection(ArrayList::new));
|
ArrayList<TypePlaceholder> argTypes = args.getArguments().stream().map(x -> TypePlaceholder.fresh(creator.getStart())).collect(Collectors.toCollection(ArrayList::new));
|
||||||
|
argTypes.add(TypePlaceholder.fresh(creator.getStart())); // return type
|
||||||
Statement ret = new NewClass(newclass, args, null, argTypes, creator.getStart());
|
Statement ret = new NewClass(newclass, args, null, argTypes, creator.getStart());
|
||||||
ret.setStatement();
|
ret.setStatement();
|
||||||
return ret;
|
return ret;
|
||||||
@@ -310,7 +314,7 @@ public class StatementGenerator {
|
|||||||
IdentifierContext identifier = innercreator.identifier();
|
IdentifierContext identifier = innercreator.identifier();
|
||||||
RefType newclass = (RefType) TypeGenerator.convertTypeName(identifier.getText(), genericArgs, identifier.getStart(), reg, generics);
|
RefType newclass = (RefType) TypeGenerator.convertTypeName(identifier.getText(), genericArgs, identifier.getStart(), reg, generics);
|
||||||
ArgumentList args = convertArguments(innercreator.classCreatorRest().arguments().expressionList());
|
ArgumentList args = convertArguments(innercreator.classCreatorRest().arguments().expressionList());
|
||||||
ArrayList<RefTypeOrTPHOrWildcardOrGeneric> argTypes = args.getArguments().stream().map(x -> TypePlaceholder.fresh(innercreator.getStart())).collect(Collectors.toCollection(ArrayList::new));
|
ArrayList<TypePlaceholder> argTypes = args.getArguments().stream().map(x -> TypePlaceholder.fresh(innercreator.getStart())).collect(Collectors.toCollection(ArrayList::new));
|
||||||
Statement ret = new NewClass(newclass, args, null, argTypes, innercreator.getStart());
|
Statement ret = new NewClass(newclass, args, null, argTypes, innercreator.getStart());
|
||||||
ret.setStatement();
|
ret.setStatement();
|
||||||
return ret;
|
return ret;
|
||||||
@@ -438,6 +442,7 @@ public class StatementGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Pattern convert(PatternContext pattern) {
|
private Pattern convert(PatternContext pattern) {
|
||||||
|
|
||||||
return switch (pattern) {
|
return switch (pattern) {
|
||||||
case PPatternContext pPattern -> {
|
case PPatternContext pPattern -> {
|
||||||
yield convert(pPattern.primaryPattern());
|
yield convert(pPattern.primaryPattern());
|
||||||
@@ -452,30 +457,36 @@ public class StatementGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private FormalParameter convert(PrimaryPatternContext pPattern) {
|
private FormalParameter convert(PrimaryPatternContext pPattern) {
|
||||||
|
|
||||||
switch (pPattern) {
|
switch (pPattern) {
|
||||||
case TPatternContext tPattern:
|
case TPatternContext tPattern:
|
||||||
TypePatternContext typePattern = tPattern.typePattern();
|
TypePatternContext typePattern = tPattern.typePattern();
|
||||||
var text = typePattern.identifier().getText();
|
var text = typePattern.identifier().getText();
|
||||||
var type = TypeGenerator.convert(typePattern.typeType(), reg, generics);
|
var type = typePattern.typeType() == null ? TypePlaceholder.fresh(pPattern.getStart()) : TypeGenerator.convert(typePattern.typeType(), reg, generics);
|
||||||
localVars.put(text, type);
|
localVars.put(text, type);
|
||||||
return new FormalParameter(text, type, typePattern.getStart());
|
return new FormalParameter(text, type, typePattern.getStart());
|
||||||
case RPatternContext rPattern:
|
case RPatternContext rPattern:
|
||||||
RecordPatternContext recordPattern = rPattern.recordPattern();
|
RecordPatternContext recordPattern = rPattern.recordPattern();
|
||||||
return convert(recordPattern);
|
return convert(recordPattern);
|
||||||
default:
|
case Java17Parser.LPatternContext patternContext: return new LiteralPattern(TypePlaceholder.fresh(patternContext.start), convert(patternContext.literal().get(0)), patternContext.start);
|
||||||
throw new NotImplementedException();
|
|
||||||
|
default:
|
||||||
|
throw new NotImplementedException();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private RecordPattern convert(RecordPatternContext recordPatternCtx) {
|
private RecordPattern convert(RecordPatternContext recordPatternCtx) {
|
||||||
List<PatternContext> subPatternCtx = recordPatternCtx.recordStructurePattern().recordComponentPatternList().pattern();
|
var cpl = recordPatternCtx.recordStructurePattern().recordComponentPatternList();
|
||||||
|
List<PatternContext> subPatternCtx = cpl == null ? List.of() : cpl.pattern();
|
||||||
List<Pattern> subPattern = subPatternCtx.stream().map(this::convert).collect(Collectors.toList());
|
List<Pattern> subPattern = subPatternCtx.stream().map(this::convert).collect(Collectors.toList());
|
||||||
IdentifierContext identifierCtx = recordPatternCtx.identifier();
|
IdentifierContext identifierCtx = recordPatternCtx.identifier();
|
||||||
var text = (identifierCtx != null) ? identifierCtx.getText() : null;
|
var text = (identifierCtx != null) ? identifierCtx.getText() : null;
|
||||||
var type = TypeGenerator.convert(recordPatternCtx.typeType(), reg, generics);
|
//Hier evtl. Typ anpassen -> wenn kein Typ bekannt ist push neuen Typ auf Hashtable
|
||||||
|
var type = recordPatternCtx.typeType() == null ? TypePlaceholder.fresh(recordPatternCtx.getStart()) : TypeGenerator.convert(recordPatternCtx.typeType(), reg, generics);
|
||||||
if (text != null) localVars.put(text, type);
|
if (text != null) localVars.put(text, type);
|
||||||
return new RecordPattern(subPattern, text, type, recordPatternCtx.getStart());
|
var ret = new RecordPattern(subPattern, text, type, recordPatternCtx.getStart());
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Statement convert(Java17Parser.WhileloopContext stmt) {
|
private Statement convert(Java17Parser.WhileloopContext stmt) {
|
||||||
@@ -582,7 +593,7 @@ public class StatementGenerator {
|
|||||||
initValue = convert(varDecl.variableInitializer().expression());
|
initValue = convert(varDecl.variableInitializer().expression());
|
||||||
}
|
}
|
||||||
var fieldEntry = fields.get(name.getText());
|
var fieldEntry = fields.get(name.getText());
|
||||||
return (new Assign(new AssignToField(new FieldVar(new This(varDecl.getStart()), (fieldEntry.modifiers() & Modifier.STATIC) != 0, name.getText(), type, varDecl.getStart())), initValue, name.getStart()));
|
return (new Assign(new AssignToField(new FieldVar(new This(varDecl.getStart()), name.getText(), type, varDecl.getStart())), initValue, name.getStart()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Statement convert(Java17Parser.BreakstmtContext stmt) {
|
private Statement convert(Java17Parser.BreakstmtContext stmt) {
|
||||||
@@ -596,8 +607,12 @@ public class StatementGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Statement convert(Java17Parser.ContinuestmtContext stmt) {
|
private Statement convert(Java17Parser.ContinuestmtContext stmt) {
|
||||||
// TODO
|
Token offset = stmt.getStart();
|
||||||
throw new NotImplementedException();
|
if (!Objects.isNull(stmt.identifier())) {
|
||||||
|
return new Continue(localVars.get(stmt.identifier().getText()), offset);
|
||||||
|
} else {
|
||||||
|
return new Continue(TypePlaceholder.fresh(offset), offset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Statement convert(Java17Parser.SemistmtContext stmt) {
|
private Statement convert(Java17Parser.SemistmtContext stmt) {
|
||||||
@@ -692,7 +707,7 @@ public class StatementGenerator {
|
|||||||
if (!Objects.isNull(expr.methodCall())) {
|
if (!Objects.isNull(expr.methodCall())) {
|
||||||
return convert(expr.methodCall(), expr.expression(), offset);
|
return convert(expr.methodCall(), expr.expression(), offset);
|
||||||
} else if (!Objects.isNull(expr.identifier())) {
|
} else if (!Objects.isNull(expr.identifier())) {
|
||||||
return generateLocalOrFieldVarOrClassName(expr.getText(), offset);
|
return new FieldVar(convert(expr.expression()), expr.identifier().getText(), TypePlaceholder.fresh(expr.identifier().start), offset);
|
||||||
} else {
|
} else {
|
||||||
// Für alle anderen Optionen, wie Feldzugriff, Aufrufe von super oder explizite
|
// Für alle anderen Optionen, wie Feldzugriff, Aufrufe von super oder explizite
|
||||||
// generische Invokationen
|
// generische Invokationen
|
||||||
@@ -711,7 +726,7 @@ public class StatementGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArgumentList argumentList = convertArguments(expr.expressionList());
|
ArgumentList argumentList = convertArguments(expr.expressionList());
|
||||||
ArrayList<RefTypeOrTPHOrWildcardOrGeneric> signature = argumentList.getArguments().stream().map(x -> (RefTypeOrTPHOrWildcardOrGeneric) TypePlaceholder.fresh(offset)).collect(Collectors.toCollection(ArrayList::new));
|
ArrayList<TypePlaceholder> signature = argumentList.getArguments().stream().map(x -> TypePlaceholder.fresh(offset)).collect(Collectors.toCollection(ArrayList::new));
|
||||||
signature.add(TypePlaceholder.fresh(offset)); // return type
|
signature.add(TypePlaceholder.fresh(offset)); // return type
|
||||||
|
|
||||||
MethodCall ret;
|
MethodCall ret;
|
||||||
@@ -736,7 +751,7 @@ public class StatementGenerator {
|
|||||||
name = expr.SUPER().getText();
|
name = expr.SUPER().getText();
|
||||||
}
|
}
|
||||||
ArgumentList argumentList = convertArguments(expr.expressionList());
|
ArgumentList argumentList = convertArguments(expr.expressionList());
|
||||||
ArrayList<RefTypeOrTPHOrWildcardOrGeneric> signature = argumentList.getArguments().stream().map(x -> (RefTypeOrTPHOrWildcardOrGeneric) TypePlaceholder.fresh(offset)).collect(Collectors.toCollection(ArrayList::new));
|
ArrayList<TypePlaceholder> signature = argumentList.getArguments().stream().map(x -> TypePlaceholder.fresh(offset)).collect(Collectors.toCollection(ArrayList::new));
|
||||||
signature.add(TypePlaceholder.fresh(offset)); // return type
|
signature.add(TypePlaceholder.fresh(offset)); // return type
|
||||||
MethodCall ret = new MethodCall(TypePlaceholder.fresh(offset), getReceiver(receiver), name, argumentList, TypePlaceholder.fresh(offset), signature, offset);
|
MethodCall ret = new MethodCall(TypePlaceholder.fresh(offset), getReceiver(receiver), name, argumentList, TypePlaceholder.fresh(offset), signature, offset);
|
||||||
ret.setStatement();
|
ret.setStatement();
|
||||||
@@ -774,56 +789,19 @@ public class StatementGenerator {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Expression generateLocalOrFieldVarOrClassName(String expression, Token offset) {
|
private Expression generateLocalOrFieldVarOrClassName(String expression, Token offset) {
|
||||||
String[] parts = expression.split("\\.");
|
// Check for localVar:
|
||||||
if (parts.length < 2) {
|
if (localVars.get(expression) != null) {
|
||||||
// Check for localVar:
|
return new LocalVar(expression, localVars.get(expression), offset);
|
||||||
if (localVars.get(expression) != null) {
|
} else if (fields.get(expression) != null) {// PL 2018-11-01 fields eingefuegt, damit die fields immer die
|
||||||
return new LocalVar(expression, localVars.get(expression), offset);
|
// gleiche TPH bekommen
|
||||||
} else if (fields.get(expression) != null) {// PL 2018-11-01 fields eingefuegt, damit die fields immer die
|
return new FieldVar(new This(offset), expression, fields.get(expression).type(), offset);
|
||||||
// gleiche TPH bekommen
|
} else if (reg.contains(expression)) {
|
||||||
var field = fields.get(expression);
|
return generateStaticClassName(expression, offset);
|
||||||
return new FieldVar(new This(offset), Modifier.isStatic(field.modifiers()), expression, fields.get(expression).type(), offset);
|
|
||||||
} else if (reg.contains(expression)) {
|
|
||||||
return generateStaticClassName(expression, offset);
|
|
||||||
} else {
|
|
||||||
// lokale Variable wurde ohne "var"-Keyword deklariert und direkt mit Wert versehen
|
|
||||||
localVars.put(expression, TypePlaceholder.fresh(offset));
|
|
||||||
return new LocalVar(expression, localVars.get(expression), offset);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return generateFieldVarOrClassname(expression, offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Expression generateFieldVarOrClassname(String expression, Token offset) {
|
|
||||||
String[] parts = expression.split("\\.");
|
|
||||||
String whole = "";
|
|
||||||
Expression receiver = null;
|
|
||||||
for (String part : parts) {
|
|
||||||
whole += part;
|
|
||||||
// Check for Classname:
|
|
||||||
if (reg.contains(whole)) {
|
|
||||||
receiver = generateStaticClassName(whole, offset);
|
|
||||||
}
|
|
||||||
whole += ".";
|
|
||||||
}
|
|
||||||
var fieldName = parts[parts.length - 1];
|
|
||||||
|
|
||||||
var isStatic = false;
|
|
||||||
if (parts.length < 2 || parts[0].contentEquals("this")) {
|
|
||||||
receiver = new This(offset);
|
|
||||||
isStatic = Modifier.isStatic(fields.get(fieldName).modifiers());
|
|
||||||
} else if (parts[0].contentEquals("super")) {
|
|
||||||
receiver = new Super(TypePlaceholder.fresh(offset), offset);
|
|
||||||
isStatic = Modifier.isStatic(compiler.getClass(new JavaClassName(superClass.getName().toString())).getField(fieldName).orElseThrow().modifier);
|
|
||||||
} else if (receiver == null) { // Handelt es sich um keinen Statischen Klassennamen:
|
|
||||||
String part = expression.substring(0, expression.length() - (1 + parts[parts.length - 1].length()));
|
|
||||||
receiver = generateLocalOrFieldVarOrClassName(part, offset);
|
|
||||||
} else {
|
} else {
|
||||||
StaticClassName cname = (StaticClassName) receiver;
|
// lokale Variable wurde ohne "var"-Keyword deklariert und direkt mit Wert versehen
|
||||||
var javaClassName = reg.getName(cname.getType().toString());
|
localVars.put(expression, TypePlaceholder.fresh(offset));
|
||||||
isStatic = Modifier.isStatic(compiler.getClass(javaClassName).getField(fieldName).orElseThrow().modifier);
|
return new LocalVar(expression, localVars.get(expression), offset);
|
||||||
}
|
}
|
||||||
return new FieldVar(receiver, isStatic, fieldName, TypePlaceholder.fresh(offset), offset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression convert(Java17Parser.ArrayaccessexpressionContext arrayaccess) {
|
private Expression convert(Java17Parser.ArrayaccessexpressionContext arrayaccess) {
|
||||||
@@ -831,7 +809,13 @@ public class StatementGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Expression convert(Java17Parser.ConditionalassignexpressionContext expression) {
|
private Expression convert(Java17Parser.ConditionalassignexpressionContext expression) {
|
||||||
throw new NotImplementedException();
|
return new Ternary(TypePlaceholder.fresh(
|
||||||
|
expression.getStart()),
|
||||||
|
convert(expression.expression(0)),
|
||||||
|
convert(expression.expression(1)),
|
||||||
|
convert(expression.expression(2)),
|
||||||
|
expression.getStart()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression convert(Java17Parser.OrexpressionContext expression) {
|
private Expression convert(Java17Parser.OrexpressionContext expression) {
|
||||||
@@ -853,10 +837,8 @@ public class StatementGenerator {
|
|||||||
private Statement convert(AssignexpressionContext expr) {
|
private Statement convert(AssignexpressionContext expr) {
|
||||||
switch (expr.bop.getText()) {
|
switch (expr.bop.getText()) {
|
||||||
case "=":
|
case "=":
|
||||||
ExpressionContext leftside = expr.expression(0);
|
AssignLeftSide leftHandSide = convertAssignLHS(convert(expr.expression(0)));
|
||||||
AssignLeftSide leftHandSide = convert(leftside.getText(), leftside.getStart());
|
return new Assign(leftHandSide, convert(expr.expression(1)), expr.getStart());
|
||||||
Statement ret = new Assign(leftHandSide, convert(expr.expression(1)), expr.getStart());
|
|
||||||
return ret;
|
|
||||||
case "+=":
|
case "+=":
|
||||||
case "-=":
|
case "-=":
|
||||||
case "*=":
|
case "*=":
|
||||||
@@ -873,8 +855,8 @@ public class StatementGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private AssignLeftSide convert(String leftHandSide, Token start) {
|
private AssignLeftSide convertAssignLHS(Expression expr) {
|
||||||
Expression leftSide = generateLocalOrFieldVarOrClassName(leftHandSide, start);
|
Expression leftSide = expr;
|
||||||
if (leftSide instanceof FieldVar)
|
if (leftSide instanceof FieldVar)
|
||||||
return new AssignToField((FieldVar) leftSide);
|
return new AssignToField((FieldVar) leftSide);
|
||||||
else if (leftSide instanceof LocalVar)
|
else if (leftSide instanceof LocalVar)
|
||||||
@@ -884,15 +866,15 @@ public class StatementGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Expression convert(Java17Parser.BitwiseorexpressionContext expression) {
|
private Expression convert(Java17Parser.BitwiseorexpressionContext expression) {
|
||||||
throw new NotImplementedException();
|
return new BinaryExpr(BinaryExpr.Operator.OR, TypePlaceholder.fresh(expression.getStart()), convert(expression.expression(0)), convert(expression.expression(1)), expression.getStart());
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression convert(Java17Parser.BitwisexorexpressionContext expression) {
|
private Expression convert(Java17Parser.BitwisexorexpressionContext expression) {
|
||||||
throw new NotImplementedException();
|
return new BinaryExpr(BinaryExpr.Operator.XOR, TypePlaceholder.fresh(expression.getStart()), convert(expression.expression(0)), convert(expression.expression(1)), expression.getStart());
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression convert(Java17Parser.BitwiseandexpressionContext expression) {
|
private Expression convert(Java17Parser.BitwiseandexpressionContext expression) {
|
||||||
throw new NotImplementedException();
|
return new BinaryExpr(BinaryExpr.Operator.AND, TypePlaceholder.fresh(expression.getStart()), convert(expression.expression(0)), convert(expression.expression(1)), expression.getStart());
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression convert(Java17Parser.EqualityexpressionContext expression) {
|
private Expression convert(Java17Parser.EqualityexpressionContext expression) {
|
||||||
@@ -957,6 +939,8 @@ public class StatementGenerator {
|
|||||||
return BinaryExpr.Operator.EQUAL;
|
return BinaryExpr.Operator.EQUAL;
|
||||||
} else if (operator.equals("!=")) {
|
} else if (operator.equals("!=")) {
|
||||||
return BinaryExpr.Operator.NOTEQUAL;
|
return BinaryExpr.Operator.NOTEQUAL;
|
||||||
|
} else if (operator.equals("%")) {
|
||||||
|
return BinaryExpr.Operator.MOD;
|
||||||
} else {
|
} else {
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
@@ -995,6 +979,9 @@ public class StatementGenerator {
|
|||||||
ret = new UnaryExpr(UnaryExpr.Operation.PREDECREMENT, expr, TypePlaceholder.fresh(op), op);
|
ret = new UnaryExpr(UnaryExpr.Operation.PREDECREMENT, expr, TypePlaceholder.fresh(op), op);
|
||||||
ret.setStatement();
|
ret.setStatement();
|
||||||
return ret;
|
return ret;
|
||||||
|
} else if (op.getText().equals("!")) {
|
||||||
|
ret = new UnaryExpr(UnaryExpr.Operation.NOT, expr, TypePlaceholder.fresh(op), op);
|
||||||
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
@@ -1028,7 +1015,7 @@ public class StatementGenerator {
|
|||||||
case PrimaryThisContext primthis:
|
case PrimaryThisContext primthis:
|
||||||
return new This(primthis.getStart());
|
return new This(primthis.getStart());
|
||||||
case PrimarySuperContext primsuper:
|
case PrimarySuperContext primsuper:
|
||||||
throw new NotImplementedException();
|
return new Super(primsuper.getStart());
|
||||||
case PrimaryLiteralContext primliteral:
|
case PrimaryLiteralContext primliteral:
|
||||||
return convert(primliteral.literal());
|
return convert(primliteral.literal());
|
||||||
case PrimaryIdentifierContext primidentifier:
|
case PrimaryIdentifierContext primidentifier:
|
||||||
@@ -1043,10 +1030,17 @@ public class StatementGenerator {
|
|||||||
private Expression convert(Java17Parser.LiteralContext literal) {
|
private Expression convert(Java17Parser.LiteralContext literal) {
|
||||||
switch (literal) {
|
switch (literal) {
|
||||||
case IntLiteralContext intliteral:
|
case IntLiteralContext intliteral:
|
||||||
Number value = Integer.parseInt(intliteral.getText());
|
Number value;
|
||||||
|
if (intliteral.getText().endsWith("l") || intliteral.getText().endsWith("L"))
|
||||||
|
value = Long.parseLong(intliteral.getText().substring(0, intliteral.getText().length() - 1));
|
||||||
|
else value = Integer.parseInt(intliteral.getText());
|
||||||
return new Literal(TypePlaceholder.fresh(literal.getStart()), value, intliteral.getStart());
|
return new Literal(TypePlaceholder.fresh(literal.getStart()), value, intliteral.getStart());
|
||||||
case FltLiteralContext floatliteral:
|
case FltLiteralContext floatliteral:
|
||||||
value = Double.parseDouble(floatliteral.getText());
|
if (floatliteral.getText().endsWith("f") || floatliteral.getText().endsWith("F"))
|
||||||
|
value = Float.parseFloat(floatliteral.getText().substring(0, floatliteral.getText().length() - 1));
|
||||||
|
else if (floatliteral.getText().endsWith("d") || floatliteral.getText().endsWith("D"))
|
||||||
|
value = Double.parseDouble(floatliteral.getText().substring(0, floatliteral.getText().length() - 1));
|
||||||
|
else value = Double.parseDouble(floatliteral.getText());
|
||||||
return new Literal(TypePlaceholder.fresh(literal.getStart()), value, floatliteral.getStart());
|
return new Literal(TypePlaceholder.fresh(literal.getStart()), value, floatliteral.getStart());
|
||||||
case CharLiteralContext charliteral:
|
case CharLiteralContext charliteral:
|
||||||
RefType type = new RefType(reg.getName("java.lang.Character"), charliteral.getStart());
|
RefType type = new RefType(reg.getName("java.lang.Character"), charliteral.getStart());
|
||||||
@@ -1071,17 +1065,17 @@ public class StatementGenerator {
|
|||||||
List<Pattern> parameterList = new ArrayList<>();
|
List<Pattern> parameterList = new ArrayList<>();
|
||||||
for (IdentifierContext identifier : lambdaParams.identifier()) {
|
for (IdentifierContext identifier : lambdaParams.identifier()) {
|
||||||
Token offset = identifier.getStart();
|
Token offset = identifier.getStart();
|
||||||
parameterList.add(new FormalParameter(identifier.getText(), TypePlaceholder.fresh(offset), offset));
|
parameterList.add(new FormalParameter(identifier.getText(), TypePlaceholder.fresh(offset, 1, false), offset));
|
||||||
}
|
}
|
||||||
params = new ParameterList(parameterList, lambdaParams.getStart());
|
params = new ParameterList(parameterList, lambdaParams.getStart());
|
||||||
} else if (lambdaParams.formalParameterList() != null) {
|
} else if (lambdaParams.formalParameterList() != null) {
|
||||||
params = convert(lambdaParams.formalParameterList());
|
params = convert(lambdaParams.formalParameterList(), false);
|
||||||
// }else if( lambdaParams.inferredFormalParameterList != null){
|
// }else if( lambdaParams.inferredFormalParameterList != null){
|
||||||
} else if (!Objects.isNull(lambdaParams.lambdaLVTIList())) {
|
} else if (!Objects.isNull(lambdaParams.lambdaLVTIList())) {
|
||||||
List<Pattern> parameterList = new ArrayList<>();
|
List<Pattern> parameterList = new ArrayList<>();
|
||||||
for (LambdaLVTIParameterContext param : lambdaParams.lambdaLVTIList().lambdaLVTIParameter()) {
|
for (LambdaLVTIParameterContext param : lambdaParams.lambdaLVTIList().lambdaLVTIParameter()) {
|
||||||
Token offset = param.getStart();
|
Token offset = param.getStart();
|
||||||
parameterList.add(new FormalParameter(param.identifier().getText(), TypePlaceholder.fresh(offset), offset));
|
parameterList.add(new FormalParameter(param.identifier().getText(), TypePlaceholder.fresh(offset, 1, false), offset));
|
||||||
}
|
}
|
||||||
params = new ParameterList(parameterList, lambdaParams.getStart());
|
params = new ParameterList(parameterList, lambdaParams.getStart());
|
||||||
} else {
|
} else {
|
||||||
@@ -1105,9 +1099,9 @@ public class StatementGenerator {
|
|||||||
block = lambdaGenerator.convert(expression.lambdaBody().block(), true);
|
block = lambdaGenerator.convert(expression.lambdaBody().block(), true);
|
||||||
}
|
}
|
||||||
List<RefTypeOrTPHOrWildcardOrGeneric> funNParams = new ArrayList<>();
|
List<RefTypeOrTPHOrWildcardOrGeneric> funNParams = new ArrayList<>();
|
||||||
funNParams.add(TypePlaceholder.fresh(expression.getStart()));// ret-Type
|
funNParams.add(TypePlaceholder.fresh(expression.getStart(), -1, false));// ret-Type
|
||||||
params.getFormalparalist().forEach(formalParameter -> // Für jeden Parameter einen TPH anfügen:
|
params.getFormalparalist().forEach(formalParameter -> // Für jeden Parameter einen TPH anfügen:
|
||||||
funNParams.add(TypePlaceholder.fresh(expression.getStart())));
|
funNParams.add(TypePlaceholder.fresh(expression.getStart(), 1, false)));
|
||||||
RefTypeOrTPHOrWildcardOrGeneric lambdaType = TypePlaceholder.fresh(expression.getStart());
|
RefTypeOrTPHOrWildcardOrGeneric lambdaType = TypePlaceholder.fresh(expression.getStart());
|
||||||
// RefType lambdaType = new
|
// RefType lambdaType = new
|
||||||
// RefType(reg.getName("Fun"+params.getFormalparalist().size()),
|
// RefType(reg.getName("Fun"+params.getFormalparalist().size()),
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ public class SyntacticSugar {
|
|||||||
public void visit(ReturnVoid aReturn) {
|
public void visit(ReturnVoid aReturn) {
|
||||||
hasReturn = true;
|
hasReturn = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void visit(LambdaExpression le) {
|
||||||
|
//PL 2024-04-09 Do nothing, as in a LambdaExpression a return could be
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean hasReturn(Block block) {
|
private static boolean hasReturn(Block block) {
|
||||||
|
|||||||
+15
-16
@@ -71,10 +71,6 @@ import de.dhbwstuttgart.syntaxtree.type.RefType;
|
|||||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||||
import de.dhbwstuttgart.syntaxtree.type.Void;
|
import de.dhbwstuttgart.syntaxtree.type.Void;
|
||||||
import de.dhbwstuttgart.typeinference.constraints.GenericsResolver;
|
|
||||||
import javassist.compiler.SyntaxError;
|
|
||||||
|
|
||||||
import javax.swing.text.html.Option;
|
|
||||||
|
|
||||||
public class SyntaxTreeGenerator {
|
public class SyntaxTreeGenerator {
|
||||||
private JavaClassRegistry reg;
|
private JavaClassRegistry reg;
|
||||||
@@ -258,7 +254,10 @@ public class SyntaxTreeGenerator {
|
|||||||
List<RefType> implementedInterfaces = new ArrayList<>();
|
List<RefType> implementedInterfaces = new ArrayList<>();
|
||||||
List<Pattern> constructorParameters = new ArrayList<>();
|
List<Pattern> constructorParameters = new ArrayList<>();
|
||||||
List<Statement> constructorStatements = new ArrayList<>();
|
List<Statement> constructorStatements = new ArrayList<>();
|
||||||
for (RecordComponentContext component : recordDeclaration.recordHeader().recordComponentList().recordComponent()) {
|
|
||||||
|
List<Java17Parser.RecordComponentContext> components = recordDeclaration.recordHeader().recordComponentList() != null ?
|
||||||
|
recordDeclaration.recordHeader().recordComponentList().recordComponent(): List.of();
|
||||||
|
for (RecordComponentContext component : components) {
|
||||||
int fieldmodifiers = allmodifiers.get("private") + allmodifiers.get("final");
|
int fieldmodifiers = allmodifiers.get("private") + allmodifiers.get("final");
|
||||||
String fieldname = component.identifier().getText();
|
String fieldname = component.identifier().getText();
|
||||||
Token fieldoffset = component.getStart();
|
Token fieldoffset = component.getStart();
|
||||||
@@ -270,7 +269,7 @@ public class SyntaxTreeGenerator {
|
|||||||
}
|
}
|
||||||
fielddecl.add(new Field(fieldname, fieldtype, fieldmodifiers, fieldoffset));
|
fielddecl.add(new Field(fieldname, fieldtype, fieldmodifiers, fieldoffset));
|
||||||
constructorParameters.add(new FormalParameter(fieldname, fieldtype, fieldoffset));
|
constructorParameters.add(new FormalParameter(fieldname, fieldtype, fieldoffset));
|
||||||
FieldVar fieldvar = new FieldVar(new This(offset), false, fieldname, fieldtype, fieldoffset);
|
FieldVar fieldvar = new FieldVar(new This(offset), fieldname, fieldtype, fieldoffset);
|
||||||
constructorStatements.add(new Assign(new AssignToField(fieldvar), new LocalVar(fieldname, fieldtype, fieldoffset), offset));
|
constructorStatements.add(new Assign(new AssignToField(fieldvar), new LocalVar(fieldname, fieldtype, fieldoffset), offset));
|
||||||
Statement returnStatement = new Return(fieldvar, offset);
|
Statement returnStatement = new Return(fieldvar, offset);
|
||||||
methods.add(new Method(allmodifiers.get("public"), fieldname, fieldtype, new ParameterList(new ArrayList<>(), offset), new Block(Arrays.asList(returnStatement), offset), new GenericDeclarationList(new ArrayList<>(), offset), offset));
|
methods.add(new Method(allmodifiers.get("public"), fieldname, fieldtype, new ParameterList(new ArrayList<>(), offset), new Block(Arrays.asList(returnStatement), offset), new GenericDeclarationList(new ArrayList<>(), offset), offset));
|
||||||
@@ -333,7 +332,7 @@ public class SyntaxTreeGenerator {
|
|||||||
|
|
||||||
private ClassOrInterface convertInterface(Java17Parser.InterfaceDeclarationContext ctx, int modifiers) {
|
private ClassOrInterface convertInterface(Java17Parser.InterfaceDeclarationContext ctx, int modifiers) {
|
||||||
this.superClass = new RefType(new JavaClassName("java.lang.Object"), new NullToken());
|
this.superClass = new RefType(new JavaClassName("java.lang.Object"), new NullToken());
|
||||||
String className = this.pkgName.length() > 0 ? this.pkgName + "." : "" + ctx.identifier().getText();
|
String className = (this.pkgName.length() > 0 ? this.pkgName + "." : "") + ctx.identifier().getText();
|
||||||
JavaClassName name = reg.getName(className); // Holt den Package Namen mit dazu
|
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?
|
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());
|
throw new TypeinferenceException("Name " + className + " bereits vorhanden in " + reg.getName(className).toString(), ctx.getStart());
|
||||||
@@ -394,12 +393,12 @@ public class SyntaxTreeGenerator {
|
|||||||
if (!Objects.isNull(ctx.EXTENDS())) {
|
if (!Objects.isNull(ctx.EXTENDS())) {
|
||||||
extendedInterfaces.addAll(convert(ctx.typeList(0), generics));
|
extendedInterfaces.addAll(convert(ctx.typeList(0), generics));
|
||||||
}
|
}
|
||||||
List<RefType> permittedSubtypes = new ArrayList<>();
|
List<RefType> permittedSubtypes = null;
|
||||||
// Ist Bit für 'sealed'-Modifier gesetzt
|
// Ist Bit für 'sealed'-Modifier gesetzt
|
||||||
if ((modifiers & 4096) != 0) {
|
if ((modifiers & 4096) != 0) {
|
||||||
if (!Objects.isNull(ctx.PERMITS())) {
|
if (!Objects.isNull(ctx.PERMITS())) {
|
||||||
// permitted subtypes sind letzte typeList (siehe Grammatikregel 'classDeclaration')
|
// permitted subtypes sind letzte typeList (siehe Grammatikregel 'classDeclaration')
|
||||||
permittedSubtypes.addAll(convert(ctx.typeList(ctx.typeList().size() - 1), generics));
|
permittedSubtypes = new ArrayList<>(convert(ctx.typeList(ctx.typeList().size() - 1), generics));
|
||||||
} else {
|
} else {
|
||||||
// falls sealed modifier ohne 'permits'-List oder umgekehrt
|
// falls sealed modifier ohne 'permits'-List oder umgekehrt
|
||||||
throw new NotImplementedException("Invalid sealed class declaration");
|
throw new NotImplementedException("Invalid sealed class declaration");
|
||||||
@@ -436,7 +435,7 @@ public class SyntaxTreeGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
StatementGenerator stmtgen = new StatementGenerator(superClass, compiler, reg, generics, fields, new HashMap<>());
|
StatementGenerator stmtgen = new StatementGenerator(superClass, compiler, reg, generics, fields, new HashMap<>());
|
||||||
ParameterList paramlist = stmtgen.convert(bodydeclaration.formalParameters().formalParameterList());
|
ParameterList paramlist = stmtgen.convert(bodydeclaration.formalParameters().formalParameterList(), true);
|
||||||
MethodBodyContext body = bodydeclaration.methodBody();
|
MethodBodyContext body = bodydeclaration.methodBody();
|
||||||
Block block = null;
|
Block block = null;
|
||||||
if (!(body instanceof EmptymethodContext)) {
|
if (!(body instanceof EmptymethodContext)) {
|
||||||
@@ -452,8 +451,8 @@ public class SyntaxTreeGenerator {
|
|||||||
protected static Block prepareBlock(Block constructorBlock, RefType superClass) {
|
protected static Block prepareBlock(Block constructorBlock, RefType superClass) {
|
||||||
List<Statement> statements = constructorBlock.getStatements();
|
List<Statement> statements = constructorBlock.getStatements();
|
||||||
if (statements.isEmpty() || !(statements.get(0) instanceof SuperCall || statements.get(0) instanceof ThisCall)) {
|
if (statements.isEmpty() || !(statements.get(0) instanceof SuperCall || statements.get(0) instanceof ThisCall)) {
|
||||||
var signature = new ArrayList<RefTypeOrTPHOrWildcardOrGeneric>();
|
var signature = new ArrayList<TypePlaceholder>();
|
||||||
signature.add(new Void(new NullToken()));
|
signature.add(TypePlaceholder.fresh(new NullToken()));
|
||||||
statements.add(0, new SuperCall(superClass, signature, constructorBlock.getOffset()));
|
statements.add(0, new SuperCall(superClass, signature, constructorBlock.getOffset()));
|
||||||
}
|
}
|
||||||
/* statements.addAll(fieldInitializations); geloescht PL 2018-11-24 */
|
/* statements.addAll(fieldInitializations); geloescht PL 2018-11-24 */
|
||||||
@@ -533,7 +532,7 @@ public class SyntaxTreeGenerator {
|
|||||||
|
|
||||||
RefTypeOrTPHOrWildcardOrGeneric retType;
|
RefTypeOrTPHOrWildcardOrGeneric retType;
|
||||||
if (Objects.isNull(header.refType())) {
|
if (Objects.isNull(header.refType())) {
|
||||||
retType = TypePlaceholder.fresh(header.getStart());
|
retType = TypePlaceholder.fresh(header.getStart(), -1, false);
|
||||||
} else {
|
} else {
|
||||||
if (header.refType() instanceof RefType2Context reftype) {
|
if (header.refType() instanceof RefType2Context reftype) {
|
||||||
retType = TypeGenerator.convert(reftype.typeType(), reg, generics);
|
retType = TypeGenerator.convert(reftype.typeType(), reg, generics);
|
||||||
@@ -542,7 +541,7 @@ public class SyntaxTreeGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
StatementGenerator stmtgen = new StatementGenerator(superClass, compiler, reg, localgenerics, fields, new HashMap<>());
|
StatementGenerator stmtgen = new StatementGenerator(superClass, compiler, reg, localgenerics, fields, new HashMap<>());
|
||||||
ParameterList paramlist = stmtgen.convert(header.formalParameters().formalParameterList());
|
ParameterList paramlist = stmtgen.convert(header.formalParameters().formalParameterList(), true);
|
||||||
MethodBodyContext body = methoddeclaration.methodBody();
|
MethodBodyContext body = methoddeclaration.methodBody();
|
||||||
Block block = null;
|
Block block = null;
|
||||||
if (body instanceof EmptymethodContext emptymethod) {
|
if (body instanceof EmptymethodContext emptymethod) {
|
||||||
@@ -582,7 +581,7 @@ public class SyntaxTreeGenerator {
|
|||||||
}
|
}
|
||||||
RefTypeOrTPHOrWildcardOrGeneric retType = TypeGenerator.convertTypeName(name, constructordeclaration.getStart(), reg, localgenerics);
|
RefTypeOrTPHOrWildcardOrGeneric retType = TypeGenerator.convertTypeName(name, constructordeclaration.getStart(), reg, localgenerics);
|
||||||
StatementGenerator stmtgen = new StatementGenerator(superClass, compiler, reg, localgenerics, fields, new HashMap<>());
|
StatementGenerator stmtgen = new StatementGenerator(superClass, compiler, reg, localgenerics, fields, new HashMap<>());
|
||||||
ParameterList paramlist = stmtgen.convert(constructordeclaration.formalParameters().formalParameterList());
|
ParameterList paramlist = stmtgen.convert(constructordeclaration.formalParameters().formalParameterList(), true);
|
||||||
Block block = prepareBlock(stmtgen.convert(constructordeclaration.constructorBody, true), superClass);
|
Block block = prepareBlock(stmtgen.convert(constructordeclaration.constructorBody, true), superClass);
|
||||||
return new Constructor(modifiers, name, retType, paramlist, block, gtvDeclarations, constructordeclaration.getStart());
|
return new Constructor(modifiers, name, retType, paramlist, block, gtvDeclarations, constructordeclaration.getStart());
|
||||||
}
|
}
|
||||||
@@ -595,7 +594,7 @@ public class SyntaxTreeGenerator {
|
|||||||
} else {
|
} else {
|
||||||
// PL 2019-12-06: variableDeclaratorList() eingefuegt, um als Token nicht die
|
// PL 2019-12-06: variableDeclaratorList() eingefuegt, um als Token nicht die
|
||||||
// Modifier zu bekommen
|
// Modifier zu bekommen
|
||||||
fieldType = TypePlaceholder.fresh(fieldDeclContext.variableDeclarators().getStart());
|
fieldType = TypePlaceholder.fresh(fieldDeclContext.variableDeclarators().getStart(), -1, false);
|
||||||
}
|
}
|
||||||
for (Java17Parser.VariableDeclaratorContext varDecl : fieldDeclContext.variableDeclarators().variableDeclarator()) {
|
for (Java17Parser.VariableDeclaratorContext varDecl : fieldDeclContext.variableDeclarators().variableDeclarator()) {
|
||||||
String fieldName = varDecl.variableDeclaratorId().getText();
|
String fieldName = varDecl.variableDeclaratorId().getText();
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ public class TypeGenerator {
|
|||||||
return new RefType(ASTFactory.createClass(Integer.class).getClassName(), typeContext.getStart());
|
return new RefType(ASTFactory.createClass(Integer.class).getClassName(), typeContext.getStart());
|
||||||
case "double":
|
case "double":
|
||||||
return new RefType(ASTFactory.createClass(Double.class).getClassName(), typeContext.getStart());
|
return new RefType(ASTFactory.createClass(Double.class).getClassName(), typeContext.getStart());
|
||||||
|
case "float":
|
||||||
|
return new RefType(ASTFactory.createClass(Float.class).getClassName(), typeContext.getStart());
|
||||||
default:
|
default:
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,8 @@ public class GatherNames {
|
|||||||
if (importDeclCtx.MUL() == null) {
|
if (importDeclCtx.MUL() == null) {
|
||||||
var name = importDeclCtx.qualifiedName().getText();
|
var name = importDeclCtx.qualifiedName().getText();
|
||||||
var className = new JavaClassName(name);
|
var className = new JavaClassName(name);
|
||||||
if (compiler.loadJavaTXClass(className)) {
|
var clazz = compiler.loadJavaTXClass(className);
|
||||||
|
if (clazz != null) {
|
||||||
ret.put(name, compiler.classRegistry.getNumberOfGenerics(name));
|
ret.put(name, compiler.classRegistry.getNumberOfGenerics(name));
|
||||||
} else {
|
} else {
|
||||||
Class<?> cl = compiler.getClassLoader().loadClass(name);
|
Class<?> cl = compiler.getClassLoader().loadClass(name);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class JavaClassName {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gibt von einem Klassennamen nur den Namen der Klasse zur�ck
|
* Gibt von einem Klassennamen nur den Namen der Klasse zurück
|
||||||
* Beispiel:
|
* Beispiel:
|
||||||
* java.lang.Object wird zu: Object
|
* java.lang.Object wird zu: Object
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import de.dhbwstuttgart.exceptions.NotImplementedException;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Speichert die Klassen f�r einen bestimmten Projektscope
|
* Speichert die Klassen für einen bestimmten Projektscope
|
||||||
*/
|
*/
|
||||||
public class JavaClassRegistry {
|
public class JavaClassRegistry{
|
||||||
final Map<JavaClassName, Integer> existingClasses = new HashMap<>();
|
final Map<JavaClassName, Integer> existingClasses = new HashMap<>();
|
||||||
|
|
||||||
public JavaClassRegistry(Map<String, Integer> initialNames) {
|
public JavaClassRegistry(Map<String, Integer> initialNames) {
|
||||||
@@ -22,6 +22,10 @@ public class JavaClassRegistry {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<JavaClassName> getAllClassNames(){
|
||||||
|
return existingClasses.keySet();
|
||||||
|
}
|
||||||
|
|
||||||
public void addName(String className, int numberOfGenerics) {
|
public void addName(String className, int numberOfGenerics) {
|
||||||
existingClasses.put(new JavaClassName(className), numberOfGenerics);
|
existingClasses.put(new JavaClassName(className), numberOfGenerics);
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user