Write a scanner for our source language J0! The token classes
are ident and number, as well as the tokens (terminal
symbols) used explicitly in the grammar.
ident = letter { letter | digit }.
number = digit { digit }.
where
letter = "a" | ... | "z" | "A" | ... | "Z" | "_".
digit = "0" | ... | "9".
Your scanner should be able to accept C++/Java-style comments; i.e. line
comments starting with // and ending at the end of the line
and comments enclosed in /* and */ . Comments
do not nest in J0.
You will find a Java framework for this assignment at
http://lampwww.epfl.ch/courses/compilation00/.
|