io.IoLexer.top C# (CSharp) Method

top() public method

public top ( ) : IoToken
return IoToken
        public IoToken top()
        {
            if (resultIndex >= tokenStream.Count) return null;
            return tokenStream[resultIndex] as IoToken;
        }

Usage Example

Ejemplo n.º 1
0
Archivo: IoMessage.cs Proyecto: ypyf/io
        void parseArgs(IoLexer lexer)
        {
            lexer.pop();

            if (lexer.top() != null && lexer.top().isValidMessageName())
            {
                IoMessage arg = newParseNextMessageChain(this.state, lexer);
                addArg(arg);

                while (lexer.topType() == IoTokenType.COMMA_TOKEN)
                {
                    lexer.pop();

                    if (lexer.top() != null && lexer.top().isValidMessageName())
                    {
                        IoMessage arg2 = newParseNextMessageChain(this.state, lexer);
                        addArg(arg2);
                    }
                    else
                    {
                    }
                }
            }

            if (lexer.topType() != IoTokenType.CLOSEPAREN_TOKEN)
            {
                // TODO: Exception, missing close paren
            }
            lexer.pop();
        }
All Usage Examples Of io.IoLexer::top