(***********************************************************************) (* *) (* Objective Caml *) (* *) (* Pierre Weis, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* en Automatique. All rights reserved. This file is distributed *) (* only by permission. *) (* *) (***********************************************************************) { open Parser;; (* The type token is defined in parser.mli *) exception Eof;; } rule token = parse | [' ' '\t'] { token lexbuf } (* Skip blanks *) | ['\n' ] { EOL } | ['0'-'9']+ { INT (int_of_string (Lexing.lexeme lexbuf)) } | '+' { PLUS } | '-' { MINUS } | '*' { TIMES } | '/' { DIV } | '(' { LPAREN } | ')' { RPAREN } | eof { raise Eof }