public State(Interpreter ii, Source source, ChannelStack output)
 {
     _finished = false;
     _preBlueprints = new Stack<Blueprint>();
     _postBlueprints = new Stack<Blueprint>();
     _interpreter = ii;
     _output = output;
     _reader = new SourceReader(source);
     _sharesOutput = (output == _interpreter._output && _interpreter.PrevState != null) || (_interpreter._stateStack.Any() && output == _interpreter._stateStack.Peek().Output);
 }
 private State(Interpreter ii, Source derivedSource, IEnumerable<Token<TokenType>> tokens,
     ChannelStack output)
 {
     _finished = false;
     _preBlueprints = new Stack<Blueprint>();
     _postBlueprints = new Stack<Blueprint>();
     _interpreter = ii;
     _output = output;
     _reader = new SourceReader(new Source(derivedSource.Name, derivedSource.Type, tokens, derivedSource.Code));
     _sharesOutput = (output == _interpreter._output && _interpreter.PrevState != null) || (_interpreter._stateStack.Any() && output == _interpreter._stateStack.Peek().Output);
 }
 public static State CreateDerivedDistinct(Source derivedSource, IEnumerable<Token<TokenType>> tokens,
     Interpreter interpreter, ChannelStack output = null)
 {
     return new State(interpreter, derivedSource, tokens, output ?? new ChannelStack(interpreter.CharLimit));
 }