From bbcc1d7eacf8ffc9b87e05fbccc985822785c020 Mon Sep 17 00:00:00 2001 From: romanman Date: Fri, 13 Jun 2014 18:17:51 +0100 Subject: [PATCH] SerpentCompiler: + implemented support for: a = msg(gas, to, value, [1, 2, 3, 4], in_size, out_size) --- .../main/java/org/ethereum/serpent/Serpent.g4 | 8 +- .../org/ethereum/serpent/SerpentParser.java | 796 +++++++++--------- .../serpent/SerpentToAssemblyCompiler.java | 77 +- .../ethereum/serpent/SerpentCompileTest.java | 39 +- 4 files changed, 512 insertions(+), 408 deletions(-) diff --git a/ethereumj-core/src/main/java/org/ethereum/serpent/Serpent.g4 b/ethereumj-core/src/main/java/org/ethereum/serpent/Serpent.g4 index afdfea43..9de1dd68 100644 --- a/ethereumj-core/src/main/java/org/ethereum/serpent/Serpent.g4 +++ b/ethereumj-core/src/main/java/org/ethereum/serpent/Serpent.g4 @@ -34,7 +34,7 @@ parse: block EOF parse_init_code_block : 'init' ':' INDENT block DEDENT 'code' ':' INDENT block DEDENT; block: ( asm | array_assign | assign | contract_storage_assign | special_func | if_elif_else_stmt | - while_stmt | ret_func_1 | ret_func_2 | suicide_func | stop_func | single_send_fund)* ; + while_stmt | ret_func_1 | ret_func_2 | suicide_func | stop_func | single_send_fund | msg_func)* ; asm: '[asm' asm_symbol 'asm]' NL; @@ -105,7 +105,8 @@ block_difficulty block_gaslimit : 'block.gaslimit' ; -msg_func: 'msg' '(' int_val ',' int_val ',' int_val ',' int_val ',' int_val ')' ; +msg_func: 'msg' '(' int_val ',' int_val ',' int_val ',' arr_def ',' int_val ',' int_val')' ; + send_func: 'send' '(' int_val ',' int_val ',' int_val ')'; single_send_fund: send_func NL; @@ -114,7 +115,7 @@ msg_data: 'msg.data' '[' expression ']' ; array_assign: VAR '[' int_val ']' EQ_OP expression NL; array_retreive: VAR '[' int_val ']'; -assign: VAR EQ_OP (expression | arr_def) NL; +assign: VAR EQ_OP (expression | arr_def | msg_func) NL; arr_def : '[' (int_val ','?)* ']'; @@ -179,7 +180,6 @@ int_val : INT | special_func | '(' expression ')' | OP_NOT '(' expression ')' | - msg_func | msg_data | send_func | contract_storage_load | diff --git a/ethereumj-core/src/main/java/org/ethereum/serpent/SerpentParser.java b/ethereumj-core/src/main/java/org/ethereum/serpent/SerpentParser.java index c0defa74..b7d91b4a 100644 --- a/ethereumj-core/src/main/java/org/ethereum/serpent/SerpentParser.java +++ b/ethereumj-core/src/main/java/org/ethereum/serpent/SerpentParser.java @@ -190,14 +190,11 @@ public class SerpentParser extends Parser { public Single_send_fundContext single_send_fund(int i) { return getRuleContext(Single_send_fundContext.class,i); } - public List single_send_fund() { - return getRuleContexts(Single_send_fundContext.class); - } public Array_assignContext array_assign(int i) { return getRuleContext(Array_assignContext.class,i); } - public Stop_funcContext stop_func(int i) { - return getRuleContext(Stop_funcContext.class,i); + public List single_send_fund() { + return getRuleContexts(Single_send_fundContext.class); } public List ret_func_1() { return getRuleContexts(Ret_func_1Context.class); @@ -208,23 +205,14 @@ public class SerpentParser extends Parser { public List asm() { return getRuleContexts(AsmContext.class); } - public List if_elif_else_stmt() { - return getRuleContexts(If_elif_else_stmtContext.class); - } public List suicide_func() { return getRuleContexts(Suicide_funcContext.class); } - public List array_assign() { - return getRuleContexts(Array_assignContext.class); - } - public List stop_func() { - return getRuleContexts(Stop_funcContext.class); - } public List while_stmt() { return getRuleContexts(While_stmtContext.class); } - public Contract_storage_assignContext contract_storage_assign(int i) { - return getRuleContext(Contract_storage_assignContext.class,i); + public List stop_func() { + return getRuleContexts(Stop_funcContext.class); } public List special_func() { return getRuleContexts(Special_funcContext.class); @@ -232,29 +220,47 @@ public class SerpentParser extends Parser { public AsmContext asm(int i) { return getRuleContext(AsmContext.class,i); } + public List contract_storage_assign() { + return getRuleContexts(Contract_storage_assignContext.class); + } + public Ret_func_1Context ret_func_1(int i) { + return getRuleContext(Ret_func_1Context.class,i); + } + public List msg_func() { + return getRuleContexts(Msg_funcContext.class); + } + public Stop_funcContext stop_func(int i) { + return getRuleContext(Stop_funcContext.class,i); + } + public List if_elif_else_stmt() { + return getRuleContexts(If_elif_else_stmtContext.class); + } + public List array_assign() { + return getRuleContexts(Array_assignContext.class); + } + public Contract_storage_assignContext contract_storage_assign(int i) { + return getRuleContext(Contract_storage_assignContext.class,i); + } public Special_funcContext special_func(int i) { return getRuleContext(Special_funcContext.class,i); } public While_stmtContext while_stmt(int i) { return getRuleContext(While_stmtContext.class,i); } - public List contract_storage_assign() { - return getRuleContexts(Contract_storage_assignContext.class); - } public Ret_func_2Context ret_func_2(int i) { return getRuleContext(Ret_func_2Context.class,i); } public AssignContext assign(int i) { return getRuleContext(AssignContext.class,i); } - public Suicide_funcContext suicide_func(int i) { - return getRuleContext(Suicide_funcContext.class,i); + public Msg_funcContext msg_func(int i) { + return getRuleContext(Msg_funcContext.class,i); } public List ret_func_2() { return getRuleContexts(Ret_func_2Context.class); } - public Ret_func_1Context ret_func_1(int i) { - return getRuleContext(Ret_func_1Context.class,i); + public Suicide_funcContext suicide_func(int i) { + return getRuleContext(Suicide_funcContext.class,i); } public If_elif_else_stmtContext if_elif_else_stmt(int i) { return getRuleContext(If_elif_else_stmtContext.class,i); @@ -285,12 +291,12 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(126); + setState(127); _errHandler.sync(this); _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << 2) | (1L << 3) | (1L << 6) | (1L << 7) | (1L << 11) | (1L << 12) | (1L << 13) | (1L << 14) | (1L << 15) | (1L << 17) | (1L << 18) | (1L << 19) | (1L << 20) | (1L << 21) | (1L << 23) | (1L << 25) | (1L << 28) | (1L << 29) | (1L << 30) | (1L << 32) | (1L << 33) | (1L << VAR))) != 0)) { + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << 2) | (1L << 3) | (1L << 5) | (1L << 6) | (1L << 7) | (1L << 11) | (1L << 12) | (1L << 13) | (1L << 14) | (1L << 15) | (1L << 17) | (1L << 18) | (1L << 19) | (1L << 20) | (1L << 21) | (1L << 23) | (1L << 25) | (1L << 28) | (1L << 29) | (1L << 30) | (1L << 32) | (1L << 33) | (1L << VAR))) != 0)) { { - setState(124); + setState(125); switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) { case 1: { @@ -363,9 +369,15 @@ public class SerpentParser extends Parser { setState(123); single_send_fund(); } break; + + case 13: + { + setState(124); msg_func(); + } + break; } } - setState(128); + setState(129); _errHandler.sync(this); _la = _input.LA(1); } @@ -412,10 +424,10 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(129); match(14); - setState(130); asm_symbol(); - setState(131); match(31); - setState(132); match(NL); + setState(130); match(14); + setState(131); asm_symbol(); + setState(132); match(31); + setState(133); match(NL); } } catch (RecognitionException re) { @@ -468,13 +480,13 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(137); + setState(138); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << INT) | (1L << ASM_SYMBOLS) | (1L << HEX_NUMBER))) != 0)) { { { - setState(134); + setState(135); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << INT) | (1L << ASM_SYMBOLS) | (1L << HEX_NUMBER))) != 0)) ) { _errHandler.recoverInline(this); @@ -482,7 +494,7 @@ public class SerpentParser extends Parser { consume(); } } - setState(139); + setState(140); _errHandler.sync(this); _la = _input.LA(1); } @@ -546,38 +558,38 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(140); match(11); - setState(141); condition(); - setState(142); match(10); - setState(143); match(INDENT); - setState(144); block(); - setState(145); match(DEDENT); - setState(155); + setState(141); match(11); + setState(142); condition(); + setState(143); match(10); + setState(144); match(INDENT); + setState(145); block(); + setState(146); match(DEDENT); + setState(156); _errHandler.sync(this); _la = _input.LA(1); while (_la==27) { { { - setState(146); match(27); - setState(147); condition(); - setState(148); match(10); - setState(149); match(INDENT); - setState(150); block(); - setState(151); match(DEDENT); + setState(147); match(27); + setState(148); condition(); + setState(149); match(10); + setState(150); match(INDENT); + setState(151); block(); + setState(152); match(DEDENT); } } - setState(157); + setState(158); _errHandler.sync(this); _la = _input.LA(1); } - setState(163); + setState(164); _la = _input.LA(1); if (_la==24) { { - setState(158); match(24); - setState(159); match(INDENT); - setState(160); block(); - setState(161); match(DEDENT); + setState(159); match(24); + setState(160); match(INDENT); + setState(161); block(); + setState(162); match(DEDENT); } } @@ -628,12 +640,12 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(165); match(7); - setState(166); condition(); - setState(167); match(10); - setState(168); match(INDENT); - setState(169); block(); - setState(170); match(DEDENT); + setState(166); match(7); + setState(167); condition(); + setState(168); match(10); + setState(169); match(INDENT); + setState(170); block(); + setState(171); match(DEDENT); } } catch (RecognitionException re) { @@ -710,84 +722,84 @@ public class SerpentParser extends Parser { Special_funcContext _localctx = new Special_funcContext(_ctx, getState()); enterRule(_localctx, 14, RULE_special_func); try { - setState(185); + setState(186); switch (_input.LA(1)) { case 21: enterOuterAlt(_localctx, 1); { - setState(172); msg_datasize(); + setState(173); msg_datasize(); } break; case 29: enterOuterAlt(_localctx, 2); { - setState(173); msg_sender(); + setState(174); msg_sender(); } break; case 15: enterOuterAlt(_localctx, 3); { - setState(174); msg_value(); + setState(175); msg_value(); } break; case 23: enterOuterAlt(_localctx, 4); { - setState(175); tx_gasprice(); + setState(176); tx_gasprice(); } break; case 25: enterOuterAlt(_localctx, 5); { - setState(176); tx_origin(); + setState(177); tx_origin(); } break; case 6: enterOuterAlt(_localctx, 6); { - setState(177); tx_gas(); + setState(178); tx_gas(); } break; case 30: enterOuterAlt(_localctx, 7); { - setState(178); contract_balance(); + setState(179); contract_balance(); } break; case 17: enterOuterAlt(_localctx, 8); { - setState(179); block_prevhash(); + setState(180); block_prevhash(); } break; case 3: enterOuterAlt(_localctx, 9); { - setState(180); block_coinbase(); + setState(181); block_coinbase(); } break; case 13: enterOuterAlt(_localctx, 10); { - setState(181); block_timestamp(); + setState(182); block_timestamp(); } break; case 33: enterOuterAlt(_localctx, 11); { - setState(182); block_number(); + setState(183); block_number(); } break; case 20: enterOuterAlt(_localctx, 12); { - setState(183); block_difficulty(); + setState(184); block_difficulty(); } break; case 32: enterOuterAlt(_localctx, 13); { - setState(184); block_gaslimit(); + setState(185); block_gaslimit(); } break; default: @@ -831,7 +843,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(187); match(21); + setState(188); match(21); } } catch (RecognitionException re) { @@ -871,7 +883,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(189); match(29); + setState(190); match(29); } } catch (RecognitionException re) { @@ -911,7 +923,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(191); match(15); + setState(192); match(15); } } catch (RecognitionException re) { @@ -951,7 +963,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(193); match(23); + setState(194); match(23); } } catch (RecognitionException re) { @@ -991,7 +1003,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(195); match(25); + setState(196); match(25); } } catch (RecognitionException re) { @@ -1031,7 +1043,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(197); match(6); + setState(198); match(6); } } catch (RecognitionException re) { @@ -1071,7 +1083,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(199); match(30); + setState(200); match(30); } } catch (RecognitionException re) { @@ -1111,7 +1123,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(201); match(17); + setState(202); match(17); } } catch (RecognitionException re) { @@ -1151,7 +1163,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(203); match(3); + setState(204); match(3); } } catch (RecognitionException re) { @@ -1191,7 +1203,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(205); match(13); + setState(206); match(13); } } catch (RecognitionException re) { @@ -1231,7 +1243,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(207); match(33); + setState(208); match(33); } } catch (RecognitionException re) { @@ -1271,7 +1283,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(209); match(20); + setState(210); match(20); } } catch (RecognitionException re) { @@ -1311,7 +1323,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(211); match(32); + setState(212); match(32); } } catch (RecognitionException re) { @@ -1332,6 +1344,9 @@ public class SerpentParser extends Parser { public List int_val() { return getRuleContexts(Int_valContext.class); } + public Arr_defContext arr_def() { + return getRuleContext(Arr_defContext.class,0); + } public Msg_funcContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -1357,18 +1372,20 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(213); match(5); - setState(214); match(9); - setState(215); int_val(); - setState(216); match(4); - setState(217); int_val(); - setState(218); match(4); - setState(219); int_val(); - setState(220); match(4); - setState(221); int_val(); - setState(222); match(4); - setState(223); int_val(); - setState(224); match(22); + setState(214); match(5); + setState(215); match(9); + setState(216); int_val(); + setState(217); match(4); + setState(218); int_val(); + setState(219); match(4); + setState(220); int_val(); + setState(221); match(4); + setState(222); arr_def(); + setState(223); match(4); + setState(224); int_val(); + setState(225); match(4); + setState(226); int_val(); + setState(227); match(22); } } catch (RecognitionException re) { @@ -1414,14 +1431,14 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(226); match(12); - setState(227); match(9); - setState(228); int_val(); - setState(229); match(4); - setState(230); int_val(); - setState(231); match(4); - setState(232); int_val(); - setState(233); match(22); + setState(229); match(12); + setState(230); match(9); + setState(231); int_val(); + setState(232); match(4); + setState(233); int_val(); + setState(234); match(4); + setState(235); int_val(); + setState(236); match(22); } } catch (RecognitionException re) { @@ -1465,8 +1482,8 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(235); send_func(); - setState(236); match(NL); + setState(238); send_func(); + setState(239); match(NL); } } catch (RecognitionException re) { @@ -1509,10 +1526,10 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(238); match(26); - setState(239); match(8); - setState(240); expression(); - setState(241); match(1); + setState(241); match(26); + setState(242); match(8); + setState(243); expression(); + setState(244); match(1); } } catch (RecognitionException re) { @@ -1561,13 +1578,13 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(243); match(VAR); - setState(244); match(8); - setState(245); int_val(); - setState(246); match(1); - setState(247); match(EQ_OP); - setState(248); expression(); - setState(249); match(NL); + setState(246); match(VAR); + setState(247); match(8); + setState(248); int_val(); + setState(249); match(1); + setState(250); match(EQ_OP); + setState(251); expression(); + setState(252); match(NL); } } catch (RecognitionException re) { @@ -1611,10 +1628,10 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(251); match(VAR); - setState(252); match(8); - setState(253); int_val(); - setState(254); match(1); + setState(254); match(VAR); + setState(255); match(8); + setState(256); int_val(); + setState(257); match(1); } } catch (RecognitionException re) { @@ -1630,6 +1647,9 @@ public class SerpentParser extends Parser { public static class AssignContext extends ParserRuleContext { public TerminalNode NL() { return getToken(SerpentParser.NL, 0); } + public Msg_funcContext msg_func() { + return getRuleContext(Msg_funcContext.class,0); + } public TerminalNode VAR() { return getToken(SerpentParser.VAR, 0); } public TerminalNode EQ_OP() { return getToken(SerpentParser.EQ_OP, 0); } public ExpressionContext expression() { @@ -1663,12 +1683,11 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(256); match(VAR); - setState(257); match(EQ_OP); - setState(260); + setState(259); match(VAR); + setState(260); match(EQ_OP); + setState(264); switch (_input.LA(1)) { case 3: - case 5: case 6: case 9: case 12: @@ -1690,18 +1709,23 @@ public class SerpentParser extends Parser { case VAR: case HEX_NUMBER: { - setState(258); expression(); + setState(261); expression(); } break; case 8: { - setState(259); arr_def(); + setState(262); arr_def(); + } + break; + case 5: + { + setState(263); msg_func(); } break; default: throw new NoViableAltException(this); } - setState(262); match(NL); + setState(266); match(NL); } } catch (RecognitionException re) { @@ -1748,29 +1772,29 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(264); match(8); - setState(271); + setState(268); match(8); + setState(275); _errHandler.sync(this); _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << 3) | (1L << 5) | (1L << 6) | (1L << 9) | (1L << 12) | (1L << 13) | (1L << 15) | (1L << 17) | (1L << 18) | (1L << 20) | (1L << 21) | (1L << 23) | (1L << 25) | (1L << 26) | (1L << 29) | (1L << 30) | (1L << 32) | (1L << 33) | (1L << INT) | (1L << OP_NOT) | (1L << VAR) | (1L << HEX_NUMBER))) != 0)) { + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << 3) | (1L << 6) | (1L << 9) | (1L << 12) | (1L << 13) | (1L << 15) | (1L << 17) | (1L << 18) | (1L << 20) | (1L << 21) | (1L << 23) | (1L << 25) | (1L << 26) | (1L << 29) | (1L << 30) | (1L << 32) | (1L << 33) | (1L << INT) | (1L << OP_NOT) | (1L << VAR) | (1L << HEX_NUMBER))) != 0)) { { { - setState(265); int_val(); - setState(267); + setState(269); int_val(); + setState(271); _la = _input.LA(1); if (_la==4) { { - setState(266); match(4); + setState(270); match(4); } } } } - setState(273); + setState(277); _errHandler.sync(this); _la = _input.LA(1); } - setState(274); match(1); + setState(278); match(1); } } catch (RecognitionException re) { @@ -1818,13 +1842,13 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(276); match(18); - setState(277); match(8); - setState(278); expression(); - setState(279); match(1); - setState(280); match(EQ_OP); - setState(281); expression(); - setState(282); match(NL); + setState(280); match(18); + setState(281); match(8); + setState(282); expression(); + setState(283); match(1); + setState(284); match(EQ_OP); + setState(285); expression(); + setState(286); match(NL); } } catch (RecognitionException re) { @@ -1867,10 +1891,10 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(284); match(18); - setState(285); match(8); - setState(286); expression(); - setState(287); match(1); + setState(288); match(18); + setState(289); match(8); + setState(290); expression(); + setState(291); match(1); } } catch (RecognitionException re) { @@ -1926,10 +1950,10 @@ public class SerpentParser extends Parser { enterOuterAlt(_localctx, 1); { { - setState(290); int_val(); + setState(294); int_val(); } _ctx.stop = _input.LT(-1); - setState(297); + setState(301); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,9,_ctx); while ( _alt!=2 && _alt!=-1 ) { @@ -1940,14 +1964,14 @@ public class SerpentParser extends Parser { { _localctx = new Mul_exprContext(_parentctx, _parentState, _p); pushNewRecursionContext(_localctx, _startState, RULE_mul_expr); - setState(292); + setState(296); if (!(1 >= _localctx._p)) throw new FailedPredicateException(this, "1 >= $_p"); - setState(293); match(OP_MUL); - setState(294); int_val(); + setState(297); match(OP_MUL); + setState(298); int_val(); } } } - setState(299); + setState(303); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,9,_ctx); } @@ -2006,10 +2030,10 @@ public class SerpentParser extends Parser { enterOuterAlt(_localctx, 1); { { - setState(301); mul_expr(0); + setState(305); mul_expr(0); } _ctx.stop = _input.LT(-1); - setState(308); + setState(312); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,10,_ctx); while ( _alt!=2 && _alt!=-1 ) { @@ -2020,14 +2044,14 @@ public class SerpentParser extends Parser { { _localctx = new Add_exprContext(_parentctx, _parentState, _p); pushNewRecursionContext(_localctx, _startState, RULE_add_expr); - setState(303); + setState(307); if (!(1 >= _localctx._p)) throw new FailedPredicateException(this, "1 >= $_p"); - setState(304); match(OP_ADD); - setState(305); mul_expr(0); + setState(308); match(OP_ADD); + setState(309); mul_expr(0); } } } - setState(310); + setState(314); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,10,_ctx); } @@ -2086,10 +2110,10 @@ public class SerpentParser extends Parser { enterOuterAlt(_localctx, 1); { { - setState(312); add_expr(0); + setState(316); add_expr(0); } _ctx.stop = _input.LT(-1); - setState(319); + setState(323); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,11,_ctx); while ( _alt!=2 && _alt!=-1 ) { @@ -2100,14 +2124,14 @@ public class SerpentParser extends Parser { { _localctx = new Rel_expContext(_parentctx, _parentState, _p); pushNewRecursionContext(_localctx, _startState, RULE_rel_exp); - setState(314); + setState(318); if (!(1 >= _localctx._p)) throw new FailedPredicateException(this, "1 >= $_p"); - setState(315); match(OP_REL); - setState(316); add_expr(0); + setState(319); match(OP_REL); + setState(320); add_expr(0); } } } - setState(321); + setState(325); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,11,_ctx); } @@ -2166,10 +2190,10 @@ public class SerpentParser extends Parser { enterOuterAlt(_localctx, 1); { { - setState(323); rel_exp(0); + setState(327); rel_exp(0); } _ctx.stop = _input.LT(-1); - setState(330); + setState(334); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,12,_ctx); while ( _alt!=2 && _alt!=-1 ) { @@ -2180,14 +2204,14 @@ public class SerpentParser extends Parser { { _localctx = new Eq_expContext(_parentctx, _parentState, _p); pushNewRecursionContext(_localctx, _startState, RULE_eq_exp); - setState(325); + setState(329); if (!(1 >= _localctx._p)) throw new FailedPredicateException(this, "1 >= $_p"); - setState(326); match(OP_EQ); - setState(327); rel_exp(0); + setState(330); match(OP_EQ); + setState(331); rel_exp(0); } } } - setState(332); + setState(336); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,12,_ctx); } @@ -2246,10 +2270,10 @@ public class SerpentParser extends Parser { enterOuterAlt(_localctx, 1); { { - setState(334); eq_exp(0); + setState(338); eq_exp(0); } _ctx.stop = _input.LT(-1); - setState(341); + setState(345); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,13,_ctx); while ( _alt!=2 && _alt!=-1 ) { @@ -2260,14 +2284,14 @@ public class SerpentParser extends Parser { { _localctx = new And_expContext(_parentctx, _parentState, _p); pushNewRecursionContext(_localctx, _startState, RULE_and_exp); - setState(336); + setState(340); if (!(1 >= _localctx._p)) throw new FailedPredicateException(this, "1 >= $_p"); - setState(337); match(OP_AND); - setState(338); eq_exp(0); + setState(341); match(OP_AND); + setState(342); eq_exp(0); } } } - setState(343); + setState(347); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,13,_ctx); } @@ -2326,10 +2350,10 @@ public class SerpentParser extends Parser { enterOuterAlt(_localctx, 1); { { - setState(345); and_exp(0); + setState(349); and_exp(0); } _ctx.stop = _input.LT(-1); - setState(352); + setState(356); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,14,_ctx); while ( _alt!=2 && _alt!=-1 ) { @@ -2340,14 +2364,14 @@ public class SerpentParser extends Parser { { _localctx = new Ex_or_expContext(_parentctx, _parentState, _p); pushNewRecursionContext(_localctx, _startState, RULE_ex_or_exp); - setState(347); + setState(351); if (!(1 >= _localctx._p)) throw new FailedPredicateException(this, "1 >= $_p"); - setState(348); match(OP_EX_OR); - setState(349); and_exp(0); + setState(352); match(OP_EX_OR); + setState(353); and_exp(0); } } } - setState(354); + setState(358); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,14,_ctx); } @@ -2406,10 +2430,10 @@ public class SerpentParser extends Parser { enterOuterAlt(_localctx, 1); { { - setState(356); ex_or_exp(0); + setState(360); ex_or_exp(0); } _ctx.stop = _input.LT(-1); - setState(363); + setState(367); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,15,_ctx); while ( _alt!=2 && _alt!=-1 ) { @@ -2420,14 +2444,14 @@ public class SerpentParser extends Parser { { _localctx = new In_or_expContext(_parentctx, _parentState, _p); pushNewRecursionContext(_localctx, _startState, RULE_in_or_exp); - setState(358); + setState(362); if (!(1 >= _localctx._p)) throw new FailedPredicateException(this, "1 >= $_p"); - setState(359); match(OP_IN_OR); - setState(360); ex_or_exp(0); + setState(363); match(OP_IN_OR); + setState(364); ex_or_exp(0); } } } - setState(365); + setState(369); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,15,_ctx); } @@ -2486,10 +2510,10 @@ public class SerpentParser extends Parser { enterOuterAlt(_localctx, 1); { { - setState(367); in_or_exp(0); + setState(371); in_or_exp(0); } _ctx.stop = _input.LT(-1); - setState(374); + setState(378); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,16,_ctx); while ( _alt!=2 && _alt!=-1 ) { @@ -2500,14 +2524,14 @@ public class SerpentParser extends Parser { { _localctx = new Log_and_expContext(_parentctx, _parentState, _p); pushNewRecursionContext(_localctx, _startState, RULE_log_and_exp); - setState(369); + setState(373); if (!(1 >= _localctx._p)) throw new FailedPredicateException(this, "1 >= $_p"); - setState(370); match(OP_LOG_AND); - setState(371); in_or_exp(0); + setState(374); match(OP_LOG_AND); + setState(375); in_or_exp(0); } } } - setState(376); + setState(380); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,16,_ctx); } @@ -2566,10 +2590,10 @@ public class SerpentParser extends Parser { enterOuterAlt(_localctx, 1); { { - setState(378); log_and_exp(0); + setState(382); log_and_exp(0); } _ctx.stop = _input.LT(-1); - setState(385); + setState(389); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,17,_ctx); while ( _alt!=2 && _alt!=-1 ) { @@ -2580,14 +2604,14 @@ public class SerpentParser extends Parser { { _localctx = new Log_or_expContext(_parentctx, _parentState, _p); pushNewRecursionContext(_localctx, _startState, RULE_log_or_exp); - setState(380); + setState(384); if (!(1 >= _localctx._p)) throw new FailedPredicateException(this, "1 >= $_p"); - setState(381); match(OP_LOG_OR); - setState(382); log_and_exp(0); + setState(385); match(OP_LOG_OR); + setState(386); log_and_exp(0); } } } - setState(387); + setState(391); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,17,_ctx); } @@ -2633,7 +2657,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(388); log_or_exp(0); + setState(392); log_or_exp(0); } } catch (RecognitionException re) { @@ -2676,7 +2700,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(390); expression(); + setState(394); expression(); } } catch (RecognitionException re) { @@ -2701,9 +2725,6 @@ public class SerpentParser extends Parser { return getRuleContext(Special_funcContext.class,0); } public TerminalNode INT() { return getToken(SerpentParser.INT, 0); } - public Msg_funcContext msg_func() { - return getRuleContext(Msg_funcContext.class,0); - } public Hex_numContext hex_num() { return getRuleContext(Hex_numContext.class,0); } @@ -2743,87 +2764,80 @@ public class SerpentParser extends Parser { Int_valContext _localctx = new Int_valContext(_ctx, getState()); enterRule(_localctx, 84, RULE_int_val); try { - setState(410); + setState(413); switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(392); match(INT); + setState(396); match(INT); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(393); hex_num(); + setState(397); hex_num(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(394); get_var(); + setState(398); get_var(); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(395); special_func(); + setState(399); special_func(); } break; case 5: enterOuterAlt(_localctx, 5); { - setState(396); match(9); - setState(397); expression(); - setState(398); match(22); + setState(400); match(9); + setState(401); expression(); + setState(402); match(22); } break; case 6: enterOuterAlt(_localctx, 6); { - setState(400); match(OP_NOT); - setState(401); match(9); - setState(402); expression(); - setState(403); match(22); + setState(404); match(OP_NOT); + setState(405); match(9); + setState(406); expression(); + setState(407); match(22); } break; case 7: enterOuterAlt(_localctx, 7); { - setState(405); msg_func(); + setState(409); msg_data(); } break; case 8: enterOuterAlt(_localctx, 8); { - setState(406); msg_data(); + setState(410); send_func(); } break; case 9: enterOuterAlt(_localctx, 9); { - setState(407); send_func(); + setState(411); contract_storage_load(); } break; case 10: enterOuterAlt(_localctx, 10); { - setState(408); contract_storage_load(); - } - break; - - case 11: - enterOuterAlt(_localctx, 11); - { - setState(409); array_retreive(); + setState(412); array_retreive(); } break; } @@ -2866,7 +2880,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(412); match(HEX_NUMBER); + setState(415); match(HEX_NUMBER); } } catch (RecognitionException re) { @@ -2910,11 +2924,11 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(414); match(28); - setState(415); match(9); - setState(416); expression(); - setState(417); match(22); - setState(418); match(NL); + setState(417); match(28); + setState(418); match(9); + setState(419); expression(); + setState(420); match(22); + setState(421); match(NL); } } catch (RecognitionException re) { @@ -2961,13 +2975,13 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(420); match(28); - setState(421); match(9); - setState(422); expression(); - setState(423); match(4); - setState(424); expression(); - setState(425); match(22); - setState(426); match(NL); + setState(423); match(28); + setState(424); match(9); + setState(425); expression(); + setState(426); match(4); + setState(427); expression(); + setState(428); match(22); + setState(429); match(NL); } } catch (RecognitionException re) { @@ -3011,11 +3025,11 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(428); match(19); - setState(429); match(9); - setState(430); expression(); - setState(431); match(22); - setState(432); match(NL); + setState(431); match(19); + setState(432); match(9); + setState(433); expression(); + setState(434); match(22); + setState(435); match(NL); } } catch (RecognitionException re) { @@ -3056,8 +3070,8 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(434); match(2); - setState(435); match(NL); + setState(437); match(2); + setState(438); match(NL); } } catch (RecognitionException re) { @@ -3098,7 +3112,7 @@ public class SerpentParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(437); match(VAR); + setState(440); match(VAR); } } catch (RecognitionException re) { @@ -3190,7 +3204,7 @@ public class SerpentParser extends Parser { } public static final String _serializedATN = - "\3\uacf5\uee8c\u4f5d\u8b0d\u4a45\u78bd\u1b2f\u3378\39\u01ba\4\2\t\2\4"+ + "\3\uacf5\uee8c\u4f5d\u8b0d\u4a45\u78bd\u1b2f\u3378\39\u01bd\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"+ @@ -3198,143 +3212,145 @@ public class SerpentParser extends Parser { "\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\3\2\3\2\3\2\3\3\3"+ "\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4"+ - "\3\4\3\4\3\4\3\4\7\4\177\n\4\f\4\16\4\u0082\13\4\3\5\3\5\3\5\3\5\3\5\3"+ - "\6\7\6\u008a\n\6\f\6\16\6\u008d\13\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3"+ - "\7\3\7\3\7\3\7\3\7\7\7\u009c\n\7\f\7\16\7\u009f\13\7\3\7\3\7\3\7\3\7\3"+ - "\7\5\7\u00a6\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3"+ - "\t\3\t\3\t\3\t\3\t\3\t\3\t\5\t\u00bc\n\t\3\n\3\n\3\13\3\13\3\f\3\f\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\23\3\23\3\24"+ - "\3\24\3\25\3\25\3\26\3\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27"+ - "\3\27\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\31"+ - "\3\31\3\31\3\32\3\32\3\32\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33"+ - "\3\33\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\5\35\u0107\n\35\3\35"+ - "\3\35\3\36\3\36\3\36\5\36\u010e\n\36\7\36\u0110\n\36\f\36\16\36\u0113"+ - "\13\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3"+ - " \3!\3!\3!\3!\3!\3!\7!\u012a\n!\f!\16!\u012d\13!\3\"\3\"\3\"\3\"\3\"\3"+ - "\"\7\"\u0135\n\"\f\"\16\"\u0138\13\"\3#\3#\3#\3#\3#\3#\7#\u0140\n#\f#"+ - "\16#\u0143\13#\3$\3$\3$\3$\3$\3$\7$\u014b\n$\f$\16$\u014e\13$\3%\3%\3"+ - "%\3%\3%\3%\7%\u0156\n%\f%\16%\u0159\13%\3&\3&\3&\3&\3&\3&\7&\u0161\n&"+ - "\f&\16&\u0164\13&\3\'\3\'\3\'\3\'\3\'\3\'\7\'\u016c\n\'\f\'\16\'\u016f"+ - "\13\'\3(\3(\3(\3(\3(\3(\7(\u0177\n(\f(\16(\u017a\13(\3)\3)\3)\3)\3)\3"+ - ")\7)\u0182\n)\f)\16)\u0185\13)\3*\3*\3+\3+\3,\3,\3,\3,\3,\3,\3,\3,\3,"+ - "\3,\3,\3,\3,\3,\3,\3,\3,\3,\5,\u019d\n,\3-\3-\3.\3.\3.\3.\3.\3.\3/\3/"+ - "\3/\3/\3/\3/\3/\3/\3\60\3\60\3\60\3\60\3\60\3\60\3\61\3\61\3\61\3\62\3"+ - "\62\3\62\2\63\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64"+ - "\668:<>@BDFHJLNPRTVXZ\\^`b\2\3\4\2%&\67\67\u01b9\2d\3\2\2\2\4g\3\2\2\2"+ - "\6\u0080\3\2\2\2\b\u0083\3\2\2\2\n\u008b\3\2\2\2\f\u008e\3\2\2\2\16\u00a7"+ - "\3\2\2\2\20\u00bb\3\2\2\2\22\u00bd\3\2\2\2\24\u00bf\3\2\2\2\26\u00c1\3"+ - "\2\2\2\30\u00c3\3\2\2\2\32\u00c5\3\2\2\2\34\u00c7\3\2\2\2\36\u00c9\3\2"+ - "\2\2 \u00cb\3\2\2\2\"\u00cd\3\2\2\2$\u00cf\3\2\2\2&\u00d1\3\2\2\2(\u00d3"+ - "\3\2\2\2*\u00d5\3\2\2\2,\u00d7\3\2\2\2.\u00e4\3\2\2\2\60\u00ed\3\2\2\2"+ - "\62\u00f0\3\2\2\2\64\u00f5\3\2\2\2\66\u00fd\3\2\2\28\u0102\3\2\2\2:\u010a"+ - "\3\2\2\2<\u0116\3\2\2\2>\u011e\3\2\2\2@\u0123\3\2\2\2B\u012e\3\2\2\2D"+ - "\u0139\3\2\2\2F\u0144\3\2\2\2H\u014f\3\2\2\2J\u015a\3\2\2\2L\u0165\3\2"+ - "\2\2N\u0170\3\2\2\2P\u017b\3\2\2\2R\u0186\3\2\2\2T\u0188\3\2\2\2V\u019c"+ - "\3\2\2\2X\u019e\3\2\2\2Z\u01a0\3\2\2\2\\\u01a6\3\2\2\2^\u01ae\3\2\2\2"+ - "`\u01b4\3\2\2\2b\u01b7\3\2\2\2de\5\6\4\2ef\7\2\2\3f\3\3\2\2\2gh\7\22\2"+ - "\2hi\7\f\2\2ij\78\2\2jk\5\6\4\2kl\79\2\2lm\7$\2\2mn\7\f\2\2no\78\2\2o"+ - "p\5\6\4\2pq\79\2\2q\5\3\2\2\2r\177\5\b\5\2s\177\5\64\33\2t\177\58\35\2"+ - "u\177\5<\37\2v\177\5\20\t\2w\177\5\f\7\2x\177\5\16\b\2y\177\5Z.\2z\177"+ - "\5\\/\2{\177\5^\60\2|\177\5`\61\2}\177\5\60\31\2~r\3\2\2\2~s\3\2\2\2~"+ - "t\3\2\2\2~u\3\2\2\2~v\3\2\2\2~w\3\2\2\2~x\3\2\2\2~y\3\2\2\2~z\3\2\2\2"+ - "~{\3\2\2\2~|\3\2\2\2~}\3\2\2\2\177\u0082\3\2\2\2\u0080~\3\2\2\2\u0080"+ - "\u0081\3\2\2\2\u0081\7\3\2\2\2\u0082\u0080\3\2\2\2\u0083\u0084\7\20\2"+ - "\2\u0084\u0085\5\n\6\2\u0085\u0086\7!\2\2\u0086\u0087\7,\2\2\u0087\t\3"+ - "\2\2\2\u0088\u008a\t\2\2\2\u0089\u0088\3\2\2\2\u008a\u008d\3\2\2\2\u008b"+ - "\u0089\3\2\2\2\u008b\u008c\3\2\2\2\u008c\13\3\2\2\2\u008d\u008b\3\2\2"+ - "\2\u008e\u008f\7\r\2\2\u008f\u0090\5T+\2\u0090\u0091\7\f\2\2\u0091\u0092"+ - "\78\2\2\u0092\u0093\5\6\4\2\u0093\u009d\79\2\2\u0094\u0095\7\35\2\2\u0095"+ - "\u0096\5T+\2\u0096\u0097\7\f\2\2\u0097\u0098\78\2\2\u0098\u0099\5\6\4"+ - "\2\u0099\u009a\79\2\2\u009a\u009c\3\2\2\2\u009b\u0094\3\2\2\2\u009c\u009f"+ - "\3\2\2\2\u009d\u009b\3\2\2\2\u009d\u009e\3\2\2\2\u009e\u00a5\3\2\2\2\u009f"+ - "\u009d\3\2\2\2\u00a0\u00a1\7\32\2\2\u00a1\u00a2\78\2\2\u00a2\u00a3\5\6"+ - "\4\2\u00a3\u00a4\79\2\2\u00a4\u00a6\3\2\2\2\u00a5\u00a0\3\2\2\2\u00a5"+ - "\u00a6\3\2\2\2\u00a6\r\3\2\2\2\u00a7\u00a8\7\t\2\2\u00a8\u00a9\5T+\2\u00a9"+ - "\u00aa\7\f\2\2\u00aa\u00ab\78\2\2\u00ab\u00ac\5\6\4\2\u00ac\u00ad\79\2"+ - "\2\u00ad\17\3\2\2\2\u00ae\u00bc\5\22\n\2\u00af\u00bc\5\24\13\2\u00b0\u00bc"+ - "\5\26\f\2\u00b1\u00bc\5\30\r\2\u00b2\u00bc\5\32\16\2\u00b3\u00bc\5\34"+ - "\17\2\u00b4\u00bc\5\36\20\2\u00b5\u00bc\5 \21\2\u00b6\u00bc\5\"\22\2\u00b7"+ - "\u00bc\5$\23\2\u00b8\u00bc\5&\24\2\u00b9\u00bc\5(\25\2\u00ba\u00bc\5*"+ - "\26\2\u00bb\u00ae\3\2\2\2\u00bb\u00af\3\2\2\2\u00bb\u00b0\3\2\2\2\u00bb"+ - "\u00b1\3\2\2\2\u00bb\u00b2\3\2\2\2\u00bb\u00b3\3\2\2\2\u00bb\u00b4\3\2"+ - "\2\2\u00bb\u00b5\3\2\2\2\u00bb\u00b6\3\2\2\2\u00bb\u00b7\3\2\2\2\u00bb"+ - "\u00b8\3\2\2\2\u00bb\u00b9\3\2\2\2\u00bb\u00ba\3\2\2\2\u00bc\21\3\2\2"+ - "\2\u00bd\u00be\7\27\2\2\u00be\23\3\2\2\2\u00bf\u00c0\7\37\2\2\u00c0\25"+ - "\3\2\2\2\u00c1\u00c2\7\21\2\2\u00c2\27\3\2\2\2\u00c3\u00c4\7\31\2\2\u00c4"+ - "\31\3\2\2\2\u00c5\u00c6\7\33\2\2\u00c6\33\3\2\2\2\u00c7\u00c8\7\b\2\2"+ - "\u00c8\35\3\2\2\2\u00c9\u00ca\7 \2\2\u00ca\37\3\2\2\2\u00cb\u00cc\7\23"+ - "\2\2\u00cc!\3\2\2\2\u00cd\u00ce\7\5\2\2\u00ce#\3\2\2\2\u00cf\u00d0\7\17"+ - "\2\2\u00d0%\3\2\2\2\u00d1\u00d2\7#\2\2\u00d2\'\3\2\2\2\u00d3\u00d4\7\26"+ - "\2\2\u00d4)\3\2\2\2\u00d5\u00d6\7\"\2\2\u00d6+\3\2\2\2\u00d7\u00d8\7\7"+ - "\2\2\u00d8\u00d9\7\13\2\2\u00d9\u00da\5V,\2\u00da\u00db\7\6\2\2\u00db"+ - "\u00dc\5V,\2\u00dc\u00dd\7\6\2\2\u00dd\u00de\5V,\2\u00de\u00df\7\6\2\2"+ - "\u00df\u00e0\5V,\2\u00e0\u00e1\7\6\2\2\u00e1\u00e2\5V,\2\u00e2\u00e3\7"+ - "\30\2\2\u00e3-\3\2\2\2\u00e4\u00e5\7\16\2\2\u00e5\u00e6\7\13\2\2\u00e6"+ - "\u00e7\5V,\2\u00e7\u00e8\7\6\2\2\u00e8\u00e9\5V,\2\u00e9\u00ea\7\6\2\2"+ - "\u00ea\u00eb\5V,\2\u00eb\u00ec\7\30\2\2\u00ec/\3\2\2\2\u00ed\u00ee\5."+ - "\30\2\u00ee\u00ef\7,\2\2\u00ef\61\3\2\2\2\u00f0\u00f1\7\34\2\2\u00f1\u00f2"+ - "\7\n\2\2\u00f2\u00f3\5R*\2\u00f3\u00f4\7\3\2\2\u00f4\63\3\2\2\2\u00f5"+ - "\u00f6\7/\2\2\u00f6\u00f7\7\n\2\2\u00f7\u00f8\5V,\2\u00f8\u00f9\7\3\2"+ - "\2\u00f9\u00fa\7+\2\2\u00fa\u00fb\5R*\2\u00fb\u00fc\7,\2\2\u00fc\65\3"+ - "\2\2\2\u00fd\u00fe\7/\2\2\u00fe\u00ff\7\n\2\2\u00ff\u0100\5V,\2\u0100"+ - "\u0101\7\3\2\2\u0101\67\3\2\2\2\u0102\u0103\7/\2\2\u0103\u0106\7+\2\2"+ - "\u0104\u0107\5R*\2\u0105\u0107\5:\36\2\u0106\u0104\3\2\2\2\u0106\u0105"+ - "\3\2\2\2\u0107\u0108\3\2\2\2\u0108\u0109\7,\2\2\u01099\3\2\2\2\u010a\u0111"+ - "\7\n\2\2\u010b\u010d\5V,\2\u010c\u010e\7\6\2\2\u010d\u010c\3\2\2\2\u010d"+ - "\u010e\3\2\2\2\u010e\u0110\3\2\2\2\u010f\u010b\3\2\2\2\u0110\u0113\3\2"+ - "\2\2\u0111\u010f\3\2\2\2\u0111\u0112\3\2\2\2\u0112\u0114\3\2\2\2\u0113"+ - "\u0111\3\2\2\2\u0114\u0115\7\3\2\2\u0115;\3\2\2\2\u0116\u0117\7\24\2\2"+ - "\u0117\u0118\7\n\2\2\u0118\u0119\5R*\2\u0119\u011a\7\3\2\2\u011a\u011b"+ - "\7+\2\2\u011b\u011c\5R*\2\u011c\u011d\7,\2\2\u011d=\3\2\2\2\u011e\u011f"+ - "\7\24\2\2\u011f\u0120\7\n\2\2\u0120\u0121\5R*\2\u0121\u0122\7\3\2\2\u0122"+ - "?\3\2\2\2\u0123\u0124\b!\1\2\u0124\u0125\5V,\2\u0125\u012b\3\2\2\2\u0126"+ - "\u0127\6!\2\3\u0127\u0128\7\61\2\2\u0128\u012a\5V,\2\u0129\u0126\3\2\2"+ - "\2\u012a\u012d\3\2\2\2\u012b\u0129\3\2\2\2\u012b\u012c\3\2\2\2\u012cA"+ - "\3\2\2\2\u012d\u012b\3\2\2\2\u012e\u012f\b\"\1\2\u012f\u0130\5@!\2\u0130"+ - "\u0136\3\2\2\2\u0131\u0132\6\"\3\3\u0132\u0133\7\60\2\2\u0133\u0135\5"+ - "@!\2\u0134\u0131\3\2\2\2\u0135\u0138\3\2\2\2\u0136\u0134\3\2\2\2\u0136"+ - "\u0137\3\2\2\2\u0137C\3\2\2\2\u0138\u0136\3\2\2\2\u0139\u013a\b#\1\2\u013a"+ - "\u013b\5B\"\2\u013b\u0141\3\2\2\2\u013c\u013d\6#\4\3\u013d\u013e\7\62"+ - "\2\2\u013e\u0140\5B\"\2\u013f\u013c\3\2\2\2\u0140\u0143\3\2\2\2\u0141"+ - "\u013f\3\2\2\2\u0141\u0142\3\2\2\2\u0142E\3\2\2\2\u0143\u0141\3\2\2\2"+ - "\u0144\u0145\b$\1\2\u0145\u0146\5D#\2\u0146\u014c\3\2\2\2\u0147\u0148"+ - "\6$\5\3\u0148\u0149\7\63\2\2\u0149\u014b\5D#\2\u014a\u0147\3\2\2\2\u014b"+ - "\u014e\3\2\2\2\u014c\u014a\3\2\2\2\u014c\u014d\3\2\2\2\u014dG\3\2\2\2"+ - "\u014e\u014c\3\2\2\2\u014f\u0150\b%\1\2\u0150\u0151\5F$\2\u0151\u0157"+ - "\3\2\2\2\u0152\u0153\6%\6\3\u0153\u0154\7\64\2\2\u0154\u0156\5F$\2\u0155"+ - "\u0152\3\2\2\2\u0156\u0159\3\2\2\2\u0157\u0155\3\2\2\2\u0157\u0158\3\2"+ - "\2\2\u0158I\3\2\2\2\u0159\u0157\3\2\2\2\u015a\u015b\b&\1\2\u015b\u015c"+ - "\5H%\2\u015c\u0162\3\2\2\2\u015d\u015e\6&\7\3\u015e\u015f\7\'\2\2\u015f"+ - "\u0161\5H%\2\u0160\u015d\3\2\2\2\u0161\u0164\3\2\2\2\u0162\u0160\3\2\2"+ - "\2\u0162\u0163\3\2\2\2\u0163K\3\2\2\2\u0164\u0162\3\2\2\2\u0165\u0166"+ - "\b\'\1\2\u0166\u0167\5J&\2\u0167\u016d\3\2\2\2\u0168\u0169\6\'\b\3\u0169"+ - "\u016a\7\65\2\2\u016a\u016c\5J&\2\u016b\u0168\3\2\2\2\u016c\u016f\3\2"+ - "\2\2\u016d\u016b\3\2\2\2\u016d\u016e\3\2\2\2\u016eM\3\2\2\2\u016f\u016d"+ - "\3\2\2\2\u0170\u0171\b(\1\2\u0171\u0172\5L\'\2\u0172\u0178\3\2\2\2\u0173"+ - "\u0174\6(\t\3\u0174\u0175\7(\2\2\u0175\u0177\5L\'\2\u0176\u0173\3\2\2"+ - "\2\u0177\u017a\3\2\2\2\u0178\u0176\3\2\2\2\u0178\u0179\3\2\2\2\u0179O"+ - "\3\2\2\2\u017a\u0178\3\2\2\2\u017b\u017c\b)\1\2\u017c\u017d\5N(\2\u017d"+ - "\u0183\3\2\2\2\u017e\u017f\6)\n\3\u017f\u0180\7)\2\2\u0180\u0182\5N(\2"+ - "\u0181\u017e\3\2\2\2\u0182\u0185\3\2\2\2\u0183\u0181\3\2\2\2\u0183\u0184"+ - "\3\2\2\2\u0184Q\3\2\2\2\u0185\u0183\3\2\2\2\u0186\u0187\5P)\2\u0187S\3"+ - "\2\2\2\u0188\u0189\5R*\2\u0189U\3\2\2\2\u018a\u019d\7%\2\2\u018b\u019d"+ - "\5X-\2\u018c\u019d\5b\62\2\u018d\u019d\5\20\t\2\u018e\u018f\7\13\2\2\u018f"+ - "\u0190\5R*\2\u0190\u0191\7\30\2\2\u0191\u019d\3\2\2\2\u0192\u0193\7*\2"+ - "\2\u0193\u0194\7\13\2\2\u0194\u0195\5R*\2\u0195\u0196\7\30\2\2\u0196\u019d"+ - "\3\2\2\2\u0197\u019d\5,\27\2\u0198\u019d\5\62\32\2\u0199\u019d\5.\30\2"+ - "\u019a\u019d\5> \2\u019b\u019d\5\66\34\2\u019c\u018a\3\2\2\2\u019c\u018b"+ - "\3\2\2\2\u019c\u018c\3\2\2\2\u019c\u018d\3\2\2\2\u019c\u018e\3\2\2\2\u019c"+ - "\u0192\3\2\2\2\u019c\u0197\3\2\2\2\u019c\u0198\3\2\2\2\u019c\u0199\3\2"+ - "\2\2\u019c\u019a\3\2\2\2\u019c\u019b\3\2\2\2\u019dW\3\2\2\2\u019e\u019f"+ - "\7\67\2\2\u019fY\3\2\2\2\u01a0\u01a1\7\36\2\2\u01a1\u01a2\7\13\2\2\u01a2"+ - "\u01a3\5R*\2\u01a3\u01a4\7\30\2\2\u01a4\u01a5\7,\2\2\u01a5[\3\2\2\2\u01a6"+ - "\u01a7\7\36\2\2\u01a7\u01a8\7\13\2\2\u01a8\u01a9\5R*\2\u01a9\u01aa\7\6"+ - "\2\2\u01aa\u01ab\5R*\2\u01ab\u01ac\7\30\2\2\u01ac\u01ad\7,\2\2\u01ad]"+ - "\3\2\2\2\u01ae\u01af\7\25\2\2\u01af\u01b0\7\13\2\2\u01b0\u01b1\5R*\2\u01b1"+ - "\u01b2\7\30\2\2\u01b2\u01b3\7,\2\2\u01b3_\3\2\2\2\u01b4\u01b5\7\4\2\2"+ - "\u01b5\u01b6\7,\2\2\u01b6a\3\2\2\2\u01b7\u01b8\7/\2\2\u01b8c\3\2\2\2\25"+ - "~\u0080\u008b\u009d\u00a5\u00bb\u0106\u010d\u0111\u012b\u0136\u0141\u014c"+ - "\u0157\u0162\u016d\u0178\u0183\u019c"; + "\3\4\3\4\3\4\3\4\3\4\7\4\u0080\n\4\f\4\16\4\u0083\13\4\3\5\3\5\3\5\3\5"+ + "\3\5\3\6\7\6\u008b\n\6\f\6\16\6\u008e\13\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7"+ + "\3\7\3\7\3\7\3\7\3\7\3\7\7\7\u009d\n\7\f\7\16\7\u00a0\13\7\3\7\3\7\3\7"+ + "\3\7\3\7\5\7\u00a7\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t"+ + "\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\5\t\u00bd\n\t\3\n\3\n\3\13\3\13\3\f\3"+ + "\f\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\23\3\23"+ + "\3\24\3\24\3\25\3\25\3\26\3\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27"+ + "\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\30\3\30"+ + "\3\30\3\30\3\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32\3\33\3\33\3\33\3\33"+ + "\3\33\3\33\3\33\3\33\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\35"+ + "\5\35\u010b\n\35\3\35\3\35\3\36\3\36\3\36\5\36\u0112\n\36\7\36\u0114\n"+ + "\36\f\36\16\36\u0117\13\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37"+ + "\3\37\3 \3 \3 \3 \3 \3!\3!\3!\3!\3!\3!\7!\u012e\n!\f!\16!\u0131\13!\3"+ + "\"\3\"\3\"\3\"\3\"\3\"\7\"\u0139\n\"\f\"\16\"\u013c\13\"\3#\3#\3#\3#\3"+ + "#\3#\7#\u0144\n#\f#\16#\u0147\13#\3$\3$\3$\3$\3$\3$\7$\u014f\n$\f$\16"+ + "$\u0152\13$\3%\3%\3%\3%\3%\3%\7%\u015a\n%\f%\16%\u015d\13%\3&\3&\3&\3"+ + "&\3&\3&\7&\u0165\n&\f&\16&\u0168\13&\3\'\3\'\3\'\3\'\3\'\3\'\7\'\u0170"+ + "\n\'\f\'\16\'\u0173\13\'\3(\3(\3(\3(\3(\3(\7(\u017b\n(\f(\16(\u017e\13"+ + "(\3)\3)\3)\3)\3)\3)\7)\u0186\n)\f)\16)\u0189\13)\3*\3*\3+\3+\3,\3,\3,"+ + "\3,\3,\3,\3,\3,\3,\3,\3,\3,\3,\3,\3,\3,\3,\5,\u01a0\n,\3-\3-\3.\3.\3."+ + "\3.\3.\3.\3/\3/\3/\3/\3/\3/\3/\3/\3\60\3\60\3\60\3\60\3\60\3\60\3\61\3"+ + "\61\3\61\3\62\3\62\3\62\2\63\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \""+ + "$&(*,.\60\62\64\668:<>@BDFHJLNPRTVXZ\\^`b\2\3\4\2%&\67\67\u01bd\2d\3\2"+ + "\2\2\4g\3\2\2\2\6\u0081\3\2\2\2\b\u0084\3\2\2\2\n\u008c\3\2\2\2\f\u008f"+ + "\3\2\2\2\16\u00a8\3\2\2\2\20\u00bc\3\2\2\2\22\u00be\3\2\2\2\24\u00c0\3"+ + "\2\2\2\26\u00c2\3\2\2\2\30\u00c4\3\2\2\2\32\u00c6\3\2\2\2\34\u00c8\3\2"+ + "\2\2\36\u00ca\3\2\2\2 \u00cc\3\2\2\2\"\u00ce\3\2\2\2$\u00d0\3\2\2\2&\u00d2"+ + "\3\2\2\2(\u00d4\3\2\2\2*\u00d6\3\2\2\2,\u00d8\3\2\2\2.\u00e7\3\2\2\2\60"+ + "\u00f0\3\2\2\2\62\u00f3\3\2\2\2\64\u00f8\3\2\2\2\66\u0100\3\2\2\28\u0105"+ + "\3\2\2\2:\u010e\3\2\2\2<\u011a\3\2\2\2>\u0122\3\2\2\2@\u0127\3\2\2\2B"+ + "\u0132\3\2\2\2D\u013d\3\2\2\2F\u0148\3\2\2\2H\u0153\3\2\2\2J\u015e\3\2"+ + "\2\2L\u0169\3\2\2\2N\u0174\3\2\2\2P\u017f\3\2\2\2R\u018a\3\2\2\2T\u018c"+ + "\3\2\2\2V\u019f\3\2\2\2X\u01a1\3\2\2\2Z\u01a3\3\2\2\2\\\u01a9\3\2\2\2"+ + "^\u01b1\3\2\2\2`\u01b7\3\2\2\2b\u01ba\3\2\2\2de\5\6\4\2ef\7\2\2\3f\3\3"+ + "\2\2\2gh\7\22\2\2hi\7\f\2\2ij\78\2\2jk\5\6\4\2kl\79\2\2lm\7$\2\2mn\7\f"+ + "\2\2no\78\2\2op\5\6\4\2pq\79\2\2q\5\3\2\2\2r\u0080\5\b\5\2s\u0080\5\64"+ + "\33\2t\u0080\58\35\2u\u0080\5<\37\2v\u0080\5\20\t\2w\u0080\5\f\7\2x\u0080"+ + "\5\16\b\2y\u0080\5Z.\2z\u0080\5\\/\2{\u0080\5^\60\2|\u0080\5`\61\2}\u0080"+ + "\5\60\31\2~\u0080\5,\27\2\177r\3\2\2\2\177s\3\2\2\2\177t\3\2\2\2\177u"+ + "\3\2\2\2\177v\3\2\2\2\177w\3\2\2\2\177x\3\2\2\2\177y\3\2\2\2\177z\3\2"+ + "\2\2\177{\3\2\2\2\177|\3\2\2\2\177}\3\2\2\2\177~\3\2\2\2\u0080\u0083\3"+ + "\2\2\2\u0081\177\3\2\2\2\u0081\u0082\3\2\2\2\u0082\7\3\2\2\2\u0083\u0081"+ + "\3\2\2\2\u0084\u0085\7\20\2\2\u0085\u0086\5\n\6\2\u0086\u0087\7!\2\2\u0087"+ + "\u0088\7,\2\2\u0088\t\3\2\2\2\u0089\u008b\t\2\2\2\u008a\u0089\3\2\2\2"+ + "\u008b\u008e\3\2\2\2\u008c\u008a\3\2\2\2\u008c\u008d\3\2\2\2\u008d\13"+ + "\3\2\2\2\u008e\u008c\3\2\2\2\u008f\u0090\7\r\2\2\u0090\u0091\5T+\2\u0091"+ + "\u0092\7\f\2\2\u0092\u0093\78\2\2\u0093\u0094\5\6\4\2\u0094\u009e\79\2"+ + "\2\u0095\u0096\7\35\2\2\u0096\u0097\5T+\2\u0097\u0098\7\f\2\2\u0098\u0099"+ + "\78\2\2\u0099\u009a\5\6\4\2\u009a\u009b\79\2\2\u009b\u009d\3\2\2\2\u009c"+ + "\u0095\3\2\2\2\u009d\u00a0\3\2\2\2\u009e\u009c\3\2\2\2\u009e\u009f\3\2"+ + "\2\2\u009f\u00a6\3\2\2\2\u00a0\u009e\3\2\2\2\u00a1\u00a2\7\32\2\2\u00a2"+ + "\u00a3\78\2\2\u00a3\u00a4\5\6\4\2\u00a4\u00a5\79\2\2\u00a5\u00a7\3\2\2"+ + "\2\u00a6\u00a1\3\2\2\2\u00a6\u00a7\3\2\2\2\u00a7\r\3\2\2\2\u00a8\u00a9"+ + "\7\t\2\2\u00a9\u00aa\5T+\2\u00aa\u00ab\7\f\2\2\u00ab\u00ac\78\2\2\u00ac"+ + "\u00ad\5\6\4\2\u00ad\u00ae\79\2\2\u00ae\17\3\2\2\2\u00af\u00bd\5\22\n"+ + "\2\u00b0\u00bd\5\24\13\2\u00b1\u00bd\5\26\f\2\u00b2\u00bd\5\30\r\2\u00b3"+ + "\u00bd\5\32\16\2\u00b4\u00bd\5\34\17\2\u00b5\u00bd\5\36\20\2\u00b6\u00bd"+ + "\5 \21\2\u00b7\u00bd\5\"\22\2\u00b8\u00bd\5$\23\2\u00b9\u00bd\5&\24\2"+ + "\u00ba\u00bd\5(\25\2\u00bb\u00bd\5*\26\2\u00bc\u00af\3\2\2\2\u00bc\u00b0"+ + "\3\2\2\2\u00bc\u00b1\3\2\2\2\u00bc\u00b2\3\2\2\2\u00bc\u00b3\3\2\2\2\u00bc"+ + "\u00b4\3\2\2\2\u00bc\u00b5\3\2\2\2\u00bc\u00b6\3\2\2\2\u00bc\u00b7\3\2"+ + "\2\2\u00bc\u00b8\3\2\2\2\u00bc\u00b9\3\2\2\2\u00bc\u00ba\3\2\2\2\u00bc"+ + "\u00bb\3\2\2\2\u00bd\21\3\2\2\2\u00be\u00bf\7\27\2\2\u00bf\23\3\2\2\2"+ + "\u00c0\u00c1\7\37\2\2\u00c1\25\3\2\2\2\u00c2\u00c3\7\21\2\2\u00c3\27\3"+ + "\2\2\2\u00c4\u00c5\7\31\2\2\u00c5\31\3\2\2\2\u00c6\u00c7\7\33\2\2\u00c7"+ + "\33\3\2\2\2\u00c8\u00c9\7\b\2\2\u00c9\35\3\2\2\2\u00ca\u00cb\7 \2\2\u00cb"+ + "\37\3\2\2\2\u00cc\u00cd\7\23\2\2\u00cd!\3\2\2\2\u00ce\u00cf\7\5\2\2\u00cf"+ + "#\3\2\2\2\u00d0\u00d1\7\17\2\2\u00d1%\3\2\2\2\u00d2\u00d3\7#\2\2\u00d3"+ + "\'\3\2\2\2\u00d4\u00d5\7\26\2\2\u00d5)\3\2\2\2\u00d6\u00d7\7\"\2\2\u00d7"+ + "+\3\2\2\2\u00d8\u00d9\7\7\2\2\u00d9\u00da\7\13\2\2\u00da\u00db\5V,\2\u00db"+ + "\u00dc\7\6\2\2\u00dc\u00dd\5V,\2\u00dd\u00de\7\6\2\2\u00de\u00df\5V,\2"+ + "\u00df\u00e0\7\6\2\2\u00e0\u00e1\5:\36\2\u00e1\u00e2\7\6\2\2\u00e2\u00e3"+ + "\5V,\2\u00e3\u00e4\7\6\2\2\u00e4\u00e5\5V,\2\u00e5\u00e6\7\30\2\2\u00e6"+ + "-\3\2\2\2\u00e7\u00e8\7\16\2\2\u00e8\u00e9\7\13\2\2\u00e9\u00ea\5V,\2"+ + "\u00ea\u00eb\7\6\2\2\u00eb\u00ec\5V,\2\u00ec\u00ed\7\6\2\2\u00ed\u00ee"+ + "\5V,\2\u00ee\u00ef\7\30\2\2\u00ef/\3\2\2\2\u00f0\u00f1\5.\30\2\u00f1\u00f2"+ + "\7,\2\2\u00f2\61\3\2\2\2\u00f3\u00f4\7\34\2\2\u00f4\u00f5\7\n\2\2\u00f5"+ + "\u00f6\5R*\2\u00f6\u00f7\7\3\2\2\u00f7\63\3\2\2\2\u00f8\u00f9\7/\2\2\u00f9"+ + "\u00fa\7\n\2\2\u00fa\u00fb\5V,\2\u00fb\u00fc\7\3\2\2\u00fc\u00fd\7+\2"+ + "\2\u00fd\u00fe\5R*\2\u00fe\u00ff\7,\2\2\u00ff\65\3\2\2\2\u0100\u0101\7"+ + "/\2\2\u0101\u0102\7\n\2\2\u0102\u0103\5V,\2\u0103\u0104\7\3\2\2\u0104"+ + "\67\3\2\2\2\u0105\u0106\7/\2\2\u0106\u010a\7+\2\2\u0107\u010b\5R*\2\u0108"+ + "\u010b\5:\36\2\u0109\u010b\5,\27\2\u010a\u0107\3\2\2\2\u010a\u0108\3\2"+ + "\2\2\u010a\u0109\3\2\2\2\u010b\u010c\3\2\2\2\u010c\u010d\7,\2\2\u010d"+ + "9\3\2\2\2\u010e\u0115\7\n\2\2\u010f\u0111\5V,\2\u0110\u0112\7\6\2\2\u0111"+ + "\u0110\3\2\2\2\u0111\u0112\3\2\2\2\u0112\u0114\3\2\2\2\u0113\u010f\3\2"+ + "\2\2\u0114\u0117\3\2\2\2\u0115\u0113\3\2\2\2\u0115\u0116\3\2\2\2\u0116"+ + "\u0118\3\2\2\2\u0117\u0115\3\2\2\2\u0118\u0119\7\3\2\2\u0119;\3\2\2\2"+ + "\u011a\u011b\7\24\2\2\u011b\u011c\7\n\2\2\u011c\u011d\5R*\2\u011d\u011e"+ + "\7\3\2\2\u011e\u011f\7+\2\2\u011f\u0120\5R*\2\u0120\u0121\7,\2\2\u0121"+ + "=\3\2\2\2\u0122\u0123\7\24\2\2\u0123\u0124\7\n\2\2\u0124\u0125\5R*\2\u0125"+ + "\u0126\7\3\2\2\u0126?\3\2\2\2\u0127\u0128\b!\1\2\u0128\u0129\5V,\2\u0129"+ + "\u012f\3\2\2\2\u012a\u012b\6!\2\3\u012b\u012c\7\61\2\2\u012c\u012e\5V"+ + ",\2\u012d\u012a\3\2\2\2\u012e\u0131\3\2\2\2\u012f\u012d\3\2\2\2\u012f"+ + "\u0130\3\2\2\2\u0130A\3\2\2\2\u0131\u012f\3\2\2\2\u0132\u0133\b\"\1\2"+ + "\u0133\u0134\5@!\2\u0134\u013a\3\2\2\2\u0135\u0136\6\"\3\3\u0136\u0137"+ + "\7\60\2\2\u0137\u0139\5@!\2\u0138\u0135\3\2\2\2\u0139\u013c\3\2\2\2\u013a"+ + "\u0138\3\2\2\2\u013a\u013b\3\2\2\2\u013bC\3\2\2\2\u013c\u013a\3\2\2\2"+ + "\u013d\u013e\b#\1\2\u013e\u013f\5B\"\2\u013f\u0145\3\2\2\2\u0140\u0141"+ + "\6#\4\3\u0141\u0142\7\62\2\2\u0142\u0144\5B\"\2\u0143\u0140\3\2\2\2\u0144"+ + "\u0147\3\2\2\2\u0145\u0143\3\2\2\2\u0145\u0146\3\2\2\2\u0146E\3\2\2\2"+ + "\u0147\u0145\3\2\2\2\u0148\u0149\b$\1\2\u0149\u014a\5D#\2\u014a\u0150"+ + "\3\2\2\2\u014b\u014c\6$\5\3\u014c\u014d\7\63\2\2\u014d\u014f\5D#\2\u014e"+ + "\u014b\3\2\2\2\u014f\u0152\3\2\2\2\u0150\u014e\3\2\2\2\u0150\u0151\3\2"+ + "\2\2\u0151G\3\2\2\2\u0152\u0150\3\2\2\2\u0153\u0154\b%\1\2\u0154\u0155"+ + "\5F$\2\u0155\u015b\3\2\2\2\u0156\u0157\6%\6\3\u0157\u0158\7\64\2\2\u0158"+ + "\u015a\5F$\2\u0159\u0156\3\2\2\2\u015a\u015d\3\2\2\2\u015b\u0159\3\2\2"+ + "\2\u015b\u015c\3\2\2\2\u015cI\3\2\2\2\u015d\u015b\3\2\2\2\u015e\u015f"+ + "\b&\1\2\u015f\u0160\5H%\2\u0160\u0166\3\2\2\2\u0161\u0162\6&\7\3\u0162"+ + "\u0163\7\'\2\2\u0163\u0165\5H%\2\u0164\u0161\3\2\2\2\u0165\u0168\3\2\2"+ + "\2\u0166\u0164\3\2\2\2\u0166\u0167\3\2\2\2\u0167K\3\2\2\2\u0168\u0166"+ + "\3\2\2\2\u0169\u016a\b\'\1\2\u016a\u016b\5J&\2\u016b\u0171\3\2\2\2\u016c"+ + "\u016d\6\'\b\3\u016d\u016e\7\65\2\2\u016e\u0170\5J&\2\u016f\u016c\3\2"+ + "\2\2\u0170\u0173\3\2\2\2\u0171\u016f\3\2\2\2\u0171\u0172\3\2\2\2\u0172"+ + "M\3\2\2\2\u0173\u0171\3\2\2\2\u0174\u0175\b(\1\2\u0175\u0176\5L\'\2\u0176"+ + "\u017c\3\2\2\2\u0177\u0178\6(\t\3\u0178\u0179\7(\2\2\u0179\u017b\5L\'"+ + "\2\u017a\u0177\3\2\2\2\u017b\u017e\3\2\2\2\u017c\u017a\3\2\2\2\u017c\u017d"+ + "\3\2\2\2\u017dO\3\2\2\2\u017e\u017c\3\2\2\2\u017f\u0180\b)\1\2\u0180\u0181"+ + "\5N(\2\u0181\u0187\3\2\2\2\u0182\u0183\6)\n\3\u0183\u0184\7)\2\2\u0184"+ + "\u0186\5N(\2\u0185\u0182\3\2\2\2\u0186\u0189\3\2\2\2\u0187\u0185\3\2\2"+ + "\2\u0187\u0188\3\2\2\2\u0188Q\3\2\2\2\u0189\u0187\3\2\2\2\u018a\u018b"+ + "\5P)\2\u018bS\3\2\2\2\u018c\u018d\5R*\2\u018dU\3\2\2\2\u018e\u01a0\7%"+ + "\2\2\u018f\u01a0\5X-\2\u0190\u01a0\5b\62\2\u0191\u01a0\5\20\t\2\u0192"+ + "\u0193\7\13\2\2\u0193\u0194\5R*\2\u0194\u0195\7\30\2\2\u0195\u01a0\3\2"+ + "\2\2\u0196\u0197\7*\2\2\u0197\u0198\7\13\2\2\u0198\u0199\5R*\2\u0199\u019a"+ + "\7\30\2\2\u019a\u01a0\3\2\2\2\u019b\u01a0\5\62\32\2\u019c\u01a0\5.\30"+ + "\2\u019d\u01a0\5> \2\u019e\u01a0\5\66\34\2\u019f\u018e\3\2\2\2\u019f\u018f"+ + "\3\2\2\2\u019f\u0190\3\2\2\2\u019f\u0191\3\2\2\2\u019f\u0192\3\2\2\2\u019f"+ + "\u0196\3\2\2\2\u019f\u019b\3\2\2\2\u019f\u019c\3\2\2\2\u019f\u019d\3\2"+ + "\2\2\u019f\u019e\3\2\2\2\u01a0W\3\2\2\2\u01a1\u01a2\7\67\2\2\u01a2Y\3"+ + "\2\2\2\u01a3\u01a4\7\36\2\2\u01a4\u01a5\7\13\2\2\u01a5\u01a6\5R*\2\u01a6"+ + "\u01a7\7\30\2\2\u01a7\u01a8\7,\2\2\u01a8[\3\2\2\2\u01a9\u01aa\7\36\2\2"+ + "\u01aa\u01ab\7\13\2\2\u01ab\u01ac\5R*\2\u01ac\u01ad\7\6\2\2\u01ad\u01ae"+ + "\5R*\2\u01ae\u01af\7\30\2\2\u01af\u01b0\7,\2\2\u01b0]\3\2\2\2\u01b1\u01b2"+ + "\7\25\2\2\u01b2\u01b3\7\13\2\2\u01b3\u01b4\5R*\2\u01b4\u01b5\7\30\2\2"+ + "\u01b5\u01b6\7,\2\2\u01b6_\3\2\2\2\u01b7\u01b8\7\4\2\2\u01b8\u01b9\7,"+ + "\2\2\u01b9a\3\2\2\2\u01ba\u01bb\7/\2\2\u01bbc\3\2\2\2\25\177\u0081\u008c"+ + "\u009e\u00a6\u00bc\u010a\u0111\u0115\u012f\u013a\u0145\u0150\u015b\u0166"+ + "\u0171\u017c\u0187\u019f"; public static final ATN _ATN = ATNSimulator.deserialize(_serializedATN.toCharArray()); static { diff --git a/ethereumj-core/src/main/java/org/ethereum/serpent/SerpentToAssemblyCompiler.java b/ethereumj-core/src/main/java/org/ethereum/serpent/SerpentToAssemblyCompiler.java index 8a66e59e..1bfa3e37 100644 --- a/ethereumj-core/src/main/java/org/ethereum/serpent/SerpentToAssemblyCompiler.java +++ b/ethereumj-core/src/main/java/org/ethereum/serpent/SerpentToAssemblyCompiler.java @@ -1,6 +1,8 @@ package org.ethereum.serpent; import org.antlr.v4.runtime.misc.NotNull; +import org.ethereum.crypto.HashUtil; +import org.ethereum.util.ByteUtil; import org.spongycastle.util.encoders.Hex; import java.math.BigInteger; @@ -199,7 +201,23 @@ public class SerpentToAssemblyCompiler extends SerpentBaseVisitor { String varName = ctx.VAR().toString(); int addr = 0; - if (ctx.arr_def() != null){ + // msg assigned has two arrays to calc + if (ctx.msg_func() != null){ + + String msgCode = visitMsg_func(ctx.msg_func()); + int outSize = getMsgOutputArraySize(msgCode); + int inSize = getMsgInputArraySize(msgCode); + msgCode = cleanMsgString(msgCode); + + String randomArrayName = new String(HashUtil.randomPeerId()); + arraysSize.put(randomArrayName, inSize * 32 + 32); + arraysIndex.add(randomArrayName); + + arraysSize.put(varName, outSize * 32 + 32); + arraysIndex.add(varName); + + return msgCode; + } else if (ctx.arr_def() != null){ // if it's an array the all management is different String arrayCode = visitArr_def(ctx.arr_def()); @@ -211,7 +229,6 @@ public class SerpentToAssemblyCompiler extends SerpentBaseVisitor { return arrayCode; } else{ - // if it's an array the all management is different String expression = visitExpression(ctx.expression()); addr = vars.indexOf(varName); if (addr == -1){ @@ -260,9 +277,6 @@ public class SerpentToAssemblyCompiler extends SerpentBaseVisitor { if (ctx.special_func() != null) return visitSpecial_func(ctx.special_func()); - if (ctx.msg_func() != null) - return visitMsg_func(ctx.msg_func()); - if (ctx.msg_data() != null) return visitMsg_data(ctx.msg_data()); @@ -292,7 +306,7 @@ public class SerpentToAssemblyCompiler extends SerpentBaseVisitor { i += 32; } - return String.format(" MSIZE %s %d SWAP MSTORE ", arrayInit, arraySize); + return String.format(" MSIZE 32 ADD MSIZE %s %d SWAP MSTORE ", arrayInit, arraySize); } @Override @@ -581,14 +595,19 @@ public class SerpentToAssemblyCompiler extends SerpentBaseVisitor { @Override public String visitMsg_func(@NotNull SerpentParser.Msg_funcContext ctx) { +// msg_func: 'msg' '(' int_val ',' int_val ',' int_val ',' arr_def ',' int_val ',' int_val')' ; +// msg_func: 'msg' '(' [gas] ',' [to] ',' [value] ',' arr_def ',' [in_len] ',' [out_len]')' ; + String operand0 = visit(ctx.int_val(0)); String operand1 = visit(ctx.int_val(1)); String operand2 = visit(ctx.int_val(2)); - String operand3 = visit(ctx.int_val(3)); - String operand4 = visit(ctx.int_val(4)); + String operand3 = visit(ctx.arr_def()); + String operand4 = visit(ctx.int_val(3)); + String operand5 = visit(ctx.int_val(4)); // OUTDATASIZE OUTDATASTART INDATASIZE INDATASTART VALUE TO GAS CALL - return String.format("0 0 %s %s %s %s %s CALL ", operand4, operand3, operand1, operand0, operand2); + return String.format(" %s %s %s %s %s %s CALL ", + operand5, operand4, operand5, operand4, operand3, operand2, operand1, operand0); } @Override @@ -674,6 +693,46 @@ public class SerpentToAssemblyCompiler extends SerpentBaseVisitor { } + private Integer getMsgOutputArraySize(String code){ + + String result = "0"; + Pattern pattern = Pattern.compile(""); + Matcher matcher = pattern.matcher(code.trim()); + if (matcher.find()) { + + String group = matcher.group(0); + result = group.replaceAll("", "$1").trim(); + } + + return Integer.parseInt(result); + } + + private Integer getMsgInputArraySize(String code){ + + String result = "0"; + Pattern pattern = Pattern.compile(""); + Matcher matcher = pattern.matcher(code.trim()); + if (matcher.find()) { + + String group = matcher.group(0); + result = group.replaceAll("", "$1").trim(); + } + + return Integer.parseInt(result); + } + + private String cleanMsgString (String code){ + + String result = ""; + + Pattern pattern = Pattern.compile("<(.*?)>"); + result= code.replaceAll("<(.*?)>", ""); + + return result; + } + + + private Integer getArraySize(String code){ String result = "0"; diff --git a/ethereumj-core/src/test/java/org/ethereum/serpent/SerpentCompileTest.java b/ethereumj-core/src/test/java/org/ethereum/serpent/SerpentCompileTest.java index 15e49272..64ca839c 100644 --- a/ethereumj-core/src/test/java/org/ethereum/serpent/SerpentCompileTest.java +++ b/ethereumj-core/src/test/java/org/ethereum/serpent/SerpentCompileTest.java @@ -1258,7 +1258,7 @@ public class SerpentCompileTest { String code = "c = 2\n" + "d = 3\n" + "a = [11, 22, 33]" ; - String expected = "0 63 MSTORE8 2 0 MSTORE 3 32 MSTORE MSIZE DUP 32 ADD 11 SWAP MSTORE DUP 64 ADD 22 SWAP MSTORE DUP 96 ADD 33 SWAP MSTORE 128 SWAP MSTORE"; + String expected = "0 63 MSTORE8 2 0 MSTORE 3 32 MSTORE MSIZE DUP DUP 32 ADD 11 SWAP MSTORE DUP 64 ADD 22 SWAP MSTORE DUP 96 ADD 33 SWAP MSTORE 128 SWAP MSTORE"; String asmResult = SerpentCompiler.compile(code); Assert.assertEquals(expected, asmResult); @@ -1269,12 +1269,24 @@ public class SerpentCompileTest { public void test46(){ String code = "a = [11, 22, 33]\n" + "a[ 2 ] = 3" ; - String expected = "MSIZE DUP 32 ADD 11 SWAP MSTORE DUP 64 ADD 22 SWAP MSTORE DUP 96 ADD 33 SWAP MSTORE 128 SWAP MSTORE 3 32 2 MUL 32 ADD 0 ADD 0 ADD MSTORE"; + String expected = "MSIZE DUP DUP 32 ADD 11 SWAP MSTORE DUP 64 ADD 22 SWAP MSTORE DUP 96 ADD 33 SWAP MSTORE 128 SWAP MSTORE 3 32 2 MUL 32 ADD 0 ADD 0 ADD MSTORE"; String asmResult = SerpentCompiler.compile(code); Assert.assertEquals(expected, asmResult); } + @Test // test arrays 3 simple + public void test46_1(){ + String code = "a = [11, 22, 33]\n" ; + String expected = ""; + + String asmResult = SerpentCompiler.compile(code); + System.out.println(asmResult); + +// Assert.assertEquals(expected, asmResult); + } + + @Test // test arrays 3 complicated set after 2 arrays public void test47(){ @@ -1282,7 +1294,7 @@ public class SerpentCompileTest { "b = [12, 14]\n" + "c = [22, 24, 25]\n" + "c[ 0 ] = 3" ; - String expected = "MSIZE DUP 32 ADD 2 SWAP MSTORE DUP 64 ADD 4 SWAP MSTORE DUP 96 ADD 6 SWAP MSTORE 128 SWAP MSTORE MSIZE DUP 32 ADD 12 SWAP MSTORE DUP 64 ADD 14 SWAP MSTORE 96 SWAP MSTORE MSIZE DUP 32 ADD 22 SWAP MSTORE DUP 64 ADD 24 SWAP MSTORE DUP 96 ADD 25 SWAP MSTORE 128 SWAP MSTORE 3 32 0 MUL 32 ADD 224 ADD 0 ADD MSTORE"; + String expected = "MSIZE DUP DUP 32 ADD 2 SWAP MSTORE DUP 64 ADD 4 SWAP MSTORE DUP 96 ADD 6 SWAP MSTORE 128 SWAP MSTORE MSIZE DUP DUP 32 ADD 12 SWAP MSTORE DUP 64 ADD 14 SWAP MSTORE 96 SWAP MSTORE MSIZE DUP DUP 32 ADD 22 SWAP MSTORE DUP 64 ADD 24 SWAP MSTORE DUP 96 ADD 25 SWAP MSTORE 128 SWAP MSTORE 3 32 0 MUL 32 ADD 224 ADD 0 ADD MSTORE"; String asmResult = SerpentCompiler.compile(code); Assert.assertEquals(expected, asmResult); } @@ -1293,7 +1305,7 @@ public class SerpentCompileTest { "c = 2\n" + "a = [11, 22, 33]\n" + "a[ 2 ] = 3" ; - String expected = "0 63 MSTORE8 1 0 MSTORE 2 32 MSTORE MSIZE DUP 32 ADD 11 SWAP MSTORE DUP 64 ADD 22 SWAP MSTORE DUP 96 ADD 33 SWAP MSTORE 128 SWAP MSTORE 3 32 2 MUL 32 ADD 0 ADD 64 ADD MSTORE"; + String expected = "0 63 MSTORE8 1 0 MSTORE 2 32 MSTORE MSIZE DUP DUP 32 ADD 11 SWAP MSTORE DUP 64 ADD 22 SWAP MSTORE DUP 96 ADD 33 SWAP MSTORE 128 SWAP MSTORE 3 32 2 MUL 32 ADD 0 ADD 64 ADD MSTORE"; String asmResult = SerpentCompiler.compile(code); Assert.assertEquals(expected, asmResult); @@ -1306,12 +1318,25 @@ public class SerpentCompileTest { String code = "c = [5]\n" + "a = [11, 22, 33]\n" + "b = a [0]" ; - String expected = "0 31 MSTORE8 MSIZE DUP 32 ADD 5 SWAP MSTORE 64 SWAP MSTORE MSIZE DUP 32 ADD 11 SWAP MSTORE DUP 64 ADD 22 SWAP MSTORE DUP 96 ADD 33 SWAP MSTORE 128 SWAP MSTORE 32 0 MUL 96 ADD 32 ADD MLOAD 0 MSTORE"; + String expected = "0 31 MSTORE8 MSIZE DUP DUP 32 ADD 5 SWAP MSTORE 64 SWAP MSTORE MSIZE DUP DUP 32 ADD 11 SWAP MSTORE DUP 64 ADD 22 SWAP MSTORE DUP 96 ADD 33 SWAP MSTORE 128 SWAP MSTORE 32 0 MUL 96 ADD 32 ADD MLOAD 0 MSTORE"; String asmResult = SerpentCompiler.compile(code); Assert.assertEquals(expected, asmResult); } + @Test // test msg(gas, to , val, [arr_in], in_len, out_len), and out access + public void test50(){ + String code = "\n" + + "a = msg(1, 2, 3, [11, 22, 33], 3, 6) \n" + + "b = a[0]\n" ; + String expected = "0 31 MSTORE8 6 3 MSIZE 32 ADD MSIZE DUP 32 ADD 11 SWAP MSTORE DUP 64 ADD 22 SWAP MSTORE DUP 96 ADD 33 SWAP MSTORE 128 SWAP MSTORE 3 2 1 CALL 32 0 MUL 160 ADD 32 ADD MLOAD 0 MSTORE"; + + String asmResult = SerpentCompiler.compile(code); + + Assert.assertEquals(expected, asmResult); + } + + /* @@ -1334,6 +1359,7 @@ public class SerpentCompileTest { */ /** + * todo: a = msg(gas, to , value, in_ptr, in_len, out_ptr, out_len) testing * * todo: return(1) testing * todo: return (1,2) testing @@ -1379,4 +1405,7 @@ public class SerpentCompileTest { " return(0)" + */ + + +// MSTORE DUP DUP MSOTRE8 FUCK I AM LOST FUCK SWAP DUP SWAP DUP DUP }