aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gramlib/gramext.ml14
-rw-r--r--gramlib/gramext.mli1
-rw-r--r--gramlib/grammar.ml10
-rw-r--r--gramlib/grammar.mli1
4 files changed, 7 insertions, 19 deletions
diff --git a/gramlib/gramext.ml b/gramlib/gramext.ml
index 159070b2f2..72468b540e 100644
--- a/gramlib/gramext.ml
+++ b/gramlib/gramext.ml
@@ -36,7 +36,6 @@ and 'te g_symbol =
| Sopt of 'te g_symbol
| Sself
| Snext
- | Scut
| Stoken of Plexing.pattern
| Stree of 'te g_tree
and g_action = Obj.t
@@ -65,7 +64,7 @@ let rec derive_eps =
| Sopt _ -> true
| Stree t -> tree_derive_eps t
| Slist1 _ | Slist1sep (_, _, _) | Snterm _ |
- Snterml (_, _) | Snext | Sself | Scut | Stoken _ ->
+ Snterml (_, _) | Snext | Sself | Stoken _ ->
false
and tree_derive_eps =
function
@@ -125,9 +124,6 @@ let insert_tree entry_name gsymbols action tree =
if eq_symbol s s1 then
let t = Node {node = s1; son = insert sl son; brother = bro} in
Some t
- else if s = Scut then
- try_insert s sl (Node {node = s; son = tree; brother = DeadEnd})
- else if s1 = Scut then try_insert s1 (s :: sl) tree
else if is_before s1 s || derive_eps s && not (derive_eps s1) then
let bro =
match try_insert s sl bro with
@@ -179,7 +175,7 @@ and token_exists_in_symbol f =
| Sopt sy -> token_exists_in_symbol f sy
| Stoken tok -> f tok
| Stree t -> token_exists_in_tree f t
- | Snterm _ | Snterml (_, _) | Snext | Sself | Scut -> false
+ | Snterm _ | Snterml (_, _) | Snext | Sself -> false
let insert_level entry_name e1 symbols action slev =
match e1 with
@@ -310,7 +306,7 @@ Error: entries \"%s\" and \"%s\" do not belong to the same grammar.\n"
| Slist1 s -> check_gram entry s
| Sopt s -> check_gram entry s
| Stree t -> tree_check_gram entry t
- | Snext | Sself | Scut | Stoken _ -> ()
+ | Snext | Sself | Stoken _ -> ()
and tree_check_gram entry =
function
Node {node = n; brother = bro; son = son} ->
@@ -344,7 +340,7 @@ let insert_tokens gram symbols =
Not_found -> let r = ref 0 in Hashtbl.add gram.gtokens tok r; r
in
incr r
- | Snterm _ | Snterml (_, _) | Snext | Sself | Scut -> ()
+ | Snterm _ | Snterml (_, _) | Snext | Sself -> ()
and tinsert =
function
Node {node = s; brother = bro; son = son} ->
@@ -468,7 +464,7 @@ let rec decr_keyw_use gram =
| Slist1sep (s1, s2, _) -> decr_keyw_use gram s1; decr_keyw_use gram s2
| Sopt s -> decr_keyw_use gram s
| Stree t -> decr_keyw_use_in_tree gram t
- | Sself | Snext | Scut | Snterm _ | Snterml (_, _) -> ()
+ | Sself | Snext | Snterm _ | Snterml (_, _) -> ()
and decr_keyw_use_in_tree gram =
function
DeadEnd | LocAct (_, _) -> ()
diff --git a/gramlib/gramext.mli b/gramlib/gramext.mli
index 03b0c77bbe..e888508277 100644
--- a/gramlib/gramext.mli
+++ b/gramlib/gramext.mli
@@ -34,7 +34,6 @@ and 'te g_symbol =
| Sopt of 'te g_symbol
| Sself
| Snext
- | Scut
| Stoken of Plexing.pattern
| Stree of 'te g_tree
and g_action = Obj.t
diff --git a/gramlib/grammar.ml b/gramlib/grammar.ml
index 0cf8eb5bbb..5340482a01 100644
--- a/gramlib/grammar.ml
+++ b/gramlib/grammar.ml
@@ -55,14 +55,13 @@ let rec print_symbol ppf =
| Snterml (e, l) ->
fprintf ppf "%s%s@ LEVEL@ %a" e.ename (if e.elocal then "*" else "")
print_str l
- | Snterm _ | Snext | Sself | Scut | Stoken _ | Stree _ as s ->
+ | Snterm _ | Snext | Sself | Stoken _ | Stree _ as s ->
print_symbol1 ppf s
and print_symbol1 ppf =
function
| Snterm e -> fprintf ppf "%s%s" e.ename (if e.elocal then "*" else "")
| Sself -> pp_print_string ppf "SELF"
| Snext -> pp_print_string ppf "NEXT"
- | Scut -> pp_print_string ppf "/"
| Stoken ("", s) -> print_str ppf s
| Stoken (con, "") -> pp_print_string ppf con
| Stree t -> print_level ppf pp_print_space (flatten_tree t)
@@ -410,8 +409,6 @@ let rec parser_of_tree entry nlevn alevn =
| Node {node = Sself; son = LocAct (act, _); brother = DeadEnd} ->
(fun (strm__ : _ Stream.t) ->
let a = entry.estart alevn strm__ in app act a)
- | Node {node = Scut; son = son; brother = _} ->
- parser_of_tree entry nlevn alevn son
| Node {node = Sself; son = LocAct (act, _); brother = bro} ->
let p2 = parser_of_tree entry nlevn alevn bro in
(fun (strm__ : _ Stream.t) ->
@@ -651,7 +648,6 @@ and parser_of_symbol entry nlevn =
(fun (strm__ : _ Stream.t) -> e.estart (level_number e l) strm__)
| Sself -> (fun (strm__ : _ Stream.t) -> entry.estart 0 strm__)
| Snext -> (fun (strm__ : _ Stream.t) -> entry.estart nlevn strm__)
- | Scut -> (fun (strm__ : _ Stream.t) -> Obj.repr ())
| Stoken tok -> parser_of_token entry tok
and parser_of_token entry tok =
let f = entry.egram.glexer.Plexing.tok_match tok in
@@ -869,7 +865,7 @@ let find_entry e s =
| Slist1sep (s, _, _) -> find_symbol s
| Sopt s -> find_symbol s
| Stree t -> find_tree t
- | Sself | Snext | Scut | Stoken _ -> None
+ | Sself | Snext | Stoken _ -> None
and find_tree =
function
Node {node = s; brother = bro; son = son} ->
@@ -996,7 +992,6 @@ module type S =
val r_next :
('self, 'a, 'r) ty_rule -> ('self, 'b) ty_symbol ->
('self, 'b -> 'a, 'r) ty_rule
- val r_cut : ('self, 'a, 'r) ty_rule -> ('self, 'a, 'r) ty_rule
val production : ('a, 'f, Ploc.t -> 'a) ty_rule * 'f -> 'a ty_production
module Unsafe :
sig
@@ -1078,7 +1073,6 @@ module GMake (L : GLexerType) =
let s_rules (t : Obj.t ty_production list) = Gramext.srules (Obj.magic t)
let r_stop = []
let r_next r s = r @ [s]
- let r_cut r = r @ [Scut]
let production
(p : ('a, 'f, Ploc.t -> 'a) ty_rule * 'f) : 'a ty_production =
Obj.magic p
diff --git a/gramlib/grammar.mli b/gramlib/grammar.mli
index fe06d1fa81..53c8004a5b 100644
--- a/gramlib/grammar.mli
+++ b/gramlib/grammar.mli
@@ -131,7 +131,6 @@ module type S =
val r_next :
('self, 'a, 'r) ty_rule -> ('self, 'b) ty_symbol ->
('self, 'b -> 'a, 'r) ty_rule
- val r_cut : ('self, 'a, 'r) ty_rule -> ('self, 'a, 'r) ty_rule
val production : ('a, 'f, Ploc.t -> 'a) ty_rule * 'f -> 'a ty_production
module Unsafe :