Returns the declaration of any generic formal types associated with the method
342844
public String getFormalTypes()
    {
        if ( _methodDecl == null || _methodDecl.getReturnType() == null )
            return "";

        Collection<TypeParameterDeclaration> formalTypes = _methodDecl.getFormalTypeParameters();
        if (formalTypes.size() == 0)
            return "";

        StringBuffer sb = new StringBuffer("<");
        boolean isFirst = true;
        for (TypeParameterDeclaration tpd: formalTypes)
        {
            if (isFirst)
                isFirst = false;
            else
                sb.append(", ");

            sb.append(tpd.toString());
        }
        sb.append(">");
        return sb.toString();
    }
623878
function getAssignmentReducedType(declaredType, assignedType) {
            if (declaredType !== assignedType) {
                var reducedType = filterType(declaredType, function (t) { return typeMaybeAssignableTo(assignedType, t); });
                if (reducedType !== neverType) {
                    return reducedType;
                }
            }
            return declaredType;
        }
339042
@SuppressWarnings( "unchecked" )
    protected MethodMetadata getMethodTypeMemberMetadataFrom( MethodDeclaration methodDeclaration ) {
        MethodMetadata methodTypeMemberMetadata = MethodMetadata.methodMemberType(JavaMetadataUtil.getName(methodDeclaration.getName()));
        processReturnTypeOfMethodDeclaration(methodDeclaration, methodTypeMemberMetadata);
        processModifiersOfMethodDeclaration(methodDeclaration, methodTypeMemberMetadata);
        processParametersOfMethodDeclaration(methodDeclaration, methodTypeMemberMetadata);
        List<SingleVariableDeclaration> params = methodDeclaration.parameters();
        for (SingleVariableDeclaration singleVariableDeclaration : params) {
            singleVariableDeclaration.getName();
        }
        return methodTypeMemberMetadata;
    }
758240
def __decl_types(decl):
        """"""
        types = []
        bases = list(decl.__class__.__bases__)
        if 'pygccxml' in decl.__class__.__module__:
            types.append(decl.__class__)
        while bases:
            base = bases.pop()
            if base is declaration.declaration_t:
                continue
            if base is byte_info.byte_info:
                continue
            if base is elaborated_info.elaborated_info:
                continue
            if 'pygccxml' not in base.__module__:
                continue
            types.append(base)
            bases.extend(base.__bases__)
        return types
1257029
def p_type_def_1(t):
    """"""
    # declarations is a type_info
    d = t[2]
    lineno = t.lineno(1)
    sortno = t.lineno(3) + 0.5
    if d.type == 'void':
        global error_occurred
        error_occurred = True
        print(
            u"ERROR - can't use void in typedef at line {0:d}".format(lineno))
        return
    d.lineno = lineno
    if id_unique(d.id, d.type, lineno):
        if d.type == 'enum':
            info = d.create_enum(lineno, sortno)
        elif d.type == 'struct':
            info = d.create_struct(lineno, sortno)
        elif d.type == 'union':
            info = d.create_union(lineno, sortno)
        else:
            info = d
        name_dict[d.id] = info
155682
private String getClassName(final TypeMirror t) {
        String res = null;

        if (t instanceof DeclaredType) {
            final DeclaredType dt = (DeclaredType) t;
            res = ((TypeElement) dt.asElement()).getQualifiedName().toString();
            if (!dt.getTypeArguments().isEmpty()) {
                res += "<";
                boolean first = true;
                for (final TypeMirror tm : dt.getTypeArguments()) {
                    if (first) {
                        first = false;
                    } else {
                        res += ",";
                    }
                    res += getClassName(tm);
                }
                res += ">";
            }

        } else if (t instanceof PrimitiveType) {
            res = ((PrimitiveType) t).toString();
        }

        return res;
    }
1176156
def find_declaration(self):
        

        # determine the library name

        if not self.is_plt:
            binary_name = self.binary_name
            if binary_name not in SIM_LIBRARIES:
                return
        else:
            binary_name = None
            # PLT entries must have the same declaration as their jump targets
            # Try to determine which library this PLT entry will jump to
            edges = self.transition_graph.edges()
            node = next(iter(edges))[1]
            if len(edges) == 1 and (type(node) is HookNode or type(node) is SyscallNode):
                target = node.addr
                if target in self._function_manager:
                    target_func = self._function_manager[target]
                    binary_name = target_func.binary_name

        if binary_name is None:
            return

        library = SIM_LIBRARIES.get(binary_name, None)

        if library is None:
            return

        if not library.has_prototype(self.name):
            return

        proto = library.prototypes[self.name]

        self.prototype = proto
        if self.calling_convention is not None:
            self.calling_convention.args = None
            self.calling_convention.func_ty = proto
624059
def declare_type(self, declared_type):  # type: (TypeDef) -> TypeDef
        """"""
        if declared_type not in self.collected_types:
            self.collected_types[declared_type.name] = declared_type
        return declared_type
