Building a scanner using imperative
programming and functional programming
Here are the tasks of this project:
1. Write a scanner using an imperative language: C/C++, Java, Python.
2. Write a scanner using Common Lisp with interpreter CLIPS (see Section 5).
Both programs must have the scan function. Its precondition is that the current pointer of
the input ﬁle is NOT at the end of ﬁle (EOF). It scans from the current pointer of the input ﬁle
and stops when either a valid token or invalid token can be decided. In the case of a valid token,
scan returns the token type; otherwise, it returns an error ﬂag. Note here when deciding a token
you must use the “longest possible token” rule.
4 On implementation of the scanner using an imperative language