(** Main module, parses command-line arguments and cycles through phases. *) (** [Pervasives.exit (]{!main} [())] is executed at the bottom of the file. *) (** Main function of a phase. Each phase exports a function of this signature that is called by the {!main}. *) type phase_func = Types.intermediate -> Types.intermediate (** List of all phases as [(identifier, phase_function, condition, description)]. [identifier] is used for the [-upto] command-line argument, which is saved in {!Globals.args}[.endphase]. [description] is used for logging, and for the usage message of [-upto]. *) val phases : (string * phase_func * (unit -> bool) * string) list (** Main function, returns exit status. Parses command-line arguments, saving them in {!Globals.args}. Then all phases are executed successively. Run [./civicc -help] in a terminal to see the available command-line options. This function catches the exceptions defined in {!Types}, and prints error messages accordingly. In case of error, 1 is returned, otherwise 0. *) val main : unit -> int