コード例 #1
0
        bool ParseMethodPointer(string s)
        {
            int p = 0;

            if (s.StartsWith("method"))
            {
                content += "method";
                p        = content.Length;
            }
            if (p == 0)
            {
                return(false);
            }

            char c;

            while (char.IsWhiteSpace(c = s[p]))
            {
                p++;
                content += c;
            }

            EcmaCallConv callConv = new EcmaCallConv();

            if (!callConv.Parse(s.Substring(content.Length)))
            {
                throw new EcmaILParserException("CallConv", content, s);
            }

            content += callConv.Content;
            p       += callConv.NextTokenPosition;

            EcmaType type = new EcmaType();

            if (!type.Parse(s.Substring(p)))
            {
                throw new EcmaILParserException("Type", content, s);
            }

            content += type.Content;
            p       += type.NextTokenPosition;

            while (char.IsWhiteSpace(c = s[p]))
            {
                p++;
                content += c;
            }

            if (c != '*')
            {
                throw new EcmaILParserException("*", content, s);
            }

            content += c;

            while (char.IsWhiteSpace(c = s[p]))
            {
                p++;
                content += c;
            }

            EcmaParameterList parameterList = new EcmaParameterList();

            if (!parameterList.Parse(s.Substring(p)))
            {
                throw new EcmaILParserException("ParameterList", content, s);
            }

            content += parameterList.Content;
            p       += parameterList.NextTokenPosition;

            nextTokenPosition += p;

            return(true);
        }