54028
function getAlternateTypes(method) {
          var types = [];

          function process(arr) {
            if (arr) {
              arr.forEach(function(obj) {
                if (obj.type) {
                  var split = obj.type.split('|');
                  if (split.length > 1) {
                    types = types.concat(split);
                  }
                }
              });
            }
          }

          process(method.params);
          process(method.options);

          return types;
        }
615917
Class<?> getGenericType(Type type) {
        if (type instanceof ParameterizedType) {
            ParameterizedType pt = (ParameterizedType) type;
            Type[] ts = pt.getActualTypeArguments();
            if (ts.length == 1) {
                return (Class<?>) ts[0];
            }
        }
        Class<?> clazz = (Class<?>) type;
        if (clazz.isArray()) {
            return clazz.getComponentType();
        }
        return Object.class;
    }
889198
public Collection<AnnotatedMethod> getMethods() {
        for (Method method : type.getDeclaredMethods()) {
            // only consider methods which have been explicitly declared in the
            // interface
            if (!method.isSynthetic()) {
                Class<?> returnType = method.getReturnType();
                Type genericReturnType = method.getGenericReturnType();
                Class<?>[] parameterTypes = method.getParameterTypes();
                Type[] genericParameterTypes = method.getGenericParameterTypes();
                if (PropertyMethod.GET.matches(method)) {
                    String name = PropertyMethod.GET.getName(method);
                    getters.put(name, method);
                    addType(type, name, returnType, genericReturnType);
                } else if (PropertyMethod.IS.matches(method)) {
                    String name = PropertyMethod.IS.getName(method);
                    getters.put(name, method);
                    addType(type, name, returnType, genericReturnType);
                } else if (PropertyMethod.SET.matches(method)) {
                    String name = PropertyMethod.SET.getName(method);
                    setters.put(name, method);
                    addType(type, name, parameterTypes[0], genericParameterTypes[0]);
                } else {
                    methods.add(method);
                }
            }
        }
        List<AnnotatedMethod> typeMethods = new ArrayList<>();
        Map<String, GetPropertyMethod> getPropertyMethods = new HashMap<>();
        for (Map.Entry<String, Method> methodEntry : getters.entrySet()) {
            String name = methodEntry.getKey();
            Method getter = methodEntry.getValue();
            Class<?> propertyType = types.get(name);
            Type genericType = genericTypes.get(name);
            GetPropertyMethod getPropertyMethod = new GetPropertyMethod(getter, name, propertyType, genericType);
            typeMethods.add(getPropertyMethod);
            getPropertyMethods.put(name, getPropertyMethod);
        }
        for (Map.Entry<String, Method> methodEntry : setters.entrySet()) {
            String name = methodEntry.getKey();
            Method setter = methodEntry.getValue();
            GetPropertyMethod getPropertyMethod = getPropertyMethods.get(name);
            Class<?> propertyType = types.get(name);
            Type genericType = genericTypes.get(name);
            SetPropertyMethod setPropertyMethod = new SetPropertyMethod(setter, getPropertyMethod, name, propertyType, genericType);
            typeMethods.add(setPropertyMethod);
        }
        for (Method method : methods) {
            typeMethods.add(new UserMethod(method));
        }
        return typeMethods;
    }
1269983
function parseDeclaraion (declaration) {
    const keyRegexp = /(?:\$)([\w-]+)(?:[\s\n\r\t])*(?::)/;
    const valueRegexp = /(?::)(?:[\s\n\r\t])*(.+)(?:[\s\n\r\t])*(?:;)/;

    const matchKey = declaration.match(keyRegexp);
    const key = matchKey[1].trim();

    const matchValue = declaration.match(valueRegexp);
    const value = matchValue[1].trim();

    return { key, value };
}
881320
private static int getTypeModifiers(TypeElement type) {
    int modifiers = ElementUtil.fromModifierSet(type.getModifiers());
    if (type.getKind().isInterface()) {
      modifiers |= java.lang.reflect.Modifier.INTERFACE | java.lang.reflect.Modifier.ABSTRACT
          | java.lang.reflect.Modifier.STATIC;
    }
    if (ElementUtil.isSynthetic(type)) {
      modifiers |= ElementUtil.ACC_SYNTHETIC;
    }
    if (ElementUtil.isAnnotationType(type)) {
      modifiers |= ElementUtil.ACC_ANNOTATION;
    }
    if (ElementUtil.isEnum(type)) {
      modifiers |= ElementUtil.ACC_ENUM;
    }
    if (ElementUtil.isAnonymous(type)) {
      modifiers |= ElementUtil.ACC_ANONYMOUS;
    }
    return modifiers;
  }
1165630
private static Method findGenericDeclaration(Method bridgeMethod) {
		// Search parent types for method that has same signature as bridge.
		Class superclass = bridgeMethod.getDeclaringClass().getSuperclass();
		while (superclass != null && !Object.class.equals(superclass)) {
			Method method = searchForMatch(superclass, bridgeMethod);
			if (method != null && !method.isBridge()) {
				return method;
			}
			superclass = superclass.getSuperclass();
		}

		// Search interfaces.
		Class[] interfaces = ClassUtils.getAllInterfacesForClass(bridgeMethod.getDeclaringClass());
		for (Class ifc : interfaces) {
			Method method = searchForMatch(ifc, bridgeMethod);
			if (method != null && !method.isBridge()) {
				return method;
			}
		}

		return null;
	}
