diff --git a/compiler/antlr/prog8.g4 b/compiler/antlr/prog8.g4 index d7b572668..2189f567f 100644 --- a/compiler/antlr/prog8.g4 +++ b/compiler/antlr/prog8.g4 @@ -223,9 +223,7 @@ statement_block : ; -sub_params : sub_param (',' EOL? sub_param)* ; - -sub_param : identifier ':' datatype; +sub_params : vardecl (',' EOL? vardecl)* ; sub_returns : datatype (',' EOL? datatype)* ; @@ -238,7 +236,7 @@ asmsub_address : '=' address=integerliteral ; asmsub_params : asmsub_param (',' EOL? asmsub_param)* ; -asmsub_param : identifier ':' datatype '@' (registerorpair | statusregister); +asmsub_param : vardecl '@' (registerorpair | statusregister); clobber : register (',' register)* ; diff --git a/compiler/examples/cube3d-novm.p8 b/compiler/examples/cube3d-novm.p8 index d5fd70e5c..703b94748 100644 --- a/compiler/examples/cube3d-novm.p8 +++ b/compiler/examples/cube3d-novm.p8 @@ -31,7 +31,7 @@ float[len(zcoor)] rotatedz sub start() { - while(1) { + while true { if irq.time_changed { irq.time_changed = 0 ;vm_gfx_clearscr(0) @@ -49,7 +49,7 @@ } } - sub rotate_vertices(t: float) { + sub rotate_vertices(float t) { ; rotate around origin (0,0,0) ; set up the 3d rotation matrix values @@ -80,11 +80,11 @@ sub draw_edges() { - sub toscreenx(x: float, z: float) -> word { + sub toscreenx(float x, float z) -> word { return fintw(x/(4.2+z) * flt(height)) + width // 2 } - sub toscreeny(y: float, z: float) -> word { + sub toscreeny(float y, float z) -> word { return fintw(y/(4.2+z) * flt(height)) + height // 2 } diff --git a/compiler/examples/cube3d.p8 b/compiler/examples/cube3d.p8 index 52e9e2f15..4171a16bc 100644 --- a/compiler/examples/cube3d.p8 +++ b/compiler/examples/cube3d.p8 @@ -31,7 +31,7 @@ float[len(zcoor)] rotatedz sub start() { - while(1) { + while true { if irq.time_changed { irq.time_changed = 0 vm_gfx_clearscr(0) @@ -48,7 +48,7 @@ } } - sub rotate_vertices(t: float) { + sub rotate_vertices(float t) { ; rotate around origin (0,0,0) ; set up the 3d rotation matrix values @@ -79,11 +79,11 @@ sub draw_edges() { - sub toscreenx(x: float, z: float) -> word { + sub toscreenx(float x, float z) -> word { return fintw(x/(4.2+z) * flt(height)) + width // 2 } - sub toscreeny(y: float, z: float) -> word { + sub toscreeny(float y, float z) -> word { return fintw(y/(4.2+z) * flt(height)) + height // 2 } diff --git a/compiler/examples/mandelbrot-c64.p8 b/compiler/examples/mandelbrot-c64.p8 index 6a987a4f0..63cdca32d 100644 --- a/compiler/examples/mandelbrot-c64.p8 +++ b/compiler/examples/mandelbrot-c64.p8 @@ -4,15 +4,20 @@ ~ main { const uword width = 30 const uword height = 20 + const ubyte max_iter = 16 sub start() { c64scr.print_string("calculating mandelbrot fractal...\n") + c64.TIME_HI=0 + c64.TIME_MID=0 + c64.TIME_LO=0 + for ubyte pixely in 0 to height-1 { - float yy = pixely/flt(height)/0.4-1.0 + float yy = flt(pixely)/height/0.4-1.0 for ubyte pixelx in 0 to width-1 { - float xx = pixelx/flt(width)/0.3-2.0 + float xx = flt(pixelx)/width/0.3-2.0 float xsquared = 0.0 float ysquared = 0.0 @@ -20,7 +25,7 @@ float y = 0.0 ubyte iter = 0 - while (iter<16 and xsquared+ysquared<4.0) { + while (iter ubyte { - return b2ub(fintb(x * flt(width)/4.2) + width//2) + sub screenx(float x) -> ubyte { + return b2ub(fintb(x * flt(width)/2.2) + width//2) } - sub screeny(y: float) -> ubyte { - return b2ub(fintb(y * flt(height)/4.2) + height//2) + sub screeny(float y) -> ubyte { + return b2ub(fintb(y * flt(height)/2.2) + height//2) } } diff --git a/compiler/examples/swirl.p8 b/compiler/examples/swirl.p8 index eb7a61ce0..2f6aa97dc 100644 --- a/compiler/examples/swirl.p8 +++ b/compiler/examples/swirl.p8 @@ -13,7 +13,7 @@ float t ubyte color - while(1) { + while true { float x = sin(t*1.01) + cos(t*1.1234) float y = cos(t) + sin(t*0.03456) vm_gfx_pixel(screenx(x), screeny(y), color//16) @@ -22,10 +22,10 @@ } } - sub screenx(x: float) -> word { + sub screenx(float x) -> word { return fintw(x * flt(width)/4.1) + width // 2 } - sub screeny(y: float) -> word { + sub screeny(float y) -> word { return fintw(y * flt(height)/4.1) + height // 2 } } diff --git a/compiler/examples/test.p8 b/compiler/examples/test.p8 index b2329d89c..544278a31 100644 --- a/compiler/examples/test.p8 +++ b/compiler/examples/test.p8 @@ -1,17 +1,53 @@ %import c64utils +%import mathlib %option enable_floats ~ main { + c64.TIME_HI=1 ; @todo WARNING about 'free' statements in main + c64.TIME_MID=0 + c64.TIME_LO=0 + + ;c64scr.PLOT(screenx(x), screeny(y)) ; @todo fix argument calculation???!!! + + sub toscreenx(float x, float z) -> word { + return 42 + } + + asmsub blerp(ubyte x @ A, uword ding @ XY) -> clobbers() -> () { + + } + sub start() { - word[3] wa = [-1000.w,2000.w,3000.w] ; @todo array data type fix (float->word) - word[3] wa2 = [1000,2000,3000] ; @todo array data type fix (uword->word) + word x = toscreenx(1.22, 3.22) + blerp(4, 555) - byte[3] ba1 = [-1, 2, 3] - byte[3] ba2 = [100,101,102] ; @todo array data type - ;return b2ub(fintb(x * flt(width)/4.2) + width//2) +; const byte width=20 +; word w1 +; byte b1 +; ubyte ub1 +; float x = 3.45 +; b1 = fintb(x * flt(width)/4.2) + width//2 +; c64scr.print_byte(b1) +; c64.CHROUT('\n') +; b1 = fintb(x/4.2 * flt(width)) + width//2 +; c64scr.print_byte(b1) +; c64.CHROUT('\n') +; ub1 = b2ub(fintb(x * flt(width)/4.2) + width//2) +; c64scr.print_ubyte(ub1) +; c64.CHROUT('\n') +; ub1 = b2ub(fintb(x/4.2 * flt(width)) + width//2) +; c64scr.print_ubyte(ub1) +; c64.CHROUT('\n') +; w1 = fintw(x * flt(width)/4.2) + width//2 +; c64scr.print_word(w1) +; c64.CHROUT('\n') +; w1 = fintw(x/4.2 * flt(width)) + width//2 +; c64scr.print_word(w1) +; c64.CHROUT('\n') + ;uw1 = w2uw(fintw(x * flt(width)/4.2) + width//2) ; @todo w2uw } } diff --git a/compiler/examples/test_maxmin.p8 b/compiler/examples/test_maxmin.p8 new file mode 100644 index 000000000..11cb5c2e4 --- /dev/null +++ b/compiler/examples/test_maxmin.p8 @@ -0,0 +1,95 @@ +%import c64utils +%option enable_floats + +~ main { + + sub start() { + + ubyte ub1 + ubyte ub2 + byte b1 = -99 + byte b2 + uword uw1 + uword uw2 + word w1 = -9999 + word w2 + float f1 + float f2 + float f3 + + ubyte[3] uba = [1,2,3] + byte[3] ba = [-1,0,3] + uword[3] uwa = [1000,200,0] + ubyte[3] uba0 = 0 + byte[3] ba0 = 0 + uword[3] uwa0 = 0 + word[3] wa0 = -222 + word[3] wa1 = [-1000.w,2000.w,3000.w] + word[3] wa2 = [1000,2000,3000] + float[3] fa0 = 0.0 + float[3] fa1 = [-1000,44.555, 99.999] + float[3] fa2 = [-1000,44.555, 0] + str string = "hello" + str_p pstring = "hello1" + str_s sstring = "hello12" + str_ps psstring = "hello123" + + c64.CHROUT('x') + c64scr.print_ubyte(X) + c64.CHROUT('\n') + + ; @todo implement max and min, AND FIX STACKPTR (X) ERRORS! + + ub1 = max(uba) + c64scr.print_ubyte(ub1) + c64.CHROUT('\n') + b1 = max(ba) + c64scr.print_byte(b1) + c64.CHROUT('\n') + uw1 = max(uwa) + c64scr.print_uword(uw1) + c64.CHROUT('\n') + w1 = max(wa0) + c64scr.print_word(w1) + c64.CHROUT('\n') + w1 = max(wa1) + c64scr.print_word(w1) + c64.CHROUT('\n') + w1 = max(wa2) + c64scr.print_word(w1) + c64.CHROUT('\n') + f1 = max(fa1) + c64flt.print_float(f1) + c64.CHROUT('\n') + c64.CHROUT('x') + c64scr.print_ubyte(X) + c64.CHROUT('\n') + + ub1 = min(uba) + c64scr.print_ubyte(ub1) + c64.CHROUT('\n') + b1 = min(ba) + c64scr.print_byte(b1) + c64.CHROUT('\n') + uw1 = min(uwa) + c64scr.print_uword(uw1) + c64.CHROUT('\n') + w1 = min(wa0) + c64scr.print_word(w1) + c64.CHROUT('\n') + w1 = min(wa1) + c64scr.print_word(w1) + c64.CHROUT('\n') + w1 = min(wa2) + c64scr.print_word(w1) + c64.CHROUT('\n') + f1 = min(fa1) + c64flt.print_float(f1) + c64.CHROUT('\n') + c64.CHROUT('x') + c64scr.print_ubyte(X) + c64.CHROUT('\n') + + } +} + diff --git a/compiler/src/prog8/ast/AST.kt b/compiler/src/prog8/ast/AST.kt index 761df2680..2ce6d47f7 100644 --- a/compiler/src/prog8/ast/AST.kt +++ b/compiler/src/prog8/ast/AST.kt @@ -1829,7 +1829,7 @@ private fun prog8Parser.Asmsub_returnsContext.toAst(): List private fun prog8Parser.Asmsub_paramsContext.toAst(): List - = asmsub_param().map { AsmSubroutineParameter(it.identifier().text, it.datatype().toAst(), it.registerorpair()?.toAst(), it.statusregister()?.toAst(), toPosition()) } + = asmsub_param().map { AsmSubroutineParameter(it.vardecl().identifier().text, it.vardecl().datatype().toAst(), it.registerorpair()?.toAst(), it.statusregister()?.toAst(), toPosition()) } private fun prog8Parser.StatusregisterContext.toAst() = Statusflag.valueOf(text) @@ -1897,7 +1897,7 @@ private fun prog8Parser.Sub_return_partContext.toAst(): List { private fun prog8Parser.Sub_paramsContext.toAst(): List = - sub_param().map { + vardecl().map { SubroutineParameter(it.identifier().text, it.datatype().toAst(), it.toPosition()) } diff --git a/compiler/src/prog8/parser/prog8Parser.java b/compiler/src/prog8/parser/prog8Parser.java index 9da0ff69b..1c407dfda 100644 --- a/compiler/src/prog8/parser/prog8Parser.java +++ b/compiler/src/prog8/parser/prog8Parser.java @@ -49,10 +49,10 @@ public class prog8Parser extends Parser { RULE_arrayliteral = 35, RULE_stringliteral = 36, RULE_charliteral = 37, RULE_floatliteral = 38, RULE_literalvalue = 39, RULE_inlineasm = 40, RULE_subroutine = 41, RULE_sub_return_part = 42, RULE_statement_block = 43, RULE_sub_params = 44, - RULE_sub_param = 45, RULE_sub_returns = 46, RULE_asmsubroutine = 47, RULE_asmsub_address = 48, - RULE_asmsub_params = 49, RULE_asmsub_param = 50, RULE_clobber = 51, RULE_asmsub_returns = 52, - RULE_asmsub_return = 53, RULE_if_stmt = 54, RULE_else_part = 55, RULE_branch_stmt = 56, - RULE_branchcondition = 57, RULE_forloop = 58, RULE_whileloop = 59, RULE_repeatloop = 60; + RULE_sub_returns = 45, RULE_asmsubroutine = 46, RULE_asmsub_address = 47, + RULE_asmsub_params = 48, RULE_asmsub_param = 49, RULE_clobber = 50, RULE_asmsub_returns = 51, + RULE_asmsub_return = 52, RULE_if_stmt = 53, RULE_else_part = 54, RULE_branch_stmt = 55, + RULE_branchcondition = 56, RULE_forloop = 57, RULE_whileloop = 58, RULE_repeatloop = 59; public static final String[] ruleNames = { "module", "modulestatement", "block", "statement", "labeldef", "unconditionaljump", "directive", "directivearg", "vardecl", "varinitializer", "constdecl", @@ -63,10 +63,9 @@ public class prog8Parser extends Parser { "registerorpair", "statusregister", "integerliteral", "wordsuffix", "booleanliteral", "arrayliteral", "stringliteral", "charliteral", "floatliteral", "literalvalue", "inlineasm", "subroutine", "sub_return_part", "statement_block", "sub_params", - "sub_param", "sub_returns", "asmsubroutine", "asmsub_address", "asmsub_params", - "asmsub_param", "clobber", "asmsub_returns", "asmsub_return", "if_stmt", - "else_part", "branch_stmt", "branchcondition", "forloop", "whileloop", - "repeatloop" + "sub_returns", "asmsubroutine", "asmsub_address", "asmsub_params", "asmsub_param", + "clobber", "asmsub_returns", "asmsub_return", "if_stmt", "else_part", + "branch_stmt", "branchcondition", "forloop", "whileloop", "repeatloop" }; private static final String[] _LITERAL_NAMES = { @@ -172,12 +171,12 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(126); + setState(124); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__3) | (1L << T__4) | (1L << T__5) | (1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12))) != 0) || _la==EOL) { { - setState(124); + setState(122); _errHandler.sync(this); switch (_input.LA(1)) { case T__0: @@ -192,13 +191,13 @@ public class prog8Parser extends Parser { case T__11: case T__12: { - setState(122); + setState(120); modulestatement(); } break; case EOL: { - setState(123); + setState(121); match(EOL); } break; @@ -206,11 +205,11 @@ public class prog8Parser extends Parser { throw new NoViableAltException(this); } } - setState(128); + setState(126); _errHandler.sync(this); _la = _input.LA(1); } - setState(129); + setState(127); match(EOF); } } @@ -242,7 +241,7 @@ public class prog8Parser extends Parser { ModulestatementContext _localctx = new ModulestatementContext(_ctx, getState()); enterRule(_localctx, 2, RULE_modulestatement); try { - setState(133); + setState(131); _errHandler.sync(this); switch (_input.LA(1)) { case T__3: @@ -257,14 +256,14 @@ public class prog8Parser extends Parser { case T__12: enterOuterAlt(_localctx, 1); { - setState(131); + setState(129); directive(); } break; case T__0: enterOuterAlt(_localctx, 2); { - setState(132); + setState(130); block(); } break; @@ -307,23 +306,23 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(135); + setState(133); match(T__0); - setState(136); + setState(134); identifier(); - setState(138); + setState(136); _errHandler.sync(this); _la = _input.LA(1); if (((((_la - 114)) & ~0x3f) == 0 && ((1L << (_la - 114)) & ((1L << (DEC_INTEGER - 114)) | (1L << (HEX_INTEGER - 114)) | (1L << (BIN_INTEGER - 114)))) != 0)) { { - setState(137); + setState(135); integerliteral(); } } - setState(140); + setState(138); statement_block(); - setState(141); + setState(139); match(EOL); } } @@ -415,160 +414,160 @@ public class prog8Parser extends Parser { StatementContext _localctx = new StatementContext(_ctx, getState()); enterRule(_localctx, 6, RULE_statement); try { - setState(165); + setState(163); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(143); + setState(141); directive(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(144); + setState(142); varinitializer(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(145); + setState(143); vardecl(); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(146); + setState(144); constdecl(); } break; case 5: enterOuterAlt(_localctx, 5); { - setState(147); + setState(145); memoryvardecl(); } break; case 6: enterOuterAlt(_localctx, 6); { - setState(148); + setState(146); assignment(); } break; case 7: enterOuterAlt(_localctx, 7); { - setState(149); + setState(147); augassignment(); } break; case 8: enterOuterAlt(_localctx, 8); { - setState(150); + setState(148); unconditionaljump(); } break; case 9: enterOuterAlt(_localctx, 9); { - setState(151); + setState(149); postincrdecr(); } break; case 10: enterOuterAlt(_localctx, 10); { - setState(152); + setState(150); functioncall_stmt(); } break; case 11: enterOuterAlt(_localctx, 11); { - setState(153); + setState(151); if_stmt(); } break; case 12: enterOuterAlt(_localctx, 12); { - setState(154); + setState(152); branch_stmt(); } break; case 13: enterOuterAlt(_localctx, 13); { - setState(155); + setState(153); subroutine(); } break; case 14: enterOuterAlt(_localctx, 14); { - setState(156); + setState(154); asmsubroutine(); } break; case 15: enterOuterAlt(_localctx, 15); { - setState(157); + setState(155); inlineasm(); } break; case 16: enterOuterAlt(_localctx, 16); { - setState(158); + setState(156); returnstmt(); } break; case 17: enterOuterAlt(_localctx, 17); { - setState(159); + setState(157); forloop(); } break; case 18: enterOuterAlt(_localctx, 18); { - setState(160); + setState(158); whileloop(); } break; case 19: enterOuterAlt(_localctx, 19); { - setState(161); + setState(159); repeatloop(); } break; case 20: enterOuterAlt(_localctx, 20); { - setState(162); + setState(160); breakstmt(); } break; case 21: enterOuterAlt(_localctx, 21); { - setState(163); + setState(161); continuestmt(); } break; case 22: enterOuterAlt(_localctx, 22); { - setState(164); + setState(162); labeldef(); } break; @@ -601,9 +600,9 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(167); + setState(165); identifier(); - setState(168); + setState(166); match(T__1); } } @@ -640,26 +639,26 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(170); + setState(168); match(T__2); - setState(174); + setState(172); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) { case 1: { - setState(171); + setState(169); integerliteral(); } break; case 2: { - setState(172); + setState(170); identifier(); } break; case 3: { - setState(173); + setState(171); scoped_identifier(); } break; @@ -698,7 +697,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(176); + setState(174); ((DirectiveContext)_localctx).directivename = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__3) | (1L << T__4) | (1L << T__5) | (1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12))) != 0)) ) { @@ -709,17 +708,17 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(188); + setState(186); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,8,_ctx) ) { case 1: { - setState(178); + setState(176); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) { case 1: { - setState(177); + setState(175); directivearg(); } break; @@ -728,21 +727,21 @@ public class prog8Parser extends Parser { break; case 2: { - setState(180); + setState(178); directivearg(); - setState(185); + setState(183); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__13) { { { - setState(181); + setState(179); match(T__13); - setState(182); + setState(180); directivearg(); } } - setState(187); + setState(185); _errHandler.sync(this); _la = _input.LA(1); } @@ -782,20 +781,20 @@ public class prog8Parser extends Parser { DirectiveargContext _localctx = new DirectiveargContext(_ctx, getState()); enterRule(_localctx, 14, RULE_directivearg); try { - setState(193); + setState(191); _errHandler.sync(this); switch (_input.LA(1)) { case STRING: enterOuterAlt(_localctx, 1); { - setState(190); + setState(188); stringliteral(); } break; case NAME: enterOuterAlt(_localctx, 2); { - setState(191); + setState(189); identifier(); } break; @@ -804,7 +803,7 @@ public class prog8Parser extends Parser { case BIN_INTEGER: enterOuterAlt(_localctx, 3); { - setState(192); + setState(190); integerliteral(); } break; @@ -846,19 +845,19 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(195); + setState(193); datatype(); - setState(197); + setState(195); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__26) { { - setState(196); + setState(194); arrayspec(); } } - setState(199); + setState(197); identifier(); } } @@ -899,23 +898,23 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(201); + setState(199); datatype(); - setState(203); + setState(201); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__26) { { - setState(202); + setState(200); arrayspec(); } } - setState(205); + setState(203); identifier(); - setState(206); + setState(204); match(T__14); - setState(207); + setState(205); expression(0); } } @@ -946,9 +945,9 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(209); + setState(207); match(T__15); - setState(210); + setState(208); varinitializer(); } } @@ -979,9 +978,9 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(212); + setState(210); match(T__16); - setState(213); + setState(211); varinitializer(); } } @@ -1010,7 +1009,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(215); + setState(213); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25))) != 0)) ) { _errHandler.recoverInline(this); @@ -1049,11 +1048,11 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(217); + setState(215); match(T__26); - setState(218); + setState(216); expression(0); - setState(219); + setState(217); match(T__27); } } @@ -1087,11 +1086,11 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(221); + setState(219); assign_targets(); - setState(222); + setState(220); match(T__14); - setState(223); + setState(221); expression(0); } } @@ -1126,21 +1125,21 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(225); + setState(223); assign_target(); - setState(230); + setState(228); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__13) { { { - setState(226); + setState(224); match(T__13); - setState(227); + setState(225); assign_target(); } } - setState(232); + setState(230); _errHandler.sync(this); _la = _input.LA(1); } @@ -1178,9 +1177,9 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(233); + setState(231); assign_target(); - setState(234); + setState(232); ((AugassignmentContext)_localctx).operator = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << T__31) | (1L << T__32) | (1L << T__33) | (1L << T__34) | (1L << T__35) | (1L << T__36) | (1L << T__37))) != 0)) ) { @@ -1191,7 +1190,7 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(235); + setState(233); expression(0); } } @@ -1229,34 +1228,34 @@ public class prog8Parser extends Parser { Assign_targetContext _localctx = new Assign_targetContext(_ctx, getState()); enterRule(_localctx, 34, RULE_assign_target); try { - setState(241); + setState(239); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,13,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(237); + setState(235); register(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(238); + setState(236); identifier(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(239); + setState(237); scoped_identifier(); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(240); + setState(238); arrayindexed(); } break; @@ -1291,9 +1290,9 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(243); + setState(241); assign_target(); - setState(244); + setState(242); ((PostincrdecrContext)_localctx).operator = _input.LT(1); _la = _input.LA(1); if ( !(_la==T__38 || _la==T__39) ) { @@ -1371,28 +1370,28 @@ public class prog8Parser extends Parser { int _alt; enterOuterAlt(_localctx, 1); { - setState(261); + setState(259); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,14,_ctx) ) { case 1: { - setState(247); + setState(245); match(T__40); - setState(248); + setState(246); expression(0); - setState(249); + setState(247); match(T__41); } break; case 2: { - setState(251); + setState(249); functioncall(); } break; case 3: { - setState(252); + setState(250); ((ExpressionContext)_localctx).prefix = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__42) | (1L << T__43))) != 0)) ) { @@ -1403,51 +1402,51 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(253); + setState(251); expression(19); } break; case 4: { - setState(254); + setState(252); ((ExpressionContext)_localctx).prefix = match(T__63); - setState(255); + setState(253); expression(6); } break; case 5: { - setState(256); + setState(254); literalvalue(); } break; case 6: { - setState(257); + setState(255); register(); } break; case 7: { - setState(258); + setState(256); identifier(); } break; case 8: { - setState(259); + setState(257); scoped_identifier(); } break; case 9: { - setState(260); + setState(258); arrayindexed(); } break; } _ctx.stop = _input.LT(-1); - setState(305); + setState(303); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,17,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -1455,7 +1454,7 @@ public class prog8Parser extends Parser { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(303); + setState(301); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) { case 1: @@ -1464,11 +1463,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(263); + setState(261); if (!(precpred(_ctx, 18))) throw new FailedPredicateException(this, "precpred(_ctx, 18)"); - setState(264); + setState(262); ((ExpressionContext)_localctx).bop = match(T__44); - setState(265); + setState(263); ((ExpressionContext)_localctx).right = expression(19); } break; @@ -1478,9 +1477,9 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(266); + setState(264); if (!(precpred(_ctx, 17))) throw new FailedPredicateException(this, "precpred(_ctx, 17)"); - setState(267); + setState(265); ((ExpressionContext)_localctx).bop = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__45) | (1L << T__46) | (1L << T__47) | (1L << T__48))) != 0)) ) { @@ -1491,7 +1490,7 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(268); + setState(266); ((ExpressionContext)_localctx).right = expression(18); } break; @@ -1501,9 +1500,9 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(269); + setState(267); if (!(precpred(_ctx, 16))) throw new FailedPredicateException(this, "precpred(_ctx, 16)"); - setState(270); + setState(268); ((ExpressionContext)_localctx).bop = _input.LT(1); _la = _input.LA(1); if ( !(_la==T__42 || _la==T__43) ) { @@ -1514,7 +1513,7 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(271); + setState(269); ((ExpressionContext)_localctx).right = expression(17); } break; @@ -1524,9 +1523,9 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(272); + setState(270); if (!(precpred(_ctx, 15))) throw new FailedPredicateException(this, "precpred(_ctx, 15)"); - setState(273); + setState(271); ((ExpressionContext)_localctx).bop = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__49) | (1L << T__50) | (1L << T__51) | (1L << T__52))) != 0)) ) { @@ -1537,7 +1536,7 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(274); + setState(272); ((ExpressionContext)_localctx).right = expression(16); } break; @@ -1547,9 +1546,9 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(275); + setState(273); if (!(precpred(_ctx, 14))) throw new FailedPredicateException(this, "precpred(_ctx, 14)"); - setState(276); + setState(274); ((ExpressionContext)_localctx).bop = _input.LT(1); _la = _input.LA(1); if ( !(_la==T__53 || _la==T__54) ) { @@ -1560,7 +1559,7 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(277); + setState(275); ((ExpressionContext)_localctx).right = expression(15); } break; @@ -1570,11 +1569,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(278); + setState(276); if (!(precpred(_ctx, 13))) throw new FailedPredicateException(this, "precpred(_ctx, 13)"); - setState(279); + setState(277); ((ExpressionContext)_localctx).bop = match(T__55); - setState(280); + setState(278); ((ExpressionContext)_localctx).right = expression(14); } break; @@ -1584,11 +1583,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(281); + setState(279); if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)"); - setState(282); + setState(280); ((ExpressionContext)_localctx).bop = match(T__56); - setState(283); + setState(281); ((ExpressionContext)_localctx).right = expression(13); } break; @@ -1598,11 +1597,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(284); + setState(282); if (!(precpred(_ctx, 11))) throw new FailedPredicateException(this, "precpred(_ctx, 11)"); - setState(285); + setState(283); ((ExpressionContext)_localctx).bop = match(T__57); - setState(286); + setState(284); ((ExpressionContext)_localctx).right = expression(12); } break; @@ -1612,11 +1611,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(287); + setState(285); if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); - setState(288); + setState(286); ((ExpressionContext)_localctx).bop = match(T__60); - setState(289); + setState(287); ((ExpressionContext)_localctx).right = expression(10); } break; @@ -1626,11 +1625,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(290); + setState(288); if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); - setState(291); + setState(289); ((ExpressionContext)_localctx).bop = match(T__61); - setState(292); + setState(290); ((ExpressionContext)_localctx).right = expression(9); } break; @@ -1640,11 +1639,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(293); + setState(291); if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); - setState(294); + setState(292); ((ExpressionContext)_localctx).bop = match(T__62); - setState(295); + setState(293); ((ExpressionContext)_localctx).right = expression(8); } break; @@ -1654,20 +1653,20 @@ public class prog8Parser extends Parser { _localctx.rangefrom = _prevctx; _localctx.rangefrom = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(296); + setState(294); if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); - setState(297); + setState(295); match(T__58); - setState(298); + setState(296); ((ExpressionContext)_localctx).rangeto = expression(0); - setState(301); + setState(299); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) { case 1: { - setState(299); + setState(297); match(T__59); - setState(300); + setState(298); ((ExpressionContext)_localctx).rangestep = expression(0); } break; @@ -1677,7 +1676,7 @@ public class prog8Parser extends Parser { } } } - setState(307); + setState(305); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,17,_ctx); } @@ -1716,23 +1715,23 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(310); + setState(308); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { case 1: { - setState(308); + setState(306); identifier(); } break; case 2: { - setState(309); + setState(307); scoped_identifier(); } break; } - setState(312); + setState(310); arrayspec(); } } @@ -1770,35 +1769,35 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(316); + setState(314); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) { case 1: { - setState(314); + setState(312); identifier(); } break; case 2: { - setState(315); + setState(313); scoped_identifier(); } break; } - setState(318); + setState(316); match(T__40); - setState(320); + setState(318); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__26) | (1L << T__40) | (1L << T__42) | (1L << T__43))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (T__63 - 64)) | (1L << (T__68 - 64)) | (1L << (T__69 - 64)) | (1L << (T__70 - 64)) | (1L << (T__79 - 64)) | (1L << (T__80 - 64)) | (1L << (NAME - 64)) | (1L << (DEC_INTEGER - 64)) | (1L << (HEX_INTEGER - 64)) | (1L << (BIN_INTEGER - 64)) | (1L << (FLOAT_NUMBER - 64)) | (1L << (STRING - 64)) | (1L << (SINGLECHAR - 64)))) != 0)) { { - setState(319); + setState(317); expression_list(); } } - setState(322); + setState(320); match(T__41); } } @@ -1836,35 +1835,35 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(326); + setState(324); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) { case 1: { - setState(324); + setState(322); identifier(); } break; case 2: { - setState(325); + setState(323); scoped_identifier(); } break; } - setState(328); + setState(326); match(T__40); - setState(330); + setState(328); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__26) | (1L << T__40) | (1L << T__42) | (1L << T__43))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (T__63 - 64)) | (1L << (T__68 - 64)) | (1L << (T__69 - 64)) | (1L << (T__70 - 64)) | (1L << (T__79 - 64)) | (1L << (T__80 - 64)) | (1L << (NAME - 64)) | (1L << (DEC_INTEGER - 64)) | (1L << (HEX_INTEGER - 64)) | (1L << (BIN_INTEGER - 64)) | (1L << (FLOAT_NUMBER - 64)) | (1L << (STRING - 64)) | (1L << (SINGLECHAR - 64)))) != 0)) { { - setState(329); + setState(327); expression_list(); } } - setState(332); + setState(330); match(T__41); } } @@ -1903,31 +1902,31 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(334); + setState(332); expression(0); - setState(342); + setState(340); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__13) { { { - setState(335); + setState(333); match(T__13); - setState(337); + setState(335); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(336); + setState(334); match(EOL); } } - setState(339); + setState(337); expression(0); } } - setState(344); + setState(342); _errHandler.sync(this); _la = _input.LA(1); } @@ -1960,14 +1959,14 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(345); + setState(343); match(T__64); - setState(347); + setState(345); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,25,_ctx) ) { case 1: { - setState(346); + setState(344); expression_list(); } break; @@ -1998,7 +1997,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(349); + setState(347); match(T__65); } } @@ -2026,7 +2025,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(351); + setState(349); match(T__66); } } @@ -2055,7 +2054,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(353); + setState(351); match(NAME); } } @@ -2088,9 +2087,9 @@ public class prog8Parser extends Parser { int _alt; enterOuterAlt(_localctx, 1); { - setState(355); + setState(353); match(NAME); - setState(358); + setState(356); _errHandler.sync(this); _alt = 1; do { @@ -2098,9 +2097,9 @@ public class prog8Parser extends Parser { case 1: { { - setState(356); + setState(354); match(T__67); - setState(357); + setState(355); match(NAME); } } @@ -2108,7 +2107,7 @@ public class prog8Parser extends Parser { default: throw new NoViableAltException(this); } - setState(360); + setState(358); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,26,_ctx); } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); @@ -2139,7 +2138,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(362); + setState(360); _la = _input.LA(1); if ( !(((((_la - 69)) & ~0x3f) == 0 && ((1L << (_la - 69)) & ((1L << (T__68 - 69)) | (1L << (T__69 - 69)) | (1L << (T__70 - 69)))) != 0)) ) { _errHandler.recoverInline(this); @@ -2176,7 +2175,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(364); + setState(362); _la = _input.LA(1); if ( !(((((_la - 69)) & ~0x3f) == 0 && ((1L << (_la - 69)) & ((1L << (T__68 - 69)) | (1L << (T__69 - 69)) | (1L << (T__70 - 69)) | (1L << (T__71 - 69)) | (1L << (T__72 - 69)) | (1L << (T__73 - 69)))) != 0)) ) { _errHandler.recoverInline(this); @@ -2213,7 +2212,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(366); + setState(364); _la = _input.LA(1); if ( !(((((_la - 75)) & ~0x3f) == 0 && ((1L << (_la - 75)) & ((1L << (T__74 - 75)) | (1L << (T__75 - 75)) | (1L << (T__76 - 75)) | (1L << (T__77 - 75)))) != 0)) ) { _errHandler.recoverInline(this); @@ -2257,7 +2256,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(368); + setState(366); ((IntegerliteralContext)_localctx).intpart = _input.LT(1); _la = _input.LA(1); if ( !(((((_la - 114)) & ~0x3f) == 0 && ((1L << (_la - 114)) & ((1L << (DEC_INTEGER - 114)) | (1L << (HEX_INTEGER - 114)) | (1L << (BIN_INTEGER - 114)))) != 0)) ) { @@ -2268,12 +2267,12 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(370); + setState(368); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) { case 1: { - setState(369); + setState(367); wordsuffix(); } break; @@ -2304,7 +2303,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(372); + setState(370); match(T__78); } } @@ -2333,7 +2332,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(374); + setState(372); _la = _input.LA(1); if ( !(_la==T__79 || _la==T__80) ) { _errHandler.recoverInline(this); @@ -2380,57 +2379,57 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(376); + setState(374); match(T__26); - setState(378); + setState(376); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(377); + setState(375); match(EOL); } } - setState(380); + setState(378); expression(0); - setState(388); + setState(386); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__13) { { { - setState(381); + setState(379); match(T__13); - setState(383); + setState(381); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(382); + setState(380); match(EOL); } } - setState(385); + setState(383); expression(0); } } - setState(390); + setState(388); _errHandler.sync(this); _la = _input.LA(1); } - setState(392); + setState(390); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(391); + setState(389); match(EOL); } } - setState(394); + setState(392); match(T__27); } } @@ -2459,7 +2458,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(396); + setState(394); match(STRING); } } @@ -2488,7 +2487,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(398); + setState(396); match(SINGLECHAR); } } @@ -2517,7 +2516,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(400); + setState(398); match(FLOAT_NUMBER); } } @@ -2561,7 +2560,7 @@ public class prog8Parser extends Parser { LiteralvalueContext _localctx = new LiteralvalueContext(_ctx, getState()); enterRule(_localctx, 78, RULE_literalvalue); try { - setState(408); + setState(406); _errHandler.sync(this); switch (_input.LA(1)) { case DEC_INTEGER: @@ -2569,7 +2568,7 @@ public class prog8Parser extends Parser { case BIN_INTEGER: enterOuterAlt(_localctx, 1); { - setState(402); + setState(400); integerliteral(); } break; @@ -2577,35 +2576,35 @@ public class prog8Parser extends Parser { case T__80: enterOuterAlt(_localctx, 2); { - setState(403); + setState(401); booleanliteral(); } break; case T__26: enterOuterAlt(_localctx, 3); { - setState(404); + setState(402); arrayliteral(); } break; case STRING: enterOuterAlt(_localctx, 4); { - setState(405); + setState(403); stringliteral(); } break; case SINGLECHAR: enterOuterAlt(_localctx, 5); { - setState(406); + setState(404); charliteral(); } break; case FLOAT_NUMBER: enterOuterAlt(_localctx, 6); { - setState(407); + setState(405); floatliteral(); } break; @@ -2638,9 +2637,9 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(410); + setState(408); match(T__81); - setState(411); + setState(409); match(INLINEASMBLOCK); } } @@ -2682,38 +2681,38 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(413); + setState(411); match(T__82); - setState(414); + setState(412); identifier(); - setState(415); + setState(413); match(T__40); - setState(417); + setState(415); _errHandler.sync(this); _la = _input.LA(1); - if (_la==NAME) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25))) != 0)) { { - setState(416); + setState(414); sub_params(); } } - setState(419); + setState(417); match(T__41); - setState(421); + setState(419); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__83) { { - setState(420); + setState(418); sub_return_part(); } } { - setState(423); + setState(421); statement_block(); - setState(424); + setState(422); match(EOL); } } @@ -2745,9 +2744,9 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(426); + setState(424); match(T__83); - setState(427); + setState(425); sub_returns(); } } @@ -2786,16 +2785,16 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(429); + setState(427); match(T__84); - setState(430); + setState(428); match(EOL); - setState(435); + setState(433); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__2) | (1L << T__3) | (1L << T__4) | (1L << T__5) | (1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << T__15) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (T__64 - 65)) | (1L << (T__65 - 65)) | (1L << (T__66 - 65)) | (1L << (T__68 - 65)) | (1L << (T__69 - 65)) | (1L << (T__70 - 65)) | (1L << (T__81 - 65)) | (1L << (T__82 - 65)) | (1L << (T__86 - 65)) | (1L << (T__89 - 65)) | (1L << (T__91 - 65)) | (1L << (T__92 - 65)) | (1L << (T__93 - 65)) | (1L << (T__94 - 65)) | (1L << (T__95 - 65)) | (1L << (T__96 - 65)) | (1L << (T__97 - 65)) | (1L << (T__98 - 65)) | (1L << (T__99 - 65)) | (1L << (T__100 - 65)) | (1L << (T__101 - 65)) | (1L << (T__102 - 65)) | (1L << (T__103 - 65)) | (1L << (T__105 - 65)) | (1L << (T__106 - 65)) | (1L << (EOL - 65)) | (1L << (NAME - 65)))) != 0)) { { - setState(433); + setState(431); _errHandler.sync(this); switch (_input.LA(1)) { case T__2: @@ -2847,13 +2846,13 @@ public class prog8Parser extends Parser { case T__106: case NAME: { - setState(431); + setState(429); statement(); } break; case EOL: { - setState(432); + setState(430); match(EOL); } break; @@ -2861,11 +2860,11 @@ public class prog8Parser extends Parser { throw new NoViableAltException(this); } } - setState(437); + setState(435); _errHandler.sync(this); _la = _input.LA(1); } - setState(438); + setState(436); match(T__85); } } @@ -2881,11 +2880,11 @@ public class prog8Parser extends Parser { } public static class Sub_paramsContext extends ParserRuleContext { - public List sub_param() { - return getRuleContexts(Sub_paramContext.class); + public List vardecl() { + return getRuleContexts(VardeclContext.class); } - public Sub_paramContext sub_param(int i) { - return getRuleContext(Sub_paramContext.class,i); + public VardeclContext vardecl(int i) { + return getRuleContext(VardeclContext.class,i); } public List EOL() { return getTokens(prog8Parser.EOL); } public TerminalNode EOL(int i) { @@ -2904,31 +2903,31 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(440); - sub_param(); - setState(448); + setState(438); + vardecl(); + setState(446); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__13) { { { - setState(441); + setState(439); match(T__13); - setState(443); + setState(441); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(442); + setState(440); match(EOL); } } - setState(445); - sub_param(); + setState(443); + vardecl(); } } - setState(450); + setState(448); _errHandler.sync(this); _la = _input.LA(1); } @@ -2945,44 +2944,6 @@ public class prog8Parser extends Parser { return _localctx; } - public static class Sub_paramContext extends ParserRuleContext { - public IdentifierContext identifier() { - return getRuleContext(IdentifierContext.class,0); - } - public DatatypeContext datatype() { - return getRuleContext(DatatypeContext.class,0); - } - public Sub_paramContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_sub_param; } - } - - public final Sub_paramContext sub_param() throws RecognitionException { - Sub_paramContext _localctx = new Sub_paramContext(_ctx, getState()); - enterRule(_localctx, 90, RULE_sub_param); - try { - enterOuterAlt(_localctx, 1); - { - setState(451); - identifier(); - setState(452); - match(T__1); - setState(453); - datatype(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - public static class Sub_returnsContext extends ParserRuleContext { public List datatype() { return getRuleContexts(DatatypeContext.class); @@ -3002,36 +2963,36 @@ public class prog8Parser extends Parser { public final Sub_returnsContext sub_returns() throws RecognitionException { Sub_returnsContext _localctx = new Sub_returnsContext(_ctx, getState()); - enterRule(_localctx, 92, RULE_sub_returns); + enterRule(_localctx, 90, RULE_sub_returns); int _la; try { enterOuterAlt(_localctx, 1); { - setState(455); + setState(449); datatype(); - setState(463); + setState(457); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__13) { { { - setState(456); + setState(450); match(T__13); - setState(458); + setState(452); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(457); + setState(451); match(EOL); } } - setState(460); + setState(454); datatype(); } } - setState(465); + setState(459); _errHandler.sync(this); _la = _input.LA(1); } @@ -3075,75 +3036,75 @@ public class prog8Parser extends Parser { public final AsmsubroutineContext asmsubroutine() throws RecognitionException { AsmsubroutineContext _localctx = new AsmsubroutineContext(_ctx, getState()); - enterRule(_localctx, 94, RULE_asmsubroutine); + enterRule(_localctx, 92, RULE_asmsubroutine); int _la; try { enterOuterAlt(_localctx, 1); { - setState(466); + setState(460); match(T__86); - setState(467); + setState(461); identifier(); - setState(468); + setState(462); match(T__40); - setState(470); + setState(464); _errHandler.sync(this); _la = _input.LA(1); - if (_la==NAME) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25))) != 0)) { { - setState(469); + setState(463); asmsub_params(); } } - setState(472); + setState(466); match(T__41); - setState(473); + setState(467); match(T__83); - setState(474); + setState(468); match(T__87); + setState(469); + match(T__40); + setState(471); + _errHandler.sync(this); + _la = _input.LA(1); + if (((((_la - 69)) & ~0x3f) == 0 && ((1L << (_la - 69)) & ((1L << (T__68 - 69)) | (1L << (T__69 - 69)) | (1L << (T__70 - 69)))) != 0)) { + { + setState(470); + clobber(); + } + } + + setState(473); + match(T__41); + setState(474); + match(T__83); setState(475); match(T__40); setState(477); _errHandler.sync(this); _la = _input.LA(1); - if (((((_la - 69)) & ~0x3f) == 0 && ((1L << (_la - 69)) & ((1L << (T__68 - 69)) | (1L << (T__69 - 69)) | (1L << (T__70 - 69)))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25))) != 0)) { { setState(476); - clobber(); + asmsub_returns(); } } setState(479); match(T__41); - setState(480); - match(T__83); - setState(481); - match(T__40); - setState(483); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25))) != 0)) { - { - setState(482); - asmsub_returns(); - } - } - - setState(485); - match(T__41); - setState(488); + setState(482); _errHandler.sync(this); switch (_input.LA(1)) { case T__14: { - setState(486); + setState(480); asmsub_address(); } break; case T__84: { - setState(487); + setState(481); statement_block(); } break; @@ -3176,13 +3137,13 @@ public class prog8Parser extends Parser { public final Asmsub_addressContext asmsub_address() throws RecognitionException { Asmsub_addressContext _localctx = new Asmsub_addressContext(_ctx, getState()); - enterRule(_localctx, 96, RULE_asmsub_address); + enterRule(_localctx, 94, RULE_asmsub_address); try { enterOuterAlt(_localctx, 1); { - setState(490); + setState(484); match(T__14); - setState(491); + setState(485); ((Asmsub_addressContext)_localctx).address = integerliteral(); } } @@ -3216,36 +3177,36 @@ public class prog8Parser extends Parser { public final Asmsub_paramsContext asmsub_params() throws RecognitionException { Asmsub_paramsContext _localctx = new Asmsub_paramsContext(_ctx, getState()); - enterRule(_localctx, 98, RULE_asmsub_params); + enterRule(_localctx, 96, RULE_asmsub_params); int _la; try { enterOuterAlt(_localctx, 1); { - setState(493); + setState(487); asmsub_param(); - setState(501); + setState(495); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__13) { { { - setState(494); + setState(488); match(T__13); - setState(496); + setState(490); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(495); + setState(489); match(EOL); } } - setState(498); + setState(492); asmsub_param(); } } - setState(503); + setState(497); _errHandler.sync(this); _la = _input.LA(1); } @@ -3263,11 +3224,8 @@ public class prog8Parser extends Parser { } public static class Asmsub_paramContext extends ParserRuleContext { - public IdentifierContext identifier() { - return getRuleContext(IdentifierContext.class,0); - } - public DatatypeContext datatype() { - return getRuleContext(DatatypeContext.class,0); + public VardeclContext vardecl() { + return getRuleContext(VardeclContext.class,0); } public RegisterorpairContext registerorpair() { return getRuleContext(RegisterorpairContext.class,0); @@ -3283,19 +3241,15 @@ public class prog8Parser extends Parser { public final Asmsub_paramContext asmsub_param() throws RecognitionException { Asmsub_paramContext _localctx = new Asmsub_paramContext(_ctx, getState()); - enterRule(_localctx, 100, RULE_asmsub_param); + enterRule(_localctx, 98, RULE_asmsub_param); try { enterOuterAlt(_localctx, 1); { - setState(504); - identifier(); - setState(505); - match(T__1); - setState(506); - datatype(); - setState(507); + setState(498); + vardecl(); + setState(499); match(T__88); - setState(510); + setState(502); _errHandler.sync(this); switch (_input.LA(1)) { case T__68: @@ -3305,7 +3259,7 @@ public class prog8Parser extends Parser { case T__72: case T__73: { - setState(508); + setState(500); registerorpair(); } break; @@ -3314,7 +3268,7 @@ public class prog8Parser extends Parser { case T__76: case T__77: { - setState(509); + setState(501); statusregister(); } break; @@ -3349,26 +3303,26 @@ public class prog8Parser extends Parser { public final ClobberContext clobber() throws RecognitionException { ClobberContext _localctx = new ClobberContext(_ctx, getState()); - enterRule(_localctx, 102, RULE_clobber); + enterRule(_localctx, 100, RULE_clobber); int _la; try { enterOuterAlt(_localctx, 1); { - setState(512); + setState(504); register(); - setState(517); + setState(509); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__13) { { { - setState(513); + setState(505); match(T__13); - setState(514); + setState(506); register(); } } - setState(519); + setState(511); _errHandler.sync(this); _la = _input.LA(1); } @@ -3404,36 +3358,36 @@ public class prog8Parser extends Parser { public final Asmsub_returnsContext asmsub_returns() throws RecognitionException { Asmsub_returnsContext _localctx = new Asmsub_returnsContext(_ctx, getState()); - enterRule(_localctx, 104, RULE_asmsub_returns); + enterRule(_localctx, 102, RULE_asmsub_returns); int _la; try { enterOuterAlt(_localctx, 1); { - setState(520); + setState(512); asmsub_return(); - setState(528); + setState(520); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__13) { { { - setState(521); + setState(513); match(T__13); - setState(523); + setState(515); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(522); + setState(514); match(EOL); } } - setState(525); + setState(517); asmsub_return(); } } - setState(530); + setState(522); _errHandler.sync(this); _la = _input.LA(1); } @@ -3468,15 +3422,15 @@ public class prog8Parser extends Parser { public final Asmsub_returnContext asmsub_return() throws RecognitionException { Asmsub_returnContext _localctx = new Asmsub_returnContext(_ctx, getState()); - enterRule(_localctx, 106, RULE_asmsub_return); + enterRule(_localctx, 104, RULE_asmsub_return); try { enterOuterAlt(_localctx, 1); { - setState(531); + setState(523); datatype(); - setState(532); + setState(524); match(T__88); - setState(535); + setState(527); _errHandler.sync(this); switch (_input.LA(1)) { case T__68: @@ -3486,7 +3440,7 @@ public class prog8Parser extends Parser { case T__72: case T__73: { - setState(533); + setState(525); registerorpair(); } break; @@ -3495,7 +3449,7 @@ public class prog8Parser extends Parser { case T__76: case T__77: { - setState(534); + setState(526); statusregister(); } break; @@ -3540,26 +3494,26 @@ public class prog8Parser extends Parser { public final If_stmtContext if_stmt() throws RecognitionException { If_stmtContext _localctx = new If_stmtContext(_ctx, getState()); - enterRule(_localctx, 108, RULE_if_stmt); + enterRule(_localctx, 106, RULE_if_stmt); int _la; try { enterOuterAlt(_localctx, 1); { - setState(537); + setState(529); match(T__89); - setState(538); + setState(530); expression(0); - setState(540); + setState(532); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(539); + setState(531); match(EOL); } } - setState(544); + setState(536); _errHandler.sync(this); switch (_input.LA(1)) { case T__2: @@ -3611,40 +3565,40 @@ public class prog8Parser extends Parser { case T__106: case NAME: { - setState(542); + setState(534); statement(); } break; case T__84: { - setState(543); + setState(535); statement_block(); } break; default: throw new NoViableAltException(this); } - setState(547); + setState(539); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,54,_ctx) ) { case 1: { - setState(546); + setState(538); match(EOL); } break; } - setState(550); + setState(542); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__90) { { - setState(549); + setState(541); else_part(); } } - setState(552); + setState(544); match(EOL); } } @@ -3675,13 +3629,133 @@ public class prog8Parser extends Parser { public final Else_partContext else_part() throws RecognitionException { Else_partContext _localctx = new Else_partContext(_ctx, getState()); - enterRule(_localctx, 110, RULE_else_part); + enterRule(_localctx, 108, RULE_else_part); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(546); + match(T__90); + setState(548); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==EOL) { + { + setState(547); + match(EOL); + } + } + + setState(552); + _errHandler.sync(this); + switch (_input.LA(1)) { + case T__2: + case T__3: + case T__4: + case T__5: + case T__6: + case T__7: + case T__8: + case T__9: + case T__10: + case T__11: + case T__12: + case T__15: + case T__16: + case T__17: + case T__18: + case T__19: + case T__20: + case T__21: + case T__22: + case T__23: + case T__24: + case T__25: + case T__64: + case T__65: + case T__66: + case T__68: + case T__69: + case T__70: + case T__81: + case T__82: + case T__86: + case T__89: + case T__91: + case T__92: + case T__93: + case T__94: + case T__95: + case T__96: + case T__97: + case T__98: + case T__99: + case T__100: + case T__101: + case T__102: + case T__103: + case T__105: + case T__106: + case NAME: + { + setState(550); + statement(); + } + break; + case T__84: + { + setState(551); + statement_block(); + } + 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 Branch_stmtContext extends ParserRuleContext { + public BranchconditionContext branchcondition() { + return getRuleContext(BranchconditionContext.class,0); + } + public List EOL() { return getTokens(prog8Parser.EOL); } + public TerminalNode EOL(int i) { + return getToken(prog8Parser.EOL, i); + } + public StatementContext statement() { + return getRuleContext(StatementContext.class,0); + } + public Statement_blockContext statement_block() { + return getRuleContext(Statement_blockContext.class,0); + } + public Else_partContext else_part() { + return getRuleContext(Else_partContext.class,0); + } + public Branch_stmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_branch_stmt; } + } + + public final Branch_stmtContext branch_stmt() throws RecognitionException { + Branch_stmtContext _localctx = new Branch_stmtContext(_ctx, getState()); + enterRule(_localctx, 110, RULE_branch_stmt); int _la; try { enterOuterAlt(_localctx, 1); { setState(554); - match(T__90); + branchcondition(); setState(556); _errHandler.sync(this); _la = _input.LA(1); @@ -3757,147 +3831,27 @@ public class prog8Parser extends Parser { 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 Branch_stmtContext extends ParserRuleContext { - public BranchconditionContext branchcondition() { - return getRuleContext(BranchconditionContext.class,0); - } - public List EOL() { return getTokens(prog8Parser.EOL); } - public TerminalNode EOL(int i) { - return getToken(prog8Parser.EOL, i); - } - public StatementContext statement() { - return getRuleContext(StatementContext.class,0); - } - public Statement_blockContext statement_block() { - return getRuleContext(Statement_blockContext.class,0); - } - public Else_partContext else_part() { - return getRuleContext(Else_partContext.class,0); - } - public Branch_stmtContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_branch_stmt; } - } - - public final Branch_stmtContext branch_stmt() throws RecognitionException { - Branch_stmtContext _localctx = new Branch_stmtContext(_ctx, getState()); - enterRule(_localctx, 112, RULE_branch_stmt); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(562); - branchcondition(); - setState(564); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==EOL) { - { - setState(563); - match(EOL); - } - } - - setState(568); - _errHandler.sync(this); - switch (_input.LA(1)) { - case T__2: - case T__3: - case T__4: - case T__5: - case T__6: - case T__7: - case T__8: - case T__9: - case T__10: - case T__11: - case T__12: - case T__15: - case T__16: - case T__17: - case T__18: - case T__19: - case T__20: - case T__21: - case T__22: - case T__23: - case T__24: - case T__25: - case T__64: - case T__65: - case T__66: - case T__68: - case T__69: - case T__70: - case T__81: - case T__82: - case T__86: - case T__89: - case T__91: - case T__92: - case T__93: - case T__94: - case T__95: - case T__96: - case T__97: - case T__98: - case T__99: - case T__100: - case T__101: - case T__102: - case T__103: - case T__105: - case T__106: - case NAME: - { - setState(566); - statement(); - } - break; - case T__84: - { - setState(567); - statement_block(); - } - break; - default: - throw new NoViableAltException(this); - } - setState(571); + setState(563); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,60,_ctx) ) { case 1: { - setState(570); + setState(562); match(EOL); } break; } - setState(574); + setState(566); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__90) { { - setState(573); + setState(565); else_part(); } } - setState(576); + setState(568); match(EOL); } } @@ -3921,12 +3875,12 @@ public class prog8Parser extends Parser { public final BranchconditionContext branchcondition() throws RecognitionException { BranchconditionContext _localctx = new BranchconditionContext(_ctx, getState()); - enterRule(_localctx, 114, RULE_branchcondition); + enterRule(_localctx, 112, RULE_branchcondition); int _la; try { enterOuterAlt(_localctx, 1); { - setState(578); + setState(570); _la = _input.LA(1); if ( !(((((_la - 92)) & ~0x3f) == 0 && ((1L << (_la - 92)) & ((1L << (T__91 - 92)) | (1L << (T__92 - 92)) | (1L << (T__93 - 92)) | (1L << (T__94 - 92)) | (1L << (T__95 - 92)) | (1L << (T__96 - 92)) | (1L << (T__97 - 92)) | (1L << (T__98 - 92)) | (1L << (T__99 - 92)) | (1L << (T__100 - 92)) | (1L << (T__101 - 92)) | (1L << (T__102 - 92)))) != 0)) ) { _errHandler.recoverInline(this); @@ -3974,58 +3928,58 @@ public class prog8Parser extends Parser { public final ForloopContext forloop() throws RecognitionException { ForloopContext _localctx = new ForloopContext(_ctx, getState()); - enterRule(_localctx, 116, RULE_forloop); + enterRule(_localctx, 114, RULE_forloop); int _la; try { enterOuterAlt(_localctx, 1); { - setState(580); + setState(572); match(T__103); - setState(582); + setState(574); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25))) != 0)) { { - setState(581); + setState(573); datatype(); } } - setState(586); + setState(578); _errHandler.sync(this); switch (_input.LA(1)) { case T__68: case T__69: case T__70: { - setState(584); + setState(576); register(); } break; case NAME: { - setState(585); + setState(577); identifier(); } break; default: throw new NoViableAltException(this); } - setState(588); + setState(580); match(T__104); - setState(589); + setState(581); expression(0); - setState(591); + setState(583); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(590); + setState(582); match(EOL); } } - setState(593); + setState(585); statement_block(); } } @@ -4059,26 +4013,26 @@ public class prog8Parser extends Parser { public final WhileloopContext whileloop() throws RecognitionException { WhileloopContext _localctx = new WhileloopContext(_ctx, getState()); - enterRule(_localctx, 118, RULE_whileloop); + enterRule(_localctx, 116, RULE_whileloop); int _la; try { enterOuterAlt(_localctx, 1); { - setState(595); + setState(587); match(T__105); - setState(596); + setState(588); expression(0); - setState(598); + setState(590); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(597); + setState(589); match(EOL); } } - setState(602); + setState(594); _errHandler.sync(this); switch (_input.LA(1)) { case T__2: @@ -4130,13 +4084,13 @@ public class prog8Parser extends Parser { case T__106: case NAME: { - setState(600); + setState(592); statement(); } break; case T__84: { - setState(601); + setState(593); statement_block(); } break; @@ -4175,14 +4129,14 @@ public class prog8Parser extends Parser { public final RepeatloopContext repeatloop() throws RecognitionException { RepeatloopContext _localctx = new RepeatloopContext(_ctx, getState()); - enterRule(_localctx, 120, RULE_repeatloop); + enterRule(_localctx, 118, RULE_repeatloop); int _la; try { enterOuterAlt(_localctx, 1); { - setState(604); + setState(596); match(T__106); - setState(607); + setState(599); _errHandler.sync(this); switch (_input.LA(1)) { case T__2: @@ -4234,32 +4188,32 @@ public class prog8Parser extends Parser { case T__106: case NAME: { - setState(605); + setState(597); statement(); } break; case T__84: { - setState(606); + setState(598); statement_block(); } break; default: throw new NoViableAltException(this); } - setState(610); + setState(602); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(609); + setState(601); match(EOL); } } - setState(612); + setState(604); match(T__107); - setState(613); + setState(605); expression(0); } } @@ -4312,7 +4266,7 @@ public class prog8Parser extends Parser { } public static final String _serializedATN = - "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3z\u026a\4\2\t\2\4"+ + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3z\u0262\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"+ @@ -4320,232 +4274,229 @@ public class prog8Parser 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\4\63\t\63\4\64\t"+ "\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+ - "\4>\t>\3\2\3\2\7\2\177\n\2\f\2\16\2\u0082\13\2\3\2\3\2\3\3\3\3\5\3\u0088"+ - "\n\3\3\4\3\4\3\4\5\4\u008d\n\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5"+ - "\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5\u00a8"+ - "\n\5\3\6\3\6\3\6\3\7\3\7\3\7\3\7\5\7\u00b1\n\7\3\b\3\b\5\b\u00b5\n\b\3"+ - "\b\3\b\3\b\7\b\u00ba\n\b\f\b\16\b\u00bd\13\b\5\b\u00bf\n\b\3\t\3\t\3\t"+ - "\5\t\u00c4\n\t\3\n\3\n\5\n\u00c8\n\n\3\n\3\n\3\13\3\13\5\13\u00ce\n\13"+ - "\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\r\3\r\3\r\3\16\3\16\3\17\3\17\3\17"+ - "\3\17\3\20\3\20\3\20\3\20\3\21\3\21\3\21\7\21\u00e7\n\21\f\21\16\21\u00ea"+ - "\13\21\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\5\23\u00f4\n\23\3\24\3"+ - "\24\3\24\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3"+ - "\25\3\25\3\25\5\25\u0108\n\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25"+ + "\3\2\3\2\7\2}\n\2\f\2\16\2\u0080\13\2\3\2\3\2\3\3\3\3\5\3\u0086\n\3\3"+ + "\4\3\4\3\4\5\4\u008b\n\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3"+ + "\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5\u00a6\n\5\3"+ + "\6\3\6\3\6\3\7\3\7\3\7\3\7\5\7\u00af\n\7\3\b\3\b\5\b\u00b3\n\b\3\b\3\b"+ + "\3\b\7\b\u00b8\n\b\f\b\16\b\u00bb\13\b\5\b\u00bd\n\b\3\t\3\t\3\t\5\t\u00c2"+ + "\n\t\3\n\3\n\5\n\u00c6\n\n\3\n\3\n\3\13\3\13\5\13\u00cc\n\13\3\13\3\13"+ + "\3\13\3\13\3\f\3\f\3\f\3\r\3\r\3\r\3\16\3\16\3\17\3\17\3\17\3\17\3\20"+ + "\3\20\3\20\3\20\3\21\3\21\3\21\7\21\u00e5\n\21\f\21\16\21\u00e8\13\21"+ + "\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\5\23\u00f2\n\23\3\24\3\24\3\24"+ + "\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25"+ + "\3\25\5\25\u0106\n\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25"+ "\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25"+ "\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25"+ - "\3\25\3\25\5\25\u0130\n\25\7\25\u0132\n\25\f\25\16\25\u0135\13\25\3\26"+ - "\3\26\5\26\u0139\n\26\3\26\3\26\3\27\3\27\5\27\u013f\n\27\3\27\3\27\5"+ - "\27\u0143\n\27\3\27\3\27\3\30\3\30\5\30\u0149\n\30\3\30\3\30\5\30\u014d"+ - "\n\30\3\30\3\30\3\31\3\31\3\31\5\31\u0154\n\31\3\31\7\31\u0157\n\31\f"+ - "\31\16\31\u015a\13\31\3\32\3\32\5\32\u015e\n\32\3\33\3\33\3\34\3\34\3"+ - "\35\3\35\3\36\3\36\3\36\6\36\u0169\n\36\r\36\16\36\u016a\3\37\3\37\3 "+ - "\3 \3!\3!\3\"\3\"\5\"\u0175\n\"\3#\3#\3$\3$\3%\3%\5%\u017d\n%\3%\3%\3"+ - "%\5%\u0182\n%\3%\7%\u0185\n%\f%\16%\u0188\13%\3%\5%\u018b\n%\3%\3%\3&"+ - "\3&\3\'\3\'\3(\3(\3)\3)\3)\3)\3)\3)\5)\u019b\n)\3*\3*\3*\3+\3+\3+\3+\5"+ - "+\u01a4\n+\3+\3+\5+\u01a8\n+\3+\3+\3+\3,\3,\3,\3-\3-\3-\3-\7-\u01b4\n"+ - "-\f-\16-\u01b7\13-\3-\3-\3.\3.\3.\5.\u01be\n.\3.\7.\u01c1\n.\f.\16.\u01c4"+ - "\13.\3/\3/\3/\3/\3\60\3\60\3\60\5\60\u01cd\n\60\3\60\7\60\u01d0\n\60\f"+ - "\60\16\60\u01d3\13\60\3\61\3\61\3\61\3\61\5\61\u01d9\n\61\3\61\3\61\3"+ - "\61\3\61\3\61\5\61\u01e0\n\61\3\61\3\61\3\61\3\61\5\61\u01e6\n\61\3\61"+ - "\3\61\3\61\5\61\u01eb\n\61\3\62\3\62\3\62\3\63\3\63\3\63\5\63\u01f3\n"+ - "\63\3\63\7\63\u01f6\n\63\f\63\16\63\u01f9\13\63\3\64\3\64\3\64\3\64\3"+ - "\64\3\64\5\64\u0201\n\64\3\65\3\65\3\65\7\65\u0206\n\65\f\65\16\65\u0209"+ - "\13\65\3\66\3\66\3\66\5\66\u020e\n\66\3\66\7\66\u0211\n\66\f\66\16\66"+ - "\u0214\13\66\3\67\3\67\3\67\3\67\5\67\u021a\n\67\38\38\38\58\u021f\n8"+ - "\38\38\58\u0223\n8\38\58\u0226\n8\38\58\u0229\n8\38\38\39\39\59\u022f"+ - "\n9\39\39\59\u0233\n9\3:\3:\5:\u0237\n:\3:\3:\5:\u023b\n:\3:\5:\u023e"+ - "\n:\3:\5:\u0241\n:\3:\3:\3;\3;\3<\3<\5<\u0249\n<\3<\3<\5<\u024d\n<\3<"+ - "\3<\3<\5<\u0252\n<\3<\3<\3=\3=\3=\5=\u0259\n=\3=\3=\5=\u025d\n=\3>\3>"+ - "\3>\5>\u0262\n>\3>\5>\u0265\n>\3>\3>\3>\3>\2\3(?\2\4\6\b\n\f\16\20\22"+ - "\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>@BDFHJLNPRTVXZ\\^`bdfhjlnp"+ - "rtvxz\2\21\3\2\6\17\3\2\24\34\3\2\37(\3\2)*\4\2\3\3-.\3\2\60\63\3\2-."+ - "\3\2\64\67\3\289\3\2GI\3\2GL\3\2MP\3\2tv\3\2RS\3\2^i\2\u029e\2\u0080\3"+ - "\2\2\2\4\u0087\3\2\2\2\6\u0089\3\2\2\2\b\u00a7\3\2\2\2\n\u00a9\3\2\2\2"+ - "\f\u00ac\3\2\2\2\16\u00b2\3\2\2\2\20\u00c3\3\2\2\2\22\u00c5\3\2\2\2\24"+ - "\u00cb\3\2\2\2\26\u00d3\3\2\2\2\30\u00d6\3\2\2\2\32\u00d9\3\2\2\2\34\u00db"+ - "\3\2\2\2\36\u00df\3\2\2\2 \u00e3\3\2\2\2\"\u00eb\3\2\2\2$\u00f3\3\2\2"+ - "\2&\u00f5\3\2\2\2(\u0107\3\2\2\2*\u0138\3\2\2\2,\u013e\3\2\2\2.\u0148"+ - "\3\2\2\2\60\u0150\3\2\2\2\62\u015b\3\2\2\2\64\u015f\3\2\2\2\66\u0161\3"+ - "\2\2\28\u0163\3\2\2\2:\u0165\3\2\2\2<\u016c\3\2\2\2>\u016e\3\2\2\2@\u0170"+ - "\3\2\2\2B\u0172\3\2\2\2D\u0176\3\2\2\2F\u0178\3\2\2\2H\u017a\3\2\2\2J"+ - "\u018e\3\2\2\2L\u0190\3\2\2\2N\u0192\3\2\2\2P\u019a\3\2\2\2R\u019c\3\2"+ - "\2\2T\u019f\3\2\2\2V\u01ac\3\2\2\2X\u01af\3\2\2\2Z\u01ba\3\2\2\2\\\u01c5"+ - "\3\2\2\2^\u01c9\3\2\2\2`\u01d4\3\2\2\2b\u01ec\3\2\2\2d\u01ef\3\2\2\2f"+ - "\u01fa\3\2\2\2h\u0202\3\2\2\2j\u020a\3\2\2\2l\u0215\3\2\2\2n\u021b\3\2"+ - "\2\2p\u022c\3\2\2\2r\u0234\3\2\2\2t\u0244\3\2\2\2v\u0246\3\2\2\2x\u0255"+ - "\3\2\2\2z\u025e\3\2\2\2|\177\5\4\3\2}\177\7r\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\u0083\3\2\2\2"+ - "\u0082\u0080\3\2\2\2\u0083\u0084\7\2\2\3\u0084\3\3\2\2\2\u0085\u0088\5"+ - "\16\b\2\u0086\u0088\5\6\4\2\u0087\u0085\3\2\2\2\u0087\u0086\3\2\2\2\u0088"+ - "\5\3\2\2\2\u0089\u008a\7\3\2\2\u008a\u008c\58\35\2\u008b\u008d\5B\"\2"+ - "\u008c\u008b\3\2\2\2\u008c\u008d\3\2\2\2\u008d\u008e\3\2\2\2\u008e\u008f"+ - "\5X-\2\u008f\u0090\7r\2\2\u0090\7\3\2\2\2\u0091\u00a8\5\16\b\2\u0092\u00a8"+ - "\5\24\13\2\u0093\u00a8\5\22\n\2\u0094\u00a8\5\26\f\2\u0095\u00a8\5\30"+ - "\r\2\u0096\u00a8\5\36\20\2\u0097\u00a8\5\"\22\2\u0098\u00a8\5\f\7\2\u0099"+ - "\u00a8\5&\24\2\u009a\u00a8\5.\30\2\u009b\u00a8\5n8\2\u009c\u00a8\5r:\2"+ - "\u009d\u00a8\5T+\2\u009e\u00a8\5`\61\2\u009f\u00a8\5R*\2\u00a0\u00a8\5"+ - "\62\32\2\u00a1\u00a8\5v<\2\u00a2\u00a8\5x=\2\u00a3\u00a8\5z>\2\u00a4\u00a8"+ - "\5\64\33\2\u00a5\u00a8\5\66\34\2\u00a6\u00a8\5\n\6\2\u00a7\u0091\3\2\2"+ - "\2\u00a7\u0092\3\2\2\2\u00a7\u0093\3\2\2\2\u00a7\u0094\3\2\2\2\u00a7\u0095"+ - "\3\2\2\2\u00a7\u0096\3\2\2\2\u00a7\u0097\3\2\2\2\u00a7\u0098\3\2\2\2\u00a7"+ - "\u0099\3\2\2\2\u00a7\u009a\3\2\2\2\u00a7\u009b\3\2\2\2\u00a7\u009c\3\2"+ - "\2\2\u00a7\u009d\3\2\2\2\u00a7\u009e\3\2\2\2\u00a7\u009f\3\2\2\2\u00a7"+ - "\u00a0\3\2\2\2\u00a7\u00a1\3\2\2\2\u00a7\u00a2\3\2\2\2\u00a7\u00a3\3\2"+ - "\2\2\u00a7\u00a4\3\2\2\2\u00a7\u00a5\3\2\2\2\u00a7\u00a6\3\2\2\2\u00a8"+ - "\t\3\2\2\2\u00a9\u00aa\58\35\2\u00aa\u00ab\7\4\2\2\u00ab\13\3\2\2\2\u00ac"+ - "\u00b0\7\5\2\2\u00ad\u00b1\5B\"\2\u00ae\u00b1\58\35\2\u00af\u00b1\5:\36"+ - "\2\u00b0\u00ad\3\2\2\2\u00b0\u00ae\3\2\2\2\u00b0\u00af\3\2\2\2\u00b1\r"+ - "\3\2\2\2\u00b2\u00be\t\2\2\2\u00b3\u00b5\5\20\t\2\u00b4\u00b3\3\2\2\2"+ - "\u00b4\u00b5\3\2\2\2\u00b5\u00bf\3\2\2\2\u00b6\u00bb\5\20\t\2\u00b7\u00b8"+ - "\7\20\2\2\u00b8\u00ba\5\20\t\2\u00b9\u00b7\3\2\2\2\u00ba\u00bd\3\2\2\2"+ - "\u00bb\u00b9\3\2\2\2\u00bb\u00bc\3\2\2\2\u00bc\u00bf\3\2\2\2\u00bd\u00bb"+ - "\3\2\2\2\u00be\u00b4\3\2\2\2\u00be\u00b6\3\2\2\2\u00bf\17\3\2\2\2\u00c0"+ - "\u00c4\5J&\2\u00c1\u00c4\58\35\2\u00c2\u00c4\5B\"\2\u00c3\u00c0\3\2\2"+ - "\2\u00c3\u00c1\3\2\2\2\u00c3\u00c2\3\2\2\2\u00c4\21\3\2\2\2\u00c5\u00c7"+ - "\5\32\16\2\u00c6\u00c8\5\34\17\2\u00c7\u00c6\3\2\2\2\u00c7\u00c8\3\2\2"+ - "\2\u00c8\u00c9\3\2\2\2\u00c9\u00ca\58\35\2\u00ca\23\3\2\2\2\u00cb\u00cd"+ - "\5\32\16\2\u00cc\u00ce\5\34\17\2\u00cd\u00cc\3\2\2\2\u00cd\u00ce\3\2\2"+ - "\2\u00ce\u00cf\3\2\2\2\u00cf\u00d0\58\35\2\u00d0\u00d1\7\21\2\2\u00d1"+ - "\u00d2\5(\25\2\u00d2\25\3\2\2\2\u00d3\u00d4\7\22\2\2\u00d4\u00d5\5\24"+ - "\13\2\u00d5\27\3\2\2\2\u00d6\u00d7\7\23\2\2\u00d7\u00d8\5\24\13\2\u00d8"+ - "\31\3\2\2\2\u00d9\u00da\t\3\2\2\u00da\33\3\2\2\2\u00db\u00dc\7\35\2\2"+ - "\u00dc\u00dd\5(\25\2\u00dd\u00de\7\36\2\2\u00de\35\3\2\2\2\u00df\u00e0"+ - "\5 \21\2\u00e0\u00e1\7\21\2\2\u00e1\u00e2\5(\25\2\u00e2\37\3\2\2\2\u00e3"+ - "\u00e8\5$\23\2\u00e4\u00e5\7\20\2\2\u00e5\u00e7\5$\23\2\u00e6\u00e4\3"+ - "\2\2\2\u00e7\u00ea\3\2\2\2\u00e8\u00e6\3\2\2\2\u00e8\u00e9\3\2\2\2\u00e9"+ - "!\3\2\2\2\u00ea\u00e8\3\2\2\2\u00eb\u00ec\5$\23\2\u00ec\u00ed\t\4\2\2"+ - "\u00ed\u00ee\5(\25\2\u00ee#\3\2\2\2\u00ef\u00f4\5<\37\2\u00f0\u00f4\5"+ - "8\35\2\u00f1\u00f4\5:\36\2\u00f2\u00f4\5*\26\2\u00f3\u00ef\3\2\2\2\u00f3"+ - "\u00f0\3\2\2\2\u00f3\u00f1\3\2\2\2\u00f3\u00f2\3\2\2\2\u00f4%\3\2\2\2"+ - "\u00f5\u00f6\5$\23\2\u00f6\u00f7\t\5\2\2\u00f7\'\3\2\2\2\u00f8\u00f9\b"+ - "\25\1\2\u00f9\u00fa\7+\2\2\u00fa\u00fb\5(\25\2\u00fb\u00fc\7,\2\2\u00fc"+ - "\u0108\3\2\2\2\u00fd\u0108\5,\27\2\u00fe\u00ff\t\6\2\2\u00ff\u0108\5("+ - "\25\25\u0100\u0101\7B\2\2\u0101\u0108\5(\25\b\u0102\u0108\5P)\2\u0103"+ - "\u0108\5<\37\2\u0104\u0108\58\35\2\u0105\u0108\5:\36\2\u0106\u0108\5*"+ - "\26\2\u0107\u00f8\3\2\2\2\u0107\u00fd\3\2\2\2\u0107\u00fe\3\2\2\2\u0107"+ - "\u0100\3\2\2\2\u0107\u0102\3\2\2\2\u0107\u0103\3\2\2\2\u0107\u0104\3\2"+ - "\2\2\u0107\u0105\3\2\2\2\u0107\u0106\3\2\2\2\u0108\u0133\3\2\2\2\u0109"+ - "\u010a\f\24\2\2\u010a\u010b\7/\2\2\u010b\u0132\5(\25\25\u010c\u010d\f"+ - "\23\2\2\u010d\u010e\t\7\2\2\u010e\u0132\5(\25\24\u010f\u0110\f\22\2\2"+ - "\u0110\u0111\t\b\2\2\u0111\u0132\5(\25\23\u0112\u0113\f\21\2\2\u0113\u0114"+ - "\t\t\2\2\u0114\u0132\5(\25\22\u0115\u0116\f\20\2\2\u0116\u0117\t\n\2\2"+ - "\u0117\u0132\5(\25\21\u0118\u0119\f\17\2\2\u0119\u011a\7:\2\2\u011a\u0132"+ - "\5(\25\20\u011b\u011c\f\16\2\2\u011c\u011d\7;\2\2\u011d\u0132\5(\25\17"+ - "\u011e\u011f\f\r\2\2\u011f\u0120\7<\2\2\u0120\u0132\5(\25\16\u0121\u0122"+ - "\f\13\2\2\u0122\u0123\7?\2\2\u0123\u0132\5(\25\f\u0124\u0125\f\n\2\2\u0125"+ - "\u0126\7@\2\2\u0126\u0132\5(\25\13\u0127\u0128\f\t\2\2\u0128\u0129\7A"+ - "\2\2\u0129\u0132\5(\25\n\u012a\u012b\f\f\2\2\u012b\u012c\7=\2\2\u012c"+ - "\u012f\5(\25\2\u012d\u012e\7>\2\2\u012e\u0130\5(\25\2\u012f\u012d\3\2"+ - "\2\2\u012f\u0130\3\2\2\2\u0130\u0132\3\2\2\2\u0131\u0109\3\2\2\2\u0131"+ - "\u010c\3\2\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\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\u0139\58\35\2\u0137\u0139\5:\36\2"+ - "\u0138\u0136\3\2\2\2\u0138\u0137\3\2\2\2\u0139\u013a\3\2\2\2\u013a\u013b"+ - "\5\34\17\2\u013b+\3\2\2\2\u013c\u013f\58\35\2\u013d\u013f\5:\36\2\u013e"+ - "\u013c\3\2\2\2\u013e\u013d\3\2\2\2\u013f\u0140\3\2\2\2\u0140\u0142\7+"+ - "\2\2\u0141\u0143\5\60\31\2\u0142\u0141\3\2\2\2\u0142\u0143\3\2\2\2\u0143"+ - "\u0144\3\2\2\2\u0144\u0145\7,\2\2\u0145-\3\2\2\2\u0146\u0149\58\35\2\u0147"+ - "\u0149\5:\36\2\u0148\u0146\3\2\2\2\u0148\u0147\3\2\2\2\u0149\u014a\3\2"+ - "\2\2\u014a\u014c\7+\2\2\u014b\u014d\5\60\31\2\u014c\u014b\3\2\2\2\u014c"+ - "\u014d\3\2\2\2\u014d\u014e\3\2\2\2\u014e\u014f\7,\2\2\u014f/\3\2\2\2\u0150"+ - "\u0158\5(\25\2\u0151\u0153\7\20\2\2\u0152\u0154\7r\2\2\u0153\u0152\3\2"+ - "\2\2\u0153\u0154\3\2\2\2\u0154\u0155\3\2\2\2\u0155\u0157\5(\25\2\u0156"+ - "\u0151\3\2\2\2\u0157\u015a\3\2\2\2\u0158\u0156\3\2\2\2\u0158\u0159\3\2"+ - "\2\2\u0159\61\3\2\2\2\u015a\u0158\3\2\2\2\u015b\u015d\7C\2\2\u015c\u015e"+ - "\5\60\31\2\u015d\u015c\3\2\2\2\u015d\u015e\3\2\2\2\u015e\63\3\2\2\2\u015f"+ - "\u0160\7D\2\2\u0160\65\3\2\2\2\u0161\u0162\7E\2\2\u0162\67\3\2\2\2\u0163"+ - "\u0164\7s\2\2\u01649\3\2\2\2\u0165\u0168\7s\2\2\u0166\u0167\7F\2\2\u0167"+ - "\u0169\7s\2\2\u0168\u0166\3\2\2\2\u0169\u016a\3\2\2\2\u016a\u0168\3\2"+ - "\2\2\u016a\u016b\3\2\2\2\u016b;\3\2\2\2\u016c\u016d\t\13\2\2\u016d=\3"+ - "\2\2\2\u016e\u016f\t\f\2\2\u016f?\3\2\2\2\u0170\u0171\t\r\2\2\u0171A\3"+ - "\2\2\2\u0172\u0174\t\16\2\2\u0173\u0175\5D#\2\u0174\u0173\3\2\2\2\u0174"+ - "\u0175\3\2\2\2\u0175C\3\2\2\2\u0176\u0177\7Q\2\2\u0177E\3\2\2\2\u0178"+ - "\u0179\t\17\2\2\u0179G\3\2\2\2\u017a\u017c\7\35\2\2\u017b\u017d\7r\2\2"+ - "\u017c\u017b\3\2\2\2\u017c\u017d\3\2\2\2\u017d\u017e\3\2\2\2\u017e\u0186"+ - "\5(\25\2\u017f\u0181\7\20\2\2\u0180\u0182\7r\2\2\u0181\u0180\3\2\2\2\u0181"+ - "\u0182\3\2\2\2\u0182\u0183\3\2\2\2\u0183\u0185\5(\25\2\u0184\u017f\3\2"+ - "\2\2\u0185\u0188\3\2\2\2\u0186\u0184\3\2\2\2\u0186\u0187\3\2\2\2\u0187"+ - "\u018a\3\2\2\2\u0188\u0186\3\2\2\2\u0189\u018b\7r\2\2\u018a\u0189\3\2"+ - "\2\2\u018a\u018b\3\2\2\2\u018b\u018c\3\2\2\2\u018c\u018d\7\36\2\2\u018d"+ - "I\3\2\2\2\u018e\u018f\7x\2\2\u018fK\3\2\2\2\u0190\u0191\7z\2\2\u0191M"+ - "\3\2\2\2\u0192\u0193\7w\2\2\u0193O\3\2\2\2\u0194\u019b\5B\"\2\u0195\u019b"+ - "\5F$\2\u0196\u019b\5H%\2\u0197\u019b\5J&\2\u0198\u019b\5L\'\2\u0199\u019b"+ - "\5N(\2\u019a\u0194\3\2\2\2\u019a\u0195\3\2\2\2\u019a\u0196\3\2\2\2\u019a"+ - "\u0197\3\2\2\2\u019a\u0198\3\2\2\2\u019a\u0199\3\2\2\2\u019bQ\3\2\2\2"+ - "\u019c\u019d\7T\2\2\u019d\u019e\7y\2\2\u019eS\3\2\2\2\u019f\u01a0\7U\2"+ - "\2\u01a0\u01a1\58\35\2\u01a1\u01a3\7+\2\2\u01a2\u01a4\5Z.\2\u01a3\u01a2"+ - "\3\2\2\2\u01a3\u01a4\3\2\2\2\u01a4\u01a5\3\2\2\2\u01a5\u01a7\7,\2\2\u01a6"+ - "\u01a8\5V,\2\u01a7\u01a6\3\2\2\2\u01a7\u01a8\3\2\2\2\u01a8\u01a9\3\2\2"+ - "\2\u01a9\u01aa\5X-\2\u01aa\u01ab\7r\2\2\u01abU\3\2\2\2\u01ac\u01ad\7V"+ - "\2\2\u01ad\u01ae\5^\60\2\u01aeW\3\2\2\2\u01af\u01b0\7W\2\2\u01b0\u01b5"+ - "\7r\2\2\u01b1\u01b4\5\b\5\2\u01b2\u01b4\7r\2\2\u01b3\u01b1\3\2\2\2\u01b3"+ - "\u01b2\3\2\2\2\u01b4\u01b7\3\2\2\2\u01b5\u01b3\3\2\2\2\u01b5\u01b6\3\2"+ - "\2\2\u01b6\u01b8\3\2\2\2\u01b7\u01b5\3\2\2\2\u01b8\u01b9\7X\2\2\u01b9"+ - "Y\3\2\2\2\u01ba\u01c2\5\\/\2\u01bb\u01bd\7\20\2\2\u01bc\u01be\7r\2\2\u01bd"+ - "\u01bc\3\2\2\2\u01bd\u01be\3\2\2\2\u01be\u01bf\3\2\2\2\u01bf\u01c1\5\\"+ - "/\2\u01c0\u01bb\3\2\2\2\u01c1\u01c4\3\2\2\2\u01c2\u01c0\3\2\2\2\u01c2"+ - "\u01c3\3\2\2\2\u01c3[\3\2\2\2\u01c4\u01c2\3\2\2\2\u01c5\u01c6\58\35\2"+ - "\u01c6\u01c7\7\4\2\2\u01c7\u01c8\5\32\16\2\u01c8]\3\2\2\2\u01c9\u01d1"+ - "\5\32\16\2\u01ca\u01cc\7\20\2\2\u01cb\u01cd\7r\2\2\u01cc\u01cb\3\2\2\2"+ - "\u01cc\u01cd\3\2\2\2\u01cd\u01ce\3\2\2\2\u01ce\u01d0\5\32\16\2\u01cf\u01ca"+ - "\3\2\2\2\u01d0\u01d3\3\2\2\2\u01d1\u01cf\3\2\2\2\u01d1\u01d2\3\2\2\2\u01d2"+ - "_\3\2\2\2\u01d3\u01d1\3\2\2\2\u01d4\u01d5\7Y\2\2\u01d5\u01d6\58\35\2\u01d6"+ - "\u01d8\7+\2\2\u01d7\u01d9\5d\63\2\u01d8\u01d7\3\2\2\2\u01d8\u01d9\3\2"+ - "\2\2\u01d9\u01da\3\2\2\2\u01da\u01db\7,\2\2\u01db\u01dc\7V\2\2\u01dc\u01dd"+ - "\7Z\2\2\u01dd\u01df\7+\2\2\u01de\u01e0\5h\65\2\u01df\u01de\3\2\2\2\u01df"+ - "\u01e0\3\2\2\2\u01e0\u01e1\3\2\2\2\u01e1\u01e2\7,\2\2\u01e2\u01e3\7V\2"+ - "\2\u01e3\u01e5\7+\2\2\u01e4\u01e6\5j\66\2\u01e5\u01e4\3\2\2\2\u01e5\u01e6"+ - "\3\2\2\2\u01e6\u01e7\3\2\2\2\u01e7\u01ea\7,\2\2\u01e8\u01eb\5b\62\2\u01e9"+ - "\u01eb\5X-\2\u01ea\u01e8\3\2\2\2\u01ea\u01e9\3\2\2\2\u01eba\3\2\2\2\u01ec"+ - "\u01ed\7\21\2\2\u01ed\u01ee\5B\"\2\u01eec\3\2\2\2\u01ef\u01f7\5f\64\2"+ - "\u01f0\u01f2\7\20\2\2\u01f1\u01f3\7r\2\2\u01f2\u01f1\3\2\2\2\u01f2\u01f3"+ - "\3\2\2\2\u01f3\u01f4\3\2\2\2\u01f4\u01f6\5f\64\2\u01f5\u01f0\3\2\2\2\u01f6"+ - "\u01f9\3\2\2\2\u01f7\u01f5\3\2\2\2\u01f7\u01f8\3\2\2\2\u01f8e\3\2\2\2"+ - "\u01f9\u01f7\3\2\2\2\u01fa\u01fb\58\35\2\u01fb\u01fc\7\4\2\2\u01fc\u01fd"+ - "\5\32\16\2\u01fd\u0200\7[\2\2\u01fe\u0201\5> \2\u01ff\u0201\5@!\2\u0200"+ - "\u01fe\3\2\2\2\u0200\u01ff\3\2\2\2\u0201g\3\2\2\2\u0202\u0207\5<\37\2"+ - "\u0203\u0204\7\20\2\2\u0204\u0206\5<\37\2\u0205\u0203\3\2\2\2\u0206\u0209"+ - "\3\2\2\2\u0207\u0205\3\2\2\2\u0207\u0208\3\2\2\2\u0208i\3\2\2\2\u0209"+ - "\u0207\3\2\2\2\u020a\u0212\5l\67\2\u020b\u020d\7\20\2\2\u020c\u020e\7"+ - "r\2\2\u020d\u020c\3\2\2\2\u020d\u020e\3\2\2\2\u020e\u020f\3\2\2\2\u020f"+ - "\u0211\5l\67\2\u0210\u020b\3\2\2\2\u0211\u0214\3\2\2\2\u0212\u0210\3\2"+ - "\2\2\u0212\u0213\3\2\2\2\u0213k\3\2\2\2\u0214\u0212\3\2\2\2\u0215\u0216"+ - "\5\32\16\2\u0216\u0219\7[\2\2\u0217\u021a\5> \2\u0218\u021a\5@!\2\u0219"+ - "\u0217\3\2\2\2\u0219\u0218\3\2\2\2\u021am\3\2\2\2\u021b\u021c\7\\\2\2"+ - "\u021c\u021e\5(\25\2\u021d\u021f\7r\2\2\u021e\u021d\3\2\2\2\u021e\u021f"+ - "\3\2\2\2\u021f\u0222\3\2\2\2\u0220\u0223\5\b\5\2\u0221\u0223\5X-\2\u0222"+ - "\u0220\3\2\2\2\u0222\u0221\3\2\2\2\u0223\u0225\3\2\2\2\u0224\u0226\7r"+ - "\2\2\u0225\u0224\3\2\2\2\u0225\u0226\3\2\2\2\u0226\u0228\3\2\2\2\u0227"+ - "\u0229\5p9\2\u0228\u0227\3\2\2\2\u0228\u0229\3\2\2\2\u0229\u022a\3\2\2"+ - "\2\u022a\u022b\7r\2\2\u022bo\3\2\2\2\u022c\u022e\7]\2\2\u022d\u022f\7"+ + "\5\25\u012e\n\25\7\25\u0130\n\25\f\25\16\25\u0133\13\25\3\26\3\26\5\26"+ + "\u0137\n\26\3\26\3\26\3\27\3\27\5\27\u013d\n\27\3\27\3\27\5\27\u0141\n"+ + "\27\3\27\3\27\3\30\3\30\5\30\u0147\n\30\3\30\3\30\5\30\u014b\n\30\3\30"+ + "\3\30\3\31\3\31\3\31\5\31\u0152\n\31\3\31\7\31\u0155\n\31\f\31\16\31\u0158"+ + "\13\31\3\32\3\32\5\32\u015c\n\32\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3"+ + "\36\3\36\6\36\u0167\n\36\r\36\16\36\u0168\3\37\3\37\3 \3 \3!\3!\3\"\3"+ + "\"\5\"\u0173\n\"\3#\3#\3$\3$\3%\3%\5%\u017b\n%\3%\3%\3%\5%\u0180\n%\3"+ + "%\7%\u0183\n%\f%\16%\u0186\13%\3%\5%\u0189\n%\3%\3%\3&\3&\3\'\3\'\3(\3"+ + "(\3)\3)\3)\3)\3)\3)\5)\u0199\n)\3*\3*\3*\3+\3+\3+\3+\5+\u01a2\n+\3+\3"+ + "+\5+\u01a6\n+\3+\3+\3+\3,\3,\3,\3-\3-\3-\3-\7-\u01b2\n-\f-\16-\u01b5\13"+ + "-\3-\3-\3.\3.\3.\5.\u01bc\n.\3.\7.\u01bf\n.\f.\16.\u01c2\13.\3/\3/\3/"+ + "\5/\u01c7\n/\3/\7/\u01ca\n/\f/\16/\u01cd\13/\3\60\3\60\3\60\3\60\5\60"+ + "\u01d3\n\60\3\60\3\60\3\60\3\60\3\60\5\60\u01da\n\60\3\60\3\60\3\60\3"+ + "\60\5\60\u01e0\n\60\3\60\3\60\3\60\5\60\u01e5\n\60\3\61\3\61\3\61\3\62"+ + "\3\62\3\62\5\62\u01ed\n\62\3\62\7\62\u01f0\n\62\f\62\16\62\u01f3\13\62"+ + "\3\63\3\63\3\63\3\63\5\63\u01f9\n\63\3\64\3\64\3\64\7\64\u01fe\n\64\f"+ + "\64\16\64\u0201\13\64\3\65\3\65\3\65\5\65\u0206\n\65\3\65\7\65\u0209\n"+ + "\65\f\65\16\65\u020c\13\65\3\66\3\66\3\66\3\66\5\66\u0212\n\66\3\67\3"+ + "\67\3\67\5\67\u0217\n\67\3\67\3\67\5\67\u021b\n\67\3\67\5\67\u021e\n\67"+ + "\3\67\5\67\u0221\n\67\3\67\3\67\38\38\58\u0227\n8\38\38\58\u022b\n8\3"+ + "9\39\59\u022f\n9\39\39\59\u0233\n9\39\59\u0236\n9\39\59\u0239\n9\39\3"+ + "9\3:\3:\3;\3;\5;\u0241\n;\3;\3;\5;\u0245\n;\3;\3;\3;\5;\u024a\n;\3;\3"+ + ";\3<\3<\3<\5<\u0251\n<\3<\3<\5<\u0255\n<\3=\3=\3=\5=\u025a\n=\3=\5=\u025d"+ + "\n=\3=\3=\3=\3=\2\3(>\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,."+ + "\60\62\64\668:<>@BDFHJLNPRTVXZ\\^`bdfhjlnprtvx\2\21\3\2\6\17\3\2\24\34"+ + "\3\2\37(\3\2)*\4\2\3\3-.\3\2\60\63\3\2-.\3\2\64\67\3\289\3\2GI\3\2GL\3"+ + "\2MP\3\2tv\3\2RS\3\2^i\2\u0297\2~\3\2\2\2\4\u0085\3\2\2\2\6\u0087\3\2"+ + "\2\2\b\u00a5\3\2\2\2\n\u00a7\3\2\2\2\f\u00aa\3\2\2\2\16\u00b0\3\2\2\2"+ + "\20\u00c1\3\2\2\2\22\u00c3\3\2\2\2\24\u00c9\3\2\2\2\26\u00d1\3\2\2\2\30"+ + "\u00d4\3\2\2\2\32\u00d7\3\2\2\2\34\u00d9\3\2\2\2\36\u00dd\3\2\2\2 \u00e1"+ + "\3\2\2\2\"\u00e9\3\2\2\2$\u00f1\3\2\2\2&\u00f3\3\2\2\2(\u0105\3\2\2\2"+ + "*\u0136\3\2\2\2,\u013c\3\2\2\2.\u0146\3\2\2\2\60\u014e\3\2\2\2\62\u0159"+ + "\3\2\2\2\64\u015d\3\2\2\2\66\u015f\3\2\2\28\u0161\3\2\2\2:\u0163\3\2\2"+ + "\2<\u016a\3\2\2\2>\u016c\3\2\2\2@\u016e\3\2\2\2B\u0170\3\2\2\2D\u0174"+ + "\3\2\2\2F\u0176\3\2\2\2H\u0178\3\2\2\2J\u018c\3\2\2\2L\u018e\3\2\2\2N"+ + "\u0190\3\2\2\2P\u0198\3\2\2\2R\u019a\3\2\2\2T\u019d\3\2\2\2V\u01aa\3\2"+ + "\2\2X\u01ad\3\2\2\2Z\u01b8\3\2\2\2\\\u01c3\3\2\2\2^\u01ce\3\2\2\2`\u01e6"+ + "\3\2\2\2b\u01e9\3\2\2\2d\u01f4\3\2\2\2f\u01fa\3\2\2\2h\u0202\3\2\2\2j"+ + "\u020d\3\2\2\2l\u0213\3\2\2\2n\u0224\3\2\2\2p\u022c\3\2\2\2r\u023c\3\2"+ + "\2\2t\u023e\3\2\2\2v\u024d\3\2\2\2x\u0256\3\2\2\2z}\5\4\3\2{}\7r\2\2|"+ + "z\3\2\2\2|{\3\2\2\2}\u0080\3\2\2\2~|\3\2\2\2~\177\3\2\2\2\177\u0081\3"+ + "\2\2\2\u0080~\3\2\2\2\u0081\u0082\7\2\2\3\u0082\3\3\2\2\2\u0083\u0086"+ + "\5\16\b\2\u0084\u0086\5\6\4\2\u0085\u0083\3\2\2\2\u0085\u0084\3\2\2\2"+ + "\u0086\5\3\2\2\2\u0087\u0088\7\3\2\2\u0088\u008a\58\35\2\u0089\u008b\5"+ + "B\"\2\u008a\u0089\3\2\2\2\u008a\u008b\3\2\2\2\u008b\u008c\3\2\2\2\u008c"+ + "\u008d\5X-\2\u008d\u008e\7r\2\2\u008e\7\3\2\2\2\u008f\u00a6\5\16\b\2\u0090"+ + "\u00a6\5\24\13\2\u0091\u00a6\5\22\n\2\u0092\u00a6\5\26\f\2\u0093\u00a6"+ + "\5\30\r\2\u0094\u00a6\5\36\20\2\u0095\u00a6\5\"\22\2\u0096\u00a6\5\f\7"+ + "\2\u0097\u00a6\5&\24\2\u0098\u00a6\5.\30\2\u0099\u00a6\5l\67\2\u009a\u00a6"+ + "\5p9\2\u009b\u00a6\5T+\2\u009c\u00a6\5^\60\2\u009d\u00a6\5R*\2\u009e\u00a6"+ + "\5\62\32\2\u009f\u00a6\5t;\2\u00a0\u00a6\5v<\2\u00a1\u00a6\5x=\2\u00a2"+ + "\u00a6\5\64\33\2\u00a3\u00a6\5\66\34\2\u00a4\u00a6\5\n\6\2\u00a5\u008f"+ + "\3\2\2\2\u00a5\u0090\3\2\2\2\u00a5\u0091\3\2\2\2\u00a5\u0092\3\2\2\2\u00a5"+ + "\u0093\3\2\2\2\u00a5\u0094\3\2\2\2\u00a5\u0095\3\2\2\2\u00a5\u0096\3\2"+ + "\2\2\u00a5\u0097\3\2\2\2\u00a5\u0098\3\2\2\2\u00a5\u0099\3\2\2\2\u00a5"+ + "\u009a\3\2\2\2\u00a5\u009b\3\2\2\2\u00a5\u009c\3\2\2\2\u00a5\u009d\3\2"+ + "\2\2\u00a5\u009e\3\2\2\2\u00a5\u009f\3\2\2\2\u00a5\u00a0\3\2\2\2\u00a5"+ + "\u00a1\3\2\2\2\u00a5\u00a2\3\2\2\2\u00a5\u00a3\3\2\2\2\u00a5\u00a4\3\2"+ + "\2\2\u00a6\t\3\2\2\2\u00a7\u00a8\58\35\2\u00a8\u00a9\7\4\2\2\u00a9\13"+ + "\3\2\2\2\u00aa\u00ae\7\5\2\2\u00ab\u00af\5B\"\2\u00ac\u00af\58\35\2\u00ad"+ + "\u00af\5:\36\2\u00ae\u00ab\3\2\2\2\u00ae\u00ac\3\2\2\2\u00ae\u00ad\3\2"+ + "\2\2\u00af\r\3\2\2\2\u00b0\u00bc\t\2\2\2\u00b1\u00b3\5\20\t\2\u00b2\u00b1"+ + "\3\2\2\2\u00b2\u00b3\3\2\2\2\u00b3\u00bd\3\2\2\2\u00b4\u00b9\5\20\t\2"+ + "\u00b5\u00b6\7\20\2\2\u00b6\u00b8\5\20\t\2\u00b7\u00b5\3\2\2\2\u00b8\u00bb"+ + "\3\2\2\2\u00b9\u00b7\3\2\2\2\u00b9\u00ba\3\2\2\2\u00ba\u00bd\3\2\2\2\u00bb"+ + "\u00b9\3\2\2\2\u00bc\u00b2\3\2\2\2\u00bc\u00b4\3\2\2\2\u00bd\17\3\2\2"+ + "\2\u00be\u00c2\5J&\2\u00bf\u00c2\58\35\2\u00c0\u00c2\5B\"\2\u00c1\u00be"+ + "\3\2\2\2\u00c1\u00bf\3\2\2\2\u00c1\u00c0\3\2\2\2\u00c2\21\3\2\2\2\u00c3"+ + "\u00c5\5\32\16\2\u00c4\u00c6\5\34\17\2\u00c5\u00c4\3\2\2\2\u00c5\u00c6"+ + "\3\2\2\2\u00c6\u00c7\3\2\2\2\u00c7\u00c8\58\35\2\u00c8\23\3\2\2\2\u00c9"+ + "\u00cb\5\32\16\2\u00ca\u00cc\5\34\17\2\u00cb\u00ca\3\2\2\2\u00cb\u00cc"+ + "\3\2\2\2\u00cc\u00cd\3\2\2\2\u00cd\u00ce\58\35\2\u00ce\u00cf\7\21\2\2"+ + "\u00cf\u00d0\5(\25\2\u00d0\25\3\2\2\2\u00d1\u00d2\7\22\2\2\u00d2\u00d3"+ + "\5\24\13\2\u00d3\27\3\2\2\2\u00d4\u00d5\7\23\2\2\u00d5\u00d6\5\24\13\2"+ + "\u00d6\31\3\2\2\2\u00d7\u00d8\t\3\2\2\u00d8\33\3\2\2\2\u00d9\u00da\7\35"+ + "\2\2\u00da\u00db\5(\25\2\u00db\u00dc\7\36\2\2\u00dc\35\3\2\2\2\u00dd\u00de"+ + "\5 \21\2\u00de\u00df\7\21\2\2\u00df\u00e0\5(\25\2\u00e0\37\3\2\2\2\u00e1"+ + "\u00e6\5$\23\2\u00e2\u00e3\7\20\2\2\u00e3\u00e5\5$\23\2\u00e4\u00e2\3"+ + "\2\2\2\u00e5\u00e8\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e6\u00e7\3\2\2\2\u00e7"+ + "!\3\2\2\2\u00e8\u00e6\3\2\2\2\u00e9\u00ea\5$\23\2\u00ea\u00eb\t\4\2\2"+ + "\u00eb\u00ec\5(\25\2\u00ec#\3\2\2\2\u00ed\u00f2\5<\37\2\u00ee\u00f2\5"+ + "8\35\2\u00ef\u00f2\5:\36\2\u00f0\u00f2\5*\26\2\u00f1\u00ed\3\2\2\2\u00f1"+ + "\u00ee\3\2\2\2\u00f1\u00ef\3\2\2\2\u00f1\u00f0\3\2\2\2\u00f2%\3\2\2\2"+ + "\u00f3\u00f4\5$\23\2\u00f4\u00f5\t\5\2\2\u00f5\'\3\2\2\2\u00f6\u00f7\b"+ + "\25\1\2\u00f7\u00f8\7+\2\2\u00f8\u00f9\5(\25\2\u00f9\u00fa\7,\2\2\u00fa"+ + "\u0106\3\2\2\2\u00fb\u0106\5,\27\2\u00fc\u00fd\t\6\2\2\u00fd\u0106\5("+ + "\25\25\u00fe\u00ff\7B\2\2\u00ff\u0106\5(\25\b\u0100\u0106\5P)\2\u0101"+ + "\u0106\5<\37\2\u0102\u0106\58\35\2\u0103\u0106\5:\36\2\u0104\u0106\5*"+ + "\26\2\u0105\u00f6\3\2\2\2\u0105\u00fb\3\2\2\2\u0105\u00fc\3\2\2\2\u0105"+ + "\u00fe\3\2\2\2\u0105\u0100\3\2\2\2\u0105\u0101\3\2\2\2\u0105\u0102\3\2"+ + "\2\2\u0105\u0103\3\2\2\2\u0105\u0104\3\2\2\2\u0106\u0131\3\2\2\2\u0107"+ + "\u0108\f\24\2\2\u0108\u0109\7/\2\2\u0109\u0130\5(\25\25\u010a\u010b\f"+ + "\23\2\2\u010b\u010c\t\7\2\2\u010c\u0130\5(\25\24\u010d\u010e\f\22\2\2"+ + "\u010e\u010f\t\b\2\2\u010f\u0130\5(\25\23\u0110\u0111\f\21\2\2\u0111\u0112"+ + "\t\t\2\2\u0112\u0130\5(\25\22\u0113\u0114\f\20\2\2\u0114\u0115\t\n\2\2"+ + "\u0115\u0130\5(\25\21\u0116\u0117\f\17\2\2\u0117\u0118\7:\2\2\u0118\u0130"+ + "\5(\25\20\u0119\u011a\f\16\2\2\u011a\u011b\7;\2\2\u011b\u0130\5(\25\17"+ + "\u011c\u011d\f\r\2\2\u011d\u011e\7<\2\2\u011e\u0130\5(\25\16\u011f\u0120"+ + "\f\13\2\2\u0120\u0121\7?\2\2\u0121\u0130\5(\25\f\u0122\u0123\f\n\2\2\u0123"+ + "\u0124\7@\2\2\u0124\u0130\5(\25\13\u0125\u0126\f\t\2\2\u0126\u0127\7A"+ + "\2\2\u0127\u0130\5(\25\n\u0128\u0129\f\f\2\2\u0129\u012a\7=\2\2\u012a"+ + "\u012d\5(\25\2\u012b\u012c\7>\2\2\u012c\u012e\5(\25\2\u012d\u012b\3\2"+ + "\2\2\u012d\u012e\3\2\2\2\u012e\u0130\3\2\2\2\u012f\u0107\3\2\2\2\u012f"+ + "\u010a\3\2\2\2\u012f\u010d\3\2\2\2\u012f\u0110\3\2\2\2\u012f\u0113\3\2"+ + "\2\2\u012f\u0116\3\2\2\2\u012f\u0119\3\2\2\2\u012f\u011c\3\2\2\2\u012f"+ + "\u011f\3\2\2\2\u012f\u0122\3\2\2\2\u012f\u0125\3\2\2\2\u012f\u0128\3\2"+ + "\2\2\u0130\u0133\3\2\2\2\u0131\u012f\3\2\2\2\u0131\u0132\3\2\2\2\u0132"+ + ")\3\2\2\2\u0133\u0131\3\2\2\2\u0134\u0137\58\35\2\u0135\u0137\5:\36\2"+ + "\u0136\u0134\3\2\2\2\u0136\u0135\3\2\2\2\u0137\u0138\3\2\2\2\u0138\u0139"+ + "\5\34\17\2\u0139+\3\2\2\2\u013a\u013d\58\35\2\u013b\u013d\5:\36\2\u013c"+ + "\u013a\3\2\2\2\u013c\u013b\3\2\2\2\u013d\u013e\3\2\2\2\u013e\u0140\7+"+ + "\2\2\u013f\u0141\5\60\31\2\u0140\u013f\3\2\2\2\u0140\u0141\3\2\2\2\u0141"+ + "\u0142\3\2\2\2\u0142\u0143\7,\2\2\u0143-\3\2\2\2\u0144\u0147\58\35\2\u0145"+ + "\u0147\5:\36\2\u0146\u0144\3\2\2\2\u0146\u0145\3\2\2\2\u0147\u0148\3\2"+ + "\2\2\u0148\u014a\7+\2\2\u0149\u014b\5\60\31\2\u014a\u0149\3\2\2\2\u014a"+ + "\u014b\3\2\2\2\u014b\u014c\3\2\2\2\u014c\u014d\7,\2\2\u014d/\3\2\2\2\u014e"+ + "\u0156\5(\25\2\u014f\u0151\7\20\2\2\u0150\u0152\7r\2\2\u0151\u0150\3\2"+ + "\2\2\u0151\u0152\3\2\2\2\u0152\u0153\3\2\2\2\u0153\u0155\5(\25\2\u0154"+ + "\u014f\3\2\2\2\u0155\u0158\3\2\2\2\u0156\u0154\3\2\2\2\u0156\u0157\3\2"+ + "\2\2\u0157\61\3\2\2\2\u0158\u0156\3\2\2\2\u0159\u015b\7C\2\2\u015a\u015c"+ + "\5\60\31\2\u015b\u015a\3\2\2\2\u015b\u015c\3\2\2\2\u015c\63\3\2\2\2\u015d"+ + "\u015e\7D\2\2\u015e\65\3\2\2\2\u015f\u0160\7E\2\2\u0160\67\3\2\2\2\u0161"+ + "\u0162\7s\2\2\u01629\3\2\2\2\u0163\u0166\7s\2\2\u0164\u0165\7F\2\2\u0165"+ + "\u0167\7s\2\2\u0166\u0164\3\2\2\2\u0167\u0168\3\2\2\2\u0168\u0166\3\2"+ + "\2\2\u0168\u0169\3\2\2\2\u0169;\3\2\2\2\u016a\u016b\t\13\2\2\u016b=\3"+ + "\2\2\2\u016c\u016d\t\f\2\2\u016d?\3\2\2\2\u016e\u016f\t\r\2\2\u016fA\3"+ + "\2\2\2\u0170\u0172\t\16\2\2\u0171\u0173\5D#\2\u0172\u0171\3\2\2\2\u0172"+ + "\u0173\3\2\2\2\u0173C\3\2\2\2\u0174\u0175\7Q\2\2\u0175E\3\2\2\2\u0176"+ + "\u0177\t\17\2\2\u0177G\3\2\2\2\u0178\u017a\7\35\2\2\u0179\u017b\7r\2\2"+ + "\u017a\u0179\3\2\2\2\u017a\u017b\3\2\2\2\u017b\u017c\3\2\2\2\u017c\u0184"+ + "\5(\25\2\u017d\u017f\7\20\2\2\u017e\u0180\7r\2\2\u017f\u017e\3\2\2\2\u017f"+ + "\u0180\3\2\2\2\u0180\u0181\3\2\2\2\u0181\u0183\5(\25\2\u0182\u017d\3\2"+ + "\2\2\u0183\u0186\3\2\2\2\u0184\u0182\3\2\2\2\u0184\u0185\3\2\2\2\u0185"+ + "\u0188\3\2\2\2\u0186\u0184\3\2\2\2\u0187\u0189\7r\2\2\u0188\u0187\3\2"+ + "\2\2\u0188\u0189\3\2\2\2\u0189\u018a\3\2\2\2\u018a\u018b\7\36\2\2\u018b"+ + "I\3\2\2\2\u018c\u018d\7x\2\2\u018dK\3\2\2\2\u018e\u018f\7z\2\2\u018fM"+ + "\3\2\2\2\u0190\u0191\7w\2\2\u0191O\3\2\2\2\u0192\u0199\5B\"\2\u0193\u0199"+ + "\5F$\2\u0194\u0199\5H%\2\u0195\u0199\5J&\2\u0196\u0199\5L\'\2\u0197\u0199"+ + "\5N(\2\u0198\u0192\3\2\2\2\u0198\u0193\3\2\2\2\u0198\u0194\3\2\2\2\u0198"+ + "\u0195\3\2\2\2\u0198\u0196\3\2\2\2\u0198\u0197\3\2\2\2\u0199Q\3\2\2\2"+ + "\u019a\u019b\7T\2\2\u019b\u019c\7y\2\2\u019cS\3\2\2\2\u019d\u019e\7U\2"+ + "\2\u019e\u019f\58\35\2\u019f\u01a1\7+\2\2\u01a0\u01a2\5Z.\2\u01a1\u01a0"+ + "\3\2\2\2\u01a1\u01a2\3\2\2\2\u01a2\u01a3\3\2\2\2\u01a3\u01a5\7,\2\2\u01a4"+ + "\u01a6\5V,\2\u01a5\u01a4\3\2\2\2\u01a5\u01a6\3\2\2\2\u01a6\u01a7\3\2\2"+ + "\2\u01a7\u01a8\5X-\2\u01a8\u01a9\7r\2\2\u01a9U\3\2\2\2\u01aa\u01ab\7V"+ + "\2\2\u01ab\u01ac\5\\/\2\u01acW\3\2\2\2\u01ad\u01ae\7W\2\2\u01ae\u01b3"+ + "\7r\2\2\u01af\u01b2\5\b\5\2\u01b0\u01b2\7r\2\2\u01b1\u01af\3\2\2\2\u01b1"+ + "\u01b0\3\2\2\2\u01b2\u01b5\3\2\2\2\u01b3\u01b1\3\2\2\2\u01b3\u01b4\3\2"+ + "\2\2\u01b4\u01b6\3\2\2\2\u01b5\u01b3\3\2\2\2\u01b6\u01b7\7X\2\2\u01b7"+ + "Y\3\2\2\2\u01b8\u01c0\5\22\n\2\u01b9\u01bb\7\20\2\2\u01ba\u01bc\7r\2\2"+ + "\u01bb\u01ba\3\2\2\2\u01bb\u01bc\3\2\2\2\u01bc\u01bd\3\2\2\2\u01bd\u01bf"+ + "\5\22\n\2\u01be\u01b9\3\2\2\2\u01bf\u01c2\3\2\2\2\u01c0\u01be\3\2\2\2"+ + "\u01c0\u01c1\3\2\2\2\u01c1[\3\2\2\2\u01c2\u01c0\3\2\2\2\u01c3\u01cb\5"+ + "\32\16\2\u01c4\u01c6\7\20\2\2\u01c5\u01c7\7r\2\2\u01c6\u01c5\3\2\2\2\u01c6"+ + "\u01c7\3\2\2\2\u01c7\u01c8\3\2\2\2\u01c8\u01ca\5\32\16\2\u01c9\u01c4\3"+ + "\2\2\2\u01ca\u01cd\3\2\2\2\u01cb\u01c9\3\2\2\2\u01cb\u01cc\3\2\2\2\u01cc"+ + "]\3\2\2\2\u01cd\u01cb\3\2\2\2\u01ce\u01cf\7Y\2\2\u01cf\u01d0\58\35\2\u01d0"+ + "\u01d2\7+\2\2\u01d1\u01d3\5b\62\2\u01d2\u01d1\3\2\2\2\u01d2\u01d3\3\2"+ + "\2\2\u01d3\u01d4\3\2\2\2\u01d4\u01d5\7,\2\2\u01d5\u01d6\7V\2\2\u01d6\u01d7"+ + "\7Z\2\2\u01d7\u01d9\7+\2\2\u01d8\u01da\5f\64\2\u01d9\u01d8\3\2\2\2\u01d9"+ + "\u01da\3\2\2\2\u01da\u01db\3\2\2\2\u01db\u01dc\7,\2\2\u01dc\u01dd\7V\2"+ + "\2\u01dd\u01df\7+\2\2\u01de\u01e0\5h\65\2\u01df\u01de\3\2\2\2\u01df\u01e0"+ + "\3\2\2\2\u01e0\u01e1\3\2\2\2\u01e1\u01e4\7,\2\2\u01e2\u01e5\5`\61\2\u01e3"+ + "\u01e5\5X-\2\u01e4\u01e2\3\2\2\2\u01e4\u01e3\3\2\2\2\u01e5_\3\2\2\2\u01e6"+ + "\u01e7\7\21\2\2\u01e7\u01e8\5B\"\2\u01e8a\3\2\2\2\u01e9\u01f1\5d\63\2"+ + "\u01ea\u01ec\7\20\2\2\u01eb\u01ed\7r\2\2\u01ec\u01eb\3\2\2\2\u01ec\u01ed"+ + "\3\2\2\2\u01ed\u01ee\3\2\2\2\u01ee\u01f0\5d\63\2\u01ef\u01ea\3\2\2\2\u01f0"+ + "\u01f3\3\2\2\2\u01f1\u01ef\3\2\2\2\u01f1\u01f2\3\2\2\2\u01f2c\3\2\2\2"+ + "\u01f3\u01f1\3\2\2\2\u01f4\u01f5\5\22\n\2\u01f5\u01f8\7[\2\2\u01f6\u01f9"+ + "\5> \2\u01f7\u01f9\5@!\2\u01f8\u01f6\3\2\2\2\u01f8\u01f7\3\2\2\2\u01f9"+ + "e\3\2\2\2\u01fa\u01ff\5<\37\2\u01fb\u01fc\7\20\2\2\u01fc\u01fe\5<\37\2"+ + "\u01fd\u01fb\3\2\2\2\u01fe\u0201\3\2\2\2\u01ff\u01fd\3\2\2\2\u01ff\u0200"+ + "\3\2\2\2\u0200g\3\2\2\2\u0201\u01ff\3\2\2\2\u0202\u020a\5j\66\2\u0203"+ + "\u0205\7\20\2\2\u0204\u0206\7r\2\2\u0205\u0204\3\2\2\2\u0205\u0206\3\2"+ + "\2\2\u0206\u0207\3\2\2\2\u0207\u0209\5j\66\2\u0208\u0203\3\2\2\2\u0209"+ + "\u020c\3\2\2\2\u020a\u0208\3\2\2\2\u020a\u020b\3\2\2\2\u020bi\3\2\2\2"+ + "\u020c\u020a\3\2\2\2\u020d\u020e\5\32\16\2\u020e\u0211\7[\2\2\u020f\u0212"+ + "\5> \2\u0210\u0212\5@!\2\u0211\u020f\3\2\2\2\u0211\u0210\3\2\2\2\u0212"+ + "k\3\2\2\2\u0213\u0214\7\\\2\2\u0214\u0216\5(\25\2\u0215\u0217\7r\2\2\u0216"+ + "\u0215\3\2\2\2\u0216\u0217\3\2\2\2\u0217\u021a\3\2\2\2\u0218\u021b\5\b"+ + "\5\2\u0219\u021b\5X-\2\u021a\u0218\3\2\2\2\u021a\u0219\3\2\2\2\u021b\u021d"+ + "\3\2\2\2\u021c\u021e\7r\2\2\u021d\u021c\3\2\2\2\u021d\u021e\3\2\2\2\u021e"+ + "\u0220\3\2\2\2\u021f\u0221\5n8\2\u0220\u021f\3\2\2\2\u0220\u0221\3\2\2"+ + "\2\u0221\u0222\3\2\2\2\u0222\u0223\7r\2\2\u0223m\3\2\2\2\u0224\u0226\7"+ + "]\2\2\u0225\u0227\7r\2\2\u0226\u0225\3\2\2\2\u0226\u0227\3\2\2\2\u0227"+ + "\u022a\3\2\2\2\u0228\u022b\5\b\5\2\u0229\u022b\5X-\2\u022a\u0228\3\2\2"+ + "\2\u022a\u0229\3\2\2\2\u022bo\3\2\2\2\u022c\u022e\5r:\2\u022d\u022f\7"+ "r\2\2\u022e\u022d\3\2\2\2\u022e\u022f\3\2\2\2\u022f\u0232\3\2\2\2\u0230"+ "\u0233\5\b\5\2\u0231\u0233\5X-\2\u0232\u0230\3\2\2\2\u0232\u0231\3\2\2"+ - "\2\u0233q\3\2\2\2\u0234\u0236\5t;\2\u0235\u0237\7r\2\2\u0236\u0235\3\2"+ - "\2\2\u0236\u0237\3\2\2\2\u0237\u023a\3\2\2\2\u0238\u023b\5\b\5\2\u0239"+ - "\u023b\5X-\2\u023a\u0238\3\2\2\2\u023a\u0239\3\2\2\2\u023b\u023d\3\2\2"+ - "\2\u023c\u023e\7r\2\2\u023d\u023c\3\2\2\2\u023d\u023e\3\2\2\2\u023e\u0240"+ - "\3\2\2\2\u023f\u0241\5p9\2\u0240\u023f\3\2\2\2\u0240\u0241\3\2\2\2\u0241"+ - "\u0242\3\2\2\2\u0242\u0243\7r\2\2\u0243s\3\2\2\2\u0244\u0245\t\20\2\2"+ - "\u0245u\3\2\2\2\u0246\u0248\7j\2\2\u0247\u0249\5\32\16\2\u0248\u0247\3"+ - "\2\2\2\u0248\u0249\3\2\2\2\u0249\u024c\3\2\2\2\u024a\u024d\5<\37\2\u024b"+ - "\u024d\58\35\2\u024c\u024a\3\2\2\2\u024c\u024b\3\2\2\2\u024d\u024e\3\2"+ - "\2\2\u024e\u024f\7k\2\2\u024f\u0251\5(\25\2\u0250\u0252\7r\2\2\u0251\u0250"+ - "\3\2\2\2\u0251\u0252\3\2\2\2\u0252\u0253\3\2\2\2\u0253\u0254\5X-\2\u0254"+ - "w\3\2\2\2\u0255\u0256\7l\2\2\u0256\u0258\5(\25\2\u0257\u0259\7r\2\2\u0258"+ - "\u0257\3\2\2\2\u0258\u0259\3\2\2\2\u0259\u025c\3\2\2\2\u025a\u025d\5\b"+ - "\5\2\u025b\u025d\5X-\2\u025c\u025a\3\2\2\2\u025c\u025b\3\2\2\2\u025dy"+ - "\3\2\2\2\u025e\u0261\7m\2\2\u025f\u0262\5\b\5\2\u0260\u0262\5X-\2\u0261"+ - "\u025f\3\2\2\2\u0261\u0260\3\2\2\2\u0262\u0264\3\2\2\2\u0263\u0265\7r"+ - "\2\2\u0264\u0263\3\2\2\2\u0264\u0265\3\2\2\2\u0265\u0266\3\2\2\2\u0266"+ - "\u0267\7n\2\2\u0267\u0268\5(\25\2\u0268{\3\2\2\2G~\u0080\u0087\u008c\u00a7"+ - "\u00b0\u00b4\u00bb\u00be\u00c3\u00c7\u00cd\u00e8\u00f3\u0107\u012f\u0131"+ - "\u0133\u0138\u013e\u0142\u0148\u014c\u0153\u0158\u015d\u016a\u0174\u017c"+ - "\u0181\u0186\u018a\u019a\u01a3\u01a7\u01b3\u01b5\u01bd\u01c2\u01cc\u01d1"+ - "\u01d8\u01df\u01e5\u01ea\u01f2\u01f7\u0200\u0207\u020d\u0212\u0219\u021e"+ - "\u0222\u0225\u0228\u022e\u0232\u0236\u023a\u023d\u0240\u0248\u024c\u0251"+ - "\u0258\u025c\u0261\u0264"; + "\2\u0233\u0235\3\2\2\2\u0234\u0236\7r\2\2\u0235\u0234\3\2\2\2\u0235\u0236"+ + "\3\2\2\2\u0236\u0238\3\2\2\2\u0237\u0239\5n8\2\u0238\u0237\3\2\2\2\u0238"+ + "\u0239\3\2\2\2\u0239\u023a\3\2\2\2\u023a\u023b\7r\2\2\u023bq\3\2\2\2\u023c"+ + "\u023d\t\20\2\2\u023ds\3\2\2\2\u023e\u0240\7j\2\2\u023f\u0241\5\32\16"+ + "\2\u0240\u023f\3\2\2\2\u0240\u0241\3\2\2\2\u0241\u0244\3\2\2\2\u0242\u0245"+ + "\5<\37\2\u0243\u0245\58\35\2\u0244\u0242\3\2\2\2\u0244\u0243\3\2\2\2\u0245"+ + "\u0246\3\2\2\2\u0246\u0247\7k\2\2\u0247\u0249\5(\25\2\u0248\u024a\7r\2"+ + "\2\u0249\u0248\3\2\2\2\u0249\u024a\3\2\2\2\u024a\u024b\3\2\2\2\u024b\u024c"+ + "\5X-\2\u024cu\3\2\2\2\u024d\u024e\7l\2\2\u024e\u0250\5(\25\2\u024f\u0251"+ + "\7r\2\2\u0250\u024f\3\2\2\2\u0250\u0251\3\2\2\2\u0251\u0254\3\2\2\2\u0252"+ + "\u0255\5\b\5\2\u0253\u0255\5X-\2\u0254\u0252\3\2\2\2\u0254\u0253\3\2\2"+ + "\2\u0255w\3\2\2\2\u0256\u0259\7m\2\2\u0257\u025a\5\b\5\2\u0258\u025a\5"+ + "X-\2\u0259\u0257\3\2\2\2\u0259\u0258\3\2\2\2\u025a\u025c\3\2\2\2\u025b"+ + "\u025d\7r\2\2\u025c\u025b\3\2\2\2\u025c\u025d\3\2\2\2\u025d\u025e\3\2"+ + "\2\2\u025e\u025f\7n\2\2\u025f\u0260\5(\25\2\u0260y\3\2\2\2G|~\u0085\u008a"+ + "\u00a5\u00ae\u00b2\u00b9\u00bc\u00c1\u00c5\u00cb\u00e6\u00f1\u0105\u012d"+ + "\u012f\u0131\u0136\u013c\u0140\u0146\u014a\u0151\u0156\u015b\u0168\u0172"+ + "\u017a\u017f\u0184\u0188\u0198\u01a1\u01a5\u01b1\u01b3\u01bb\u01c0\u01c6"+ + "\u01cb\u01d2\u01d9\u01df\u01e4\u01ec\u01f1\u01f8\u01ff\u0205\u020a\u0211"+ + "\u0216\u021a\u021d\u0220\u0226\u022a\u022e\u0232\u0235\u0238\u0240\u0244"+ + "\u0249\u0250\u0254\u0259\u025c"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/docs/source/syntaxreference.rst b/docs/source/syntaxreference.rst index 90307f4c7..fa251c5ed 100644 --- a/docs/source/syntaxreference.rst +++ b/docs/source/syntaxreference.rst @@ -422,13 +422,13 @@ The syntax is:: } ; example: - sub triple_something (amount: word) -> word { + sub triple_something (word amount) -> word { return X * 3 } The open curly brace must immediately follow the subroutine result specification on the same line, and can have nothing following it. The close curly brace must be on its own line as well. -The parameters is a (possibly empty) comma separated list of ": " pairs specifying the input parameters. +The parameters is a (possibly empty) comma separated list of " " pairs specifying the input parameters. The return type has to be specified if the subroutine returns a value. .. todo:: diff --git a/prog8lib/c64lib.p8 b/prog8lib/c64lib.p8 index b3a84218e..7cb4ff1f0 100644 --- a/prog8lib/c64lib.p8 +++ b/prog8lib/c64lib.p8 @@ -9,6 +9,7 @@ ~ c64 { memory ubyte SCRATCH_ZPB1 = $02 ; scratch byte 1 in ZP memory ubyte SCRATCH_ZPREG = $03 ; scratch register in ZP + memory ubyte SCRATCH_ZPREGX = $fa ; temp storage for X register (stack pointer) memory uword SCRATCH_ZPWORD1 = $fb ; scratch word in ZP ($fb/$fc) memory uword SCRATCH_ZPWORD2 = $fd ; scratch word in ZP ($fd/$fe) @@ -110,14 +111,14 @@ ; note: for subtraction and division, the left operand is in fac2, the right operand in fac1. ; checked functions below: -asmsub MOVFM (mflpt: uword @ AY) -> clobbers(A,Y) -> () = $bba2 ; load mflpt value from memory in A/Y into fac1 +asmsub MOVFM (uword mflpt @ AY) -> clobbers(A,Y) -> () = $bba2 ; load mflpt value from memory in A/Y into fac1 asmsub FREADMEM () -> clobbers(A,Y) -> () = $bba6 ; load mflpt value from memory in $22/$23 into fac1 -asmsub CONUPK (mflpt: uword @ AY) -> clobbers(A,Y) -> () = $ba8c ; load mflpt value from memory in A/Y into fac2 +asmsub CONUPK (uword mflpt @ AY) -> clobbers(A,Y) -> () = $ba8c ; load mflpt value from memory in A/Y into fac2 asmsub FAREADMEM () -> clobbers(A,Y) -> () = $ba90 ; load mflpt value from memory in $22/$23 into fac2 asmsub MOVFA () -> clobbers(A,X) -> () = $bbfc ; copy fac2 to fac1 asmsub MOVAF () -> clobbers(A,X) -> () = $bc0c ; copy fac1 to fac2 (rounded) asmsub MOVEF () -> clobbers(A,X) -> () = $bc0f ; copy fac1 to fac2 -asmsub MOVMF (mflpt: uword @ XY) -> clobbers(A,Y) -> () = $bbd4 ; store fac1 to memory X/Y as 5-byte mflpt +asmsub MOVMF (uword mflpt @ XY) -> clobbers(A,Y) -> () = $bbd4 ; store fac1 to memory X/Y as 5-byte mflpt ; fac1-> signed word in Y/A (might throw ILLEGAL QUANTITY) ; (tip: use c64flt.FTOSWRDAY to get A/Y output; lo/hi switched to normal little endian order) @@ -136,29 +137,29 @@ asmsub AYINT () -> clobbers(A,X,Y) -> () = $b1bf ; fac1-> signed word in 100 ; there is also c64flt.FREADS32 that reads from 98-101 ($62-$65) MSB FIRST ; there is also c64flt.FREADUS32 that reads from 98-101 ($62-$65) MSB FIRST ; there is also c64flt.FREADS24AXY that reads signed int24 into fac1 from A/X/Y (lo/mid/hi bytes) -asmsub GIVAYF (lo: ubyte @ Y, hi: ubyte @ A) -> clobbers(A,X,Y) -> () = $b391 +asmsub GIVAYF (ubyte lo @ Y, ubyte hi @ A) -> clobbers(A,X,Y) -> () = $b391 -asmsub FREADUY (unsigned: ubyte @ Y) -> clobbers(A,X,Y) -> () = $b3a2 ; 8 bit unsigned Y -> float in fac1 -asmsub FREADSA (signed: ubyte @ A) -> clobbers(A,X,Y) -> () = $bc3c ; 8 bit signed A -> float in fac1 -asmsub FREADSTR (length: ubyte @ A) -> clobbers(A,X,Y) -> () = $b7b5 ; str -> fac1, $22/23 must point to string, A=string length +asmsub FREADUY (ubyte value @ Y) -> clobbers(A,X,Y) -> () = $b3a2 ; 8 bit unsigned Y -> float in fac1 +asmsub FREADSA (byte value @ A) -> clobbers(A,X,Y) -> () = $bc3c ; 8 bit signed A -> float in fac1 +asmsub FREADSTR (ubyte length @ A) -> clobbers(A,X,Y) -> () = $b7b5 ; str -> fac1, $22/23 must point to string, A=string length asmsub FPRINTLN () -> clobbers(A,X,Y) -> () = $aabc ; print string of fac1, on one line (= with newline) destroys fac1. (consider FOUT + STROUT as well) asmsub FOUT () -> clobbers(X) -> (uword @ AY) = $bddd ; fac1 -> string, address returned in AY ($0100) asmsub FADDH () -> clobbers(A,X,Y) -> () = $b849 ; fac1 += 0.5, for rounding- call this before INT asmsub MUL10 () -> clobbers(A,X,Y) -> () = $bae2 ; fac1 *= 10 asmsub DIV10 () -> clobbers(A,X,Y) -> () = $bafe ; fac1 /= 10 , CAUTION: result is always positive! -asmsub FCOMP (mflpt: uword @ AY) -> clobbers(X,Y) -> (ubyte @ A) = $bc5b ; A = compare fac1 to mflpt in A/Y, 0=equal 1=fac1 is greater, 255=fac1 is less than +asmsub FCOMP (uword mflpt @ AY) -> clobbers(X,Y) -> (ubyte @ A) = $bc5b ; A = compare fac1 to mflpt in A/Y, 0=equal 1=fac1 is greater, 255=fac1 is less than asmsub FADDT () -> clobbers(A,X,Y) -> () = $b86a ; fac1 += fac2 -asmsub FADD (mflpt: uword @ AY) -> clobbers(A,X,Y) -> () = $b867 ; fac1 += mflpt value from A/Y +asmsub FADD (uword mflpt @ AY) -> clobbers(A,X,Y) -> () = $b867 ; fac1 += mflpt value from A/Y asmsub FSUBT () -> clobbers(A,X,Y) -> () = $b853 ; fac1 = fac2-fac1 mind the order of the operands -asmsub FSUB (mflpt: uword @ AY) -> clobbers(A,X,Y) -> () = $b850 ; fac1 = mflpt from A/Y - fac1 +asmsub FSUB (uword mflpt @ AY) -> clobbers(A,X,Y) -> () = $b850 ; fac1 = mflpt from A/Y - fac1 asmsub FMULTT () -> clobbers(A,X,Y) -> () = $ba2b ; fac1 *= fac2 -asmsub FMULT (mflpt: uword @ AY) -> clobbers(A,X,Y) -> () = $ba28 ; fac1 *= mflpt value from A/Y +asmsub FMULT (uword mflpt @ AY) -> clobbers(A,X,Y) -> () = $ba28 ; fac1 *= mflpt value from A/Y asmsub FDIVT () -> clobbers(A,X,Y) -> () = $bb12 ; fac1 = fac2/fac1 (remainder in fac2) mind the order of the operands -asmsub FDIV (mflpt: uword @ AY) -> clobbers(A,X,Y) -> () = $bb0f ; fac1 = mflpt in A/Y / fac1 (remainder in fac2) +asmsub FDIV (uword mflpt @ AY) -> clobbers(A,X,Y) -> () = $bb0f ; fac1 = mflpt in A/Y / fac1 (remainder in fac2) asmsub FPWRT () -> clobbers(A,X,Y) -> () = $bf7b ; fac1 = fac2 ** fac1 -asmsub FPWR (mflpt: uword @ AY) -> clobbers(A,X,Y) -> () = $bf78 ; fac1 = fac2 ** mflpt from A/Y +asmsub FPWR (uword mflpt @ AY) -> clobbers(A,X,Y) -> () = $bf78 ; fac1 = fac2 ** mflpt from A/Y asmsub NOTOP () -> clobbers(A,X,Y) -> () = $aed4 ; fac1 = NOT(fac1) asmsub INT () -> clobbers(A,X,Y) -> () = $bccc ; INT() truncates, use FADDH first to round instead of trunc @@ -189,47 +190,47 @@ asmsub HOMECRSR () -> clobbers(A,X,Y) -> () = $E566 ; cursor to top left of sc ; ---- C64 kernal routines ---- -asmsub STROUT (strptr: uword @ AY) -> clobbers(A, X, Y) -> () = $AB1E ; print null-terminated string (a bit slow, see if you can use c64scr.print_string instead) +asmsub STROUT (uword strptr @ AY) -> clobbers(A, X, Y) -> () = $AB1E ; print null-terminated string (a bit slow, see if you can use c64scr.print_string instead) asmsub IRQDFRT () -> clobbers(A,X,Y) -> () = $EA31 ; default IRQ routine asmsub IRQDFEND () -> clobbers(A,X,Y) -> () = $EA81 ; default IRQ end/cleanup asmsub CINT () -> clobbers(A,X,Y) -> () = $FF81 ; (alias: SCINIT) initialize screen editor and video chip asmsub IOINIT () -> clobbers(A, X) -> () = $FF84 ; initialize I/O devices (CIA, SID, IRQ) asmsub RAMTAS () -> clobbers(A,X,Y) -> () = $FF87 ; initialize RAM, tape buffer, screen asmsub RESTOR () -> clobbers(A,X,Y) -> () = $FF8A ; restore default I/O vectors -asmsub VECTOR (dir: ubyte @ Pc, userptr: uword @ XY) -> clobbers(A,Y) -> () = $FF8D ; read/set I/O vector table -asmsub SETMSG (value: ubyte @ A) -> clobbers() -> () = $FF90 ; set Kernal message control flag -asmsub SECOND (address: ubyte @ A) -> clobbers(A) -> () = $FF93 ; (alias: LSTNSA) send secondary address after LISTEN -asmsub TKSA (address: ubyte @ A) -> clobbers(A) -> () = $FF96 ; (alias: TALKSA) send secondary address after TALK -asmsub MEMTOP (dir: ubyte @ Pc, address: uword @ XY) -> clobbers() -> (uword @ XY) = $FF99 ; read/set top of memory pointer -asmsub MEMBOT (dir: ubyte @ Pc, address: uword @ XY) -> clobbers() -> (uword @ XY) = $FF9C ; read/set bottom of memory pointer +asmsub VECTOR (ubyte dir @ Pc, uword userptr @ XY) -> clobbers(A,Y) -> () = $FF8D ; read/set I/O vector table +asmsub SETMSG (ubyte value @ A) -> clobbers() -> () = $FF90 ; set Kernal message control flag +asmsub SECOND (ubyte address @ A) -> clobbers(A) -> () = $FF93 ; (alias: LSTNSA) send secondary address after LISTEN +asmsub TKSA (ubyte address @ A) -> clobbers(A) -> () = $FF96 ; (alias: TALKSA) send secondary address after TALK +asmsub MEMTOP (ubyte dir @ Pc, uword address @ XY) -> clobbers() -> (uword @ XY) = $FF99 ; read/set top of memory pointer +asmsub MEMBOT (ubyte dir @ Pc, uword address @ XY) -> clobbers() -> (uword @ XY) = $FF9C ; read/set bottom of memory pointer asmsub SCNKEY () -> clobbers(A,X,Y) -> () = $FF9F ; scan the keyboard -asmsub SETTMO (timeout: ubyte @ A) -> clobbers() -> () = $FFA2 ; set time-out flag for IEEE bus +asmsub SETTMO (ubyte timeout @ A) -> clobbers() -> () = $FFA2 ; set time-out flag for IEEE bus asmsub ACPTR () -> clobbers() -> (ubyte @ A) = $FFA5 ; (alias: IECIN) input byte from serial bus -asmsub CIOUT (databyte: ubyte @ A) -> clobbers() -> () = $FFA8 ; (alias: IECOUT) output byte to serial bus +asmsub CIOUT (ubyte databyte @ A) -> clobbers() -> () = $FFA8 ; (alias: IECOUT) output byte to serial bus asmsub UNTLK () -> clobbers(A) -> () = $FFAB ; command serial bus device to UNTALK asmsub UNLSN () -> clobbers(A) -> () = $FFAE ; command serial bus device to UNLISTEN -asmsub LISTEN (device: ubyte @ A) -> clobbers(A) -> () = $FFB1 ; command serial bus device to LISTEN -asmsub TALK (device: ubyte @ A) -> clobbers(A) -> () = $FFB4 ; command serial bus device to TALK +asmsub LISTEN (ubyte device @ A) -> clobbers(A) -> () = $FFB1 ; command serial bus device to LISTEN +asmsub TALK (ubyte device @ A) -> clobbers(A) -> () = $FFB4 ; command serial bus device to TALK asmsub READST () -> clobbers() -> (ubyte @ A) = $FFB7 ; read I/O status word -asmsub SETLFS (logical: ubyte @ A, device: ubyte @ X, address: ubyte @ Y) -> clobbers() -> () = $FFBA ; set logical file parameters -asmsub SETNAM (namelen: ubyte @ A, filename: uword @ XY) -> clobbers() -> () = $FFBD ; set filename parameters +asmsub SETLFS (ubyte logical @ A, ubyte device @ X, ubyte address @ Y) -> clobbers() -> () = $FFBA ; set logical file parameters +asmsub SETNAM (ubyte namelen @ A, str filename @ XY) -> clobbers() -> () = $FFBD ; set filename parameters asmsub OPEN () -> clobbers(A,X,Y) -> () = $FFC0 ; (via 794 ($31A)) open a logical file -asmsub CLOSE (logical: ubyte @ A) -> clobbers(A,X,Y) -> () = $FFC3 ; (via 796 ($31C)) close a logical file -asmsub CHKIN (logical: ubyte @ X) -> clobbers(A,X) -> () = $FFC6 ; (via 798 ($31E)) define an input channel -asmsub CHKOUT (logical: ubyte @ X) -> clobbers(A,X) -> () = $FFC9 ; (via 800 ($320)) define an output channel +asmsub CLOSE (ubyte logical @ A) -> clobbers(A,X,Y) -> () = $FFC3 ; (via 796 ($31C)) close a logical file +asmsub CHKIN (ubyte logical @ X) -> clobbers(A,X) -> () = $FFC6 ; (via 798 ($31E)) define an input channel +asmsub CHKOUT (ubyte logical @ X) -> clobbers(A,X) -> () = $FFC9 ; (via 800 ($320)) define an output channel asmsub CLRCHN () -> clobbers(A,X) -> () = $FFCC ; (via 802 ($322)) restore default devices asmsub CHRIN () -> clobbers(Y) -> (ubyte @ A) = $FFCF ; (via 804 ($324)) input a character (for keyboard, read a whole line from the screen) A=byte read. -asmsub CHROUT (char: ubyte @ A) -> clobbers() -> () = $FFD2 ; (via 806 ($326)) output a character -asmsub LOAD (verify: ubyte @ A, address: uword @ XY) -> clobbers() -> (ubyte @Pc, ubyte @ A, ubyte @ X, ubyte @ Y) = $FFD5 ; (via 816 ($330)) load from device -asmsub SAVE (zp_startaddr: ubyte @ A, endaddr: uword @ XY) -> clobbers() -> (ubyte @ Pc, ubyte @ A) = $FFD8 ; (via 818 ($332)) save to a device -asmsub SETTIM (low: ubyte @ A, middle: ubyte @ X, high: ubyte @ Y) -> clobbers() -> () = $FFDB ; set the software clock +asmsub CHROUT (ubyte char @ A) -> clobbers() -> () = $FFD2 ; (via 806 ($326)) output a character +asmsub LOAD (ubyte verify @ A, uword address @ XY) -> clobbers() -> (ubyte @Pc, ubyte @ A, ubyte @ X, ubyte @ Y) = $FFD5 ; (via 816 ($330)) load from device +asmsub SAVE (ubyte zp_startaddr @ A, uword endaddr @ XY) -> clobbers() -> (ubyte @ Pc, ubyte @ A) = $FFD8 ; (via 818 ($332)) save to a device +asmsub SETTIM (ubyte low @ A, ubyte middle @ X, ubyte high @ Y) -> clobbers() -> () = $FFDB ; set the software clock asmsub RDTIM () -> clobbers() -> (ubyte @ A, ubyte @ X, ubyte @ Y) = $FFDE ; read the software clock asmsub STOP () -> clobbers(A,X) -> (ubyte @ Pz, ubyte @ Pc) = $FFE1 ; (via 808 ($328)) check the STOP key asmsub GETIN () -> clobbers(X,Y) -> (ubyte @ A) = $FFE4 ; (via 810 ($32A)) get a character asmsub CLALL () -> clobbers(A,X) -> () = $FFE7 ; (via 812 ($32C)) close all files asmsub UDTIM () -> clobbers(A,X) -> () = $FFEA ; update the software clock asmsub SCREEN () -> clobbers() -> (ubyte @ X, ubyte @ Y) = $FFED ; read number of screen rows and columns -asmsub PLOT (dir: ubyte @ Pc, col: ubyte @ Y, row: ubyte @ X) -> clobbers() -> (ubyte @ X, ubyte @ Y) = $FFF0 ; read/set position of cursor on screen +asmsub PLOT (ubyte dir @ Pc, ubyte col @ Y, ubyte row @ X) -> clobbers() -> (ubyte @ X, ubyte @ Y) = $FFF0 ; read/set position of cursor on screen. See c64scr.PLOT for a 'safe' wrapper that preserves X. asmsub IOBASE () -> clobbers() -> (uword @ XY) = $FFF3 ; read base address of I/O devices ; ---- end of C64 kernal routines ---- diff --git a/prog8lib/c64utils.p8 b/prog8lib/c64utils.p8 index 1957c91c3..a0ec601c6 100644 --- a/prog8lib/c64utils.p8 +++ b/prog8lib/c64utils.p8 @@ -48,7 +48,7 @@ asmsub init_system () -> clobbers(A,X,Y) -> () { }} } -asmsub ubyte2decimal (value: ubyte @ A) -> clobbers() -> (ubyte @ Y, ubyte @ X, ubyte @ A) { +asmsub ubyte2decimal (ubyte value @ A) -> clobbers() -> (ubyte @ Y, ubyte @ X, ubyte @ A) { ; ---- A to decimal string in Y/X/A (100s in Y, 10s in X, 1s in A) %asm {{ ldy #$2f @@ -65,7 +65,7 @@ asmsub ubyte2decimal (value: ubyte @ A) -> clobbers() -> (ubyte @ Y, ubyte @ X }} } -asmsub byte2decimal (value: ubyte @ A) -> clobbers() -> (ubyte @ Y, ubyte @ X, ubyte @ A) { +asmsub byte2decimal (ubyte value @ A) -> clobbers() -> (ubyte @ Y, ubyte @ X, ubyte @ A) { ; ---- A (signed byte) to decimal string in Y/X/A (100s in Y, 10s in X, 1s in A) ; note: the '-' is not part of the conversion here if it's a negative number %asm {{ @@ -78,7 +78,7 @@ asmsub byte2decimal (value: ubyte @ A) -> clobbers() -> (ubyte @ Y, ubyte @ X, }} } -asmsub ubyte2hex (value: ubyte @ A) -> clobbers(X) -> (ubyte @ A, ubyte @ Y) { +asmsub ubyte2hex (ubyte value @ A) -> clobbers(X) -> (ubyte @ A, ubyte @ Y) { ; ---- A to hex string in AY (first hex char in A, second hex char in Y) %asm {{ pha @@ -100,7 +100,7 @@ hex_digits .text "0123456789abcdef" ; can probably be reused for other stuff as str word2hex_output = "1234" ; 0-terminated, to make printing easier -asmsub uword2hex (value: uword @ AY) -> clobbers(A,X,Y) -> () { +asmsub uword2hex (uword value @ AY) -> clobbers(A,X,Y) -> () { ; ---- convert 16 bit uword in A/Y into 4-character hexadecimal string into memory 'word2hex_output' %asm {{ sta c64.SCRATCH_ZPREG @@ -117,7 +117,7 @@ asmsub uword2hex (value: uword @ AY) -> clobbers(A,X,Y) -> () { } ubyte[3] word2bcd_bcdbuff = [0, 0, 0] -asmsub uword2bcd (dataword: uword @ AY) -> clobbers(A,X) -> () { +asmsub uword2bcd (uword value @ AY) -> clobbers(A,X) -> () { ; Convert an 16 bit binary value to BCD ; ; This function converts a 16 bit binary value in A/Y into a 24 bit BCD. It @@ -155,7 +155,7 @@ asmsub uword2bcd (dataword: uword @ AY) -> clobbers(A,X) -> () { ubyte[5] word2decimal_output = 0 -asmsub uword2decimal (dataword: uword @ AY) -> clobbers(A,X,Y) -> () { +asmsub uword2decimal (uword value @ AY) -> clobbers(A,X,Y) -> () { ; ---- convert 16 bit uword in A/Y into decimal string into memory 'word2decimal_output' %asm {{ jsr uword2bcd @@ -220,7 +220,7 @@ asmsub FREADUS32 () -> clobbers(A,X,Y) -> () { }} } -asmsub FREADS24AXY (lo: ubyte @ A, mid: ubyte @ X, hi: ubyte @ Y) -> clobbers(A,X,Y) -> () { +asmsub FREADS24AXY (ubyte lo @ A, ubyte mid @ X, ubyte hi @ Y) -> clobbers(A,X,Y) -> () { ; ---- fac1 = signed int24 (A/X/Y contain lo/mid/hi bytes) ; note: there is no FREADU24AXY (unsigned), use FREADUS32 instead. %asm {{ @@ -237,7 +237,7 @@ asmsub FREADS24AXY (lo: ubyte @ A, mid: ubyte @ X, hi: ubyte @ Y) -> clobbers( }} } -asmsub GIVUAYFAY (value: uword @ AY) -> clobbers(A,X,Y) -> () { +asmsub GIVUAYFAY (uword value @ AY) -> clobbers(A,X,Y) -> () { ; ---- unsigned 16 bit word in A/Y (lo/hi) to fac1 %asm {{ sty $62 @@ -248,7 +248,7 @@ asmsub GIVUAYFAY (value: uword @ AY) -> clobbers(A,X,Y) -> () { }} } -asmsub GIVAYFAY (value: uword @ AY) -> clobbers(A,X,Y) -> () { +asmsub GIVAYFAY (uword value @ AY) -> clobbers(A,X,Y) -> () { ; ---- signed 16 bit word in A/Y (lo/hi) to float in fac1 %asm {{ sta c64.SCRATCH_ZPREG @@ -280,7 +280,7 @@ asmsub GETADRAY () -> clobbers(X) -> (uword @ AY) { }} } -sub print_float (value: float) { +sub print_float (float value) { ; ---- prints the floating point value (without a newline) using basic rom routines. ; clobbers no registers. ; @todo version that takes A/Y pointer to float instead @@ -304,7 +304,7 @@ sub print_float (value: float) { }} } -sub print_float_ln (value: float) { +sub print_float_ln (float value) { ; ---- prints the floating point value (with a newline at the end) using basic rom routines ; clobbers no registers. ; @todo version that takes A/Y pointer to float instead @@ -336,7 +336,7 @@ sub print_float_ln (value: float) { ; ---- this block contains (character) Screen and text I/O related functions ---- -asmsub clear_screen (char: ubyte @ A, color: ubyte @ Y) -> clobbers(A,X) -> () { +asmsub clear_screen (ubyte char @ A, ubyte color @ Y) -> clobbers(A,X) -> () { ; ---- clear the character screen with the given fill character and character color. ; (assumes screen is at $0400, could be altered in the future with self-modifying code) ; @todo some byte var to set the SCREEN ADDR HI BYTE @@ -366,7 +366,7 @@ _loop lda #0 } -asmsub scroll_left_full (alsocolors: ubyte @ Pc) -> clobbers(A, X, Y) -> () { +asmsub scroll_left_full (ubyte alsocolors @ Pc) -> clobbers(A, X, Y) -> () { ; ---- scroll the whole screen 1 character to the left ; contents of the rightmost column are unchanged, you should clear/refill this yourself ; Carry flag determines if screen color data must be scrolled too @@ -425,7 +425,7 @@ _scroll_screen ; scroll the screen memory } -asmsub scroll_right_full (alsocolors: ubyte @ Pc) -> clobbers(A,X) -> () { +asmsub scroll_right_full (ubyte alsocolors @ Pc) -> clobbers(A,X) -> () { ; ---- scroll the whole screen 1 character to the right ; contents of the leftmost column are unchanged, you should clear/refill this yourself ; Carry flag determines if screen color data must be scrolled too @@ -476,7 +476,7 @@ _scroll_screen ; scroll the screen memory } -asmsub scroll_up_full (alsocolors: ubyte @ Pc) -> clobbers(A,X) -> () { +asmsub scroll_up_full (ubyte alsocolors @ Pc) -> clobbers(A,X) -> () { ; ---- scroll the whole screen 1 character up ; contents of the bottom row are unchanged, you should refill/clear this yourself ; Carry flag determines if screen color data must be scrolled too @@ -527,7 +527,7 @@ _scroll_screen ; scroll the screen memory } -asmsub scroll_down_full (alsocolors: ubyte @ Pc) -> clobbers(A,X) -> () { +asmsub scroll_down_full (ubyte alsocolors @ Pc) -> clobbers(A,X) -> () { ; ---- scroll the whole screen 1 character down ; contents of the top row are unchanged, you should refill/clear this yourself ; Carry flag determines if screen color data must be scrolled too @@ -579,7 +579,7 @@ _scroll_screen ; scroll the screen memory -asmsub print_string (text: str @ AY) -> clobbers(A,Y) -> () { +asmsub print_string (str text @ AY) -> clobbers(A,Y) -> () { ; ---- print null terminated string from A/Y ; note: the compiler contains an optimization that will replace ; a call to this subroutine with a string argument of just one char, @@ -598,7 +598,7 @@ asmsub print_string (text: str @ AY) -> clobbers(A,Y) -> () { } -asmsub print_pstring (text: str_p @ AY) -> clobbers(A,X) -> (ubyte @ Y) { +asmsub print_pstring (str_p text @ AY) -> clobbers(A,X) -> (ubyte @ Y) { ; ---- print pstring (length as first byte) from A/Y, returns str len in Y %asm {{ sta c64.SCRATCH_ZPB1 @@ -617,7 +617,7 @@ asmsub print_pstring (text: str_p @ AY) -> clobbers(A,X) -> (ubyte @ Y) { } -asmsub print_ubyte0 (value: ubyte @ A) -> clobbers(A,X,Y) -> () { +asmsub print_ubyte0 (ubyte value @ A) -> clobbers(A,X,Y) -> () { ; ---- print the ubyte in A in decimal form, with left padding 0s (3 positions total) %asm {{ jsr c64utils.ubyte2decimal @@ -632,7 +632,7 @@ asmsub print_ubyte0 (value: ubyte @ A) -> clobbers(A,X,Y) -> () { } -asmsub print_ubyte (value: ubyte @ A) -> clobbers(A,X,Y) -> () { +asmsub print_ubyte (ubyte value @ A) -> clobbers(A,X,Y) -> () { ; ---- print the ubyte in A in decimal form, without left padding 0s %asm {{ jsr c64utils.ubyte2decimal @@ -653,7 +653,7 @@ _print_tens txa }} } -asmsub print_byte (value: byte @ A) -> clobbers(A,X,Y) -> () { +asmsub print_byte (byte value @ A) -> clobbers(A,X,Y) -> () { ; ---- print the byte in A in decimal form, without left padding 0s %asm {{ pha @@ -668,7 +668,7 @@ asmsub print_byte (value: byte @ A) -> clobbers(A,X,Y) -> () { } -asmsub print_ubyte_hex (prefix: ubyte @ Pc, value: ubyte @ A) -> clobbers(A,X,Y) -> () { +asmsub print_ubyte_hex (ubyte prefix @ Pc, ubyte value @ A) -> clobbers(A,X,Y) -> () { ; ---- print the ubyte in A in hex form (if Carry is set, a radix prefix '$' is printed as well) %asm {{ bcc + @@ -684,7 +684,7 @@ asmsub print_ubyte_hex (prefix: ubyte @ Pc, value: ubyte @ A) -> clobbers(A,X, } -asmsub print_uword_hex (prefix: ubyte @ Pc, value: uword @ AY) -> clobbers(A,X,Y) -> () { +asmsub print_uword_hex (ubyte prefix @ Pc, uword value @ AY) -> clobbers(A,X,Y) -> () { ; ---- print the uword in A/Y in hexadecimal form (4 digits) ; (if Carry is set, a radix prefix '$' is printed as well) %asm {{ @@ -698,7 +698,7 @@ asmsub print_uword_hex (prefix: ubyte @ Pc, value: uword @ AY) -> clobbers(A,X, } -asmsub print_uword0 (value: uword @ AY) -> clobbers(A,X,Y) -> () { +asmsub print_uword0 (uword value @ AY) -> clobbers(A,X,Y) -> () { ; ---- print the uword in A/Y in decimal form, with left padding 0s (5 positions total) ; @todo shorter in loop form? %asm {{ @@ -717,7 +717,7 @@ asmsub print_uword0 (value: uword @ AY) -> clobbers(A,X,Y) -> () { } -asmsub print_uword (value: uword @ AY) -> clobbers(A,X,Y) -> () { +asmsub print_uword (uword value @ AY) -> clobbers(A,X,Y) -> () { ; ---- print the uword in A/Y in decimal form, without left padding 0s %asm {{ jsr c64utils.uword2decimal @@ -749,7 +749,7 @@ _pr_decimal }} } -asmsub print_word (value: word @ AY) -> clobbers(A,X,Y) -> () { +asmsub print_word (word value @ AY) -> clobbers(A,X,Y) -> () { ; ---- print the (signed) word in A/Y in decimal form, without left padding 0s %asm {{ cpy #0 @@ -770,7 +770,7 @@ asmsub print_word (value: word @ AY) -> clobbers(A,X,Y) -> () { }} } -asmsub input_chars (buffer: uword @ AY) -> clobbers(A, X) -> (ubyte @ Y) { +asmsub input_chars (uword buffer @ AY) -> clobbers(A, X) -> (ubyte @ Y) { ; ---- Input a string (max. 80 chars) from the keyboard. Returns length in Y. ; It assumes the keyboard is selected as I/O channel! @@ -791,7 +791,7 @@ asmsub input_chars (buffer: uword @ AY) -> clobbers(A, X) -> (ubyte @ Y) { }} } -asmsub setchr (col: ubyte @Y, row: ubyte @A) -> clobbers(A) -> () { +asmsub setchr (ubyte col @Y, ubyte row @A) -> clobbers(A) -> () { ; ---- set the character in SCRATCH_ZPB1 on the screen matrix at the given position %asm {{ sty c64.SCRATCH_ZPREG @@ -813,7 +813,7 @@ _screenrows .word $0400 + range(0, 1000, 40) }} } -asmsub setclr (col: ubyte @Y, row: ubyte @A) -> clobbers(A) -> () { +asmsub setclr (ubyte col @Y, ubyte row @A) -> clobbers(A) -> () { ; ---- set the color in SCRATCH_ZPB1 on the screen matrix at the given position %asm {{ sty c64.SCRATCH_ZPREG @@ -836,7 +836,7 @@ _colorrows .word $d800 + range(0, 1000, 40) } -sub setchrclr (column: ubyte, row: ubyte, char: ubyte, color: ubyte) { +sub setchrclr (ubyte column, ubyte row, ubyte char, ubyte color) { ; ---- set char+color at the given position on the screen %asm {{ lda setchrclr_row @@ -866,5 +866,17 @@ _colormod sta $ffff ; modified }} } +asmsub PLOT (ubyte col @ Y, ubyte row @ A) -> clobbers(A) -> () { + ; ---- safe wrapper around PLOT kernel routine, to save the X register. + %asm {{ + stx c64.SCRATCH_ZPREGX + tax + clc + jsr c64.PLOT + ldx c64.SCRATCH_ZPREGX + rts + }} +} + } ; ---- end block c64scr diff --git a/prog8lib/mathlib.p8 b/prog8lib/mathlib.p8 index bdd79df33..81fab6f24 100644 --- a/prog8lib/mathlib.p8 +++ b/prog8lib/mathlib.p8 @@ -19,7 +19,7 @@ -asmsub multiply_bytes (byte1: ubyte @ A, byte2: ubyte @ Y) -> clobbers(X) -> (ubyte @ A) { +asmsub multiply_bytes (ubyte byte1 @ A, ubyte byte2 @ Y) -> clobbers(X) -> (ubyte @ A) { ; ---- multiply 2 bytes, result as byte in A (signed or unsigned) %asm {{ sta SCRATCH_ZPB1 @@ -37,7 +37,7 @@ asmsub multiply_bytes (byte1: ubyte @ A, byte2: ubyte @ Y) -> clobbers(X) -> ( } -asmsub multiply_bytes_16 (byte1: ubyte @ A, byte2: ubyte @ Y) -> clobbers(X) -> (uword @ AY) { +asmsub multiply_bytes_16 (ubyte byte1 @ A, ubyte byte2 @ Y) -> clobbers(X) -> (uword @ AY) { ; ---- multiply 2 bytes, result as word in A/Y (unsigned) %asm {{ sta SCRATCH_ZPB1 @@ -59,7 +59,7 @@ asmsub multiply_bytes_16 (byte1: ubyte @ A, byte2: ubyte @ Y) -> clobbers(X) - } word[2] multiply_words_product = 0 -asmsub multiply_words (number: uword @ AY) -> clobbers(A,X) -> () { +asmsub multiply_words (uword number @ AY) -> clobbers(A,X) -> () { ; ---- multiply two 16-bit words into a 32-bit result ; input: A/Y = first 16-bit number, SCRATCH_ZPWORD1 in ZP = second 16-bit number ; output: multiply_words_product 32-bits product, LSB order (low-to-high) @@ -93,7 +93,7 @@ mult16 lda #$00 } -asmsub divmod_bytes (number: ubyte @ X, divisor: ubyte @ Y) -> clobbers() -> (ubyte @ X, ubyte @ A) { +asmsub divmod_bytes (ubyte number @ X, ubyte divisor @ Y) -> clobbers() -> (ubyte @ X, ubyte @ A) { ; ---- divide X by Y, result quotient in X, remainder in A (unsigned) ; division by zero will result in quotient = 255 and remainder = original number %asm {{ @@ -116,7 +116,7 @@ asmsub divmod_bytes (number: ubyte @ X, divisor: ubyte @ Y) -> clobbers() -> ( }} } -asmsub divmod_words (divisor: uword @ AY) -> clobbers(X) -> (uword @ AY) { +asmsub divmod_words (uword divisor @ AY) -> clobbers(X) -> (uword @ AY) { ; ---- divide two words (16 bit each) into 16 bit results ; input: SCRATCH_ZPWORD1 in ZP: 16 bit number, A/Y: 16 bit divisor ; output: SCRATCH_ZPWORD1 in ZP: 16 bit result, A/Y: 16 bit remainder @@ -164,7 +164,7 @@ remainder = SCRATCH_ZPB1 }} } -asmsub randseed (seed: uword @ AY) -> clobbers(A, Y) -> () { +asmsub randseed (uword seed @ AY) -> clobbers(A, Y) -> () { ; ---- reset the random seeds for the byte and word random generators ; default starting values are: A=$2c Y=$9e %asm {{