public BaseRecognizer(RecognizerSharedState state) { if (state == null) { state = new RecognizerSharedState(); } this.state = state; this.InitDFAs(); }
public RecognizerSharedState(RecognizerSharedState state) { if (state == null) { throw new ArgumentNullException("state"); } this.following = (BitSet[])state.following.Clone(); this._fsp = state._fsp; this.errorRecovery = state.errorRecovery; this.lastErrorIndex = state.lastErrorIndex; this.failed = state.failed; this.syntaxErrors = state.syntaxErrors; this.backtracking = state.backtracking; if (state.ruleMemo != null) { this.ruleMemo = (IDictionary <int, int>[])state.ruleMemo.Clone(); } this.token = state.token; this.tokenStartCharIndex = state.tokenStartCharIndex; this.tokenStartCharPositionInLine = state.tokenStartCharPositionInLine; this.channel = state.channel; this.type = state.type; this.text = state.text; }