Syntax-Directed Definitions and Translations

Question 1
Marks : +2 | -2
Pass Ratio : 100%
Which table is a permanent database that has an entry for each terminal symbol?
Terminal Table
Literal Table
Identifier Table
None of the mentioned
Explanation:
A database that has entry for each terminal symbols such as arithmetic operators, keywords, punctuation characters such as ‘;’, ‘,’etc Fields: Name of the symbol.
Question 2
Marks : +2 | -2
Pass Ratio : 100%
A linker is given object module for a set of programs that were compiled separately. What is not true about an object module?
Object code
Relocation bits
Names and locations of all external symbols denied in the object module
Absolute addresses of internal symbols
Explanation:
A linker or link editor is a computer program that takes one or more object files generated by a compiler and combines them into a single executable file, library file, or another object file.
Question 3
Marks : +2 | -2
Pass Ratio : 100%
What is the function of the syntax phase?
recognize the language and to cal the appropriate action routines that will generate the intermediate form or matrix for these constructs
Build a literal table and an identifier table
Build a uniform symbol table
Parse the source program into the basic elements or tokens of the language
Explanation:
In this phase symbol table is created by the compiler which contains the list of lexemes or tokens.
Question 4
Marks : +2 | -2
Pass Ratio : 100%
What is Pass 2?
Assemble instruction and generate data
Perform processing of assembler
Write the object program
All of the mentioned
Explanation:
A multi-pass compiler is a type of compiler that processes the source code or abstract syntax tree of a program several times. Each pass takes the result of the previous pass as the input and creates an intermediate output.
Question 5
Marks : +2 | -2
Pass Ratio : 100%
Which one of the following is the tightest upper bound that represents the time complexity of inserting an object into a binary search tree of n nodes?
O(1)
O(long)
O(n)
O(long)
Explanation:
For skewed binary search tree on n nodes, the upper bound to insert a node is O (n).
Question 6
Marks : +2 | -2
Pass Ratio : 100%
Assembly code data base is associated with ___________
Code is converted into assembly
Table of rules in the form of patterns for matching with the uniform symbol table to discover syntactic structure
All of the mentioned
None of the mentioned
Explanation:
An assembly language is a low-level programming language for a computer, or other programmable device, in which there is a very strong (generally one-to-one) correspondence between the language and the architecture’s machine code instructions.
Question 7
Marks : +2 | -2
Pass Ratio : 100%
Pass I ______________
Assign address to all statements
Save the values assigned to all labels for use in pass 2
Perform some processing
All of the mentioned
Explanation:
The pass 1 of a compiler the above mentioned functions are performed
Question 8
Marks : +2 | -2
Pass Ratio : 100%
In a single pass assembler, most of the forward references can be avoided by putting the restriction ___________
On the number of strings/life reacts
Code segment to be defined after data segment
On unconditional rump
None of the mentioned
Explanation:
A single pass assembler scans the program only once and creates the equivalent binary program.
Question 9
Marks : +2 | -2
Pass Ratio : 100%
The table created by lexical analysis to describe all literals used in the source program is?
Terminal table
Literal table
Identifier table
Reductions
Explanation:
In computer science, and specifically in compiler and assembler design, literal pool is a lookup table used to hold literals during assembly and execution.
Question 10
Marks : +2 | -2
Pass Ratio : 100%
The method which merges the bodies of two loops is?
Loop rolling
Loop jamming
Constant folding
None of the mentioned
Explanation:
In computer science, loop fusion (or loop jamming) is a compiler optimization and loop transformation which replaces multiple loops with a single one.