Return the underlying type of a typedef declaration.

        Returns a Type for the typedef this cursor is a declaration for. If
        the current cursor is not a typedef, this raises.
12606
def underlying_typedef_type(self):
        
        if not hasattr(self, '_underlying_type'):
            assert self.kind.is_declaration()
            self._underlying_type = \
              conf.lib.clang_getTypedefDeclUnderlyingType(self)

        return self._underlying_type
1244670
def type(self):
        """"""
        if self.xc in self.defined_aliases: return self.defined_aliases[self.xc].type
        xc = (self.x, self.c)
        if xc in self.defined_aliases: return self.defined_aliases[xc].type

        # If self is not in defined_aliases, use LibxcFunc family
        if self.xc is not None: return self.xc.family
        return "+".join([self.x.family, self.c.family])
1293694
public String getCorefType() {
    if (Coref_Type.featOkTst && ((Coref_Type)jcasType).casFeat_corefType == null)
      jcasType.jcas.throwFeatMissing("corefType", "de.julielab.jules.types.muc7.Coref");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Coref_Type)jcasType).casFeatCode_corefType);}
227959
def element_type(self):
        
        result = conf.lib.clang_getElementType(self)
        if result.kind == TypeKind.INVALID:
            raise Exception('Element type not available on this type.')

        return result
445053
def type(self, type):
        # pylint: disable=redefined-builtin
        """"""

        type = _ensure_unicode(type)

        # We perform this check after the initialization to avoid errors
        # in test tools that show the object with repr().
        if type not in ALL_CIMTYPES:
            raise ValueError(
                _format("Invalid CIM type: {0}", type))

        # pylint: disable=attribute-defined-outside-init
        self._type = type
904070
public static Type getType(final Class c) {
        if (c.isPrimitive()) {
            if (c == Integer.TYPE) {
                return INT_TYPE;
            } else if (c == Void.TYPE) {
                return VOID_TYPE;
            } else if (c == Boolean.TYPE) {
                return BOOLEAN_TYPE;
            } else if (c == Byte.TYPE) {
                return BYTE_TYPE;
            } else if (c == Character.TYPE) {
                return CHAR_TYPE;
            } else if (c == Short.TYPE) {
                return SHORT_TYPE;
            } else if (c == Double.TYPE) {
                return DOUBLE_TYPE;
            } else if (c == Float.TYPE) {
                return FLOAT_TYPE;
            } else /* if (c == Long.TYPE) */{
                return LONG_TYPE;
            }
        } else {
            return getType(getDescriptor(c));
        }
    }
68422
public short getType() {
	if (type == UNDEFINED) {
	    type = CFTypes.toShort(strType, false, CFTypes.TYPE_UNKNOW);
	}
	return type;
    }
1318698
def VAR_DECL(self, cursor):
        """"""
        # get the name
        name = self.get_unique_name(cursor)
        log.debug('VAR_DECL: name: %s', name)
        # Check for a previous declaration in the register
        if self.is_registered(name):
            return self.get_registered(name)
        # get the typedesc object
        _type = self._VAR_DECL_type(cursor)
        # transform the ctypes values into ctypeslib
        init_value = self._VAR_DECL_value(cursor, _type)
        # finished
        log.debug('VAR_DECL: _type:%s', _type.name)
        log.debug('VAR_DECL: _init:%s', init_value)
        log.debug('VAR_DECL: location:%s', getattr(cursor, 'location'))
        obj = self.register(name, typedesc.Variable(name, _type, init_value))
        self.set_location(obj, cursor)
        self.set_comment(obj, cursor)
        return True
1000297
private Scope findScopeForType(TypeElement type) {
    Scope scope = peekScope();
    while (scope != null) {
      if (scope.kind != ScopeKind.METHOD && type.equals(scope.type)) {
        return scope;
      }
      scope = scope.outer;
    }
    return null;
  }
195752
def _handle_fundamental_types(self, typ):
        
        ctypesname = self.get_ctypes_name(typ.kind)
        if typ.kind == TypeKind.VOID:
            size = align = 1
        else:
            size = typ.get_size()
            align = typ.get_align()
        return typedesc.FundamentalType(ctypesname, size, align)
