Contents Introduction Names Variables The Concept of Binding Type Checking Strong Typing Type Equivalence Scope Scope and Lifetime Referencing Environments Named Constants Introduction



Download 396.24 Kb.
Page2/16
Date18.02.2022
Size396.24 Kb.
#58269
1   2   3   4   5   6   7   8   9   ...   16
13516098

Address

Address


Name
  • Attributes:

Address

Type

Lifetime

Value

Scope

Type

Type

  • Meaning: determines the range of values of variables and the set of operations that are defined for values of that type.
  • Example: integer type in Java
        • Range of values :-2,147,483,648 .. 2,147,483,647
        • Set of Operations: +, -, *, Mod, Div

Name
  • Attributes:

Address

Type

Lifetime

Value

Scope

int n;


703

704

705

706

707

708

n

Value

Value

  • Meaning: the contents of the location with which the variable is associated.

Name
  • Attributes:

Address

Type

Lifetime

Value

Scope

Meaning: A binding is the association of data/code with an identifier


The Concept of Binding
  • Language design time : bind operator symbols to operations

  • (ex. * is bound to multiplication)
  • Language implementation time: bind floating point type to a representation

  • (in java float represents as 4 bytes according to IEEE-754
  • Compile time: bind a variable to a type in C or Java

  • (ex. int n  n is bound integer type at compilation )

    4. Load time: bind a C or C++ static variable to a memory cell)

    (i.e. allocate in memory)



    5. Runtime: bind a non-static local variable to a memory cell.

    (ex. object in Java; a value is bound to variable at runtime)



Time of Binding
  • Binding time is the time at which a binding takes place.
  • Meaning: A binding is the association of data/code with an identifier

  • Download 396.24 Kb.

    Share with your friends:
1   2   3   4   5   6   7   8   9   ...   16




The database is protected by copyright ©ininet.org 2024
send message

    Main page