Machine-translated by Google. Questions are authored in English.
Top

Discussion

Consider the reasons for separating lexical analysis from parsing.
1. it simplifies the design of both phases
2. it improves compiler efficiency through specialised techniques
3. it enhances the portability of the compiler across character sets

  • A.1 only
  • B.Only 4
  • C.All of them
  • D.None of them

Answer: C

All three are the standard justifications given in the literature. Simplicity, efficiency and portability together outweigh the small cost of defining an interface between the two phases. The interface is a single function call, which is about as cheap as a boundary can be.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.