From 9d724f17e813fa344d485329d33b5f5ecf8197a3 Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Fri, 4 Apr 2025 20:53:56 +0200 Subject: Functorization --- ccross.sml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'ccross.sml') diff --git a/ccross.sml b/ccross.sml index 58f9c32..749687b 100644 --- a/ccross.sml +++ b/ccross.sml @@ -1,4 +1,16 @@ -fun main [fname] = Cpp.debugPrint fname +structure ccross:> CCROSS = struct + structure T:> TOKENIZER = + Tokenizer(structure H = Hashtable; structure S = Stream) + + structure P:> CPP = Cpp(T) + + structure ExnHandler:> EXN_HANDLER = + ExnHandler(structure T = T; structure P = P) +end + +val () = MLton.Exn.setTopLevelHandler ccross.ExnHandler.handler + +fun main [fname] = ccross.P.debugPrint fname | main _ = printLn "Expected a single argument: file name" val () = main $ CommandLine.arguments () -- cgit v1.2.3