/// <summary> /// Obtiene todos los tokens de la cadena /// </summary> internal TokensCollection GetAllTokens() { TokensCollection tokens = new TokensCollection(); // Obtiene todos los tokens do { tokens.Add(GetNextToken()); }while (tokens[tokens.Count - 1].Type != Token.TokenType.EOF); // Devuelve la colección de tokens return(tokens); }
/// <summary> /// Adds a new token to the current collection /// </summary> /// <param name="T"></param> Token AddToken(Token.TYPE _type, object _value) { TokensCollection tokens = m_tokenCollections.Peek(); int streamIndex = m_stream.Index; if (_type == Token.TYPE.NAME && _value is Name) { streamIndex -= (_value as Name).ToString().Length; } Token T = new Token(streamIndex, _type, _value); tokens.Add(T); return(T); }