Exemple #1
0
 public CodeLexer(
     TextReader reader, 
     IEnumerable<TokenBase> tokenMatchers, 
     IConsumeTokenStrategy consumeTokenStrategy)
 {
     this.ConsumeTokenStrategy = consumeTokenStrategy;
     this.reader = reader;
     this.tokenMatchers = tokenMatchers;
     this.NextLine();
 }
Exemple #2
0
        public TokenBase NextTokenUsingStrategy(IConsumeTokenStrategy tokenConsumingStrategy)
        {
            var oldStrategy = this.ConsumeTokenStrategy;
            this.ConsumeTokenStrategy = tokenConsumingStrategy;
            var token = this.NextToken();
            this.ConsumeTokenStrategy = oldStrategy;

            return token;
        }