Example #1
0
        public void Parse(ExpressionParserHelper parseHelper)
        {
            Token start = parseHelper.Current;

            parseHelper.Expect(FunctionSign);
            var helperExpressionLib = parseHelper.ExpressionLib;

            parseHelper.PushNewTokenConfiguration(new TokenizerConfiguration('\\', _lib.FunctionNamesSet, _lib.FunctionNameSetMaxLength, helperExpressionLib.WhiteSpaceOperandsSet, helperExpressionLib.WhiteSpaceOperandsSetMaxLength, null, true, true), ResetIndex.CurrentAndLookAhead);
            Token token    = parseHelper.Next();
            var   function = _lib.Obtain(token.Contents);

            parseHelper.PopTokenConfiguration(ResetIndex.MaintainPosition);
            parseHelper.Next();
            function.Token  = start;
            function.PreFix = start.Contents;
            parseHelper.Push(function);
            if (function.Arguments.Length == 0)
            {
                BracketsParser.MunchEmptyBrackets(parseHelper);
            }
            else if (function.IsParamsFunctions())
            {
                var bp = new BracketsParser(true, function.Arguments.Length, true);
                bp.Parse(parseHelper);
            }
            else
            {
                var bp = new BracketsParser(true, function.Arguments.Length);
                bp.Parse(parseHelper);
            }
        }
Example #2
0
        public void Parse(ExpressionParserHelper parseHelper)
        {
            Token start = parseHelper.Current;
            var   helperExpressionLib = parseHelper.ExpressionLib;

            parseHelper.PushNewTokenConfiguration(new TokenizerConfiguration('\\', new HashSet <string> {
                _func.Name
            }, _func.Name.Length, helperExpressionLib.WhiteSpaceOperandsSet, helperExpressionLib.WhiteSpaceOperandsSetMaxLength, null, true, true), ResetIndex.CurrentAndLookAhead);
            parseHelper.Expect(_func.Name);
            parseHelper.PopTokenConfiguration(ResetIndex.LookAhead);
            var function = new Function(_func);

            function.Token = start;
            parseHelper.Push(function);
            parseHelper.Next();
            if (function.Arguments.Length == 0)
            {
                BracketsParser.MunchEmptyBrackets(parseHelper);
            }
            else
            {
                var bp = new BracketsParser(true, function.Arguments.Length);
                bp.Parse(parseHelper);
            }
        }