public void Mount(TextSource textSource, LexerContext <TToken> parserContext) { _textSource = textSource; _lexerContext = parserContext; if (_lexerContext != null) { _lexerContext.LexerAutomataContext = this; } }
public SpanProcess(StringTextSource textSource, Lexer <TGrammar, TToken> lexer, LexerContext <TToken> lexerContext) : base(textSource) { _charMemory = textSource.String.AsMemory().Slice(textSource.Offset); _dfaInitialState = lexer.Automata._dfaBuilder.InitialState; _noOpDfaInitialState = lexer.Automata._dfaBuilder.NoOpInitialState; Context = new LexerAutomataContext(); Context.Mount(textSource, lexerContext); }
public ReaderProcess(TextSource textSource, Lexer <TGrammar, TToken> lexer, LexerContext <TToken> lexerContext) : base(textSource) { _dfaInitialState = lexer.Automata._dfaBuilder.InitialState; _instructionStream = new InstructionStream().AddReference().Mount(new TextInstructionReader(textSource.CreateReader()), lexer.Automata); _instructionPointer = InstructionStream.InitializeInstructionPointer(); Context = new LexerAutomataContext(); Context.Mount(textSource, lexerContext); }