LATEST UPDATE (ALREADY GRADED A+)
Lexical analysis or tokenization
In the compilation pipeline, this is used for grouping characters into tokens
Characters in source program are converter into lexical units
During the lexical analysis stage, what is converted to what?
Parising
Syntax analysis is also known as
Sequences from lexical analysis are grouped into phrases
During syntax analysis, what is grouped into what?
Syntactic structure
Parse trees represent the
-O1, O2, -O3
Which gcc compiler optimization flag optimizes the generated code for both size and speed?
-O0
Gcc compiler for optimization for compilation time (default)
-O1 or -O
Gcc compiler for optimization for code size and execution time
-O2
Gcc compiler more for optimization for code size and execution time
-O3
Gcc compiler more for optimization for code size and execution time
-Os
Gcc compiler optimization for code size
-Ofast
Gcc compiler with fast none accurate math calculations
Strength reduction
, An optimization by which a compiler replaces expensive operations with less expensive ones that
produce a functionally equivalent result.
Division instructions
Example of expensive reduction
int i=0;
while (i < 10) {
int j= 3*i+2;
a[j] = a[j] -2;
i = i +2;
}
Loop Strength Reduction
Example of less expensive strength reduction (optimized)
int i=0;
int j=2;
while (i < 10)
{
a[j] = a[j] - 2;
i= i+2;
j=j+6;
faster
A compiled program is _________ to run than an interpreted program, but it takes more time to
compile and run a program than to just interpret it.
assembler
The _____________ translates a .s file into a relocatable object file .o
fundamentally
Compiler produces programs faster ______
once
Assembler analyzes each statement ____
each time
Interpreter analyzes each statement ____
interpreter
Related to compiler, takes both source program and input data
0*1