+let push st n = {st with
+ l = n; s = 1 :: st.s; w = true
+}
+
+let pop st = {st with
+ w = false; s = match st.s with [] -> [] | i :: tl -> succ i :: tl
+}
+
+let next st = {st with
+ w = false
+}
+
+let mk_open st ris =
+ if st.w then T.Macro "PRIM" :: T.arg "" :: T.Macro "OPEN" :: ris else ris
+
+let mk_dec w s ris =