public RecognizerSharedState(RecognizerSharedState state) { if (state == null) { throw new ArgumentNullException("state"); } following = (BitSet[])state.following.Clone(); _fsp = state._fsp; errorRecovery = state.errorRecovery; lastErrorIndex = state.lastErrorIndex; failed = state.failed; syntaxErrors = state.syntaxErrors; backtracking = state.backtracking; if (state.ruleMemo != null) { ruleMemo = (IDictionary <int, int>[])state.ruleMemo.Clone(); } token = state.token; tokenStartCharIndex = state.tokenStartCharIndex; tokenStartCharPositionInLine = state.tokenStartCharPositionInLine; channel = state.channel; type = state.type; text = state.text; }
public BaseRecognizer(RecognizerSharedState state) { if (state == null) { state = new RecognizerSharedState(); } this.state = state; InitDFAs(); }
public Lexer(ICharStream input, RecognizerSharedState state) : base(state) { this.input = input; }
public Parser(ITokenStream input, RecognizerSharedState state) : base(state) // share the state object with another parser { this.input = input; }