comparison lab4/lexer.mli @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:bfdcc3820b32
1 (* lab4/lexer.mli *)
2 (* Copyright (c) 2017 J. M. Spivey *)
3
4 open Dict
5
6 (* The lexer is generated from a camllex script. It takes an input
7 buffer, reads a token, and returns the |token| value that corresponds
8 to it. The lexer maintains the current line number in |lineno| for
9 producing error messages. Lexical errors result in the exception
10 |Lex_error|, whose arguments are a format and argument list suitable
11 for passing to |printf| to print the message. *)
12
13 (* |token| -- scan a token and return its code *)
14 val token : Lexing.lexbuf -> Parser.token
15
16 (* |lineno| -- source line number *)
17 val lineno : int ref
18
19 (* |string_table| -- fetch table of string constants *)
20 val string_table : unit -> (Optree.symbol * string) list