sig
type operator = string
exception Not_operator of Pa_infix.operator
exception Forbidden of Pa_infix.operator
module Level :
sig
type unary
type binary
type 'a t
type arity = Unary | Binary
type assoc = Camlp4.Sig.Grammar.assoc = NonA | RightA | LeftA
type 'a precedence =
Highest
| Higher of 'a Pa_infix.Level.t
| Lower of 'a Pa_infix.Level.t
| Lowest
exception Bad_arity
val compare : 'a Pa_infix.Level.t -> 'b Pa_infix.Level.t -> int
val binary :
?name:string ->
?assoc:Pa_infix.Level.assoc ->
Pa_infix.Level.binary Pa_infix.Level.precedence ->
Pa_infix.Level.binary Pa_infix.Level.t
val unary :
?name:string ->
Pa_infix.Level.unary Pa_infix.Level.precedence ->
Pa_infix.Level.unary Pa_infix.Level.t
val name : 'a Pa_infix.Level.t -> string
val arity : 'a Pa_infix.Level.t -> Pa_infix.Level.arity
val assoc : 'a Pa_infix.Level.t -> Pa_infix.Level.assoc
val assignment : Pa_infix.Level.binary Pa_infix.Level.t
val disjunction : Pa_infix.Level.binary Pa_infix.Level.t
val conjunction : Pa_infix.Level.binary Pa_infix.Level.t
val comparison : Pa_infix.Level.binary Pa_infix.Level.t
val concatenation : Pa_infix.Level.binary Pa_infix.Level.t
val addition : Pa_infix.Level.binary Pa_infix.Level.t
val multiplication : Pa_infix.Level.binary Pa_infix.Level.t
val exponentiation : Pa_infix.Level.binary Pa_infix.Level.t
val default_unary : Pa_infix.Level.unary Pa_infix.Level.t
end
type kind = Prefix | Infix | Postfix
exception Conflicting_kind of Pa_infix.operator * Pa_infix.kind *
Pa_infix.kind
exception Conflicting_level of Pa_infix.operator * string * string
val infix :
Pa_infix.operator ->
?expr:(Camlp4.PreCast.Syntax.Ast.expr ->
Camlp4.PreCast.Syntax.Ast.expr ->
Camlp4.PreCast.Syntax.Ast.Loc.t -> Camlp4.PreCast.Syntax.Ast.expr) ->
Pa_infix.Level.binary Pa_infix.Level.t -> unit
val prefix :
?expr:(Camlp4.PreCast.Syntax.Ast.expr ->
Camlp4.PreCast.Syntax.Ast.Loc.t -> Camlp4.PreCast.Syntax.Ast.expr) ->
?level:Pa_infix.Level.unary Pa_infix.Level.t -> Pa_infix.operator -> unit
val postfix :
?expr:(Camlp4.PreCast.Syntax.Ast.expr ->
Camlp4.PreCast.Syntax.Ast.Loc.t -> Camlp4.PreCast.Syntax.Ast.expr) ->
?level:Pa_infix.Level.unary Pa_infix.Level.t -> Pa_infix.operator -> unit
val assoc : Pa_infix.operator -> Pa_infix.Level.assoc
val level : Pa_infix.operator -> 'a Pa_infix.Level.t
val kind : Pa_infix.operator -> Pa_infix.kind
val is_operator : Pa_infix.operator -> bool
val is_set : Pa_infix.operator -> bool
val handle_error : ('a -> 'b) -> 'a -> 'b
end