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