Commit 8634638f authored by POTTIER Francois's avatar POTTIER Francois

New function [Symbol.is_terminal].

parent cec5e7ec
......@@ -442,6 +442,13 @@ module Symbol = struct
| N of Nonterminal.t
| T of Terminal.t
let is_terminal sym =
match sym with
| N _ ->
false
| T _ ->
true
let compare sym1 sym2 =
match sym1, sym2 with
| N nt1, N nt2 ->
......
......@@ -289,6 +289,8 @@ module Symbol : sig
| N of Nonterminal.t
| T of Terminal.t
val is_terminal: t -> bool
(* [lookup] maps an identifier to a symbol, or raises [Not_found]. *)
val lookup : string -> t
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment