hutch-xamplr-pp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,62 @@
1
+ #!/usr/local/bin/ruby
2
+ require "xampl-pp-wf"
3
+ #require "xampl-pp"
4
+
5
+ class Chew
6
+
7
+ def resolve(name)
8
+ @resolveRequest = true
9
+ # if not @xpp.standalone then
10
+ # # for the purposes of conformance, accept this since we don't
11
+ # # know if the external subset defines something
12
+ # return "fake it"
13
+ # else
14
+ # return nil
15
+ # end
16
+ end
17
+
18
+ def run
19
+ @allFiles = File.new ARGV[1]
20
+
21
+ while true do
22
+ fileName = @allFiles.gets
23
+ if nil == fileName then
24
+ break
25
+ end
26
+ fileName.chop!
27
+
28
+ @xpp = Xampl_PP.new
29
+ @xpp.input = File.new(fileName)
30
+ @xpp.resolver = self
31
+ @resolveRequest = false
32
+ @xpp.processNamespace = false
33
+ @xpp.reportNamespaceAttributes = false
34
+
35
+ begin
36
+ i = 0
37
+ while not @xpp.endDocument? do
38
+ type = @xpp.nextEvent
39
+ i += 1
40
+ end
41
+ printf("%sPASSED '%s' -- there were %d events\n", (("PASS" == ARGV[0])? " " : "#"), fileName, i)
42
+ rescue RuntimeError => message
43
+ #print message.backtrace.join("\n")
44
+ if @resolveRequest then
45
+ printf("ENTITY [%s] '%s'\n", (("FAIL" == ARGV[0])? " " : "#"), message, fileName)
46
+ else
47
+ printf("%sFAILED [%s] '%s'\n", (("FAIL" == ARGV[0])? " " : "#"), message, fileName)
48
+ end
49
+ rescue Exception => message
50
+ #print message.backtrace.join("\n")
51
+ if @resolveRequest then
52
+ printf("ENTITY [%s] '%s'\n", (("FAIL" == ARGV[0])? " " : "#"), message, fileName)
53
+ else
54
+ printf("%sFAILED [%s] '%s'\n", (("FAIL" == ARGV[0])? " " : "#"), message, fileName)
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+
61
+ chew = Chew.new
62
+ chew.run
@@ -0,0 +1,44 @@
1
+ #!/usr/local/bin/ruby
2
+ require "xppMultibyte"
3
+
4
+ class Chew
5
+
6
+ def resolve(name)
7
+ return "fake it"
8
+ end
9
+
10
+ def run
11
+ @allFiles = File.new ARGV[1]
12
+
13
+ while true do
14
+ fileName = @allFiles.gets
15
+ if nil == fileName then
16
+ break
17
+ end
18
+ fileName.chop!
19
+
20
+ @xpp = Xpp.new
21
+ @xpp.input = File.new(fileName)
22
+ @xpp.resolver = self
23
+ @xpp.processNamespace = false
24
+ @xpp.reportNamespaceAttributes = false
25
+
26
+ begin
27
+ i = 0
28
+ while not @xpp.endDocument? do
29
+ type = @xpp.nextEvent
30
+ i += 1
31
+ end
32
+ printf("%sPASSED '%s' -- there were %d events\n", (("PASS" == ARGV[0])? " " : "#"), fileName, i)
33
+ rescue RuntimeError => message
34
+ printf("%sFAILED [%s] '%s'\n", (("FAIL" == ARGV[0])? " " : "#"), message, fileName)
35
+ rescue Exception => message
36
+ printf("%sFAILED [%s] '%s'\n", (("FAIL" == ARGV[0])? " " : "#"), message, fileName)
37
+ end
38
+ end
39
+ end
40
+ end
41
+
42
+ chew = Chew.new
43
+ chew.run
44
+
@@ -0,0 +1,58 @@
1
+ #!/usr/local/bin/ruby
2
+
3
+ pattern = Regexp.compile(".", nil, 'u')
4
+
5
+ for filename in ARGV do
6
+ printf("file: %s\n", filename)
7
+ file = File.new(filename)
8
+ file.each do
9
+ | line |
10
+ p = 0
11
+ while true do
12
+ line.index(pattern, p)
13
+ if nil == $& then
14
+ break;
15
+ end
16
+ p += $&.length
17
+ $&.each_byte do
18
+ | c |
19
+ printf("%3x ", c)
20
+ end
21
+ printf("-- '%s'\n", $&);
22
+ end
23
+ end
24
+ end
25
+
26
+ def decode(s)
27
+ r = 0
28
+ $&.each_byte do
29
+ | c |
30
+ if c < 0x80 then
31
+ r += c
32
+ elsif
33
+ end
34
+ end
35
+
36
+
37
+ def encode(c)
38
+ if utf8encode then
39
+ if c < 0x80 then
40
+ @textBuffer << c
41
+ elsif c < 0x0800
42
+ @textBuffer << ((c >> 6) | 0xC0)
43
+ @textBuffer << (c & (0x3F | 0x80))
44
+ elsif c < 0x10000
45
+ @textBuffer << ((c >> 12) | 0xE0)
46
+ @textBuffer << ((c >> 6) & (0x3F | 0x80))
47
+ @textBuffer << (c & (0x3F | 0x80))
48
+ else
49
+ @textBuffer << ((c >> 18) | 0xF0)
50
+ @textBuffer << ((c >> 12) & (0x3F | 0x80))
51
+ @textBuffer << ((c >> 6) & (0x3F | 0x80))
52
+ @textBuffer << (c & (0x3F | 0x80))
53
+ end
54
+ else
55
+ @textBuffer << c
56
+ end
57
+ end
58
+
@@ -0,0 +1,67 @@
1
+ Name ::= (Letter | '_' | ':') (NameChar)*
2
+ NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | | CombiningChar | Extender
3
+ Letter ::= BaseChar | Ideographic
4
+ Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
5
+ WhiteSpace ::= x20 | x9 | xD | xA
6
+ Char := x09 | xA | xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
7
+
8
+ Digit ::= [#x0030-#x0039] [#x0660-#x0669] |[#x06F0-#x06F9]
9
+ |[#x0966-#x096F] |[#x09E6-#x09EF] |[#x0A66-#x0A6F] |[#x0AE6-#x0AEF]
10
+ |[#x0B66-#x0B6F] |[#x0BE7-#x0BEF] |[#x0C66-#x0C6F] |[#x0CE6-#x0CEF]
11
+ |[#x0D66-#x0D6F] |[#x0E50-#x0E59] |[#x0ED0-#x0ED9] |[#x0F20-#x0F29]
12
+
13
+ Extender ::= [#x0030-#x0039] |[#x0660-#x0669] |[#x06F0-#x06F9]
14
+ |[#x0966-#x096F] |[#x09E6-#x09EF] |[#x0A66-#x0A6F]
15
+ |[#x0AE6-#x0AEF] |[#x0B66-#x0B6F] |[#x0BE7-#x0BEF]
16
+ |[#x0C66-#x0C6F] |[#x0CE6-#x0CEF] |[#x0D66-#x0D6F]
17
+ |[#x0E50-#x0E59] |[#x0ED0-#x0ED9] |[#x0F20-#x0F29]
18
+ CombiningChar ::=[#x0300-#x0345] |[#x0360-#x0361] |[#x0483-#x0486]
19
+ |[#x0591-#x05A1] |[#x05A3-#x05B9] |[#x05BB-#x05BD]
20
+ |#x05BF |[#x05C1-#x05C2] |#x05C4 |[#x064B-#x0652]
21
+ |#x0670 |[#x06D6-#x06DC] |[#x06DD-#x06DF] |[#x06E0-#x06E4]
22
+ |[#x06E7-#x06E8] |[#x06EA-#x06ED] |[#x0901-#x0903] |#x093C
23
+ |[#x093E-#x094C] |#x094D |[#x0951-#x0954] |[#x0962-#x0963]
24
+ |[#x0981-#x0983] |#x09BC |#x09BE |#x09BF |[#x09C0-#x09C4]
25
+ |[#x09C7-#x09C8] |[#x09CB-#x09CD] |#x09D7 |[#x09E2-#x09E3]
26
+ |#x0A02 |#x0A3C |#x0A3E |#x0A3F |[#x0A40-#x0A42]
27
+ |[#x0A47-#x0A48] |[#x0A4B-#x0A4D] |[#x0A70-#x0A71]
28
+ |[#x0A81-#x0A83] |#x0ABC |[#x0ABE-#x0AC5] |[#x0AC7-#x0AC9]
29
+ |[#x0ACB-#x0ACD] |[#x0B01-#x0B03] |#x0B3C |[#x0B3E-#x0B43]
30
+ |[#x0B47-#x0B48] |[#x0B4B-#x0B4D] |[#x0B56-#x0B57]
31
+ |[#x0B82-#x0B83] |[#x0BBE-#x0BC2] |[#x0BC6-#x0BC8]
32
+ |[#x0BCA-#x0BCD] |#x0BD7 |[#x0C01-#x0C03] |[#x0C3E-#x0C44]
33
+ |[#x0C46-#x0C48] |[#x0C4A-#x0C4D] |[#x0C55-#x0C56]
34
+ |[#x0C82-#x0C83] |[#x0CBE-#x0CC4] |[#x0CC6-#x0CC8]
35
+ |[#x0CCA-#x0CCD] |[#x0CD5-#x0CD6] |[#x0D02-#x0D03]
36
+ |[#x0D3E-#x0D43] |[#x0D46-#x0D48] |[#x0D4A-#x0D4D]
37
+ |#x0D57 |#x0E31 [#x0E34-#x0E3A] |[#x0E47-#x0E4E] |#x0EB1
38
+ |[#x0EB4-#x0EB9] |[#x0EBB-#x0EBC] |[#x0EC8-#x0ECD][#x0F18-#x0F19]
39
+ |#x0F35 |#x0F37 |#x0F39 |#x0F3E |#x0F3F |[#x0F71-#x0F84]
40
+ |[#x0F86-#x0F8B] |[#x0F90-#x0F95] |#x0F97 |[#x0F99-#x0FAD]
41
+ |[#x0FB1-#x0FB7] |#x0FB9 |[#x20D0-#x20DC] |#x20E1
42
+ |[#x302A-#x302F] |#x3099 |#x309A
43
+ BaseChar ::= [#x0300-#x0345] |[#x0360-#x0361] |[#x0483-#x0486] |[#x0591-#x05A1]
44
+ |[#x05A3-#x05B9] |[#x05BB-#x05BD] |#x05BF |[#x05C1-#x05C2]
45
+ |#x05C4 |[#x064B-#x0652] |#x0670 |[#x06D6-#x06DC]
46
+ |[#x06DD-#x06DF] |[#x06E0-#x06E4] |[#x06E7-#x06E8]
47
+ |[#x06EA-#x06ED] |[#x0901-#x0903] |#x093C |[#x093E-#x094C]
48
+ |#x094D |[#x0951-#x0954] |[#x0962-#x0963] |[#x0981-#x0983]
49
+ |#x09BC |#x09BE |#x09BF |[#x09C0-#x09C4] |[#x09C7-#x09C8]
50
+ |[#x09CB-#x09CD] |#x09D7 |[#x09E2-#x09E3] |#x0A02 |#x0A3C
51
+ |#x0A3E |#x0A3F |[#x0A40-#x0A42] |[#x0A47-#x0A48]
52
+ |[#x0A4B-#x0A4D] |[#x0A70-#x0A71] |[#x0A81-#x0A83]
53
+ |#x0ABC |[#x0ABE-#x0AC5] |[#x0AC7-#x0AC9] |[#x0ACB-#x0ACD]
54
+ |[#x0B01-#x0B03] |#x0B3C |[#x0B3E-#x0B43] |[#x0B47-#x0B48]
55
+ |[#x0B4B-#x0B4D] |[#x0B56-#x0B57] |[#x0B82-#x0B83]
56
+ |[#x0BBE-#x0BC2] |[#x0BC6-#x0BC8] |[#x0BCA-#x0BCD] |#x0BD7
57
+ |[#x0C01-#x0C03] |[#x0C3E-#x0C44] |[#x0C46-#x0C48]
58
+ |[#x0C4A-#x0C4D] |[#x0C55-#x0C56] |[#x0C82-#x0C83]
59
+ |[#x0CBE-#x0CC4] |[#x0CC6-#x0CC8] |[#x0CCA-#x0CCD]
60
+ |[#x0CD5-#x0CD6] |[#x0D02-#x0D03] |[#x0D3E-#x0D43]
61
+ |[#x0D46-#x0D48] |[#x0D4A-#x0D4D] |#x0D57 |#x0E31
62
+ |[#x0E34-#x0E3A] |[#x0E47-#x0E4E] |#x0EB1 |[#x0EB4-#x0EB9]
63
+ |[#x0EBB-#x0EBC] |[#x0EC8-#x0ECD]|[#x0F18-#x0F19] |#x0F35
64
+ |#x0F37 |#x0F39 |#x0F3E |#x0F3F |[#x0F71-#x0F84]
65
+ |[#x0F86-#x0F8B] |[#x0F90-#x0F95] |#x0F97 |[#x0F99-#x0FAD]
66
+ |[#x0FB1-#x0FB7] |#x0FB9 |[#x20D0-#x20DC] |#x20E1
67
+ |[#x302A-#x302F] |#x3099 |#x309A