Part 1 Introduction
Q What is the primary function of a compiler?
(a) It translates code written in a higher language like C or C++ into the target language.
(b) It converts assembly language program to machine code
(c) It translates assembly language program to Object code
(d) It converts Object code to Executable
Q What is a secondary function of a compiler?
(a) Work with Linker to produce a Binary
(b) Produce an Executable from a Source File
(c) Reporting errors in the source code programs
(d) Provide options to convert from one higher level language to another
Q Which one of the following functions does a preprocessor perform?
(a) Substitutes Macros, Strips Comments and Includes Header Files
(b) Translates Code Written in Higher Level Languages like C/C++ into Target Language
(c) Converts Assembly language Program into Machine Language Program (Object Code)
(d) Combines one or more Object Files into an Executable File
Q Which one of the following functions does an Assembler perform?
(a) Substitutes Macros, Strips Comments and Includes Header Files
(b) Translates Code Written in Higher Level Languages like C/C++ into Target Language
(c) Converts Assembly language Program into Machine Language Program (Object Code)
(d) Combines one or more Object Files into an Executable File
Q Which one of the following functions does a Linker perform?
(a) Substitutes Macros, Strips Comments and Includes Header Files
(b) Translates Code Written in Higher Level Languages like C/C++ into Target Language
(c) Converts Assembly language Program into Machine Language Program (Object Code)
(d) Combines one or more Object Files into an Executable File
Q What does the front end of a compiler do?
(a) Converts Assembly language Program into Machine Language Program (Object Code)
(b) Combines one or more Object Files into an Executable File
(c) Transforms the input source into an intermediate code
(d) Transforms machine independent Intermediate code into Target Assembly language Program
Q What does the Back-end of a compiler do?
(a) Converts Assembly language Program into Machine Language Program (Object Code)
(b) Combines one or more Object Files into an Executable File
(c) Transforms the input source into an intermediate code
(d) Transforms machine independent Intermediate code into Target Assembly language Program
Q What is the objective of Lexical Analysis?
(a) Break up the input source into a small meaningful sequence of tokens
(b) Check if the sequence of tokens forms a valid sequence as defined in the programming Language
(c) Check if the syntactically correct statements make a meaningful reading
(d) Walk through the Annotated parse tree and generate Intermediate Code.
Q What is the objective of Syntax Analysis?
(a) Break up the input source into a small meaningful sequence of characters
(b) Check if the sequence of tokens forms a valid sequence as defined in the programming Language
(c) Check if the syntactically correct statements make a meaningful reading
(d) Walk through the Annotated parse tree and generate Intermediate Code.
Q What is the Objective of Semantic Analysis?
(a) Break up the input source into small meaningful sequence of characters
(b) Check if the sequence of tokens forms a valid sequence as defined in the programming Language
(c) Check if the syntactically correct statements make a meaningful reading
(d) Walk through the Annotated parse tree and generate Intermediate Code.
Q What is a "Pass" in a compiler?
(a) Reading through a representation of the entire program for performing a task
(b) Successfully being able to compile a Program
(c) Bypassing the Optimization Phases during compilation
(d) Break up the input source into a small meaningful sequence of characters
Q Some Programming languages like PL/1 or ALGOL 68 are not suitable for single-pass compilation
because
(a) They have complicated programming constructs
(b) They allow for variables to be used before declaring them
(c) They allow different ways of declaring a variable
(d) The Intermediate code cannot be optimized in such languages
Q A Symbol Table contains information with respect to
(a) The identifiers used in the input source program
(b) The constants and strings used in the input source program
(c) The Functions used in the input source program
(d) All of the above
Q A Literal Table contains information with respect to
(a) The identifiers used in the input source program
(b) The constants and strings used in the input source program
(c) The Functions used in the input source program
(d) All of the above
No comments:
Post a Comment