From eb6ee9bff8b1df1001fcc04f173904d928621ca2 Mon Sep 17 00:00:00 2001 From: Jesper Gravgaard Date: Sat, 23 Dec 2017 15:35:13 +0100 Subject: [PATCH] Prepared parser for inline word expressions. --- .../kickc/fragment/AsmFragmentSignature.java | 7 +- .../java/dk/camelot64/kickc/parser/KickC.g4 | 10 +- .../kickc/parser/KickCBaseListener.java | 38 +- .../kickc/parser/KickCBaseVisitor.java | 23 +- .../dk/camelot64/kickc/parser/KickCLexer.java | 2 +- .../camelot64/kickc/parser/KickCListener.java | 38 +- .../camelot64/kickc/parser/KickCParser.java | 1141 ++++++++--------- .../camelot64/kickc/parser/KickCVisitor.java | 23 +- .../passes/ParseTreeConstantEvaluator.java | 5 - .../passes/StatementSequenceGenerator.java | 13 +- 10 files changed, 585 insertions(+), 715 deletions(-) diff --git a/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentSignature.java b/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentSignature.java index 743e35cc6..ec34cef65 100644 --- a/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentSignature.java +++ b/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentSignature.java @@ -159,9 +159,10 @@ public class AsmFragmentSignature { ControlFlowBlock destinationBlock = graph.getBlock(destination); String destinationLabel; if (destinationBlock.hasPhiBlock()) { - destinationLabel = (destinationBlock.getLabel().getLocalName() + "_from_" + block.getLabel().getLocalName()).replace( - '@', - 'b').replace(':', '_'); + destinationLabel = + (destinationBlock.getLabel().getLocalName() + + "_from_" + + block.getLabel().getLocalName()).replace('@', 'b').replace(':', '_'); } else { destinationLabel = destination.getLocalName(); } diff --git a/src/main/java/dk/camelot64/kickc/parser/KickC.g4 b/src/main/java/dk/camelot64/kickc/parser/KickC.g4 index 1b551516e..02f2976f0 100644 --- a/src/main/java/dk/camelot64/kickc/parser/KickC.g4 +++ b/src/main/java/dk/camelot64/kickc/parser/KickC.g4 @@ -33,7 +33,7 @@ parameterDecl : typeDecl NAME ; declVar - : ('const')? typeDecl NAME ('=' initializer)? ';' + : ('const')? typeDecl NAME ('=' expr)? ';' ; stmtSeq @@ -54,7 +54,7 @@ stmt ; forDeclaration - : typeDecl? NAME ('=' initializer)? #forDecl + : typeDecl? NAME ('=' expr)? #forDecl ; forIteration @@ -69,11 +69,6 @@ typeDecl | typeDecl '[' (expr)? ']' #typeArray ; -initializer - : expr #initExpr - | '{' initializer (',' initializer )* '}' #initList - ; - lvalue : NAME #lvalueName | '*' NAME #lvaluePtr @@ -99,6 +94,7 @@ expr | expr ( '|' ) expr #exprBinary | expr ( '&&' ) expr #exprBinary | expr ( '||' ) expr #exprBinary + | '{' expr (',' expr )* '}' #initList | NAME #exprId | NUMBER #exprNumber | STRING #exprString diff --git a/src/main/java/dk/camelot64/kickc/parser/KickCBaseListener.java b/src/main/java/dk/camelot64/kickc/parser/KickCBaseListener.java index 30b48f2e5..e2c01d154 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 /Users/jespergravgaard/c64/src/kickc/src/main/java/dk/camelot64/kickc/parser/KickC.g4 by ANTLR 4.7 +// Generated from C:/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; @@ -347,30 +347,6 @@ public class KickCBaseListener implements KickCListener { *

The default implementation does nothing.

*/ @Override public void exitTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterInitExpr(KickCParser.InitExprContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitInitExpr(KickCParser.InitExprContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterInitList(KickCParser.InitListContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitInitList(KickCParser.InitListContext ctx) { } /** * {@inheritDoc} * @@ -503,6 +479,18 @@ public class KickCBaseListener implements KickCListener { *

The default implementation does nothing.

*/ @Override public void exitExprChar(KickCParser.ExprCharContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterInitList(KickCParser.InitListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitInitList(KickCParser.InitListContext 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 ec95a5fbe..bce3e303d 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 /Users/jespergravgaard/c64/src/kickc/src/main/java/dk/camelot64/kickc/parser/KickC.g4 by ANTLR 4.7 +// Generated from C:/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; @@ -207,20 +207,6 @@ public class KickCBaseVisitor extends AbstractParseTreeVisitor implements * {@link #visitChildren} on {@code ctx}.

*/ @Override public T visitTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

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

- */ - @Override public T visitInitExpr(KickCParser.InitExprContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

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

- */ - @Override public T visitInitList(KickCParser.InitListContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * @@ -298,6 +284,13 @@ public class KickCBaseVisitor extends AbstractParseTreeVisitor implements * {@link #visitChildren} on {@code ctx}.

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

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

+ */ + @Override public T visitInitList(KickCParser.InitListContext 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 42d59254f..b0c8cfa43 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 /Users/jespergravgaard/c64/src/kickc/src/main/java/dk/camelot64/kickc/parser/KickC.g4 by ANTLR 4.7 +// Generated from C:/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; diff --git a/src/main/java/dk/camelot64/kickc/parser/KickCListener.java b/src/main/java/dk/camelot64/kickc/parser/KickCListener.java index 7a156913f..54ccb0a3f 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 /Users/jespergravgaard/c64/src/kickc/src/main/java/dk/camelot64/kickc/parser/KickC.g4 by ANTLR 4.7 +// Generated from C:/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; @@ -325,30 +325,6 @@ public interface KickCListener extends ParseTreeListener { * @param ctx the parse tree */ void exitTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx); - /** - * Enter a parse tree produced by the {@code initExpr} - * labeled alternative in {@link KickCParser#initializer}. - * @param ctx the parse tree - */ - void enterInitExpr(KickCParser.InitExprContext ctx); - /** - * Exit a parse tree produced by the {@code initExpr} - * labeled alternative in {@link KickCParser#initializer}. - * @param ctx the parse tree - */ - void exitInitExpr(KickCParser.InitExprContext ctx); - /** - * Enter a parse tree produced by the {@code initList} - * labeled alternative in {@link KickCParser#initializer}. - * @param ctx the parse tree - */ - void enterInitList(KickCParser.InitListContext ctx); - /** - * Exit a parse tree produced by the {@code initList} - * labeled alternative in {@link KickCParser#initializer}. - * @param ctx the parse tree - */ - void exitInitList(KickCParser.InitListContext ctx); /** * Enter a parse tree produced by the {@code lvalueName} * labeled alternative in {@link KickCParser#lvalue}. @@ -481,6 +457,18 @@ public interface KickCListener extends ParseTreeListener { * @param ctx the parse tree */ void exitExprChar(KickCParser.ExprCharContext ctx); + /** + * Enter a parse tree produced by the {@code initList} + * labeled alternative in {@link KickCParser#expr}. + * @param ctx the parse tree + */ + void enterInitList(KickCParser.InitListContext ctx); + /** + * Exit a parse tree produced by the {@code initList} + * labeled alternative in {@link KickCParser#expr}. + * @param ctx the parse tree + */ + void exitInitList(KickCParser.InitListContext ctx); /** * Enter a parse tree produced by the {@code exprCast} * labeled alternative in {@link KickCParser#expr}. diff --git a/src/main/java/dk/camelot64/kickc/parser/KickCParser.java b/src/main/java/dk/camelot64/kickc/parser/KickCParser.java index a5e887cf9..6b9b5514d 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 /Users/jespergravgaard/c64/src/kickc/src/main/java/dk/camelot64/kickc/parser/KickC.g4 by ANTLR 4.7 +// Generated from C:/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; @@ -31,15 +31,14 @@ public class KickCParser extends Parser { RULE_file = 0, RULE_asmFile = 1, RULE_importSeq = 2, RULE_importDecl = 3, RULE_declSeq = 4, RULE_decl = 5, RULE_parameterListDecl = 6, RULE_parameterDecl = 7, RULE_declVar = 8, RULE_stmtSeq = 9, RULE_stmt = 10, RULE_forDeclaration = 11, - RULE_forIteration = 12, RULE_typeDecl = 13, RULE_initializer = 14, RULE_lvalue = 15, - RULE_expr = 16, RULE_parameterList = 17, RULE_asmLines = 18, RULE_asmLine = 19, - RULE_asmLabel = 20, RULE_asmInstruction = 21, RULE_asmParamMode = 22, - RULE_asmExpr = 23; + RULE_forIteration = 12, RULE_typeDecl = 13, RULE_lvalue = 14, RULE_expr = 15, + RULE_parameterList = 16, RULE_asmLines = 17, RULE_asmLine = 18, RULE_asmLabel = 19, + RULE_asmInstruction = 20, RULE_asmParamMode = 21, RULE_asmExpr = 22; public static final String[] ruleNames = { "file", "asmFile", "importSeq", "importDecl", "declSeq", "decl", "parameterListDecl", "parameterDecl", "declVar", "stmtSeq", "stmt", "forDeclaration", "forIteration", - "typeDecl", "initializer", "lvalue", "expr", "parameterList", "asmLines", - "asmLine", "asmLabel", "asmInstruction", "asmParamMode", "asmExpr" + "typeDecl", "lvalue", "expr", "parameterList", "asmLines", "asmLine", + "asmLabel", "asmInstruction", "asmParamMode", "asmExpr" }; private static final String[] _LITERAL_NAMES = { @@ -141,11 +140,11 @@ public class KickCParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(48); + setState(46); importSeq(); - setState(49); + setState(47); declSeq(); - setState(50); + setState(48); match(EOF); } } @@ -190,9 +189,9 @@ public class KickCParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(52); + setState(50); asmLines(); - setState(53); + setState(51); match(EOF); } } @@ -240,17 +239,17 @@ public class KickCParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(58); + setState(56); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__0) { { { - setState(55); + setState(53); importDecl(); } } - setState(60); + setState(58); _errHandler.sync(this); _la = _input.LA(1); } @@ -294,9 +293,9 @@ public class KickCParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(61); + setState(59); match(T__0); - setState(62); + setState(60); match(STRING); } } @@ -344,17 +343,17 @@ public class KickCParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(65); + setState(63); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(64); + setState(62); decl(); } } - setState(67); + setState(65); _errHandler.sync(this); _la = _input.LA(1); } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__6) | (1L << T__18) | (1L << SIMPLETYPE))) != 0) ); @@ -433,44 +432,44 @@ public class KickCParser extends Parser { enterRule(_localctx, 10, RULE_decl); int _la; try { - setState(83); + setState(81); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) { case 1: _localctx = new DeclMethodContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(69); + setState(67); typeDecl(0); - setState(70); + setState(68); match(NAME); - setState(71); + setState(69); match(T__1); - setState(73); + setState(71); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__18 || _la==SIMPLETYPE) { { - setState(72); + setState(70); parameterListDecl(); } } - setState(75); + setState(73); match(T__2); - setState(76); + setState(74); match(T__3); - setState(78); + setState(76); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__3) | (1L << T__6) | (1L << T__9) | (1L << T__11) | (1L << T__12) | (1L << T__13) | (1L << T__14) | (1L << T__15) | (1L << T__18) | (1L << T__19) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << SIMPLETYPE) | (1L << STRING) | (1L << CHAR) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { { - setState(77); + setState(75); stmtSeq(); } } - setState(80); + setState(78); match(T__4); } break; @@ -478,7 +477,7 @@ public class KickCParser extends Parser { _localctx = new DeclVariableContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(82); + setState(80); declVar(); } break; @@ -528,21 +527,21 @@ public class KickCParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(85); + setState(83); parameterDecl(); - setState(90); + setState(88); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__5) { { { - setState(86); + setState(84); match(T__5); - setState(87); + setState(85); parameterDecl(); } } - setState(92); + setState(90); _errHandler.sync(this); _la = _input.LA(1); } @@ -589,9 +588,9 @@ public class KickCParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(93); + setState(91); typeDecl(0); - setState(94); + setState(92); match(NAME); } } @@ -611,8 +610,8 @@ public class KickCParser extends Parser { return getRuleContext(TypeDeclContext.class,0); } public TerminalNode NAME() { return getToken(KickCParser.NAME, 0); } - public InitializerContext initializer() { - return getRuleContext(InitializerContext.class,0); + public ExprContext expr() { + return getRuleContext(ExprContext.class,0); } public DeclVarContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); @@ -640,33 +639,33 @@ public class KickCParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(97); + setState(95); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__6) { { - setState(96); + setState(94); match(T__6); } } - setState(99); + setState(97); typeDecl(0); - setState(100); + setState(98); match(NAME); - setState(103); + setState(101); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__7) { { - setState(101); + setState(99); match(T__7); - setState(102); - initializer(); + setState(100); + expr(0); } } - setState(105); + setState(103); match(T__8); } } @@ -714,17 +713,17 @@ public class KickCParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(108); + setState(106); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(107); + setState(105); stmt(); } } - setState(110); + setState(108); _errHandler.sync(this); _la = _input.LA(1); } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__3) | (1L << T__6) | (1L << T__9) | (1L << T__11) | (1L << T__12) | (1L << T__13) | (1L << T__14) | (1L << T__15) | (1L << T__18) | (1L << T__19) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << SIMPLETYPE) | (1L << STRING) | (1L << CHAR) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0) ); @@ -969,14 +968,14 @@ public class KickCParser extends Parser { enterRule(_localctx, 20, RULE_stmt); int _la; try { - setState(168); + setState(166); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,13,_ctx) ) { case 1: _localctx = new StmtDeclVarContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(112); + setState(110); declVar(); } break; @@ -984,19 +983,19 @@ public class KickCParser extends Parser { _localctx = new StmtBlockContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(113); + setState(111); match(T__3); - setState(115); + setState(113); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__3) | (1L << T__6) | (1L << T__9) | (1L << T__11) | (1L << T__12) | (1L << T__13) | (1L << T__14) | (1L << T__15) | (1L << T__18) | (1L << T__19) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << SIMPLETYPE) | (1L << STRING) | (1L << CHAR) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { { - setState(114); + setState(112); stmtSeq(); } } - setState(117); + setState(115); match(T__4); } break; @@ -1004,13 +1003,13 @@ public class KickCParser extends Parser { _localctx = new StmtAssignmentContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(118); + setState(116); lvalue(0); - setState(119); + setState(117); match(T__7); - setState(120); + setState(118); expr(0); - setState(121); + setState(119); match(T__8); } break; @@ -1018,9 +1017,9 @@ public class KickCParser extends Parser { _localctx = new StmtExprContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(123); + setState(121); expr(0); - setState(124); + setState(122); match(T__8); } break; @@ -1028,24 +1027,24 @@ public class KickCParser extends Parser { _localctx = new StmtIfElseContext(_localctx); enterOuterAlt(_localctx, 5); { - setState(126); + setState(124); match(T__9); - setState(127); + setState(125); match(T__1); - setState(128); + setState(126); expr(0); - setState(129); + setState(127); match(T__2); - setState(130); + setState(128); stmt(); - setState(133); + setState(131); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,10,_ctx) ) { case 1: { - setState(131); + setState(129); match(T__10); - setState(132); + setState(130); stmt(); } break; @@ -1056,15 +1055,15 @@ public class KickCParser extends Parser { _localctx = new StmtWhileContext(_localctx); enterOuterAlt(_localctx, 6); { - setState(135); + setState(133); match(T__11); - setState(136); + setState(134); match(T__1); - setState(137); + setState(135); expr(0); - setState(138); + setState(136); match(T__2); - setState(139); + setState(137); stmt(); } break; @@ -1072,19 +1071,19 @@ public class KickCParser extends Parser { _localctx = new StmtDoWhileContext(_localctx); enterOuterAlt(_localctx, 7); { - setState(141); + setState(139); match(T__12); - setState(142); + setState(140); stmt(); - setState(143); + setState(141); match(T__11); - setState(144); + setState(142); match(T__1); - setState(145); + setState(143); expr(0); - setState(146); + setState(144); match(T__2); - setState(147); + setState(145); match(T__8); } break; @@ -1092,25 +1091,25 @@ public class KickCParser extends Parser { _localctx = new StmtForContext(_localctx); enterOuterAlt(_localctx, 8); { - setState(149); + setState(147); match(T__13); - setState(150); + setState(148); match(T__1); - setState(152); + setState(150); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__18) | (1L << SIMPLETYPE) | (1L << NAME))) != 0)) { { - setState(151); + setState(149); forDeclaration(); } } - setState(154); + setState(152); forIteration(); - setState(155); + setState(153); match(T__2); - setState(156); + setState(154); stmt(); } break; @@ -1118,19 +1117,19 @@ public class KickCParser extends Parser { _localctx = new StmtReturnContext(_localctx); enterOuterAlt(_localctx, 9); { - setState(158); + setState(156); match(T__14); - setState(160); + setState(158); _errHandler.sync(this); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__19) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << STRING) | (1L << CHAR) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__3) | (1L << T__19) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << STRING) | (1L << CHAR) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { { - setState(159); + setState(157); expr(0); } } - setState(162); + setState(160); match(T__8); } break; @@ -1138,13 +1137,13 @@ public class KickCParser extends Parser { _localctx = new StmtAsmContext(_localctx); enterOuterAlt(_localctx, 10); { - setState(163); + setState(161); match(T__15); - setState(164); + setState(162); match(T__3); - setState(165); + setState(163); asmLines(); - setState(166); + setState(164); match(T__4); } break; @@ -1177,8 +1176,8 @@ public class KickCParser extends Parser { public TypeDeclContext typeDecl() { return getRuleContext(TypeDeclContext.class,0); } - public InitializerContext initializer() { - return getRuleContext(InitializerContext.class,0); + public ExprContext expr() { + return getRuleContext(ExprContext.class,0); } public ForDeclContext(ForDeclarationContext ctx) { copyFrom(ctx); } @Override @@ -1204,27 +1203,27 @@ public class KickCParser extends Parser { _localctx = new ForDeclContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(171); + setState(169); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__18 || _la==SIMPLETYPE) { { - setState(170); + setState(168); typeDecl(0); } } - setState(173); + setState(171); match(NAME); - setState(176); + setState(174); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__7) { { - setState(174); + setState(172); match(T__7); - setState(175); - initializer(); + setState(173); + expr(0); } } @@ -1302,25 +1301,25 @@ public class KickCParser extends Parser { enterRule(_localctx, 24, RULE_forIteration); int _la; try { - setState(189); + setState(187); _errHandler.sync(this); switch (_input.LA(1)) { case T__8: _localctx = new ForClassicContext(_localctx); enterOuterAlt(_localctx, 1); { + setState(176); + match(T__8); + setState(177); + expr(0); setState(178); match(T__8); - setState(179); - expr(0); setState(180); - match(T__8); - setState(182); _errHandler.sync(this); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__19) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << STRING) | (1L << CHAR) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__3) | (1L << T__19) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << STRING) | (1L << CHAR) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { { - setState(181); + setState(179); expr(0); } } @@ -1331,15 +1330,15 @@ public class KickCParser extends Parser { _localctx = new ForRangeContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(184); + setState(182); match(T__16); - setState(185); + setState(183); expr(0); { - setState(186); + setState(184); match(T__17); } - setState(187); + setState(185); expr(0); } break; @@ -1461,7 +1460,7 @@ public class KickCParser extends Parser { int _alt; enterOuterAlt(_localctx, 1); { - setState(195); + setState(193); _errHandler.sync(this); switch (_input.LA(1)) { case SIMPLETYPE: @@ -1470,7 +1469,7 @@ public class KickCParser extends Parser { _ctx = _localctx; _prevctx = _localctx; - setState(192); + setState(190); match(SIMPLETYPE); } break; @@ -1479,9 +1478,9 @@ public class KickCParser extends Parser { _localctx = new TypeSignedSimpleContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(193); + setState(191); match(T__18); - setState(194); + setState(192); match(SIMPLETYPE); } break; @@ -1489,7 +1488,7 @@ public class KickCParser extends Parser { throw new NoViableAltException(this); } _ctx.stop = _input.LT(-1); - setState(207); + setState(205); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,21,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -1497,16 +1496,16 @@ public class KickCParser extends Parser { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(205); + setState(203); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) { case 1: { _localctx = new TypePtrContext(new TypeDeclContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_typeDecl); - setState(197); + setState(195); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(198); + setState(196); match(T__19); } break; @@ -1514,28 +1513,28 @@ public class KickCParser extends Parser { { _localctx = new TypeArrayContext(new TypeDeclContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_typeDecl); - setState(199); + setState(197); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(200); + setState(198); match(T__20); - setState(202); + setState(200); _errHandler.sync(this); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__19) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << STRING) | (1L << CHAR) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__3) | (1L << T__19) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << STRING) | (1L << CHAR) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { { - setState(201); + setState(199); expr(0); } } - setState(204); + setState(202); match(T__21); } break; } } } - setState(209); + setState(207); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,21,_ctx); } @@ -1552,133 +1551,6 @@ public class KickCParser extends Parser { return _localctx; } - public static class InitializerContext extends ParserRuleContext { - public InitializerContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_initializer; } - - public InitializerContext() { } - public void copyFrom(InitializerContext ctx) { - super.copyFrom(ctx); - } - } - public static class InitListContext extends InitializerContext { - public List initializer() { - return getRuleContexts(InitializerContext.class); - } - public InitializerContext initializer(int i) { - return getRuleContext(InitializerContext.class,i); - } - public InitListContext(InitializerContext ctx) { copyFrom(ctx); } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof KickCListener ) ((KickCListener)listener).enterInitList(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof KickCListener ) ((KickCListener)listener).exitInitList(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof KickCVisitor ) return ((KickCVisitor)visitor).visitInitList(this); - else return visitor.visitChildren(this); - } - } - public static class InitExprContext extends InitializerContext { - public ExprContext expr() { - return getRuleContext(ExprContext.class,0); - } - public InitExprContext(InitializerContext ctx) { copyFrom(ctx); } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof KickCListener ) ((KickCListener)listener).enterInitExpr(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof KickCListener ) ((KickCListener)listener).exitInitExpr(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof KickCVisitor ) return ((KickCVisitor)visitor).visitInitExpr(this); - else return visitor.visitChildren(this); - } - } - - public final InitializerContext initializer() throws RecognitionException { - InitializerContext _localctx = new InitializerContext(_ctx, getState()); - enterRule(_localctx, 28, RULE_initializer); - int _la; - try { - setState(222); - _errHandler.sync(this); - switch (_input.LA(1)) { - case T__1: - case T__19: - case T__22: - case T__23: - case T__24: - case T__25: - case T__26: - case T__27: - case T__28: - case T__29: - case T__30: - case STRING: - case CHAR: - case BOOLEAN: - case NUMBER: - case NAME: - _localctx = new InitExprContext(_localctx); - enterOuterAlt(_localctx, 1); - { - setState(210); - expr(0); - } - break; - case T__3: - _localctx = new InitListContext(_localctx); - enterOuterAlt(_localctx, 2); - { - setState(211); - match(T__3); - setState(212); - initializer(); - setState(217); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__5) { - { - { - setState(213); - match(T__5); - setState(214); - initializer(); - } - } - setState(219); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(220); - match(T__4); - } - 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 LvalueContext extends ParserRuleContext { public LvalueContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); @@ -1794,23 +1666,23 @@ public class KickCParser extends Parser { int _parentState = getState(); LvalueContext _localctx = new LvalueContext(_ctx, _parentState); LvalueContext _prevctx = _localctx; - int _startState = 30; - enterRecursionRule(_localctx, 30, RULE_lvalue, _p); + int _startState = 28; + enterRecursionRule(_localctx, 28, RULE_lvalue, _p); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { - setState(235); + setState(219); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,22,_ctx) ) { case 1: { _localctx = new LvalueNameContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(225); + setState(209); match(NAME); } break; @@ -1819,9 +1691,9 @@ public class KickCParser extends Parser { _localctx = new LvaluePtrContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(226); + setState(210); match(T__19); - setState(227); + setState(211); match(NAME); } break; @@ -1830,13 +1702,13 @@ public class KickCParser extends Parser { _localctx = new LvaluePtrExprContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(228); + setState(212); match(T__19); - setState(229); + setState(213); match(T__1); - setState(230); + setState(214); expr(0); - setState(231); + setState(215); match(T__2); } break; @@ -1845,7 +1717,7 @@ public class KickCParser extends Parser { _localctx = new LvalueLoHiContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(233); + setState(217); _la = _input.LA(1); if ( !(_la==T__22 || _la==T__23) ) { _errHandler.recoverInline(this); @@ -1855,15 +1727,15 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(234); + setState(218); lvalue(2); } break; } _ctx.stop = _input.LT(-1); - setState(244); + setState(228); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,25,_ctx); + _alt = getInterpreter().adaptivePredict(_input,23,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); @@ -1872,20 +1744,20 @@ public class KickCParser extends Parser { { _localctx = new LvalueArrayContext(new LvalueContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_lvalue); - setState(237); + setState(221); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(238); + setState(222); match(T__20); - setState(239); + setState(223); expr(0); - setState(240); + setState(224); match(T__21); } } } - setState(246); + setState(230); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,25,_ctx); + _alt = getInterpreter().adaptivePredict(_input,23,_ctx); } } } @@ -2024,6 +1896,28 @@ public class KickCParser extends Parser { else return visitor.visitChildren(this); } } + public static class InitListContext extends ExprContext { + public List expr() { + return getRuleContexts(ExprContext.class); + } + public ExprContext expr(int i) { + return getRuleContext(ExprContext.class,i); + } + public InitListContext(ExprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof KickCListener ) ((KickCListener)listener).enterInitList(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof KickCListener ) ((KickCListener)listener).exitInitList(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof KickCVisitor ) return ((KickCVisitor)visitor).visitInitList(this); + else return visitor.visitChildren(this); + } + } public static class ExprCastContext extends ExprContext { public TypeDeclContext typeDecl() { return getRuleContext(TypeDeclContext.class,0); @@ -2168,27 +2062,27 @@ public class KickCParser extends Parser { int _parentState = getState(); ExprContext _localctx = new ExprContext(_ctx, _parentState); ExprContext _prevctx = _localctx; - int _startState = 32; - enterRecursionRule(_localctx, 32, RULE_expr, _p); + int _startState = 30; + enterRecursionRule(_localctx, 30, RULE_expr, _p); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { - setState(272); + setState(267); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,26,_ctx) ) { case 1: { _localctx = new ExprParContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(248); + setState(232); match(T__1); - setState(249); + setState(233); expr(0); - setState(250); + setState(234); match(T__2); } break; @@ -2197,21 +2091,21 @@ public class KickCParser extends Parser { _localctx = new ExprCallContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(252); + setState(236); match(NAME); - setState(253); + setState(237); match(T__1); - setState(255); + setState(239); _errHandler.sync(this); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__19) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << STRING) | (1L << CHAR) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__3) | (1L << T__19) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << STRING) | (1L << CHAR) | (1L << BOOLEAN) | (1L << NUMBER) | (1L << NAME))) != 0)) { { - setState(254); + setState(238); parameterList(); } } - setState(257); + setState(241); match(T__2); } break; @@ -2220,14 +2114,14 @@ public class KickCParser extends Parser { _localctx = new ExprCastContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(258); + setState(242); match(T__1); - setState(259); + setState(243); typeDecl(0); - setState(260); + setState(244); match(T__2); - setState(261); - expr(19); + setState(245); + expr(20); } break; case 4: @@ -2235,7 +2129,7 @@ public class KickCParser extends Parser { _localctx = new ExprPreModContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(263); + setState(247); _la = _input.LA(1); if ( !(_la==T__24 || _la==T__25) ) { _errHandler.recoverInline(this); @@ -2245,8 +2139,8 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(264); - expr(17); + setState(248); + expr(18); } break; case 5: @@ -2254,7 +2148,7 @@ public class KickCParser extends Parser { _localctx = new ExprUnaryContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(265); + setState(249); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__19) | (1L << T__22) | (1L << T__23) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30))) != 0)) ) { _errHandler.recoverInline(this); @@ -2264,75 +2158,104 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(266); - expr(15); + setState(250); + expr(16); } break; case 6: { - _localctx = new ExprIdContext(_localctx); + _localctx = new InitListContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(267); - match(NAME); + setState(251); + match(T__3); + setState(252); + expr(0); + setState(257); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==T__5) { + { + { + setState(253); + match(T__5); + setState(254); + expr(0); + } + } + setState(259); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(260); + match(T__4); } break; case 7: { - _localctx = new ExprNumberContext(_localctx); + _localctx = new ExprIdContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(268); - match(NUMBER); + setState(262); + match(NAME); } break; case 8: { - _localctx = new ExprStringContext(_localctx); + _localctx = new ExprNumberContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(269); - match(STRING); + setState(263); + match(NUMBER); } break; case 9: { - _localctx = new ExprCharContext(_localctx); + _localctx = new ExprStringContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(270); - match(CHAR); + setState(264); + match(STRING); } break; case 10: + { + _localctx = new ExprCharContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(265); + match(CHAR); + } + break; + case 11: { _localctx = new ExprBoolContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(271); + setState(266); match(BOOLEAN); } break; } _ctx.stop = _input.LT(-1); - setState(310); + setState(305); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,29,_ctx); + _alt = getInterpreter().adaptivePredict(_input,28,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(308); + setState(303); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) { case 1: { _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(274); - if (!(precpred(_ctx, 14))) throw new FailedPredicateException(this, "precpred(_ctx, 14)"); - setState(275); + setState(269); + if (!(precpred(_ctx, 15))) throw new FailedPredicateException(this, "precpred(_ctx, 15)"); + setState(270); _la = _input.LA(1); if ( !(_la==T__31 || _la==T__32) ) { _errHandler.recoverInline(this); @@ -2342,17 +2265,17 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(276); - expr(15); + setState(271); + expr(16); } break; case 2: { _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(277); - if (!(precpred(_ctx, 13))) throw new FailedPredicateException(this, "precpred(_ctx, 13)"); - setState(278); + setState(272); + if (!(precpred(_ctx, 14))) throw new FailedPredicateException(this, "precpred(_ctx, 14)"); + setState(273); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__19) | (1L << T__33) | (1L << T__34))) != 0)) ) { _errHandler.recoverInline(this); @@ -2362,17 +2285,17 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(279); - expr(14); + setState(274); + expr(15); } break; case 3: { _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(280); - if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)"); - setState(281); + setState(275); + if (!(precpred(_ctx, 13))) throw new FailedPredicateException(this, "precpred(_ctx, 13)"); + setState(276); _la = _input.LA(1); if ( !(_la==T__26 || _la==T__27) ) { _errHandler.recoverInline(this); @@ -2382,17 +2305,17 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(282); - expr(13); + setState(277); + expr(14); } break; case 4: { _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(283); - if (!(precpred(_ctx, 11))) throw new FailedPredicateException(this, "precpred(_ctx, 11)"); - setState(284); + setState(278); + if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)"); + setState(279); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__22) | (1L << T__23) | (1L << T__35) | (1L << T__36) | (1L << T__37) | (1L << T__38) | (1L << T__39) | (1L << T__40) | (1L << T__41))) != 0)) ) { _errHandler.recoverInline(this); @@ -2402,91 +2325,91 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(285); - expr(12); + setState(280); + expr(13); } break; case 5: { _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(286); - if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); + setState(281); + if (!(precpred(_ctx, 11))) throw new FailedPredicateException(this, "precpred(_ctx, 11)"); { - setState(287); + setState(282); match(T__29); } - setState(288); - expr(11); + setState(283); + expr(12); } break; case 6: { _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(289); - if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); + setState(284); + if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); { - setState(290); + setState(285); match(T__42); } - setState(291); - expr(10); + setState(286); + expr(11); } break; case 7: { _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(292); - if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); + setState(287); + if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); { - setState(293); + setState(288); match(T__43); } - setState(294); - expr(9); + setState(289); + expr(10); } break; case 8: { _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(295); - if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); + setState(290); + if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); { - setState(296); + setState(291); match(T__44); } - setState(297); - expr(8); + setState(292); + expr(9); } break; case 9: { _localctx = new ExprBinaryContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(298); - if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); + setState(293); + if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); { - setState(299); + setState(294); match(T__45); } - setState(300); - expr(7); + setState(295); + expr(8); } break; case 10: { _localctx = new ExprArrayContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(301); - if (!(precpred(_ctx, 18))) throw new FailedPredicateException(this, "precpred(_ctx, 18)"); - setState(302); + setState(296); + if (!(precpred(_ctx, 19))) throw new FailedPredicateException(this, "precpred(_ctx, 19)"); + setState(297); match(T__20); - setState(303); + setState(298); expr(0); - setState(304); + setState(299); match(T__21); } break; @@ -2494,9 +2417,9 @@ public class KickCParser extends Parser { { _localctx = new ExprPostModContext(new ExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expr); - setState(306); - if (!(precpred(_ctx, 16))) throw new FailedPredicateException(this, "precpred(_ctx, 16)"); - setState(307); + setState(301); + if (!(precpred(_ctx, 17))) throw new FailedPredicateException(this, "precpred(_ctx, 17)"); + setState(302); _la = _input.LA(1); if ( !(_la==T__24 || _la==T__25) ) { _errHandler.recoverInline(this); @@ -2511,9 +2434,9 @@ public class KickCParser extends Parser { } } } - setState(312); + setState(307); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,29,_ctx); + _alt = getInterpreter().adaptivePredict(_input,28,_ctx); } } } @@ -2556,26 +2479,26 @@ public class KickCParser extends Parser { public final ParameterListContext parameterList() throws RecognitionException { ParameterListContext _localctx = new ParameterListContext(_ctx, getState()); - enterRule(_localctx, 34, RULE_parameterList); + enterRule(_localctx, 32, RULE_parameterList); int _la; try { enterOuterAlt(_localctx, 1); { - setState(313); + setState(308); expr(0); - setState(318); + setState(313); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__5) { { { - setState(314); + setState(309); match(T__5); - setState(315); + setState(310); expr(0); } } - setState(320); + setState(315); _errHandler.sync(this); _la = _input.LA(1); } @@ -2620,22 +2543,22 @@ public class KickCParser extends Parser { public final AsmLinesContext asmLines() throws RecognitionException { AsmLinesContext _localctx = new AsmLinesContext(_ctx, getState()); - enterRule(_localctx, 36, RULE_asmLines); + enterRule(_localctx, 34, RULE_asmLines); int _la; try { enterOuterAlt(_localctx, 1); { - setState(324); + setState(319); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__28) | (1L << MNEMONIC) | (1L << NAME))) != 0)) { { { - setState(321); + setState(316); asmLine(); } } - setState(326); + setState(321); _errHandler.sync(this); _la = _input.LA(1); } @@ -2680,23 +2603,23 @@ public class KickCParser extends Parser { public final AsmLineContext asmLine() throws RecognitionException { AsmLineContext _localctx = new AsmLineContext(_ctx, getState()); - enterRule(_localctx, 38, RULE_asmLine); + enterRule(_localctx, 36, RULE_asmLine); try { - setState(329); + setState(324); _errHandler.sync(this); switch (_input.LA(1)) { case T__28: case NAME: enterOuterAlt(_localctx, 1); { - setState(327); + setState(322); asmLabel(); } break; case MNEMONIC: enterOuterAlt(_localctx, 2); { - setState(328); + setState(323); asmInstruction(); } break; @@ -2738,26 +2661,26 @@ public class KickCParser extends Parser { public final AsmLabelContext asmLabel() throws RecognitionException { AsmLabelContext _localctx = new AsmLabelContext(_ctx, getState()); - enterRule(_localctx, 40, RULE_asmLabel); + enterRule(_localctx, 38, RULE_asmLabel); try { - setState(335); + setState(330); _errHandler.sync(this); switch (_input.LA(1)) { case NAME: enterOuterAlt(_localctx, 1); { - setState(331); + setState(326); match(NAME); - setState(332); + setState(327); match(T__16); } break; case T__28: enterOuterAlt(_localctx, 2); { - setState(333); + setState(328); match(T__28); - setState(334); + setState(329); match(T__16); } break; @@ -2802,18 +2725,18 @@ public class KickCParser extends Parser { public final AsmInstructionContext asmInstruction() throws RecognitionException { AsmInstructionContext _localctx = new AsmInstructionContext(_ctx, getState()); - enterRule(_localctx, 42, RULE_asmInstruction); + enterRule(_localctx, 40, RULE_asmInstruction); try { enterOuterAlt(_localctx, 1); { - setState(337); + setState(332); match(MNEMONIC); - setState(339); + setState(334); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,33,_ctx) ) { case 1: { - setState(338); + setState(333); asmParamMode(); } break; @@ -2962,16 +2885,16 @@ public class KickCParser extends Parser { public final AsmParamModeContext asmParamMode() throws RecognitionException { AsmParamModeContext _localctx = new AsmParamModeContext(_ctx, getState()); - enterRule(_localctx, 44, RULE_asmParamMode); + enterRule(_localctx, 42, RULE_asmParamMode); try { - setState(364); + setState(359); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,35,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) { case 1: _localctx = new AsmModeAbsContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(341); + setState(336); asmExpr(0); } break; @@ -2979,9 +2902,9 @@ public class KickCParser extends Parser { _localctx = new AsmModeImmContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(342); + setState(337); match(T__46); - setState(343); + setState(338); asmExpr(0); } break; @@ -2989,11 +2912,11 @@ public class KickCParser extends Parser { _localctx = new AsmModeAbsXYContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(344); + setState(339); asmExpr(0); - setState(345); + setState(340); match(T__5); - setState(346); + setState(341); match(NAME); } break; @@ -3001,15 +2924,15 @@ public class KickCParser extends Parser { _localctx = new AsmModeIndIdxXYContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(348); + setState(343); match(T__1); - setState(349); + setState(344); asmExpr(0); - setState(350); + setState(345); match(T__2); - setState(351); + setState(346); match(T__5); - setState(352); + setState(347); match(NAME); } break; @@ -3017,15 +2940,15 @@ public class KickCParser extends Parser { _localctx = new AsmModeIdxIndXYContext(_localctx); enterOuterAlt(_localctx, 5); { - setState(354); + setState(349); match(T__1); - setState(355); + setState(350); asmExpr(0); - setState(356); + setState(351); match(T__5); - setState(357); + setState(352); match(NAME); - setState(358); + setState(353); match(T__2); } break; @@ -3033,11 +2956,11 @@ public class KickCParser extends Parser { _localctx = new AsmModeIndContext(_localctx); enterOuterAlt(_localctx, 6); { - setState(360); + setState(355); match(T__1); - setState(361); + setState(356); asmExpr(0); - setState(362); + setState(357); match(T__2); } break; @@ -3201,14 +3124,14 @@ public class KickCParser extends Parser { int _parentState = getState(); AsmExprContext _localctx = new AsmExprContext(_ctx, _parentState); AsmExprContext _prevctx = _localctx; - int _startState = 46; - enterRecursionRule(_localctx, 46, RULE_asmExpr, _p); + int _startState = 44; + enterRecursionRule(_localctx, 44, RULE_asmExpr, _p); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { - setState(376); + setState(371); _errHandler.sync(this); switch (_input.LA(1)) { case T__22: @@ -3220,7 +3143,7 @@ public class KickCParser extends Parser { _ctx = _localctx; _prevctx = _localctx; - setState(367); + setState(362); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__22) | (1L << T__23) | (1L << T__26) | (1L << T__27))) != 0)) ) { _errHandler.recoverInline(this); @@ -3230,7 +3153,7 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(368); + setState(363); asmExpr(8); } break; @@ -3239,7 +3162,7 @@ public class KickCParser extends Parser { _localctx = new AsmExprLabelContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(369); + setState(364); match(NAME); } break; @@ -3248,7 +3171,7 @@ public class KickCParser extends Parser { _localctx = new AsmExprLabelRelContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(370); + setState(365); match(ASMREL); } break; @@ -3257,11 +3180,11 @@ public class KickCParser extends Parser { _localctx = new AsmExprReplaceContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(371); + setState(366); match(T__3); - setState(372); + setState(367); match(NAME); - setState(373); + setState(368); match(T__4); } break; @@ -3270,7 +3193,7 @@ public class KickCParser extends Parser { _localctx = new AsmExprIntContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(374); + setState(369); match(NUMBER); } break; @@ -3279,7 +3202,7 @@ public class KickCParser extends Parser { _localctx = new AsmExprCharContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(375); + setState(370); match(CHAR); } break; @@ -3287,24 +3210,24 @@ public class KickCParser extends Parser { throw new NoViableAltException(this); } _ctx.stop = _input.LT(-1); - setState(386); + setState(381); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,38,_ctx); + _alt = getInterpreter().adaptivePredict(_input,37,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(384); + setState(379); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,37,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,36,_ctx) ) { case 1: { _localctx = new AsmExprBinaryContext(new AsmExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_asmExpr); - setState(378); + setState(373); if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); - setState(379); + setState(374); _la = _input.LA(1); if ( !(_la==T__19 || _la==T__33) ) { _errHandler.recoverInline(this); @@ -3314,7 +3237,7 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(380); + setState(375); asmExpr(8); } break; @@ -3322,9 +3245,9 @@ public class KickCParser extends Parser { { _localctx = new AsmExprBinaryContext(new AsmExprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_asmExpr); - setState(381); + setState(376); if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); - setState(382); + setState(377); _la = _input.LA(1); if ( !(_la==T__26 || _la==T__27) ) { _errHandler.recoverInline(this); @@ -3334,16 +3257,16 @@ public class KickCParser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(383); + setState(378); asmExpr(7); } break; } } } - setState(388); + setState(383); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,38,_ctx); + _alt = getInterpreter().adaptivePredict(_input,37,_ctx); } } } @@ -3362,11 +3285,11 @@ public class KickCParser extends Parser { switch (ruleIndex) { case 13: return typeDecl_sempred((TypeDeclContext)_localctx, predIndex); - case 15: + case 14: return lvalue_sempred((LvalueContext)_localctx, predIndex); - case 16: + case 15: return expr_sempred((ExprContext)_localctx, predIndex); - case 23: + case 22: return asmExpr_sempred((AsmExprContext)_localctx, predIndex); } return true; @@ -3390,27 +3313,27 @@ public class KickCParser extends Parser { private boolean expr_sempred(ExprContext _localctx, int predIndex) { switch (predIndex) { case 3: - return precpred(_ctx, 14); + return precpred(_ctx, 15); case 4: - return precpred(_ctx, 13); + return precpred(_ctx, 14); case 5: - return precpred(_ctx, 12); + return precpred(_ctx, 13); case 6: - return precpred(_ctx, 11); + return precpred(_ctx, 12); case 7: - return precpred(_ctx, 10); + return precpred(_ctx, 11); case 8: - return precpred(_ctx, 9); + return precpred(_ctx, 10); case 9: - return precpred(_ctx, 8); + return precpred(_ctx, 9); case 10: - return precpred(_ctx, 7); + return precpred(_ctx, 8); case 11: - return precpred(_ctx, 6); + return precpred(_ctx, 7); case 12: - return precpred(_ctx, 18); + return precpred(_ctx, 19); case 13: - return precpred(_ctx, 16); + return precpred(_ctx, 17); } return true; } @@ -3425,153 +3348,151 @@ public class KickCParser extends Parser { } public static final String _serializedATN = - "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3D\u0188\4\2\t\2\4"+ + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3D\u0183\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"+ - "\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\4\7\4;\n\4\f\4\16\4>\13\4\3\5\3\5\3\5\3"+ - "\6\6\6D\n\6\r\6\16\6E\3\7\3\7\3\7\3\7\5\7L\n\7\3\7\3\7\3\7\5\7Q\n\7\3"+ - "\7\3\7\3\7\5\7V\n\7\3\b\3\b\3\b\7\b[\n\b\f\b\16\b^\13\b\3\t\3\t\3\t\3"+ - "\n\5\nd\n\n\3\n\3\n\3\n\3\n\5\nj\n\n\3\n\3\n\3\13\6\13o\n\13\r\13\16\13"+ - "p\3\f\3\f\3\f\5\fv\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\5\f\u0088\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\5\f\u009b\n\f\3\f\3\f\3\f\3\f\3\f\3\f\5\f"+ - "\u00a3\n\f\3\f\3\f\3\f\3\f\3\f\3\f\5\f\u00ab\n\f\3\r\5\r\u00ae\n\r\3\r"+ - "\3\r\3\r\5\r\u00b3\n\r\3\16\3\16\3\16\3\16\5\16\u00b9\n\16\3\16\3\16\3"+ - "\16\3\16\3\16\5\16\u00c0\n\16\3\17\3\17\3\17\3\17\5\17\u00c6\n\17\3\17"+ - "\3\17\3\17\3\17\3\17\5\17\u00cd\n\17\3\17\7\17\u00d0\n\17\f\17\16\17\u00d3"+ - "\13\17\3\20\3\20\3\20\3\20\3\20\7\20\u00da\n\20\f\20\16\20\u00dd\13\20"+ - "\3\20\3\20\5\20\u00e1\n\20\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21"+ - "\3\21\3\21\5\21\u00ee\n\21\3\21\3\21\3\21\3\21\3\21\7\21\u00f5\n\21\f"+ - "\21\16\21\u00f8\13\21\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\5\22\u0102"+ - "\n\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22"+ - "\3\22\3\22\5\22\u0113\n\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22"+ - "\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22"+ - "\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\7\22\u0137\n\22"+ - "\f\22\16\22\u013a\13\22\3\23\3\23\3\23\7\23\u013f\n\23\f\23\16\23\u0142"+ - "\13\23\3\24\7\24\u0145\n\24\f\24\16\24\u0148\13\24\3\25\3\25\5\25\u014c"+ - "\n\25\3\26\3\26\3\26\3\26\5\26\u0152\n\26\3\27\3\27\5\27\u0156\n\27\3"+ - "\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3"+ - "\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\5\30\u016f\n\30\3\31\3\31"+ - "\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\5\31\u017b\n\31\3\31\3\31\3\31"+ - "\3\31\3\31\3\31\7\31\u0183\n\31\f\31\16\31\u0186\13\31\3\31\2\6\34 \""+ - "\60\32\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\2\13\3\2\31"+ - "\32\3\2\33\34\5\2\26\26\31\32\35!\3\2\"#\4\2\26\26$%\3\2\35\36\4\2\31"+ - "\32&,\4\2\31\32\35\36\4\2\26\26$$\2\u01b9\2\62\3\2\2\2\4\66\3\2\2\2\6"+ - "<\3\2\2\2\b?\3\2\2\2\nC\3\2\2\2\fU\3\2\2\2\16W\3\2\2\2\20_\3\2\2\2\22"+ - "c\3\2\2\2\24n\3\2\2\2\26\u00aa\3\2\2\2\30\u00ad\3\2\2\2\32\u00bf\3\2\2"+ - "\2\34\u00c5\3\2\2\2\36\u00e0\3\2\2\2 \u00ed\3\2\2\2\"\u0112\3\2\2\2$\u013b"+ - "\3\2\2\2&\u0146\3\2\2\2(\u014b\3\2\2\2*\u0151\3\2\2\2,\u0153\3\2\2\2."+ - "\u016e\3\2\2\2\60\u017a\3\2\2\2\62\63\5\6\4\2\63\64\5\n\6\2\64\65\7\2"+ - "\2\3\65\3\3\2\2\2\66\67\5&\24\2\678\7\2\2\38\5\3\2\2\29;\5\b\5\2:9\3\2"+ - "\2\2;>\3\2\2\2<:\3\2\2\2<=\3\2\2\2=\7\3\2\2\2><\3\2\2\2?@\7\3\2\2@A\7"+ - "\64\2\2A\t\3\2\2\2BD\5\f\7\2CB\3\2\2\2DE\3\2\2\2EC\3\2\2\2EF\3\2\2\2F"+ - "\13\3\2\2\2GH\5\34\17\2HI\7@\2\2IK\7\4\2\2JL\5\16\b\2KJ\3\2\2\2KL\3\2"+ - "\2\2LM\3\2\2\2MN\7\5\2\2NP\7\6\2\2OQ\5\24\13\2PO\3\2\2\2PQ\3\2\2\2QR\3"+ - "\2\2\2RS\7\7\2\2SV\3\2\2\2TV\5\22\n\2UG\3\2\2\2UT\3\2\2\2V\r\3\2\2\2W"+ - "\\\5\20\t\2XY\7\b\2\2Y[\5\20\t\2ZX\3\2\2\2[^\3\2\2\2\\Z\3\2\2\2\\]\3\2"+ - "\2\2]\17\3\2\2\2^\\\3\2\2\2_`\5\34\17\2`a\7@\2\2a\21\3\2\2\2bd\7\t\2\2"+ - "cb\3\2\2\2cd\3\2\2\2de\3\2\2\2ef\5\34\17\2fi\7@\2\2gh\7\n\2\2hj\5\36\20"+ - "\2ig\3\2\2\2ij\3\2\2\2jk\3\2\2\2kl\7\13\2\2l\23\3\2\2\2mo\5\26\f\2nm\3"+ - "\2\2\2op\3\2\2\2pn\3\2\2\2pq\3\2\2\2q\25\3\2\2\2r\u00ab\5\22\n\2su\7\6"+ - "\2\2tv\5\24\13\2ut\3\2\2\2uv\3\2\2\2vw\3\2\2\2w\u00ab\7\7\2\2xy\5 \21"+ - "\2yz\7\n\2\2z{\5\"\22\2{|\7\13\2\2|\u00ab\3\2\2\2}~\5\"\22\2~\177\7\13"+ - "\2\2\177\u00ab\3\2\2\2\u0080\u0081\7\f\2\2\u0081\u0082\7\4\2\2\u0082\u0083"+ - "\5\"\22\2\u0083\u0084\7\5\2\2\u0084\u0087\5\26\f\2\u0085\u0086\7\r\2\2"+ - "\u0086\u0088\5\26\f\2\u0087\u0085\3\2\2\2\u0087\u0088\3\2\2\2\u0088\u00ab"+ - "\3\2\2\2\u0089\u008a\7\16\2\2\u008a\u008b\7\4\2\2\u008b\u008c\5\"\22\2"+ - "\u008c\u008d\7\5\2\2\u008d\u008e\5\26\f\2\u008e\u00ab\3\2\2\2\u008f\u0090"+ - "\7\17\2\2\u0090\u0091\5\26\f\2\u0091\u0092\7\16\2\2\u0092\u0093\7\4\2"+ - "\2\u0093\u0094\5\"\22\2\u0094\u0095\7\5\2\2\u0095\u0096\7\13\2\2\u0096"+ - "\u00ab\3\2\2\2\u0097\u0098\7\20\2\2\u0098\u009a\7\4\2\2\u0099\u009b\5"+ - "\30\r\2\u009a\u0099\3\2\2\2\u009a\u009b\3\2\2\2\u009b\u009c\3\2\2\2\u009c"+ - "\u009d\5\32\16\2\u009d\u009e\7\5\2\2\u009e\u009f\5\26\f\2\u009f\u00ab"+ - "\3\2\2\2\u00a0\u00a2\7\21\2\2\u00a1\u00a3\5\"\22\2\u00a2\u00a1\3\2\2\2"+ - "\u00a2\u00a3\3\2\2\2\u00a3\u00a4\3\2\2\2\u00a4\u00ab\7\13\2\2\u00a5\u00a6"+ - "\7\22\2\2\u00a6\u00a7\7\6\2\2\u00a7\u00a8\5&\24\2\u00a8\u00a9\7\7\2\2"+ - "\u00a9\u00ab\3\2\2\2\u00aar\3\2\2\2\u00aas\3\2\2\2\u00aax\3\2\2\2\u00aa"+ - "}\3\2\2\2\u00aa\u0080\3\2\2\2\u00aa\u0089\3\2\2\2\u00aa\u008f\3\2\2\2"+ - "\u00aa\u0097\3\2\2\2\u00aa\u00a0\3\2\2\2\u00aa\u00a5\3\2\2\2\u00ab\27"+ - "\3\2\2\2\u00ac\u00ae\5\34\17\2\u00ad\u00ac\3\2\2\2\u00ad\u00ae\3\2\2\2"+ - "\u00ae\u00af\3\2\2\2\u00af\u00b2\7@\2\2\u00b0\u00b1\7\n\2\2\u00b1\u00b3"+ - "\5\36\20\2\u00b2\u00b0\3\2\2\2\u00b2\u00b3\3\2\2\2\u00b3\31\3\2\2\2\u00b4"+ - "\u00b5\7\13\2\2\u00b5\u00b6\5\"\22\2\u00b6\u00b8\7\13\2\2\u00b7\u00b9"+ - "\5\"\22\2\u00b8\u00b7\3\2\2\2\u00b8\u00b9\3\2\2\2\u00b9\u00c0\3\2\2\2"+ - "\u00ba\u00bb\7\23\2\2\u00bb\u00bc\5\"\22\2\u00bc\u00bd\7\24\2\2\u00bd"+ - "\u00be\5\"\22\2\u00be\u00c0\3\2\2\2\u00bf\u00b4\3\2\2\2\u00bf\u00ba\3"+ - "\2\2\2\u00c0\33\3\2\2\2\u00c1\u00c2\b\17\1\2\u00c2\u00c6\7\63\2\2\u00c3"+ - "\u00c4\7\25\2\2\u00c4\u00c6\7\63\2\2\u00c5\u00c1\3\2\2\2\u00c5\u00c3\3"+ - "\2\2\2\u00c6\u00d1\3\2\2\2\u00c7\u00c8\f\4\2\2\u00c8\u00d0\7\26\2\2\u00c9"+ - "\u00ca\f\3\2\2\u00ca\u00cc\7\27\2\2\u00cb\u00cd\5\"\22\2\u00cc\u00cb\3"+ - "\2\2\2\u00cc\u00cd\3\2\2\2\u00cd\u00ce\3\2\2\2\u00ce\u00d0\7\30\2\2\u00cf"+ - "\u00c7\3\2\2\2\u00cf\u00c9\3\2\2\2\u00d0\u00d3\3\2\2\2\u00d1\u00cf\3\2"+ - "\2\2\u00d1\u00d2\3\2\2\2\u00d2\35\3\2\2\2\u00d3\u00d1\3\2\2\2\u00d4\u00e1"+ - "\5\"\22\2\u00d5\u00d6\7\6\2\2\u00d6\u00db\5\36\20\2\u00d7\u00d8\7\b\2"+ - "\2\u00d8\u00da\5\36\20\2\u00d9\u00d7\3\2\2\2\u00da\u00dd\3\2\2\2\u00db"+ - "\u00d9\3\2\2\2\u00db\u00dc\3\2\2\2\u00dc\u00de\3\2\2\2\u00dd\u00db\3\2"+ - "\2\2\u00de\u00df\7\7\2\2\u00df\u00e1\3\2\2\2\u00e0\u00d4\3\2\2\2\u00e0"+ - "\u00d5\3\2\2\2\u00e1\37\3\2\2\2\u00e2\u00e3\b\21\1\2\u00e3\u00ee\7@\2"+ - "\2\u00e4\u00e5\7\26\2\2\u00e5\u00ee\7@\2\2\u00e6\u00e7\7\26\2\2\u00e7"+ - "\u00e8\7\4\2\2\u00e8\u00e9\5\"\22\2\u00e9\u00ea\7\5\2\2\u00ea\u00ee\3"+ - "\2\2\2\u00eb\u00ec\t\2\2\2\u00ec\u00ee\5 \21\4\u00ed\u00e2\3\2\2\2\u00ed"+ - "\u00e4\3\2\2\2\u00ed\u00e6\3\2\2\2\u00ed\u00eb\3\2\2\2\u00ee\u00f6\3\2"+ - "\2\2\u00ef\u00f0\f\3\2\2\u00f0\u00f1\7\27\2\2\u00f1\u00f2\5\"\22\2\u00f2"+ - "\u00f3\7\30\2\2\u00f3\u00f5\3\2\2\2\u00f4\u00ef\3\2\2\2\u00f5\u00f8\3"+ - "\2\2\2\u00f6\u00f4\3\2\2\2\u00f6\u00f7\3\2\2\2\u00f7!\3\2\2\2\u00f8\u00f6"+ - "\3\2\2\2\u00f9\u00fa\b\22\1\2\u00fa\u00fb\7\4\2\2\u00fb\u00fc\5\"\22\2"+ - "\u00fc\u00fd\7\5\2\2\u00fd\u0113\3\2\2\2\u00fe\u00ff\7@\2\2\u00ff\u0101"+ - "\7\4\2\2\u0100\u0102\5$\23\2\u0101\u0100\3\2\2\2\u0101\u0102\3\2\2\2\u0102"+ - "\u0103\3\2\2\2\u0103\u0113\7\5\2\2\u0104\u0105\7\4\2\2\u0105\u0106\5\34"+ - "\17\2\u0106\u0107\7\5\2\2\u0107\u0108\5\"\22\25\u0108\u0113\3\2\2\2\u0109"+ - "\u010a\t\3\2\2\u010a\u0113\5\"\22\23\u010b\u010c\t\4\2\2\u010c\u0113\5"+ - "\"\22\21\u010d\u0113\7@\2\2\u010e\u0113\7\67\2\2\u010f\u0113\7\64\2\2"+ - "\u0110\u0113\7\65\2\2\u0111\u0113\7\66\2\2\u0112\u00f9\3\2\2\2\u0112\u00fe"+ - "\3\2\2\2\u0112\u0104\3\2\2\2\u0112\u0109\3\2\2\2\u0112\u010b\3\2\2\2\u0112"+ - "\u010d\3\2\2\2\u0112\u010e\3\2\2\2\u0112\u010f\3\2\2\2\u0112\u0110\3\2"+ - "\2\2\u0112\u0111\3\2\2\2\u0113\u0138\3\2\2\2\u0114\u0115\f\20\2\2\u0115"+ - "\u0116\t\5\2\2\u0116\u0137\5\"\22\21\u0117\u0118\f\17\2\2\u0118\u0119"+ - "\t\6\2\2\u0119\u0137\5\"\22\20\u011a\u011b\f\16\2\2\u011b\u011c\t\7\2"+ - "\2\u011c\u0137\5\"\22\17\u011d\u011e\f\r\2\2\u011e\u011f\t\b\2\2\u011f"+ - "\u0137\5\"\22\16\u0120\u0121\f\f\2\2\u0121\u0122\7 \2\2\u0122\u0137\5"+ - "\"\22\r\u0123\u0124\f\13\2\2\u0124\u0125\7-\2\2\u0125\u0137\5\"\22\f\u0126"+ - "\u0127\f\n\2\2\u0127\u0128\7.\2\2\u0128\u0137\5\"\22\13\u0129\u012a\f"+ - "\t\2\2\u012a\u012b\7/\2\2\u012b\u0137\5\"\22\n\u012c\u012d\f\b\2\2\u012d"+ - "\u012e\7\60\2\2\u012e\u0137\5\"\22\t\u012f\u0130\f\24\2\2\u0130\u0131"+ - "\7\27\2\2\u0131\u0132\5\"\22\2\u0132\u0133\7\30\2\2\u0133\u0137\3\2\2"+ - "\2\u0134\u0135\f\22\2\2\u0135\u0137\t\3\2\2\u0136\u0114\3\2\2\2\u0136"+ - "\u0117\3\2\2\2\u0136\u011a\3\2\2\2\u0136\u011d\3\2\2\2\u0136\u0120\3\2"+ - "\2\2\u0136\u0123\3\2\2\2\u0136\u0126\3\2\2\2\u0136\u0129\3\2\2\2\u0136"+ - "\u012c\3\2\2\2\u0136\u012f\3\2\2\2\u0136\u0134\3\2\2\2\u0137\u013a\3\2"+ - "\2\2\u0138\u0136\3\2\2\2\u0138\u0139\3\2\2\2\u0139#\3\2\2\2\u013a\u0138"+ - "\3\2\2\2\u013b\u0140\5\"\22\2\u013c\u013d\7\b\2\2\u013d\u013f\5\"\22\2"+ - "\u013e\u013c\3\2\2\2\u013f\u0142\3\2\2\2\u0140\u013e\3\2\2\2\u0140\u0141"+ - "\3\2\2\2\u0141%\3\2\2\2\u0142\u0140\3\2\2\2\u0143\u0145\5(\25\2\u0144"+ - "\u0143\3\2\2\2\u0145\u0148\3\2\2\2\u0146\u0144\3\2\2\2\u0146\u0147\3\2"+ - "\2\2\u0147\'\3\2\2\2\u0148\u0146\3\2\2\2\u0149\u014c\5*\26\2\u014a\u014c"+ - "\5,\27\2\u014b\u0149\3\2\2\2\u014b\u014a\3\2\2\2\u014c)\3\2\2\2\u014d"+ - "\u014e\7@\2\2\u014e\u0152\7\23\2\2\u014f\u0150\7\37\2\2\u0150\u0152\7"+ - "\23\2\2\u0151\u014d\3\2\2\2\u0151\u014f\3\2\2\2\u0152+\3\2\2\2\u0153\u0155"+ - "\7\62\2\2\u0154\u0156\5.\30\2\u0155\u0154\3\2\2\2\u0155\u0156\3\2\2\2"+ - "\u0156-\3\2\2\2\u0157\u016f\5\60\31\2\u0158\u0159\7\61\2\2\u0159\u016f"+ - "\5\60\31\2\u015a\u015b\5\60\31\2\u015b\u015c\7\b\2\2\u015c\u015d\7@\2"+ - "\2\u015d\u016f\3\2\2\2\u015e\u015f\7\4\2\2\u015f\u0160\5\60\31\2\u0160"+ - "\u0161\7\5\2\2\u0161\u0162\7\b\2\2\u0162\u0163\7@\2\2\u0163\u016f\3\2"+ - "\2\2\u0164\u0165\7\4\2\2\u0165\u0166\5\60\31\2\u0166\u0167\7\b\2\2\u0167"+ - "\u0168\7@\2\2\u0168\u0169\7\5\2\2\u0169\u016f\3\2\2\2\u016a\u016b\7\4"+ - "\2\2\u016b\u016c\5\60\31\2\u016c\u016d\7\5\2\2\u016d\u016f\3\2\2\2\u016e"+ - "\u0157\3\2\2\2\u016e\u0158\3\2\2\2\u016e\u015a\3\2\2\2\u016e\u015e\3\2"+ - "\2\2\u016e\u0164\3\2\2\2\u016e\u016a\3\2\2\2\u016f/\3\2\2\2\u0170\u0171"+ - "\b\31\1\2\u0171\u0172\t\t\2\2\u0172\u017b\5\60\31\n\u0173\u017b\7@\2\2"+ - "\u0174\u017b\7A\2\2\u0175\u0176\7\6\2\2\u0176\u0177\7@\2\2\u0177\u017b"+ - "\7\7\2\2\u0178\u017b\7\67\2\2\u0179\u017b\7\65\2\2\u017a\u0170\3\2\2\2"+ - "\u017a\u0173\3\2\2\2\u017a\u0174\3\2\2\2\u017a\u0175\3\2\2\2\u017a\u0178"+ - "\3\2\2\2\u017a\u0179\3\2\2\2\u017b\u0184\3\2\2\2\u017c\u017d\f\t\2\2\u017d"+ - "\u017e\t\n\2\2\u017e\u0183\5\60\31\n\u017f\u0180\f\b\2\2\u0180\u0181\t"+ - "\7\2\2\u0181\u0183\5\60\31\t\u0182\u017c\3\2\2\2\u0182\u017f\3\2\2\2\u0183"+ - "\u0186\3\2\2\2\u0184\u0182\3\2\2\2\u0184\u0185\3\2\2\2\u0185\61\3\2\2"+ - "\2\u0186\u0184\3\2\2\2)\7\3\2\2>?\7\64\2\2?\t\3\2\2\2@B\5\f\7\2A@\3\2\2\2B"+ + "C\3\2\2\2CA\3\2\2\2CD\3\2\2\2D\13\3\2\2\2EF\5\34\17\2FG\7@\2\2GI\7\4\2"+ + "\2HJ\5\16\b\2IH\3\2\2\2IJ\3\2\2\2JK\3\2\2\2KL\7\5\2\2LN\7\6\2\2MO\5\24"+ + "\13\2NM\3\2\2\2NO\3\2\2\2OP\3\2\2\2PQ\7\7\2\2QT\3\2\2\2RT\5\22\n\2SE\3"+ + "\2\2\2SR\3\2\2\2T\r\3\2\2\2UZ\5\20\t\2VW\7\b\2\2WY\5\20\t\2XV\3\2\2\2"+ + "Y\\\3\2\2\2ZX\3\2\2\2Z[\3\2\2\2[\17\3\2\2\2\\Z\3\2\2\2]^\5\34\17\2^_\7"+ + "@\2\2_\21\3\2\2\2`b\7\t\2\2a`\3\2\2\2ab\3\2\2\2bc\3\2\2\2cd\5\34\17\2"+ + "dg\7@\2\2ef\7\n\2\2fh\5 \21\2ge\3\2\2\2gh\3\2\2\2hi\3\2\2\2ij\7\13\2\2"+ + "j\23\3\2\2\2km\5\26\f\2lk\3\2\2\2mn\3\2\2\2nl\3\2\2\2no\3\2\2\2o\25\3"+ + "\2\2\2p\u00a9\5\22\n\2qs\7\6\2\2rt\5\24\13\2sr\3\2\2\2st\3\2\2\2tu\3\2"+ + "\2\2u\u00a9\7\7\2\2vw\5\36\20\2wx\7\n\2\2xy\5 \21\2yz\7\13\2\2z\u00a9"+ + "\3\2\2\2{|\5 \21\2|}\7\13\2\2}\u00a9\3\2\2\2~\177\7\f\2\2\177\u0080\7"+ + "\4\2\2\u0080\u0081\5 \21\2\u0081\u0082\7\5\2\2\u0082\u0085\5\26\f\2\u0083"+ + "\u0084\7\r\2\2\u0084\u0086\5\26\f\2\u0085\u0083\3\2\2\2\u0085\u0086\3"+ + "\2\2\2\u0086\u00a9\3\2\2\2\u0087\u0088\7\16\2\2\u0088\u0089\7\4\2\2\u0089"+ + "\u008a\5 \21\2\u008a\u008b\7\5\2\2\u008b\u008c\5\26\f\2\u008c\u00a9\3"+ + "\2\2\2\u008d\u008e\7\17\2\2\u008e\u008f\5\26\f\2\u008f\u0090\7\16\2\2"+ + "\u0090\u0091\7\4\2\2\u0091\u0092\5 \21\2\u0092\u0093\7\5\2\2\u0093\u0094"+ + "\7\13\2\2\u0094\u00a9\3\2\2\2\u0095\u0096\7\20\2\2\u0096\u0098\7\4\2\2"+ + "\u0097\u0099\5\30\r\2\u0098\u0097\3\2\2\2\u0098\u0099\3\2\2\2\u0099\u009a"+ + "\3\2\2\2\u009a\u009b\5\32\16\2\u009b\u009c\7\5\2\2\u009c\u009d\5\26\f"+ + "\2\u009d\u00a9\3\2\2\2\u009e\u00a0\7\21\2\2\u009f\u00a1\5 \21\2\u00a0"+ + "\u009f\3\2\2\2\u00a0\u00a1\3\2\2\2\u00a1\u00a2\3\2\2\2\u00a2\u00a9\7\13"+ + "\2\2\u00a3\u00a4\7\22\2\2\u00a4\u00a5\7\6\2\2\u00a5\u00a6\5$\23\2\u00a6"+ + "\u00a7\7\7\2\2\u00a7\u00a9\3\2\2\2\u00a8p\3\2\2\2\u00a8q\3\2\2\2\u00a8"+ + "v\3\2\2\2\u00a8{\3\2\2\2\u00a8~\3\2\2\2\u00a8\u0087\3\2\2\2\u00a8\u008d"+ + "\3\2\2\2\u00a8\u0095\3\2\2\2\u00a8\u009e\3\2\2\2\u00a8\u00a3\3\2\2\2\u00a9"+ + "\27\3\2\2\2\u00aa\u00ac\5\34\17\2\u00ab\u00aa\3\2\2\2\u00ab\u00ac\3\2"+ + "\2\2\u00ac\u00ad\3\2\2\2\u00ad\u00b0\7@\2\2\u00ae\u00af\7\n\2\2\u00af"+ + "\u00b1\5 \21\2\u00b0\u00ae\3\2\2\2\u00b0\u00b1\3\2\2\2\u00b1\31\3\2\2"+ + "\2\u00b2\u00b3\7\13\2\2\u00b3\u00b4\5 \21\2\u00b4\u00b6\7\13\2\2\u00b5"+ + "\u00b7\5 \21\2\u00b6\u00b5\3\2\2\2\u00b6\u00b7\3\2\2\2\u00b7\u00be\3\2"+ + "\2\2\u00b8\u00b9\7\23\2\2\u00b9\u00ba\5 \21\2\u00ba\u00bb\7\24\2\2\u00bb"+ + "\u00bc\5 \21\2\u00bc\u00be\3\2\2\2\u00bd\u00b2\3\2\2\2\u00bd\u00b8\3\2"+ + "\2\2\u00be\33\3\2\2\2\u00bf\u00c0\b\17\1\2\u00c0\u00c4\7\63\2\2\u00c1"+ + "\u00c2\7\25\2\2\u00c2\u00c4\7\63\2\2\u00c3\u00bf\3\2\2\2\u00c3\u00c1\3"+ + "\2\2\2\u00c4\u00cf\3\2\2\2\u00c5\u00c6\f\4\2\2\u00c6\u00ce\7\26\2\2\u00c7"+ + "\u00c8\f\3\2\2\u00c8\u00ca\7\27\2\2\u00c9\u00cb\5 \21\2\u00ca\u00c9\3"+ + "\2\2\2\u00ca\u00cb\3\2\2\2\u00cb\u00cc\3\2\2\2\u00cc\u00ce\7\30\2\2\u00cd"+ + "\u00c5\3\2\2\2\u00cd\u00c7\3\2\2\2\u00ce\u00d1\3\2\2\2\u00cf\u00cd\3\2"+ + "\2\2\u00cf\u00d0\3\2\2\2\u00d0\35\3\2\2\2\u00d1\u00cf\3\2\2\2\u00d2\u00d3"+ + "\b\20\1\2\u00d3\u00de\7@\2\2\u00d4\u00d5\7\26\2\2\u00d5\u00de\7@\2\2\u00d6"+ + "\u00d7\7\26\2\2\u00d7\u00d8\7\4\2\2\u00d8\u00d9\5 \21\2\u00d9\u00da\7"+ + "\5\2\2\u00da\u00de\3\2\2\2\u00db\u00dc\t\2\2\2\u00dc\u00de\5\36\20\4\u00dd"+ + "\u00d2\3\2\2\2\u00dd\u00d4\3\2\2\2\u00dd\u00d6\3\2\2\2\u00dd\u00db\3\2"+ + "\2\2\u00de\u00e6\3\2\2\2\u00df\u00e0\f\3\2\2\u00e0\u00e1\7\27\2\2\u00e1"+ + "\u00e2\5 \21\2\u00e2\u00e3\7\30\2\2\u00e3\u00e5\3\2\2\2\u00e4\u00df\3"+ + "\2\2\2\u00e5\u00e8\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e6\u00e7\3\2\2\2\u00e7"+ + "\37\3\2\2\2\u00e8\u00e6\3\2\2\2\u00e9\u00ea\b\21\1\2\u00ea\u00eb\7\4\2"+ + "\2\u00eb\u00ec\5 \21\2\u00ec\u00ed\7\5\2\2\u00ed\u010e\3\2\2\2\u00ee\u00ef"+ + "\7@\2\2\u00ef\u00f1\7\4\2\2\u00f0\u00f2\5\"\22\2\u00f1\u00f0\3\2\2\2\u00f1"+ + "\u00f2\3\2\2\2\u00f2\u00f3\3\2\2\2\u00f3\u010e\7\5\2\2\u00f4\u00f5\7\4"+ + "\2\2\u00f5\u00f6\5\34\17\2\u00f6\u00f7\7\5\2\2\u00f7\u00f8\5 \21\26\u00f8"+ + "\u010e\3\2\2\2\u00f9\u00fa\t\3\2\2\u00fa\u010e\5 \21\24\u00fb\u00fc\t"+ + "\4\2\2\u00fc\u010e\5 \21\22\u00fd\u00fe\7\6\2\2\u00fe\u0103\5 \21\2\u00ff"+ + "\u0100\7\b\2\2\u0100\u0102\5 \21\2\u0101\u00ff\3\2\2\2\u0102\u0105\3\2"+ + "\2\2\u0103\u0101\3\2\2\2\u0103\u0104\3\2\2\2\u0104\u0106\3\2\2\2\u0105"+ + "\u0103\3\2\2\2\u0106\u0107\7\7\2\2\u0107\u010e\3\2\2\2\u0108\u010e\7@"+ + "\2\2\u0109\u010e\7\67\2\2\u010a\u010e\7\64\2\2\u010b\u010e\7\65\2\2\u010c"+ + "\u010e\7\66\2\2\u010d\u00e9\3\2\2\2\u010d\u00ee\3\2\2\2\u010d\u00f4\3"+ + "\2\2\2\u010d\u00f9\3\2\2\2\u010d\u00fb\3\2\2\2\u010d\u00fd\3\2\2\2\u010d"+ + "\u0108\3\2\2\2\u010d\u0109\3\2\2\2\u010d\u010a\3\2\2\2\u010d\u010b\3\2"+ + "\2\2\u010d\u010c\3\2\2\2\u010e\u0133\3\2\2\2\u010f\u0110\f\21\2\2\u0110"+ + "\u0111\t\5\2\2\u0111\u0132\5 \21\22\u0112\u0113\f\20\2\2\u0113\u0114\t"+ + "\6\2\2\u0114\u0132\5 \21\21\u0115\u0116\f\17\2\2\u0116\u0117\t\7\2\2\u0117"+ + "\u0132\5 \21\20\u0118\u0119\f\16\2\2\u0119\u011a\t\b\2\2\u011a\u0132\5"+ + " \21\17\u011b\u011c\f\r\2\2\u011c\u011d\7 \2\2\u011d\u0132\5 \21\16\u011e"+ + "\u011f\f\f\2\2\u011f\u0120\7-\2\2\u0120\u0132\5 \21\r\u0121\u0122\f\13"+ + "\2\2\u0122\u0123\7.\2\2\u0123\u0132\5 \21\f\u0124\u0125\f\n\2\2\u0125"+ + "\u0126\7/\2\2\u0126\u0132\5 \21\13\u0127\u0128\f\t\2\2\u0128\u0129\7\60"+ + "\2\2\u0129\u0132\5 \21\n\u012a\u012b\f\25\2\2\u012b\u012c\7\27\2\2\u012c"+ + "\u012d\5 \21\2\u012d\u012e\7\30\2\2\u012e\u0132\3\2\2\2\u012f\u0130\f"+ + "\23\2\2\u0130\u0132\t\3\2\2\u0131\u010f\3\2\2\2\u0131\u0112\3\2\2\2\u0131"+ + "\u0115\3\2\2\2\u0131\u0118\3\2\2\2\u0131\u011b\3\2\2\2\u0131\u011e\3\2"+ + "\2\2\u0131\u0121\3\2\2\2\u0131\u0124\3\2\2\2\u0131\u0127\3\2\2\2\u0131"+ + "\u012a\3\2\2\2\u0131\u012f\3\2\2\2\u0132\u0135\3\2\2\2\u0133\u0131\3\2"+ + "\2\2\u0133\u0134\3\2\2\2\u0134!\3\2\2\2\u0135\u0133\3\2\2\2\u0136\u013b"+ + "\5 \21\2\u0137\u0138\7\b\2\2\u0138\u013a\5 \21\2\u0139\u0137\3\2\2\2\u013a"+ + "\u013d\3\2\2\2\u013b\u0139\3\2\2\2\u013b\u013c\3\2\2\2\u013c#\3\2\2\2"+ + "\u013d\u013b\3\2\2\2\u013e\u0140\5&\24\2\u013f\u013e\3\2\2\2\u0140\u0143"+ + "\3\2\2\2\u0141\u013f\3\2\2\2\u0141\u0142\3\2\2\2\u0142%\3\2\2\2\u0143"+ + "\u0141\3\2\2\2\u0144\u0147\5(\25\2\u0145\u0147\5*\26\2\u0146\u0144\3\2"+ + "\2\2\u0146\u0145\3\2\2\2\u0147\'\3\2\2\2\u0148\u0149\7@\2\2\u0149\u014d"+ + "\7\23\2\2\u014a\u014b\7\37\2\2\u014b\u014d\7\23\2\2\u014c\u0148\3\2\2"+ + "\2\u014c\u014a\3\2\2\2\u014d)\3\2\2\2\u014e\u0150\7\62\2\2\u014f\u0151"+ + "\5,\27\2\u0150\u014f\3\2\2\2\u0150\u0151\3\2\2\2\u0151+\3\2\2\2\u0152"+ + "\u016a\5.\30\2\u0153\u0154\7\61\2\2\u0154\u016a\5.\30\2\u0155\u0156\5"+ + ".\30\2\u0156\u0157\7\b\2\2\u0157\u0158\7@\2\2\u0158\u016a\3\2\2\2\u0159"+ + "\u015a\7\4\2\2\u015a\u015b\5.\30\2\u015b\u015c\7\5\2\2\u015c\u015d\7\b"+ + "\2\2\u015d\u015e\7@\2\2\u015e\u016a\3\2\2\2\u015f\u0160\7\4\2\2\u0160"+ + "\u0161\5.\30\2\u0161\u0162\7\b\2\2\u0162\u0163\7@\2\2\u0163\u0164\7\5"+ + "\2\2\u0164\u016a\3\2\2\2\u0165\u0166\7\4\2\2\u0166\u0167\5.\30\2\u0167"+ + "\u0168\7\5\2\2\u0168\u016a\3\2\2\2\u0169\u0152\3\2\2\2\u0169\u0153\3\2"+ + "\2\2\u0169\u0155\3\2\2\2\u0169\u0159\3\2\2\2\u0169\u015f\3\2\2\2\u0169"+ + "\u0165\3\2\2\2\u016a-\3\2\2\2\u016b\u016c\b\30\1\2\u016c\u016d\t\t\2\2"+ + "\u016d\u0176\5.\30\n\u016e\u0176\7@\2\2\u016f\u0176\7A\2\2\u0170\u0171"+ + "\7\6\2\2\u0171\u0172\7@\2\2\u0172\u0176\7\7\2\2\u0173\u0176\7\67\2\2\u0174"+ + "\u0176\7\65\2\2\u0175\u016b\3\2\2\2\u0175\u016e\3\2\2\2\u0175\u016f\3"+ + "\2\2\2\u0175\u0170\3\2\2\2\u0175\u0173\3\2\2\2\u0175\u0174\3\2\2\2\u0176"+ + "\u017f\3\2\2\2\u0177\u0178\f\t\2\2\u0178\u0179\t\n\2\2\u0179\u017e\5."+ + "\30\n\u017a\u017b\f\b\2\2\u017b\u017c\t\7\2\2\u017c\u017e\5.\30\t\u017d"+ + "\u0177\3\2\2\2\u017d\u017a\3\2\2\2\u017e\u0181\3\2\2\2\u017f\u017d\3\2"+ + "\2\2\u017f\u0180\3\2\2\2\u0180/\3\2\2\2\u0181\u017f\3\2\2\2(:CINSZagn"+ + "s\u0085\u0098\u00a0\u00a8\u00ab\u00b0\u00b6\u00bd\u00c3\u00ca\u00cd\u00cf"+ + "\u00dd\u00e6\u00f1\u0103\u010d\u0131\u0133\u013b\u0141\u0146\u014c\u0150"+ + "\u0169\u0175\u017d\u017f"; 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 a2b42e637..7aab98521 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 /Users/jespergravgaard/c64/src/kickc/src/main/java/dk/camelot64/kickc/parser/KickC.g4 by ANTLR 4.7 +// Generated from C:/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; @@ -197,20 +197,6 @@ public interface KickCVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx); - /** - * Visit a parse tree produced by the {@code initExpr} - * labeled alternative in {@link KickCParser#initializer}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitInitExpr(KickCParser.InitExprContext ctx); - /** - * Visit a parse tree produced by the {@code initList} - * labeled alternative in {@link KickCParser#initializer}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitInitList(KickCParser.InitListContext ctx); /** * Visit a parse tree produced by the {@code lvalueName} * labeled alternative in {@link KickCParser#lvalue}. @@ -288,6 +274,13 @@ public interface KickCVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitExprChar(KickCParser.ExprCharContext ctx); + /** + * Visit a parse tree produced by the {@code initList} + * labeled alternative in {@link KickCParser#expr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitInitList(KickCParser.InitListContext ctx); /** * Visit a parse tree produced by the {@code exprCast} * labeled alternative in {@link KickCParser#expr}. diff --git a/src/main/java/dk/camelot64/kickc/passes/ParseTreeConstantEvaluator.java b/src/main/java/dk/camelot64/kickc/passes/ParseTreeConstantEvaluator.java index 80467f57c..35d6b864b 100644 --- a/src/main/java/dk/camelot64/kickc/passes/ParseTreeConstantEvaluator.java +++ b/src/main/java/dk/camelot64/kickc/passes/ParseTreeConstantEvaluator.java @@ -64,11 +64,6 @@ public class ParseTreeConstantEvaluator extends KickCBaseVisitor throw new NotConstantException(); } - @Override - public ConstantValue visitInitExpr(KickCParser.InitExprContext ctx) { - return visit(ctx.expr()); - } - @Override public ConstantValue visitInitList(KickCParser.InitListContext ctx) { throw new NotConstantException(); diff --git a/src/main/java/dk/camelot64/kickc/passes/StatementSequenceGenerator.java b/src/main/java/dk/camelot64/kickc/passes/StatementSequenceGenerator.java index 39efdb4f6..478740536 100644 --- a/src/main/java/dk/camelot64/kickc/passes/StatementSequenceGenerator.java +++ b/src/main/java/dk/camelot64/kickc/passes/StatementSequenceGenerator.java @@ -138,11 +138,11 @@ public class StatementSequenceGenerator extends KickCBaseVisitor { public Object visitDeclVar(KickCParser.DeclVarContext ctx) { SymbolType type = (SymbolType) visit(ctx.typeDecl()); String varName = ctx.NAME().getText(); - KickCParser.InitializerContext initializer = ctx.initializer(); VariableUnversioned lValue = getCurrentSymbols().addVariable(varName, type); if (ctx.getChild(0).getText().equals("const")) { lValue.setDeclaredConstant(true); } + KickCParser.ExprContext initializer = ctx.expr(); if (initializer != null) { addInitialAssignment(initializer, lValue); } @@ -269,7 +269,7 @@ public class StatementSequenceGenerator extends KickCBaseVisitor { } else { lValue = getCurrentSymbols().getVariable(varName); } - KickCParser.InitializerContext initializer = forDeclCtx.initializer(); + KickCParser.ExprContext initializer = forDeclCtx.expr(); if (initializer != null) { addInitialAssignment(initializer, lValue); } @@ -388,7 +388,7 @@ public class StatementSequenceGenerator extends KickCBaseVisitor { return null; } - private void addInitialAssignment(KickCParser.InitializerContext initializer, Variable lValue) { + private void addInitialAssignment(KickCParser.ExprContext initializer, Variable lValue) { PrePostModifierHandler.addPreModifiers(this, initializer); RValue rValue = (RValue) visit(initializer); Statement stmt = new StatementAssignment(lValue, rValue); @@ -448,15 +448,10 @@ public class StatementSequenceGenerator extends KickCBaseVisitor { return new PointerDereferenceIndexed(lval, index); } - @Override - public RValue visitInitExpr(KickCParser.InitExprContext ctx) { - return (RValue) visit(ctx.expr()); - } - @Override public RValue visitInitList(KickCParser.InitListContext ctx) { List initValues = new ArrayList<>(); - for (KickCParser.InitializerContext initializer : ctx.initializer()) { + for (KickCParser.ExprContext initializer : ctx.expr()) { RValue rValue = (RValue) visit(initializer); initValues.add(rValue); }