From af0d52b5c296b9a2553a02bd5900755ada4b55b2 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Tue, 2 Oct 2018 03:07:46 +0200 Subject: [PATCH] assignment to array-indexed --- compiler/antlr/prog8.g4 | 1 + compiler/examples/spincube.p8 | 94 +- compiler/examples/test.p8 | 46 +- compiler/src/prog8/ast/AST.kt | 42 +- compiler/src/prog8/ast/AstChecker.kt | 15 +- compiler/src/prog8/compiler/Compiler.kt | 77 +- .../prog8/optimizing/StatementOptimizer.kt | 2 +- compiler/src/prog8/parser/prog8Parser.java | 847 +++++++++--------- compiler/src/prog8/stackvm/Program.kt | 2 +- compiler/src/prog8/stackvm/StackVm.kt | 47 +- 10 files changed, 633 insertions(+), 540 deletions(-) diff --git a/compiler/antlr/prog8.g4 b/compiler/antlr/prog8.g4 index 0e39a1b85..28b34484c 100644 --- a/compiler/antlr/prog8.g4 +++ b/compiler/antlr/prog8.g4 @@ -117,6 +117,7 @@ assign_target: register | identifier | scoped_identifier + | arrayindexed ; postincrdecr : assign_target operator = ('++' | '--') ; diff --git a/compiler/examples/spincube.p8 b/compiler/examples/spincube.p8 index d2d54dc5f..9903811b4 100644 --- a/compiler/examples/spincube.p8 +++ b/compiler/examples/spincube.p8 @@ -16,81 +16,61 @@ const word width = 320 const word height = 200 - float x1 = -1.0 - float y1 = 1.0 + float[6] xcoor = [-1.0, 1.0, 1.0, 0.5, 0.2, -1.0] + float[6] ycoor = [1.0, 1.0, -1.0, -0.3, -0.6, -1.0] - float x2 = 1.0 - float y2 = 1.0 - - float x3 = 1.0 - float y3 = -1.0 - - float x4 = -1.0 - float y4 = -1.0 - - - float rx1 - float rx2 - float rx3 - float rx4 - float ry1 - float ry2 - float ry3 - float ry4 + float[len(xcoor)] rotatedx + float[len(ycoor)] rotatedy sub start() { - float t - _vm_gfx_clearscr(0) + byte i while(1) { if irq.time_changed { irq.time_changed = 0 _vm_gfx_clearscr(0) - _vm_gfx_text(130, 80, 5, "Spin !!!") - t = flt(irq.global_time) / 60.0 - rotate_all(t) - plot_pixels() + _vm_gfx_text(120, 40, 5, "Spin to Win !!!") + + for i in 0 to width//10 { + _vm_gfx_line(i*2+100, 100, i*10, 199, 6) + } + + rotate_points(flt(irq.global_time) / 30.0) + draw_lines() } } } - sub rotate_all(t: float) { - rx1 = x1 * cos(t) - y1 * sin(t) - ry1 = x1 * sin(t) + y1 * cos(t) + sub rotate_points(t: float) { - rx2 = x2 * cos(t) - y2 * sin(t) - ry2 = x2 * sin(t) + y2 * cos(t) + ; rotate around origin (0,0) and zoom a bit + byte i + float zoom + zoom = (0.6 + sin(t*1.4)/2.2) - rx3 = x3 * cos(t) - y3 * sin(t) - ry3 = x3 * sin(t) + y3 * cos(t) - - rx4 = x4 * cos(t) - y4 * sin(t) - ry4 = x4 * sin(t) + y4 * cos(t) + for i in 0 to len(xcoor)-1 { + rotatedx[i] = xcoor[i] * cos(t) - ycoor[i] * sin(t) + rotatedy[i] = xcoor[i] * sin(t) + ycoor[i] * cos(t) + rotatedx[i] *= zoom + rotatedy[i] *= zoom + } } - sub plot_pixels() { - word sx1 - word sx2 - word sx3 - word sx4 - word sy1 - word sy2 - word sy3 - word sy4 + sub draw_lines() { + byte i - sx1 = floor(rx1 * height/3 + width/2) - sx2 = floor(rx2 * height/3 + width/2) - sx3 = floor(rx3 * height/3 + width/2) - sx4 = floor(rx4 * height/3 + width/2) - sy1 = floor(ry1 * height/3 + height/2) - sy2 = floor(ry2 * height/3 + height/2) - sy3 = floor(ry3 * height/3 + height/2) - sy4 = floor(ry4 * height/3 + height/2) + sub toscreenx(x: float) -> word { + return floor(x * height/3 + width /2) + } - _vm_gfx_line(sx1, sy1, sx2, sy2, 1) - _vm_gfx_line(sx2, sy2, sx3, sy3, 7) - _vm_gfx_line(sx3, sy3, sx4, sy4, 10) - _vm_gfx_line(sx4, sy4, sx1, sy1, 14) + sub toscreeny(y: float) -> word { + return floor(y * height/3 + height /2) + } + + for i in 0 to len(xcoor)-2 { + _vm_gfx_line(toscreenx(rotatedx[i]), toscreeny(rotatedy[i]), toscreenx(rotatedx[i+1]), toscreeny(rotatedy[i+1]), i+7) + } + _vm_gfx_line(toscreenx(rotatedx[len(xcoor)-1]), toscreeny(rotatedy[len(xcoor)-1]), toscreenx(rotatedx[0]), toscreeny(rotatedy[0]), 14) } } diff --git a/compiler/examples/test.p8 b/compiler/examples/test.p8 index f8accd4bc..da81b4c67 100644 --- a/compiler/examples/test.p8 +++ b/compiler/examples/test.p8 @@ -27,30 +27,36 @@ sub start() { byte i word w - for i in 0 to 2 { - _vm_write_num(farray5[i]) - _vm_write_char('\n') - } + ;warray3[1] = warray3[1] + 1 + warray3[1] += 1 + ;warray3[1] ++ - for w in [1,2,3777] { ;@todo loop over array literal - _vm_write_num(w) - _vm_write_char('\n') - } - for i in barray3 { ; @todo loop over symbol - _vm_write_num(i) - _vm_write_char('\n') - } - for i in "hello" { ; @todo loop over string - _vm_write_num(i) - _vm_write_char('\n') - } +; for i in 0 to 2 { +; _vm_write_num(farray5[i]) +; _vm_write_char('\n') +; } - for w in "hello" { ; @todo loop over string - _vm_write_num(w) - _vm_write_char('\n') - } +; for w in [1,2,3777] { ;@todo loop over array literal +; _vm_write_num(w) +; _vm_write_char('\n') +; } +; +; for i in barray3 { ; @todo loop over symbol +; _vm_write_num(i) +; _vm_write_char('\n') +; } +; +; for i in "hello" { ; @todo loop over string +; _vm_write_num(i) +; _vm_write_char('\n') +; } +; +; for w in "hello" { ; @todo loop over string +; _vm_write_num(w) +; _vm_write_char('\n') +; } return diff --git a/compiler/src/prog8/ast/AST.kt b/compiler/src/prog8/ast/AST.kt index 0cb2f050f..37c9b36a6 100644 --- a/compiler/src/prog8/ast/AST.kt +++ b/compiler/src/prog8/ast/AST.kt @@ -226,6 +226,12 @@ interface IAstProcessor { arrayIndexedExpression.array.process(this) return arrayIndexedExpression } + + fun process(assignTarget: AssignTarget): AssignTarget { + assignTarget.arrayindexed?.process(this) + assignTarget.identifier?.process(this) + return assignTarget + } } @@ -674,25 +680,39 @@ class Assignment(var target: AssignTarget, val aug_op : String?, var value: IExp } } -data class AssignTarget(val register: Register?, val identifier: IdentifierReference?, override val position: Position) : Node { +data class AssignTarget(val register: Register?, + val identifier: IdentifierReference?, + val arrayindexed: ArrayIndexedExpression?, + override val position: Position) : Node { override lateinit var parent: Node override fun linkParents(parent: Node) { this.parent = parent identifier?.linkParents(this) + arrayindexed?.linkParents(this) } - fun process(processor: IAstProcessor) = this + fun process(processor: IAstProcessor) = processor.process(this) - fun determineDatatype(namespace: INameScope, stmt: IStatement): DataType { + fun determineDatatype(namespace: INameScope, heap: HeapValues, stmt: IStatement): DataType { if(register!=null) return when(register){ Register.A, Register.X, Register.Y -> DataType.BYTE Register.AX, Register.AY, Register.XY -> DataType.WORD } - val symbol = namespace.lookup(identifier!!.nameInSource, stmt) ?: throw FatalAstException("symbol lookup failed: ${identifier.nameInSource}") - if(symbol is VarDecl) return symbol.datatype + if(identifier!=null) { + val symbol = namespace.lookup(identifier.nameInSource, stmt) + ?: throw FatalAstException("symbol lookup failed: ${identifier.nameInSource}") + if (symbol is VarDecl) return symbol.datatype + } + + if(arrayindexed!=null) { + val dt = arrayindexed.resultingDatatype(namespace, heap) + if(dt!=null) + return dt + } + throw FatalAstException("cannot determine datatype of assignment target $this") } } @@ -1685,10 +1705,12 @@ private fun prog8Parser.Sub_paramsContext.toAst(): List = private fun prog8Parser.Assign_targetContext.toAst() : AssignTarget { val register = register()?.toAst() val identifier = identifier() - return if(identifier!=null) - AssignTarget(register, identifier.toAst(), toPosition()) - else - AssignTarget(register, scoped_identifier()?.toAst(), toPosition()) + return when { + register!=null -> AssignTarget(register, null, null, toPosition()) + identifier!=null -> AssignTarget(null, identifier.toAst(), null, toPosition()) + arrayindexed()!=null -> AssignTarget(null, null, arrayindexed().toAst(), toPosition()) + else -> AssignTarget(null, scoped_identifier()?.toAst(), null, toPosition()) + } } @@ -1810,7 +1832,7 @@ private fun prog8Parser.ExpressionContext.toAst() : IExpression { throw FatalAstException(text) } -private fun prog8Parser.ArrayindexedContext.toAst(): IExpression { +private fun prog8Parser.ArrayindexedContext.toAst(): ArrayIndexedExpression { return ArrayIndexedExpression(identifier()?.toAst() ?: scoped_identifier()?.toAst(), register()?.toAst(), arrayspec().toAst(), diff --git a/compiler/src/prog8/ast/AstChecker.kt b/compiler/src/prog8/ast/AstChecker.kt index 227558d0f..d7b3fc905 100644 --- a/compiler/src/prog8/ast/AstChecker.kt +++ b/compiler/src/prog8/ast/AstChecker.kt @@ -251,6 +251,8 @@ class AstChecker(private val namespace: INameScope, * Also check data type compatibility */ override fun process(assignment: Assignment): IStatement { + // todo deal with target.arrayindexed + if(assignment.target.identifier!=null) { val targetName = assignment.target.identifier!!.nameInSource val targetSymbol = namespace.lookup(targetName, assignment) @@ -276,8 +278,13 @@ class AstChecker(private val namespace: INameScope, val target: IExpression = if(assignment.target.register!=null) RegisterExpr(assignment.target.register!!, assignment.target.position) - else + else if(assignment.target.identifier!=null) assignment.target.identifier!! + else if(assignment.target.arrayindexed!=null) { + // todo deal with target.arrayindexed + assignment.target.arrayindexed!! + } else throw FatalAstException("strange assignment") + val expression = BinaryExpression(target, assignment.aug_op.substringBeforeLast('='), assignment.value, assignment.position) expression.linkParents(assignment.parent) val assignment2 = Assignment(assignment.target, null, expression, assignment.position) @@ -285,7 +292,7 @@ class AstChecker(private val namespace: INameScope, return process(assignment2) } - val targetDatatype = assignment.target.determineDatatype(namespace, assignment) + val targetDatatype = assignment.target.determineDatatype(namespace, heap, assignment) val constVal = assignment.value.constValue(namespace, heap) if(constVal!=null) { checkValueTypeAndRange(targetDatatype, null, constVal, heap) @@ -550,7 +557,7 @@ class AstChecker(private val namespace: INameScope, } override fun process(postIncrDecr: PostIncrDecr): IStatement { - if(postIncrDecr.target.register==null) { + if(postIncrDecr.target.identifier!=null) { val targetName = postIncrDecr.target.identifier!!.nameInSource val target = namespace.lookup(targetName, postIncrDecr) if(target==null) { @@ -562,6 +569,8 @@ class AstChecker(private val namespace: INameScope, checkResult.add(SyntaxError("can only increment or decrement a byte/float/word variable", postIncrDecr.position)) } } + } else if(postIncrDecr.target.arrayindexed!=null) { + // todo deal with target.arrayindexed } return super.process(postIncrDecr) } diff --git a/compiler/src/prog8/compiler/Compiler.kt b/compiler/src/prog8/compiler/Compiler.kt index a0295035d..278bb737a 100644 --- a/compiler/src/prog8/compiler/Compiler.kt +++ b/compiler/src/prog8/compiler/Compiler.kt @@ -444,7 +444,7 @@ private class StatementTranslator(private val stackvmProg: StackVmProgram, } } is IdentifierReference -> translate(expr) - is ArrayIndexedExpression -> translate(expr) + is ArrayIndexedExpression -> translate(expr, false) is RangeExpr -> { TODO("TRANSLATE range $expr") } @@ -592,7 +592,7 @@ private class StatementTranslator(private val stackvmProg: StackVmProgram, stackvmProg.instr(opcode) } - private fun translate(arrayindexed: ArrayIndexedExpression) { + private fun translate(arrayindexed: ArrayIndexedExpression, write: Boolean) { val variable = arrayindexed.identifier?.targetStatement(namespace) as? VarDecl val variableName = if(arrayindexed.register!=null) { @@ -615,7 +615,11 @@ private class StatementTranslator(private val stackvmProg: StackVmProgram, stackvmProg.instr(Opcode.MUL) stackvmProg.instr(Opcode.ADD) } - stackvmProg.instr(Opcode.PUSH_INDEXED_VAR, callLabel = variableName) + + if(write) + stackvmProg.instr(Opcode.WRITE_INDEXED_VAR, callLabel = variableName) + else + stackvmProg.instr(Opcode.READ_INDEXED_VAR, callLabel = variableName) } @@ -652,17 +656,29 @@ private class StatementTranslator(private val stackvmProg: StackVmProgram, private fun translate(stmt: PostIncrDecr) { stackvmProg.line(stmt.position) - if(stmt.target.register!=null) { - when(stmt.operator) { + when { + stmt.target.register!=null -> when(stmt.operator) { "++" -> stackvmProg.instr(Opcode.INC_VAR, callLabel = stmt.target.register.toString()) "--" -> stackvmProg.instr(Opcode.DEC_VAR, callLabel = stmt.target.register.toString()) } - } else { - val targetStatement = stmt.target.identifier!!.targetStatement(namespace) as VarDecl - when(stmt.operator) { - "++" -> stackvmProg.instr(Opcode.INC_VAR, callLabel = targetStatement.scopedname) - "--" -> stackvmProg.instr(Opcode.DEC_VAR, callLabel = targetStatement.scopedname) + stmt.target.identifier!=null -> { + val targetStatement = stmt.target.identifier!!.targetStatement(namespace) as VarDecl + when(stmt.operator) { + "++" -> stackvmProg.instr(Opcode.INC_VAR, callLabel = targetStatement.scopedname) + "--" -> stackvmProg.instr(Opcode.DEC_VAR, callLabel = targetStatement.scopedname) + } } + stmt.target.arrayindexed!=null -> { + // todo: generate more efficient bytecode for this? + translate(stmt.target.arrayindexed!!, false) + stackvmProg.instr(Opcode.PUSH, Value(stmt.target.arrayindexed!!.resultingDatatype(namespace, heap)!!, 1)) + when(stmt.operator) { + "++" -> stackvmProg.instr(Opcode.ADD) + "--" -> stackvmProg.instr(Opcode.SUB) + } + translate(stmt.target.arrayindexed!!, true) + } + else -> throw CompilerException("very strange postincrdecr") } } @@ -670,7 +686,7 @@ private class StatementTranslator(private val stackvmProg: StackVmProgram, stackvmProg.line(stmt.position) translate(stmt.value) val valueDt = stmt.value.resultingDatatype(namespace, heap) - val targetDt = stmt.target.determineDatatype(namespace, stmt) + val targetDt = stmt.target.determineDatatype(namespace, heap, stmt) if(valueDt!=targetDt) { // convert value to target datatype if possible when(targetDt) { @@ -696,27 +712,32 @@ private class StatementTranslator(private val stackvmProg: StackVmProgram, if(stmt.aug_op!=null) { // augmented assignment - if(stmt.target.identifier!=null) { - val target = stmt.target.identifier!!.targetStatement(namespace)!! - when(target) { - is VarDecl -> stackvmProg.instr(Opcode.PUSH_VAR, callLabel = target.scopedname) - else -> throw CompilerException("invalid assignment target type ${target::class}") + when { + stmt.target.identifier!=null -> { + val target = stmt.target.identifier!!.targetStatement(namespace)!! + when(target) { + is VarDecl -> stackvmProg.instr(Opcode.PUSH_VAR, callLabel = target.scopedname) + else -> throw CompilerException("invalid assignment target type ${target::class}") + } } - } else if(stmt.target.register!=null) { - stackvmProg.instr(Opcode.PUSH_VAR, callLabel = stmt.target.register.toString()) + stmt.target.register!=null -> stackvmProg.instr(Opcode.PUSH_VAR, callLabel = stmt.target.register.toString()) + stmt.target.arrayindexed!=null -> translate(stmt.target.arrayindexed!!, false) } + translateAugAssignOperator(stmt.aug_op) } // pop the result value back into the assignment target - if(stmt.target.identifier!=null) { - val target = stmt.target.identifier!!.targetStatement(namespace)!! - when(target) { - is VarDecl -> stackvmProg.instr(Opcode.POP_VAR, callLabel = target.scopedname) - else -> throw CompilerException("invalid assignment target type ${target::class}") + when { + stmt.target.identifier!=null -> { + val target = stmt.target.identifier!!.targetStatement(namespace)!! + when(target) { + is VarDecl -> stackvmProg.instr(Opcode.POP_VAR, callLabel = target.scopedname) + else -> throw CompilerException("invalid assignment target type ${target::class}") + } } - } else if(stmt.target.register!=null) { - stackvmProg.instr(Opcode.POP_VAR, callLabel = stmt.target.register.toString()) + stmt.target.register!=null -> stackvmProg.instr(Opcode.POP_VAR, callLabel = stmt.target.register.toString()) + stmt.target.arrayindexed!=null -> translate(stmt.target.arrayindexed!!, true) // write value to it } } @@ -915,9 +936,9 @@ private class StatementTranslator(private val stackvmProg: StackVmProgram, */ fun makeAssignmentTarget(): AssignTarget { return if(varname!=null) - AssignTarget(null, IdentifierReference(varname, range.position), range.position) + AssignTarget(null, IdentifierReference(varname, range.position), null, range.position) else - AssignTarget(register, null, range.position) + AssignTarget(register, null, null, range.position) } val startAssignment = Assignment(makeAssignmentTarget(), null, range.from, range.position) @@ -970,6 +991,8 @@ private class StatementTranslator(private val stackvmProg: StackVmProgram, } else { null } + // todo deal with target.arrayindexed? + when (literalStepValue) { 1 -> { diff --git a/compiler/src/prog8/optimizing/StatementOptimizer.kt b/compiler/src/prog8/optimizing/StatementOptimizer.kt index b7533d5ed..1296e499e 100644 --- a/compiler/src/prog8/optimizing/StatementOptimizer.kt +++ b/compiler/src/prog8/optimizing/StatementOptimizer.kt @@ -67,7 +67,7 @@ class StatementOptimizer(private val globalNamespace: INameScope, private val he if(range.size()==1) { // for loop over a (constant) range of just a single value-- optimize the loop away // loopvar/reg = range value , follow by block - val assignment = Assignment(AssignTarget(forLoop.loopRegister, forLoop.loopVar, forLoop.position), null, range.from, forLoop.position) + val assignment = Assignment(AssignTarget(forLoop.loopRegister, forLoop.loopVar, null, forLoop.position), null, range.from, forLoop.position) forLoop.body.add(0, assignment) return AnonymousStatementList(forLoop.parent, forLoop.body, forLoop.position) } diff --git a/compiler/src/prog8/parser/prog8Parser.java b/compiler/src/prog8/parser/prog8Parser.java index 6c9581791..36c9b9fad 100644 --- a/compiler/src/prog8/parser/prog8Parser.java +++ b/compiler/src/prog8/parser/prog8Parser.java @@ -1177,6 +1177,9 @@ public class prog8Parser extends Parser { public Scoped_identifierContext scoped_identifier() { return getRuleContext(Scoped_identifierContext.class,0); } + public ArrayindexedContext arrayindexed() { + return getRuleContext(ArrayindexedContext.class,0); + } public Assign_targetContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -1187,7 +1190,7 @@ public class prog8Parser extends Parser { Assign_targetContext _localctx = new Assign_targetContext(_ctx, getState()); enterRule(_localctx, 32, RULE_assign_target); try { - setState(232); + setState(233); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,13,_ctx) ) { case 1: @@ -1211,6 +1214,13 @@ public class prog8Parser extends Parser { scoped_identifier(); } break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(232); + arrayindexed(); + } + break; } } catch (RecognitionException re) { @@ -1242,9 +1252,9 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(234); - assign_target(); setState(235); + assign_target(); + setState(236); ((PostincrdecrContext)_localctx).operator = _input.LT(1); _la = _input.LA(1); if ( !(_la==T__34 || _la==T__35) ) { @@ -1322,28 +1332,28 @@ public class prog8Parser extends Parser { int _alt; enterOuterAlt(_localctx, 1); { - setState(252); + setState(253); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,14,_ctx) ) { case 1: { - setState(238); - match(T__36); setState(239); - expression(0); + match(T__36); setState(240); + expression(0); + setState(241); match(T__37); } break; case 2: { - setState(242); + setState(243); functioncall(); } break; case 3: { - setState(243); + setState(244); ((ExpressionContext)_localctx).prefix = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__38) | (1L << T__39))) != 0)) ) { @@ -1354,51 +1364,51 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(244); + setState(245); expression(19); } break; case 4: { - setState(245); - ((ExpressionContext)_localctx).prefix = match(T__59); setState(246); + ((ExpressionContext)_localctx).prefix = match(T__59); + setState(247); expression(6); } break; case 5: { - setState(247); + setState(248); literalvalue(); } break; case 6: { - setState(248); + setState(249); register(); } break; case 7: { - setState(249); + setState(250); identifier(); } break; case 8: { - setState(250); + setState(251); scoped_identifier(); } break; case 9: { - setState(251); + setState(252); arrayindexed(); } break; } _ctx.stop = _input.LT(-1); - setState(296); + setState(297); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,17,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -1406,7 +1416,7 @@ public class prog8Parser extends Parser { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(294); + setState(295); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) { case 1: @@ -1415,11 +1425,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(254); - if (!(precpred(_ctx, 18))) throw new FailedPredicateException(this, "precpred(_ctx, 18)"); setState(255); - ((ExpressionContext)_localctx).bop = match(T__40); + if (!(precpred(_ctx, 18))) throw new FailedPredicateException(this, "precpred(_ctx, 18)"); setState(256); + ((ExpressionContext)_localctx).bop = match(T__40); + setState(257); ((ExpressionContext)_localctx).right = expression(19); } break; @@ -1429,9 +1439,9 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(257); - if (!(precpred(_ctx, 17))) throw new FailedPredicateException(this, "precpred(_ctx, 17)"); setState(258); + if (!(precpred(_ctx, 17))) throw new FailedPredicateException(this, "precpred(_ctx, 17)"); + setState(259); ((ExpressionContext)_localctx).bop = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__41) | (1L << T__42) | (1L << T__43) | (1L << T__44))) != 0)) ) { @@ -1442,7 +1452,7 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(259); + setState(260); ((ExpressionContext)_localctx).right = expression(18); } break; @@ -1452,9 +1462,9 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(260); - if (!(precpred(_ctx, 16))) throw new FailedPredicateException(this, "precpred(_ctx, 16)"); setState(261); + if (!(precpred(_ctx, 16))) throw new FailedPredicateException(this, "precpred(_ctx, 16)"); + setState(262); ((ExpressionContext)_localctx).bop = _input.LT(1); _la = _input.LA(1); if ( !(_la==T__38 || _la==T__39) ) { @@ -1465,7 +1475,7 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(262); + setState(263); ((ExpressionContext)_localctx).right = expression(17); } break; @@ -1475,9 +1485,9 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(263); - if (!(precpred(_ctx, 15))) throw new FailedPredicateException(this, "precpred(_ctx, 15)"); setState(264); + if (!(precpred(_ctx, 15))) throw new FailedPredicateException(this, "precpred(_ctx, 15)"); + 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)) ) { @@ -1488,7 +1498,7 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(265); + setState(266); ((ExpressionContext)_localctx).right = expression(16); } break; @@ -1498,9 +1508,9 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(266); - if (!(precpred(_ctx, 14))) throw new FailedPredicateException(this, "precpred(_ctx, 14)"); setState(267); + if (!(precpred(_ctx, 14))) throw new FailedPredicateException(this, "precpred(_ctx, 14)"); + setState(268); ((ExpressionContext)_localctx).bop = _input.LT(1); _la = _input.LA(1); if ( !(_la==T__49 || _la==T__50) ) { @@ -1511,7 +1521,7 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(268); + setState(269); ((ExpressionContext)_localctx).right = expression(15); } break; @@ -1521,11 +1531,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(269); - if (!(precpred(_ctx, 13))) throw new FailedPredicateException(this, "precpred(_ctx, 13)"); setState(270); - ((ExpressionContext)_localctx).bop = match(T__51); + if (!(precpred(_ctx, 13))) throw new FailedPredicateException(this, "precpred(_ctx, 13)"); setState(271); + ((ExpressionContext)_localctx).bop = match(T__51); + setState(272); ((ExpressionContext)_localctx).right = expression(14); } break; @@ -1535,11 +1545,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(272); - if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)"); setState(273); - ((ExpressionContext)_localctx).bop = match(T__52); + if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)"); setState(274); + ((ExpressionContext)_localctx).bop = match(T__52); + setState(275); ((ExpressionContext)_localctx).right = expression(13); } break; @@ -1549,11 +1559,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(275); - if (!(precpred(_ctx, 11))) throw new FailedPredicateException(this, "precpred(_ctx, 11)"); setState(276); - ((ExpressionContext)_localctx).bop = match(T__53); + if (!(precpred(_ctx, 11))) throw new FailedPredicateException(this, "precpred(_ctx, 11)"); setState(277); + ((ExpressionContext)_localctx).bop = match(T__53); + setState(278); ((ExpressionContext)_localctx).right = expression(12); } break; @@ -1563,11 +1573,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(278); - if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); setState(279); - ((ExpressionContext)_localctx).bop = match(T__56); + if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); setState(280); + ((ExpressionContext)_localctx).bop = match(T__56); + setState(281); ((ExpressionContext)_localctx).right = expression(10); } break; @@ -1577,11 +1587,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(281); - if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); setState(282); - ((ExpressionContext)_localctx).bop = match(T__57); + if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); setState(283); + ((ExpressionContext)_localctx).bop = match(T__57); + setState(284); ((ExpressionContext)_localctx).right = expression(9); } break; @@ -1591,11 +1601,11 @@ public class prog8Parser extends Parser { _localctx.left = _prevctx; _localctx.left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(284); - if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); setState(285); - ((ExpressionContext)_localctx).bop = match(T__58); + if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); setState(286); + ((ExpressionContext)_localctx).bop = match(T__58); + setState(287); ((ExpressionContext)_localctx).right = expression(8); } break; @@ -1605,20 +1615,20 @@ public class prog8Parser extends Parser { _localctx.rangefrom = _prevctx; _localctx.rangefrom = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(287); - if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); setState(288); - match(T__54); + if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); setState(289); + match(T__54); + setState(290); ((ExpressionContext)_localctx).rangeto = expression(0); - setState(292); + setState(293); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) { case 1: { - setState(290); - match(T__55); setState(291); + match(T__55); + setState(292); ((ExpressionContext)_localctx).rangestep = expression(0); } break; @@ -1628,7 +1638,7 @@ public class prog8Parser extends Parser { } } } - setState(298); + setState(299); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,17,_ctx); } @@ -1670,29 +1680,29 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(302); + setState(303); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { case 1: { - setState(299); + setState(300); identifier(); } break; case 2: { - setState(300); + setState(301); scoped_identifier(); } break; case 3: { - setState(301); + setState(302); register(); } break; } - setState(304); + setState(305); arrayspec(); } } @@ -1730,35 +1740,35 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(308); + setState(309); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) { case 1: { - setState(306); + setState(307); identifier(); } break; case 2: { - setState(307); + setState(308); scoped_identifier(); } break; } - setState(310); + setState(311); match(T__36); - setState(312); + setState(313); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__23) | (1L << T__36) | (1L << T__38) | (1L << T__39) | (1L << T__59))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (T__64 - 65)) | (1L << (T__65 - 65)) | (1L << (T__66 - 65)) | (1L << (T__67 - 65)) | (1L << (T__68 - 65)) | (1L << (T__69 - 65)) | (1L << (T__75 - 65)) | (1L << (T__76 - 65)) | (1L << (NAME - 65)) | (1L << (DEC_INTEGER - 65)) | (1L << (HEX_INTEGER - 65)) | (1L << (BIN_INTEGER - 65)) | (1L << (FLOAT_NUMBER - 65)) | (1L << (STRING - 65)) | (1L << (SINGLECHAR - 65)))) != 0)) { { - setState(311); + setState(312); expression_list(); } } - setState(314); + setState(315); match(T__37); } } @@ -1796,35 +1806,35 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(318); + setState(319); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) { case 1: { - setState(316); + setState(317); identifier(); } break; case 2: { - setState(317); + setState(318); scoped_identifier(); } break; } - setState(320); + setState(321); match(T__36); - setState(322); + setState(323); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__23) | (1L << T__36) | (1L << T__38) | (1L << T__39) | (1L << T__59))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (T__64 - 65)) | (1L << (T__65 - 65)) | (1L << (T__66 - 65)) | (1L << (T__67 - 65)) | (1L << (T__68 - 65)) | (1L << (T__69 - 65)) | (1L << (T__75 - 65)) | (1L << (T__76 - 65)) | (1L << (NAME - 65)) | (1L << (DEC_INTEGER - 65)) | (1L << (HEX_INTEGER - 65)) | (1L << (BIN_INTEGER - 65)) | (1L << (FLOAT_NUMBER - 65)) | (1L << (STRING - 65)) | (1L << (SINGLECHAR - 65)))) != 0)) { { - setState(321); + setState(322); expression_list(); } } - setState(324); + setState(325); match(T__37); } } @@ -1859,21 +1869,21 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(326); + setState(327); expression(0); - setState(331); + setState(332); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__12) { { { - setState(327); - match(T__12); setState(328); + match(T__12); + setState(329); expression(0); } } - setState(333); + setState(334); _errHandler.sync(this); _la = _input.LA(1); } @@ -1906,14 +1916,14 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(334); + setState(335); match(T__60); - setState(336); + setState(337); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) { case 1: { - setState(335); + setState(336); expression_list(); } break; @@ -1944,7 +1954,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(338); + setState(339); match(T__61); } } @@ -1972,7 +1982,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(340); + setState(341); match(T__62); } } @@ -2001,7 +2011,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(342); + setState(343); match(NAME); } } @@ -2034,9 +2044,9 @@ public class prog8Parser extends Parser { int _alt; enterOuterAlt(_localctx, 1); { - setState(344); + setState(345); match(NAME); - setState(347); + setState(348); _errHandler.sync(this); _alt = 1; do { @@ -2044,9 +2054,9 @@ public class prog8Parser extends Parser { case 1: { { - setState(345); - match(T__63); setState(346); + match(T__63); + setState(347); match(NAME); } } @@ -2054,7 +2064,7 @@ public class prog8Parser extends Parser { default: throw new NoViableAltException(this); } - setState(349); + setState(350); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,25,_ctx); } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); @@ -2085,7 +2095,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(351); + setState(352); _la = _input.LA(1); if ( !(((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (T__64 - 65)) | (1L << (T__65 - 65)) | (1L << (T__66 - 65)) | (1L << (T__67 - 65)) | (1L << (T__68 - 65)) | (1L << (T__69 - 65)))) != 0)) ) { _errHandler.recoverInline(this); @@ -2122,7 +2132,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(353); + setState(354); _la = _input.LA(1); if ( !(((((_la - 71)) & ~0x3f) == 0 && ((1L << (_la - 71)) & ((1L << (T__70 - 71)) | (1L << (T__71 - 71)) | (1L << (T__72 - 71)) | (1L << (T__73 - 71)))) != 0)) ) { _errHandler.recoverInline(this); @@ -2166,7 +2176,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(355); + setState(356); ((IntegerliteralContext)_localctx).intpart = _input.LT(1); _la = _input.LA(1); if ( !(((((_la - 110)) & ~0x3f) == 0 && ((1L << (_la - 110)) & ((1L << (DEC_INTEGER - 110)) | (1L << (HEX_INTEGER - 110)) | (1L << (BIN_INTEGER - 110)))) != 0)) ) { @@ -2177,12 +2187,12 @@ public class prog8Parser extends Parser { _errHandler.reportMatch(this); consume(); } - setState(357); + setState(358); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,26,_ctx) ) { case 1: { - setState(356); + setState(357); wordsuffix(); } break; @@ -2213,7 +2223,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(359); + setState(360); match(T__74); } } @@ -2242,7 +2252,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(361); + setState(362); _la = _input.LA(1); if ( !(_la==T__75 || _la==T__76) ) { _errHandler.recoverInline(this); @@ -2285,27 +2295,27 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(363); - match(T__23); setState(364); + match(T__23); + setState(365); expression(0); - setState(369); + setState(370); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__12) { { { - setState(365); - match(T__12); setState(366); + match(T__12); + setState(367); expression(0); } } - setState(371); + setState(372); _errHandler.sync(this); _la = _input.LA(1); } - setState(372); + setState(373); match(T__24); } } @@ -2334,7 +2344,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(374); + setState(375); match(STRING); } } @@ -2363,7 +2373,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(376); + setState(377); match(SINGLECHAR); } } @@ -2392,7 +2402,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(378); + setState(379); match(FLOAT_NUMBER); } } @@ -2436,7 +2446,7 @@ public class prog8Parser extends Parser { LiteralvalueContext _localctx = new LiteralvalueContext(_ctx, getState()); enterRule(_localctx, 74, RULE_literalvalue); try { - setState(386); + setState(387); _errHandler.sync(this); switch (_input.LA(1)) { case DEC_INTEGER: @@ -2444,7 +2454,7 @@ public class prog8Parser extends Parser { case BIN_INTEGER: enterOuterAlt(_localctx, 1); { - setState(380); + setState(381); integerliteral(); } break; @@ -2452,35 +2462,35 @@ public class prog8Parser extends Parser { case T__76: enterOuterAlt(_localctx, 2); { - setState(381); + setState(382); booleanliteral(); } break; case T__23: enterOuterAlt(_localctx, 3); { - setState(382); + setState(383); arrayliteral(); } break; case STRING: enterOuterAlt(_localctx, 4); { - setState(383); + setState(384); stringliteral(); } break; case SINGLECHAR: enterOuterAlt(_localctx, 5); { - setState(384); + setState(385); charliteral(); } break; case FLOAT_NUMBER: enterOuterAlt(_localctx, 6); { - setState(385); + setState(386); floatliteral(); } break; @@ -2513,9 +2523,9 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(388); - match(T__77); setState(389); + match(T__77); + setState(390); match(INLINEASMBLOCK); } } @@ -2557,38 +2567,38 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(391); - match(T__78); setState(392); - identifier(); + match(T__78); setState(393); + identifier(); + setState(394); match(T__36); - setState(395); + setState(396); _errHandler.sync(this); _la = _input.LA(1); if (_la==NAME) { { - setState(394); + setState(395); sub_params(); } } - setState(397); + setState(398); match(T__37); - setState(399); + setState(400); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__79) { { - setState(398); + setState(399); sub_return_part(); } } { - setState(401); - statement_block(); setState(402); + statement_block(); + setState(403); match(EOL); } } @@ -2620,9 +2630,9 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(404); - match(T__79); setState(405); + match(T__79); + setState(406); sub_returns(); } } @@ -2661,16 +2671,16 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(407); - match(T__80); setState(408); + match(T__80); + setState(409); match(EOL); - setState(413); + setState(414); _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__14) | (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__60) | (1L << T__61) | (1L << T__62))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (T__64 - 65)) | (1L << (T__65 - 65)) | (1L << (T__66 - 65)) | (1L << (T__67 - 65)) | (1L << (T__68 - 65)) | (1L << (T__69 - 65)) | (1L << (T__77 - 65)) | (1L << (T__78 - 65)) | (1L << (T__82 - 65)) | (1L << (T__85 - 65)) | (1L << (T__87 - 65)) | (1L << (T__88 - 65)) | (1L << (T__89 - 65)) | (1L << (T__90 - 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__101 - 65)) | (1L << (T__102 - 65)) | (1L << (EOL - 65)) | (1L << (NAME - 65)))) != 0)) { { - setState(411); + setState(412); _errHandler.sync(this); switch (_input.LA(1)) { case T__2: @@ -2722,13 +2732,13 @@ public class prog8Parser extends Parser { case T__102: case NAME: { - setState(409); + setState(410); statement(); } break; case EOL: { - setState(410); + setState(411); match(EOL); } break; @@ -2736,11 +2746,11 @@ public class prog8Parser extends Parser { throw new NoViableAltException(this); } } - setState(415); + setState(416); _errHandler.sync(this); _la = _input.LA(1); } - setState(416); + setState(417); match(T__81); } } @@ -2775,21 +2785,21 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(418); + setState(419); sub_param(); - setState(423); + setState(424); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__12) { { { - setState(419); - match(T__12); setState(420); + match(T__12); + setState(421); sub_param(); } } - setState(425); + setState(426); _errHandler.sync(this); _la = _input.LA(1); } @@ -2825,11 +2835,11 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(426); - identifier(); setState(427); - match(T__1); + identifier(); setState(428); + match(T__1); + setState(429); datatype(); } } @@ -2864,21 +2874,21 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(430); + setState(431); datatype(); - setState(435); + setState(436); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__12) { { { - setState(431); - match(T__12); setState(432); + match(T__12); + setState(433); datatype(); } } - setState(437); + setState(438); _errHandler.sync(this); _la = _input.LA(1); } @@ -2927,70 +2937,70 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(438); - match(T__82); setState(439); - identifier(); + match(T__82); setState(440); + identifier(); + setState(441); match(T__36); - setState(442); + setState(443); _errHandler.sync(this); _la = _input.LA(1); if (_la==NAME) { { - setState(441); + setState(442); asmsub_params(); } } - setState(444); - match(T__37); setState(445); - match(T__79); + match(T__37); setState(446); - match(T__83); + match(T__79); setState(447); + match(T__83); + setState(448); match(T__36); - setState(449); + setState(450); _errHandler.sync(this); _la = _input.LA(1); if (((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (T__64 - 65)) | (1L << (T__65 - 65)) | (1L << (T__66 - 65)) | (1L << (T__67 - 65)) | (1L << (T__68 - 65)) | (1L << (T__69 - 65)))) != 0)) { { - setState(448); + setState(449); clobber(); } } - setState(451); - match(T__37); setState(452); - match(T__79); + match(T__37); setState(453); + match(T__79); + setState(454); match(T__36); - setState(455); + setState(456); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22))) != 0)) { { - setState(454); + setState(455); asmsub_returns(); } } - setState(457); + setState(458); match(T__37); - setState(460); + setState(461); _errHandler.sync(this); switch (_input.LA(1)) { case T__13: { - setState(458); + setState(459); asmsub_address(); } break; case T__80: { - setState(459); + setState(460); statement_block(); } break; @@ -3027,9 +3037,9 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(462); - match(T__13); setState(463); + match(T__13); + setState(464); ((Asmsub_addressContext)_localctx).address = integerliteral(); } } @@ -3064,21 +3074,21 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(465); + setState(466); asmsub_param(); - setState(470); + setState(471); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__12) { { { - setState(466); - match(T__12); setState(467); + match(T__12); + setState(468); asmsub_param(); } } - setState(472); + setState(473); _errHandler.sync(this); _la = _input.LA(1); } @@ -3120,15 +3130,15 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(473); - identifier(); setState(474); - match(T__1); + identifier(); setState(475); - datatype(); + match(T__1); setState(476); + datatype(); + setState(477); match(T__84); - setState(479); + setState(480); _errHandler.sync(this); switch (_input.LA(1)) { case T__64: @@ -3138,7 +3148,7 @@ public class prog8Parser extends Parser { case T__68: case T__69: { - setState(477); + setState(478); register(); } break; @@ -3147,7 +3157,7 @@ public class prog8Parser extends Parser { case T__72: case T__73: { - setState(478); + setState(479); statusregister(); } break; @@ -3187,21 +3197,21 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(481); + setState(482); register(); - setState(486); + setState(487); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__12) { { { - setState(482); - match(T__12); setState(483); + match(T__12); + setState(484); register(); } } - setState(488); + setState(489); _errHandler.sync(this); _la = _input.LA(1); } @@ -3238,21 +3248,21 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(489); + setState(490); asmsub_return(); - setState(494); + setState(495); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__12) { { { - setState(490); - match(T__12); setState(491); + match(T__12); + setState(492); asmsub_return(); } } - setState(496); + setState(497); _errHandler.sync(this); _la = _input.LA(1); } @@ -3291,11 +3301,11 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(497); - datatype(); setState(498); + datatype(); + setState(499); match(T__84); - setState(501); + setState(502); _errHandler.sync(this); switch (_input.LA(1)) { case T__64: @@ -3305,7 +3315,7 @@ public class prog8Parser extends Parser { case T__68: case T__69: { - setState(499); + setState(500); register(); } break; @@ -3314,7 +3324,7 @@ public class prog8Parser extends Parser { case T__72: case T__73: { - setState(500); + setState(501); statusregister(); } break; @@ -3364,21 +3374,21 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(503); - match(T__85); setState(504); + match(T__85); + setState(505); expression(0); - setState(506); + setState(507); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(505); + setState(506); match(EOL); } } - setState(510); + setState(511); _errHandler.sync(this); switch (_input.LA(1)) { case T__2: @@ -3430,40 +3440,40 @@ public class prog8Parser extends Parser { case T__102: case NAME: { - setState(508); + setState(509); statement(); } break; case T__80: { - setState(509); + setState(510); statement_block(); } break; default: throw new NoViableAltException(this); } - setState(513); + setState(514); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,46,_ctx) ) { case 1: { - setState(512); + setState(513); match(EOL); } break; } - setState(516); + setState(517); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__86) { { - setState(515); + setState(516); else_part(); } } - setState(518); + setState(519); match(EOL); } } @@ -3499,19 +3509,19 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(520); + setState(521); match(T__86); - setState(522); + setState(523); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(521); + setState(522); match(EOL); } } - setState(526); + setState(527); _errHandler.sync(this); switch (_input.LA(1)) { case T__2: @@ -3563,13 +3573,13 @@ public class prog8Parser extends Parser { case T__102: case NAME: { - setState(524); + setState(525); statement(); } break; case T__80: { - setState(525); + setState(526); statement_block(); } break; @@ -3619,19 +3629,19 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(528); + setState(529); branchcondition(); - setState(530); + setState(531); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(529); + setState(530); match(EOL); } } - setState(534); + setState(535); _errHandler.sync(this); switch (_input.LA(1)) { case T__2: @@ -3683,40 +3693,40 @@ public class prog8Parser extends Parser { case T__102: case NAME: { - setState(532); + setState(533); statement(); } break; case T__80: { - setState(533); + setState(534); statement_block(); } break; default: throw new NoViableAltException(this); } - setState(537); + setState(538); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,52,_ctx) ) { case 1: { - setState(536); + setState(537); match(EOL); } break; } - setState(540); + setState(541); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__86) { { - setState(539); + setState(540); else_part(); } } - setState(542); + setState(543); match(EOL); } } @@ -3745,7 +3755,7 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(544); + setState(545); _la = _input.LA(1); if ( !(((((_la - 88)) & ~0x3f) == 0 && ((1L << (_la - 88)) & ((1L << (T__87 - 88)) | (1L << (T__88 - 88)) | (1L << (T__89 - 88)) | (1L << (T__90 - 88)) | (1L << (T__91 - 88)) | (1L << (T__92 - 88)) | (1L << (T__93 - 88)) | (1L << (T__94 - 88)) | (1L << (T__95 - 88)) | (1L << (T__96 - 88)) | (1L << (T__97 - 88)) | (1L << (T__98 - 88)))) != 0)) ) { _errHandler.recoverInline(this); @@ -3795,9 +3805,9 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(546); + setState(547); match(T__99); - setState(549); + setState(550); _errHandler.sync(this); switch (_input.LA(1)) { case T__64: @@ -3807,34 +3817,34 @@ public class prog8Parser extends Parser { case T__68: case T__69: { - setState(547); + setState(548); register(); } break; case NAME: { - setState(548); + setState(549); identifier(); } break; default: throw new NoViableAltException(this); } - setState(551); - match(T__100); setState(552); + match(T__100); + setState(553); expression(0); - setState(554); + setState(555); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(553); + setState(554); match(EOL); } } - setState(556); + setState(557); statement_block(); } } @@ -3873,21 +3883,21 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(558); - match(T__101); setState(559); + match(T__101); + setState(560); expression(0); - setState(561); + setState(562); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(560); + setState(561); match(EOL); } } - setState(565); + setState(566); _errHandler.sync(this); switch (_input.LA(1)) { case T__2: @@ -3939,13 +3949,13 @@ public class prog8Parser extends Parser { case T__102: case NAME: { - setState(563); + setState(564); statement(); } break; case T__80: { - setState(564); + setState(565); statement_block(); } break; @@ -3989,9 +3999,9 @@ public class prog8Parser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(567); + setState(568); match(T__102); - setState(570); + setState(571); _errHandler.sync(this); switch (_input.LA(1)) { case T__2: @@ -4043,32 +4053,32 @@ public class prog8Parser extends Parser { case T__102: case NAME: { - setState(568); + setState(569); statement(); } break; case T__80: { - setState(569); + setState(570); statement_block(); } break; default: throw new NoViableAltException(this); } - setState(573); + setState(574); _errHandler.sync(this); _la = _input.LA(1); if (_la==EOL) { { - setState(572); + setState(573); match(EOL); } } - setState(575); - match(T__103); setState(576); + match(T__103); + setState(577); expression(0); } } @@ -4121,7 +4131,7 @@ public class prog8Parser extends Parser { } public static final String _serializedATN = - "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3v\u0245\4\2\t\2\4"+ + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3v\u0246\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"+ @@ -4136,49 +4146,49 @@ public class prog8Parser extends Parser { "\n\b\f\b\16\b\u00b9\13\b\5\b\u00bb\n\b\3\t\3\t\3\t\5\t\u00c0\n\t\3\n\3"+ "\n\5\n\u00c4\n\n\3\n\3\n\3\13\3\13\5\13\u00ca\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\5\17\u00dc\n\17"+ - "\3\17\3\17\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\22\3\22\3\22\5\22"+ - "\u00eb\n\22\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24"+ - "\3\24\3\24\3\24\3\24\3\24\3\24\5\24\u00ff\n\24\3\24\3\24\3\24\3\24\3\24"+ + "\3\17\3\17\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22"+ + "\5\22\u00ec\n\22\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24"+ + "\3\24\3\24\3\24\3\24\3\24\3\24\3\24\5\24\u0100\n\24\3\24\3\24\3\24\3\24"+ "\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24"+ "\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24"+ - "\3\24\3\24\3\24\3\24\3\24\5\24\u0127\n\24\7\24\u0129\n\24\f\24\16\24\u012c"+ - "\13\24\3\25\3\25\3\25\5\25\u0131\n\25\3\25\3\25\3\26\3\26\5\26\u0137\n"+ - "\26\3\26\3\26\5\26\u013b\n\26\3\26\3\26\3\27\3\27\5\27\u0141\n\27\3\27"+ - "\3\27\5\27\u0145\n\27\3\27\3\27\3\30\3\30\3\30\7\30\u014c\n\30\f\30\16"+ - "\30\u014f\13\30\3\31\3\31\5\31\u0153\n\31\3\32\3\32\3\33\3\33\3\34\3\34"+ - "\3\35\3\35\3\35\6\35\u015e\n\35\r\35\16\35\u015f\3\36\3\36\3\37\3\37\3"+ - " \3 \5 \u0168\n \3!\3!\3\"\3\"\3#\3#\3#\3#\7#\u0172\n#\f#\16#\u0175\13"+ - "#\3#\3#\3$\3$\3%\3%\3&\3&\3\'\3\'\3\'\3\'\3\'\3\'\5\'\u0185\n\'\3(\3("+ - "\3(\3)\3)\3)\3)\5)\u018e\n)\3)\3)\5)\u0192\n)\3)\3)\3)\3*\3*\3*\3+\3+"+ - "\3+\3+\7+\u019e\n+\f+\16+\u01a1\13+\3+\3+\3,\3,\3,\7,\u01a8\n,\f,\16,"+ - "\u01ab\13,\3-\3-\3-\3-\3.\3.\3.\7.\u01b4\n.\f.\16.\u01b7\13.\3/\3/\3/"+ - "\3/\5/\u01bd\n/\3/\3/\3/\3/\3/\5/\u01c4\n/\3/\3/\3/\3/\5/\u01ca\n/\3/"+ - "\3/\3/\5/\u01cf\n/\3\60\3\60\3\60\3\61\3\61\3\61\7\61\u01d7\n\61\f\61"+ - "\16\61\u01da\13\61\3\62\3\62\3\62\3\62\3\62\3\62\5\62\u01e2\n\62\3\63"+ - "\3\63\3\63\7\63\u01e7\n\63\f\63\16\63\u01ea\13\63\3\64\3\64\3\64\7\64"+ - "\u01ef\n\64\f\64\16\64\u01f2\13\64\3\65\3\65\3\65\3\65\5\65\u01f8\n\65"+ - "\3\66\3\66\3\66\5\66\u01fd\n\66\3\66\3\66\5\66\u0201\n\66\3\66\5\66\u0204"+ - "\n\66\3\66\5\66\u0207\n\66\3\66\3\66\3\67\3\67\5\67\u020d\n\67\3\67\3"+ - "\67\5\67\u0211\n\67\38\38\58\u0215\n8\38\38\58\u0219\n8\38\58\u021c\n"+ - "8\38\58\u021f\n8\38\38\39\39\3:\3:\3:\5:\u0228\n:\3:\3:\3:\5:\u022d\n"+ - ":\3:\3:\3;\3;\3;\5;\u0234\n;\3;\3;\5;\u0238\n;\3<\3<\3<\5<\u023d\n<\3"+ - "<\5<\u0240\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\\^`bdfhjlnprtv\2\20\3\2\6\16\3"+ - "\2\23\31\3\2\34$\3\2%&\4\2\3\3)*\3\2,/\3\2)*\3\2\60\63\3\2\64\65\3\2C"+ - "H\3\2IL\3\2pr\3\2NO\3\2Ze\2\u0272\2|\3\2\2\2\4\u0083\3\2\2\2\6\u0085\3"+ - "\2\2\2\b\u00a3\3\2\2\2\n\u00a5\3\2\2\2\f\u00a8\3\2\2\2\16\u00ae\3\2\2"+ - "\2\20\u00bf\3\2\2\2\22\u00c1\3\2\2\2\24\u00c7\3\2\2\2\26\u00cf\3\2\2\2"+ - "\30\u00d2\3\2\2\2\32\u00d5\3\2\2\2\34\u00d7\3\2\2\2\36\u00df\3\2\2\2 "+ - "\u00e3\3\2\2\2\"\u00ea\3\2\2\2$\u00ec\3\2\2\2&\u00fe\3\2\2\2(\u0130\3"+ - "\2\2\2*\u0136\3\2\2\2,\u0140\3\2\2\2.\u0148\3\2\2\2\60\u0150\3\2\2\2\62"+ - "\u0154\3\2\2\2\64\u0156\3\2\2\2\66\u0158\3\2\2\28\u015a\3\2\2\2:\u0161"+ - "\3\2\2\2<\u0163\3\2\2\2>\u0165\3\2\2\2@\u0169\3\2\2\2B\u016b\3\2\2\2D"+ - "\u016d\3\2\2\2F\u0178\3\2\2\2H\u017a\3\2\2\2J\u017c\3\2\2\2L\u0184\3\2"+ - "\2\2N\u0186\3\2\2\2P\u0189\3\2\2\2R\u0196\3\2\2\2T\u0199\3\2\2\2V\u01a4"+ - "\3\2\2\2X\u01ac\3\2\2\2Z\u01b0\3\2\2\2\\\u01b8\3\2\2\2^\u01d0\3\2\2\2"+ - "`\u01d3\3\2\2\2b\u01db\3\2\2\2d\u01e3\3\2\2\2f\u01eb\3\2\2\2h\u01f3\3"+ - "\2\2\2j\u01f9\3\2\2\2l\u020a\3\2\2\2n\u0212\3\2\2\2p\u0222\3\2\2\2r\u0224"+ - "\3\2\2\2t\u0230\3\2\2\2v\u0239\3\2\2\2x{\5\4\3\2y{\7n\2\2zx\3\2\2\2zy"+ + "\3\24\3\24\3\24\3\24\3\24\3\24\5\24\u0128\n\24\7\24\u012a\n\24\f\24\16"+ + "\24\u012d\13\24\3\25\3\25\3\25\5\25\u0132\n\25\3\25\3\25\3\26\3\26\5\26"+ + "\u0138\n\26\3\26\3\26\5\26\u013c\n\26\3\26\3\26\3\27\3\27\5\27\u0142\n"+ + "\27\3\27\3\27\5\27\u0146\n\27\3\27\3\27\3\30\3\30\3\30\7\30\u014d\n\30"+ + "\f\30\16\30\u0150\13\30\3\31\3\31\5\31\u0154\n\31\3\32\3\32\3\33\3\33"+ + "\3\34\3\34\3\35\3\35\3\35\6\35\u015f\n\35\r\35\16\35\u0160\3\36\3\36\3"+ + "\37\3\37\3 \3 \5 \u0169\n \3!\3!\3\"\3\"\3#\3#\3#\3#\7#\u0173\n#\f#\16"+ + "#\u0176\13#\3#\3#\3$\3$\3%\3%\3&\3&\3\'\3\'\3\'\3\'\3\'\3\'\5\'\u0186"+ + "\n\'\3(\3(\3(\3)\3)\3)\3)\5)\u018f\n)\3)\3)\5)\u0193\n)\3)\3)\3)\3*\3"+ + "*\3*\3+\3+\3+\3+\7+\u019f\n+\f+\16+\u01a2\13+\3+\3+\3,\3,\3,\7,\u01a9"+ + "\n,\f,\16,\u01ac\13,\3-\3-\3-\3-\3.\3.\3.\7.\u01b5\n.\f.\16.\u01b8\13"+ + ".\3/\3/\3/\3/\5/\u01be\n/\3/\3/\3/\3/\3/\5/\u01c5\n/\3/\3/\3/\3/\5/\u01cb"+ + "\n/\3/\3/\3/\5/\u01d0\n/\3\60\3\60\3\60\3\61\3\61\3\61\7\61\u01d8\n\61"+ + "\f\61\16\61\u01db\13\61\3\62\3\62\3\62\3\62\3\62\3\62\5\62\u01e3\n\62"+ + "\3\63\3\63\3\63\7\63\u01e8\n\63\f\63\16\63\u01eb\13\63\3\64\3\64\3\64"+ + "\7\64\u01f0\n\64\f\64\16\64\u01f3\13\64\3\65\3\65\3\65\3\65\5\65\u01f9"+ + "\n\65\3\66\3\66\3\66\5\66\u01fe\n\66\3\66\3\66\5\66\u0202\n\66\3\66\5"+ + "\66\u0205\n\66\3\66\5\66\u0208\n\66\3\66\3\66\3\67\3\67\5\67\u020e\n\67"+ + "\3\67\3\67\5\67\u0212\n\67\38\38\58\u0216\n8\38\38\58\u021a\n8\38\58\u021d"+ + "\n8\38\58\u0220\n8\38\38\39\39\3:\3:\3:\5:\u0229\n:\3:\3:\3:\5:\u022e"+ + "\n:\3:\3:\3;\3;\3;\5;\u0235\n;\3;\3;\5;\u0239\n;\3<\3<\3<\5<\u023e\n<"+ + "\3<\5<\u0241\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\\^`bdfhjlnprtv\2\20\3\2\6\16"+ + "\3\2\23\31\3\2\34$\3\2%&\4\2\3\3)*\3\2,/\3\2)*\3\2\60\63\3\2\64\65\3\2"+ + "CH\3\2IL\3\2pr\3\2NO\3\2Ze\2\u0274\2|\3\2\2\2\4\u0083\3\2\2\2\6\u0085"+ + "\3\2\2\2\b\u00a3\3\2\2\2\n\u00a5\3\2\2\2\f\u00a8\3\2\2\2\16\u00ae\3\2"+ + "\2\2\20\u00bf\3\2\2\2\22\u00c1\3\2\2\2\24\u00c7\3\2\2\2\26\u00cf\3\2\2"+ + "\2\30\u00d2\3\2\2\2\32\u00d5\3\2\2\2\34\u00d7\3\2\2\2\36\u00df\3\2\2\2"+ + " \u00e3\3\2\2\2\"\u00eb\3\2\2\2$\u00ed\3\2\2\2&\u00ff\3\2\2\2(\u0131\3"+ + "\2\2\2*\u0137\3\2\2\2,\u0141\3\2\2\2.\u0149\3\2\2\2\60\u0151\3\2\2\2\62"+ + "\u0155\3\2\2\2\64\u0157\3\2\2\2\66\u0159\3\2\2\28\u015b\3\2\2\2:\u0162"+ + "\3\2\2\2<\u0164\3\2\2\2>\u0166\3\2\2\2@\u016a\3\2\2\2B\u016c\3\2\2\2D"+ + "\u016e\3\2\2\2F\u0179\3\2\2\2H\u017b\3\2\2\2J\u017d\3\2\2\2L\u0185\3\2"+ + "\2\2N\u0187\3\2\2\2P\u018a\3\2\2\2R\u0197\3\2\2\2T\u019a\3\2\2\2V\u01a5"+ + "\3\2\2\2X\u01ad\3\2\2\2Z\u01b1\3\2\2\2\\\u01b9\3\2\2\2^\u01d1\3\2\2\2"+ + "`\u01d4\3\2\2\2b\u01dc\3\2\2\2d\u01e4\3\2\2\2f\u01ec\3\2\2\2h\u01f4\3"+ + "\2\2\2j\u01fa\3\2\2\2l\u020b\3\2\2\2n\u0213\3\2\2\2p\u0223\3\2\2\2r\u0225"+ + "\3\2\2\2t\u0231\3\2\2\2v\u023a\3\2\2\2x{\5\4\3\2y{\7n\2\2zx\3\2\2\2zy"+ "\3\2\2\2{~\3\2\2\2|z\3\2\2\2|}\3\2\2\2}\177\3\2\2\2~|\3\2\2\2\177\u0080"+ "\7\2\2\3\u0080\3\3\2\2\2\u0081\u0084\5\16\b\2\u0082\u0084\5\6\4\2\u0083"+ "\u0081\3\2\2\2\u0083\u0082\3\2\2\2\u0084\5\3\2\2\2\u0085\u0086\7\3\2\2"+ @@ -4218,126 +4228,127 @@ public class prog8Parser extends Parser { "\u00dc\3\2\2\2\u00dc\u00dd\3\2\2\2\u00dd\u00de\7\33\2\2\u00de\35\3\2\2"+ "\2\u00df\u00e0\5\"\22\2\u00e0\u00e1\7\20\2\2\u00e1\u00e2\5&\24\2\u00e2"+ "\37\3\2\2\2\u00e3\u00e4\5\"\22\2\u00e4\u00e5\t\4\2\2\u00e5\u00e6\5&\24"+ - "\2\u00e6!\3\2\2\2\u00e7\u00eb\5:\36\2\u00e8\u00eb\5\66\34\2\u00e9\u00eb"+ - "\58\35\2\u00ea\u00e7\3\2\2\2\u00ea\u00e8\3\2\2\2\u00ea\u00e9\3\2\2\2\u00eb"+ - "#\3\2\2\2\u00ec\u00ed\5\"\22\2\u00ed\u00ee\t\5\2\2\u00ee%\3\2\2\2\u00ef"+ - "\u00f0\b\24\1\2\u00f0\u00f1\7\'\2\2\u00f1\u00f2\5&\24\2\u00f2\u00f3\7"+ - "(\2\2\u00f3\u00ff\3\2\2\2\u00f4\u00ff\5*\26\2\u00f5\u00f6\t\6\2\2\u00f6"+ - "\u00ff\5&\24\25\u00f7\u00f8\7>\2\2\u00f8\u00ff\5&\24\b\u00f9\u00ff\5L"+ - "\'\2\u00fa\u00ff\5:\36\2\u00fb\u00ff\5\66\34\2\u00fc\u00ff\58\35\2\u00fd"+ - "\u00ff\5(\25\2\u00fe\u00ef\3\2\2\2\u00fe\u00f4\3\2\2\2\u00fe\u00f5\3\2"+ - "\2\2\u00fe\u00f7\3\2\2\2\u00fe\u00f9\3\2\2\2\u00fe\u00fa\3\2\2\2\u00fe"+ - "\u00fb\3\2\2\2\u00fe\u00fc\3\2\2\2\u00fe\u00fd\3\2\2\2\u00ff\u012a\3\2"+ - "\2\2\u0100\u0101\f\24\2\2\u0101\u0102\7+\2\2\u0102\u0129\5&\24\25\u0103"+ - "\u0104\f\23\2\2\u0104\u0105\t\7\2\2\u0105\u0129\5&\24\24\u0106\u0107\f"+ - "\22\2\2\u0107\u0108\t\b\2\2\u0108\u0129\5&\24\23\u0109\u010a\f\21\2\2"+ - "\u010a\u010b\t\t\2\2\u010b\u0129\5&\24\22\u010c\u010d\f\20\2\2\u010d\u010e"+ - "\t\n\2\2\u010e\u0129\5&\24\21\u010f\u0110\f\17\2\2\u0110\u0111\7\66\2"+ - "\2\u0111\u0129\5&\24\20\u0112\u0113\f\16\2\2\u0113\u0114\7\67\2\2\u0114"+ - "\u0129\5&\24\17\u0115\u0116\f\r\2\2\u0116\u0117\78\2\2\u0117\u0129\5&"+ - "\24\16\u0118\u0119\f\13\2\2\u0119\u011a\7;\2\2\u011a\u0129\5&\24\f\u011b"+ - "\u011c\f\n\2\2\u011c\u011d\7<\2\2\u011d\u0129\5&\24\13\u011e\u011f\f\t"+ - "\2\2\u011f\u0120\7=\2\2\u0120\u0129\5&\24\n\u0121\u0122\f\f\2\2\u0122"+ - "\u0123\79\2\2\u0123\u0126\5&\24\2\u0124\u0125\7:\2\2\u0125\u0127\5&\24"+ - "\2\u0126\u0124\3\2\2\2\u0126\u0127\3\2\2\2\u0127\u0129\3\2\2\2\u0128\u0100"+ - "\3\2\2\2\u0128\u0103\3\2\2\2\u0128\u0106\3\2\2\2\u0128\u0109\3\2\2\2\u0128"+ - "\u010c\3\2\2\2\u0128\u010f\3\2\2\2\u0128\u0112\3\2\2\2\u0128\u0115\3\2"+ - "\2\2\u0128\u0118\3\2\2\2\u0128\u011b\3\2\2\2\u0128\u011e\3\2\2\2\u0128"+ - "\u0121\3\2\2\2\u0129\u012c\3\2\2\2\u012a\u0128\3\2\2\2\u012a\u012b\3\2"+ - "\2\2\u012b\'\3\2\2\2\u012c\u012a\3\2\2\2\u012d\u0131\5\66\34\2\u012e\u0131"+ - "\58\35\2\u012f\u0131\5:\36\2\u0130\u012d\3\2\2\2\u0130\u012e\3\2\2\2\u0130"+ - "\u012f\3\2\2\2\u0131\u0132\3\2\2\2\u0132\u0133\5\34\17\2\u0133)\3\2\2"+ - "\2\u0134\u0137\5\66\34\2\u0135\u0137\58\35\2\u0136\u0134\3\2\2\2\u0136"+ - "\u0135\3\2\2\2\u0137\u0138\3\2\2\2\u0138\u013a\7\'\2\2\u0139\u013b\5."+ - "\30\2\u013a\u0139\3\2\2\2\u013a\u013b\3\2\2\2\u013b\u013c\3\2\2\2\u013c"+ - "\u013d\7(\2\2\u013d+\3\2\2\2\u013e\u0141\5\66\34\2\u013f\u0141\58\35\2"+ - "\u0140\u013e\3\2\2\2\u0140\u013f\3\2\2\2\u0141\u0142\3\2\2\2\u0142\u0144"+ - "\7\'\2\2\u0143\u0145\5.\30\2\u0144\u0143\3\2\2\2\u0144\u0145\3\2\2\2\u0145"+ - "\u0146\3\2\2\2\u0146\u0147\7(\2\2\u0147-\3\2\2\2\u0148\u014d\5&\24\2\u0149"+ - "\u014a\7\17\2\2\u014a\u014c\5&\24\2\u014b\u0149\3\2\2\2\u014c\u014f\3"+ - "\2\2\2\u014d\u014b\3\2\2\2\u014d\u014e\3\2\2\2\u014e/\3\2\2\2\u014f\u014d"+ - "\3\2\2\2\u0150\u0152\7?\2\2\u0151\u0153\5.\30\2\u0152\u0151\3\2\2\2\u0152"+ - "\u0153\3\2\2\2\u0153\61\3\2\2\2\u0154\u0155\7@\2\2\u0155\63\3\2\2\2\u0156"+ - "\u0157\7A\2\2\u0157\65\3\2\2\2\u0158\u0159\7o\2\2\u0159\67\3\2\2\2\u015a"+ - "\u015d\7o\2\2\u015b\u015c\7B\2\2\u015c\u015e\7o\2\2\u015d\u015b\3\2\2"+ - "\2\u015e\u015f\3\2\2\2\u015f\u015d\3\2\2\2\u015f\u0160\3\2\2\2\u01609"+ - "\3\2\2\2\u0161\u0162\t\13\2\2\u0162;\3\2\2\2\u0163\u0164\t\f\2\2\u0164"+ - "=\3\2\2\2\u0165\u0167\t\r\2\2\u0166\u0168\5@!\2\u0167\u0166\3\2\2\2\u0167"+ - "\u0168\3\2\2\2\u0168?\3\2\2\2\u0169\u016a\7M\2\2\u016aA\3\2\2\2\u016b"+ - "\u016c\t\16\2\2\u016cC\3\2\2\2\u016d\u016e\7\32\2\2\u016e\u0173\5&\24"+ - "\2\u016f\u0170\7\17\2\2\u0170\u0172\5&\24\2\u0171\u016f\3\2\2\2\u0172"+ - "\u0175\3\2\2\2\u0173\u0171\3\2\2\2\u0173\u0174\3\2\2\2\u0174\u0176\3\2"+ - "\2\2\u0175\u0173\3\2\2\2\u0176\u0177\7\33\2\2\u0177E\3\2\2\2\u0178\u0179"+ - "\7t\2\2\u0179G\3\2\2\2\u017a\u017b\7v\2\2\u017bI\3\2\2\2\u017c\u017d\7"+ - "s\2\2\u017dK\3\2\2\2\u017e\u0185\5> \2\u017f\u0185\5B\"\2\u0180\u0185"+ - "\5D#\2\u0181\u0185\5F$\2\u0182\u0185\5H%\2\u0183\u0185\5J&\2\u0184\u017e"+ - "\3\2\2\2\u0184\u017f\3\2\2\2\u0184\u0180\3\2\2\2\u0184\u0181\3\2\2\2\u0184"+ - "\u0182\3\2\2\2\u0184\u0183\3\2\2\2\u0185M\3\2\2\2\u0186\u0187\7P\2\2\u0187"+ - "\u0188\7u\2\2\u0188O\3\2\2\2\u0189\u018a\7Q\2\2\u018a\u018b\5\66\34\2"+ - "\u018b\u018d\7\'\2\2\u018c\u018e\5V,\2\u018d\u018c\3\2\2\2\u018d\u018e"+ - "\3\2\2\2\u018e\u018f\3\2\2\2\u018f\u0191\7(\2\2\u0190\u0192\5R*\2\u0191"+ - "\u0190\3\2\2\2\u0191\u0192\3\2\2\2\u0192\u0193\3\2\2\2\u0193\u0194\5T"+ - "+\2\u0194\u0195\7n\2\2\u0195Q\3\2\2\2\u0196\u0197\7R\2\2\u0197\u0198\5"+ - "Z.\2\u0198S\3\2\2\2\u0199\u019a\7S\2\2\u019a\u019f\7n\2\2\u019b\u019e"+ - "\5\b\5\2\u019c\u019e\7n\2\2\u019d\u019b\3\2\2\2\u019d\u019c\3\2\2\2\u019e"+ - "\u01a1\3\2\2\2\u019f\u019d\3\2\2\2\u019f\u01a0\3\2\2\2\u01a0\u01a2\3\2"+ - "\2\2\u01a1\u019f\3\2\2\2\u01a2\u01a3\7T\2\2\u01a3U\3\2\2\2\u01a4\u01a9"+ - "\5X-\2\u01a5\u01a6\7\17\2\2\u01a6\u01a8\5X-\2\u01a7\u01a5\3\2\2\2\u01a8"+ - "\u01ab\3\2\2\2\u01a9\u01a7\3\2\2\2\u01a9\u01aa\3\2\2\2\u01aaW\3\2\2\2"+ - "\u01ab\u01a9\3\2\2\2\u01ac\u01ad\5\66\34\2\u01ad\u01ae\7\4\2\2\u01ae\u01af"+ - "\5\32\16\2\u01afY\3\2\2\2\u01b0\u01b5\5\32\16\2\u01b1\u01b2\7\17\2\2\u01b2"+ - "\u01b4\5\32\16\2\u01b3\u01b1\3\2\2\2\u01b4\u01b7\3\2\2\2\u01b5\u01b3\3"+ - "\2\2\2\u01b5\u01b6\3\2\2\2\u01b6[\3\2\2\2\u01b7\u01b5\3\2\2\2\u01b8\u01b9"+ - "\7U\2\2\u01b9\u01ba\5\66\34\2\u01ba\u01bc\7\'\2\2\u01bb\u01bd\5`\61\2"+ - "\u01bc\u01bb\3\2\2\2\u01bc\u01bd\3\2\2\2\u01bd\u01be\3\2\2\2\u01be\u01bf"+ - "\7(\2\2\u01bf\u01c0\7R\2\2\u01c0\u01c1\7V\2\2\u01c1\u01c3\7\'\2\2\u01c2"+ - "\u01c4\5d\63\2\u01c3\u01c2\3\2\2\2\u01c3\u01c4\3\2\2\2\u01c4\u01c5\3\2"+ - "\2\2\u01c5\u01c6\7(\2\2\u01c6\u01c7\7R\2\2\u01c7\u01c9\7\'\2\2\u01c8\u01ca"+ - "\5f\64\2\u01c9\u01c8\3\2\2\2\u01c9\u01ca\3\2\2\2\u01ca\u01cb\3\2\2\2\u01cb"+ - "\u01ce\7(\2\2\u01cc\u01cf\5^\60\2\u01cd\u01cf\5T+\2\u01ce\u01cc\3\2\2"+ - "\2\u01ce\u01cd\3\2\2\2\u01cf]\3\2\2\2\u01d0\u01d1\7\20\2\2\u01d1\u01d2"+ - "\5> \2\u01d2_\3\2\2\2\u01d3\u01d8\5b\62\2\u01d4\u01d5\7\17\2\2\u01d5\u01d7"+ - "\5b\62\2\u01d6\u01d4\3\2\2\2\u01d7\u01da\3\2\2\2\u01d8\u01d6\3\2\2\2\u01d8"+ - "\u01d9\3\2\2\2\u01d9a\3\2\2\2\u01da\u01d8\3\2\2\2\u01db\u01dc\5\66\34"+ - "\2\u01dc\u01dd\7\4\2\2\u01dd\u01de\5\32\16\2\u01de\u01e1\7W\2\2\u01df"+ - "\u01e2\5:\36\2\u01e0\u01e2\5<\37\2\u01e1\u01df\3\2\2\2\u01e1\u01e0\3\2"+ - "\2\2\u01e2c\3\2\2\2\u01e3\u01e8\5:\36\2\u01e4\u01e5\7\17\2\2\u01e5\u01e7"+ - "\5:\36\2\u01e6\u01e4\3\2\2\2\u01e7\u01ea\3\2\2\2\u01e8\u01e6\3\2\2\2\u01e8"+ - "\u01e9\3\2\2\2\u01e9e\3\2\2\2\u01ea\u01e8\3\2\2\2\u01eb\u01f0\5h\65\2"+ - "\u01ec\u01ed\7\17\2\2\u01ed\u01ef\5h\65\2\u01ee\u01ec\3\2\2\2\u01ef\u01f2"+ - "\3\2\2\2\u01f0\u01ee\3\2\2\2\u01f0\u01f1\3\2\2\2\u01f1g\3\2\2\2\u01f2"+ - "\u01f0\3\2\2\2\u01f3\u01f4\5\32\16\2\u01f4\u01f7\7W\2\2\u01f5\u01f8\5"+ - ":\36\2\u01f6\u01f8\5<\37\2\u01f7\u01f5\3\2\2\2\u01f7\u01f6\3\2\2\2\u01f8"+ - "i\3\2\2\2\u01f9\u01fa\7X\2\2\u01fa\u01fc\5&\24\2\u01fb\u01fd\7n\2\2\u01fc"+ - "\u01fb\3\2\2\2\u01fc\u01fd\3\2\2\2\u01fd\u0200\3\2\2\2\u01fe\u0201\5\b"+ - "\5\2\u01ff\u0201\5T+\2\u0200\u01fe\3\2\2\2\u0200\u01ff\3\2\2\2\u0201\u0203"+ - "\3\2\2\2\u0202\u0204\7n\2\2\u0203\u0202\3\2\2\2\u0203\u0204\3\2\2\2\u0204"+ - "\u0206\3\2\2\2\u0205\u0207\5l\67\2\u0206\u0205\3\2\2\2\u0206\u0207\3\2"+ - "\2\2\u0207\u0208\3\2\2\2\u0208\u0209\7n\2\2\u0209k\3\2\2\2\u020a\u020c"+ - "\7Y\2\2\u020b\u020d\7n\2\2\u020c\u020b\3\2\2\2\u020c\u020d\3\2\2\2\u020d"+ - "\u0210\3\2\2\2\u020e\u0211\5\b\5\2\u020f\u0211\5T+\2\u0210\u020e\3\2\2"+ - "\2\u0210\u020f\3\2\2\2\u0211m\3\2\2\2\u0212\u0214\5p9\2\u0213\u0215\7"+ - "n\2\2\u0214\u0213\3\2\2\2\u0214\u0215\3\2\2\2\u0215\u0218\3\2\2\2\u0216"+ - "\u0219\5\b\5\2\u0217\u0219\5T+\2\u0218\u0216\3\2\2\2\u0218\u0217\3\2\2"+ - "\2\u0219\u021b\3\2\2\2\u021a\u021c\7n\2\2\u021b\u021a\3\2\2\2\u021b\u021c"+ - "\3\2\2\2\u021c\u021e\3\2\2\2\u021d\u021f\5l\67\2\u021e\u021d\3\2\2\2\u021e"+ - "\u021f\3\2\2\2\u021f\u0220\3\2\2\2\u0220\u0221\7n\2\2\u0221o\3\2\2\2\u0222"+ - "\u0223\t\17\2\2\u0223q\3\2\2\2\u0224\u0227\7f\2\2\u0225\u0228\5:\36\2"+ - "\u0226\u0228\5\66\34\2\u0227\u0225\3\2\2\2\u0227\u0226\3\2\2\2\u0228\u0229"+ - "\3\2\2\2\u0229\u022a\7g\2\2\u022a\u022c\5&\24\2\u022b\u022d\7n\2\2\u022c"+ - "\u022b\3\2\2\2\u022c\u022d\3\2\2\2\u022d\u022e\3\2\2\2\u022e\u022f\5T"+ - "+\2\u022fs\3\2\2\2\u0230\u0231\7h\2\2\u0231\u0233\5&\24\2\u0232\u0234"+ - "\7n\2\2\u0233\u0232\3\2\2\2\u0233\u0234\3\2\2\2\u0234\u0237\3\2\2\2\u0235"+ - "\u0238\5\b\5\2\u0236\u0238\5T+\2\u0237\u0235\3\2\2\2\u0237\u0236\3\2\2"+ - "\2\u0238u\3\2\2\2\u0239\u023c\7i\2\2\u023a\u023d\5\b\5\2\u023b\u023d\5"+ - "T+\2\u023c\u023a\3\2\2\2\u023c\u023b\3\2\2\2\u023d\u023f\3\2\2\2\u023e"+ - "\u0240\7n\2\2\u023f\u023e\3\2\2\2\u023f\u0240\3\2\2\2\u0240\u0241\3\2"+ - "\2\2\u0241\u0242\7j\2\2\u0242\u0243\5&\24\2\u0243w\3\2\2\2>z|\u0083\u0088"+ - "\u00a3\u00ac\u00b0\u00b7\u00ba\u00bf\u00c3\u00c9\u00db\u00ea\u00fe\u0126"+ - "\u0128\u012a\u0130\u0136\u013a\u0140\u0144\u014d\u0152\u015f\u0167\u0173"+ - "\u0184\u018d\u0191\u019d\u019f\u01a9\u01b5\u01bc\u01c3\u01c9\u01ce\u01d8"+ - "\u01e1\u01e8\u01f0\u01f7\u01fc\u0200\u0203\u0206\u020c\u0210\u0214\u0218"+ - "\u021b\u021e\u0227\u022c\u0233\u0237\u023c\u023f"; + "\2\u00e6!\3\2\2\2\u00e7\u00ec\5:\36\2\u00e8\u00ec\5\66\34\2\u00e9\u00ec"+ + "\58\35\2\u00ea\u00ec\5(\25\2\u00eb\u00e7\3\2\2\2\u00eb\u00e8\3\2\2\2\u00eb"+ + "\u00e9\3\2\2\2\u00eb\u00ea\3\2\2\2\u00ec#\3\2\2\2\u00ed\u00ee\5\"\22\2"+ + "\u00ee\u00ef\t\5\2\2\u00ef%\3\2\2\2\u00f0\u00f1\b\24\1\2\u00f1\u00f2\7"+ + "\'\2\2\u00f2\u00f3\5&\24\2\u00f3\u00f4\7(\2\2\u00f4\u0100\3\2\2\2\u00f5"+ + "\u0100\5*\26\2\u00f6\u00f7\t\6\2\2\u00f7\u0100\5&\24\25\u00f8\u00f9\7"+ + ">\2\2\u00f9\u0100\5&\24\b\u00fa\u0100\5L\'\2\u00fb\u0100\5:\36\2\u00fc"+ + "\u0100\5\66\34\2\u00fd\u0100\58\35\2\u00fe\u0100\5(\25\2\u00ff\u00f0\3"+ + "\2\2\2\u00ff\u00f5\3\2\2\2\u00ff\u00f6\3\2\2\2\u00ff\u00f8\3\2\2\2\u00ff"+ + "\u00fa\3\2\2\2\u00ff\u00fb\3\2\2\2\u00ff\u00fc\3\2\2\2\u00ff\u00fd\3\2"+ + "\2\2\u00ff\u00fe\3\2\2\2\u0100\u012b\3\2\2\2\u0101\u0102\f\24\2\2\u0102"+ + "\u0103\7+\2\2\u0103\u012a\5&\24\25\u0104\u0105\f\23\2\2\u0105\u0106\t"+ + "\7\2\2\u0106\u012a\5&\24\24\u0107\u0108\f\22\2\2\u0108\u0109\t\b\2\2\u0109"+ + "\u012a\5&\24\23\u010a\u010b\f\21\2\2\u010b\u010c\t\t\2\2\u010c\u012a\5"+ + "&\24\22\u010d\u010e\f\20\2\2\u010e\u010f\t\n\2\2\u010f\u012a\5&\24\21"+ + "\u0110\u0111\f\17\2\2\u0111\u0112\7\66\2\2\u0112\u012a\5&\24\20\u0113"+ + "\u0114\f\16\2\2\u0114\u0115\7\67\2\2\u0115\u012a\5&\24\17\u0116\u0117"+ + "\f\r\2\2\u0117\u0118\78\2\2\u0118\u012a\5&\24\16\u0119\u011a\f\13\2\2"+ + "\u011a\u011b\7;\2\2\u011b\u012a\5&\24\f\u011c\u011d\f\n\2\2\u011d\u011e"+ + "\7<\2\2\u011e\u012a\5&\24\13\u011f\u0120\f\t\2\2\u0120\u0121\7=\2\2\u0121"+ + "\u012a\5&\24\n\u0122\u0123\f\f\2\2\u0123\u0124\79\2\2\u0124\u0127\5&\24"+ + "\2\u0125\u0126\7:\2\2\u0126\u0128\5&\24\2\u0127\u0125\3\2\2\2\u0127\u0128"+ + "\3\2\2\2\u0128\u012a\3\2\2\2\u0129\u0101\3\2\2\2\u0129\u0104\3\2\2\2\u0129"+ + "\u0107\3\2\2\2\u0129\u010a\3\2\2\2\u0129\u010d\3\2\2\2\u0129\u0110\3\2"+ + "\2\2\u0129\u0113\3\2\2\2\u0129\u0116\3\2\2\2\u0129\u0119\3\2\2\2\u0129"+ + "\u011c\3\2\2\2\u0129\u011f\3\2\2\2\u0129\u0122\3\2\2\2\u012a\u012d\3\2"+ + "\2\2\u012b\u0129\3\2\2\2\u012b\u012c\3\2\2\2\u012c\'\3\2\2\2\u012d\u012b"+ + "\3\2\2\2\u012e\u0132\5\66\34\2\u012f\u0132\58\35\2\u0130\u0132\5:\36\2"+ + "\u0131\u012e\3\2\2\2\u0131\u012f\3\2\2\2\u0131\u0130\3\2\2\2\u0132\u0133"+ + "\3\2\2\2\u0133\u0134\5\34\17\2\u0134)\3\2\2\2\u0135\u0138\5\66\34\2\u0136"+ + "\u0138\58\35\2\u0137\u0135\3\2\2\2\u0137\u0136\3\2\2\2\u0138\u0139\3\2"+ + "\2\2\u0139\u013b\7\'\2\2\u013a\u013c\5.\30\2\u013b\u013a\3\2\2\2\u013b"+ + "\u013c\3\2\2\2\u013c\u013d\3\2\2\2\u013d\u013e\7(\2\2\u013e+\3\2\2\2\u013f"+ + "\u0142\5\66\34\2\u0140\u0142\58\35\2\u0141\u013f\3\2\2\2\u0141\u0140\3"+ + "\2\2\2\u0142\u0143\3\2\2\2\u0143\u0145\7\'\2\2\u0144\u0146\5.\30\2\u0145"+ + "\u0144\3\2\2\2\u0145\u0146\3\2\2\2\u0146\u0147\3\2\2\2\u0147\u0148\7("+ + "\2\2\u0148-\3\2\2\2\u0149\u014e\5&\24\2\u014a\u014b\7\17\2\2\u014b\u014d"+ + "\5&\24\2\u014c\u014a\3\2\2\2\u014d\u0150\3\2\2\2\u014e\u014c\3\2\2\2\u014e"+ + "\u014f\3\2\2\2\u014f/\3\2\2\2\u0150\u014e\3\2\2\2\u0151\u0153\7?\2\2\u0152"+ + "\u0154\5.\30\2\u0153\u0152\3\2\2\2\u0153\u0154\3\2\2\2\u0154\61\3\2\2"+ + "\2\u0155\u0156\7@\2\2\u0156\63\3\2\2\2\u0157\u0158\7A\2\2\u0158\65\3\2"+ + "\2\2\u0159\u015a\7o\2\2\u015a\67\3\2\2\2\u015b\u015e\7o\2\2\u015c\u015d"+ + "\7B\2\2\u015d\u015f\7o\2\2\u015e\u015c\3\2\2\2\u015f\u0160\3\2\2\2\u0160"+ + "\u015e\3\2\2\2\u0160\u0161\3\2\2\2\u01619\3\2\2\2\u0162\u0163\t\13\2\2"+ + "\u0163;\3\2\2\2\u0164\u0165\t\f\2\2\u0165=\3\2\2\2\u0166\u0168\t\r\2\2"+ + "\u0167\u0169\5@!\2\u0168\u0167\3\2\2\2\u0168\u0169\3\2\2\2\u0169?\3\2"+ + "\2\2\u016a\u016b\7M\2\2\u016bA\3\2\2\2\u016c\u016d\t\16\2\2\u016dC\3\2"+ + "\2\2\u016e\u016f\7\32\2\2\u016f\u0174\5&\24\2\u0170\u0171\7\17\2\2\u0171"+ + "\u0173\5&\24\2\u0172\u0170\3\2\2\2\u0173\u0176\3\2\2\2\u0174\u0172\3\2"+ + "\2\2\u0174\u0175\3\2\2\2\u0175\u0177\3\2\2\2\u0176\u0174\3\2\2\2\u0177"+ + "\u0178\7\33\2\2\u0178E\3\2\2\2\u0179\u017a\7t\2\2\u017aG\3\2\2\2\u017b"+ + "\u017c\7v\2\2\u017cI\3\2\2\2\u017d\u017e\7s\2\2\u017eK\3\2\2\2\u017f\u0186"+ + "\5> \2\u0180\u0186\5B\"\2\u0181\u0186\5D#\2\u0182\u0186\5F$\2\u0183\u0186"+ + "\5H%\2\u0184\u0186\5J&\2\u0185\u017f\3\2\2\2\u0185\u0180\3\2\2\2\u0185"+ + "\u0181\3\2\2\2\u0185\u0182\3\2\2\2\u0185\u0183\3\2\2\2\u0185\u0184\3\2"+ + "\2\2\u0186M\3\2\2\2\u0187\u0188\7P\2\2\u0188\u0189\7u\2\2\u0189O\3\2\2"+ + "\2\u018a\u018b\7Q\2\2\u018b\u018c\5\66\34\2\u018c\u018e\7\'\2\2\u018d"+ + "\u018f\5V,\2\u018e\u018d\3\2\2\2\u018e\u018f\3\2\2\2\u018f\u0190\3\2\2"+ + "\2\u0190\u0192\7(\2\2\u0191\u0193\5R*\2\u0192\u0191\3\2\2\2\u0192\u0193"+ + "\3\2\2\2\u0193\u0194\3\2\2\2\u0194\u0195\5T+\2\u0195\u0196\7n\2\2\u0196"+ + "Q\3\2\2\2\u0197\u0198\7R\2\2\u0198\u0199\5Z.\2\u0199S\3\2\2\2\u019a\u019b"+ + "\7S\2\2\u019b\u01a0\7n\2\2\u019c\u019f\5\b\5\2\u019d\u019f\7n\2\2\u019e"+ + "\u019c\3\2\2\2\u019e\u019d\3\2\2\2\u019f\u01a2\3\2\2\2\u01a0\u019e\3\2"+ + "\2\2\u01a0\u01a1\3\2\2\2\u01a1\u01a3\3\2\2\2\u01a2\u01a0\3\2\2\2\u01a3"+ + "\u01a4\7T\2\2\u01a4U\3\2\2\2\u01a5\u01aa\5X-\2\u01a6\u01a7\7\17\2\2\u01a7"+ + "\u01a9\5X-\2\u01a8\u01a6\3\2\2\2\u01a9\u01ac\3\2\2\2\u01aa\u01a8\3\2\2"+ + "\2\u01aa\u01ab\3\2\2\2\u01abW\3\2\2\2\u01ac\u01aa\3\2\2\2\u01ad\u01ae"+ + "\5\66\34\2\u01ae\u01af\7\4\2\2\u01af\u01b0\5\32\16\2\u01b0Y\3\2\2\2\u01b1"+ + "\u01b6\5\32\16\2\u01b2\u01b3\7\17\2\2\u01b3\u01b5\5\32\16\2\u01b4\u01b2"+ + "\3\2\2\2\u01b5\u01b8\3\2\2\2\u01b6\u01b4\3\2\2\2\u01b6\u01b7\3\2\2\2\u01b7"+ + "[\3\2\2\2\u01b8\u01b6\3\2\2\2\u01b9\u01ba\7U\2\2\u01ba\u01bb\5\66\34\2"+ + "\u01bb\u01bd\7\'\2\2\u01bc\u01be\5`\61\2\u01bd\u01bc\3\2\2\2\u01bd\u01be"+ + "\3\2\2\2\u01be\u01bf\3\2\2\2\u01bf\u01c0\7(\2\2\u01c0\u01c1\7R\2\2\u01c1"+ + "\u01c2\7V\2\2\u01c2\u01c4\7\'\2\2\u01c3\u01c5\5d\63\2\u01c4\u01c3\3\2"+ + "\2\2\u01c4\u01c5\3\2\2\2\u01c5\u01c6\3\2\2\2\u01c6\u01c7\7(\2\2\u01c7"+ + "\u01c8\7R\2\2\u01c8\u01ca\7\'\2\2\u01c9\u01cb\5f\64\2\u01ca\u01c9\3\2"+ + "\2\2\u01ca\u01cb\3\2\2\2\u01cb\u01cc\3\2\2\2\u01cc\u01cf\7(\2\2\u01cd"+ + "\u01d0\5^\60\2\u01ce\u01d0\5T+\2\u01cf\u01cd\3\2\2\2\u01cf\u01ce\3\2\2"+ + "\2\u01d0]\3\2\2\2\u01d1\u01d2\7\20\2\2\u01d2\u01d3\5> \2\u01d3_\3\2\2"+ + "\2\u01d4\u01d9\5b\62\2\u01d5\u01d6\7\17\2\2\u01d6\u01d8\5b\62\2\u01d7"+ + "\u01d5\3\2\2\2\u01d8\u01db\3\2\2\2\u01d9\u01d7\3\2\2\2\u01d9\u01da\3\2"+ + "\2\2\u01daa\3\2\2\2\u01db\u01d9\3\2\2\2\u01dc\u01dd\5\66\34\2\u01dd\u01de"+ + "\7\4\2\2\u01de\u01df\5\32\16\2\u01df\u01e2\7W\2\2\u01e0\u01e3\5:\36\2"+ + "\u01e1\u01e3\5<\37\2\u01e2\u01e0\3\2\2\2\u01e2\u01e1\3\2\2\2\u01e3c\3"+ + "\2\2\2\u01e4\u01e9\5:\36\2\u01e5\u01e6\7\17\2\2\u01e6\u01e8\5:\36\2\u01e7"+ + "\u01e5\3\2\2\2\u01e8\u01eb\3\2\2\2\u01e9\u01e7\3\2\2\2\u01e9\u01ea\3\2"+ + "\2\2\u01eae\3\2\2\2\u01eb\u01e9\3\2\2\2\u01ec\u01f1\5h\65\2\u01ed\u01ee"+ + "\7\17\2\2\u01ee\u01f0\5h\65\2\u01ef\u01ed\3\2\2\2\u01f0\u01f3\3\2\2\2"+ + "\u01f1\u01ef\3\2\2\2\u01f1\u01f2\3\2\2\2\u01f2g\3\2\2\2\u01f3\u01f1\3"+ + "\2\2\2\u01f4\u01f5\5\32\16\2\u01f5\u01f8\7W\2\2\u01f6\u01f9\5:\36\2\u01f7"+ + "\u01f9\5<\37\2\u01f8\u01f6\3\2\2\2\u01f8\u01f7\3\2\2\2\u01f9i\3\2\2\2"+ + "\u01fa\u01fb\7X\2\2\u01fb\u01fd\5&\24\2\u01fc\u01fe\7n\2\2\u01fd\u01fc"+ + "\3\2\2\2\u01fd\u01fe\3\2\2\2\u01fe\u0201\3\2\2\2\u01ff\u0202\5\b\5\2\u0200"+ + "\u0202\5T+\2\u0201\u01ff\3\2\2\2\u0201\u0200\3\2\2\2\u0202\u0204\3\2\2"+ + "\2\u0203\u0205\7n\2\2\u0204\u0203\3\2\2\2\u0204\u0205\3\2\2\2\u0205\u0207"+ + "\3\2\2\2\u0206\u0208\5l\67\2\u0207\u0206\3\2\2\2\u0207\u0208\3\2\2\2\u0208"+ + "\u0209\3\2\2\2\u0209\u020a\7n\2\2\u020ak\3\2\2\2\u020b\u020d\7Y\2\2\u020c"+ + "\u020e\7n\2\2\u020d\u020c\3\2\2\2\u020d\u020e\3\2\2\2\u020e\u0211\3\2"+ + "\2\2\u020f\u0212\5\b\5\2\u0210\u0212\5T+\2\u0211\u020f\3\2\2\2\u0211\u0210"+ + "\3\2\2\2\u0212m\3\2\2\2\u0213\u0215\5p9\2\u0214\u0216\7n\2\2\u0215\u0214"+ + "\3\2\2\2\u0215\u0216\3\2\2\2\u0216\u0219\3\2\2\2\u0217\u021a\5\b\5\2\u0218"+ + "\u021a\5T+\2\u0219\u0217\3\2\2\2\u0219\u0218\3\2\2\2\u021a\u021c\3\2\2"+ + "\2\u021b\u021d\7n\2\2\u021c\u021b\3\2\2\2\u021c\u021d\3\2\2\2\u021d\u021f"+ + "\3\2\2\2\u021e\u0220\5l\67\2\u021f\u021e\3\2\2\2\u021f\u0220\3\2\2\2\u0220"+ + "\u0221\3\2\2\2\u0221\u0222\7n\2\2\u0222o\3\2\2\2\u0223\u0224\t\17\2\2"+ + "\u0224q\3\2\2\2\u0225\u0228\7f\2\2\u0226\u0229\5:\36\2\u0227\u0229\5\66"+ + "\34\2\u0228\u0226\3\2\2\2\u0228\u0227\3\2\2\2\u0229\u022a\3\2\2\2\u022a"+ + "\u022b\7g\2\2\u022b\u022d\5&\24\2\u022c\u022e\7n\2\2\u022d\u022c\3\2\2"+ + "\2\u022d\u022e\3\2\2\2\u022e\u022f\3\2\2\2\u022f\u0230\5T+\2\u0230s\3"+ + "\2\2\2\u0231\u0232\7h\2\2\u0232\u0234\5&\24\2\u0233\u0235\7n\2\2\u0234"+ + "\u0233\3\2\2\2\u0234\u0235\3\2\2\2\u0235\u0238\3\2\2\2\u0236\u0239\5\b"+ + "\5\2\u0237\u0239\5T+\2\u0238\u0236\3\2\2\2\u0238\u0237\3\2\2\2\u0239u"+ + "\3\2\2\2\u023a\u023d\7i\2\2\u023b\u023e\5\b\5\2\u023c\u023e\5T+\2\u023d"+ + "\u023b\3\2\2\2\u023d\u023c\3\2\2\2\u023e\u0240\3\2\2\2\u023f\u0241\7n"+ + "\2\2\u0240\u023f\3\2\2\2\u0240\u0241\3\2\2\2\u0241\u0242\3\2\2\2\u0242"+ + "\u0243\7j\2\2\u0243\u0244\5&\24\2\u0244w\3\2\2\2>z|\u0083\u0088\u00a3"+ + "\u00ac\u00b0\u00b7\u00ba\u00bf\u00c3\u00c9\u00db\u00eb\u00ff\u0127\u0129"+ + "\u012b\u0131\u0137\u013b\u0141\u0145\u014e\u0153\u0160\u0168\u0174\u0185"+ + "\u018e\u0192\u019e\u01a0\u01aa\u01b6\u01bd\u01c4\u01ca\u01cf\u01d9\u01e2"+ + "\u01e9\u01f1\u01f8\u01fd\u0201\u0204\u0207\u020d\u0211\u0215\u0219\u021c"+ + "\u021f\u0228\u022d\u0234\u0238\u023d\u0240"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/compiler/src/prog8/stackvm/Program.kt b/compiler/src/prog8/stackvm/Program.kt index 3631999fe..e49158881 100644 --- a/compiler/src/prog8/stackvm/Program.kt +++ b/compiler/src/prog8/stackvm/Program.kt @@ -107,7 +107,7 @@ class Program (val name: String, Opcode.INC_VAR, Opcode.DEC_VAR, Opcode.SHR_VAR, Opcode.SHL_VAR, Opcode.ROL_VAR, Opcode.ROR_VAR, Opcode.ROL2_VAR, Opcode.ROR2_VAR, Opcode.POP_VAR, Opcode.PUSH_VAR, - Opcode.PUSH_INDEXED_VAR -> { + Opcode.READ_INDEXED_VAR, Opcode.WRITE_INDEXED_VAR -> { val withoutQuotes = if(args!!.startsWith('"') && args.endsWith('"')) args.substring(1, args.length-1) else args diff --git a/compiler/src/prog8/stackvm/StackVm.kt b/compiler/src/prog8/stackvm/StackVm.kt index a84affd19..d00f06143 100644 --- a/compiler/src/prog8/stackvm/StackVm.kt +++ b/compiler/src/prog8/stackvm/StackVm.kt @@ -94,7 +94,8 @@ enum class Opcode { NOTEQUAL, // array access - PUSH_INDEXED_VAR, + READ_INDEXED_VAR, + WRITE_INDEXED_VAR, // branching JUMP, @@ -911,7 +912,8 @@ class StackVm(private var traceOutputFile: String?) { Opcode.LINE -> { sourceLine = ins.callLabel!! } - Opcode.PUSH_INDEXED_VAR -> { + Opcode.READ_INDEXED_VAR -> { + // put the value of variable[index] onto the stack val index = evalstack.pop().integerValue() val variable = variables[ins.callLabel] ?: throw VmExecutionException("unknown variable: ${ins.callLabel}") if(variable.type==DataType.WORD) { @@ -930,7 +932,46 @@ class StackVm(private var traceOutputFile: String?) { DataType.STR, DataType.STR_P, DataType.STR_S, - DataType.STR_PS -> throw VmExecutionException("not a proper array/matrix var") + DataType.STR_PS -> throw VmExecutionException("not a proper array/matrix var") // todo: allow strings + } + } + } + Opcode.WRITE_INDEXED_VAR -> { + // store value on the stack in variable[index] (index is on the stack as well) + val index = evalstack.pop().integerValue() + val value = evalstack.pop() + val variable = variables[ins.callLabel] ?: throw VmExecutionException("unknown variable: ${ins.callLabel}") + if(variable.type==DataType.WORD) { + // assume the variable is a pointer (address) and write the byte value to that memory location + if(value.type!=DataType.BYTE) + throw VmExecutionException("writing a non-byte value to memory location") + mem.setByte(variable.integerValue(), value.integerValue().toShort()) + } else { + // set indexed element in the array + val array = heap.get(variable.heapId) + when(array.type) { + DataType.ARRAY, DataType.MATRIX -> { + if(value.type!=DataType.BYTE) + throw VmExecutionException("writing a non-byte value into byte array/matrix") + array.array!![index] = value.integerValue() + } + DataType.ARRAY_W -> { + if(value.type!=DataType.WORD) + throw VmExecutionException("writing a non-word value into word array") + array.array!![index] = value.integerValue() + } + DataType.ARRAY_F -> { + if(value.type!=DataType.FLOAT) + throw VmExecutionException("writing a non-float value into float array") + array.doubleArray!![index] = value.numericValue().toDouble() + } + DataType.BYTE, + DataType.WORD, + DataType.FLOAT, + DataType.STR, + DataType.STR_P, + DataType.STR_S, + DataType.STR_PS -> throw VmExecutionException("not a proper array/matrix var") // todo: allow strings } } }