// Move our pointer to the right. public VisitResult VisitMove_Right([Antlr4.Runtime.Misc.NotNull] BFParser.Move_RightContext context) { if (memPos == memSize - 1) // Wrap around to the furthest left. { memPos = 0; var datPtr = GetValue(ptr); // Get data pointer. SetValue(ptr, IntToPtr(AddSub32(PtrToInt(datPtr), true, memSize - 1))); // Do the math operations to our pointer, which involves converting it than reconverting it. } else // Move right. { memPos++; var datPtr = GetValue(ptr); // Get data pointer. SetValue(ptr, IntToPtr(AddSub32(PtrToInt(datPtr), false, 1))); // Do the math operations to our pointer, which involves converting it than reconverting it. } return(null); }
/// <summary> /// Exit a parse tree produced by the <c>Move_Right</c> /// labeled alternative in <see cref="BFParser.instruction"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitMove_Right([NotNull] BFParser.Move_RightContext context) { }
/// <summary> /// Visit a parse tree produced by the <c>Move_Right</c> /// labeled alternative in <see cref="BFParser.instruction"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitMove_Right([NotNull] BFParser.Move_RightContext context) { return(VisitChildren(context)); }