]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/pxp/pxp/m2parsergen/ast.ml
- the mathql interpreter is not helm-dependent any more
[helm.git] / helm / DEVEL / pxp / pxp / m2parsergen / ast.ml
1 (* $Id$
2  * ----------------------------------------------------------------------
3  *
4  *)
5
6 type declaration =
7     D_token of string                         (* D_token name *)
8   | D_typed_token of string                   (* D_typed_token name *)
9 ;;
10
11 type symbol =
12     U_symbol of (string * string option)      (* U_symbol(token, label) *)
13   | L_symbol of (string * string list * string option)
14                                         (* L_symbol(token, args, label) *)
15   | L_indirect of (string * string list * string option)
16 ;;
17
18
19 type modifier =
20     Exact
21   | Option
22   | Repetition
23 ;;
24
25
26 type pattern =
27     { pat_symbol : symbol;
28       pat_modifier : modifier;
29     }
30
31
32 type branch = 
33     { branch_selector : symbol;
34       branch_early_code : (string * int * int);
35       branch_binding_code : (string * int * int);
36       branch_pattern : pattern list;
37       branch_result_code : (string * int * int);
38       branch_error_code : (string * int * int) option;
39     }
40 ;;
41
42 type rule =
43     { rule_name : string;
44       rule_arguments : string list;           (* List of names *)
45       rule_branches : branch list;
46     }
47 ;;
48
49 type text =
50     { text_decls : declaration list;
51       text_rules : rule list;
52     }
53 ;;
54
55 (* ======================================================================
56  * History:
57  * 
58  * $Log$
59  * Revision 1.1  2000/11/17 09:57:32  lpadovan
60  * Initial revision
61  *
62  * Revision 1.3  2000/05/09 00:03:22  gerd
63  *      Added [ ml_name ] symbols, where ml_name is an arbitrary
64  * OCaml identifier.
65  *
66  * Revision 1.2  2000/05/08 22:03:01  gerd
67  *      It is now possible to have a $ {{ }} sequence right BEFORE
68  * the first token. This code is executed just after the first token
69  * has been recognized.
70  *
71  * Revision 1.1  2000/05/06 17:36:17  gerd
72  *      Initial revision.
73  *
74  * 
75  *)