summaryrefslogtreecommitdiff
path: root/module/xpointers.m
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-22 20:52:35 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-22 20:52:35 +0000
commit46439007cf417cbd9ac8049bb4122c890097a0fa (patch)
tree6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /module/xpointers.m
parent37da2899f40661e3e9631e497da8dc59b971cbd0 (diff)
20060303-partial
Diffstat (limited to 'module/xpointers.m')
-rw-r--r--module/xpointers.m67
1 files changed, 67 insertions, 0 deletions
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);
+};