private void RestoreStateAndPos(Scanner.Context ctx) { this.buffer.Position = ctx.bPos; this._cNum = ctx.cNum; this._state = ctx.state; this._chr = ctx.cChr; }
private void SaveStateAndPos(Scanner.Context ctx) { ctx.bPos = this.buffer.Position; ctx.cNum = this._cNum; ctx.state = this._state; ctx.cChr = this._chr; }
private Scanner.Result Recurse2(Scanner.Context ctx, int next) { this.SaveStateAndPos(ctx); this._state = next; if (this._state != 0) { this.GetChr(); bool flag = false; while (true) { int num = this.NextState(); next = num; if (num == this._currentStart) { break; } if (flag && next > 22) { this.SaveStateAndPos(ctx); } this._state = next; if (this._state == 0) { return Scanner.Result.accept; } this.GetChr(); flag = this._state <= 22; } if (!flag) { return Scanner.Result.noMatch; } else { return Scanner.Result.accept; } } else { return Scanner.Result.accept; } }