Backport from sid to buster
[hcoop/debian/mlton.git] / mlyacc / main.sml
CommitLineData
7f918cf1
CE
1(* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 * Copyright (C) 1997-2000 NEC Research Institute.
4 *
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
7 *)
8
9structure Main =
10struct
11
12fun usage s =
13 Process.usage {usage = "file.grm",
14 msg = s}
15
16fun main args =
17 let
18 val rest =
19 let open Popt
20 in parse {switches = args,
21 opts = []}
22 end
23 in case rest of
24 Result.No msg => usage msg
25 | Result.Yes [file] => ParseGen.parseGen file
26 | _ => usage "too many files"
27 end
28
29val main = Process.makeMain main
30
31end