1signature Holmake_types =
2sig
3
4datatype pretoken = DEFN of string | RULE of string | EOF
5
6datatype frag = LIT of string | VREF of string
7type quotation = frag list
8
9type raw_rule_info = { targets : quotation, dependencies : quotation,
10                       commands : quotation list }
11
12datatype token = HM_defn of string * quotation
13               | HM_rule of raw_rule_info
14
15type env
16
17val base_environment : unit -> env
18val lookup : env -> string -> quotation
19
20val env_extend : string * quotation -> env -> env
21
22val to_token : pretoken -> token
23
24val perform_substitution : env -> quotation -> string
25
26val tokenize : string -> string list
27val dequote : string -> string
28val extract_normal_quotation : Substring.substring -> quotation
29val extract_cmd_quotation : Substring.substring -> quotation
30
31type rule_info = {dependencies : string list, commands : string list}
32
33type ruledb =
34     (string, {dependencies:string list, commands : quotation list})Binarymap.dict
35type depdb = (string,string list)Binarymap.dict
36val empty_ruledb : ruledb
37val extend_ruledb : (string -> unit) -> env -> raw_rule_info ->
38                    (ruledb * depdb) -> (ruledb * depdb * string list)
39val get_rule_info : ruledb -> env -> string -> rule_info option
40
41(*
42
43   [extend_ruledb warn env rule_info (rdb,ddb)] returns a pair of a
44   rule database and dependency database, extending those given as inputs, and
45   a list of the targets of the rule.
46
47   The databases are used to map target names to dependency and
48   command information (using the get_rule_info function).  The warn
49   function is used to output warning messages about the rule_info.  *)
50
51end
52