Discussion
Consider the following statements about scanner generators.
1. They resolve ties between equal length matches by rule order.
2. They apply the longest match rule when patterns overlap.
3. They require the token patterns to be context free grammars.
Answer: C
Correct answer: 1 and 2 only
Statements 1 and 2 are the two disambiguation rules, and they are applied in that order: longest match first, then rule order to settle a tie. Statement 3 is wrong - the patterns are regular expressions, not context free grammars, which is precisely what makes the mechanical construction of an automaton possible.
No comment is present. Be the first to comment.
Loading…
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