示例#1
0
                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);
                }