From 5a075a0ce4c1866f868c40fa21dfc2d0065e8513 Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Mon, 14 Aug 2017 08:34:02 +0200 Subject: [PATCH] Added for syntax to parser --- src/main/java/dk/camelot64/kickc/TODO.txt | 2 +- .../java/dk/camelot64/kickc/parser/KickC.g4 | 10 + .../dk/camelot64/kickc/parser/KickC.tokens | 98 +- .../kickc/parser/KickCBaseListener.java | 50 +- .../kickc/parser/KickCBaseVisitor.java | 30 +- .../dk/camelot64/kickc/parser/KickCLexer.java | 326 +++--- .../camelot64/kickc/parser/KickCLexer.tokens | 98 +- .../camelot64/kickc/parser/KickCListener.java | 50 +- .../camelot64/kickc/parser/KickCParser.java | 951 +++++++++++------- .../camelot64/kickc/parser/KickCVisitor.java | 30 +- 10 files changed, 1055 insertions(+), 590 deletions(-) diff --git a/src/main/java/dk/camelot64/kickc/TODO.txt b/src/main/java/dk/camelot64/kickc/TODO.txt index f074fdb05..4ab9c5ca9 100644 --- a/src/main/java/dk/camelot64/kickc/TODO.txt +++ b/src/main/java/dk/camelot64/kickc/TODO.txt @@ -2,7 +2,6 @@ Features - Move the main code into a main() function, and disallow code outside functions. The main function per default has no parameters and exits with RTS. - Add a for loop for(init;condition;increment) {stmt} -> { init; do { stmt; increment } while (condition) } - Add for loop for(byte i: 1..100) { } and for(byte i : 100..0) {} (plus maybe .+. and .-. to make the inc/dec unambiguous) -- Optimize if's without else if(expr) { stmt; } -> $1=!expr; if($1) goto @1; stmt; @1: - Add signed bytes - Add signed words - Add Fixed Point number types fixed[8.8], fixed[16.8] - maybe even fixed[24.4] @@ -22,6 +21,7 @@ Features - Optimize loops with Strength reduction (https://en.wikipedia.org/wiki/Strength_reduction) + Create a proper main function for the compiler + Add ++/-- incrementing/decrementing operators. ++ Optimize if's without else if(expr) { stmt; } -> $1=!expr; if($1) goto @1; stmt; @1: Assembler Improvements - Make generated ASM human readable. diff --git a/src/main/java/dk/camelot64/kickc/parser/KickC.g4 b/src/main/java/dk/camelot64/kickc/parser/KickC.g4 index c4933ed3a..06f6e12f0 100644 --- a/src/main/java/dk/camelot64/kickc/parser/KickC.g4 +++ b/src/main/java/dk/camelot64/kickc/parser/KickC.g4 @@ -18,9 +18,19 @@ stmt | 'if' '(' expr ')' stmt ( 'else' stmt )? #stmtIfElse | 'while' '(' expr ')' stmt #stmtWhile | 'do' stmt 'while' '(' expr ')' #stmtDoWhile + | 'for' '(' forDeclaration? forIteration ')' stmt #stmtFor | 'return' expr? ';' #stmtReturn ; +forDeclaration + : typeDecl? NAME ('=' initializer)? #forDecl + ; + +forIteration + : ';' expr ';' expr? # forClassic + | ':' expr ( '..' | '.+.' | '.-.' ) expr #forRange + ; + parameterListDecl : parameterDecl (',' parameterDecl)* ; diff --git a/src/main/java/dk/camelot64/kickc/parser/KickC.tokens b/src/main/java/dk/camelot64/kickc/parser/KickC.tokens index dc10d2d48..87f6880fd 100644 --- a/src/main/java/dk/camelot64/kickc/parser/KickC.tokens +++ b/src/main/java/dk/camelot64/kickc/parser/KickC.tokens @@ -37,22 +37,27 @@ T__35=36 T__36=37 T__37=38 T__38=39 -SIMPLETYPE=40 -STRING=41 -BOOLEAN=42 -NUMBER=43 -NUMFLOAT=44 -BINFLOAT=45 -DECFLOAT=46 -HEXFLOAT=47 -NUMINT=48 -BININTEGER=49 -DECINTEGER=50 -HEXINTEGER=51 -NAME=52 -WS=53 -COMMENT_LINE=54 -COMMENT_BLOCK=55 +T__39=40 +T__40=41 +T__41=42 +T__42=43 +T__43=44 +SIMPLETYPE=45 +STRING=46 +BOOLEAN=47 +NUMBER=48 +NUMFLOAT=49 +BINFLOAT=50 +DECFLOAT=51 +HEXFLOAT=52 +NUMINT=53 +BININTEGER=54 +DECINTEGER=55 +HEXINTEGER=56 +NAME=57 +WS=58 +COMMENT_LINE=59 +COMMENT_BLOCK=60 '{'=1 '}'=2 '('=3 @@ -64,31 +69,36 @@ COMMENT_BLOCK=55 'else'=9 'while'=10 'do'=11 -'return'=12 -','=13 -'*'=14 -'['=15 -']'=16 -'--'=17 -'++'=18 -'+'=19 -'-'=20 -'not'=21 -'!'=22 -'&'=23 -'>>'=24 -'<<'=25 -'/'=26 -'=='=27 -'!='=28 -'<>'=29 -'<'=30 -'<='=31 -'=<'=32 -'>='=33 -'=>'=34 -'>'=35 -'and'=36 -'&&'=37 -'or'=38 -'||'=39 +'for'=12 +'return'=13 +':'=14 +'..'=15 +'.+.'=16 +'.-.'=17 +','=18 +'*'=19 +'['=20 +']'=21 +'--'=22 +'++'=23 +'+'=24 +'-'=25 +'not'=26 +'!'=27 +'&'=28 +'>>'=29 +'<<'=30 +'/'=31 +'=='=32 +'!='=33 +'<>'=34 +'<'=35 +'<='=36 +'=<'=37 +'>='=38 +'=>'=39 +'>'=40 +'and'=41 +'&&'=42 +'or'=43 +'||'=44 diff --git a/src/main/java/dk/camelot64/kickc/parser/KickCBaseListener.java b/src/main/java/dk/camelot64/kickc/parser/KickCBaseListener.java index 7d571eb8b..748c37366 100644 --- a/src/main/java/dk/camelot64/kickc/parser/KickCBaseListener.java +++ b/src/main/java/dk/camelot64/kickc/parser/KickCBaseListener.java @@ -1,4 +1,4 @@ -// Generated from C:/c64/src/kickc/src/dk/camelot64/kickc/parser\KickC.g4 by ANTLR 4.7 +// Generated from /Users/jespergravgaard/c64/src/kickc/src/main/java/dk/camelot64/kickc/parser/KickC.g4 by ANTLR 4.7 package dk.camelot64.kickc.parser; import org.antlr.v4.runtime.ParserRuleContext; @@ -131,6 +131,18 @@ public class KickCBaseListener implements KickCListener { *

The default implementation does nothing.

