1/53
A set of 54 vocabulary flashcards summarizing key terms and definitions from the lecture on language semantics, scoping, memory, and assignment principles.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Lexical Analysis
The compiler phase that converts raw bytes or characters into a stream of tokens.
Syntax Analysis
The phase that checks sequences of tokens for grammatical correctness and builds a parse tree.
Semantics
The meaning assigned to a parse tree; describes what a program actually does.
Preciseness
A desired property of a semantic definition ensuring it is exact and unambiguous.
Predictability
A property of semantics that guarantees consistent behavior across different executions and implementations.
Completeness
A semantic description covering every construct of a language with no gaps.
English Specification
A natural-language description of language rules, e.g., the 538-page C99 spec; readable but potentially ambiguous.
Reference Implementation
An authoritative interpreter or compiler whose behavior defines the language (e.g., pre-2011 Ruby MRI).
Formal Specification
A mathematically precise description of language semantics enabling proofs about programs.
C99 Specification
The extensive English document defining the C language as standardized in 1999.
Ruby MRI
Matz’s Ruby Interpreter, historically used as Ruby’s reference semantics before an official spec.
Abstract Semantics Transition Relation (F*)
A formal relation expressing how abstract program states transition during execution.
Declaration
A language construct that introduces a name and its attributes (type, storage class, etc.).
Implicit Declaration
Introduction of a construct without an explicit declaration statement (e.g., using a variable first in some languages).
Scope
The region of code where a declaration remains valid and can be referenced.
Static Scoping
Name resolution determined at compile time based on the program’s lexical structure.
Dynamic Scoping
Name resolution performed at run time using the call stack to find the most recent binding.
Block-level Scoping
A scoping rule where declarations are visible only within the enclosing { } block (e.g., C).
Function-level Scoping
A scoping rule where declarations are visible throughout the entire function body (e.g., JavaScript var).
Symbol Table
A data structure mapping names to declarations and attributes during compilation or execution.
Name Resolution
The process of linking a name occurrence to its corresponding declaration using scoping rules.
Function Signature
The set of elements used to disambiguate overloaded functions (name, parameter count/type, etc.).
Overloading
Defining multiple functions with the same name but different signatures (common in C++).
L-value
An expression that refers to a location and can appear on the left side of an assignment.
R-value
An expression that denotes a value; may not necessarily have an associated writable location.
Binding
The association between a name and a location (or sometimes a value).
Location
A storage cell capable of holding a value; identified by an address.
Value
An actual data element stored in or retrieved from a location.
Assignment Semantics
Rules that define how values are transferred between locations via the ‘=’ operator.
Address Operator (&)
Unary operator that produces the address of an l-value, yielding a pointer (T*).
Dereference Operator (*)
Unary operator that accesses or modifies the value at a given pointer address.
Pointer
A variable whose value is an address pointing to another location in memory.
Alias (Programming)
Two or more l-values referring to the same location, so updating one affects the others.
Dangling Reference
A reference that still points to a location after that location has been deallocated.
Garbage (Memory)
Heap-allocated memory that is unreachable by the program yet not freed.
Global Allocation
Memory reserved for the entire program duration, typically for global/static variables.
Stack Allocation
Automatic memory allocation tied to function calls and scopes, freed when out of scope.
Heap Allocation
Program-requested memory (e.g., malloc, new) that persists until explicitly deallocated.
Memory Deallocation
The act of releasing previously reserved heap memory so it may be reused.
Dangling Pointer after free
A pointer left pointing to freed heap memory, leading to undefined behavior if dereferenced.
Copy Semantics
Assignment behavior where the value from one location is copied into another.
Sharing Semantics
Assignment behavior where two names are made to share the same location.
malloc
A C standard library function that allocates a specified number of bytes on the heap and returns a pointer.
free
A C function that deallocates heap memory previously obtained via malloc, realloc, or calloc.
Enumeration Constant
A named integer value defined within an enum declaration in C/C++.
Macro
A preprocessor construct in C that performs textual substitution before compilation.
Tag (C Struct/Union/Enum)
The identifier that names a struct, union, or enum type in C.
Type (Programming)
A classification identifying a set of values and permissible operations (e.g., int, char*, Object).
Control Structure
A language construct that alters the flow of execution (if, while, for, etc.).
Exception
A run-time event signaling abnormal conditions, often handled with try-catch constructs.
Constant
A value that does not change during execution, often declared with const or literal notation.
Variable
A named storage location whose value may change during execution.
Operator
A symbol or keyword that performs an operation on operands (e.g., +, =, &).
Class
A blueprint for creating objects, encapsulating data and behavior in object-oriented languages.