author | Patrik Svestka <patrik.svestka@gmail.com> |
Wed, 14 Nov 2018 13:01:14 +0100 | |
changeset 642 | 77d5fddb6462 |
parent 454 | a9cd5ea7cc36 |
permissions | -rw-r--r-- |
387
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
1 |
"{ Package: 'stx:goodies/petitparser/islands' }" |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
2 |
|
454
a9cd5ea7cc36
Portability: fixes for Smalltalk/X
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
3 |
"{ NameSpace: Smalltalk }" |
a9cd5ea7cc36
Portability: fixes for Smalltalk/X
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
4 |
|
387
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
5 |
PPCompositeParser subclass:#XmlFeedParser |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
6 |
instanceVariableNames:'item openItem itemContent closeItem openShoplist shoplistContent |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
7 |
closeShoplist shoplist simpleElement stringValue' |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
8 |
classVariableNames:'' |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
9 |
poolDictionaries:'' |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
10 |
category:'PetitIslands-Examples' |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
11 |
! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
12 |
|
642
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
13 |
XmlFeedParser comment:'A XmlFeedParser is Parser of a fake shop feed. Shop feed is a XML file with information about shop products. Shop feed can be malformed (for any reason) the parser will recover from malformed item and will continue on the next valid item. |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
14 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
15 |
Instance Variables |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
16 |
closeItem: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
17 |
closeName: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
18 |
closeShoplist: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
19 |
item: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
20 |
itemContent: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
21 |
name: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
22 |
nameContent: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
23 |
openItem: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
24 |
openName: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
25 |
openShoplist: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
26 |
shoplist: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
27 |
shoplistContent: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
28 |
simpleElement: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
29 |
stringValue: <Object> |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
30 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
31 |
closeItem |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
32 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
33 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
34 |
closeName |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
35 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
36 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
37 |
closeShoplist |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
38 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
39 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
40 |
item |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
41 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
42 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
43 |
itemContent |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
44 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
45 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
46 |
name |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
47 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
48 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
49 |
nameContent |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
50 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
51 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
52 |
openItem |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
53 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
54 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
55 |
openName |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
56 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
57 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
58 |
openShoplist |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
59 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
60 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
61 |
shoplist |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
62 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
63 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
64 |
shoplistContent |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
65 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
66 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
67 |
simpleElement |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
68 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
69 |
|
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
70 |
stringValue |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
71 |
- xxxxx |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
454
diff
changeset
|
72 |
' |
387
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
73 |
! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
74 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
75 |
!XmlFeedParser methodsFor:'grammar'! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
76 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
77 |
item |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
78 |
^ (openItem, itemContent trim, closeItem) trim ==> #second |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
79 |
! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
80 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
81 |
itemContent |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
82 |
^ (simpleElement trim star) ==> self elementsToDictionaryBlock |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
83 |
! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
84 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
85 |
shoplist |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
86 |
^ (openShoplist, shoplistContent, closeShoplist) trim ==> #second |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
87 |
! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
88 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
89 |
shoplistContent |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
90 |
^ (item island ==> #second) star |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
91 |
! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
92 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
93 |
start |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
94 |
^ shoplist |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
95 |
! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
96 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
97 |
stringValue |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
98 |
^ (#letter asParser / #digit asParser) star flatten trim |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
99 |
! ! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
100 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
101 |
!XmlFeedParser methodsFor:'tags'! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
102 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
103 |
closeItem |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
104 |
^ '</' asParser, 'item' asParser trim, '>' asParser |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
105 |
! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
106 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
107 |
closeShoplist |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
108 |
^ '</' asParser, 'shoplist' asParser trim, '>' asParser |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
109 |
! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
110 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
111 |
openItem |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
112 |
^ '<' asParser, 'item' asParser trim, '>' asParser |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
113 |
! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
114 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
115 |
openShoplist |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
116 |
^ '<' asParser, 'shoplist' asParser trim, '>' asParser |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
117 |
! ! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
118 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
119 |
!XmlFeedParser methodsFor:'xmlSupport'! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
120 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
121 |
elementsToDictionaryBlock |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
122 |
^ [ :elements | | d | |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
123 |
d := Dictionary new. |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
124 |
elements do: [ :e | d at: e first asSymbol put: e second ]. |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
125 |
d |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
126 |
] |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
127 |
! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
128 |
|
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
129 |
simpleElement |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
130 |
^ ( |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
131 |
(('<' asParser, stringValue trim, '>' asParser) ==> #second), |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
132 |
stringValue, |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
133 |
(('</' asParser, stringValue trim, '>' asParser) ==> #second) |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
134 |
) ==> [ :elements | |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
135 |
(elements first = elements third) |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
136 |
ifTrue: [ Array with: elements first with: elements second ] |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
137 |
ifFalse: [ PPFailure message: 'malformed element' ] |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
138 |
] |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
139 |
! ! |
e2b2ccaa4de6
Commited a island parser support (MC package PetitIslands)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
140 |