Debian Codegraph @

gramlib/gramext.ml

raw symbols SCIP
1 (* camlp5r *)
2 (* gramext.ml,v *)
3 (* Copyright (c) INRIA 2007-2017 *)
4
5 type position =
6 | First
7 | Last
8 | Before of string
9 | After of string
10
11 type g_assoc = NonA | RightA | LeftA | BothA
12
13 let pr_assoc = function
14 | BothA -> Pp.str "multi associativity"
15 | LeftA -> Pp.str "left associativity"
16 | RightA -> Pp.str "right associativity"
17 | NonA -> Pp.str "no associativity"
18
19 (** Returns whether SELF means SELF, respectively on the left and on the right. *)
20 let split_assoc = function
21 | BothA -> (true, true)
22 | LeftA -> (true, false)
23 | RightA -> (false, true)
24 | NonA -> (false, false)
25
26 let self_on_the_left assoc = fst (split_assoc assoc)
27 let self_on_the_right assoc = snd (split_assoc assoc)