Discussion
A scanner generator such as Lex takes as input
Answer: C
Correct answer: regular expressions describing the tokens and produces a scanner
Lex and its successors take a specification pairing regular expressions with actions and generate a scanner - typically as a finite automaton driven by a table.
Regular expressions suffice because token structure is regular: identifiers, numbers and operators can all be described without recursion. Nested structures such as balanced parentheses cannot, which is why the parser needs a context-free grammar and a different generator, and why the two tools are separate.
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