Coccinelle release 1.0.0-rc15
[bpt/coccinelle.git] / bundles / menhirLib / menhir-20120123 / src / cst.mli
1 (**************************************************************************)
2 (* *)
3 (* Menhir *)
4 (* *)
5 (* François Pottier, INRIA Rocquencourt *)
6 (* Yann Régis-Gianas, PPS, Université Paris Diderot *)
7 (* *)
8 (* Copyright 2005-2008 Institut National de Recherche en Informatique *)
9 (* et en Automatique. All rights reserved. This file is distributed *)
10 (* under the terms of the Q Public License version 1.0, with the change *)
11 (* described in file LICENSE. *)
12 (* *)
13 (**************************************************************************)
14
15 open Grammar
16
17 (* Concrete syntax trees. *)
18
19 (* A concrete syntax tree is one of a leaf -- which corresponds to a
20 terminal symbol; a node -- which corresponds to a non-terminal
21 symbol, and whose immediate descendants form an expansion of that
22 symbol; or an error leaf -- which corresponds to a point where the
23 [error] pseudo-token was shifted. *)
24
25 type cst =
26 | CstTerminal of Terminal.t
27 | CstNonTerminal of Production.index * cst array
28 | CstError
29
30 (* This is a (mostly) unambiguous printer for concrete syntax trees,
31 in an sexp-like notation. *)
32
33 val print: out_channel -> cst -> unit
34
35 (* This is a pretty-printer for concrete syntax trees. The notation is
36 the same as that used by the above printer; the only difference is
37 that the [Pprint] library is used to manage indentation. *)
38
39 val show: out_channel -> cst -> unit
40