public INode Parse(IEnumerable <IToken> tokens) { _tokens = tokens.GetEnumerator(); _states = new Stack <ParseState>(); _currentState = new ParseState(); while (_tokens.MoveNext()) { _currentState.Handle(this); } while (_states.Count > 0) { EndState(); } return(_currentState.Close()); }
public INode Parse(IEnumerable<IToken> tokens) { _tokens = tokens.GetEnumerator(); _states = new Stack<ParseState>(); _currentState = new ParseState(); while (_tokens.MoveNext()) { _currentState.Handle(this); } while (_states.Count > 0) { EndState(); } return _currentState.Close(); }