X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fpxp%2Fpxp%2Fm2parsergen%2Fast.ml;fp=helm%2FDEVEL%2Fpxp%2Fpxp%2Fm2parsergen%2Fast.ml;h=219dd0c80f4bae94bcf9e89c04c14d2b5de87c7d;hb=c03d2c1fdab8d228cb88aaba5ca0f556318bebc5;hp=0000000000000000000000000000000000000000;hpb=758057e85325f94cd88583feb1fdf6b038e35055;p=helm.git diff --git a/helm/DEVEL/pxp/pxp/m2parsergen/ast.ml b/helm/DEVEL/pxp/pxp/m2parsergen/ast.ml new file mode 100644 index 000000000..219dd0c80 --- /dev/null +++ b/helm/DEVEL/pxp/pxp/m2parsergen/ast.ml @@ -0,0 +1,75 @@ +(* $Id$ + * ---------------------------------------------------------------------- + * + *) + +type declaration = + D_token of string (* D_token name *) + | D_typed_token of string (* D_typed_token name *) +;; + +type symbol = + U_symbol of (string * string option) (* U_symbol(token, label) *) + | L_symbol of (string * string list * string option) + (* L_symbol(token, args, label) *) + | L_indirect of (string * string list * string option) +;; + + +type modifier = + Exact + | Option + | Repetition +;; + + +type pattern = + { pat_symbol : symbol; + pat_modifier : modifier; + } + + +type branch = + { branch_selector : symbol; + branch_early_code : (string * int * int); + branch_binding_code : (string * int * int); + branch_pattern : pattern list; + branch_result_code : (string * int * int); + branch_error_code : (string * int * int) option; + } +;; + +type rule = + { rule_name : string; + rule_arguments : string list; (* List of names *) + rule_branches : branch list; + } +;; + +type text = + { text_decls : declaration list; + text_rules : rule list; + } +;; + +(* ====================================================================== + * History: + * + * $Log$ + * Revision 1.1 2000/11/17 09:57:32 lpadovan + * Initial revision + * + * Revision 1.3 2000/05/09 00:03:22 gerd + * Added [ ml_name ] symbols, where ml_name is an arbitrary + * OCaml identifier. + * + * Revision 1.2 2000/05/08 22:03:01 gerd + * It is now possible to have a $ {{ }} sequence right BEFORE + * the first token. This code is executed just after the first token + * has been recognized. + * + * Revision 1.1 2000/05/06 17:36:17 gerd + * Initial revision. + * + * + *)