mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 17:28:03 +00:00
Handling Merge
This commit is contained in:
commit
70d933a398
@ -1,8 +1,7 @@
|
||||
grammar Decaf;
|
||||
|
||||
program : (class)+;
|
||||
|
||||
class : PUBLIC? 'class' id '{' mainmeth? (field | meth | constructor)* '}';
|
||||
class : PUBLIC 'class' id '{' mainmeth? (field | meth | constructor)* '}';
|
||||
|
||||
field : type id ';';
|
||||
localVar : type id ';';
|
||||
@ -10,7 +9,7 @@ assignSign : ASSIGN | ADD_ASSIGN | SUB_ASSIGN | MUL_ASSIGN;
|
||||
returntype : type | VOID;
|
||||
type : INT | BOOL | CHAR | id;
|
||||
|
||||
meth : PUBLIC? returntype id '(' params? ')' block;
|
||||
meth : PUBLIC returntype id '(' params? ')' block;
|
||||
mainmeth : PUBLIC 'static' 'void' 'main' '(' 'String[] args' ')' block;
|
||||
constructor: PUBLIC? id '(' params? ')' block;
|
||||
params : param (',' param)*;
|
||||
@ -25,7 +24,6 @@ stmt : 'if' '(' expr ')' block ('else' block)? #If
|
||||
| 'return' expr ';' #Return
|
||||
| 'return' ';' #ReturnVoid
|
||||
| 'break' ';' #Break
|
||||
| 'continue' ';' #Continue
|
||||
| assign ';' #Assignment
|
||||
| stmtexpr ';' #StatementExpressionstmt
|
||||
;
|
||||
|
@ -11,16 +11,8 @@ import java.util.List;
|
||||
|
||||
public class ASTGenerator {
|
||||
|
||||
public static Program generateAST(DecafParser.ProgramContext parseTree) {
|
||||
List<Class> classes = new ArrayList<>();
|
||||
for (DecafParser.ClassContext cctx : parseTree.class_()) {
|
||||
classes.add(generateClass(cctx));
|
||||
}
|
||||
return new Program(classes);
|
||||
}
|
||||
|
||||
public static Class generateClass(DecafParser.ClassContext ctx) {
|
||||
Boolean isPublic = ctx.PUBLIC() != null;
|
||||
public static Class generateAST(DecafParser.ClassContext ctx) {
|
||||
List<Field> fields = new ArrayList<>();
|
||||
if (ctx.field() != null) {
|
||||
fields = ctx.field().stream().map(ASTGenerator::generateFieldVariable).toList();
|
||||
@ -38,7 +30,7 @@ public class ASTGenerator {
|
||||
meths = ctx.meth().stream().map(ASTGenerator::generateMethod).toList();
|
||||
}
|
||||
Id classId = new Id(ctx.id().getText());
|
||||
return new Class(isPublic, classId, fields, meths, mainMethod, constructors);
|
||||
return new Class(classId, fields, meths, mainMethod, constructors);
|
||||
}
|
||||
|
||||
public static Field generateFieldVariable(DecafParser.FieldContext ctx) {
|
||||
@ -52,14 +44,13 @@ public class ASTGenerator {
|
||||
}
|
||||
|
||||
public static Method generateMethod(DecafParser.MethContext ctx) {
|
||||
Boolean isPublic = ctx.PUBLIC() != null;
|
||||
List<Parameter> params = new ArrayList<>();
|
||||
if (ctx.params() != null) {
|
||||
params = ctx.params().param().stream().map(ASTGenerator::generateParameter).toList();
|
||||
}
|
||||
Block block = new BlockGenerator().visit(ctx.block());
|
||||
Id methId = new Id(ctx.id().getText());
|
||||
return new Method(isPublic, getReturnType(ctx.returntype()), methId, params, block);
|
||||
return new Method(getReturnType(ctx.returntype()), methId, params, block);
|
||||
}
|
||||
|
||||
public static Constructor generateConstructor(DecafParser.ConstructorContext ctx) {
|
||||
|
@ -2,7 +2,7 @@ package de.maishai;
|
||||
|
||||
import de.maishai.antlr.DecafLexer;
|
||||
import de.maishai.antlr.DecafParser;
|
||||
import de.maishai.ast.records.Program;
|
||||
import de.maishai.ast.records.Class;
|
||||
import org.antlr.v4.runtime.CharStream;
|
||||
import org.antlr.v4.runtime.CharStreams;
|
||||
import org.antlr.v4.runtime.CommonTokenStream;
|
||||
@ -12,13 +12,14 @@ import org.antlr.v4.runtime.CommonTokenStream;
|
||||
*/
|
||||
public class Compiler {
|
||||
|
||||
public static Program generateAST(String fromSource) {
|
||||
public static Class generateAST(String fromSource) {
|
||||
CharStream input = CharStreams.fromString(fromSource);
|
||||
DecafLexer lexer = new DecafLexer(input);
|
||||
CommonTokenStream tokens = new CommonTokenStream(lexer);
|
||||
DecafParser parser = new DecafParser(tokens);
|
||||
DecafParser.ProgramContext tree = parser.program(); //Parsen
|
||||
return ASTGenerator.generateAST(tree);
|
||||
DecafParser.ClassContext tree = parser.class_(); //Parsen
|
||||
Class ast = ASTGenerator.generateAST(tree);
|
||||
return ast;
|
||||
}
|
||||
|
||||
|
||||
|
@ -61,11 +61,6 @@ public class StatementGenerator extends DecafBaseVisitor<Statement> {
|
||||
return new Break();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement visitContinue(DecafParser.ContinueContext ctx) {
|
||||
return new Continue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement visitAssignment(DecafParser.AssignmentContext ctx) {
|
||||
return generateAssign(ctx.assign());
|
||||
|
File diff suppressed because one or more lines are too long
@ -16,36 +16,35 @@ T__14=15
|
||||
T__15=16
|
||||
T__16=17
|
||||
T__17=18
|
||||
T__18=19
|
||||
PUBLIC=20
|
||||
NEW=21
|
||||
NULL=22
|
||||
THIS=23
|
||||
SUB=24
|
||||
ADD=25
|
||||
MUL=26
|
||||
GT=27
|
||||
LT=28
|
||||
GE=29
|
||||
LE=30
|
||||
EQ=31
|
||||
NE=32
|
||||
AND=33
|
||||
OR=34
|
||||
ASSIGN=35
|
||||
ADD_ASSIGN=36
|
||||
SUB_ASSIGN=37
|
||||
MUL_ASSIGN=38
|
||||
NOT=39
|
||||
INT=40
|
||||
BOOL=41
|
||||
VOID=42
|
||||
CHAR=43
|
||||
BOOLEANLITERAL=44
|
||||
CHARLITERAL=45
|
||||
IDENTIFIER=46
|
||||
NUMBER=47
|
||||
WS=48
|
||||
PUBLIC=19
|
||||
NEW=20
|
||||
NULL=21
|
||||
THIS=22
|
||||
SUB=23
|
||||
ADD=24
|
||||
MUL=25
|
||||
GT=26
|
||||
LT=27
|
||||
GE=28
|
||||
LE=29
|
||||
EQ=30
|
||||
NE=31
|
||||
AND=32
|
||||
OR=33
|
||||
ASSIGN=34
|
||||
ADD_ASSIGN=35
|
||||
SUB_ASSIGN=36
|
||||
MUL_ASSIGN=37
|
||||
NOT=38
|
||||
INT=39
|
||||
BOOL=40
|
||||
VOID=41
|
||||
CHAR=42
|
||||
BOOLEANLITERAL=43
|
||||
CHARLITERAL=44
|
||||
IDENTIFIER=45
|
||||
NUMBER=46
|
||||
WS=47
|
||||
'class'=1
|
||||
'{'=2
|
||||
'}'=3
|
||||
@ -63,29 +62,28 @@ WS=48
|
||||
'do'=15
|
||||
'return'=16
|
||||
'break'=17
|
||||
'continue'=18
|
||||
'.'=19
|
||||
'public'=20
|
||||
'new'=21
|
||||
'null'=22
|
||||
'this'=23
|
||||
'-'=24
|
||||
'+'=25
|
||||
'*'=26
|
||||
'>'=27
|
||||
'<'=28
|
||||
'>='=29
|
||||
'<='=30
|
||||
'=='=31
|
||||
'!='=32
|
||||
'&&'=33
|
||||
'||'=34
|
||||
'='=35
|
||||
'+='=36
|
||||
'-='=37
|
||||
'*='=38
|
||||
'!'=39
|
||||
'int'=40
|
||||
'boolean'=41
|
||||
'void'=42
|
||||
'char'=43
|
||||
'.'=18
|
||||
'public'=19
|
||||
'new'=20
|
||||
'null'=21
|
||||
'this'=22
|
||||
'-'=23
|
||||
'+'=24
|
||||
'*'=25
|
||||
'>'=26
|
||||
'<'=27
|
||||
'>='=28
|
||||
'<='=29
|
||||
'=='=30
|
||||
'!='=31
|
||||
'&&'=32
|
||||
'||'=33
|
||||
'='=34
|
||||
'+='=35
|
||||
'-='=36
|
||||
'*='=37
|
||||
'!'=38
|
||||
'int'=39
|
||||
'boolean'=40
|
||||
'void'=41
|
||||
'char'=42
|
||||
|
@ -12,18 +12,6 @@ import org.antlr.v4.runtime.tree.TerminalNode;
|
||||
*/
|
||||
@SuppressWarnings("CheckReturnValue")
|
||||
public class DecafBaseListener implements DecafListener {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterProgram(DecafParser.ProgramContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitProgram(DecafParser.ProgramContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
@ -252,18 +240,6 @@ public class DecafBaseListener implements DecafListener {
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitBreak(DecafParser.BreakContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterContinue(DecafParser.ContinueContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitContinue(DecafParser.ContinueContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
|
@ -12,13 +12,6 @@ import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
|
||||
*/
|
||||
@SuppressWarnings("CheckReturnValue")
|
||||
public class DecafBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements DecafVisitor<T> {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitProgram(DecafParser.ProgramContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
@ -152,13 +145,6 @@ public class DecafBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitBreak(DecafParser.BreakContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitContinue(DecafParser.ContinueContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
|
File diff suppressed because one or more lines are too long
@ -19,11 +19,10 @@ public class DecafLexer extends Lexer {
|
||||
public static final int
|
||||
T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9,
|
||||
T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17,
|
||||
T__17=18, T__18=19, PUBLIC=20, NEW=21, NULL=22, THIS=23, SUB=24, ADD=25,
|
||||
MUL=26, GT=27, LT=28, GE=29, LE=30, EQ=31, NE=32, AND=33, OR=34, ASSIGN=35,
|
||||
ADD_ASSIGN=36, SUB_ASSIGN=37, MUL_ASSIGN=38, NOT=39, INT=40, BOOL=41,
|
||||
VOID=42, CHAR=43, BOOLEANLITERAL=44, CHARLITERAL=45, IDENTIFIER=46, NUMBER=47,
|
||||
WS=48;
|
||||
T__17=18, PUBLIC=19, NEW=20, NULL=21, THIS=22, SUB=23, ADD=24, MUL=25,
|
||||
GT=26, LT=27, GE=28, LE=29, EQ=30, NE=31, AND=32, OR=33, ASSIGN=34, ADD_ASSIGN=35,
|
||||
SUB_ASSIGN=36, MUL_ASSIGN=37, NOT=38, INT=39, BOOL=40, VOID=41, CHAR=42,
|
||||
BOOLEANLITERAL=43, CHARLITERAL=44, IDENTIFIER=45, NUMBER=46, WS=47;
|
||||
public static String[] channelNames = {
|
||||
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
|
||||
};
|
||||
@ -36,9 +35,9 @@ public class DecafLexer extends Lexer {
|
||||
return new String[] {
|
||||
"T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8",
|
||||
"T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16",
|
||||
"T__17", "T__18", "PUBLIC", "NEW", "NULL", "THIS", "SUB", "ADD", "MUL",
|
||||
"GT", "LT", "GE", "LE", "EQ", "NE", "AND", "OR", "ASSIGN", "ADD_ASSIGN",
|
||||
"SUB_ASSIGN", "MUL_ASSIGN", "NOT", "INT", "BOOL", "VOID", "CHAR", "BOOLEANLITERAL",
|
||||
"T__17", "PUBLIC", "NEW", "NULL", "THIS", "SUB", "ADD", "MUL", "GT",
|
||||
"LT", "GE", "LE", "EQ", "NE", "AND", "OR", "ASSIGN", "ADD_ASSIGN", "SUB_ASSIGN",
|
||||
"MUL_ASSIGN", "NOT", "INT", "BOOL", "VOID", "CHAR", "BOOLEANLITERAL",
|
||||
"CHARLITERAL", "IDENTIFIER", "NUMBER", "WS"
|
||||
};
|
||||
}
|
||||
@ -48,21 +47,21 @@ public class DecafLexer extends Lexer {
|
||||
return new String[] {
|
||||
null, "'class'", "'{'", "'}'", "';'", "'('", "')'", "'static'", "'main'",
|
||||
"'String[] args'", "','", "'if'", "'else'", "'for'", "'while'", "'do'",
|
||||
"'return'", "'break'", "'continue'", "'.'", "'public'", "'new'", "'null'",
|
||||
"'this'", "'-'", "'+'", "'*'", "'>'", "'<'", "'>='", "'<='", "'=='",
|
||||
"'!='", "'&&'", "'||'", "'='", "'+='", "'-='", "'*='", "'!'", "'int'",
|
||||
"'boolean'", "'void'", "'char'"
|
||||
"'return'", "'break'", "'.'", "'public'", "'new'", "'null'", "'this'",
|
||||
"'-'", "'+'", "'*'", "'>'", "'<'", "'>='", "'<='", "'=='", "'!='", "'&&'",
|
||||
"'||'", "'='", "'+='", "'-='", "'*='", "'!'", "'int'", "'boolean'", "'void'",
|
||||
"'char'"
|
||||
};
|
||||
}
|
||||
private static final String[] _LITERAL_NAMES = makeLiteralNames();
|
||||
private static String[] makeSymbolicNames() {
|
||||
return new String[] {
|
||||
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||
null, null, null, null, null, null, null, null, "PUBLIC", "NEW", "NULL",
|
||||
"THIS", "SUB", "ADD", "MUL", "GT", "LT", "GE", "LE", "EQ", "NE", "AND",
|
||||
"OR", "ASSIGN", "ADD_ASSIGN", "SUB_ASSIGN", "MUL_ASSIGN", "NOT", "INT",
|
||||
"BOOL", "VOID", "CHAR", "BOOLEANLITERAL", "CHARLITERAL", "IDENTIFIER",
|
||||
"NUMBER", "WS"
|
||||
null, null, null, null, null, null, null, "PUBLIC", "NEW", "NULL", "THIS",
|
||||
"SUB", "ADD", "MUL", "GT", "LT", "GE", "LE", "EQ", "NE", "AND", "OR",
|
||||
"ASSIGN", "ADD_ASSIGN", "SUB_ASSIGN", "MUL_ASSIGN", "NOT", "INT", "BOOL",
|
||||
"VOID", "CHAR", "BOOLEANLITERAL", "CHARLITERAL", "IDENTIFIER", "NUMBER",
|
||||
"WS"
|
||||
};
|
||||
}
|
||||
private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
|
||||
@ -124,7 +123,7 @@ public class DecafLexer extends Lexer {
|
||||
public ATN getATN() { return _ATN; }
|
||||
|
||||
public static final String _serializedATN =
|
||||
"\u0004\u00000\u012b\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+
|
||||
"\u0004\u0000/\u0120\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"+
|
||||
@ -137,170 +136,164 @@ public class DecafLexer extends Lexer {
|
||||
"\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/\u0001\u0000"+
|
||||
"\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0001"+
|
||||
"\u0001\u0001\u0001\u0002\u0001\u0002\u0001\u0003\u0001\u0003\u0001\u0004"+
|
||||
"\u0001\u0004\u0001\u0005\u0001\u0005\u0001\u0006\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\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001"+
|
||||
"\b\u0001\t\u0001\t\u0001\n\u0001\n\u0001\n\u0001\u000b\u0001\u000b\u0001"+
|
||||
"\u000b\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001\f\u0001\f\u0001\r"+
|
||||
"\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\u000e\u0001\u000e\u0001"+
|
||||
"\u000e\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001"+
|
||||
"\u000f\u0001\u000f\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\u0011\u0001\u0011\u0001\u0011\u0001\u0012\u0001"+
|
||||
"\u0012\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001"+
|
||||
"\u0013\u0001\u0013\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001"+
|
||||
"+\u0002,\u0007,\u0002-\u0007-\u0002.\u0007.\u0001\u0000\u0001\u0000\u0001"+
|
||||
"\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0001"+
|
||||
"\u0002\u0001\u0002\u0001\u0003\u0001\u0003\u0001\u0004\u0001\u0004\u0001"+
|
||||
"\u0005\u0001\u0005\u0001\u0006\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"+
|
||||
"\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001\t\u0001"+
|
||||
"\t\u0001\n\u0001\n\u0001\n\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b"+
|
||||
"\u0001\u000b\u0001\f\u0001\f\u0001\f\u0001\f\u0001\r\u0001\r\u0001\r\u0001"+
|
||||
"\r\u0001\r\u0001\r\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000f\u0001"+
|
||||
"\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001"+
|
||||
"\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001"+
|
||||
"\u0011\u0001\u0011\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001"+
|
||||
"\u0012\u0001\u0012\u0001\u0012\u0001\u0013\u0001\u0013\u0001\u0013\u0001"+
|
||||
"\u0013\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001"+
|
||||
"\u0015\u0001\u0015\u0001\u0015\u0001\u0015\u0001\u0015\u0001\u0016\u0001"+
|
||||
"\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0017\u0001\u0017\u0001"+
|
||||
"\u0018\u0001\u0018\u0001\u0019\u0001\u0019\u0001\u001a\u0001\u001a\u0001"+
|
||||
"\u001b\u0001\u001b\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001d\u0001"+
|
||||
"\u001d\u0001\u001d\u0001\u001e\u0001\u001e\u0001\u001e\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"+
|
||||
"\u0016\u0001\u0017\u0001\u0017\u0001\u0018\u0001\u0018\u0001\u0019\u0001"+
|
||||
"\u0019\u0001\u001a\u0001\u001a\u0001\u001b\u0001\u001b\u0001\u001b\u0001"+
|
||||
"\u001c\u0001\u001c\u0001\u001c\u0001\u001d\u0001\u001d\u0001\u001d\u0001"+
|
||||
"\u001e\u0001\u001e\u0001\u001e\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+\u0003+\u0118\b+\u0001,\u0001,\u0001,\u0001,\u0001-\u0004"+
|
||||
"-\u011f\b-\u000b-\f-\u0120\u0001.\u0004.\u0124\b.\u000b.\f.\u0125\u0001"+
|
||||
"/\u0001/\u0001/\u0001/\u0000\u00000\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\u001c"+
|
||||
"9\u001d;\u001e=\u001f? A!C\"E#G$I%K&M\'O(Q)S*U+W,Y-[.]/_0\u0001\u0000"+
|
||||
"\u0004\u0001\u0000\'\'\u0002\u0000AZaz\u0001\u000009\u0003\u0000\t\n\r"+
|
||||
"\r \u012d\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\u0000"+
|
||||
"3\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\u0000"+
|
||||
"A\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\u0000"+
|
||||
"O\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\u0001a\u0001"+
|
||||
"\u0000\u0000\u0000\u0003g\u0001\u0000\u0000\u0000\u0005i\u0001\u0000\u0000"+
|
||||
"\u0000\u0007k\u0001\u0000\u0000\u0000\tm\u0001\u0000\u0000\u0000\u000b"+
|
||||
"o\u0001\u0000\u0000\u0000\rq\u0001\u0000\u0000\u0000\u000fx\u0001\u0000"+
|
||||
"\u0000\u0000\u0011}\u0001\u0000\u0000\u0000\u0013\u008b\u0001\u0000\u0000"+
|
||||
"\u0000\u0015\u008d\u0001\u0000\u0000\u0000\u0017\u0090\u0001\u0000\u0000"+
|
||||
"\u0000\u0019\u0095\u0001\u0000\u0000\u0000\u001b\u0099\u0001\u0000\u0000"+
|
||||
"\u0000\u001d\u009f\u0001\u0000\u0000\u0000\u001f\u00a2\u0001\u0000\u0000"+
|
||||
"\u0000!\u00a9\u0001\u0000\u0000\u0000#\u00af\u0001\u0000\u0000\u0000%"+
|
||||
"\u00b8\u0001\u0000\u0000\u0000\'\u00ba\u0001\u0000\u0000\u0000)\u00c1"+
|
||||
"\u0001\u0000\u0000\u0000+\u00c5\u0001\u0000\u0000\u0000-\u00ca\u0001\u0000"+
|
||||
"\u0000\u0000/\u00cf\u0001\u0000\u0000\u00001\u00d1\u0001\u0000\u0000\u0000"+
|
||||
"3\u00d3\u0001\u0000\u0000\u00005\u00d5\u0001\u0000\u0000\u00007\u00d7"+
|
||||
"\u0001\u0000\u0000\u00009\u00d9\u0001\u0000\u0000\u0000;\u00dc\u0001\u0000"+
|
||||
"\u0000\u0000=\u00df\u0001\u0000\u0000\u0000?\u00e2\u0001\u0000\u0000\u0000"+
|
||||
"A\u00e5\u0001\u0000\u0000\u0000C\u00e8\u0001\u0000\u0000\u0000E\u00eb"+
|
||||
"\u0001\u0000\u0000\u0000G\u00ed\u0001\u0000\u0000\u0000I\u00f0\u0001\u0000"+
|
||||
"\u0000\u0000K\u00f3\u0001\u0000\u0000\u0000M\u00f6\u0001\u0000\u0000\u0000"+
|
||||
"O\u00f8\u0001\u0000\u0000\u0000Q\u00fc\u0001\u0000\u0000\u0000S\u0104"+
|
||||
"\u0001\u0000\u0000\u0000U\u0109\u0001\u0000\u0000\u0000W\u0117\u0001\u0000"+
|
||||
"\u0000\u0000Y\u0119\u0001\u0000\u0000\u0000[\u011e\u0001\u0000\u0000\u0000"+
|
||||
"]\u0123\u0001\u0000\u0000\u0000_\u0127\u0001\u0000\u0000\u0000ab\u0005"+
|
||||
"c\u0000\u0000bc\u0005l\u0000\u0000cd\u0005a\u0000\u0000de\u0005s\u0000"+
|
||||
"\u0000ef\u0005s\u0000\u0000f\u0002\u0001\u0000\u0000\u0000gh\u0005{\u0000"+
|
||||
"\u0000h\u0004\u0001\u0000\u0000\u0000ij\u0005}\u0000\u0000j\u0006\u0001"+
|
||||
"\u0000\u0000\u0000kl\u0005;\u0000\u0000l\b\u0001\u0000\u0000\u0000mn\u0005"+
|
||||
"(\u0000\u0000n\n\u0001\u0000\u0000\u0000op\u0005)\u0000\u0000p\f\u0001"+
|
||||
"\u0000\u0000\u0000qr\u0005s\u0000\u0000rs\u0005t\u0000\u0000st\u0005a"+
|
||||
"\u0000\u0000tu\u0005t\u0000\u0000uv\u0005i\u0000\u0000vw\u0005c\u0000"+
|
||||
"\u0000w\u000e\u0001\u0000\u0000\u0000xy\u0005m\u0000\u0000yz\u0005a\u0000"+
|
||||
"\u0000z{\u0005i\u0000\u0000{|\u0005n\u0000\u0000|\u0010\u0001\u0000\u0000"+
|
||||
"\u0000}~\u0005S\u0000\u0000~\u007f\u0005t\u0000\u0000\u007f\u0080\u0005"+
|
||||
"r\u0000\u0000\u0080\u0081\u0005i\u0000\u0000\u0081\u0082\u0005n\u0000"+
|
||||
"\u0000\u0082\u0083\u0005g\u0000\u0000\u0083\u0084\u0005[\u0000\u0000\u0084"+
|
||||
"\u0085\u0005]\u0000\u0000\u0085\u0086\u0005 \u0000\u0000\u0086\u0087\u0005"+
|
||||
"a\u0000\u0000\u0087\u0088\u0005r\u0000\u0000\u0088\u0089\u0005g\u0000"+
|
||||
"\u0000\u0089\u008a\u0005s\u0000\u0000\u008a\u0012\u0001\u0000\u0000\u0000"+
|
||||
"\u008b\u008c\u0005,\u0000\u0000\u008c\u0014\u0001\u0000\u0000\u0000\u008d"+
|
||||
"\u008e\u0005i\u0000\u0000\u008e\u008f\u0005f\u0000\u0000\u008f\u0016\u0001"+
|
||||
"\u0000\u0000\u0000\u0090\u0091\u0005e\u0000\u0000\u0091\u0092\u0005l\u0000"+
|
||||
"\u0000\u0092\u0093\u0005s\u0000\u0000\u0093\u0094\u0005e\u0000\u0000\u0094"+
|
||||
"\u0018\u0001\u0000\u0000\u0000\u0095\u0096\u0005f\u0000\u0000\u0096\u0097"+
|
||||
"\u0005o\u0000\u0000\u0097\u0098\u0005r\u0000\u0000\u0098\u001a\u0001\u0000"+
|
||||
"\u0000\u0000\u0099\u009a\u0005w\u0000\u0000\u009a\u009b\u0005h\u0000\u0000"+
|
||||
"\u009b\u009c\u0005i\u0000\u0000\u009c\u009d\u0005l\u0000\u0000\u009d\u009e"+
|
||||
"\u0005e\u0000\u0000\u009e\u001c\u0001\u0000\u0000\u0000\u009f\u00a0\u0005"+
|
||||
"d\u0000\u0000\u00a0\u00a1\u0005o\u0000\u0000\u00a1\u001e\u0001\u0000\u0000"+
|
||||
"\u0000\u00a2\u00a3\u0005r\u0000\u0000\u00a3\u00a4\u0005e\u0000\u0000\u00a4"+
|
||||
"\u00a5\u0005t\u0000\u0000\u00a5\u00a6\u0005u\u0000\u0000\u00a6\u00a7\u0005"+
|
||||
"r\u0000\u0000\u00a7\u00a8\u0005n\u0000\u0000\u00a8 \u0001\u0000\u0000"+
|
||||
"\u0000\u00a9\u00aa\u0005b\u0000\u0000\u00aa\u00ab\u0005r\u0000\u0000\u00ab"+
|
||||
"\u00ac\u0005e\u0000\u0000\u00ac\u00ad\u0005a\u0000\u0000\u00ad\u00ae\u0005"+
|
||||
"k\u0000\u0000\u00ae\"\u0001\u0000\u0000\u0000\u00af\u00b0\u0005c\u0000"+
|
||||
"\u0000\u00b0\u00b1\u0005o\u0000\u0000\u00b1\u00b2\u0005n\u0000\u0000\u00b2"+
|
||||
"\u00b3\u0005t\u0000\u0000\u00b3\u00b4\u0005i\u0000\u0000\u00b4\u00b5\u0005"+
|
||||
"n\u0000\u0000\u00b5\u00b6\u0005u\u0000\u0000\u00b6\u00b7\u0005e\u0000"+
|
||||
"\u0000\u00b7$\u0001\u0000\u0000\u0000\u00b8\u00b9\u0005.\u0000\u0000\u00b9"+
|
||||
"&\u0001\u0000\u0000\u0000\u00ba\u00bb\u0005p\u0000\u0000\u00bb\u00bc\u0005"+
|
||||
"u\u0000\u0000\u00bc\u00bd\u0005b\u0000\u0000\u00bd\u00be\u0005l\u0000"+
|
||||
"\u0000\u00be\u00bf\u0005i\u0000\u0000\u00bf\u00c0\u0005c\u0000\u0000\u00c0"+
|
||||
"(\u0001\u0000\u0000\u0000\u00c1\u00c2\u0005n\u0000\u0000\u00c2\u00c3\u0005"+
|
||||
"e\u0000\u0000\u00c3\u00c4\u0005w\u0000\u0000\u00c4*\u0001\u0000\u0000"+
|
||||
"\u0000\u00c5\u00c6\u0005n\u0000\u0000\u00c6\u00c7\u0005u\u0000\u0000\u00c7"+
|
||||
"\u00c8\u0005l\u0000\u0000\u00c8\u00c9\u0005l\u0000\u0000\u00c9,\u0001"+
|
||||
"\u0000\u0000\u0000\u00ca\u00cb\u0005t\u0000\u0000\u00cb\u00cc\u0005h\u0000"+
|
||||
"\u0000\u00cc\u00cd\u0005i\u0000\u0000\u00cd\u00ce\u0005s\u0000\u0000\u00ce"+
|
||||
".\u0001\u0000\u0000\u0000\u00cf\u00d0\u0005-\u0000\u0000\u00d00\u0001"+
|
||||
"\u0000\u0000\u0000\u00d1\u00d2\u0005+\u0000\u0000\u00d22\u0001\u0000\u0000"+
|
||||
"\u0000\u00d3\u00d4\u0005*\u0000\u0000\u00d44\u0001\u0000\u0000\u0000\u00d5"+
|
||||
"\u00d6\u0005>\u0000\u0000\u00d66\u0001\u0000\u0000\u0000\u00d7\u00d8\u0005"+
|
||||
"<\u0000\u0000\u00d88\u0001\u0000\u0000\u0000\u00d9\u00da\u0005>\u0000"+
|
||||
"\u0000\u00da\u00db\u0005=\u0000\u0000\u00db:\u0001\u0000\u0000\u0000\u00dc"+
|
||||
"\u00dd\u0005<\u0000\u0000\u00dd\u00de\u0005=\u0000\u0000\u00de<\u0001"+
|
||||
"\u0000\u0000\u0000\u00df\u00e0\u0005=\u0000\u0000\u00e0\u00e1\u0005=\u0000"+
|
||||
"\u0000\u00e1>\u0001\u0000\u0000\u0000\u00e2\u00e3\u0005!\u0000\u0000\u00e3"+
|
||||
"\u00e4\u0005=\u0000\u0000\u00e4@\u0001\u0000\u0000\u0000\u00e5\u00e6\u0005"+
|
||||
"&\u0000\u0000\u00e6\u00e7\u0005&\u0000\u0000\u00e7B\u0001\u0000\u0000"+
|
||||
"\u0000\u00e8\u00e9\u0005|\u0000\u0000\u00e9\u00ea\u0005|\u0000\u0000\u00ea"+
|
||||
"D\u0001\u0000\u0000\u0000\u00eb\u00ec\u0005=\u0000\u0000\u00ecF\u0001"+
|
||||
"\u0000\u0000\u0000\u00ed\u00ee\u0005+\u0000\u0000\u00ee\u00ef\u0005=\u0000"+
|
||||
"\u0000\u00efH\u0001\u0000\u0000\u0000\u00f0\u00f1\u0005-\u0000\u0000\u00f1"+
|
||||
"\u00f2\u0005=\u0000\u0000\u00f2J\u0001\u0000\u0000\u0000\u00f3\u00f4\u0005"+
|
||||
"*\u0000\u0000\u00f4\u00f5\u0005=\u0000\u0000\u00f5L\u0001\u0000\u0000"+
|
||||
"\u0000\u00f6\u00f7\u0005!\u0000\u0000\u00f7N\u0001\u0000\u0000\u0000\u00f8"+
|
||||
"\u00f9\u0005i\u0000\u0000\u00f9\u00fa\u0005n\u0000\u0000\u00fa\u00fb\u0005"+
|
||||
"t\u0000\u0000\u00fbP\u0001\u0000\u0000\u0000\u00fc\u00fd\u0005b\u0000"+
|
||||
"\u0000\u00fd\u00fe\u0005o\u0000\u0000\u00fe\u00ff\u0005o\u0000\u0000\u00ff"+
|
||||
"\u0100\u0005l\u0000\u0000\u0100\u0101\u0005e\u0000\u0000\u0101\u0102\u0005"+
|
||||
"a\u0000\u0000\u0102\u0103\u0005n\u0000\u0000\u0103R\u0001\u0000\u0000"+
|
||||
"\u0000\u0104\u0105\u0005v\u0000\u0000\u0105\u0106\u0005o\u0000\u0000\u0106"+
|
||||
"\u0107\u0005i\u0000\u0000\u0107\u0108\u0005d\u0000\u0000\u0108T\u0001"+
|
||||
"\u0000\u0000\u0000\u0109\u010a\u0005c\u0000\u0000\u010a\u010b\u0005h\u0000"+
|
||||
"\u0000\u010b\u010c\u0005a\u0000\u0000\u010c\u010d\u0005r\u0000\u0000\u010d"+
|
||||
"V\u0001\u0000\u0000\u0000\u010e\u010f\u0005t\u0000\u0000\u010f\u0110\u0005"+
|
||||
"r\u0000\u0000\u0110\u0111\u0005u\u0000\u0000\u0111\u0118\u0005e\u0000"+
|
||||
"\u0000\u0112\u0113\u0005f\u0000\u0000\u0113\u0114\u0005a\u0000\u0000\u0114"+
|
||||
"\u0115\u0005l\u0000\u0000\u0115\u0116\u0005s\u0000\u0000\u0116\u0118\u0005"+
|
||||
"e\u0000\u0000\u0117\u010e\u0001\u0000\u0000\u0000\u0117\u0112\u0001\u0000"+
|
||||
"\u0000\u0000\u0118X\u0001\u0000\u0000\u0000\u0119\u011a\u0007\u0000\u0000"+
|
||||
"\u0000\u011a\u011b\u0007\u0001\u0000\u0000\u011b\u011c\u0007\u0000\u0000"+
|
||||
"\u0000\u011cZ\u0001\u0000\u0000\u0000\u011d\u011f\u0007\u0001\u0000\u0000"+
|
||||
"\u011e\u011d\u0001\u0000\u0000\u0000\u011f\u0120\u0001\u0000\u0000\u0000"+
|
||||
"\u0120\u011e\u0001\u0000\u0000\u0000\u0120\u0121\u0001\u0000\u0000\u0000"+
|
||||
"\u0121\\\u0001\u0000\u0000\u0000\u0122\u0124\u0007\u0002\u0000\u0000\u0123"+
|
||||
"\u0122\u0001\u0000\u0000\u0000\u0124\u0125\u0001\u0000\u0000\u0000\u0125"+
|
||||
"\u0123\u0001\u0000\u0000\u0000\u0125\u0126\u0001\u0000\u0000\u0000\u0126"+
|
||||
"^\u0001\u0000\u0000\u0000\u0127\u0128\u0007\u0003\u0000\u0000\u0128\u0129"+
|
||||
"\u0001\u0000\u0000\u0000\u0129\u012a\u0006/\u0000\u0000\u012a`\u0001\u0000"+
|
||||
"\u0000\u0000\u0004\u0000\u0117\u0120\u0125\u0001\u0006\u0000\u0000";
|
||||
"*\u0001*\u0001*\u0001*\u0001*\u0001*\u0001*\u0001*\u0003*\u010d\b*\u0001"+
|
||||
"+\u0001+\u0001+\u0001+\u0001,\u0004,\u0114\b,\u000b,\f,\u0115\u0001-\u0004"+
|
||||
"-\u0119\b-\u000b-\f-\u011a\u0001.\u0001.\u0001.\u0001.\u0000\u0000/\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-[.]/\u0001\u0000\u0004\u0001\u0000\'\'\u0002\u0000AZa"+
|
||||
"z\u0001\u000009\u0003\u0000\t\n\r\r \u0122\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\u0001_\u0001\u0000"+
|
||||
"\u0000\u0000\u0003e\u0001\u0000\u0000\u0000\u0005g\u0001\u0000\u0000\u0000"+
|
||||
"\u0007i\u0001\u0000\u0000\u0000\tk\u0001\u0000\u0000\u0000\u000bm\u0001"+
|
||||
"\u0000\u0000\u0000\ro\u0001\u0000\u0000\u0000\u000fv\u0001\u0000\u0000"+
|
||||
"\u0000\u0011{\u0001\u0000\u0000\u0000\u0013\u0089\u0001\u0000\u0000\u0000"+
|
||||
"\u0015\u008b\u0001\u0000\u0000\u0000\u0017\u008e\u0001\u0000\u0000\u0000"+
|
||||
"\u0019\u0093\u0001\u0000\u0000\u0000\u001b\u0097\u0001\u0000\u0000\u0000"+
|
||||
"\u001d\u009d\u0001\u0000\u0000\u0000\u001f\u00a0\u0001\u0000\u0000\u0000"+
|
||||
"!\u00a7\u0001\u0000\u0000\u0000#\u00ad\u0001\u0000\u0000\u0000%\u00af"+
|
||||
"\u0001\u0000\u0000\u0000\'\u00b6\u0001\u0000\u0000\u0000)\u00ba\u0001"+
|
||||
"\u0000\u0000\u0000+\u00bf\u0001\u0000\u0000\u0000-\u00c4\u0001\u0000\u0000"+
|
||||
"\u0000/\u00c6\u0001\u0000\u0000\u00001\u00c8\u0001\u0000\u0000\u00003"+
|
||||
"\u00ca\u0001\u0000\u0000\u00005\u00cc\u0001\u0000\u0000\u00007\u00ce\u0001"+
|
||||
"\u0000\u0000\u00009\u00d1\u0001\u0000\u0000\u0000;\u00d4\u0001\u0000\u0000"+
|
||||
"\u0000=\u00d7\u0001\u0000\u0000\u0000?\u00da\u0001\u0000\u0000\u0000A"+
|
||||
"\u00dd\u0001\u0000\u0000\u0000C\u00e0\u0001\u0000\u0000\u0000E\u00e2\u0001"+
|
||||
"\u0000\u0000\u0000G\u00e5\u0001\u0000\u0000\u0000I\u00e8\u0001\u0000\u0000"+
|
||||
"\u0000K\u00eb\u0001\u0000\u0000\u0000M\u00ed\u0001\u0000\u0000\u0000O"+
|
||||
"\u00f1\u0001\u0000\u0000\u0000Q\u00f9\u0001\u0000\u0000\u0000S\u00fe\u0001"+
|
||||
"\u0000\u0000\u0000U\u010c\u0001\u0000\u0000\u0000W\u010e\u0001\u0000\u0000"+
|
||||
"\u0000Y\u0113\u0001\u0000\u0000\u0000[\u0118\u0001\u0000\u0000\u0000]"+
|
||||
"\u011c\u0001\u0000\u0000\u0000_`\u0005c\u0000\u0000`a\u0005l\u0000\u0000"+
|
||||
"ab\u0005a\u0000\u0000bc\u0005s\u0000\u0000cd\u0005s\u0000\u0000d\u0002"+
|
||||
"\u0001\u0000\u0000\u0000ef\u0005{\u0000\u0000f\u0004\u0001\u0000\u0000"+
|
||||
"\u0000gh\u0005}\u0000\u0000h\u0006\u0001\u0000\u0000\u0000ij\u0005;\u0000"+
|
||||
"\u0000j\b\u0001\u0000\u0000\u0000kl\u0005(\u0000\u0000l\n\u0001\u0000"+
|
||||
"\u0000\u0000mn\u0005)\u0000\u0000n\f\u0001\u0000\u0000\u0000op\u0005s"+
|
||||
"\u0000\u0000pq\u0005t\u0000\u0000qr\u0005a\u0000\u0000rs\u0005t\u0000"+
|
||||
"\u0000st\u0005i\u0000\u0000tu\u0005c\u0000\u0000u\u000e\u0001\u0000\u0000"+
|
||||
"\u0000vw\u0005m\u0000\u0000wx\u0005a\u0000\u0000xy\u0005i\u0000\u0000"+
|
||||
"yz\u0005n\u0000\u0000z\u0010\u0001\u0000\u0000\u0000{|\u0005S\u0000\u0000"+
|
||||
"|}\u0005t\u0000\u0000}~\u0005r\u0000\u0000~\u007f\u0005i\u0000\u0000\u007f"+
|
||||
"\u0080\u0005n\u0000\u0000\u0080\u0081\u0005g\u0000\u0000\u0081\u0082\u0005"+
|
||||
"[\u0000\u0000\u0082\u0083\u0005]\u0000\u0000\u0083\u0084\u0005 \u0000"+
|
||||
"\u0000\u0084\u0085\u0005a\u0000\u0000\u0085\u0086\u0005r\u0000\u0000\u0086"+
|
||||
"\u0087\u0005g\u0000\u0000\u0087\u0088\u0005s\u0000\u0000\u0088\u0012\u0001"+
|
||||
"\u0000\u0000\u0000\u0089\u008a\u0005,\u0000\u0000\u008a\u0014\u0001\u0000"+
|
||||
"\u0000\u0000\u008b\u008c\u0005i\u0000\u0000\u008c\u008d\u0005f\u0000\u0000"+
|
||||
"\u008d\u0016\u0001\u0000\u0000\u0000\u008e\u008f\u0005e\u0000\u0000\u008f"+
|
||||
"\u0090\u0005l\u0000\u0000\u0090\u0091\u0005s\u0000\u0000\u0091\u0092\u0005"+
|
||||
"e\u0000\u0000\u0092\u0018\u0001\u0000\u0000\u0000\u0093\u0094\u0005f\u0000"+
|
||||
"\u0000\u0094\u0095\u0005o\u0000\u0000\u0095\u0096\u0005r\u0000\u0000\u0096"+
|
||||
"\u001a\u0001\u0000\u0000\u0000\u0097\u0098\u0005w\u0000\u0000\u0098\u0099"+
|
||||
"\u0005h\u0000\u0000\u0099\u009a\u0005i\u0000\u0000\u009a\u009b\u0005l"+
|
||||
"\u0000\u0000\u009b\u009c\u0005e\u0000\u0000\u009c\u001c\u0001\u0000\u0000"+
|
||||
"\u0000\u009d\u009e\u0005d\u0000\u0000\u009e\u009f\u0005o\u0000\u0000\u009f"+
|
||||
"\u001e\u0001\u0000\u0000\u0000\u00a0\u00a1\u0005r\u0000\u0000\u00a1\u00a2"+
|
||||
"\u0005e\u0000\u0000\u00a2\u00a3\u0005t\u0000\u0000\u00a3\u00a4\u0005u"+
|
||||
"\u0000\u0000\u00a4\u00a5\u0005r\u0000\u0000\u00a5\u00a6\u0005n\u0000\u0000"+
|
||||
"\u00a6 \u0001\u0000\u0000\u0000\u00a7\u00a8\u0005b\u0000\u0000\u00a8\u00a9"+
|
||||
"\u0005r\u0000\u0000\u00a9\u00aa\u0005e\u0000\u0000\u00aa\u00ab\u0005a"+
|
||||
"\u0000\u0000\u00ab\u00ac\u0005k\u0000\u0000\u00ac\"\u0001\u0000\u0000"+
|
||||
"\u0000\u00ad\u00ae\u0005.\u0000\u0000\u00ae$\u0001\u0000\u0000\u0000\u00af"+
|
||||
"\u00b0\u0005p\u0000\u0000\u00b0\u00b1\u0005u\u0000\u0000\u00b1\u00b2\u0005"+
|
||||
"b\u0000\u0000\u00b2\u00b3\u0005l\u0000\u0000\u00b3\u00b4\u0005i\u0000"+
|
||||
"\u0000\u00b4\u00b5\u0005c\u0000\u0000\u00b5&\u0001\u0000\u0000\u0000\u00b6"+
|
||||
"\u00b7\u0005n\u0000\u0000\u00b7\u00b8\u0005e\u0000\u0000\u00b8\u00b9\u0005"+
|
||||
"w\u0000\u0000\u00b9(\u0001\u0000\u0000\u0000\u00ba\u00bb\u0005n\u0000"+
|
||||
"\u0000\u00bb\u00bc\u0005u\u0000\u0000\u00bc\u00bd\u0005l\u0000\u0000\u00bd"+
|
||||
"\u00be\u0005l\u0000\u0000\u00be*\u0001\u0000\u0000\u0000\u00bf\u00c0\u0005"+
|
||||
"t\u0000\u0000\u00c0\u00c1\u0005h\u0000\u0000\u00c1\u00c2\u0005i\u0000"+
|
||||
"\u0000\u00c2\u00c3\u0005s\u0000\u0000\u00c3,\u0001\u0000\u0000\u0000\u00c4"+
|
||||
"\u00c5\u0005-\u0000\u0000\u00c5.\u0001\u0000\u0000\u0000\u00c6\u00c7\u0005"+
|
||||
"+\u0000\u0000\u00c70\u0001\u0000\u0000\u0000\u00c8\u00c9\u0005*\u0000"+
|
||||
"\u0000\u00c92\u0001\u0000\u0000\u0000\u00ca\u00cb\u0005>\u0000\u0000\u00cb"+
|
||||
"4\u0001\u0000\u0000\u0000\u00cc\u00cd\u0005<\u0000\u0000\u00cd6\u0001"+
|
||||
"\u0000\u0000\u0000\u00ce\u00cf\u0005>\u0000\u0000\u00cf\u00d0\u0005=\u0000"+
|
||||
"\u0000\u00d08\u0001\u0000\u0000\u0000\u00d1\u00d2\u0005<\u0000\u0000\u00d2"+
|
||||
"\u00d3\u0005=\u0000\u0000\u00d3:\u0001\u0000\u0000\u0000\u00d4\u00d5\u0005"+
|
||||
"=\u0000\u0000\u00d5\u00d6\u0005=\u0000\u0000\u00d6<\u0001\u0000\u0000"+
|
||||
"\u0000\u00d7\u00d8\u0005!\u0000\u0000\u00d8\u00d9\u0005=\u0000\u0000\u00d9"+
|
||||
">\u0001\u0000\u0000\u0000\u00da\u00db\u0005&\u0000\u0000\u00db\u00dc\u0005"+
|
||||
"&\u0000\u0000\u00dc@\u0001\u0000\u0000\u0000\u00dd\u00de\u0005|\u0000"+
|
||||
"\u0000\u00de\u00df\u0005|\u0000\u0000\u00dfB\u0001\u0000\u0000\u0000\u00e0"+
|
||||
"\u00e1\u0005=\u0000\u0000\u00e1D\u0001\u0000\u0000\u0000\u00e2\u00e3\u0005"+
|
||||
"+\u0000\u0000\u00e3\u00e4\u0005=\u0000\u0000\u00e4F\u0001\u0000\u0000"+
|
||||
"\u0000\u00e5\u00e6\u0005-\u0000\u0000\u00e6\u00e7\u0005=\u0000\u0000\u00e7"+
|
||||
"H\u0001\u0000\u0000\u0000\u00e8\u00e9\u0005*\u0000\u0000\u00e9\u00ea\u0005"+
|
||||
"=\u0000\u0000\u00eaJ\u0001\u0000\u0000\u0000\u00eb\u00ec\u0005!\u0000"+
|
||||
"\u0000\u00ecL\u0001\u0000\u0000\u0000\u00ed\u00ee\u0005i\u0000\u0000\u00ee"+
|
||||
"\u00ef\u0005n\u0000\u0000\u00ef\u00f0\u0005t\u0000\u0000\u00f0N\u0001"+
|
||||
"\u0000\u0000\u0000\u00f1\u00f2\u0005b\u0000\u0000\u00f2\u00f3\u0005o\u0000"+
|
||||
"\u0000\u00f3\u00f4\u0005o\u0000\u0000\u00f4\u00f5\u0005l\u0000\u0000\u00f5"+
|
||||
"\u00f6\u0005e\u0000\u0000\u00f6\u00f7\u0005a\u0000\u0000\u00f7\u00f8\u0005"+
|
||||
"n\u0000\u0000\u00f8P\u0001\u0000\u0000\u0000\u00f9\u00fa\u0005v\u0000"+
|
||||
"\u0000\u00fa\u00fb\u0005o\u0000\u0000\u00fb\u00fc\u0005i\u0000\u0000\u00fc"+
|
||||
"\u00fd\u0005d\u0000\u0000\u00fdR\u0001\u0000\u0000\u0000\u00fe\u00ff\u0005"+
|
||||
"c\u0000\u0000\u00ff\u0100\u0005h\u0000\u0000\u0100\u0101\u0005a\u0000"+
|
||||
"\u0000\u0101\u0102\u0005r\u0000\u0000\u0102T\u0001\u0000\u0000\u0000\u0103"+
|
||||
"\u0104\u0005t\u0000\u0000\u0104\u0105\u0005r\u0000\u0000\u0105\u0106\u0005"+
|
||||
"u\u0000\u0000\u0106\u010d\u0005e\u0000\u0000\u0107\u0108\u0005f\u0000"+
|
||||
"\u0000\u0108\u0109\u0005a\u0000\u0000\u0109\u010a\u0005l\u0000\u0000\u010a"+
|
||||
"\u010b\u0005s\u0000\u0000\u010b\u010d\u0005e\u0000\u0000\u010c\u0103\u0001"+
|
||||
"\u0000\u0000\u0000\u010c\u0107\u0001\u0000\u0000\u0000\u010dV\u0001\u0000"+
|
||||
"\u0000\u0000\u010e\u010f\u0007\u0000\u0000\u0000\u010f\u0110\u0007\u0001"+
|
||||
"\u0000\u0000\u0110\u0111\u0007\u0000\u0000\u0000\u0111X\u0001\u0000\u0000"+
|
||||
"\u0000\u0112\u0114\u0007\u0001\u0000\u0000\u0113\u0112\u0001\u0000\u0000"+
|
||||
"\u0000\u0114\u0115\u0001\u0000\u0000\u0000\u0115\u0113\u0001\u0000\u0000"+
|
||||
"\u0000\u0115\u0116\u0001\u0000\u0000\u0000\u0116Z\u0001\u0000\u0000\u0000"+
|
||||
"\u0117\u0119\u0007\u0002\u0000\u0000\u0118\u0117\u0001\u0000\u0000\u0000"+
|
||||
"\u0119\u011a\u0001\u0000\u0000\u0000\u011a\u0118\u0001\u0000\u0000\u0000"+
|
||||
"\u011a\u011b\u0001\u0000\u0000\u0000\u011b\\\u0001\u0000\u0000\u0000\u011c"+
|
||||
"\u011d\u0007\u0003\u0000\u0000\u011d\u011e\u0001\u0000\u0000\u0000\u011e"+
|
||||
"\u011f\u0006.\u0000\u0000\u011f^\u0001\u0000\u0000\u0000\u0004\u0000\u010c"+
|
||||
"\u0115\u011a\u0001\u0006\u0000\u0000";
|
||||
public static final ATN _ATN =
|
||||
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
|
||||
static {
|
||||
|
@ -16,36 +16,35 @@ T__14=15
|
||||
T__15=16
|
||||
T__16=17
|
||||
T__17=18
|
||||
T__18=19
|
||||
PUBLIC=20
|
||||
NEW=21
|
||||
NULL=22
|
||||
THIS=23
|
||||
SUB=24
|
||||
ADD=25
|
||||
MUL=26
|
||||
GT=27
|
||||
LT=28
|
||||
GE=29
|
||||
LE=30
|
||||
EQ=31
|
||||
NE=32
|
||||
AND=33
|
||||
OR=34
|
||||
ASSIGN=35
|
||||
ADD_ASSIGN=36
|
||||
SUB_ASSIGN=37
|
||||
MUL_ASSIGN=38
|
||||
NOT=39
|
||||
INT=40
|
||||
BOOL=41
|
||||
VOID=42
|
||||
CHAR=43
|
||||
BOOLEANLITERAL=44
|
||||
CHARLITERAL=45
|
||||
IDENTIFIER=46
|
||||
NUMBER=47
|
||||
WS=48
|
||||
PUBLIC=19
|
||||
NEW=20
|
||||
NULL=21
|
||||
THIS=22
|
||||
SUB=23
|
||||
ADD=24
|
||||
MUL=25
|
||||
GT=26
|
||||
LT=27
|
||||
GE=28
|
||||
LE=29
|
||||
EQ=30
|
||||
NE=31
|
||||
AND=32
|
||||
OR=33
|
||||
ASSIGN=34
|
||||
ADD_ASSIGN=35
|
||||
SUB_ASSIGN=36
|
||||
MUL_ASSIGN=37
|
||||
NOT=38
|
||||
INT=39
|
||||
BOOL=40
|
||||
VOID=41
|
||||
CHAR=42
|
||||
BOOLEANLITERAL=43
|
||||
CHARLITERAL=44
|
||||
IDENTIFIER=45
|
||||
NUMBER=46
|
||||
WS=47
|
||||
'class'=1
|
||||
'{'=2
|
||||
'}'=3
|
||||
@ -63,29 +62,28 @@ WS=48
|
||||
'do'=15
|
||||
'return'=16
|
||||
'break'=17
|
||||
'continue'=18
|
||||
'.'=19
|
||||
'public'=20
|
||||
'new'=21
|
||||
'null'=22
|
||||
'this'=23
|
||||
'-'=24
|
||||
'+'=25
|
||||
'*'=26
|
||||
'>'=27
|
||||
'<'=28
|
||||
'>='=29
|
||||
'<='=30
|
||||
'=='=31
|
||||
'!='=32
|
||||
'&&'=33
|
||||
'||'=34
|
||||
'='=35
|
||||
'+='=36
|
||||
'-='=37
|
||||
'*='=38
|
||||
'!'=39
|
||||
'int'=40
|
||||
'boolean'=41
|
||||
'void'=42
|
||||
'char'=43
|
||||
'.'=18
|
||||
'public'=19
|
||||
'new'=20
|
||||
'null'=21
|
||||
'this'=22
|
||||
'-'=23
|
||||
'+'=24
|
||||
'*'=25
|
||||
'>'=26
|
||||
'<'=27
|
||||
'>='=28
|
||||
'<='=29
|
||||
'=='=30
|
||||
'!='=31
|
||||
'&&'=32
|
||||
'||'=33
|
||||
'='=34
|
||||
'+='=35
|
||||
'-='=36
|
||||
'*='=37
|
||||
'!'=38
|
||||
'int'=39
|
||||
'boolean'=40
|
||||
'void'=41
|
||||
'char'=42
|
||||
|
@ -7,16 +7,6 @@ import org.antlr.v4.runtime.tree.ParseTreeListener;
|
||||
* {@link DecafParser}.
|
||||
*/
|
||||
public interface DecafListener extends ParseTreeListener {
|
||||
/**
|
||||
* Enter a parse tree produced by {@link DecafParser#program}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterProgram(DecafParser.ProgramContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link DecafParser#program}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitProgram(DecafParser.ProgramContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link DecafParser#class}.
|
||||
* @param ctx the parse tree
|
||||
@ -221,18 +211,6 @@ public interface DecafListener extends ParseTreeListener {
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitBreak(DecafParser.BreakContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by the {@code Continue}
|
||||
* labeled alternative in {@link DecafParser#stmt}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterContinue(DecafParser.ContinueContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by the {@code Continue}
|
||||
* labeled alternative in {@link DecafParser#stmt}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitContinue(DecafParser.ContinueContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by the {@code Assignment}
|
||||
* labeled alternative in {@link DecafParser#stmt}.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -10,12 +10,6 @@ import org.antlr.v4.runtime.tree.ParseTreeVisitor;
|
||||
* operations with no return type.
|
||||
*/
|
||||
public interface DecafVisitor<T> extends ParseTreeVisitor<T> {
|
||||
/**
|
||||
* Visit a parse tree produced by {@link DecafParser#program}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitProgram(DecafParser.ProgramContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link DecafParser#class}.
|
||||
* @param ctx the parse tree
|
||||
@ -137,13 +131,6 @@ public interface DecafVisitor<T> extends ParseTreeVisitor<T> {
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitBreak(DecafParser.BreakContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code Continue}
|
||||
* labeled alternative in {@link DecafParser#stmt}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitContinue(DecafParser.ContinueContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code Assignment}
|
||||
* labeled alternative in {@link DecafParser#stmt}.
|
||||
|
@ -2,5 +2,5 @@ package de.maishai.ast.records;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record Class(Boolean isPublic, Id id , List<Field> fields, List<Method> methods, MainMethod mainMethod, List<Constructor> constructors) implements Node {
|
||||
public record Class(Id id , List<Field> fields, List<Method> methods, MainMethod mainMethod, List<Constructor> constructors) implements Node {
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
package de.maishai.ast.records;
|
||||
|
||||
|
||||
public record Continue() implements Statement {
|
||||
}
|
@ -6,5 +6,5 @@ import de.maishai.ast.ReturnType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record Method(Boolean isPublic, ReturnType type, Id id, List<Parameter> params, Block block) implements Node {
|
||||
public record Method(ReturnType type, Id id, List<Parameter> params, Block block) implements Node {
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package de.maishai.ast.records;
|
||||
|
||||
public sealed interface Node permits Block, Class, Constructor, Expression, Field, LocalVariable, MainMethod, Method, Parameter, Program, Statement {
|
||||
public sealed interface Node permits Block, Class, Constructor, Expression, Field, LocalVariable, MainMethod, Method, Parameter, Statement {
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
package de.maishai.ast.records;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record Program(List<Class> classes) implements Node {
|
||||
}
|
@ -1,16 +1,4 @@
|
||||
package de.maishai.ast.records;
|
||||
|
||||
import de.maishai.ast.records.Break;
|
||||
import de.maishai.ast.records.Continue;
|
||||
import de.maishai.ast.records.DoWhile;
|
||||
import de.maishai.ast.records.For;
|
||||
import de.maishai.ast.records.IfElse;
|
||||
import de.maishai.ast.records.MethodCall;
|
||||
import de.maishai.ast.records.New;
|
||||
import de.maishai.ast.records.Node;
|
||||
import de.maishai.ast.records.Return;
|
||||
import de.maishai.ast.records.ReturnVoid;
|
||||
import de.maishai.ast.records.While;
|
||||
|
||||
public sealed interface Statement extends Node permits Assignment, Break, Continue, DoWhile, For, IfElse, MethodCall, New, Return, ReturnVoid, While {
|
||||
public sealed interface Statement extends Node permits Assignment, Break, DoWhile, For, IfElse, MethodCall, New, Return, ReturnVoid, While {
|
||||
}
|
||||
|
@ -17,8 +17,7 @@ public class CodeGenUtils {
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public static void writeClassfile(ClassWriter cw, String name) {
|
||||
byte[] code = cw.toByteArray();
|
||||
public static void writeClassfile(byte[] code, String name) {
|
||||
try {
|
||||
FileOutputStream fos = new FileOutputStream("output/" + name + ".class");
|
||||
fos.write(code);
|
||||
|
10
src/main/java/de/maishai/typedast/MethodContext.java
Normal file
10
src/main/java/de/maishai/typedast/MethodContext.java
Normal file
@ -0,0 +1,10 @@
|
||||
package de.maishai.typedast;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class MethodContext {
|
||||
}
|
@ -1,4 +1,7 @@
|
||||
package de.maishai.typedast;
|
||||
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
public interface TypedStatement extends TypedNode {
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx);
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.TypedStatement;
|
||||
import de.maishai.typedast.Type;
|
||||
import lombok.Data;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -39,4 +40,9 @@ public class TypedAssignment implements TypedStatement {
|
||||
typedAssignment.setValue((TypedExpression) value.convertToTypedAST(localVar, classes, untyped.value()));
|
||||
return typedAssignment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,12 @@ package de.maishai.typedast.typedclass;
|
||||
|
||||
import de.maishai.ast.records.Block;
|
||||
import de.maishai.ast.records.LocalVariable;
|
||||
import de.maishai.typedast.MethodContext;
|
||||
import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.TypedStatement;
|
||||
import de.maishai.typedast.Type;
|
||||
import lombok.Data;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -46,4 +48,13 @@ public class TypedBlock implements TypedNode {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
for (TypedLocalVariable var : vars) {
|
||||
var.codeGen(mv, ctx);
|
||||
}
|
||||
for (TypedStatement stmt : stmts) {
|
||||
stmt.codeGen(mv, ctx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
package de.maishai.typedast.typedclass;
|
||||
|
||||
import de.maishai.typedast.MethodContext;
|
||||
import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.TypedStatement;
|
||||
import de.maishai.typedast.Type;
|
||||
import lombok.Data;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import java.util.Map;
|
||||
@Data
|
||||
@ -17,4 +19,9 @@ public class TypedBreak implements TypedStatement {
|
||||
public TypedNode convertToTypedAST(Map<String, Type> localVar, Map<String, TypedClass> classes, de.maishai.ast.records.Node unTypedAST) {
|
||||
return new TypedBreak();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public class TypedClass implements TypedNode {
|
||||
return typedClass;
|
||||
}
|
||||
|
||||
public void codeGen() {
|
||||
public byte[] codeGen() {
|
||||
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
|
||||
cw.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC, typedId.getName(), null, "java/lang/Object", null);
|
||||
for (TypedField field : typedFields) {
|
||||
@ -78,7 +78,7 @@ public class TypedClass implements TypedNode {
|
||||
//m.codeGen(cw);
|
||||
}
|
||||
|
||||
CodeGenUtils.writeClassfile(cw, typedId.getName());
|
||||
return cw.toByteArray();
|
||||
}
|
||||
|
||||
|
||||
@ -99,6 +99,7 @@ public class TypedClass implements TypedNode {
|
||||
c.typedMethods = new ArrayList<>();
|
||||
|
||||
//codeGen
|
||||
c.codeGen();
|
||||
byte[] code = c.codeGen();
|
||||
CodeGenUtils.writeClassfile(code, "SomeClass");
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import de.maishai.ast.records.Block;
|
||||
import de.maishai.ast.records.Constructor;
|
||||
import de.maishai.ast.records.Parameter;
|
||||
import de.maishai.typedast.CodeGenUtils;
|
||||
import de.maishai.typedast.MethodContext;
|
||||
import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.Type;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -69,12 +70,12 @@ public class TypedConstructor implements TypedNode {
|
||||
MethodVisitor mv = cw.visitMethod(accessModifier, "<init>", CodeGenUtils.generateDescriptor(typedParameters, Type.VOID), null, null);
|
||||
mv.visitCode();
|
||||
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
|
||||
//super();
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
|
||||
|
||||
//TODO: deal with block
|
||||
MethodContext context = new MethodContext();
|
||||
typedBlock.codeGen(mv, context);
|
||||
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
|
||||
|
@ -1,9 +1,11 @@
|
||||
package de.maishai.typedast.typedclass;
|
||||
|
||||
import de.maishai.typedast.MethodContext;
|
||||
import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.TypedStatement;
|
||||
import de.maishai.typedast.Type;
|
||||
import lombok.Data;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import java.util.Map;
|
||||
@Data
|
||||
@ -18,4 +20,9 @@ public class TypedContinue implements TypedStatement {
|
||||
public TypedNode convertToTypedAST(Map<String, Type> localVar, Map<String, TypedClass> classes, de.maishai.ast.records.Node unTypedAST) {
|
||||
return new TypedContinue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,9 @@
|
||||
package de.maishai.typedast.typedclass;
|
||||
|
||||
import de.maishai.ast.records.DoWhile;
|
||||
import de.maishai.typedast.TypedExpression;
|
||||
import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.TypedStatement;
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.*;
|
||||
import lombok.Data;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import java.util.Map;
|
||||
@Data
|
||||
@ -31,4 +29,9 @@ public class TypedDoWhile implements TypedStatement {
|
||||
|
||||
return typedDoWhile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,11 @@
|
||||
package de.maishai.typedast.typedclass;
|
||||
|
||||
import de.maishai.ast.records.For;
|
||||
import de.maishai.typedast.TypedExpression;
|
||||
import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.TypedStatement;
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -40,4 +38,9 @@ public class TypedFor implements TypedStatement {
|
||||
|
||||
return typedFor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,9 @@
|
||||
package de.maishai.typedast.typedclass;
|
||||
|
||||
import de.maishai.ast.records.IfElse;
|
||||
import de.maishai.typedast.TypedExpression;
|
||||
import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.TypedStatement;
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.*;
|
||||
import lombok.Data;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -39,4 +37,9 @@ public class TypedIfElse implements TypedStatement {
|
||||
|
||||
return typedIfElse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,14 @@
|
||||
package de.maishai.typedast.typedclass;
|
||||
|
||||
import de.maishai.ast.records.LocalVariable;
|
||||
import de.maishai.typedast.MethodContext;
|
||||
import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.TypeMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import java.util.Map;
|
||||
@Data
|
||||
@ -35,4 +37,7 @@ public final class TypedLocalVariable implements TypedNode {
|
||||
|
||||
return typedLocalVariable;
|
||||
}
|
||||
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,11 @@ package de.maishai.typedast.typedclass;
|
||||
|
||||
import de.maishai.ast.records.Method;
|
||||
import de.maishai.ast.records.Parameter;
|
||||
import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.TypeMapper;
|
||||
import de.maishai.typedast.*;
|
||||
import lombok.Data;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -70,5 +71,18 @@ public class TypedMethod implements TypedNode {
|
||||
return typedParameter;
|
||||
}
|
||||
|
||||
public void codeGen(ClassWriter cw) {
|
||||
int accessModifier = Opcodes.ACC_PUBLIC; // ist laut Andi ok
|
||||
MethodVisitor mv = cw.visitMethod(accessModifier, typedId.getName(),
|
||||
CodeGenUtils.generateDescriptor(typedParameters, returnType), null, null);
|
||||
mv.visitCode();
|
||||
|
||||
|
||||
MethodContext context = new MethodContext();
|
||||
typedBlock.codeGen(mv, context);
|
||||
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,8 @@
|
||||
package de.maishai.typedast.typedclass;
|
||||
|
||||
import de.maishai.typedast.TypedExpression;
|
||||
import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.TypedStatement;
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.*;
|
||||
import lombok.Data;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -27,4 +25,9 @@ public class TypedMethodCall implements TypedExpression, TypedStatement {
|
||||
//TODO: Implement this
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package de.maishai.typedast.typedclass;
|
||||
import de.maishai.ast.records.New;
|
||||
import de.maishai.typedast.*;
|
||||
import lombok.Data;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -47,4 +48,9 @@ public class TypedNew implements TypedExpression, TypedStatement {
|
||||
}
|
||||
return typedNew;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,11 +2,9 @@ package de.maishai.typedast.typedclass;
|
||||
|
||||
|
||||
import de.maishai.ast.records.Return;
|
||||
import de.maishai.typedast.TypedExpression;
|
||||
import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.TypedStatement;
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.*;
|
||||
import lombok.Data;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import java.util.Map;
|
||||
@Data
|
||||
@ -25,4 +23,9 @@ public class TypedReturn implements TypedStatement {
|
||||
typedReturn.setRet((TypedExpression) ret.convertToTypedAST(localVar, classes, untyped.ret()));
|
||||
return typedReturn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
package de.maishai.typedast.typedclass;
|
||||
|
||||
import de.maishai.ast.records.Method;
|
||||
import de.maishai.typedast.MethodContext;
|
||||
import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.TypedStatement;
|
||||
import de.maishai.typedast.Type;
|
||||
import lombok.Data;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import java.util.Map;
|
||||
@Data
|
||||
@ -23,4 +25,9 @@ public class TypedReturnVoid implements TypedStatement {
|
||||
}
|
||||
return new TypedReturnVoid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,9 @@
|
||||
package de.maishai.typedast.typedclass;
|
||||
|
||||
import de.maishai.ast.records.While;
|
||||
import de.maishai.typedast.TypedExpression;
|
||||
import de.maishai.typedast.TypedNode;
|
||||
import de.maishai.typedast.TypedStatement;
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.*;
|
||||
import lombok.Data;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -29,4 +27,9 @@ public class TypedWhile implements TypedStatement {
|
||||
typedWhile.setTypedBlock((TypedBlock) typedBlock.convertToTypedAST(localVar, classes, untyped.block()));
|
||||
return typedWhile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user