Thursday, 10 November 2011

CS606 assignment # 1

Suppose that you are working as a programmer in Microsoft. They
assigned you a task to draw a finite acceptor which can be useful
for lexical analyses of language L expressed as L = {w (a, b)* /
nb(w) mod 3 > 1.}. You are requested to analyze this language and
construct a deterministic finite acceptor of this language.

Question 2:

We can follow two approaches during the construction of lexical
analyzer. We can construct it as a separate module or it can
be a part of scanner. If scanner is the part of parse then in this
approach parser usually generates syntax tree of the source
program as defined by a grammar. The leaves of the tree are the
terminal symbols of the grammar. These terminal symbols or
tokens pass to the parser. But generally we choose to handle
analysis separately for the better modularity and portability, and
to allow make syntax analysis easier, so what are the reasons for
decoupling the scanner from parser?

No comments:

Post a Comment

Note: only a member of this blog may post a comment.