예제 #1
0
        private FunctionalExpression Function()
        {
            var name = Consume(TokenType.WORD).Text;

            Consume(TokenType.LPAREN);
            var function = new FunctionalExpression(name);

            while (!Match(TokenType.RPAREN))
            {
                function.AddArgument(Expression());
                Match(TokenType.COMMA);
            }
            return(function);
        }
예제 #2
0
파일: Parser.cs 프로젝트: MrxLoicx/LLang
        private FunctionalExpression function()
        {
            string name = consume(TokenType.WORD).getText();

            consume(TokenType.LPAREN);
            FunctionalExpression function = new FunctionalExpression(name);

            // добавление аргументов для функции
            while (!match(TokenType.RPAREN))
            {
                function.AddArgument(expression());
                match(TokenType.COMMA);
            }
            return(function);
        }