405483
def __remove_alias(type_):
    
    if isinstance(type_, cpptypes.declarated_t) and \
            isinstance(type_.declaration, typedef.typedef_t):
        return __remove_alias(type_.declaration.decl_type)
    if isinstance(type_, cpptypes.compound_t):
        type_.base = __remove_alias(type_.base)
        return type_
    return type_
641936
def p_typedef(self, p):
        ''''''
        p[0] = ast.Typedef(
            name=p[3], target_type=p[2], annotations=p[4], lineno=p.lineno(3)
        )
234198
def extern_get_type_for(self, context_handle, val):
    """"""
    c = self._ffi.from_handle(context_handle)
    obj = self._ffi.from_handle(val[0])
    type_id = c.to_id(type(obj))
    return TypeId(type_id)
462384
def is_anonymous(self):
        
        if self.kind == CursorKind.FIELD_DECL:
            return self.type.get_declaration().is_anonymous()
        return conf.lib.clang_Cursor_isAnonymous(self)
1162390
def _VAR_DECL_type(self, cursor):
        """"""
        # Get the type
        _ctype = cursor.type.get_canonical()
        log.debug('VAR_DECL: _ctype: %s ', _ctype.kind)
        # FIXME: Need working int128, long_double, etc.
        if self.is_fundamental_type(_ctype):
            ctypesname = self.get_ctypes_name(_ctype.kind)
            _type = typedesc.FundamentalType(ctypesname, 0, 0)
        elif self.is_unexposed_type(_ctype):
            st = 'PATCH NEEDED: %s type is not exposed by clang' % (
                self.get_unique_name(cursor))
            log.error(st)
            raise RuntimeError(st)
        elif self.is_array_type(_ctype) or _ctype.kind == TypeKind.RECORD:
            _type = self.parse_cursor_type(_ctype)
        elif self.is_pointer_type(_ctype):
            # for example, extern Function pointer
            if self.is_unexposed_type(_ctype.get_pointee()):
                _type = self.parse_cursor_type(
                    _ctype.get_canonical().get_pointee())
            elif _ctype.get_pointee().kind == TypeKind.FUNCTIONPROTO:
                # Function pointers
                # Arguments are handled in here
                _type = self.parse_cursor_type(_ctype.get_pointee())
            else:  # Pointer to Fundamental types, structs....
                _type = self.parse_cursor_type(_ctype)
        else:
            # What else ?
            raise NotImplementedError(
                'What other type of variable? %s' %
                (_ctype.kind))
        log.debug('VAR_DECL: _type: %s ', _type)
        return _type
293077
def _get_ctypes_name(self, index=None):
        
        if index is None:
            if ("allocatable" not in self.modifiers and "pointer" not in self.modifiers
                and self.dtype != "logical"):
                #The fortan logical has type 4 by default, whereas c_bool only has 1
                return self.name
            else:
                return "{}_c".format(self.name)
        else:
            return "{0}_{1:d}_c".format(self.name, index)
396855
def PARM_DECL(self, cursor):
        """"""
        # try and get the type. If unexposed, The canonical type will work.
        _type = cursor.type
        _name = cursor.spelling
        if (self.is_array_type(_type) or
                self.is_fundamental_type(_type) or
                self.is_pointer_type(_type) or
                self.is_unexposed_type(_type)):
            _argtype = self.parse_cursor_type(_type)
        else:  # FIXME: Which UT/case ? size_t in stdio.h for example.
            _argtype_decl = _type.get_declaration()
            _argtype_name = self.get_unique_name(_argtype_decl)
            if not self.is_registered(_argtype_name):
                log.info('This param type is not declared: %s', _argtype_name)
                _argtype = self.parse_cursor_type(_type)
            else:
                _argtype = self.get_registered(_argtype_name)
        obj = typedesc.Argument(_name, _argtype)
        self.set_location(obj, cursor)
        self.set_comment(obj, cursor)
        return obj