X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=helm%2FDEVEL%2Fpxp%2Fpxp%2Fm2parsergen%2Fgenerator.ml;fp=helm%2FDEVEL%2Fpxp%2Fpxp%2Fm2parsergen%2Fgenerator.ml;h=0000000000000000000000000000000000000000;hp=4301f22596b8083c86fd4186fc21621c87e2f5b1;hb=3ef089a4c58fbe429dd539af6215991ecbe11ee2;hpb=1c7fb836e2af4f2f3d18afd0396701f2094265ff diff --git a/helm/DEVEL/pxp/pxp/m2parsergen/generator.ml b/helm/DEVEL/pxp/pxp/m2parsergen/generator.ml deleted file mode 100644 index 4301f2259..000000000 --- a/helm/DEVEL/pxp/pxp/m2parsergen/generator.ml +++ /dev/null @@ -1,920 +0,0 @@ -(* $Id$ - * ---------------------------------------------------------------------- - * - *) - -open Parser -open Ast - -(* Overall scheme: - * - * The rules are translated to: - * - * let rec parse_ ... = ... - * and parse_ ... = ... - * and ... - * and parse_ ... = ... - * in - * - * Every rule has at least two arguments: 'current' and 'get_next'. - * 'current()' is the token that should match the first symbol of the - * rule. 'get_next()' returns the next token. - * - * The rules may have further user arguments; these are the next arguments - * in turn. - * - * The rules return the user value. After they have returned to the caller - * the current token is the token that follows the sequence of tokens - * matching the rule. - * - * The rules will raise: - * - Not_found if the first token does not match - * - Parsing.Parse_error if the rest does not match. - * - * Rule scheme: - * - * rule(arg1,arg2,...): - * (l1:x1) - * {{ let-CODE }} - * (l2:y2(name1,...)) y3 ... - * {{ CODE }} - * ? {{ ?-CODE }} - * | x2 ... - * | ... - * | xN - * - * let parse_ current get_next arg1 arg2 ... = - * match current() with - * S(x1) -> ... - * | S(x2) -> ... - * | ... - * | S(xN) -> ... -* | _ -> raise Not_found - * - * Here, S(xi) denotes the set of tokens matched by xi without all tokens - * already matched by x1 to x(i-1). (If S(xi) = empty, a warning is printed, - * and this branch of the rule is omitted.) - * - * S(xi) may be a set because xi may be a reference to another rule. In this - * case, S(xi) bases on the set of tokens that match the first symbol of - * the other rule. (In general, S(xi) must be computed recursively.) - * - * If the "?" clause is present, every branch is embraced by the following: - * - * let position = ref "