ocamlspot / spotfile.mli

(***********************************************************************)
(*                                                                     *)
(*                            ocamlspotter                             *)
(*                                                                     *)
(*                             Jun FURUSE                              *)
(*                                                                     *)
(*   Copyright 2008, 2009 Jun Furuse. All rights reserved.             *)
(*   This file is distributed under the terms of the GNU Library       *)
(*   General Public License, with the special exception on linking     *)
(*   described in file LICENSE.                                        *)
(*                                                                     *)
(***********************************************************************)

open Spot
open Spoteval
open Cmt_format
open Spoteval

type file = {
  cmt            : Cmt_format.cmt_infos;
  path           : string; (** cmt file itself if packed *)
  flat           : Abstraction.structure;
  top            : Abstraction.structure;
  id_def_regions : (Ident.t, Region.t) Hashtbl.t lazy_t;
  rannots        : Annot.t list Regioned.t list lazy_t;
  tree           : Tree.t lazy_t
}

val source_path_of_cmt : cmt_infos -> string option
val dump_file : file -> unit
val cmt_of_file : string -> string
val abstraction_of_cmt : cmt_infos -> Abstraction.structure * (Location.t, (int (* CR jfuruse: useless *) * Annot.t list)) Hashtbl.t

module Make(Spotconfig : Spotconfig_intf.S) : sig
  module Load : sig
    exception Old_cmt of string * string
    val load : load_paths:string list -> string -> file
    val load_module : ?spit:bool -> load_paths:string list -> string -> file (* CR jfuruse: spit *)
  end
  exception Old_cmt of string * string
  val load : load_paths:string list -> string -> file
  val load_module : ?spit:bool -> load_paths:string list -> string -> file (* CR jfuruse: spit *)
  val empty_env   : file -> Env.t
  val invalid_env : file -> Env.t
  type result = File_itself | Found_at of Region.t | Predefined
  val find_path_in_flat : file -> Kind.t * Path.t -> PIdent.t * result
  val str_of_global_ident : load_paths:string list -> Ident.t -> string * Value.structure
  val eval_packed : Env.t -> string -> Value.t
end

(*
module Make( Spotconfig : Spotconfig_intf.S ) : sig

  type elem = 
      File.elem =
    | Argv of string array
    | Source_path of string option
    | Cwd of string
    | Load_paths of string list
    | Top of Abstraction.structure option
    | Annots of (Location.t * Annot.t) list

  val dump : source: string option -> string -> unit
  val dump_package : prefix: string -> source: string -> string list -> unit

  type file = {
    path : string; (* "" means no source *)
    cwd : string;
    load_paths : string list;
    version : string * string;
    argv : string array;
    top : Abstraction.structure;
    flat : Abstraction.structure;
    rannots : Annot.t Regioned.t list;
    tree : Tree.t lazy_t;
    id_def_regions : (Ident.t, Region.t) Hashtbl.t;
  }
	
  val dump_file : file -> unit

  val spot_of_file : string -> string

  exception Old_spot of string * string
  val load : load_paths:string list -> string -> file
  val load_module : ?spit:bool -> load_paths:string list -> string -> file
    
  val empty_env : file -> Env.t
  val invalid_env : file -> Env.t

  type result = File_itself | Found_at of Region.t | Predefined
  
  val find_path_in_flat : file -> Kind.t * Path.t -> PIdent.t * result

  val str_of_global_ident : load_paths:string list -> Ident.t -> string * Value.structure

  val eval_packed : Env.t -> string -> Value.t

  val dump_elem : elem -> unit
  val dump_elems : elem list -> unit
end
*)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.