Exemple #1
0
        //  populated-arg ::= populated-arg-type arrays-opt out-opt
        //  out-opt ::= '@' |
        private PopulatedType ParsePopulatedArg()
        {
            PopulatedType type = ParsePopulatedArgType();

            IEnumerable <ArrayInfo> arrays = ParseArraysOpt();

            if (arrays != null && arrays.Any())
            {
                type = type.WithArrays(arrays);
            }

            return(type);
        }
Exemple #2
0
        //  populated-generic-args ::= populated-arg | populated-arg ',' populated-generic-args
        private IEnumerable <PopulatedType> ParsePopulatedGenericArgs()
        {
            List <PopulatedType> args = new List <PopulatedType>();

            PopulatedType type = ParsePopulatedArg();

            args.Add(type);

            while (_lexer.Next() == NameTokenKind.Comma)
            {
                type = ParsePopulatedArg();
                args.Add(type);
            }
            _lexer.Unget();

            return(args);
        }
Exemple #3
0
        //  populated-arg-list ::= populated-arg out-opt | populated-arg out-opt ',' populated-arg-list
        //  out-opt ::= '@' |
        private IEnumerable <ParamInfo> ParsePopulatedArgList()
        {
            List <ParamInfo> args = new List <ParamInfo>();

            do
            {
                PopulatedType type      = ParsePopulatedArg();
                ParamInfo     paramInfo = new ParamInfo(type);
                if (_lexer.Next() == NameTokenKind.At)
                {
                    paramInfo = paramInfo.WithKind(ParameterKind.Out);
                }
                else
                {
                    _lexer.Unget();
                }
                args.Add(paramInfo);
            }while (_lexer.Next() == NameTokenKind.Comma);

            _lexer.Unget();

            return(args);
        }