예제 #1
0
 private static void RegisterDefaultLexemeFactories(ILexemeFactoryRegistry lexemeFactoryRegistry)
 {
     lexemeFactoryRegistry.Register(new TerminalLexemeFactory());
     lexemeFactoryRegistry.Register(new ParseEngineLexemeFactory());
     lexemeFactoryRegistry.Register(new StringLiteralLexemeFactory());
     lexemeFactoryRegistry.Register(new DfaLexemeFactory());
 }
예제 #2
0
 public ParseRunner(IParseEngine parseEngine, TextReader reader)
 {
     ParseEngine            = parseEngine;
     _reader                = reader;
     _existingLexemes       = new List <ILexeme>();
     _ignoreLexemes         = new List <ILexeme>();
     _lexemeFactoryRegistry = new LexemeFactoryRegistry();
     RegisterDefaultLexemeFactories(_lexemeFactoryRegistry);
     Position = 0;
 }
예제 #3
0
        public ParseInterface(IParseEngine parseEngine, TextReader input)
        {
            _textReader = input;
            _lexemeFactoryRegistry = new LexemeFactoryRegistry();
            _lexemeFactoryRegistry.Register(new TerminalLexemeFactory());
            _lexemeFactoryRegistry.Register(new ParseEngineLexemeFactory());
            _lexemeFactoryRegistry.Register(new StringLiteralLexemeFactory());
            _lexemeFactoryRegistry.Register(new DfaLexemeFactory());

            Position = -1;
            ParseEngine = parseEngine;
        }
예제 #4
0
        public ParseRunner(IParseEngine parseEngine, TextReader input)
        {
            _textReader = input;

            _lexemeFactoryRegistry = new LexemeFactoryRegistry();
            RegisterDefaultLexemeFactories(_lexemeFactoryRegistry);

            _ignoreLexemes = new List<ILexeme>();
            _existingLexemes = new List<ILexeme>();

            Position = 0;
            ParseEngine = parseEngine;
        }
예제 #5
0
        public ParseRunner(IParseEngine parseEngine, TextReader reader)
        {
            ParseEngine            = parseEngine;
            _reader                = reader;
            _tokenLexemes          = new List <ILexeme>();
            _ignoreLexemes         = new List <ILexeme>();
            _triviaLexemes         = new List <ILexeme>();
            _triviaAccumulator     = new List <ILexeme>();
            _lexemeFactoryRegistry = new LexemeFactoryRegistry();
            _builder               = new StringBuilder();
            _capture               = new StringBuilderCapture(_builder);

            RegisterDefaultLexemeFactories(_lexemeFactoryRegistry);
            Position = -1;
        }
예제 #6
0
 private static void RegisterDefaultLexemeFactories(ILexemeFactoryRegistry lexemeFactoryRegistry)
 {
     lexemeFactoryRegistry.Register(new TerminalLexemeFactory());
     lexemeFactoryRegistry.Register(new ParseEngineLexemeFactory());
     lexemeFactoryRegistry.Register(new StringLiteralLexemeFactory());
     lexemeFactoryRegistry.Register(new DfaLexemeFactory());
 }