planck / lib / op_prec.mli

(** Tools for operator precedences and associativities *)

module Make(A : sig
  type t
  type op
  val app : t -> t -> t
  val binop : op -> t -> t -> t
  val unop : op -> t -> t
end) : sig

  type op = {
    prec : float; (** Operator precedence. Bigger is stronger. *)
    kind : [ `Infix of [ `Left | `Right | `Noassoc ] (** Infix, left or right associative *)
           | `Postfix 
           | `Prefix
  val prec_app : float
  (** Operator precedence of function application. = 1000.0 *)
  val tbl : (A.op, op) Hashtbl.t
  (** Operator table. The resolution functions below uses this table to query operators
      and its precedence information *)
  val find : (A.op -> op) ref
  (** By default [!find] is used to query operators from [tbl]. 
      If your set of operators cannot use table based precedence + associativity query,
      you can override this behavior by modifying the reference. 
  (** Resolution *)

  val parse : [ `Op of op * A.op | `Term of A.t ] list -> A.t
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
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.