Lexical Analyser

Question 1
Marks : +2 | -2
Pass Ratio : 100%
Input to Lexical Analyser is _________
Source Code
Object Code
Lexeme
None of the mentioned
Explanation:
Lexical analyser’s Input is Source Code.
Question 2
Marks : +2 | -2
Pass Ratio : 100%
Two Important lexical categories are __________
White Space
Comments
None of the mentioned
White Space & Comments
Explanation:
Two important common lexical categories are white space and comments.
Question 3
Marks : +2 | -2
Pass Ratio : 100%
Which one is a type of Lexeme?
Identifiers
Constants
Keywords
All of the mentioned
Explanation:
All of them along with Operators are different types of lexemes.
Question 4
Marks : +2 | -2
Pass Ratio : 100%
Lexers are often generated by a lexer generator, same as parser generators.
True
False
Explanation:
Lexers are often generated by a lexer generator same as parser.
Question 5
Marks : +2 | -2
Pass Ratio : 100%
Lexical Analyser’s Output is given to Syntax Analysis.
True
False
Explanation:
Lexical Analyzer’s Output is given to Syntax Analysis.
Question 6
Marks : +2 | -2
Pass Ratio : 100%
An individual token is called ________
Lexeme
Lex
Lexeme & Lex
None of the mentioned
Explanation:
Individual Token is also Called Lexeme.
Question 7
Marks : +2 | -2
Pass Ratio : 100%
What is the output of a lexical analyzer?
Machine Code
Intermediate Code
Stream of Token
Parse Tree
Explanation:
The output given is in the form of tokens.
Question 8
Marks : +2 | -2
Pass Ratio : 100%
What goes over the characters of the lexeme to produce value?
Scanner
Parser
Evaluator
Lexical generator
Explanation:
In order to construct a token, the lexical analyzer needs a second stage, the evaluator, which goes over the characters of the lexeme to produce a value.
Question 9
Marks : +2 | -2
Pass Ratio : 100%
Lexical Analysis Identifies Different Lexical Units in a _______
Source Code
Object Code
Lexeme
None of the mentioned
Explanation:
Lexical Analysis Identifies Different Lexical Units in a source Code.
Question 10
Marks : +2 | -2
Pass Ratio : 100%
Which phase of the compiler is Lexical Analyser?
First
Second
Third
None of the mentioned
Explanation:
Lexical Analyzer is First Phase of Compiler.