What is Elementary Data Types?

Compiler DesignProgramming LanguagesComputer Programming

An elementary data object includes a single data value and a class of elementary data objects with a set of operations for creating and manipulating them is represented as an elementary data type. An example of elementary data types such as integer, real, character, Boolean, pointer, etc.

The basic components of elementary data types are as follows −

  • Attributes − Attributes refers to characteristics or group of characteristics that distinguish one data object from others. The main attributes of a data object are its name, associated address, and data type. The following declaration in C.

int a;

It specifies that a data object named ‘a’ is of type integer. The attributes of a data object can be stored in a collection of memory cells, called descriptor (or dope vector). A descriptor is the group of attributes of a variable. If the attributes are all fixed, descriptors are needed only at compile time. They are developed by the compiler, generally as a part of the symbol table, and are used during compilation.

  • Values − It refers to a set of all possible values that a data object can contain. The values that a data object can assume are determined by the type of that data object. An elementary data object contains a single value from the set of values at any point during its lifetime. For example, the C declaration int a; specifies that the data object a can assume a single integer value from a set of integer values. The value included in a data object can change during the lifetime of the data object and is therefore represented explicitly during the program execution.

  • Operations − An operation refers to a mathematical function for the manipulation of data objects. An operation includes −

    • Domain − It refers to a set of all possible input arguments on which the operation is defined.

    • Range − It refers to a set of all possible results that an operation can produce as an output.

    • Action − The action of the operation represents the result created for any given set of arguments.

    • Algorithm − It defines how to evaluate the results for any given set of arguments. It is used for determining the action of an operation.

    • Signature − A signature of an operator defines the number, order, and data types of the arguments in the domain of an operation and the order and data type of the producing order.

Published on 22-Oct-2021 11:45:36