*/ @Override public void exitStmtDoWhile(KickCParser.StmtDoWhileContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterStmtFor(KickCParser.StmtForContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitStmtFor(KickCParser.StmtForContext ctx) { } /** * {@inheritDoc} * @@ -143,6 +155,42 @@ public class KickCBaseListener implements KickCListener { *

The default implementation does nothing.

*/ @Override public void exitStmtReturn(KickCParser.StmtReturnContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterForDecl(KickCParser.ForDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitForDecl(KickCParser.ForDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterForClassic(KickCParser.ForClassicContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitForClassic(KickCParser.ForClassicContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterForRange(KickCParser.ForRangeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitForRange(KickCParser.ForRangeContext ctx) { } /** * {@inheritDoc} * diff --git a/src/main/java/dk/camelot64/kickc/parser/KickCBaseVisitor.java b/src/main/java/dk/camelot64/kickc/parser/KickCBaseVisitor.java index 378f966b1..eb8d98441 100644 --- a/src/main/java/dk/camelot64/kickc/parser/KickCBaseVisitor.java +++ b/src/main/java/dk/camelot64/kickc/parser/KickCBaseVisitor.java @@ -1,4 +1,4 @@ -// Generated from C:/c64/src/kickc/src/dk/camelot64/kickc/parser\KickC.g4 by ANTLR 4.7 +// Generated from /Users/jespergravgaard/c64/src/kickc/src/main/java/dk/camelot64/kickc/parser/KickC.g4 by ANTLR 4.7 package dk.camelot64.kickc.parser; import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; @@ -81,6 +81,13 @@ public class KickCBaseVisitor extends AbstractParseTreeVisitor implements * {@link #visitChildren} on {@code ctx}.

*/ @Override public T visitStmtDoWhile(KickCParser.StmtDoWhileContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitStmtFor(KickCParser.StmtForContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * @@ -88,6 +95,27 @@ public class KickCBaseVisitor extends AbstractParseTreeVisitor implements * {@link #visitChildren} on {@code ctx}.

*/ @Override public T visitStmtReturn(KickCParser.StmtReturnContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitForDecl(KickCParser.ForDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitForClassic(KickCParser.ForClassicContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitForRange(KickCParser.ForRangeContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * diff --git a/src/main/java/dk/camelot64/kickc/parser/KickCLexer.java b/src/main/java/dk/camelot64/kickc/parser/KickCLexer.java index efa6e96be..ae264f787 100644 --- a/src/main/java/dk/camelot64/kickc/parser/KickCLexer.java +++ b/src/main/java/dk/camelot64/kickc/parser/KickCLexer.java @@ -1,4 +1,4 @@ -// Generated from C:/c64/src/kickc/src/dk/camelot64/kickc/parser\KickC.g4 by ANTLR 4.7 +// Generated from /Users/jespergravgaard/c64/src/kickc/src/main/java/dk/camelot64/kickc/parser/KickC.g4 by ANTLR 4.7 package dk.camelot64.kickc.parser; import org.antlr.v4.runtime.Lexer; import org.antlr.v4.runtime.CharStream; @@ -22,9 +22,10 @@ public class KickCLexer extends Lexer { T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, T__24=25, T__25=26, T__26=27, T__27=28, T__28=29, T__29=30, T__30=31, T__31=32, T__32=33, T__33=34, T__34=35, T__35=36, T__36=37, T__37=38, - T__38=39, SIMPLETYPE=40, STRING=41, BOOLEAN=42, NUMBER=43, NUMFLOAT=44, - BINFLOAT=45, DECFLOAT=46, HEXFLOAT=47, NUMINT=48, BININTEGER=49, DECINTEGER=50, - HEXINTEGER=51, NAME=52, WS=53, COMMENT_LINE=54, COMMENT_BLOCK=55; + T__38=39, T__39=40, T__40=41, T__41=42, T__42=43, T__43=44, SIMPLETYPE=45, + STRING=46, BOOLEAN=47, NUMBER=48, NUMFLOAT=49, BINFLOAT=50, DECFLOAT=51, + HEXFLOAT=52, NUMINT=53, BININTEGER=54, DECINTEGER=55, HEXINTEGER=56, NAME=57, + WS=58, COMMENT_LINE=59, COMMENT_BLOCK=60; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; @@ -38,26 +39,28 @@ public class KickCLexer extends Lexer { "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24", "T__25", "T__26", "T__27", "T__28", "T__29", "T__30", "T__31", "T__32", - "T__33", "T__34", "T__35", "T__36", "T__37", "T__38", "SIMPLETYPE", "STRING", - "BOOLEAN", "NUMBER", "NUMFLOAT", "BINFLOAT", "DECFLOAT", "HEXFLOAT", "NUMINT", - "BININTEGER", "DECINTEGER", "HEXINTEGER", "BINDIGIT", "DECDIGIT", "HEXDIGIT", - "NAME", "NAME_START", "NAME_CHAR", "WS", "COMMENT_LINE", "COMMENT_BLOCK" + "T__33", "T__34", "T__35", "T__36", "T__37", "T__38", "T__39", "T__40", + "T__41", "T__42", "T__43", "SIMPLETYPE", "STRING", "BOOLEAN", "NUMBER", + "NUMFLOAT", "BINFLOAT", "DECFLOAT", "HEXFLOAT", "NUMINT", "BININTEGER", + "DECINTEGER", "HEXINTEGER", "BINDIGIT", "DECDIGIT", "HEXDIGIT", "NAME", + "NAME_START", "NAME_CHAR", "WS", "COMMENT_LINE", "COMMENT_BLOCK" }; private static final String[] _LITERAL_NAMES = { null, "'{'", "'}'", "'('", "')'", "'const'", "'='", "';'", "'if'", "'else'", - "'while'", "'do'", "'return'", "','", "'*'", "'['", "']'", "'--'", "'++'", - "'+'", "'-'", "'not'", "'!'", "'&'", "'>>'", "'<<'", "'/'", "'=='", "'!='", - "'<>'", "'<'", "'<='", "'=<'", "'>='", "'=>'", "'>'", "'and'", "'&&'", - "'or'", "'||'" + "'while'", "'do'", "'for'", "'return'", "':'", "'..'", "'.+.'", "'.-.'", + "','", "'*'", "'['", "']'", "'--'", "'++'", "'+'", "'-'", "'not'", "'!'", + "'&'", "'>>'", "'<<'", "'/'", "'=='", "'!='", "'<>'", "'<'", "'<='", "'=<'", + "'>='", "'=>'", "'>'", "'and'", "'&&'", "'or'", "'||'" }; private static final String[] _SYMBOLIC_NAMES = { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, "SIMPLETYPE", "STRING", "BOOLEAN", "NUMBER", "NUMFLOAT", - "BINFLOAT", "DECFLOAT", "HEXFLOAT", "NUMINT", "BININTEGER", "DECINTEGER", - "HEXINTEGER", "NAME", "WS", "COMMENT_LINE", "COMMENT_BLOCK" + null, null, null, null, null, null, null, null, null, "SIMPLETYPE", "STRING", + "BOOLEAN", "NUMBER", "NUMFLOAT", "BINFLOAT", "DECFLOAT", "HEXFLOAT", "NUMINT", + "BININTEGER", "DECINTEGER", "HEXINTEGER", "NAME", "WS", "COMMENT_LINE", + "COMMENT_BLOCK" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -117,7 +120,7 @@ public class KickCLexer extends Lexer { public ATN getATN() { return _ATN; } public static final String _serializedATN = - "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\29\u01af\b\1\4\2\t"+ + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2>\u01ca\b\1\4\2\t"+ "\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ @@ -125,147 +128,156 @@ public class KickCLexer extends Lexer { "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+ ",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+ "\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+ - "\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\b\3"+ - "\b\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3"+ - "\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\17\3\17\3\20\3\20\3\21"+ - "\3\21\3\22\3\22\3\22\3\23\3\23\3\23\3\24\3\24\3\25\3\25\3\26\3\26\3\26"+ - "\3\26\3\27\3\27\3\30\3\30\3\31\3\31\3\31\3\32\3\32\3\32\3\33\3\33\3\34"+ - "\3\34\3\34\3\35\3\35\3\35\3\36\3\36\3\36\3\37\3\37\3 \3 \3 \3!\3!\3!\3"+ - "\"\3\"\3\"\3#\3#\3#\3$\3$\3%\3%\3%\3%\3&\3&\3&\3\'\3\'\3\'\3(\3(\3(\3"+ - ")\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3"+ - ")\3)\5)\u0107\n)\3*\3*\3*\3*\7*\u010d\n*\f*\16*\u0110\13*\3*\3*\3+\3+"+ - "\3+\3+\3+\3+\3+\3+\3+\5+\u011d\n+\3,\3,\5,\u0121\n,\3-\3-\3-\5-\u0126"+ - "\n-\3.\3.\3.\3.\3.\5.\u012d\n.\3.\7.\u0130\n.\f.\16.\u0133\13.\3.\3.\6"+ - ".\u0137\n.\r.\16.\u0138\3/\7/\u013c\n/\f/\16/\u013f\13/\3/\3/\6/\u0143"+ - "\n/\r/\16/\u0144\3\60\3\60\3\60\3\60\3\60\5\60\u014c\n\60\3\60\7\60\u014f"+ - "\n\60\f\60\16\60\u0152\13\60\3\60\3\60\6\60\u0156\n\60\r\60\16\60\u0157"+ - "\3\61\3\61\3\61\5\61\u015d\n\61\3\62\3\62\3\62\6\62\u0162\n\62\r\62\16"+ - "\62\u0163\3\62\3\62\6\62\u0168\n\62\r\62\16\62\u0169\5\62\u016c\n\62\3"+ - "\63\6\63\u016f\n\63\r\63\16\63\u0170\3\64\3\64\3\64\3\64\3\64\5\64\u0178"+ - "\n\64\3\64\6\64\u017b\n\64\r\64\16\64\u017c\3\65\3\65\3\66\3\66\3\67\3"+ - "\67\38\38\78\u0187\n8\f8\168\u018a\138\39\39\3:\3:\3;\6;\u0191\n;\r;\16"+ - ";\u0192\3;\3;\3<\3<\3<\3<\7<\u019b\n<\f<\16<\u019e\13<\3<\3<\3=\3=\3="+ - "\3=\7=\u01a6\n=\f=\16=\u01a9\13=\3=\3=\3=\3=\3=\3\u01a7\2>\3\3\5\4\7\5"+ - "\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23"+ - "%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G"+ - "%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63e\64g\65i\2k\2m\2o\66q\2s\2u\67"+ - "w8y9\3\2\13\3\2$$\4\2DDdd\3\2\62\63\3\2\62;\5\2\62;CHch\5\2C\\aac|\6\2"+ - "\62;C\\aac|\5\2\13\f\17\17\"\"\4\2\f\f\17\17\2\u01ca\2\3\3\2\2\2\2\5\3"+ - "\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2"+ - "\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3"+ - "\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'"+ - "\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63"+ - "\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2"+ - "?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3"+ - "\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2"+ - "\2\2Y\3\2\2\2\2[\3\2\2\2\2]\3\2\2\2\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2\2\2"+ - "e\3\2\2\2\2g\3\2\2\2\2o\3\2\2\2\2u\3\2\2\2\2w\3\2\2\2\2y\3\2\2\2\3{\3"+ - "\2\2\2\5}\3\2\2\2\7\177\3\2\2\2\t\u0081\3\2\2\2\13\u0083\3\2\2\2\r\u0089"+ - "\3\2\2\2\17\u008b\3\2\2\2\21\u008d\3\2\2\2\23\u0090\3\2\2\2\25\u0095\3"+ - "\2\2\2\27\u009b\3\2\2\2\31\u009e\3\2\2\2\33\u00a5\3\2\2\2\35\u00a7\3\2"+ - "\2\2\37\u00a9\3\2\2\2!\u00ab\3\2\2\2#\u00ad\3\2\2\2%\u00b0\3\2\2\2\'\u00b3"+ - "\3\2\2\2)\u00b5\3\2\2\2+\u00b7\3\2\2\2-\u00bb\3\2\2\2/\u00bd\3\2\2\2\61"+ - "\u00bf\3\2\2\2\63\u00c2\3\2\2\2\65\u00c5\3\2\2\2\67\u00c7\3\2\2\29\u00ca"+ - "\3\2\2\2;\u00cd\3\2\2\2=\u00d0\3\2\2\2?\u00d2\3\2\2\2A\u00d5\3\2\2\2C"+ - "\u00d8\3\2\2\2E\u00db\3\2\2\2G\u00de\3\2\2\2I\u00e0\3\2\2\2K\u00e4\3\2"+ - "\2\2M\u00e7\3\2\2\2O\u00ea\3\2\2\2Q\u0106\3\2\2\2S\u0108\3\2\2\2U\u011c"+ - "\3\2\2\2W\u0120\3\2\2\2Y\u0125\3\2\2\2[\u012c\3\2\2\2]\u013d\3\2\2\2_"+ - "\u014b\3\2\2\2a\u015c\3\2\2\2c\u016b\3\2\2\2e\u016e\3\2\2\2g\u0177\3\2"+ - "\2\2i\u017e\3\2\2\2k\u0180\3\2\2\2m\u0182\3\2\2\2o\u0184\3\2\2\2q\u018b"+ - "\3\2\2\2s\u018d\3\2\2\2u\u0190\3\2\2\2w\u0196\3\2\2\2y\u01a1\3\2\2\2{"+ - "|\7}\2\2|\4\3\2\2\2}~\7\177\2\2~\6\3\2\2\2\177\u0080\7*\2\2\u0080\b\3"+ - "\2\2\2\u0081\u0082\7+\2\2\u0082\n\3\2\2\2\u0083\u0084\7e\2\2\u0084\u0085"+ - "\7q\2\2\u0085\u0086\7p\2\2\u0086\u0087\7u\2\2\u0087\u0088\7v\2\2\u0088"+ - "\f\3\2\2\2\u0089\u008a\7?\2\2\u008a\16\3\2\2\2\u008b\u008c\7=\2\2\u008c"+ - "\20\3\2\2\2\u008d\u008e\7k\2\2\u008e\u008f\7h\2\2\u008f\22\3\2\2\2\u0090"+ - "\u0091\7g\2\2\u0091\u0092\7n\2\2\u0092\u0093\7u\2\2\u0093\u0094\7g\2\2"+ - "\u0094\24\3\2\2\2\u0095\u0096\7y\2\2\u0096\u0097\7j\2\2\u0097\u0098\7"+ - "k\2\2\u0098\u0099\7n\2\2\u0099\u009a\7g\2\2\u009a\26\3\2\2\2\u009b\u009c"+ - "\7f\2\2\u009c\u009d\7q\2\2\u009d\30\3\2\2\2\u009e\u009f\7t\2\2\u009f\u00a0"+ - "\7g\2\2\u00a0\u00a1\7v\2\2\u00a1\u00a2\7w\2\2\u00a2\u00a3\7t\2\2\u00a3"+ - "\u00a4\7p\2\2\u00a4\32\3\2\2\2\u00a5\u00a6\7.\2\2\u00a6\34\3\2\2\2\u00a7"+ - "\u00a8\7,\2\2\u00a8\36\3\2\2\2\u00a9\u00aa\7]\2\2\u00aa \3\2\2\2\u00ab"+ - "\u00ac\7_\2\2\u00ac\"\3\2\2\2\u00ad\u00ae\7/\2\2\u00ae\u00af\7/\2\2\u00af"+ - "$\3\2\2\2\u00b0\u00b1\7-\2\2\u00b1\u00b2\7-\2\2\u00b2&\3\2\2\2\u00b3\u00b4"+ - "\7-\2\2\u00b4(\3\2\2\2\u00b5\u00b6\7/\2\2\u00b6*\3\2\2\2\u00b7\u00b8\7"+ - "p\2\2\u00b8\u00b9\7q\2\2\u00b9\u00ba\7v\2\2\u00ba,\3\2\2\2\u00bb\u00bc"+ - "\7#\2\2\u00bc.\3\2\2\2\u00bd\u00be\7(\2\2\u00be\60\3\2\2\2\u00bf\u00c0"+ - "\7@\2\2\u00c0\u00c1\7@\2\2\u00c1\62\3\2\2\2\u00c2\u00c3\7>\2\2\u00c3\u00c4"+ - "\7>\2\2\u00c4\64\3\2\2\2\u00c5\u00c6\7\61\2\2\u00c6\66\3\2\2\2\u00c7\u00c8"+ - "\7?\2\2\u00c8\u00c9\7?\2\2\u00c98\3\2\2\2\u00ca\u00cb\7#\2\2\u00cb\u00cc"+ - "\7?\2\2\u00cc:\3\2\2\2\u00cd\u00ce\7>\2\2\u00ce\u00cf\7@\2\2\u00cf<\3"+ - "\2\2\2\u00d0\u00d1\7>\2\2\u00d1>\3\2\2\2\u00d2\u00d3\7>\2\2\u00d3\u00d4"+ - "\7?\2\2\u00d4@\3\2\2\2\u00d5\u00d6\7?\2\2\u00d6\u00d7\7>\2\2\u00d7B\3"+ - "\2\2\2\u00d8\u00d9\7@\2\2\u00d9\u00da\7?\2\2\u00daD\3\2\2\2\u00db\u00dc"+ - "\7?\2\2\u00dc\u00dd\7@\2\2\u00ddF\3\2\2\2\u00de\u00df\7@\2\2\u00dfH\3"+ - "\2\2\2\u00e0\u00e1\7c\2\2\u00e1\u00e2\7p\2\2\u00e2\u00e3\7f\2\2\u00e3"+ - "J\3\2\2\2\u00e4\u00e5\7(\2\2\u00e5\u00e6\7(\2\2\u00e6L\3\2\2\2\u00e7\u00e8"+ - "\7q\2\2\u00e8\u00e9\7t\2\2\u00e9N\3\2\2\2\u00ea\u00eb\7~\2\2\u00eb\u00ec"+ - "\7~\2\2\u00ecP\3\2\2\2\u00ed\u00ee\7d\2\2\u00ee\u00ef\7{\2\2\u00ef\u00f0"+ - "\7v\2\2\u00f0\u0107\7g\2\2\u00f1\u00f2\7y\2\2\u00f2\u00f3\7q\2\2\u00f3"+ - "\u00f4\7t\2\2\u00f4\u0107\7f\2\2\u00f5\u00f6\7u\2\2\u00f6\u00f7\7v\2\2"+ - "\u00f7\u00f8\7t\2\2\u00f8\u00f9\7k\2\2\u00f9\u00fa\7p\2\2\u00fa\u0107"+ - "\7i\2\2\u00fb\u00fc\7d\2\2\u00fc\u00fd\7q\2\2\u00fd\u00fe\7q\2\2\u00fe"+ - "\u00ff\7n\2\2\u00ff\u0100\7g\2\2\u0100\u0101\7c\2\2\u0101\u0107\7p\2\2"+ - "\u0102\u0103\7x\2\2\u0103\u0104\7q\2\2\u0104\u0105\7k\2\2\u0105\u0107"+ - "\7f\2\2\u0106\u00ed\3\2\2\2\u0106\u00f1\3\2\2\2\u0106\u00f5\3\2\2\2\u0106"+ - "\u00fb\3\2\2\2\u0106\u0102\3\2\2\2\u0107R\3\2\2\2\u0108\u010e\7$\2\2\u0109"+ - "\u010a\7^\2\2\u010a\u010d\7$\2\2\u010b\u010d\n\2\2\2\u010c\u0109\3\2\2"+ - "\2\u010c\u010b\3\2\2\2\u010d\u0110\3\2\2\2\u010e\u010c\3\2\2\2\u010e\u010f"+ - "\3\2\2\2\u010f\u0111\3\2\2\2\u0110\u010e\3\2\2\2\u0111\u0112\7$\2\2\u0112"+ - "T\3\2\2\2\u0113\u0114\7v\2\2\u0114\u0115\7t\2\2\u0115\u0116\7w\2\2\u0116"+ - "\u011d\7g\2\2\u0117\u0118\7h\2\2\u0118\u0119\7c\2\2\u0119\u011a\7n\2\2"+ - "\u011a\u011b\7u\2\2\u011b\u011d\7g\2\2\u011c\u0113\3\2\2\2\u011c\u0117"+ - "\3\2\2\2\u011dV\3\2\2\2\u011e\u0121\5Y-\2\u011f\u0121\5a\61\2\u0120\u011e"+ - "\3\2\2\2\u0120\u011f\3\2\2\2\u0121X\3\2\2\2\u0122\u0126\5[.\2\u0123\u0126"+ - "\5]/\2\u0124\u0126\5_\60\2\u0125\u0122\3\2\2\2\u0125\u0123\3\2\2\2\u0125"+ - "\u0124\3\2\2\2\u0126Z\3\2\2\2\u0127\u012d\7\'\2\2\u0128\u0129\7\62\2\2"+ - "\u0129\u012d\7d\2\2\u012a\u012b\7\62\2\2\u012b\u012d\7D\2\2\u012c\u0127"+ - "\3\2\2\2\u012c\u0128\3\2\2\2\u012c\u012a\3\2\2\2\u012d\u0131\3\2\2\2\u012e"+ - "\u0130\5i\65\2\u012f\u012e\3\2\2\2\u0130\u0133\3\2\2\2\u0131\u012f\3\2"+ - "\2\2\u0131\u0132\3\2\2\2\u0132\u0134\3\2\2\2\u0133\u0131\3\2\2\2\u0134"+ - "\u0136\7\60\2\2\u0135\u0137\5i\65\2\u0136\u0135\3\2\2\2\u0137\u0138\3"+ - "\2\2\2\u0138\u0136\3\2\2\2\u0138\u0139\3\2\2\2\u0139\\\3\2\2\2\u013a\u013c"+ - "\5k\66\2\u013b\u013a\3\2\2\2\u013c\u013f\3\2\2\2\u013d\u013b\3\2\2\2\u013d"+ - "\u013e\3\2\2\2\u013e\u0140\3\2\2\2\u013f\u013d\3\2\2\2\u0140\u0142\7\60"+ - "\2\2\u0141\u0143\5k\66\2\u0142\u0141\3\2\2\2\u0143\u0144\3\2\2\2\u0144"+ - "\u0142\3\2\2\2\u0144\u0145\3\2\2\2\u0145^\3\2\2\2\u0146\u014c\7&\2\2\u0147"+ - "\u0148\7\62\2\2\u0148\u014c\7z\2\2\u0149\u014a\7\62\2\2\u014a\u014c\7"+ - "Z\2\2\u014b\u0146\3\2\2\2\u014b\u0147\3\2\2\2\u014b\u0149\3\2\2\2\u014c"+ - "\u0150\3\2\2\2\u014d\u014f\5m\67\2\u014e\u014d\3\2\2\2\u014f\u0152\3\2"+ - "\2\2\u0150\u014e\3\2\2\2\u0150\u0151\3\2\2\2\u0151\u0153\3\2\2\2\u0152"+ - "\u0150\3\2\2\2\u0153\u0155\7\60\2\2\u0154\u0156\5m\67\2\u0155\u0154\3"+ - "\2\2\2\u0156\u0157\3\2\2\2\u0157\u0155\3\2\2\2\u0157\u0158\3\2\2\2\u0158"+ - "`\3\2\2\2\u0159\u015d\5e\63\2\u015a\u015d\5g\64\2\u015b\u015d\5c\62\2"+ - "\u015c\u0159\3\2\2\2\u015c\u015a\3\2\2\2\u015c\u015b\3\2\2\2\u015db\3"+ - "\2\2\2\u015e\u015f\7\62\2\2\u015f\u0161\t\3\2\2\u0160\u0162\5i\65\2\u0161"+ - "\u0160\3\2\2\2\u0162\u0163\3\2\2\2\u0163\u0161\3\2\2\2\u0163\u0164\3\2"+ - "\2\2\u0164\u016c\3\2\2\2\u0165\u0167\7\'\2\2\u0166\u0168\5i\65\2\u0167"+ - "\u0166\3\2\2\2\u0168\u0169\3\2\2\2\u0169\u0167\3\2\2\2\u0169\u016a\3\2"+ - "\2\2\u016a\u016c\3\2\2\2\u016b\u015e\3\2\2\2\u016b\u0165\3\2\2\2\u016c"+ - "d\3\2\2\2\u016d\u016f\5k\66\2\u016e\u016d\3\2\2\2\u016f\u0170\3\2\2\2"+ - "\u0170\u016e\3\2\2\2\u0170\u0171\3\2\2\2\u0171f\3\2\2\2\u0172\u0178\7"+ - "&\2\2\u0173\u0174\7\62\2\2\u0174\u0178\7z\2\2\u0175\u0176\7\62\2\2\u0176"+ - "\u0178\7Z\2\2\u0177\u0172\3\2\2\2\u0177\u0173\3\2\2\2\u0177\u0175\3\2"+ - "\2\2\u0178\u017a\3\2\2\2\u0179\u017b\5m\67\2\u017a\u0179\3\2\2\2\u017b"+ - "\u017c\3\2\2\2\u017c\u017a\3\2\2\2\u017c\u017d\3\2\2\2\u017dh\3\2\2\2"+ - "\u017e\u017f\t\4\2\2\u017fj\3\2\2\2\u0180\u0181\t\5\2\2\u0181l\3\2\2\2"+ - "\u0182\u0183\t\6\2\2\u0183n\3\2\2\2\u0184\u0188\5q9\2\u0185\u0187\5s:"+ - "\2\u0186\u0185\3\2\2\2\u0187\u018a\3\2\2\2\u0188\u0186\3\2\2\2\u0188\u0189"+ - "\3\2\2\2\u0189p\3\2\2\2\u018a\u0188\3\2\2\2\u018b\u018c\t\7\2\2\u018c"+ - "r\3\2\2\2\u018d\u018e\t\b\2\2\u018et\3\2\2\2\u018f\u0191\t\t\2\2\u0190"+ - "\u018f\3\2\2\2\u0191\u0192\3\2\2\2\u0192\u0190\3\2\2\2\u0192\u0193\3\2"+ - "\2\2\u0193\u0194\3\2\2\2\u0194\u0195\b;\2\2\u0195v\3\2\2\2\u0196\u0197"+ - "\7\61\2\2\u0197\u0198\7\61\2\2\u0198\u019c\3\2\2\2\u0199\u019b\n\n\2\2"+ - "\u019a\u0199\3\2\2\2\u019b\u019e\3\2\2\2\u019c\u019a\3\2\2\2\u019c\u019d"+ - "\3\2\2\2\u019d\u019f\3\2\2\2\u019e\u019c\3\2\2\2\u019f\u01a0\b<\2\2\u01a0"+ - "x\3\2\2\2\u01a1\u01a2\7\61\2\2\u01a2\u01a3\7,\2\2\u01a3\u01a7\3\2\2\2"+ - "\u01a4\u01a6\13\2\2\2\u01a5\u01a4\3\2\2\2\u01a6\u01a9\3\2\2\2\u01a7\u01a8"+ - "\3\2\2\2\u01a7\u01a5\3\2\2\2\u01a8\u01aa\3\2\2\2\u01a9\u01a7\3\2\2\2\u01aa"+ - "\u01ab\7,\2\2\u01ab\u01ac\7\61\2\2\u01ac\u01ad\3\2\2\2\u01ad\u01ae\b="+ - "\2\2\u01aez\3\2\2\2\34\2\u0106\u010c\u010e\u011c\u0120\u0125\u012c\u0131"+ - "\u0138\u013d\u0144\u014b\u0150\u0157\u015c\u0163\u0169\u016b\u0170\u0177"+ - "\u017c\u0188\u0192\u019c\u01a7\3\b\2\2"; + "\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6"+ + "\3\6\3\6\3\6\3\6\3\7\3\7\3\b\3\b\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\13"+ + "\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3"+ + "\16\3\16\3\16\3\16\3\17\3\17\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\22\3"+ + "\22\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\26\3\26\3\27\3\27\3\27\3"+ + "\30\3\30\3\30\3\31\3\31\3\32\3\32\3\33\3\33\3\33\3\33\3\34\3\34\3\35\3"+ + "\35\3\36\3\36\3\36\3\37\3\37\3\37\3 \3 \3!\3!\3!\3\"\3\"\3\"\3#\3#\3#"+ + "\3$\3$\3%\3%\3%\3&\3&\3&\3\'\3\'\3\'\3(\3(\3(\3)\3)\3*\3*\3*\3*\3+\3+"+ + "\3+\3,\3,\3,\3-\3-\3-\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3."+ + "\3.\3.\3.\3.\3.\3.\3.\3.\3.\5.\u0122\n.\3/\3/\3/\3/\7/\u0128\n/\f/\16"+ + "/\u012b\13/\3/\3/\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\5\60\u0138"+ + "\n\60\3\61\3\61\5\61\u013c\n\61\3\62\3\62\3\62\5\62\u0141\n\62\3\63\3"+ + "\63\3\63\3\63\3\63\5\63\u0148\n\63\3\63\7\63\u014b\n\63\f\63\16\63\u014e"+ + "\13\63\3\63\3\63\6\63\u0152\n\63\r\63\16\63\u0153\3\64\7\64\u0157\n\64"+ + "\f\64\16\64\u015a\13\64\3\64\3\64\6\64\u015e\n\64\r\64\16\64\u015f\3\65"+ + "\3\65\3\65\3\65\3\65\5\65\u0167\n\65\3\65\7\65\u016a\n\65\f\65\16\65\u016d"+ + "\13\65\3\65\3\65\6\65\u0171\n\65\r\65\16\65\u0172\3\66\3\66\3\66\5\66"+ + "\u0178\n\66\3\67\3\67\3\67\6\67\u017d\n\67\r\67\16\67\u017e\3\67\3\67"+ + "\6\67\u0183\n\67\r\67\16\67\u0184\5\67\u0187\n\67\38\68\u018a\n8\r8\16"+ + "8\u018b\39\39\39\39\39\59\u0193\n9\39\69\u0196\n9\r9\169\u0197\3:\3:\3"+ + ";\3;\3<\3<\3=\3=\7=\u01a2\n=\f=\16=\u01a5\13=\3>\3>\3?\3?\3@\6@\u01ac"+ + "\n@\r@\16@\u01ad\3@\3@\3A\3A\3A\3A\7A\u01b6\nA\fA\16A\u01b9\13A\3A\3A"+ + "\3B\3B\3B\3B\7B\u01c1\nB\fB\16B\u01c4\13B\3B\3B\3B\3B\3B\3\u01c2\2C\3"+ + "\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37"+ + "\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37="+ + " ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63e\64g\65i\66k\67m8o9"+ + "q:s\2u\2w\2y;{\2}\2\177<\u0081=\u0083>\3\2\13\3\2$$\4\2DDdd\3\2\62\63"+ + "\3\2\62;\5\2\62;CHch\5\2C\\aac|\6\2\62;C\\aac|\5\2\13\f\17\17\"\"\4\2"+ + "\f\f\17\17\2\u01e5\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13"+ + "\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2"+ + "\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2"+ + "!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3"+ + "\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2"+ + "\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E"+ + "\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2"+ + "\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\2]\3\2\2\2"+ + "\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2\2\2e\3\2\2\2\2g\3\2\2\2\2i\3\2\2\2\2k"+ + "\3\2\2\2\2m\3\2\2\2\2o\3\2\2\2\2q\3\2\2\2\2y\3\2\2\2\2\177\3\2\2\2\2\u0081"+ + "\3\2\2\2\2\u0083\3\2\2\2\3\u0085\3\2\2\2\5\u0087\3\2\2\2\7\u0089\3\2\2"+ + "\2\t\u008b\3\2\2\2\13\u008d\3\2\2\2\r\u0093\3\2\2\2\17\u0095\3\2\2\2\21"+ + "\u0097\3\2\2\2\23\u009a\3\2\2\2\25\u009f\3\2\2\2\27\u00a5\3\2\2\2\31\u00a8"+ + "\3\2\2\2\33\u00ac\3\2\2\2\35\u00b3\3\2\2\2\37\u00b5\3\2\2\2!\u00b8\3\2"+ + "\2\2#\u00bc\3\2\2\2%\u00c0\3\2\2\2\'\u00c2\3\2\2\2)\u00c4\3\2\2\2+\u00c6"+ + "\3\2\2\2-\u00c8\3\2\2\2/\u00cb\3\2\2\2\61\u00ce\3\2\2\2\63\u00d0\3\2\2"+ + "\2\65\u00d2\3\2\2\2\67\u00d6\3\2\2\29\u00d8\3\2\2\2;\u00da\3\2\2\2=\u00dd"+ + "\3\2\2\2?\u00e0\3\2\2\2A\u00e2\3\2\2\2C\u00e5\3\2\2\2E\u00e8\3\2\2\2G"+ + "\u00eb\3\2\2\2I\u00ed\3\2\2\2K\u00f0\3\2\2\2M\u00f3\3\2\2\2O\u00f6\3\2"+ + "\2\2Q\u00f9\3\2\2\2S\u00fb\3\2\2\2U\u00ff\3\2\2\2W\u0102\3\2\2\2Y\u0105"+ + "\3\2\2\2[\u0121\3\2\2\2]\u0123\3\2\2\2_\u0137\3\2\2\2a\u013b\3\2\2\2c"+ + "\u0140\3\2\2\2e\u0147\3\2\2\2g\u0158\3\2\2\2i\u0166\3\2\2\2k\u0177\3\2"+ + "\2\2m\u0186\3\2\2\2o\u0189\3\2\2\2q\u0192\3\2\2\2s\u0199\3\2\2\2u\u019b"+ + "\3\2\2\2w\u019d\3\2\2\2y\u019f\3\2\2\2{\u01a6\3\2\2\2}\u01a8\3\2\2\2\177"+ + "\u01ab\3\2\2\2\u0081\u01b1\3\2\2\2\u0083\u01bc\3\2\2\2\u0085\u0086\7}"+ + "\2\2\u0086\4\3\2\2\2\u0087\u0088\7\177\2\2\u0088\6\3\2\2\2\u0089\u008a"+ + "\7*\2\2\u008a\b\3\2\2\2\u008b\u008c\7+\2\2\u008c\n\3\2\2\2\u008d\u008e"+ + "\7e\2\2\u008e\u008f\7q\2\2\u008f\u0090\7p\2\2\u0090\u0091\7u\2\2\u0091"+ + "\u0092\7v\2\2\u0092\f\3\2\2\2\u0093\u0094\7?\2\2\u0094\16\3\2\2\2\u0095"+ + "\u0096\7=\2\2\u0096\20\3\2\2\2\u0097\u0098\7k\2\2\u0098\u0099\7h\2\2\u0099"+ + "\22\3\2\2\2\u009a\u009b\7g\2\2\u009b\u009c\7n\2\2\u009c\u009d\7u\2\2\u009d"+ + "\u009e\7g\2\2\u009e\24\3\2\2\2\u009f\u00a0\7y\2\2\u00a0\u00a1\7j\2\2\u00a1"+ + "\u00a2\7k\2\2\u00a2\u00a3\7n\2\2\u00a3\u00a4\7g\2\2\u00a4\26\3\2\2\2\u00a5"+ + "\u00a6\7f\2\2\u00a6\u00a7\7q\2\2\u00a7\30\3\2\2\2\u00a8\u00a9\7h\2\2\u00a9"+ + "\u00aa\7q\2\2\u00aa\u00ab\7t\2\2\u00ab\32\3\2\2\2\u00ac\u00ad\7t\2\2\u00ad"+ + "\u00ae\7g\2\2\u00ae\u00af\7v\2\2\u00af\u00b0\7w\2\2\u00b0\u00b1\7t\2\2"+ + "\u00b1\u00b2\7p\2\2\u00b2\34\3\2\2\2\u00b3\u00b4\7<\2\2\u00b4\36\3\2\2"+ + "\2\u00b5\u00b6\7\60\2\2\u00b6\u00b7\7\60\2\2\u00b7 \3\2\2\2\u00b8\u00b9"+ + "\7\60\2\2\u00b9\u00ba\7-\2\2\u00ba\u00bb\7\60\2\2\u00bb\"\3\2\2\2\u00bc"+ + "\u00bd\7\60\2\2\u00bd\u00be\7/\2\2\u00be\u00bf\7\60\2\2\u00bf$\3\2\2\2"+ + "\u00c0\u00c1\7.\2\2\u00c1&\3\2\2\2\u00c2\u00c3\7,\2\2\u00c3(\3\2\2\2\u00c4"+ + "\u00c5\7]\2\2\u00c5*\3\2\2\2\u00c6\u00c7\7_\2\2\u00c7,\3\2\2\2\u00c8\u00c9"+ + "\7/\2\2\u00c9\u00ca\7/\2\2\u00ca.\3\2\2\2\u00cb\u00cc\7-\2\2\u00cc\u00cd"+ + "\7-\2\2\u00cd\60\3\2\2\2\u00ce\u00cf\7-\2\2\u00cf\62\3\2\2\2\u00d0\u00d1"+ + "\7/\2\2\u00d1\64\3\2\2\2\u00d2\u00d3\7p\2\2\u00d3\u00d4\7q\2\2\u00d4\u00d5"+ + "\7v\2\2\u00d5\66\3\2\2\2\u00d6\u00d7\7#\2\2\u00d78\3\2\2\2\u00d8\u00d9"+ + "\7(\2\2\u00d9:\3\2\2\2\u00da\u00db\7@\2\2\u00db\u00dc\7@\2\2\u00dc<\3"+ + "\2\2\2\u00dd\u00de\7>\2\2\u00de\u00df\7>\2\2\u00df>\3\2\2\2\u00e0\u00e1"+ + "\7\61\2\2\u00e1@\3\2\2\2\u00e2\u00e3\7?\2\2\u00e3\u00e4\7?\2\2\u00e4B"+ + "\3\2\2\2\u00e5\u00e6\7#\2\2\u00e6\u00e7\7?\2\2\u00e7D\3\2\2\2\u00e8\u00e9"+ + "\7>\2\2\u00e9\u00ea\7@\2\2\u00eaF\3\2\2\2\u00eb\u00ec\7>\2\2\u00ecH\3"+ + "\2\2\2\u00ed\u00ee\7>\2\2\u00ee\u00ef\7?\2\2\u00efJ\3\2\2\2\u00f0\u00f1"+ + "\7?\2\2\u00f1\u00f2\7>\2\2\u00f2L\3\2\2\2\u00f3\u00f4\7@\2\2\u00f4\u00f5"+ + "\7?\2\2\u00f5N\3\2\2\2\u00f6\u00f7\7?\2\2\u00f7\u00f8\7@\2\2\u00f8P\3"+ + "\2\2\2\u00f9\u00fa\7@\2\2\u00faR\3\2\2\2\u00fb\u00fc\7c\2\2\u00fc\u00fd"+ + "\7p\2\2\u00fd\u00fe\7f\2\2\u00feT\3\2\2\2\u00ff\u0100\7(\2\2\u0100\u0101"+ + "\7(\2\2\u0101V\3\2\2\2\u0102\u0103\7q\2\2\u0103\u0104\7t\2\2\u0104X\3"+ + "\2\2\2\u0105\u0106\7~\2\2\u0106\u0107\7~\2\2\u0107Z\3\2\2\2\u0108\u0109"+ + "\7d\2\2\u0109\u010a\7{\2\2\u010a\u010b\7v\2\2\u010b\u0122\7g\2\2\u010c"+ + "\u010d\7y\2\2\u010d\u010e\7q\2\2\u010e\u010f\7t\2\2\u010f\u0122\7f\2\2"+ + "\u0110\u0111\7u\2\2\u0111\u0112\7v\2\2\u0112\u0113\7t\2\2\u0113\u0114"+ + "\7k\2\2\u0114\u0115\7p\2\2\u0115\u0122\7i\2\2\u0116\u0117\7d\2\2\u0117"+ + "\u0118\7q\2\2\u0118\u0119\7q\2\2\u0119\u011a\7n\2\2\u011a\u011b\7g\2\2"+ + "\u011b\u011c\7c\2\2\u011c\u0122\7p\2\2\u011d\u011e\7x\2\2\u011e\u011f"+ + "\7q\2\2\u011f\u0120\7k\2\2\u0120\u0122\7f\2\2\u0121\u0108\3\2\2\2\u0121"+ + "\u010c\3\2\2\2\u0121\u0110\3\2\2\2\u0121\u0116\3\2\2\2\u0121\u011d\3\2"+ + "\2\2\u0122\\\3\2\2\2\u0123\u0129\7$\2\2\u0124\u0125\7^\2\2\u0125\u0128"+ + "\7$\2\2\u0126\u0128\n\2\2\2\u0127\u0124\3\2\2\2\u0127\u0126\3\2\2\2\u0128"+ + "\u012b\3\2\2\2\u0129\u0127\3\2\2\2\u0129\u012a\3\2\2\2\u012a\u012c\3\2"+ + "\2\2\u012b\u0129\3\2\2\2\u012c\u012d\7$\2\2\u012d^\3\2\2\2\u012e\u012f"+ + "\7v\2\2\u012f\u0130\7t\2\2\u0130\u0131\7w\2\2\u0131\u0138\7g\2\2\u0132"+ + "\u0133\7h\2\2\u0133\u0134\7c\2\2\u0134\u0135\7n\2\2\u0135\u0136\7u\2\2"+ + "\u0136\u0138\7g\2\2\u0137\u012e\3\2\2\2\u0137\u0132\3\2\2\2\u0138`\3\2"+ + "\2\2\u0139\u013c\5c\62\2\u013a\u013c\5k\66\2\u013b\u0139\3\2\2\2\u013b"+ + "\u013a\3\2\2\2\u013cb\3\2\2\2\u013d\u0141\5e\63\2\u013e\u0141\5g\64\2"+ + "\u013f\u0141\5i\65\2\u0140\u013d\3\2\2\2\u0140\u013e\3\2\2\2\u0140\u013f"+ + "\3\2\2\2\u0141d\3\2\2\2\u0142\u0148\7\'\2\2\u0143\u0144\7\62\2\2\u0144"+ + "\u0148\7d\2\2\u0145\u0146\7\62\2\2\u0146\u0148\7D\2\2\u0147\u0142\3\2"+ + "\2\2\u0147\u0143\3\2\2\2\u0147\u0145\3\2\2\2\u0148\u014c\3\2\2\2\u0149"+ + "\u014b\5s:\2\u014a\u0149\3\2\2\2\u014b\u014e\3\2\2\2\u014c\u014a\3\2\2"+ + "\2\u014c\u014d\3\2\2\2\u014d\u014f\3\2\2\2\u014e\u014c\3\2\2\2\u014f\u0151"+ + "\7\60\2\2\u0150\u0152\5s:\2\u0151\u0150\3\2\2\2\u0152\u0153\3\2\2\2\u0153"+ + "\u0151\3\2\2\2\u0153\u0154\3\2\2\2\u0154f\3\2\2\2\u0155\u0157\5u;\2\u0156"+ + "\u0155\3\2\2\2\u0157\u015a\3\2\2\2\u0158\u0156\3\2\2\2\u0158\u0159\3\2"+ + "\2\2\u0159\u015b\3\2\2\2\u015a\u0158\3\2\2\2\u015b\u015d\7\60\2\2\u015c"+ + "\u015e\5u;\2\u015d\u015c\3\2\2\2\u015e\u015f\3\2\2\2\u015f\u015d\3\2\2"+ + "\2\u015f\u0160\3\2\2\2\u0160h\3\2\2\2\u0161\u0167\7&\2\2\u0162\u0163\7"+ + "\62\2\2\u0163\u0167\7z\2\2\u0164\u0165\7\62\2\2\u0165\u0167\7Z\2\2\u0166"+ + "\u0161\3\2\2\2\u0166\u0162\3\2\2\2\u0166\u0164\3\2\2\2\u0167\u016b\3\2"+ + "\2\2\u0168\u016a\5w<\2\u0169\u0168\3\2\2\2\u016a\u016d\3\2\2\2\u016b\u0169"+ + "\3\2\2\2\u016b\u016c\3\2\2\2\u016c\u016e\3\2\2\2\u016d\u016b\3\2\2\2\u016e"+ + "\u0170\7\60\2\2\u016f\u0171\5w<\2\u0170\u016f\3\2\2\2\u0171\u0172\3\2"+ + "\2\2\u0172\u0170\3\2\2\2\u0172\u0173\3\2\2\2\u0173j\3\2\2\2\u0174\u0178"+ + "\5o8\2\u0175\u0178\5q9\2\u0176\u0178\5m\67\2\u0177\u0174\3\2\2\2\u0177"+ + "\u0175\3\2\2\2\u0177\u0176\3\2\2\2\u0178l\3\2\2\2\u0179\u017a\7\62\2\2"+ + "\u017a\u017c\t\3\2\2\u017b\u017d\5s:\2\u017c\u017b\3\2\2\2\u017d\u017e"+ + "\3\2\2\2\u017e\u017c\3\2\2\2\u017e\u017f\3\2\2\2\u017f\u0187\3\2\2\2\u0180"+ + "\u0182\7\'\2\2\u0181\u0183\5s:\2\u0182\u0181\3\2\2\2\u0183\u0184\3\2\2"+ + "\2\u0184\u0182\3\2\2\2\u0184\u0185\3\2\2\2\u0185\u0187\3\2\2\2\u0186\u0179"+ + "\3\2\2\2\u0186\u0180\3\2\2\2\u0187n\3\2\2\2\u0188\u018a\5u;\2\u0189\u0188"+ + "\3\2\2\2\u018a\u018b\3\2\2\2\u018b\u0189\3\2\2\2\u018b\u018c\3\2\2\2\u018c"+ + "p\3\2\2\2\u018d\u0193\7&\2\2\u018e\u018f\7\62\2\2\u018f\u0193\7z\2\2\u0190"+ + "\u0191\7\62\2\2\u0191\u0193\7Z\2\2\u0192\u018d\3\2\2\2\u0192\u018e\3\2"+ + "\2\2\u0192\u0190\3\2\2\2\u0193\u0195\3\2\2\2\u0194\u0196\5w<\2\u0195\u0194"+ + "\3\2\2\2\u0196\u0197\3\2\2\2\u0197\u0195\3\2\2\2\u0197\u0198\3\2\2\2\u0198"+ + "r\3\2\2\2\u0199\u019a\t\4\2\2\u019at\3\2\2\2\u019b\u019c\t\5\2\2\u019c"+ + "v\3\2\2\2\u019d\u019e\t\6\2\2\u019ex\3\2\2\2\u019f\u01a3\5{>\2\u01a0\u01a2"+ + "\5}?\2\u01a1\u01a0\3\2\2\2\u01a2\u01a5\3\2\2\2\u01a3\u01a1\3\2\2\2\u01a3"+ + "\u01a4\3\2\2\2\u01a4z\3\2\2\2\u01a5\u01a3\3\2\2\2\u01a6\u01a7\t\7\2\2"+ + "\u01a7|\3\2\2\2\u01a8\u01a9\t\b\2\2\u01a9~\3\2\2\2\u01aa\u01ac\t\t\2\2"+ + "\u01ab\u01aa\3\2\2\2\u01ac\u01ad\3\2\2\2\u01ad\u01ab\3\2\2\2\u01ad\u01ae"+ + "\3\2\2\2\u01ae\u01af\3\2\2\2\u01af\u01b0\b@\2\2\u01b0\u0080\3\2\2\2\u01b1"+ + "\u01b2\7\61\2\2\u01b2\u01b3\7\61\2\2\u01b3\u01b7\3\2\2\2\u01b4\u01b6\n"+ + "\n\2\2\u01b5\u01b4\3\2\2\2\u01b6\u01b9\3\2\2\2\u01b7\u01b5\3\2\2\2\u01b7"+ + "\u01b8\3\2\2\2\u01b8\u01ba\3\2\2\2\u01b9\u01b7\3\2\2\2\u01ba\u01bb\bA"+ + "\2\2\u01bb\u0082\3\2\2\2\u01bc\u01bd\7\61\2\2\u01bd\u01be\7,\2\2\u01be"+ + "\u01c2\3\2\2\2\u01bf\u01c1\13\2\2\2\u01c0\u01bf\3\2\2\2\u01c1\u01c4\3"+ + "\2\2\2\u01c2\u01c3\3\2\2\2\u01c2\u01c0\3\2\2\2\u01c3\u01c5\3\2\2\2\u01c4"+ + "\u01c2\3\2\2\2\u01c5\u01c6\7,\2\2\u01c6\u01c7\7\61\2\2\u01c7\u01c8\3\2"+ + "\2\2\u01c8\u01c9\bB\2\2\u01c9\u0084\3\2\2\2\34\2\u0121\u0127\u0129\u0137"+ + "\u013b\u0140\u0147\u014c\u0153\u0158\u015f\u0166\u016b\u0172\u0177\u017e"+ + "\u0184\u0186\u018b\u0192\u0197\u01a3\u01ad\u01b7\u01c2\3\b\2\2"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/main/java/dk/camelot64/kickc/parser/KickCLexer.tokens b/src/main/java/dk/camelot64/kickc/parser/KickCLexer.tokens index dc10d2d48..87f6880fd 100644 --- a/src/main/java/dk/camelot64/kickc/parser/KickCLexer.tokens +++ b/src/main/java/dk/camelot64/kickc/parser/KickCLexer.tokens @@ -37,22 +37,27 @@ T__35=36 T__36=37 T__37=38 T__38=39 -SIMPLETYPE=40 -STRING=41 -BOOLEAN=42 -NUMBER=43 -NUMFLOAT=44 -BINFLOAT=45 -DECFLOAT=46 -HEXFLOAT=47 -NUMINT=48 -BININTEGER=49 -DECINTEGER=50 -HEXINTEGER=51 -NAME=52 -WS=53 -COMMENT_LINE=54 -COMMENT_BLOCK=55 +T__39=40 +T__40=41 +T__41=42 +T__42=43 +T__43=44 +SIMPLETYPE=45 +STRING=46 +BOOLEAN=47 +NUMBER=48 +NUMFLOAT=49 +BINFLOAT=50 +DECFLOAT=51 +HEXFLOAT=52 +NUMINT=53 +BININTEGER=54 +DECINTEGER=55 +HEXINTEGER=56 +NAME=57 +WS=58 +COMMENT_LINE=59 +COMMENT_BLOCK=60 '{'=1 '}'=2 '('=3 @@ -64,31 +69,36 @@ COMMENT_BLOCK=55 'else'=9 'while'=10 'do'=11 -'return'=12 -','=13 -'*'=14 -'['=15 -']'=16 -'--'=17 -'++'=18 -'+'=19 -'-'=20 -'not'=21 -'!'=22 -'&'=23 -'>>'=24 -'<<'=25 -'/'=26 -'=='=27 -'!='=28 -'<>'=29 -'<'=30 -'<='=31 -'=<'=32 -'>='=33 -'=>'=34 -'>'=35 -'and'=36 -'&&'=37 -'or'=38 -'||'=39 +'for'=12 +'return'=13 +':'=14 +'..'=15 +'.+.'=16 +'.-.'=17 +','=18 +'*'=19 +'['=20 +']'=21 +'--'=22 +'++'=23 +'+'=24 +'-'=25 +'not'=26 +'!'=27 +'&'=28 +'>>'=29 +'<<'=30 +'/'=31 +'=='=32 +'!='=33 +'<>'=34 +'<'=35 +'<='=36 +'=<'=37 +'>='=38 +'=>'=39 +'>'=40 +'and'=41 +'&&'=42 +'or'=43 +'||'=44 diff --git a/src/main/java/dk/camelot64/kickc/parser/KickCListener.java b/src/main/java/dk/camelot64/kickc/parser/KickCListener.java index 2c8b1a9e7..a6e468ad4 100644 --- a/src/main/java/dk/camelot64/kickc/parser/KickCListener.java +++ b/src/main/java/dk/camelot64/kickc/parser/KickCListener.java @@ -1,4 +1,4 @@ -// Generated from C:/c64/src/kickc/src/dk/camelot64/kickc/parser\KickC.g4 by ANTLR 4.7 +// Generated from /Users/jespergravgaard/c64/src/kickc/src/main/java/dk/camelot64/kickc/parser/KickC.g4 by ANTLR 4.7 package dk.camelot64.kickc.parser; import org.antlr.v4.runtime.tree.ParseTreeListener; @@ -123,6 +123,18 @@ public interface KickCListener extends ParseTreeListener { * @param ctx the parse tree */ void exitStmtDoWhile(KickCParser.StmtDoWhileContext ctx); + /** + * Enter a parse tree produced by the {@code stmtFor} + * labeled alternative in {@link KickCParser#stmt}. + * @param ctx the parse tree + */ + void enterStmtFor(KickCParser.StmtForContext ctx); + /** + * Exit a parse tree produced by the {@code stmtFor} + * labeled alternative in {@link KickCParser#stmt}. + * @param ctx the parse tree + */ + void exitStmtFor(KickCParser.StmtForContext ctx); /** * Enter a parse tree produced by the {@code stmtReturn} * labeled alternative in {@link KickCParser#stmt}. @@ -135,6 +147,42 @@ public interface KickCListener extends ParseTreeListener { * @param ctx the parse tree */ void exitStmtReturn(KickCParser.StmtReturnContext ctx); + /** + * Enter a parse tree produced by the {@code forDecl} + * labeled alternative in {@link KickCParser#forDeclaration}. + * @param ctx the parse tree + */ + void enterForDecl(KickCParser.ForDeclContext ctx); + /** + * Exit a parse tree produced by the {@code forDecl} + * labeled alternative in {@link KickCParser#forDeclaration}. + * @param ctx the parse tree + */ + void exitForDecl(KickCParser.ForDeclContext ctx); + /** + * Enter a parse tree produced by the {@code forClassic} + * labeled alternative in {@link KickCParser#forIteration}. + * @param ctx the parse tree + */ + void enterForClassic(KickCParser.ForClassicContext ctx); + /** + * Exit a parse tree produced by the {@code forClassic} + * labeled alternative in {@link KickCParser#forIteration}. + * @param ctx the parse tree + */ + void exitForClassic(KickCParser.ForClassicContext ctx); + /** + * Enter a parse tree produced by the {@code forRange} + * labeled alternative in {@link KickCParser#forIteration}. + * @param ctx the parse tree + */ + void enterForRange(KickCParser.ForRangeContext ctx); + /** + * Exit a parse tree produced by the {@code forRange} + * labeled alternative in {@link KickCParser#forIteration}. + * @param ctx the parse tree + */ + void exitForRange(KickCParser.ForRangeContext ctx); /** * Enter a parse tree produced by {@link KickCParser#parameterListDecl}. * @param ctx the parse tree diff --git a/src/main/java/dk/camelot64/kickc/parser/KickCParser.java b/src/main/java/dk/camelot64/kickc/parser/KickCParser.java index 1b3b1bfcf..e34f7d9bb 100644 --- a/src/main/java/dk/camelot64/kickc/parser/KickCParser.java +++ b/src/main/java/dk/camelot64/kickc/parser/KickCParser.java @@ -1,4 +1,4 @@ -// Generated from C:/c64/src/kickc/src/dk/camelot64/kickc/parser\KickC.g4 by ANTLR 4.7 +// Generated from /Users/jespergravgaard/c64/src/kickc/src/main/java/dk/camelot64/kickc/parser/KickC.g4 by ANTLR 4.7 package dk.camelot64.kickc.parser; import org.antlr.v4.runtime.atn.*; import org.antlr.v4.runtime.dfa.DFA; @@ -22,32 +22,35 @@ public class KickCParser extends Parser { T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, T__24=25, T__25=26, T__26=27, T__27=28, T__28=29, T__29=30, T__30=31, T__31=32, T__32=33, T__33=34, T__34=35, T__35=36, T__36=37, T__37=38, - T__38=39, SIMPLETYPE=40, STRING=41, BOOLEAN=42, NUMBER=43, NUMFLOAT=44, - BINFLOAT=45, DECFLOAT=46, HEXFLOAT=47, NUMINT=48, BININTEGER=49, DECINTEGER=50, - HEXINTEGER=51, NAME=52, WS=53, COMMENT_LINE=54, COMMENT_BLOCK=55; + T__38=39, T__39=40, T__40=41, T__41=42, T__42=43, T__43=44, SIMPLETYPE=45, + STRING=46, BOOLEAN=47, NUMBER=48, NUMFLOAT=49, BINFLOAT=50, DECFLOAT=51, + HEXFLOAT=52, NUMINT=53, BININTEGER=54, DECINTEGER=55, HEXINTEGER=56, NAME=57, + WS=58, COMMENT_LINE=59, COMMENT_BLOCK=60; public static final int - RULE_file = 0, RULE_stmtSeq = 1, RULE_stmt = 2, RULE_parameterListDecl = 3, - RULE_parameterDecl = 4, RULE_typeDecl = 5, RULE_initializer = 6, RULE_lvalue = 7, - RULE_expr = 8, RULE_parameterList = 9; + RULE_file = 0, RULE_stmtSeq = 1, RULE_stmt = 2, RULE_forDeclaration = 3, + RULE_forIteration = 4, RULE_parameterListDecl = 5, RULE_parameterDecl = 6, + RULE_typeDecl = 7, RULE_initializer = 8, RULE_lvalue = 9, RULE_expr = 10, + RULE_parameterList = 11; public static final String[] ruleNames = { - "file", "stmtSeq", "stmt", "parameterListDecl", "parameterDecl", "typeDecl", - "initializer", "lvalue", "expr", "parameterList" + "file", "stmtSeq", "stmt", "forDeclaration", "forIteration", "parameterListDecl", + "parameterDecl", "typeDecl", "initializer", "lvalue", "expr", "parameterList" }; private static final String[] _LITERAL_NAMES = { null, "'{'", "'}'", "'('", "')'", "'const'", "'='", "';'", "'if'", "'else'", - "'while'", "'do'", "'return'", "','", "'*'", "'['", "']'", "'--'", "'++'", - "'+'", "'-'", "'not'", "'!'", "'&'", "'>>'", "'<<'", "'/'", "'=='", "'!='", - "'<>'", "'<'", "'<='", "'=<'", "'>='", "'=>'", "'>'", "'and'", "'&&'", - "'or'", "'||'" + "'while'", "'do'", "'for'", "'return'", "':'", "'..'", "'.+.'", "'.-.'", + "','", "'*'", "'['", "']'", "'--'", "'++'", "'+'", "'-'", "'not'", "'!'", + "'&'", "'>>'", "'<<'", "'/'", "'=='", "'!='", "'<>'", "'<'", "'<='", "'=<'", + "'>='", "'=>'", "'>'", "'and'", "'&&'", "'or'", "'||'" }; private static final String[] _SYMBOLIC_NAMES = { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, "SIMPLETYPE", "STRING", "BOOLEAN", "NUMBER", "NUMFLOAT", - "BINFLOAT", "DECFLOAT", "HEXFLOAT", "NUMINT", "BININTEGER", "DECINTEGER", - "HEXINTEGER", "NAME", "WS", "COMMENT_LINE", "COMMENT_BLOCK" + null, null, null, null, null, null, null, null, null, "SIMPLETYPE", "STRING", + "BOOLEAN", "NUMBER", "NUMFLOAT", "BINFLOAT", "DECFLOAT", "HEXFLOAT", "NUMINT", + "BININTEGER", "DECINTEGER", "HEXINTEGER", "NAME", "WS", "COMMENT_LINE", + "COMMENT_BLOCK" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -128,9 +131,9 @@ public class KickCParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(20); + setState(24); stmtSeq(); - setState(21); + setState(25); match(EOF); } } @@ -178,20 +181,20 @@ public class KickCParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(24); + setState(28); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(23); + setState(27); stmt(); } } - setState(26); + setState(30); _errHandler.sync(this); _la = _input.LA(1); - } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__2) | (1L << T__4) | (1L << T__7) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__13) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << SIMPLETYPE) | (1L << STRING) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0) ); + } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__2) | (1L << T__4) | (1L << T__7) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << T__18) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << SIMPLETYPE) | (1L << STRING) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0) ); } } catch (RecognitionException re) { @@ -298,6 +301,31 @@ public class KickCParser extends Parser { else return visitor.visitChildren(this); } } + public static class StmtForContext extends StmtContext { + public ForIterationContext forIteration() { + return getRuleContext(ForIterationContext.class,0); + } + public StmtContext stmt() { + return getRuleContext(StmtContext.class,0); + } + public ForDeclarationContext forDeclaration() { + return getRuleContext(ForDeclarationContext.class,0); + } + public StmtForContext(StmtContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof KickCListener ) ((KickCListener)listener).enterStmtFor(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof KickCListener ) ((KickCListener)listener).exitStmtFor(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof KickCVisitor ) return ((KickCVisitor)visitor).visitStmtFor(this); + else return visitor.visitChildren(this); + } + } public static class StmtAssignmentContext extends StmtContext { public LvalueContext lvalue() { return getRuleContext(LvalueContext.class,0); @@ -419,26 +447,26 @@ public class KickCParser extends Parser { enterRule(_localctx, 4, RULE_stmt); int _la; try { - setState(92); + setState(105); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,8,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,9,_ctx) ) { case 1: _localctx = new StmtBlockContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(28); + setState(32); match(T__0); - setState(30); + setState(34); _errHandler.sync(this); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__2) | (1L << T__4) | (1L << T__7) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__13) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << SIMPLETYPE) | (1L << STRING) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__2) | (1L << T__4) | (1L << T__7) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << T__18) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << SIMPLETYPE) | (1L << STRING) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { { - setState(29); + setState(33); stmtSeq(); } } - setState(32); + setState(36); match(T__1); } break; @@ -446,37 +474,37 @@ public class KickCParser extends Parser { _localctx = new StmtFunctionContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(33); - typeDecl(0); - setState(34); - match(NAME); - setState(35); - match(T__2); setState(37); + typeDecl(0); + setState(38); + match(NAME); + setState(39); + match(T__2); + setState(41); _errHandler.sync(this); _la = _input.LA(1); if (_la==SIMPLETYPE) { { - setState(36); + setState(40); parameterListDecl(); } } - setState(39); + setState(43); match(T__3); - setState(40); + setState(44); match(T__0); - setState(42); + setState(46); _errHandler.sync(this); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__2) | (1L << T__4) | (1L << T__7) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__13) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << SIMPLETYPE) | (1L << STRING) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__2) | (1L << T__4) | (1L << T__7) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << T__18) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << SIMPLETYPE) | (1L << STRING) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { { - setState(41); + setState(45); stmtSeq(); } } - setState(44); + setState(48); match(T__1); } break; @@ -484,33 +512,33 @@ public class KickCParser extends Parser { _localctx = new StmtDeclarationContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(47); + setState(51); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__4) { { - setState(46); + setState(50); match(T__4); } } - setState(49); - typeDecl(0); - setState(50); - match(NAME); setState(53); + typeDecl(0); + setState(54); + match(NAME); + setState(57); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__5) { { - setState(51); + setState(55); match(T__5); - setState(52); + setState(56); initializer(); } } - setState(55); + setState(59); match(T__6); } break; @@ -518,13 +546,13 @@ public class KickCParser extends Parser { _localctx = new StmtAssignmentContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(57); + setState(61); lvalue(0); - setState(58); + setState(62); match(T__5); - setState(59); + setState(63); expr(0); - setState(60); + setState(64); match(T__6); } break; @@ -532,9 +560,9 @@ public class KickCParser extends Parser { _localctx = new StmtExprContext(_localctx); enterOuterAlt(_localctx, 5); { - setState(62); + setState(66); expr(0); - setState(63); + setState(67); match(T__6); } break; @@ -542,24 +570,24 @@ public class KickCParser extends Parser { _localctx = new StmtIfElseContext(_localctx); enterOuterAlt(_localctx, 6); { - setState(65); - match(T__7); - setState(66); - match(T__2); - setState(67); - expr(0); - setState(68); - match(T__3); setState(69); - stmt(); + match(T__7); + setState(70); + match(T__2); + setState(71); + expr(0); setState(72); + match(T__3); + setState(73); + stmt(); + setState(76); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) { case 1: { - setState(70); + setState(74); match(T__8); - setState(71); + setState(75); stmt(); } break; @@ -570,15 +598,15 @@ public class KickCParser extends Parser { _localctx = new StmtWhileContext(_localctx); enterOuterAlt(_localctx, 7); { - setState(74); - match(T__9); - setState(75); - match(T__2); - setState(76); - expr(0); - setState(77); - match(T__3); setState(78); + match(T__9); + setState(79); + match(T__2); + setState(80); + expr(0); + setState(81); + match(T__3); + setState(82); stmt(); } break; @@ -586,37 +614,63 @@ public class KickCParser extends Parser { _localctx = new StmtDoWhileContext(_localctx); enterOuterAlt(_localctx, 8); { - setState(80); - match(T__10); - setState(81); - stmt(); - setState(82); - match(T__9); - setState(83); - match(T__2); setState(84); - expr(0); + match(T__10); setState(85); + stmt(); + setState(86); + match(T__9); + setState(87); + match(T__2); + setState(88); + expr(0); + setState(89); match(T__3); } break; case 9: - _localctx = new StmtReturnContext(_localctx); + _localctx = new StmtForContext(_localctx); enterOuterAlt(_localctx, 9); { - setState(87); + setState(91); match(T__11); - setState(89); + setState(92); + match(T__2); + setState(94); _errHandler.sync(this); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__2) | (1L << T__13) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << STRING) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { + if (_la==SIMPLETYPE || _la==NAME) { { - setState(88); + setState(93); + forDeclaration(); + } + } + + setState(96); + forIteration(); + setState(97); + match(T__3); + setState(98); + stmt(); + } + break; + case 10: + _localctx = new StmtReturnContext(_localctx); + enterOuterAlt(_localctx, 10); + { + setState(100); + match(T__12); + setState(102); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__2) | (1L << T__18) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << STRING) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { + { + setState(101); expr(0); } } - setState(91); + setState(104); match(T__6); } break; @@ -633,6 +687,209 @@ public class KickCParser extends Parser { return _localctx; } + public static class ForDeclarationContext extends ParserRuleContext { + public ForDeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_forDeclaration; } + + public ForDeclarationContext() { } + public void copyFrom(ForDeclarationContext ctx) { + super.copyFrom(ctx); + } + } + public static class ForDeclContext extends ForDeclarationContext { + public TerminalNode NAME() { return getToken(KickCParser.NAME, 0); } + public TypeDeclContext typeDecl() { + return getRuleContext(TypeDeclContext.class,0); + } + public InitializerContext initializer() { + return getRuleContext(InitializerContext.class,0); + } + public ForDeclContext(ForDeclarationContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof KickCListener ) ((KickCListener)listener).enterForDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof KickCListener ) ((KickCListener)listener).exitForDecl(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof KickCVisitor ) return ((KickCVisitor)visitor).visitForDecl(this); + else return visitor.visitChildren(this); + } + } + + public final ForDeclarationContext forDeclaration() throws RecognitionException { + ForDeclarationContext _localctx = new ForDeclarationContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_forDeclaration); + int _la; + try { + _localctx = new ForDeclContext(_localctx); + enterOuterAlt(_localctx, 1); + { + setState(108); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==SIMPLETYPE) { + { + setState(107); + typeDecl(0); + } + } + + setState(110); + match(NAME); + setState(113); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==T__5) { + { + setState(111); + match(T__5); + setState(112); + initializer(); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ForIterationContext extends ParserRuleContext { + public ForIterationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_forIteration; } + + public ForIterationContext() { } + public void copyFrom(ForIterationContext ctx) { + super.copyFrom(ctx); + } + } + public static class ForRangeContext extends ForIterationContext { + public List expr() { + return getRuleContexts(ExprContext.class); + } + public ExprContext expr(int i) { + return getRuleContext(ExprContext.class,i); + } + public ForRangeContext(ForIterationContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof KickCListener ) ((KickCListener)listener).enterForRange(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof KickCListener ) ((KickCListener)listener).exitForRange(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof KickCVisitor ) return ((KickCVisitor)visitor).visitForRange(this); + else return visitor.visitChildren(this); + } + } + public static class ForClassicContext extends ForIterationContext { + public List expr() { + return getRuleContexts(ExprContext.class); + } + public ExprContext expr(int i) { + return getRuleContext(ExprContext.class,i); + } + public ForClassicContext(ForIterationContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof KickCListener ) ((KickCListener)listener).enterForClassic(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof KickCListener ) ((KickCListener)listener).exitForClassic(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof KickCVisitor ) return ((KickCVisitor)visitor).visitForClassic(this); + else return visitor.visitChildren(this); + } + } + + public final ForIterationContext forIteration() throws RecognitionException { + ForIterationContext _localctx = new ForIterationContext(_ctx, getState()); + enterRule(_localctx, 8, RULE_forIteration); + int _la; + try { + setState(126); + _errHandler.sync(this); + switch (_input.LA(1)) { + case T__6: + _localctx = new ForClassicContext(_localctx); + enterOuterAlt(_localctx, 1); + { + setState(115); + match(T__6); + setState(116); + expr(0); + setState(117); + match(T__6); + setState(119); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__2) | (1L << T__18) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << STRING) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { + { + setState(118); + expr(0); + } + } + + } + break; + case T__13: + _localctx = new ForRangeContext(_localctx); + enterOuterAlt(_localctx, 2); + { + setState(121); + match(T__13); + setState(122); + expr(0); + setState(123); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__14) | (1L << T__15) | (1L << T__16))) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(124); + expr(0); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + public static class ParameterListDeclContext extends ParserRuleContext { public List parameterDecl() { return getRuleContexts(ParameterDeclContext.class); @@ -661,26 +918,26 @@ public class KickCParser extends Parser { public final ParameterListDeclContext parameterListDecl() throws RecognitionException { ParameterListDeclContext _localctx = new ParameterListDeclContext(_ctx, getState()); - enterRule(_localctx, 6, RULE_parameterListDecl); + enterRule(_localctx, 10, RULE_parameterListDecl); int _la; try { enterOuterAlt(_localctx, 1); { - setState(94); + setState(128); parameterDecl(); - setState(99); + setState(133); _errHandler.sync(this); _la = _input.LA(1); - while (_la==T__12) { + while (_la==T__17) { { { - setState(95); - match(T__12); - setState(96); + setState(129); + match(T__17); + setState(130); parameterDecl(); } } - setState(101); + setState(135); _errHandler.sync(this); _la = _input.LA(1); } @@ -723,13 +980,13 @@ public class KickCParser extends Parser { public final ParameterDeclContext parameterDecl() throws RecognitionException { ParameterDeclContext _localctx = new ParameterDeclContext(_ctx, getState()); - enterRule(_localctx, 8, RULE_parameterDecl); + enterRule(_localctx, 12, RULE_parameterDecl); try { enterOuterAlt(_localctx, 1); { - setState(102); + setState(136); typeDecl(0); - setState(103); + setState(137); match(NAME); } } @@ -823,8 +1080,8 @@ public class KickCParser extends Parser { int _parentState = getState(); TypeDeclContext _localctx = new TypeDeclContext(_ctx, _parentState); TypeDeclContext _prevctx = _localctx; - int _startState = 10; - enterRecursionRule(_localctx, 10, RULE_typeDecl, _p); + int _startState = 14; + enterRecursionRule(_localctx, 14, RULE_typeDecl, _p); int _la; try { int _alt; @@ -835,59 +1092,59 @@ public class KickCParser extends Parser { _ctx = _localctx; _prevctx = _localctx; - setState(106); + setState(140); match(SIMPLETYPE); } _ctx.stop = _input.LT(-1); - setState(118); + setState(152); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,12,_ctx); + _alt = getInterpreter().adaptivePredict(_input,17,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(116); + setState(150); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,11,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) { case 1: { _localctx = new TypePtrContext(new TypeDeclContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_typeDecl); - setState(108); + setState(142); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(109); - match(T__13); + setState(143); + match(T__18); } break; case 2: { _localctx = new TypeArrayContext(new TypeDeclContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_typeDecl); - setState(110); + setState(144); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(111); - match(T__14); - setState(113); + setState(145); + match(T__19); + setState(147); _errHandler.sync(this); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__2) | (1L << T__13) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << STRING) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__2) | (1L << T__18) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << STRING) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { { - setState(112); + setState(146); expr(0); } } - setState(115); - match(T__15); + setState(149); + match(T__20); } break; } } } - setState(120); + setState(154); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,12,_ctx); + _alt = getInterpreter().adaptivePredict(_input,17,_ctx); } } } @@ -957,21 +1214,21 @@ public class KickCParser extends Parser { public final InitializerContext initializer() throws RecognitionException { InitializerContext _localctx = new InitializerContext(_ctx, getState()); - enterRule(_localctx, 12, RULE_initializer); + enterRule(_localctx, 16, RULE_initializer); int _la; try { - setState(133); + setState(167); _errHandler.sync(this); switch (_input.LA(1)) { case T__2: - case T__13: - case T__16: - case T__17: case T__18: - case T__19: - case T__20: case T__21: case T__22: + case T__23: + case T__24: + case T__25: + case T__26: + case T__27: case STRING: case BOOLEAN: case NUMBER: @@ -979,7 +1236,7 @@ public class KickCParser extends Parser { _localctx = new InitExprContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(121); + setState(155); expr(0); } break; @@ -987,27 +1244,27 @@ public class KickCParser extends Parser { _localctx = new InitListContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(122); + setState(156); match(T__0); - setState(123); + setState(157); initializer(); - setState(128); + setState(162); _errHandler.sync(this); _la = _input.LA(1); - while (_la==T__12) { + while (_la==T__17) { { { - setState(124); - match(T__12); - setState(125); + setState(158); + match(T__17); + setState(159); initializer(); } } - setState(130); + setState(164); _errHandler.sync(this); _la = _input.LA(1); } - setState(131); + setState(165); match(T__1); } break; @@ -1124,13 +1381,13 @@ public class KickCParser extends Parser { int _parentState = getState(); LvalueContext _localctx = new LvalueContext(_ctx, _parentState); LvalueContext _prevctx = _localctx; - int _startState = 14; - enterRecursionRule(_localctx, 14, RULE_lvalue, _p); + int _startState = 18; + enterRecursionRule(_localctx, 18, RULE_lvalue, _p); try { int _alt; enterOuterAlt(_localctx, 1); { - setState(143); + setState(177); _errHandler.sync(this); switch (_input.LA(1)) { case T__2: @@ -1139,11 +1396,11 @@ public class KickCParser extends Parser { _ctx = _localctx; _prevctx = _localctx; - setState(136); + setState(170); match(T__2); - setState(137); + setState(171); lvalue(0); - setState(138); + setState(172); match(T__3); } break; @@ -1152,18 +1409,18 @@ public class KickCParser extends Parser { _localctx = new LvalueNameContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(140); + setState(174); match(NAME); } break; - case T__13: + case T__18: { _localctx = new LvaluePtrContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(141); - match(T__13); - setState(142); + setState(175); + match(T__18); + setState(176); lvalue(2); } break; @@ -1171,9 +1428,9 @@ public class KickCParser extends Parser { throw new NoViableAltException(this); } _ctx.stop = _input.LT(-1); - setState(152); + setState(186); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,16,_ctx); + _alt = getInterpreter().adaptivePredict(_input,21,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); @@ -1182,20 +1439,20 @@ public class KickCParser extends Parser { { _localctx = new LvalueArrayContext(new LvalueContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_lvalue); - setState(145); + setState(179); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(146); - match(T__14); - setState(147); + setState(180); + match(T__19); + setState(181); expr(0); - setState(148); - match(T__15); + setState(182); + match(T__20); } } } - setState(154); + setState(188); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,16,_ctx); + _alt = getInterpreter().adaptivePredict(_input,21,_ctx); } } } @@ -1461,27 +1718,27 @@ public class KickCParser extends Parser { int _parentState = getState(); ExprContext _localctx = new ExprContext(_ctx, _parentState); ExprContext _prevctx = _localctx; - int _startState = 16; - enterRecursionRule(_localctx, 16, RULE_expr, _p); + int _startState = 20; + enterRecursionRule(_localctx, 20, RULE_expr, _p); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { - setState(179); + setState(213); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) { case 1: { _localctx = new ExprParContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(156); + setState(190); match(T__2); - setState(157); + setState(191); expr(0); - setState(158); + setState(192); match(T__3); } break; @@ -1490,21 +1747,21 @@ public class KickCParser extends Parser { _localctx = new ExprCallContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(160); + setState(194); match(NAME); - setState(161); + setState(195); match(T__2); - setState(163); + setState(197); _errHandler.sync(this); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__2) | (1L << T__13) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << STRING) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__2) | (1L << T__18) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << STRING) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { { - setState(162); + setState(196); parameterList(); } } - setState(165); + setState(199); match(T__3); } break; @@ -1513,13 +1770,13 @@ public class KickCParser extends Parser { _localctx = new ExprCastContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(166); + setState(200); match(T__2); - setState(167); + setState(201); typeDecl(0); - setState(168); + setState(202); match(T__3); - setState(169); + setState(203); expr(15); } break; @@ -1528,9 +1785,9 @@ public class KickCParser extends Parser { _localctx = new ExprPreModContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(171); + setState(205); _la = _input.LA(1); - if ( !(_la==T__16 || _la==T__17) ) { + if ( !(_la==T__21 || _la==T__22) ) { _errHandler.recoverInline(this); } else { @@ -1538,7 +1795,7 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(172); + setState(206); expr(13); } break; @@ -1547,9 +1804,9 @@ public class KickCParser extends Parser { _localctx = new ExprUnaryContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(173); + setState(207); _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__13) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22))) != 0)) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__18) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27))) != 0)) ) { _errHandler.recoverInline(this); } else { @@ -1557,7 +1814,7 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(174); + setState(208); expr(11); } break; @@ -1566,7 +1823,7 @@ public class KickCParser extends Parser { _localctx = new ExprIdContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(175); + setState(209); match(NAME); } break; @@ -1575,7 +1832,7 @@ public class KickCParser extends Parser { _localctx = new ExprNumberContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(176); + setState(210); match(NUMBER); } break; @@ -1584,7 +1841,7 @@ public class KickCParser extends Parser { _localctx = new ExprStringContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(177); + setState(211); match(STRING); } break; @@ -1593,30 +1850,70 @@ public class KickCParser extends Parser { _localctx = new ExprBoolContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(178); + setState(212); match(BOOLEAN); } break; } _ctx.stop = _input.LT(-1); - setState(208); + setState(242); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,20,_ctx); + _alt = getInterpreter().adaptivePredict(_input,25,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(206); + setState(240); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) { case 1: { _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(181); + setState(215); if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); - setState(182); + setState(216); + _la = _input.LA(1); + if ( !(_la==T__28 || _la==T__29) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(217); + expr(11); + } + break; + case 2: + { + _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_expr); + setState(218); + if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); + setState(219); + _la = _input.LA(1); + if ( !(_la==T__18 || _la==T__30) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(220); + expr(10); + } + break; + case 3: + { + _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_expr); + setState(221); + if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); + setState(222); _la = _input.LA(1); if ( !(_la==T__23 || _la==T__24) ) { _errHandler.recoverInline(this); @@ -1626,47 +1923,7 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(183); - expr(11); - } - break; - case 2: - { - _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); - pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(184); - if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); - setState(185); - _la = _input.LA(1); - if ( !(_la==T__13 || _la==T__25) ) { - _errHandler.recoverInline(this); - } - else { - if ( _input.LA(1)==Token.EOF ) matchedEOF = true; - _errHandler.reportMatch(this); - consume(); - } - setState(186); - expr(10); - } - break; - case 3: - { - _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); - pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(187); - if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); - setState(188); - _la = _input.LA(1); - if ( !(_la==T__18 || _la==T__19) ) { - _errHandler.recoverInline(this); - } - else { - if ( _input.LA(1)==Token.EOF ) matchedEOF = true; - _errHandler.reportMatch(this); - consume(); - } - setState(189); + setState(223); expr(9); } break; @@ -1674,11 +1931,11 @@ public class KickCParser extends Parser { { _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(190); + setState(224); if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); - setState(191); + setState(225); _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << T__31) | (1L << T__32) | (1L << T__33) | (1L << T__34))) != 0)) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__31) | (1L << T__32) | (1L << T__33) | (1L << T__34) | (1L << T__35) | (1L << T__36) | (1L << T__37) | (1L << T__38) | (1L << T__39))) != 0)) ) { _errHandler.recoverInline(this); } else { @@ -1686,7 +1943,7 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(192); + setState(226); expr(8); } break; @@ -1694,11 +1951,11 @@ public class KickCParser extends Parser { { _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(193); + setState(227); if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); - setState(194); + setState(228); _la = _input.LA(1); - if ( !(_la==T__35 || _la==T__36) ) { + if ( !(_la==T__40 || _la==T__41) ) { _errHandler.recoverInline(this); } else { @@ -1706,7 +1963,7 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(195); + setState(229); expr(7); } break; @@ -1714,11 +1971,11 @@ public class KickCParser extends Parser { { _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(196); + setState(230); if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)"); - setState(197); + setState(231); _la = _input.LA(1); - if ( !(_la==T__37 || _la==T__38) ) { + if ( !(_la==T__42 || _la==T__43) ) { _errHandler.recoverInline(this); } else { @@ -1726,7 +1983,7 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(198); + setState(232); expr(6); } break; @@ -1734,25 +1991,25 @@ public class KickCParser extends Parser { { _localctx = new ExprArrayContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(199); + setState(233); if (!(precpred(_ctx, 14))) throw new FailedPredicateException(this, "precpred(_ctx, 14)"); - setState(200); - match(T__14); - setState(201); + setState(234); + match(T__19); + setState(235); expr(0); - setState(202); - match(T__15); + setState(236); + match(T__20); } break; case 8: { _localctx = new ExprPostModContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(204); + setState(238); if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)"); - setState(205); + setState(239); _la = _input.LA(1); - if ( !(_la==T__16 || _la==T__17) ) { + if ( !(_la==T__21 || _la==T__22) ) { _errHandler.recoverInline(this); } else { @@ -1765,9 +2022,9 @@ public class KickCParser extends Parser { } } } - setState(210); + setState(244); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,20,_ctx); + _alt = getInterpreter().adaptivePredict(_input,25,_ctx); } } } @@ -1810,26 +2067,26 @@ public class KickCParser extends Parser { public final ParameterListContext parameterList() throws RecognitionException { ParameterListContext _localctx = new ParameterListContext(_ctx, getState()); - enterRule(_localctx, 18, RULE_parameterList); + enterRule(_localctx, 22, RULE_parameterList); int _la; try { enterOuterAlt(_localctx, 1); { - setState(211); + setState(245); expr(0); - setState(216); + setState(250); _errHandler.sync(this); _la = _input.LA(1); - while (_la==T__12) { + while (_la==T__17) { { { - setState(212); - match(T__12); - setState(213); + setState(246); + match(T__17); + setState(247); expr(0); } } - setState(218); + setState(252); _errHandler.sync(this); _la = _input.LA(1); } @@ -1848,11 +2105,11 @@ public class KickCParser extends Parser { public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { switch (ruleIndex) { - case 5: - return typeDecl_sempred((TypeDeclContext)_localctx, predIndex); case 7: + return typeDecl_sempred((TypeDeclContext)_localctx, predIndex); + case 9: return lvalue_sempred((LvalueContext)_localctx, predIndex); - case 8: + case 10: return expr_sempred((ExprContext)_localctx, predIndex); } return true; @@ -1896,79 +2153,93 @@ public class KickCParser extends Parser { } public static final String _serializedATN = - "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\39\u00de\4\2\t\2\4"+ + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3>\u0100\4\2\t\2\4"+ "\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+ - "\13\3\2\3\2\3\2\3\3\6\3\33\n\3\r\3\16\3\34\3\4\3\4\5\4!\n\4\3\4\3\4\3"+ - "\4\3\4\3\4\5\4(\n\4\3\4\3\4\3\4\5\4-\n\4\3\4\3\4\3\4\5\4\62\n\4\3\4\3"+ - "\4\3\4\3\4\5\48\n\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3"+ - "\4\3\4\3\4\3\4\3\4\5\4K\n\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3"+ - "\4\3\4\3\4\3\4\3\4\5\4\\\n\4\3\4\5\4_\n\4\3\5\3\5\3\5\7\5d\n\5\f\5\16"+ - "\5g\13\5\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\5\7t\n\7\3\7\7\7"+ - "w\n\7\f\7\16\7z\13\7\3\b\3\b\3\b\3\b\3\b\7\b\u0081\n\b\f\b\16\b\u0084"+ - "\13\b\3\b\3\b\5\b\u0088\n\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\5\t\u0092"+ - "\n\t\3\t\3\t\3\t\3\t\3\t\7\t\u0099\n\t\f\t\16\t\u009c\13\t\3\n\3\n\3\n"+ - "\3\n\3\n\3\n\3\n\3\n\5\n\u00a6\n\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n"+ - "\3\n\3\n\3\n\3\n\3\n\5\n\u00b6\n\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n"+ - "\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\7\n\u00d1"+ - "\n\n\f\n\16\n\u00d4\13\n\3\13\3\13\3\13\7\13\u00d9\n\13\f\13\16\13\u00dc"+ - "\13\13\3\13\2\5\f\20\22\f\2\4\6\b\n\f\16\20\22\24\2\n\3\2\23\24\4\2\20"+ - "\20\25\31\3\2\32\33\4\2\20\20\34\34\3\2\25\26\3\2\35%\3\2&\'\3\2()\2\u00fe"+ - "\2\26\3\2\2\2\4\32\3\2\2\2\6^\3\2\2\2\b`\3\2\2\2\nh\3\2\2\2\fk\3\2\2\2"+ - "\16\u0087\3\2\2\2\20\u0091\3\2\2\2\22\u00b5\3\2\2\2\24\u00d5\3\2\2\2\26"+ - "\27\5\4\3\2\27\30\7\2\2\3\30\3\3\2\2\2\31\33\5\6\4\2\32\31\3\2\2\2\33"+ - "\34\3\2\2\2\34\32\3\2\2\2\34\35\3\2\2\2\35\5\3\2\2\2\36 \7\3\2\2\37!\5"+ - "\4\3\2 \37\3\2\2\2 !\3\2\2\2!\"\3\2\2\2\"_\7\4\2\2#$\5\f\7\2$%\7\66\2"+ - "\2%\'\7\5\2\2&(\5\b\5\2\'&\3\2\2\2\'(\3\2\2\2()\3\2\2\2)*\7\6\2\2*,\7"+ - "\3\2\2+-\5\4\3\2,+\3\2\2\2,-\3\2\2\2-.\3\2\2\2./\7\4\2\2/_\3\2\2\2\60"+ - "\62\7\7\2\2\61\60\3\2\2\2\61\62\3\2\2\2\62\63\3\2\2\2\63\64\5\f\7\2\64"+ - "\67\7\66\2\2\65\66\7\b\2\2\668\5\16\b\2\67\65\3\2\2\2\678\3\2\2\289\3"+ - "\2\2\29:\7\t\2\2:_\3\2\2\2;<\5\20\t\2<=\7\b\2\2=>\5\22\n\2>?\7\t\2\2?"+ - "_\3\2\2\2@A\5\22\n\2AB\7\t\2\2B_\3\2\2\2CD\7\n\2\2DE\7\5\2\2EF\5\22\n"+ - "\2FG\7\6\2\2GJ\5\6\4\2HI\7\13\2\2IK\5\6\4\2JH\3\2\2\2JK\3\2\2\2K_\3\2"+ - "\2\2LM\7\f\2\2MN\7\5\2\2NO\5\22\n\2OP\7\6\2\2PQ\5\6\4\2Q_\3\2\2\2RS\7"+ - "\r\2\2ST\5\6\4\2TU\7\f\2\2UV\7\5\2\2VW\5\22\n\2WX\7\6\2\2X_\3\2\2\2Y["+ - "\7\16\2\2Z\\\5\22\n\2[Z\3\2\2\2[\\\3\2\2\2\\]\3\2\2\2]_\7\t\2\2^\36\3"+ - "\2\2\2^#\3\2\2\2^\61\3\2\2\2^;\3\2\2\2^@\3\2\2\2^C\3\2\2\2^L\3\2\2\2^"+ - "R\3\2\2\2^Y\3\2\2\2_\7\3\2\2\2`e\5\n\6\2ab\7\17\2\2bd\5\n\6\2ca\3\2\2"+ - "\2dg\3\2\2\2ec\3\2\2\2ef\3\2\2\2f\t\3\2\2\2ge\3\2\2\2hi\5\f\7\2ij\7\66"+ - "\2\2j\13\3\2\2\2kl\b\7\1\2lm\7*\2\2mx\3\2\2\2no\f\4\2\2ow\7\20\2\2pq\f"+ - "\3\2\2qs\7\21\2\2rt\5\22\n\2sr\3\2\2\2st\3\2\2\2tu\3\2\2\2uw\7\22\2\2"+ - "vn\3\2\2\2vp\3\2\2\2wz\3\2\2\2xv\3\2\2\2xy\3\2\2\2y\r\3\2\2\2zx\3\2\2"+ - "\2{\u0088\5\22\n\2|}\7\3\2\2}\u0082\5\16\b\2~\177\7\17\2\2\177\u0081\5"+ - "\16\b\2\u0080~\3\2\2\2\u0081\u0084\3\2\2\2\u0082\u0080\3\2\2\2\u0082\u0083"+ - "\3\2\2\2\u0083\u0085\3\2\2\2\u0084\u0082\3\2\2\2\u0085\u0086\7\4\2\2\u0086"+ - "\u0088\3\2\2\2\u0087{\3\2\2\2\u0087|\3\2\2\2\u0088\17\3\2\2\2\u0089\u008a"+ - "\b\t\1\2\u008a\u008b\7\5\2\2\u008b\u008c\5\20\t\2\u008c\u008d\7\6\2\2"+ - "\u008d\u0092\3\2\2\2\u008e\u0092\7\66\2\2\u008f\u0090\7\20\2\2\u0090\u0092"+ - "\5\20\t\4\u0091\u0089\3\2\2\2\u0091\u008e\3\2\2\2\u0091\u008f\3\2\2\2"+ - "\u0092\u009a\3\2\2\2\u0093\u0094\f\3\2\2\u0094\u0095\7\21\2\2\u0095\u0096"+ - "\5\22\n\2\u0096\u0097\7\22\2\2\u0097\u0099\3\2\2\2\u0098\u0093\3\2\2\2"+ - "\u0099\u009c\3\2\2\2\u009a\u0098\3\2\2\2\u009a\u009b\3\2\2\2\u009b\21"+ - "\3\2\2\2\u009c\u009a\3\2\2\2\u009d\u009e\b\n\1\2\u009e\u009f\7\5\2\2\u009f"+ - "\u00a0\5\22\n\2\u00a0\u00a1\7\6\2\2\u00a1\u00b6\3\2\2\2\u00a2\u00a3\7"+ - "\66\2\2\u00a3\u00a5\7\5\2\2\u00a4\u00a6\5\24\13\2\u00a5\u00a4\3\2\2\2"+ - "\u00a5\u00a6\3\2\2\2\u00a6\u00a7\3\2\2\2\u00a7\u00b6\7\6\2\2\u00a8\u00a9"+ - "\7\5\2\2\u00a9\u00aa\5\f\7\2\u00aa\u00ab\7\6\2\2\u00ab\u00ac\5\22\n\21"+ - "\u00ac\u00b6\3\2\2\2\u00ad\u00ae\t\2\2\2\u00ae\u00b6\5\22\n\17\u00af\u00b0"+ - "\t\3\2\2\u00b0\u00b6\5\22\n\r\u00b1\u00b6\7\66\2\2\u00b2\u00b6\7-\2\2"+ - "\u00b3\u00b6\7+\2\2\u00b4\u00b6\7,\2\2\u00b5\u009d\3\2\2\2\u00b5\u00a2"+ - "\3\2\2\2\u00b5\u00a8\3\2\2\2\u00b5\u00ad\3\2\2\2\u00b5\u00af\3\2\2\2\u00b5"+ - "\u00b1\3\2\2\2\u00b5\u00b2\3\2\2\2\u00b5\u00b3\3\2\2\2\u00b5\u00b4\3\2"+ - "\2\2\u00b6\u00d2\3\2\2\2\u00b7\u00b8\f\f\2\2\u00b8\u00b9\t\4\2\2\u00b9"+ - "\u00d1\5\22\n\r\u00ba\u00bb\f\13\2\2\u00bb\u00bc\t\5\2\2\u00bc\u00d1\5"+ - "\22\n\f\u00bd\u00be\f\n\2\2\u00be\u00bf\t\6\2\2\u00bf\u00d1\5\22\n\13"+ - "\u00c0\u00c1\f\t\2\2\u00c1\u00c2\t\7\2\2\u00c2\u00d1\5\22\n\n\u00c3\u00c4"+ - "\f\b\2\2\u00c4\u00c5\t\b\2\2\u00c5\u00d1\5\22\n\t\u00c6\u00c7\f\7\2\2"+ - "\u00c7\u00c8\t\t\2\2\u00c8\u00d1\5\22\n\b\u00c9\u00ca\f\20\2\2\u00ca\u00cb"+ - "\7\21\2\2\u00cb\u00cc\5\22\n\2\u00cc\u00cd\7\22\2\2\u00cd\u00d1\3\2\2"+ - "\2\u00ce\u00cf\f\16\2\2\u00cf\u00d1\t\2\2\2\u00d0\u00b7\3\2\2\2\u00d0"+ - "\u00ba\3\2\2\2\u00d0\u00bd\3\2\2\2\u00d0\u00c0\3\2\2\2\u00d0\u00c3\3\2"+ - "\2\2\u00d0\u00c6\3\2\2\2\u00d0\u00c9\3\2\2\2\u00d0\u00ce\3\2\2\2\u00d1"+ - "\u00d4\3\2\2\2\u00d2\u00d0\3\2\2\2\u00d2\u00d3\3\2\2\2\u00d3\23\3\2\2"+ - "\2\u00d4\u00d2\3\2\2\2\u00d5\u00da\5\22\n\2\u00d6\u00d7\7\17\2\2\u00d7"+ - "\u00d9\5\22\n\2\u00d8\u00d6\3\2\2\2\u00d9\u00dc\3\2\2\2\u00da\u00d8\3"+ - "\2\2\2\u00da\u00db\3\2\2\2\u00db\25\3\2\2\2\u00dc\u00da\3\2\2\2\30\34"+ - " \',\61\67J[^esvx\u0082\u0087\u0091\u009a\u00a5\u00b5\u00d0\u00d2\u00da"; + "\13\4\f\t\f\4\r\t\r\3\2\3\2\3\2\3\3\6\3\37\n\3\r\3\16\3 \3\4\3\4\5\4%"+ + "\n\4\3\4\3\4\3\4\3\4\3\4\5\4,\n\4\3\4\3\4\3\4\5\4\61\n\4\3\4\3\4\3\4\5"+ + "\4\66\n\4\3\4\3\4\3\4\3\4\5\4<\n\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4"+ + "\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\5\4O\n\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4"+ + "\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\5\4a\n\4\3\4\3\4\3\4\3\4\3\4\3\4"+ + "\5\4i\n\4\3\4\5\4l\n\4\3\5\5\5o\n\5\3\5\3\5\3\5\5\5t\n\5\3\6\3\6\3\6\3"+ + "\6\5\6z\n\6\3\6\3\6\3\6\3\6\3\6\5\6\u0081\n\6\3\7\3\7\3\7\7\7\u0086\n"+ + "\7\f\7\16\7\u0089\13\7\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\5\t"+ + "\u0096\n\t\3\t\7\t\u0099\n\t\f\t\16\t\u009c\13\t\3\n\3\n\3\n\3\n\3\n\7"+ + "\n\u00a3\n\n\f\n\16\n\u00a6\13\n\3\n\3\n\5\n\u00aa\n\n\3\13\3\13\3\13"+ + "\3\13\3\13\3\13\3\13\3\13\5\13\u00b4\n\13\3\13\3\13\3\13\3\13\3\13\7\13"+ + "\u00bb\n\13\f\13\16\13\u00be\13\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\5\f"+ + "\u00c8\n\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\5\f"+ + "\u00d8\n\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f"+ + "\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\7\f\u00f3\n\f\f\f\16\f\u00f6"+ + "\13\f\3\r\3\r\3\r\7\r\u00fb\n\r\f\r\16\r\u00fe\13\r\3\r\2\5\20\24\26\16"+ + "\2\4\6\b\n\f\16\20\22\24\26\30\2\13\3\2\21\23\3\2\30\31\4\2\25\25\32\36"+ + "\3\2\37 \4\2\25\25!!\3\2\32\33\3\2\"*\3\2+,\3\2-.\2\u0124\2\32\3\2\2\2"+ + "\4\36\3\2\2\2\6k\3\2\2\2\bn\3\2\2\2\n\u0080\3\2\2\2\f\u0082\3\2\2\2\16"+ + "\u008a\3\2\2\2\20\u008d\3\2\2\2\22\u00a9\3\2\2\2\24\u00b3\3\2\2\2\26\u00d7"+ + "\3\2\2\2\30\u00f7\3\2\2\2\32\33\5\4\3\2\33\34\7\2\2\3\34\3\3\2\2\2\35"+ + "\37\5\6\4\2\36\35\3\2\2\2\37 \3\2\2\2 \36\3\2\2\2 !\3\2\2\2!\5\3\2\2\2"+ + "\"$\7\3\2\2#%\5\4\3\2$#\3\2\2\2$%\3\2\2\2%&\3\2\2\2&l\7\4\2\2\'(\5\20"+ + "\t\2()\7;\2\2)+\7\5\2\2*,\5\f\7\2+*\3\2\2\2+,\3\2\2\2,-\3\2\2\2-.\7\6"+ + "\2\2.\60\7\3\2\2/\61\5\4\3\2\60/\3\2\2\2\60\61\3\2\2\2\61\62\3\2\2\2\62"+ + "\63\7\4\2\2\63l\3\2\2\2\64\66\7\7\2\2\65\64\3\2\2\2\65\66\3\2\2\2\66\67"+ + "\3\2\2\2\678\5\20\t\28;\7;\2\29:\7\b\2\2:<\5\22\n\2;9\3\2\2\2;<\3\2\2"+ + "\2<=\3\2\2\2=>\7\t\2\2>l\3\2\2\2?@\5\24\13\2@A\7\b\2\2AB\5\26\f\2BC\7"+ + "\t\2\2Cl\3\2\2\2DE\5\26\f\2EF\7\t\2\2Fl\3\2\2\2GH\7\n\2\2HI\7\5\2\2IJ"+ + "\5\26\f\2JK\7\6\2\2KN\5\6\4\2LM\7\13\2\2MO\5\6\4\2NL\3\2\2\2NO\3\2\2\2"+ + "Ol\3\2\2\2PQ\7\f\2\2QR\7\5\2\2RS\5\26\f\2ST\7\6\2\2TU\5\6\4\2Ul\3\2\2"+ + "\2VW\7\r\2\2WX\5\6\4\2XY\7\f\2\2YZ\7\5\2\2Z[\5\26\f\2[\\\7\6\2\2\\l\3"+ + "\2\2\2]^\7\16\2\2^`\7\5\2\2_a\5\b\5\2`_\3\2\2\2`a\3\2\2\2ab\3\2\2\2bc"+ + "\5\n\6\2cd\7\6\2\2de\5\6\4\2el\3\2\2\2fh\7\17\2\2gi\5\26\f\2hg\3\2\2\2"+ + "hi\3\2\2\2ij\3\2\2\2jl\7\t\2\2k\"\3\2\2\2k\'\3\2\2\2k\65\3\2\2\2k?\3\2"+ + "\2\2kD\3\2\2\2kG\3\2\2\2kP\3\2\2\2kV\3\2\2\2k]\3\2\2\2kf\3\2\2\2l\7\3"+ + "\2\2\2mo\5\20\t\2nm\3\2\2\2no\3\2\2\2op\3\2\2\2ps\7;\2\2qr\7\b\2\2rt\5"+ + "\22\n\2sq\3\2\2\2st\3\2\2\2t\t\3\2\2\2uv\7\t\2\2vw\5\26\f\2wy\7\t\2\2"+ + "xz\5\26\f\2yx\3\2\2\2yz\3\2\2\2z\u0081\3\2\2\2{|\7\20\2\2|}\5\26\f\2}"+ + "~\t\2\2\2~\177\5\26\f\2\177\u0081\3\2\2\2\u0080u\3\2\2\2\u0080{\3\2\2"+ + "\2\u0081\13\3\2\2\2\u0082\u0087\5\16\b\2\u0083\u0084\7\24\2\2\u0084\u0086"+ + "\5\16\b\2\u0085\u0083\3\2\2\2\u0086\u0089\3\2\2\2\u0087\u0085\3\2\2\2"+ + "\u0087\u0088\3\2\2\2\u0088\r\3\2\2\2\u0089\u0087\3\2\2\2\u008a\u008b\5"+ + "\20\t\2\u008b\u008c\7;\2\2\u008c\17\3\2\2\2\u008d\u008e\b\t\1\2\u008e"+ + "\u008f\7/\2\2\u008f\u009a\3\2\2\2\u0090\u0091\f\4\2\2\u0091\u0099\7\25"+ + "\2\2\u0092\u0093\f\3\2\2\u0093\u0095\7\26\2\2\u0094\u0096\5\26\f\2\u0095"+ + "\u0094\3\2\2\2\u0095\u0096\3\2\2\2\u0096\u0097\3\2\2\2\u0097\u0099\7\27"+ + "\2\2\u0098\u0090\3\2\2\2\u0098\u0092\3\2\2\2\u0099\u009c\3\2\2\2\u009a"+ + "\u0098\3\2\2\2\u009a\u009b\3\2\2\2\u009b\21\3\2\2\2\u009c\u009a\3\2\2"+ + "\2\u009d\u00aa\5\26\f\2\u009e\u009f\7\3\2\2\u009f\u00a4\5\22\n\2\u00a0"+ + "\u00a1\7\24\2\2\u00a1\u00a3\5\22\n\2\u00a2\u00a0\3\2\2\2\u00a3\u00a6\3"+ + "\2\2\2\u00a4\u00a2\3\2\2\2\u00a4\u00a5\3\2\2\2\u00a5\u00a7\3\2\2\2\u00a6"+ + "\u00a4\3\2\2\2\u00a7\u00a8\7\4\2\2\u00a8\u00aa\3\2\2\2\u00a9\u009d\3\2"+ + "\2\2\u00a9\u009e\3\2\2\2\u00aa\23\3\2\2\2\u00ab\u00ac\b\13\1\2\u00ac\u00ad"+ + "\7\5\2\2\u00ad\u00ae\5\24\13\2\u00ae\u00af\7\6\2\2\u00af\u00b4\3\2\2\2"+ + "\u00b0\u00b4\7;\2\2\u00b1\u00b2\7\25\2\2\u00b2\u00b4\5\24\13\4\u00b3\u00ab"+ + "\3\2\2\2\u00b3\u00b0\3\2\2\2\u00b3\u00b1\3\2\2\2\u00b4\u00bc\3\2\2\2\u00b5"+ + "\u00b6\f\3\2\2\u00b6\u00b7\7\26\2\2\u00b7\u00b8\5\26\f\2\u00b8\u00b9\7"+ + "\27\2\2\u00b9\u00bb\3\2\2\2\u00ba\u00b5\3\2\2\2\u00bb\u00be\3\2\2\2\u00bc"+ + "\u00ba\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd\25\3\2\2\2\u00be\u00bc\3\2\2"+ + "\2\u00bf\u00c0\b\f\1\2\u00c0\u00c1\7\5\2\2\u00c1\u00c2\5\26\f\2\u00c2"+ + "\u00c3\7\6\2\2\u00c3\u00d8\3\2\2\2\u00c4\u00c5\7;\2\2\u00c5\u00c7\7\5"+ + "\2\2\u00c6\u00c8\5\30\r\2\u00c7\u00c6\3\2\2\2\u00c7\u00c8\3\2\2\2\u00c8"+ + "\u00c9\3\2\2\2\u00c9\u00d8\7\6\2\2\u00ca\u00cb\7\5\2\2\u00cb\u00cc\5\20"+ + "\t\2\u00cc\u00cd\7\6\2\2\u00cd\u00ce\5\26\f\21\u00ce\u00d8\3\2\2\2\u00cf"+ + "\u00d0\t\3\2\2\u00d0\u00d8\5\26\f\17\u00d1\u00d2\t\4\2\2\u00d2\u00d8\5"+ + "\26\f\r\u00d3\u00d8\7;\2\2\u00d4\u00d8\7\62\2\2\u00d5\u00d8\7\60\2\2\u00d6"+ + "\u00d8\7\61\2\2\u00d7\u00bf\3\2\2\2\u00d7\u00c4\3\2\2\2\u00d7\u00ca\3"+ + "\2\2\2\u00d7\u00cf\3\2\2\2\u00d7\u00d1\3\2\2\2\u00d7\u00d3\3\2\2\2\u00d7"+ + "\u00d4\3\2\2\2\u00d7\u00d5\3\2\2\2\u00d7\u00d6\3\2\2\2\u00d8\u00f4\3\2"+ + "\2\2\u00d9\u00da\f\f\2\2\u00da\u00db\t\5\2\2\u00db\u00f3\5\26\f\r\u00dc"+ + "\u00dd\f\13\2\2\u00dd\u00de\t\6\2\2\u00de\u00f3\5\26\f\f\u00df\u00e0\f"+ + "\n\2\2\u00e0\u00e1\t\7\2\2\u00e1\u00f3\5\26\f\13\u00e2\u00e3\f\t\2\2\u00e3"+ + "\u00e4\t\b\2\2\u00e4\u00f3\5\26\f\n\u00e5\u00e6\f\b\2\2\u00e6\u00e7\t"+ + "\t\2\2\u00e7\u00f3\5\26\f\t\u00e8\u00e9\f\7\2\2\u00e9\u00ea\t\n\2\2\u00ea"+ + "\u00f3\5\26\f\b\u00eb\u00ec\f\20\2\2\u00ec\u00ed\7\26\2\2\u00ed\u00ee"+ + "\5\26\f\2\u00ee\u00ef\7\27\2\2\u00ef\u00f3\3\2\2\2\u00f0\u00f1\f\16\2"+ + "\2\u00f1\u00f3\t\3\2\2\u00f2\u00d9\3\2\2\2\u00f2\u00dc\3\2\2\2\u00f2\u00df"+ + "\3\2\2\2\u00f2\u00e2\3\2\2\2\u00f2\u00e5\3\2\2\2\u00f2\u00e8\3\2\2\2\u00f2"+ + "\u00eb\3\2\2\2\u00f2\u00f0\3\2\2\2\u00f3\u00f6\3\2\2\2\u00f4\u00f2\3\2"+ + "\2\2\u00f4\u00f5\3\2\2\2\u00f5\27\3\2\2\2\u00f6\u00f4\3\2\2\2\u00f7\u00fc"+ + "\5\26\f\2\u00f8\u00f9\7\24\2\2\u00f9\u00fb\5\26\f\2\u00fa\u00f8\3\2\2"+ + "\2\u00fb\u00fe\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd\31"+ + "\3\2\2\2\u00fe\u00fc\3\2\2\2\35 $+\60\65;N`hknsy\u0080\u0087\u0095\u0098"+ + "\u009a\u00a4\u00a9\u00b3\u00bc\u00c7\u00d7\u00f2\u00f4\u00fc"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/main/java/dk/camelot64/kickc/parser/KickCVisitor.java b/src/main/java/dk/camelot64/kickc/parser/KickCVisitor.java index 06343039a..00d3dce9f 100644 --- a/src/main/java/dk/camelot64/kickc/parser/KickCVisitor.java +++ b/src/main/java/dk/camelot64/kickc/parser/KickCVisitor.java @@ -1,4 +1,4 @@ -// Generated from C:/c64/src/kickc/src/dk/camelot64/kickc/parser\KickC.g4 by ANTLR 4.7 +// Generated from /Users/jespergravgaard/c64/src/kickc/src/main/java/dk/camelot64/kickc/parser/KickC.g4 by ANTLR 4.7 package dk.camelot64.kickc.parser; import org.antlr.v4.runtime.tree.ParseTreeVisitor; @@ -78,6 +78,13 @@ public interface KickCVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitStmtDoWhile(KickCParser.StmtDoWhileContext ctx); + /** + * Visit a parse tree produced by the {@code stmtFor} + * labeled alternative in {@link KickCParser#stmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitStmtFor(KickCParser.StmtForContext ctx); /** * Visit a parse tree produced by the {@code stmtReturn} * labeled alternative in {@link KickCParser#stmt}. @@ -85,6 +92,27 @@ public interface KickCVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitStmtReturn(KickCParser.StmtReturnContext ctx); + /** + * Visit a parse tree produced by the {@code forDecl} + * labeled alternative in {@link KickCParser#forDeclaration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitForDecl(KickCParser.ForDeclContext ctx); + /** + * Visit a parse tree produced by the {@code forClassic} + * labeled alternative in {@link KickCParser#forIteration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitForClassic(KickCParser.ForClassicContext ctx); + /** + * Visit a parse tree produced by the {@code forRange} + * labeled alternative in {@link KickCParser#forIteration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitForRange(KickCParser.ForRangeContext ctx); /** * Visit a parse tree produced by {@link KickCParser#parameterListDecl}. * @param ctx the parse tree