Computer Science Department
Programming Methods Laboratory

Compilation     winter 00/01
Ecole Polytechnique Federale de Lausanne
Assignment 1
03.11.2K

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/
.


You should present your solution in the tutorial on Friday, 17.11.2K.