![]() | Library Documentation | Structures | Signatures | Identifiers | Packages | About |
SIMPLE_TOKEN (pkg github.com/diku-dk/sml-parse)Simple tokenisation library.
The tokenisation library has basic support for symbols, identifiers, and numbers. It also associates region information to each individual token and thereby provides good support for error handling.structure SimpleToken : SIMPLE_TOKEN (pkg github.com/diku-dk/sml-parse)
signature SIMPLE_TOKEN = sig
type reg = Region.reg
datatype token = Symb of string
| Id of string
| Num of string
val pp_token : token -> string
val tokenise : {sep_chars : string, (* single-char symbols *)
symb_chars : string, (* multi-char symbols *)
is_id : string -> bool, (* is a string an id? *)
is_num : string -> bool} (* is a string a number? *)
-> {srcname:string,input:string}
-> (token*reg) list
end