Syntax Analyser

Question 1
Marks : +2 | -2
Pass Ratio : 100%
A grammar for a programming language is a formal description of _______________
Syntax
Semantics
Structure
Library
Explanation:
The grammar clearly indicates which type of structure does a program has.
Question 2
Marks : +2 | -2
Pass Ratio : 100%
Output file of Lex is __________ the input file is Myfile.
Myfile.e
Myfile.yy.c
Myfile.lex
Myfile.obj
Explanation:
This Produce the filr “myfile.yy.c” which we can then compile with g++.
Question 3
Marks : +2 | -2
Pass Ratio : 100%
Which of these features of assembler are Machine-Dependent?
Instruction formats
Addressing modes
Program relocation
All of the mentioned
Explanation:
All of these options are features of assembler which are machine dependent.
Question 4
Marks : +2 | -2
Pass Ratio : 100%
In Short Syntax Analysis Generates Parse Tree.
True
False
Explanation:
Short Syntax Analysis generates a parse tree.
Question 5
Marks : +2 | -2
Pass Ratio : 50%
Semantic Analyser is used for?
Generating Object code
Maintaining symbol table
Generating Object code & Maintaining symbol table
None of the mentioned
Explanation:
Maintaining the Symbol Table for each block.
Question 6
Marks : +2 | -2
Pass Ratio : 100%
Parsers are expected to parse the whole code.
True
False
Explanation:
Parsers are expected to parse the whole code even if some errors exist in the program.
Question 7
Marks : +2 | -2
Pass Ratio : 100%
Suppose One of the Operand is String and other is Integer then it does not throw error as it only checks whether there are two operands associated with ‘+’ or not.
True
False
Explanation:
Syntax analyser does not check the type of the operand.
Question 8
Marks : +2 | -2
Pass Ratio : 50%
Which phase of the compiler is Syntax Analysis?
First
Second
Third
None of the mentioned
Explanation:
It is Second Phase Of Compiler after Lexical Analyzer.
Question 9
Marks : +2 | -2
Pass Ratio : 100%
Type checking is normally done during ____________
Lexical Analysis
Syntax Analysis
Syntax Directed Translation
Code generation
Explanation:
It is the function of Syntax directed translation.
Question 10
Marks : +2 | -2
Pass Ratio : 100%
Select a Machine Independent phase of the compiler.
Syntax Analysis
Intermediate Code generation
Lexical Analysis
All of the mentioned
Explanation:
All of them work independent of a machine.