Parses the generic signature of a class and creates the data structure
representing the signature.

@param genericDecl the GenericDeclaration calling this method
@param signature the generic signature of the class
187634
public void parseForClass(GenericDeclaration genericDecl, String signature) {
        setInput(genericDecl, signature);
        if (!eof) {
            parseClassSignature();
        } else {
            if(genericDecl instanceof Class) {
                Class c = (Class) genericDecl;
                this.formalTypeParameters = EmptyArray.TYPE_VARIABLE;
                this.superclassType = c.getSuperclass();
                Class<?>[] interfaces = c.getInterfaces();
                if (interfaces.length == 0) {
                    this.interfaceTypes = ListOfTypes.EMPTY;
                } else {
                    this.interfaceTypes = new ListOfTypes(interfaces);
                }
            } else {
                this.formalTypeParameters = EmptyArray.TYPE_VARIABLE;
                this.superclassType = Object.class;
                this.interfaceTypes = ListOfTypes.EMPTY;
            }
        }
    }
706716
static TypeVariableSignature parse(final Parser parser, final String definingClassName) throws ParseException {
        final char peek = parser.peek();
        if (peek == 'T') {
            parser.next();
            if (!TypeUtils.getIdentifierToken(parser)) {
                throw new ParseException(parser, "Could not parse type variable signature");
            }
            parser.expect(';');
            final TypeVariableSignature typeVariableSignature = new TypeVariableSignature(parser.currToken(),
                    definingClassName);

            // Save type variable signatures in the parser state, so method and class type signatures can link
            // to type signatures
            @SuppressWarnings("unchecked")
            List<TypeVariableSignature> typeVariableSignatures = (List<TypeVariableSignature>) parser.getState();
            if (typeVariableSignatures == null) {
                parser.setState(typeVariableSignatures = new ArrayList<>());
            }
            typeVariableSignatures.add(typeVariableSignature);

            return typeVariableSignature;
        } else {
            return null;
        }
    }
229258
public static void validateLambdaType(Class<?> baseClass, Type t) {
		if (!(t instanceof Class)) {
			return;
		}
		final Class<?> clazz = (Class<?>) t;

		if (clazz.getTypeParameters().length > 0) {
			throw new InvalidTypesException("The generic type parameters of '" + clazz.getSimpleName() + "' are missing. "
				+ "In many cases lambda methods don't provide enough information for automatic type extraction when Java generics are involved. "
				+ "An easy workaround is to use an (anonymous) class instead that implements the '" + baseClass.getName() + "' interface. "
				+ "Otherwise the type has to be specified explicitly using type information.");
		}
	}
769112
static TypeSignature parse(final Parser parser, final String definingClass) throws ParseException {
        final ReferenceTypeSignature referenceTypeSignature = ReferenceTypeSignature
                .parseReferenceTypeSignature(parser, definingClass);
        if (referenceTypeSignature != null) {
            return referenceTypeSignature;
        }
        final BaseTypeSignature baseTypeSignature = BaseTypeSignature.parse(parser);
        if (baseTypeSignature != null) {
            return baseTypeSignature;
        }
        return null;
    }
668326
@Override
    public void visitFormalTypeParameter(final String name) {
        if (type == TYPE_SIGNATURE
                || (state != EMPTY && state != FORMAL && state != BOUND)) {
            throw new IllegalStateException();
        }
        CheckMethodAdapter.checkIdentifier(name, "formal type parameter");
        state = FORMAL;
        if (sv != null) {
            sv.visitFormalTypeParameter(name);
        }
    }
904814
def unparse_signature(signature) :
    ""
    signature = parse_signature(signature)
    if not isinstance(signature, (tuple, list)) :
        signature = [signature]
    #end if
    return \
        DBUS.Signature("".join(t.signature for t in signature))
729314
private static void classTypeSignature(Result sb, TypeMirror type) throws IOException
    {
        sb.append('L');
        packageSpecifier(sb, type);
        simpleClassTypeSignature(sb, type);
        classTypeSignatureSuffix(sb, type);
        sb.append(';');
    }
203710
public static @CheckForNull
    ClassDescriptor createClassDescriptorFromFieldSignature(String signature) {
        int start = signature.indexOf('L');
        if (start < 0) {
            return null;
        }
        int end = signature.indexOf(';', start);
        if (end < 0) {
            return null;
        }
        return createClassDescriptor(signature.substring(start + 1, end));
    }
889438
private void outputDocTypeDecl(String name) throws SAXException {
        if (true == m_needToOutputDocTypeDecl)
        {
            String doctypeSystem = getDoctypeSystem();
            String doctypePublic = getDoctypePublic();
            if ((null != doctypeSystem) || (null != doctypePublic))
            {
                final java.io.Writer writer = m_writer;
                try
                {
                writer.write("<!DOCTYPE ");
                writer.write(name);

                if (null != doctypePublic)
                {
                    writer.write(" PUBLIC \"");
                    writer.write(doctypePublic);
                    writer.write('"');
                }

                if (null != doctypeSystem)
                {
                    if (null == doctypePublic)
                        writer.write(" SYSTEM \"");
                    else
                        writer.write(" \"");

                    writer.write(doctypeSystem);
                    writer.write('"');
                }

                writer.write('>');
                outputLineSep();
                }
                catch(IOException e)
                {
                    throw new SAXException(e);
                }
            }
        }

        m_needToOutputDocTypeDecl = false;
    }
