Ace
Learns
Theme
light_mode
dark_mode
light_mode
Light
dark_mode
Dark
monitor
Auto
Open main menu
menu_open
×
Home
History
Geography
Astronomy
Physics
Chemistry
Biology
Agriculture
Sports
Computer Science
Articles
Contact Us
MCQ Categories
Articles
Home
Contact Us
Home
»
Computer Science
»
Language Processors
»
Parsing
Language Processors
unfold_more
double_arrow
Assemblers
double_arrow
Code Generation and Optimization
double_arrow
Compiler Design
double_arrow
Lexical Analysis
double_arrow
Linkers
double_arrow
Loaders
double_arrow
Parsing
quiz
Parsing
Parsing and Types of Parsers
1.
What is parsing?
A)
The process of dividing a string into individual words
B)
The process of analyzing a string of symbols according to the rules of a formal grammar
C)
The process of generating machine code from source code
D)
The process of debugging code for errors
Answer
keyboard_arrow_down
keyboard_arrow_up
B) The process of analyzing a string of symbols according to the rules of a formal grammar
Explanation
2.
Which of the following is a widely used compiler-compiler tool for generating parsers?
A)
Lex
B)
GCC
C)
Yacc
D)
Make
Answer
keyboard_arrow_down
keyboard_arrow_up
C) Yacc
Explanation
3.
Which type of grammar is typically used to define the syntax of programming languages for parsers?
A)
Regular Grammar
B)
Context-Free Grammar
C)
Context-Sensitive Grammar
D)
Unrestricted Grammar
Answer
keyboard_arrow_down
keyboard_arrow_up
B) Context-Free Grammar
Explanation
4.
In what type of parsing are lexical analysis and parsing combined?
A)
Recursive parsing
B)
Context-sensitive parsing
C)
Scannerless parsing
D)
Syntactic parsing
Answer
keyboard_arrow_down
keyboard_arrow_up
C) Scannerless parsing
Explanation
5.
Which algorithm is commonly used for parsing context-free grammars in polynomial time?
A)
CYK algorithm
B)
Dijkstra's algorithm
C)
A* algorithm
D)
Kruskal's algorithm
Answer
keyboard_arrow_down
keyboard_arrow_up
A) CYK algorithm
Explanation
6.
Which type of parser uses the Shift-Reduce method?
A)
Top-down parser
B)
LL parser
C)
Bottom-up parser
D)
Recursive-descent parser
Answer
keyboard_arrow_down
keyboard_arrow_up
C) Bottom-up parser
Explanation
7.
What data structure is typically created by the parsing process in a compiler?
A)
Hash Table
B)
Abstract Syntax Tree (AST)
C)
Linked List
D)
Queue
Answer
keyboard_arrow_down
keyboard_arrow_up
B) Abstract Syntax Tree (AST)
Explanation
8.
What is the result of a parse tree when the grammar is ambiguous?
A)
A single unique parse tree for each sentence
B)
The parse tree is guaranteed to be minimal
C)
No parse tree can be constructed
D)
Multiple distinct parse trees for the same sentence
Answer
keyboard_arrow_down
keyboard_arrow_up
D) Multiple distinct parse trees for the same sentence
Explanation
9.
Which of the following parsers cannot accommodate left-recursive production rules?
A)
LR parsers
B)
Top-down parsers
C)
Bottom-up parsers
D)
Shift-reduce parsers
Answer
keyboard_arrow_down
keyboard_arrow_up
B) Top-down parsers
Explanation
10.
In the context of parsers, what is a “fix-up” mechanism?
A)
A way to handle forward declarations or references
B)
A method to improve parsing speed
C)
A tool to optimize token generation
D)
A technique to combine lexing and parsing
Answer
keyboard_arrow_down
keyboard_arrow_up
A) A way to handle forward declarations or references
Explanation
Quick Links
Sports
chevron_right
Common Wealth Games
chevron_right
Cricket
chevron_right
Football
chevron_right
Olympics
Current Affairs & Events
chevron_right
Daily Current Affairs
chevron_right
Latest Current Events
Geography
chevron_right
Geopolitics and Global Issues
chevron_right
Regional Geography
chevron_right
Geomorphology
chevron_right
Oceanography
Astronomy
chevron_right
Galaxies
chevron_right
Stars
chevron_right
The Universe
chevron_right
Space Exploration