public void Init() { if (!_tokenizer.MoveNext()) { ParseException.ExpectedToken(); } _lookahead = _tokenizer.Token; }
public bool Exist(Token name) { return _tags.Any(t => t.TagName.Equals(name)); }
public ITag Get(Token name) { return Get(name.Contents, name.Context); }
private void ReinitLookAhead() { if (_tokenizer.MoveNext()) { _lookahead = _tokenizer.Token; } }
private void InitLookAhead() { if (_tokenizer.MoveNext()) { _previous = _current; _current = _lookahead; _lookahead = _tokenizer.Token; } }
public Token Next() { _previous = _current; _current = _lookahead; _lookahead = null; if (_tokenizer.MoveNext()) { _lookahead = _tokenizer.Token; } if (_current == null) { throw ParseException.ExpectedToken().Decorate(_previous); } return _current; }
public TextPart(Token token) : this(token.Contents, token.Context) { }
public bool At(ICollection <string> expectedTokens) { Token current = Current; return(Current != null?expectedTokens.Contains(current.Contents) : false); }