1016291
public void parseSignaturesStream(InputStream in, String name) throws IOException,ParseException {
    logger.info("Reading API signatures: " + name);
    final Set<String> missingClasses = new TreeSet<String>();
    parseSignaturesStream(in, false, missingClasses);
    reportMissingSignatureClasses(missingClasses);
  }
246246
private static int checkClassTypeSignature(final String signature, int pos) {
        // ClassTypeSignature:
        // L Identifier ( / Identifier )* TypeArguments? ( . Identifier
        // TypeArguments? )* ;

        pos = checkChar('L', signature, pos);
        pos = checkIdentifier(signature, pos);
        while (getChar(signature, pos) == '/') {
            pos = checkIdentifier(signature, pos + 1);
        }
        if (getChar(signature, pos) == '<') {
            pos = checkTypeArguments(signature, pos);
        }
        while (getChar(signature, pos) == '.') {
            pos = checkIdentifier(signature, pos + 1);
            if (getChar(signature, pos) == '<') {
                pos = checkTypeArguments(signature, pos);
            }
        }
        return checkChar(';', signature, pos);
    }
246960
protected String _signature(XCastedExpression castExpression, boolean typeAtEnd) {
		if (castExpression instanceof SarlCastedExpression) {
			final JvmOperation delegate = ((SarlCastedExpression) castExpression).getFeature();
			if (delegate != null) {
				return _signature(delegate, typeAtEnd);
			}
		}
		return MessageFormat.format(Messages.SARLHoverSignatureProvider_0,
				getTypeName(castExpression.getType()));
	}
489830
def parse_type_signature(sig):
    
    match = TYPE_SIG_RE.match(sig.strip())
    if not match:
        raise RuntimeError('Type signature invalid, got ' + sig)
    groups = match.groups()
    typ = groups[0]
    generic_types = groups[1]
    if not generic_types:
        generic_types = []
    else:
        generic_types = split_sig(generic_types[1:-1])
    is_array = (groups[2] is not None)
    return typ, generic_types, is_array
713728
FieldDescriptor getFieldDescriptor(TypeCache.CachedType<?> cachedType, String signature) {
        FieldDescriptor fieldDescriptor = cachedType.getField(signature);
        if (fieldDescriptor == null) {
            fieldDescriptor = scannerContext.getStore().create(FieldDescriptor.class);
            fieldDescriptor.setSignature(signature);
            cachedType.addMember(signature, fieldDescriptor);
        }
        return fieldDescriptor;
    }
54571
@Override
    public void visitClassContext(ClassContext classContext) {
        try {
            String clsName = classContext.getJavaClass().getClassName();
            isInnerClass = clsName.indexOf(Values.INNER_CLASS_SEPARATOR) >= 0;

            clsSignature = SignatureUtils.classToSignature(clsName);
            stack = new OpcodeStack();
            localSpecialObjects = new HashMap<>();
            fieldSpecialObjects = new HashMap<>();
            super.visitClassContext(classContext);

            if (!isInnerClass && !fieldSpecialObjects.isEmpty()) {

                for (Map.Entry<String, String> entry : fieldSpecialObjects.entrySet()) {
                    String fieldName = entry.getKey();
                    String signature = entry.getValue();
                    bugReporter.reportBug(
                            makeFieldBugInstance().addClass(this).addField(clsName, fieldName, signature, false));
                }
            }
        } finally {
            stack = null;
            localSpecialObjects = null;
            fieldSpecialObjects = null;
        }
    }
1126776
public static Map<String, String> deserializeCatalogSignature(String signature) {
        Map<String, String> tableSignatures = Maps.newHashMap();
        for (String oneSig : signature.split(Pattern.quote(SIGNATURE_DELIMITER))) {
            if (!oneSig.isEmpty()) {
                final String[] parts = oneSig.split(Pattern.quote(SIGNATURE_TABLE_NAME_SEPARATOR), 2);
                tableSignatures.put(parts[0], parts[1]);
            }
        }
        return tableSignatures;
    }
677864
@Override
	public void visit(
        final int version,
        final int access,
        final String name,
        final String signature,
        final String superName,
        final String[] interfaces)
    {
    	if ((access & ACC_SYNTHETIC) != 0)
			throw new IllegalStateException("Cannot create type for anonymous or synthetic classes");
    	if ((ACC_ENUM & access) != 0) {
    		result = TypesFactory.eINSTANCE.createJvmEnumerationType();
    		offset = 2;
    	} else if ((ACC_ANNOTATION & access) != 0) {
    		result = TypesFactory.eINSTANCE.createJvmAnnotationType();
    	} else {
    		JvmGenericType generic = TypesFactory.eINSTANCE.createJvmGenericType(); 
    		result = generic;

    		generic.setInterface((access & ACC_INTERFACE) != 0);
    		generic.setStrictFloatingPoint((access & ACC_STRICT) != 0);
    	}
    	setTypeModifiers(access);
    	
    	proxies.setVisibility(access, result);
    	
    	setNameAndPackage(name);

    	BinarySuperTypeSignature genericSignature = null;
		if (signature != null) {
			if ((access & (ACC_STATIC | ACC_INTERFACE)) != 0) {
				typeParameters = Collections.emptyMap();
			}
			genericSignature = BinarySignatures.createSuperTypeSignature(signature);
			if (((ACC_ENUM | ACC_ANNOTATION) & access) == 0) {
				typeParameters = proxies.createTypeParameters(genericSignature, (JvmTypeParameterDeclarator) result, typeParameters);
			}
		}
		setSuperTypes(name, genericSignature, superName, interfaces);
    }