Esempio n. 1
0
        private Node ConsumeAs(Node node, TokenType tokenType)
        {
            var ret = node.AddChild(tokenType, _currentToken.Text);

            Next();

            return ret;
        }
Esempio n. 2
0
        private Node ConsumeAs(Node node, TokenType expectedTokenType, TokenType asTokenType)
        {
            if (IsTokenType(expectedTokenType))
            {
                var ret = node.AddChild(asTokenType, _currentToken.Text);

                Next();

                return ret;
            }

            throw new Exception("Expected " + expectedTokenType);
        }