320321
private String genericTypeAsString(GenericsType genericsType, boolean showRedirect) {
        String ret = genericsType.getName();
        if (genericsType.getUpperBounds() != null) {
            ret += " extends ";
            for (int i = 0; i < genericsType.getUpperBounds().length; i++) {
                ClassNode classNode = genericsType.getUpperBounds()[i];
                if (classNode.equals(this)) {
                    ret += classNode.getName();
                } else {
                    ret += classNode.toString(showRedirect);
                }
                if (i + 1 < genericsType.getUpperBounds().length) ret += " & ";
            }
        } else if (genericsType.getLowerBound() !=null) {
            ClassNode classNode = genericsType.getLowerBound();
            if (classNode.equals(this)) {
                ret += " super " + classNode.getName();
            } else {
                ret += " super " + classNode;
            }
        }
        return ret;
    }
1197896
private static boolean isResolvedTypeMatch(
			Method genericMethod, Method candidateMethod, Class<?> declaringClass) {
		Type[] genericParameters = genericMethod.getGenericParameterTypes();
		Class<?>[] candidateParameters = candidateMethod.getParameterTypes();
		if (genericParameters.length != candidateParameters.length) {
			return false;
		}
		for (int i = 0; i < candidateParameters.length; i++) {
			ResolvableType genericParameter = ResolvableType.forMethodParameter(genericMethod, i, declaringClass);
			Class<?> candidateParameter = candidateParameters[i];
			if (candidateParameter.isArray()) {
				// An array type: compare the component type.
				if (!candidateParameter.getComponentType().equals(genericParameter.getComponentType().resolve(Object.class))) {
					return false;
				}
			}
			// A non-array type: compare the type itself.
			if (!candidateParameter.equals(genericParameter.resolve(Object.class))) {
				return false;
			}
		}
		return true;
	}
898675
function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {
            if (declaration.flags & 134217728 /* JavaScriptFile */) {
                // If this is a variable in a JavaScript file, then use the JSDoc type (if it has
                // one as its type), otherwise fallback to the below standard TS codepaths to
                // try to figure it out.
                var type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration);
                if (type && type !== unknownType) {
                    return type;
                }
            }
            // A variable declared in a for..in statement is always of type string
            if (declaration.parent.parent.kind === 207 /* ForInStatement */) {
                return stringType;
            }
            if (declaration.parent.parent.kind === 208 /* ForOfStatement */) {
                // checkRightHandSideOfForOf will return undefined if the for-of expression type was
                // missing properties/signatures required to get its iteratedType (like
                // [Symbol.iterator] or next). This may be because we accessed properties from anyType,
                // or it may have led to an error inside getElementTypeOfIterable.
                return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType;
            }
            if (ts.isBindingPattern(declaration.parent)) {
                return getTypeForBindingElement(declaration);
            }
            // Use type from type annotation if one is present
            if (declaration.type) {
                return addOptionality(getTypeFromTypeNode(declaration.type), /*optional*/ declaration.questionToken && includeOptionality);
            }
            if (declaration.kind === 142 /* Parameter */) {
                var func = declaration.parent;
                // For a parameter of a set accessor, use the type of the get accessor if one is present
                if (func.kind === 150 /* SetAccessor */ && !ts.hasDynamicName(func)) {
                    var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 149 /* GetAccessor */);
                    if (getter) {
                        var getterSignature = getSignatureFromDeclaration(getter);
                        var thisParameter = getAccessorThisParameter(func);
                        if (thisParameter && declaration === thisParameter) {
                            // Use the type from the *getter*
                            ts.Debug.assert(!thisParameter.type);
                            return getTypeOfSymbol(getterSignature.thisParameter);
                        }
                        return getReturnTypeOfSignature(getterSignature);
                    }
                }
                // Use contextual parameter type if one is available
                var type = void 0;
                if (declaration.symbol.name === "this") {
                    var thisParameter = getContextualThisParameter(func);
                    type = thisParameter ? getTypeOfSymbol(thisParameter) : undefined;
                }
                else {
                    type = getContextuallyTypedParameterType(declaration);
                }
                if (type) {
                    return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality);
                }
            }
            // Use the type of the initializer expression if one is present
            if (declaration.initializer) {
                return addOptionality(checkExpressionCached(declaration.initializer), /*optional*/ declaration.questionToken && includeOptionality);
            }
            // If it is a short-hand property assignment, use the type of the identifier
            if (declaration.kind === 254 /* ShorthandPropertyAssignment */) {
                return checkIdentifier(declaration.name);
            }
            // If the declaration specifies a binding pattern, use the type implied by the binding pattern
            if (ts.isBindingPattern(declaration.name)) {
                return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ false, /*reportErrors*/ true);
            }
            // No type specified and nothing can be inferred
            return undefined;
        }