
Quiz on Parsing and Context-Free Grammar
Authored by Aima Zahoor
Computers
12th Grade

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Which of the following is a characteristic of context-free grammar?
It can generate all possible strings in a language
It requires context to understand the syntax
It is only applicable to programming languages
It cannot define recursive structures
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following is an example of a nonterminal symbol?
2
expr
if
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What does it mean for a grammar to be ambiguous?
It has multiple valid parse trees for the same string
It cannot generate any strings
It has a single parse tree for every string
It is too complex to analyze
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is left recursion in grammar?
A way to eliminate ambiguity
A type of operator precedence
A method of parsing from the left side of the string
A situation where a nonterminal refers to itself on the left
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following describes left associativity?
Operators have equal precedence
Operators are evaluated from left to right
Operators are evaluated based on their type
Operators are evaluated from right to left
6.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What is a predictive parser?
A parser that generates random outputs
A parser that predicts the output of a program
A parser that does not require backtracking
A parser that uses backtracking
7.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Which of the following is NOT a type of parser?
Top-down parser
Bottom-up parser
Left-right parser
Universal parser
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?