Debian Codegraph @

mllex/main.sml

raw
1 (* Copyright (C) 2022 Matthew Fluet
2 * Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 * Copyright (C) 1997-2000 NEC Research Institute.
5 *
6 * MLton is released under a HPND-style license.
7 * See the file MLton-LICENSE for details.
8 *)
9
10 structure Main =
11 struct
12
13 fun usage s =
14 CommandLine.usage {usage = "file.lex ...", msg = s}
15
16 fun main (_, args) =
17 let
18 val rest =
19 let open Popt
20 in parse {switches = args, opts = []}
21 end
22 in
23 case rest of
24 Result.No msg => usage msg
25 | Result.Yes [] => usage "no files"
26 | Result.Yes files => List.foreach (files, LexGen.lexGen)
27 end
28
29 val main = CommandLine.make main
30
31 end