From 46439007cf417cbd9ac8049bb4122c890097a0fa Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Fri, 22 Dec 2006 20:52:35 +0000 Subject: 20060303-partial --- module/xpointers.m | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 module/xpointers.m (limited to 'module/xpointers.m') diff --git a/module/xpointers.m b/module/xpointers.m new file mode 100644 index 00000000..491beffe --- /dev/null +++ b/module/xpointers.m @@ -0,0 +1,67 @@ +Xpointers: module +{ + PATH: con "/dis/lib/w3c/xpointers.dis"; + + One, Ole, Oge, Omul, Odiv, Omod, Oand, Oor, Oneg, + Onodetype, Onametest, Ofilter, Opath: con 'A'+iota; + + # axis types + Aancestor, + Aancestor_or_self, + Aattribute, + Achild, + Adescendant, + Adescendant_or_self, + Afollowing, + Afollowing_sibling, + Anamespace, + Aparent, + Apreceding, + Apreceding_sibling, + Aself: con iota; + + Xstep: adt { + axis: int; # Aancestor, ... (above) + op: int; # Onametest or Onodetype + ns: string; + name: string; + arg: string; # optional parameter to processing-instruction + preds: cyclic list of ref Xpath; + + text: fn(nil: self ref Xstep): string; + axisname: fn(i: int): string; + }; + + Xpath: adt { + pick{ + E => + op: int; + l, r: cyclic ref Xpath; + Fn => + ns: string; + name: string; + args: cyclic list of ref Xpath; + Var => + ns: string; + name: string; + Path => + abs: int; + steps: list of ref Xstep; + Int => + val: big; + Real => + val: real; + Str => + s: string; + } + text: fn(nil: self ref Xpath): string; + }; + + init: fn(); + framework: fn(s: string): (string, list of (string, string, string), string); + + # predefined schemes + element: fn(s: string): (string, list of int, string); + xmlns: fn(s: string): (string, string, string); + xpointer: fn(s: string): (ref Xpath, string); +}; -- cgit v1.2.3