Question Details

Which of the following statements is/are true?

Options

A

LL(1) parser uses backtracking

B

For a grammar to be LL(1), it must be left-recursive

C

For a grammar to be LL(1), it must be left-factored

D

The LL(1) parsers are more powerful than the SLR parsers

Show Answer
Correct Answer
C For a grammar to be LL(1), it must be left-factored

Solution :

The correct statement is: For a grammar to be LL(1), it must be left-factored.

Let's analyze each of the statements to understand why this is the correct choice:

1. LL(1) parsers do not use backtracking:
An LL(1) parser is a deterministic, predictive top-down parser. The first 'L' stands for scanning the input from Left to right, the second 'L' stands for producing a Leftmost derivation, and the '1' indicates that it uses exactly one lookahead input symbol to make parsing decisions. Because the parser can uniquely determine which production rule to apply at each step using a parsing table and a single lookahead token, it never needs to backtrack. Thus, the statement "LL(1) parser uses backtracking" is false.

2. LL(1) grammars cannot be left-recursive:
If a grammar contains left-recursion, it has a non-terminal that can eventually derive a sentential form starting with itself, for example:

A → A α | β

When a top-down parser like LL(1) tries to expand the non-terminal A, it can repeatedly apply the rule A → Aα without consuming any input symbols, causing the parser to fall into an infinite loop. Therefore, left-recursion must be eliminated for a grammar to be LL(1). This makes the statement "For a grammar to be LL(1), it must be left-recursive" false.

3. LL(1) grammars must be left-factored:
Left-factoring is a grammar transformation technique used to remove common prefixes from production rules sharing the same left-hand side. For example, if we have:

A → α β 1 | α β 2

An LL(1) parser looking at the prefix α cannot decide which of the two productions to choose based on a single lookahead token. To resolve this choice, we must left-factor the grammar by rewritng it so that the choice is deferred. Consequently, for a grammar to be LL(1), it must be left-factored. This statement is true.

4. SLR parsers are more powerful than LL(1) parsers:
SLR(1) (Simple LR) is a bottom-up parser. Bottom-up parsers generally handle a wider class of grammars than top-down parsers because they defer decisions until they have seen the entire right-hand side of a production. The set of LL(1) grammars is a strict subset of SLR(1) grammars. Therefore, SLR parsers are more powerful than LL(1) parsers, making the statement "The LL(1) parsers are more powerful than the SLR parsers" false.

Transparent Access on Mindyard

Built for Learners & Educators Alike

Completely free for students. Educators & coaching institutes get 2 months free Pro trial to create tests.

FREE FOR STUDENTS

Practice & Learn Free for Students

Access unlimited practice questions, detailed step-by-step solutions, and exam study materials — completely free for students.

  • Unlimited mock tests & question bank practice
  • Full access to curated study library & formula notes
  • 100% free for students • No credit card required
2 MONTHS FREE TRIAL

Educators & Coaching Institutes

Create and conduct professional online assessments with AI question generation, tab proctoring, and comprehensive batch management.

  • AI question uploader & rapid test generator
  • Anti-cheating tab proctoring & performance reports
  • Full Pro access free for 60 days • No upfront commitment
Discover more resources

You may also like

Mock Tests

View All
  • GATE
  • beginner
  • 3 hours
  • civil engineering

Prepare for GATE 2026 Civil Engineering with the latest question papers, previous year papers, detailed solutions, syllabus, exam pattern, preparation tips, mock tests, and subject-wise study material. Download GATE 2026 CE question papers with solutions in PDF format and boost your preparation for top engineering institutes and PSU recruitment.

  • GATE
  • beginner
  • 3 hours
  • electronics and communication engineering

Prepare effectively for GATE 2026 Electronics & Communication Engineering (EC) with this comprehensive Question Paper with Solutions. This resource includes detailed explanations, concept-wise solutions, previous year paper analysis, and exam-oriented practice to help aspirants strengthen core subjects like Electronic Devices, Analog Circuits, Digital Circuits, Signals & Systems, Network Theory, Control Systems, Electromagnetics, Communications, and more. Perfect for revision, self-assessment, and boosting your GATE 2026 EC preparation strategy.

Ask AI Tutor
5 left
Q1 View Question & Options
AI Tutor is solving this question...
Reading question context & options...
Ask your own doubt or choose a quick prompt: