Esempio n. 1
0
        public final MethodTypeSignature parseMethodTypeSignature()
        {
            var result = new MethodTypeSignature();

            if (current == '<')
            {
                result.formalTypeParameters = parseFormalTypeParameters();
            }
            else
            {
                result.formalTypeParameters = Collections.emptyList <TypeSignature>();
            }
            if (current != '(')
            {
                throw new IllegalStateException();
            }
            advance();
            var parameters = new ArrayList <TypeSignature>();

            result.parameters = parameters;
            while (current != ')')
            {
                parameters.add(parseTypeSignature());
            }
            advance();
            if (current == 'V')
            {
                result.returnType = PrimitiveTypeSignature.VoidSignature;
                advance();
            }
            else
            {
                result.returnType = parseTypeSignature();
            }
            var exceptions = new ArrayList <TypeSignature>();

            result.exceptions = exceptions;
            while (current != -1)
            {
                if (current != '^')
                {
                    throw new IllegalStateException();
                }
                advance();
                if (current == 'T')
                {
                    exceptions.add(parseTypeVariableSignature());
                }
                else
                {
                    exceptions.add(parseClassTypeSignature());
                }
            }
            return(result);
        }
 public final MethodTypeSignature parseMethodTypeSignature() {
     var result = new MethodTypeSignature();
     if (current == '<') {
         result.formalTypeParameters = parseFormalTypeParameters();
     } else {
         result.formalTypeParameters = Collections.emptyList<TypeSignature>();
     }
     if (current != '(') {
         throw new IllegalStateException();
     }
     advance();
     var parameters = new ArrayList<TypeSignature>();
     result.parameters = parameters;
     while (current != ')') {
         parameters.add(parseTypeSignature());
     }
     advance();
     if (current == 'V') {
         result.returnType = PrimitiveTypeSignature.VoidSignature;
         advance();
     } else {
         result.returnType = parseTypeSignature();
     }
     var exceptions = new ArrayList<TypeSignature>();
     result.exceptions = exceptions;
     while (current != -1) {
         if (current != '^') {
             throw new IllegalStateException();
         }
         advance();
         if (current == 'T') {
             exceptions.add(parseTypeVariableSignature());
         } else {
             exceptions.add(parseClassTypeSignature());
         }
     }
     return result;
 }