Commits

camlspotter committed 7fe1c32

merge

  • Participants
  • Parent commits 31c5719

Comments (0)

Files changed (3)

 OCAML_BYTE_LINK_FLAGS +=
 OCAML_NATIVE_LINK_FLAGS +=
 
+# OCAMLPACKS= 
+
 # OCamlGeneratedFiles(parser.ml lexer.ml)
 
-OCAMLPACKS[]=
-
 LIBFILES[] =
    utils
    result
 
 LIB = planck
 
-.DEFAULT: $(OCamlLibrary $(LIB), $(LIBFILES))
+.DEFAULT: $(MyOCamlLibrary $(LIB), $(LIBFILES))
 
 PROGFILES[] = $(LIBFILES)
 
 OCAML_OTHER_LIBS +=
 OCAML_LIB_FLAGS +=
 
-.DEFAULT: $(OCamlProgram $(PROGRAM), $(PROGFILES))
-
-
-clean:
-	rm -f *.o *.a *.cm* *.spit *spot *.annot *.opt *.byt
+.DEFAULT: $(MyOCamlProgram $(PROGRAM), $(PROGFILES))
+open Utils
+
 module OCaml = struct
   module Char = Char
 end
   let substr : 'a t -> string t = fun t ->
     mark >>= fun mark ->
     t >>= fun _ ->
-    string_from_mark mark 
+    string_from_mark mark
 
   let with_substr : 'a t -> (string * 'a) t = fun t ->
     mark >>= fun mark ->
     substr (char_uppercase >>= fun _ -> 
             star (char_uppercase <|> char_lowercase <|> char_lowercase_symbol <|> Literal.Char.digit_char))
 end
+
+module Keyword = struct
+  let tbl = HashSet.create 107
+  let add (kwd : string) = HashSet.add tbl kwd
+(*
+  let keyword : string t =
+*)
+end
+
+module Token = struct
+  type t =
+    | Keyword of string
+    | Char of char
+    | Float of string
+    | Infix of string
+    | Int of string
+    | LIdent of string
+    | Operator of string
+    | String of string
+    | UIdent of string
+end
     | Some v -> f v
     | None -> None
 end)
+
+module HashSet : sig
+  type 'a t
+  val create : int -> 'a t
+  val mem : 'a t -> 'a -> bool
+  val add : 'a t -> 'a -> unit
+  val remove : 'a t -> 'a -> unit
+end = struct
+  type 'a t = ('a, unit) Hashtbl.t (* poorman's implementation *)
+  let create = Hashtbl.create
+  let mem = Hashtbl.mem
+  let add t k = if not (mem t k) then Hashtbl.add t k ()
+  let remove = Hashtbl.remove
+end