GATE CS 2022 Set 1 — Question 29
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.NAT+1 / -0MediumLR(0) & SLR(1)Syntax AnalysisCompiler Design
Compiler Design → Syntax Analysis → LR(0) & SLR(1)
Last updated
Question
Consider the augmented grammar with as the set of terminals.If is the set of two items , then contains exactly __________ items.
Correct answer
5 to 5
Solution
The given set of items is .The operation involves finding the transition on the terminal symbol .
Moving the dot over , we get the kernel item for the next state:
Now, check the new items. We have a dot before (already handled) and a dot before . We must add productions for .
1.
2.
3.
4.
5. There are exactly 5 items in this set.
1.Identify the kernel item:
The item in with the dot before is .Moving the dot over , we get the kernel item for the next state:
2.Compute the closure:
We need to include all production rules for the non-terminal immediately following the dot ().- Add productions for :
Now, check the new items. We have a dot before (already handled) and a dot before . We must add productions for .
- Add productions for :
3.Final Set of Items:
The complete set of items in the new state is:1.
2.
3.
4.
5. There are exactly 5 items in this set.
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Syntax Analysis
2026 Set 2 Q17In C runtime environment, which one of the following is stored in heap?2026 Set 2 Q19Consider the following three ANSI-C programs, P1, P2, and P3. P1 [code] P2 [code] **P3**…2026 Set 1 Q27Consider the following C statements: Which of the following options is/are correct? [figure]2026 Set 1 Q28Which of the following statements is/are true?2026 Set 2 Q35A lexical analyzer uses the following token definitions - - …