CSCE 3600 FINAL QUESTIONS AND ANSWERS
Optimization of a program that works within a single basic block of code is called
_________________
a. local transformation / optimization
b. global transformation / optimization
c. loop un-controlling
d. loop controlling - Answers - a. local transformation / optimization
Any macros specified in source code are expanded by the _____________
a. preprocessor
b. assembler
c. compiler
d. linker - Answers - a. preprocessor
Macro without arguments is treated like a _____________ _______________ -
Answers - symbolic constant
What is the process of searching for match tokens described using?
a. Context-free grammar
b. Finite automata
c. Regular expressions
d. Both B and C - Answers - d. Both B and C
These operations are performed in parsing phase of compilation.
a. Obtaining tokens from lexical analysis
b. Group tokens into statements
c. Construct parse trees
d. All the above - Answers - d. All the above
The primary job of the linker is to _______________
a. combine functions, libraries, etc., into an executable program
b. translate source code into object code
c. find syntax errors in a program
d. find semantic errors in a program
e. convert input characters into the proper data types for the variables used for input -
Answers - a. combine functions, libraries, etc., into an executable program
In a C program, the statement int x = 10.5; should be detected as___________
, a. Valid assignment statement
b. Syntax error
c. Semantic error
d. Lexical error - Answers - c. Semantic error
Compilation translates high-level ______________ ________ into ____________
_______ - Answers - source language; machine language
4 phases of the compilation process - Answers - lexical analysis
syntax analysis
semantics analysis
code generation
Compiler optimization levels:
-g - Answers - includes debug information, no optimization
Compiler optimization levels:
-O0 - Answers - default, no optimization
Compiler optimization levels:
-O1 - Answers - optimizes for both speed and size
makes debugging simple
Compiler optimization levels:
-O2 - Answers - turns on every optimization except those the drastically increase size
enables instruction scheduling
makes code small and fast but hard to debug
Compiler optimization levels:
-O3 - Answers - drastically increases code size, but also increases performance
compared to -O2 and -O1
includes function inlining
Compiler optimization levels:
-Os - Answers -
Optimization of a program that works within a single basic block of code is called
_________________
a. local transformation / optimization
b. global transformation / optimization
c. loop un-controlling
d. loop controlling - Answers - a. local transformation / optimization
Any macros specified in source code are expanded by the _____________
a. preprocessor
b. assembler
c. compiler
d. linker - Answers - a. preprocessor
Macro without arguments is treated like a _____________ _______________ -
Answers - symbolic constant
What is the process of searching for match tokens described using?
a. Context-free grammar
b. Finite automata
c. Regular expressions
d. Both B and C - Answers - d. Both B and C
These operations are performed in parsing phase of compilation.
a. Obtaining tokens from lexical analysis
b. Group tokens into statements
c. Construct parse trees
d. All the above - Answers - d. All the above
The primary job of the linker is to _______________
a. combine functions, libraries, etc., into an executable program
b. translate source code into object code
c. find syntax errors in a program
d. find semantic errors in a program
e. convert input characters into the proper data types for the variables used for input -
Answers - a. combine functions, libraries, etc., into an executable program
In a C program, the statement int x = 10.5; should be detected as___________
, a. Valid assignment statement
b. Syntax error
c. Semantic error
d. Lexical error - Answers - c. Semantic error
Compilation translates high-level ______________ ________ into ____________
_______ - Answers - source language; machine language
4 phases of the compilation process - Answers - lexical analysis
syntax analysis
semantics analysis
code generation
Compiler optimization levels:
-g - Answers - includes debug information, no optimization
Compiler optimization levels:
-O0 - Answers - default, no optimization
Compiler optimization levels:
-O1 - Answers - optimizes for both speed and size
makes debugging simple
Compiler optimization levels:
-O2 - Answers - turns on every optimization except those the drastically increase size
enables instruction scheduling
makes code small and fast but hard to debug
Compiler optimization levels:
-O3 - Answers - drastically increases code size, but also increases performance
compared to -O2 and -O1
includes function inlining
Compiler optimization levels:
-Os - Answers -