0
|
1 |
"{ Package: 'stx:goodies/xmlsuite/relaxng' }"
|
|
2 |
|
|
3 |
"{ NameSpace: RNG }"
|
|
4 |
|
|
5 |
ContentModelNode subclass:#ChoiceNode
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'Relax NG-Content model'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!ChoiceNode methodsFor:'automaton support'!
|
|
14 |
|
|
15 |
generateTransitionsIn:aContentModelAutomaton
|
|
16 |
|
|
17 |
super generateTransitionsIn:aContentModelAutomaton.
|
|
18 |
|
|
19 |
self children do:[:child|
|
|
20 |
aContentModelAutomaton
|
|
21 |
makeTransitionsFrom:child patternsThatCanBeLast
|
|
22 |
to:self patternsThatCanBeNext
|
|
23 |
]
|
|
24 |
|
|
25 |
"Created: / 30-04-2005 / 21:13:49 / janfrog"
|
|
26 |
!
|
|
27 |
|
|
28 |
patternsThatCanBeFirst
|
|
29 |
"Superclass says that I am responsible to implement this method"
|
|
30 |
|
|
31 |
^self children
|
|
32 |
inject:Set new
|
|
33 |
into:[:set :child| set addAll:(child patternsThatCanBeFirst). set]
|
|
34 |
|
|
35 |
"Created: / 30-04-2005 / 21:04:04 / janfrog"
|
|
36 |
!
|
|
37 |
|
|
38 |
patternsThatCanBeLast
|
|
39 |
"Superclass says that I am responsible to implement this method"
|
|
40 |
|
|
41 |
^self children
|
|
42 |
inject:Set new
|
|
43 |
into:[:set :child| set addAll:(child patternsThatCanBeLast). set]
|
|
44 |
|
|
45 |
"Created: / 30-04-2005 / 21:04:04 / janfrog"
|
|
46 |
! !
|
|
47 |
|
|
48 |
!ChoiceNode methodsFor:'printing'!
|
|
49 |
|
|
50 |
groupModifierCharacter
|
|
51 |
"Superclass says that I am responsible to implement this method"
|
|
52 |
|
|
53 |
^Character space
|
|
54 |
|
|
55 |
"Created: / 30-04-2005 / 18:58:09 / janfrog"
|
|
56 |
!
|
|
57 |
|
|
58 |
printChildrenOn:aStream
|
|
59 |
|
|
60 |
self firstChild isTerminatorNode ifTrue:[
|
|
61 |
^aStream nextPut:$e.
|
|
62 |
].
|
|
63 |
self children
|
|
64 |
do:[:childNode | childNode printOn:aStream ]
|
|
65 |
separatedBy:[
|
|
66 |
aStream
|
|
67 |
space
|
|
68 |
nextPut:$|;
|
|
69 |
space
|
|
70 |
]
|
|
71 |
|
|
72 |
"Created: / 30-04-2005 / 18:58:04 / janfrog"
|
|
73 |
! !
|
|
74 |
|
|
75 |
!ChoiceNode methodsFor:'testing'!
|
|
76 |
|
|
77 |
isChoiceNode
|
|
78 |
^ true
|
|
79 |
|
|
80 |
"Created: / 14-05-2005 / 20:47:45 / janfrog"
|
|
81 |
! !
|
|
82 |
|
|
83 |
!ChoiceNode methodsFor:'visiting'!
|
|
84 |
|
|
85 |
acceptVisitor:aVisitor
|
|
86 |
"Double dispatch back to the visitor, passing my type encoded in
|
|
87 |
the selector (visitor pattern)"
|
|
88 |
|
|
89 |
"stub code automatically generated - please change if required"
|
|
90 |
|
|
91 |
^ aVisitor visitChoiceNode:self
|
|
92 |
|
|
93 |
"Created: / 02-05-2005 / 16:38:45 / janfrog"
|
|
94 |
! !
|
|
95 |
|
|
96 |
!ChoiceNode class methodsFor:'documentation'!
|
|
97 |
|
|
98 |
version
|
|
99 |
^ '$Header: /opt/data/cvs/stx/goodies/xmlsuite/relaxng/RNG__ChoiceNode.st,v 1.1.1.1 2005-11-01 22:07:12 vranyj1 Exp $'
|
|
100 |
! !
|