# loki.types.datatypes module

Collection of classes to represent type information for symbols used throughout Loki’s internal representation (IR)

class DataType

  Bases: `object`

  Base class for data types a symbol may have

class BasicType(*values)

  Bases: `DataType`, `int`, `Enum`

  Representation of intrinsic data types, names taken from the FORTRAN convention.

  Currently, there are

  - `LOGICAL`

  - `INTEGER`

  - `REAL`

  - `CHARACTER`

  - `COMPLEX`

  and, to indicate an undefined data type (e.g., for imported symbols whose definition is not available), `DEFERRED`.

  For convenience, string representations of FORTRAN and C99 types can be heuristically converted.

  DEFERRED = 0
  LOGICAL = 1
  INTEGER = 2
  REAL = 3
  CHARACTER = 4
  COMPLEX = 5
  classmethod from_str(value)

    Try to convert the given string using one of the from_* methods.

  classmethod from_name(value)

    Convert the given string representation of the `BasicType`.

  classmethod from_fortran_type(value)

    Convert the given string representation of a FORTRAN type.

  classmethod from_c99_type(value)

    Convert the given string representation of a C99 type.