ALC Final Exam
Static - Answer-Variable type is checked at compile time
Dynamic - Answer-Variable type is checked at runtime
Language evaluation criteria: Readability - Answer-The ease with which programs can be read and
understood
Language evaluation criteria: Writability - Answer-The ease with which a language can be used to create
programs
Language evaluation criteria: Reliability - Answer-Conformance to specifications (i.e., performs to its
specifications)
Language evaluation criteria: Cost - Answer-The ultimate total cost
Phases of a compiler: Step 1 - Answer-Lexical analysis: converts characters in the source program into
lexical units
Phases of a compiler: Step 2 - Answer-Syntax analysis: transforms lexical units into parse trees which
represent the syntactic structure of program
Phases of a compiler: Step 3 - Answer-Semantics analysis: further checks that are too difficult for syntax
(declare before use, type checking, parameter matching).
ALSO IN STEP 3: intermediate code generator
, Phases of a compiler: Step 4 - Answer-Code generation: machine code is generated
Mark-and-sweep - Answer-Garbage collection algorithm consisting of a mark phase and a sweep phase.
Mark phase: when an object is created, its mark bit is set to false. In the mark phase, the mark bit of all
reachable objects is set to true.
Sweep phase: all objects whose marked value is false are cleared from memory.
Reference counting - Answer-Garbage collection algorithm. Each object has a count of the number of
references to it. If an object has 0 references to it, it is identified as garbage and cleared from memory.
Semaphore - Answer-A data structure consisting of a counter and a queue for storing task descriptors.
Used to implement safeguards on the code that accesses shared data values and provides
synchronization between processes. Has a "wait" phase and a "release" phase.
Abstraction - Answer-A view or representation of an entity that includes only the most significant
attributes
Abstract data type - Answer-A user-defined data type in which the representation of objects is hidden
https://www.youtube.com/watch?v=XkoeF-xXo2o
Binding - Answer-An association between an entity and an attribute, such as between a variable and its
type or value, or between an operation and a symbol
Binding time - Answer-The time at which a binding takes place
Static binding - Answer-A binding is static if it first occurs before runtime and remains unchanged
throughout program execution
Static - Answer-Variable type is checked at compile time
Dynamic - Answer-Variable type is checked at runtime
Language evaluation criteria: Readability - Answer-The ease with which programs can be read and
understood
Language evaluation criteria: Writability - Answer-The ease with which a language can be used to create
programs
Language evaluation criteria: Reliability - Answer-Conformance to specifications (i.e., performs to its
specifications)
Language evaluation criteria: Cost - Answer-The ultimate total cost
Phases of a compiler: Step 1 - Answer-Lexical analysis: converts characters in the source program into
lexical units
Phases of a compiler: Step 2 - Answer-Syntax analysis: transforms lexical units into parse trees which
represent the syntactic structure of program
Phases of a compiler: Step 3 - Answer-Semantics analysis: further checks that are too difficult for syntax
(declare before use, type checking, parameter matching).
ALSO IN STEP 3: intermediate code generator
, Phases of a compiler: Step 4 - Answer-Code generation: machine code is generated
Mark-and-sweep - Answer-Garbage collection algorithm consisting of a mark phase and a sweep phase.
Mark phase: when an object is created, its mark bit is set to false. In the mark phase, the mark bit of all
reachable objects is set to true.
Sweep phase: all objects whose marked value is false are cleared from memory.
Reference counting - Answer-Garbage collection algorithm. Each object has a count of the number of
references to it. If an object has 0 references to it, it is identified as garbage and cleared from memory.
Semaphore - Answer-A data structure consisting of a counter and a queue for storing task descriptors.
Used to implement safeguards on the code that accesses shared data values and provides
synchronization between processes. Has a "wait" phase and a "release" phase.
Abstraction - Answer-A view or representation of an entity that includes only the most significant
attributes
Abstract data type - Answer-A user-defined data type in which the representation of objects is hidden
https://www.youtube.com/watch?v=XkoeF-xXo2o
Binding - Answer-An association between an entity and an attribute, such as between a variable and its
type or value, or between an operation and a symbol
Binding time - Answer-The time at which a binding takes place
Static binding - Answer-A binding is static if it first occurs before runtime and remains unchanged
throughout program execution