-
Language design time
- program structure, primitive data
- types
-
Language implementation time
- - I/O, arithmetic overflow,
- type equality (if unspecified in manual)
-
Program writing time
- things chosen by the programmer –
- algorithms, identifier names, data structures
-
Compile time –
- mapping of program instructions to
- machine/target code, layout of static data in memory
-
Link time
- time at which separately compiled components
- are bound together. Linker determines how these separate
- units are organized in executable entity. Java
- documentation defines: “Linking is the process of taking a
- class or interface and combining it into the run-time state
- of the Java Virtual Machine so that it can be executed. “
-
Load time
- he time at which the executable entity is
- loaded into memory – relative addresses associated with
- actual addresses. Java documentation defines: “Loading is
- the process of finding the binary representation of a class
- or interface type with a particular name and creating a
- class or interface from that binary representation.”
-
Run time
- from beginning to end of execution; values
- bound to variables, types to variables in languages with late
- binding
-
Data type
- – defines a collection of data values and a set of predefined operations on those values.
- Types may be intrinsic to a language (like the Java primitives) or defined by the user (by combining
- primitives and other user-defined types into more complex structured types). Some languages allow
- programmers to define new simple types (like enumerated types).
-
Type checking
- process of verifying that type information in a program is used consistently; that is
- determines if variables of specified types are used in ways that are correct for that type.
-
Type system
- set of rules that enforce data types. Many topics previously covered are related to
- type systems: lexical versus dynamic typing, strong versus weak typing, static versus dynamic type
- checking, etc etc etc
-
A type system
- a mechanism to define types and associate them with language constructs, and
- • a set of rules for type equivalence, type compatibility and type inference
-
Type equivalence -
- rules that specify when two types are the same.
- • Since new types can be defined in many languages, the language must provide rules as to
- when types are the same.
-
Type compatibility
- rules that specify when a value of a given type can be used in a given context.
- • Weaker than equivalence. Can a type be used with another, even if they are not equivalent?
-
Type inference –
- rules for determining the type of an arbitrarily complex expression.
- • What is the type of the expression on the rhs of x = a * b + c;
-
structural equivalence
- – two types with the same structure are equivalent (even if they have
- different type names or no type names)
-
name equivalence-
distinctly named types are always different (Java uses this - simple)
-
Finite State automata
Regular
-
Push down automata
Context free
-
Linear-bounded automata
Context-sensitive
-
Turing Machines
Phrase Structure
|
|