1/98
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Syntax
What the language constructs look like
Semantics
What the language constructs actually do; expected behavior
Language Reference Manual
Common way to specify semantics using natural language, often imprecise
Translator Definition
Specifies semantics by implementing a compiler or interpreter
Formal Definition
Uses mathematical methods to precisely define semantics
Denotational Semantics
Formal method describing program behavior using functions
Name (Identifier)
Symbolic label for a language entity or construct
Value
Storable quantity associated with a name
Location
Memory address where a value is stored
Attribute
Property that determines the meaning of a name (e.g., type, value)
Binding
Process of associating an attribute with a name
Binding Time
Moment when a binding occurs
Static Binding
Binding that occurs before execution
Dynamic Binding
Binding that occurs during execution
Static Attribute
Attribute bound statically
Dynamic Attribute
Attribute bound dynamically
Predefined Identifier
Name defined by the language itself (e.g., true, false)
Symbol Table
Data structure mapping names to attributes
Lexical Analysis
Determines if a character string is a valid token
Syntax Analysis
Checks if a sequence of tokens forms a valid phrase
Static Semantic Analysis
Ensures names conform to their declared attributes
Declaration
Statement that introduces a name and binds attributes
Definition
Declaration that binds all potential attributes
Prototype
Function declaration specifying type but not implementation
Block
Sequence of declarations followed by statements
Compound Statement
Block used as a single statement (e.g., in C)
Local Declaration
Declaration within a block
Nonlocal Declaration
Declaration from an enclosing block
Lexical Address
Pair of level number and offset identifying a name
Scope
Region of a program where a binding is valid
Lexical Scope
Scope determined by block structure
Declaration-Before-Use Rule
In C, a name's scope starts at its declaration
Scope Hole
Region where a global name is shadowed by a local one
Shadowing
Local declaration hides a nonlocal one
Visibility
Region where a name's binding is accessible
Insertion
Adding a name and its attributes to the symbol table
Lookup
Retrieving attributes for a name from the symbol table
Deletion
Removing a name's binding from the symbol table
Static Scoping
Bindings determined at compile time
Dynamic Scoping
Bindings determined at runtime
Overloading
Using the same name for multiple functions or operators
Overload Resolution
Choosing the correct function based on context
Calling Context
Information used to resolve overloaded functions
Operator Overloading
Defining multiple meanings for built-in operators
Function Overloading
Defining multiple functions with the same name but different parameters
Environment
Maps names to locations
Static Allocation
Memory assigned at load time
Dynamic Allocation
Memory assigned during execution
Activation
A function call
Activation Record
Memory allocated for a function call
Lifetime (Extent)
Duration an object exists in memory
Pointer
Variable storing the address of another object
Heap
Memory area for dynamic allocation
Storage Class
Type of allocation (static, automatic, dynamic)
Variable
Object whose value can change during execution
Assignment Statement
Updates a variable's value
L-Value
Refers to a variable's location
R-Value
Refers to a variable's value
Assignment by Sharing
Copies location, not value
Assignment by Cloning
Copies value into a new location
Value Semantics
Standard assignment behavior
Reference Semantics
Assignment using shared locations (pointers)
Constant
Entity with a fixed value
Literal
Direct representation of a value (e.g., 42, 'a')
Manifest Constant
Named literal
Compile-Time Constant
Value known at compile time
Static Constant
Value known at load time
Dynamic Constant
Value computed during execution
Alias
Two names bound to the same object
Side Effect
Change in state that persists beyond a statement
Dangling Reference
Pointer to a deallocated object
Garbage
Allocated memory that is no longer accessible
Garbage Collection
Automatic reclamation of unused memory
Struct
User-defined type containing fields with their own declarations
Struct Symbol Table
Local symbol table embedded in a struct
Scope Resolution Operator (
:): Used in C++ to access global variables shadowed by locals
Named Scope
A scoping unit with its own symbol table (e.g., Ada packages, C++ namespaces)
Symbol Table Stack
Layered structure of symbol tables for nested scopes
Search Path
Order in which symbol tables are searched for a name
Overloaded Name
Same name used for different constructs (e.g., type, function, variable)
Automatic Conversion
Implicit type conversion during overload resolution
Semantic Difference
Difference in meaning; operators and functions have none, only syntactic difference
Struct Field Access
Using dot notation to access fields within a struct
Struct Deletion
Struct's symbol table deleted only when the struct itself is deleted
Recursive Declaration
Declaration that refers to itself (e.g., recursive functions)
Scope of Function Name
Must begin before the function body to allow recursion
Dynamic Scope Output
Output affected by runtime bindings
Lexical Scope Output
Output determined by static bindings
Symbol Table Complexity
Increases with dynamic scoping and nested structures
Interpreter Environment
Runtime structure for managing dynamic bindings
Class/Package/Module
Scoping units in object-oriented and modular languages
Ada Scope
Named block with its own symbol table
Java Overloading
Allows same name for type, function, and variable
C++ Operator Overloading
Allows built-in operators to be overloaded with fixed syntax rules
Function Call Ambiguity
Occurs when multiple overloads could match a call
Return Type Resolution
Used in Ada but ignored in C++ and Java
Dot Member Notation
Syntax for accessing struct fields
Execution Path
Determines bindings in dynamic scoping
Symbol Table Search
Begins in current scope and continues outward until name is found