Discussion
A language is straightforward to parse when it offers
Answer: B
Correct answer: a grammar that is unambiguous and within a well known class
An unambiguous grammar gives each valid program exactly one parse tree, so there is no choice for the parser to resolve. Belonging to a class such as LL(1) or LALR(1) means an efficient deterministic parser can be generated automatically.
Neither the number of keywords nor the presence of comments affects this, both being matters for the scanner, and a single type would simplify semantic analysis rather than parsing. The grammar's properties are what decide parsing difficulty.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development