Explore tens of thousands of sets crafted by our community.
Compiler Basics
30
Flashcards
0/30
Lexical Analysis
The first phase of a compiler where the source code is converted into tokens.
Syntax Analysis
The phase where tokens are organized into a parse tree which represents the grammatical structure of program code.
Semantic Analysis
The compiler phase that checks for semantic errors, ensures type compatibility, and collects type information.
Intermediate Code Generation
After semantic analysis, the compiler generates a low-level or intermediate representation of the source code.
Code Optimization
The process of improving intermediate code so it runs faster and consumes fewer resources.
Code Generation
The process of converting intermediate code into target machine code.
Tokens
The smallest individual units in a program, created in the lexical analysis phase, such as keywords, identifiers, and operators.
Parse Tree
A hierarchical structure that represents the syntax of the source code as derived from a grammar.
Abstract Syntax Tree (AST)
A tree representation of the abstract syntactic structure of source code written in a programming language.
Symbol Table
Data structure used by a compiler to keep track of information about language constructs like variables, functions, classes, etc.
Backpatching
A method used in compilers to manage jumps to forward locations or unresolved addresses in the code.
Three-Address Code
An intermediate code form used by compilers where each instruction contains at most three operands.
Quadruples
An intermediate code representation that expresses operations in a structured four-part format.
Peephole Optimization
A code optimization technique that examines and improves small parts of machine code or intermediate code.
Data Flow Analysis
A technique used for gathering information about the possible set of values calculated at various points in a computer program.
Control Flow Graph (CFG)
A representation, used in program analysis, that depicts all paths that might be traversed through a program during its execution.
Basic Block
A straight-line code sequence with no branches in except to the entry and no branches out except at the exit.
Dead Code Elimination
An optimization that removes code which does not affect the program results (such as instructions following an unconditional jump).
Loop Optimization
The process of increasing the execution speed and efficiency of loops in a program.
Constant Folding
The process of recognizing and evaluating constant expressions at compile time rather than computing them at runtime.
Constant Propagation
The process of substituting the values of known constants in expressions at compile time.
Type Casting
Converting a variable from one data type to another, for example, an integer to a float.
Just-In-Time Compilation (JIT)
A compilation approach where code is compiled during execution (runtime) rather than beforehand.
Inlining
An optimization technique that involves replacing a function call with the body of the called function.
Register Allocation
The process of assigning a large number of target program variables onto a small number of CPU registers.
Garbage Collection
The automatic process of memory deallocation for objects that are no longer accessible by a program.
Static Single Assignment (SSA)
A property of an intermediate representation (IR), which requires each variable to be assigned exactly once and defined before use.
Escape Analysis
A method of determining if a pointer or a reference to a resource can be accessed beyond the scope it was created in.
Interprocedural Optimization
Optimizations that analyze multiple functions or methods together, which can span multiple files or modules.
Tail Call Optimization
A technique that allows for some kinds of function calls to be replaced by a single jump instruction, reducing the overhead of recursion.
© Hypatia.Tech. 2024 All rights reserved.