line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#################################################################### |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# This file was generated using Parse::Yapp version 1.05. |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# Don't edit this file, use source file instead. |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# ANY CHANGE MADE HERE WILL BE LOST ! |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
#################################################################### |
10
|
|
|
|
|
|
|
package TM::AsTMa::Fact2; |
11
|
1
|
|
|
1
|
|
1941
|
use vars qw ( @ISA ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
73
|
|
12
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
57
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
@ISA= qw ( Parse::Yapp::Driver ); |
15
|
1
|
|
|
1
|
|
1205
|
use Parse::Yapp::Driver; |
|
1
|
|
|
|
|
2475
|
|
|
1
|
|
|
|
|
3942
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#line 1 "yapp/astma2-fact.yp" |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
use Data::Dumper; |
20
|
|
|
|
|
|
|
use TM; |
21
|
|
|
|
|
|
|
use TM::Literal; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use constant { |
24
|
|
|
|
|
|
|
XSD => 'http://www.w3.org/2001/XMLSchema', |
25
|
|
|
|
|
|
|
XSD_STRING => 'http://www.w3.org/2001/XMLSchema#string', |
26
|
|
|
|
|
|
|
ASTMA => 'http://psi.tm.bond.edu.au/astma/2.0/', |
27
|
|
|
|
|
|
|
ONTOLOGY => 'http://psi.tm.bond.edu.au/astma/2.0/#ontology', |
28
|
|
|
|
|
|
|
TEMPLATE => 'http://psi.tm.bond.edu.au/astma/2.0/#template' |
29
|
|
|
|
|
|
|
}; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _expand_template { |
32
|
|
|
|
|
|
|
my $store = shift; |
33
|
|
|
|
|
|
|
my $ted = shift; |
34
|
|
|
|
|
|
|
my $params = shift; # they are all strings at this level |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#warn "params".Dumper $params; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
my @returns = $store->match (TM->FORALL, type => 'return', irole => 'thing', iplayer => $store->tids ($ted) ) |
39
|
|
|
|
|
|
|
or die "template '$ted' does not have a 'return' characteristic"; |
40
|
|
|
|
|
|
|
#warn Dumper \@returns; |
41
|
|
|
|
|
|
|
my $return = $returns[0]->[TM->PLAYERS]->[1] and (scalar @returns == 1 |
42
|
|
|
|
|
|
|
or die "ambiguous 'return' characteristics for '$ted'"); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my $value = $return->[0] and ($return->[1] eq 'http://www.w3.org/2001/XMLSchema#string' |
45
|
|
|
|
|
|
|
or die "'return' characteristic of '$ted' is no string"); |
46
|
|
|
|
|
|
|
#warn "template id '$ted' >>>$value<<<"; |
47
|
|
|
|
|
|
|
foreach my $p (keys %$params) { |
48
|
|
|
|
|
|
|
$value =~ s/{\s*\$$p\s*}/$params->{$p}/sg; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
#warn "after template id '$ted' >>>$value<<<"; |
51
|
|
|
|
|
|
|
die "variable '$1' in template '$ted' has no value at expansion" if $value =~ /{\s*(\$\w+)\s*}/; |
52
|
|
|
|
|
|
|
return $value; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub new { |
58
|
|
|
|
|
|
|
my $class = shift; |
59
|
|
|
|
|
|
|
my %options = @_; |
60
|
|
|
|
|
|
|
my $store = delete $options{store} || new TM; # the Yapp parser is picky and interprets this :-/ |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
ref($class) and $class=ref($class); |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
my $self = $class->SUPER::new( |
65
|
|
|
|
|
|
|
## yydebug => 0x01, |
66
|
|
|
|
|
|
|
yyversion => '1.05', |
67
|
|
|
|
|
|
|
yystates => |
68
|
|
|
|
|
|
|
[ |
69
|
|
|
|
|
|
|
{#State 0 |
70
|
|
|
|
|
|
|
DEFAULT => -1, |
71
|
|
|
|
|
|
|
GOTOS => { |
72
|
|
|
|
|
|
|
'instance' => 1 |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
}, |
75
|
|
|
|
|
|
|
{#State 1 |
76
|
|
|
|
|
|
|
ACTIONS => { |
77
|
|
|
|
|
|
|
'' => 2, |
78
|
|
|
|
|
|
|
'LOG' => 10, |
79
|
|
|
|
|
|
|
'EOL' => 13, |
80
|
|
|
|
|
|
|
'CANCEL' => 4, |
81
|
|
|
|
|
|
|
'INCLUDE' => 6, |
82
|
|
|
|
|
|
|
'TED' => 5, |
83
|
|
|
|
|
|
|
'ENCODING' => 7, |
84
|
|
|
|
|
|
|
'VERSION' => 11 |
85
|
|
|
|
|
|
|
}, |
86
|
|
|
|
|
|
|
DEFAULT => -4, |
87
|
|
|
|
|
|
|
GOTOS => { |
88
|
|
|
|
|
|
|
'@1-0' => 8, |
89
|
|
|
|
|
|
|
'clause' => 9, |
90
|
|
|
|
|
|
|
'template_expansion' => 3, |
91
|
|
|
|
|
|
|
'directive' => 12 |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
}, |
94
|
|
|
|
|
|
|
{#State 2 |
95
|
|
|
|
|
|
|
DEFAULT => 0 |
96
|
|
|
|
|
|
|
}, |
97
|
|
|
|
|
|
|
{#State 3 |
98
|
|
|
|
|
|
|
DEFAULT => -6 |
99
|
|
|
|
|
|
|
}, |
100
|
|
|
|
|
|
|
{#State 4 |
101
|
|
|
|
|
|
|
DEFAULT => -8 |
102
|
|
|
|
|
|
|
}, |
103
|
|
|
|
|
|
|
{#State 5 |
104
|
|
|
|
|
|
|
ACTIONS => { |
105
|
|
|
|
|
|
|
'LPAREN' => 14 |
106
|
|
|
|
|
|
|
}, |
107
|
|
|
|
|
|
|
DEFAULT => -14, |
108
|
|
|
|
|
|
|
GOTOS => { |
109
|
|
|
|
|
|
|
'parameters' => 15 |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
}, |
112
|
|
|
|
|
|
|
{#State 6 |
113
|
|
|
|
|
|
|
DEFAULT => -11 |
114
|
|
|
|
|
|
|
}, |
115
|
|
|
|
|
|
|
{#State 7 |
116
|
|
|
|
|
|
|
DEFAULT => -12 |
117
|
|
|
|
|
|
|
}, |
118
|
|
|
|
|
|
|
{#State 8 |
119
|
|
|
|
|
|
|
ACTIONS => { |
120
|
|
|
|
|
|
|
'BRA' => 17 |
121
|
|
|
|
|
|
|
}, |
122
|
|
|
|
|
|
|
DEFAULT => -22, |
123
|
|
|
|
|
|
|
GOTOS => { |
124
|
|
|
|
|
|
|
'@3-0' => 18, |
125
|
|
|
|
|
|
|
'topic' => 16, |
126
|
|
|
|
|
|
|
'theme' => 19 |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
}, |
129
|
|
|
|
|
|
|
{#State 9 |
130
|
|
|
|
|
|
|
DEFAULT => -3 |
131
|
|
|
|
|
|
|
}, |
132
|
|
|
|
|
|
|
{#State 10 |
133
|
|
|
|
|
|
|
DEFAULT => -9 |
134
|
|
|
|
|
|
|
}, |
135
|
|
|
|
|
|
|
{#State 11 |
136
|
|
|
|
|
|
|
DEFAULT => -10 |
137
|
|
|
|
|
|
|
}, |
138
|
|
|
|
|
|
|
{#State 12 |
139
|
|
|
|
|
|
|
DEFAULT => -7 |
140
|
|
|
|
|
|
|
}, |
141
|
|
|
|
|
|
|
{#State 13 |
142
|
|
|
|
|
|
|
DEFAULT => -2 |
143
|
|
|
|
|
|
|
}, |
144
|
|
|
|
|
|
|
{#State 14 |
145
|
|
|
|
|
|
|
ACTIONS => { |
146
|
|
|
|
|
|
|
'ID' => 20 |
147
|
|
|
|
|
|
|
}, |
148
|
|
|
|
|
|
|
GOTOS => { |
149
|
|
|
|
|
|
|
'bindings' => 21, |
150
|
|
|
|
|
|
|
'binding' => 22 |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
}, |
153
|
|
|
|
|
|
|
{#State 15 |
154
|
|
|
|
|
|
|
DEFAULT => -13 |
155
|
|
|
|
|
|
|
}, |
156
|
|
|
|
|
|
|
{#State 16 |
157
|
|
|
|
|
|
|
DEFAULT => -21 |
158
|
|
|
|
|
|
|
}, |
159
|
|
|
|
|
|
|
{#State 17 |
160
|
|
|
|
|
|
|
DEFAULT => -22, |
161
|
|
|
|
|
|
|
GOTOS => { |
162
|
|
|
|
|
|
|
'@3-0' => 18, |
163
|
|
|
|
|
|
|
'topic' => 23 |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
}, |
166
|
|
|
|
|
|
|
{#State 18 |
167
|
|
|
|
|
|
|
DEFAULT => -44, |
168
|
|
|
|
|
|
|
GOTOS => { |
169
|
|
|
|
|
|
|
'attachments' => 24 |
170
|
|
|
|
|
|
|
} |
171
|
|
|
|
|
|
|
}, |
172
|
|
|
|
|
|
|
{#State 19 |
173
|
|
|
|
|
|
|
ACTIONS => { |
174
|
|
|
|
|
|
|
'DOT' => 25 |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
}, |
177
|
|
|
|
|
|
|
{#State 20 |
178
|
|
|
|
|
|
|
ACTIONS => { |
179
|
|
|
|
|
|
|
'COLON' => 26 |
180
|
|
|
|
|
|
|
} |
181
|
|
|
|
|
|
|
}, |
182
|
|
|
|
|
|
|
{#State 21 |
183
|
|
|
|
|
|
|
ACTIONS => { |
184
|
|
|
|
|
|
|
'RPAREN' => 27, |
185
|
|
|
|
|
|
|
'COMMA' => 28 |
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
}, |
188
|
|
|
|
|
|
|
{#State 22 |
189
|
|
|
|
|
|
|
DEFAULT => -16 |
190
|
|
|
|
|
|
|
}, |
191
|
|
|
|
|
|
|
{#State 23 |
192
|
|
|
|
|
|
|
ACTIONS => { |
193
|
|
|
|
|
|
|
'KET' => 29 |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
}, |
196
|
|
|
|
|
|
|
{#State 24 |
197
|
|
|
|
|
|
|
ACTIONS => { |
198
|
|
|
|
|
|
|
'ID' => 30, |
199
|
|
|
|
|
|
|
'HAS' => 31, |
200
|
|
|
|
|
|
|
'DATE' => 32, |
201
|
|
|
|
|
|
|
'WILDCARD' => 33, |
202
|
|
|
|
|
|
|
'WHICH' => 35, |
203
|
|
|
|
|
|
|
'EQUAL' => 36, |
204
|
|
|
|
|
|
|
'EOL' => 38, |
205
|
|
|
|
|
|
|
'SUBCL' => 39, |
206
|
|
|
|
|
|
|
'REIFIES' => 40, |
207
|
|
|
|
|
|
|
'URI' => 41, |
208
|
|
|
|
|
|
|
'TED' => 45, |
209
|
|
|
|
|
|
|
'ISA' => 46, |
210
|
|
|
|
|
|
|
'TILDE' => 47 |
211
|
|
|
|
|
|
|
}, |
212
|
|
|
|
|
|
|
DEFAULT => -24, |
213
|
|
|
|
|
|
|
GOTOS => { |
214
|
|
|
|
|
|
|
'expansion' => 42, |
215
|
|
|
|
|
|
|
'predefined_inlines' => 43, |
216
|
|
|
|
|
|
|
'association' => 37, |
217
|
|
|
|
|
|
|
'identification' => 44, |
218
|
|
|
|
|
|
|
'tid' => 34 |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
}, |
221
|
|
|
|
|
|
|
{#State 25 |
222
|
|
|
|
|
|
|
DEFAULT => -5 |
223
|
|
|
|
|
|
|
}, |
224
|
|
|
|
|
|
|
{#State 26 |
225
|
|
|
|
|
|
|
DEFAULT => -18, |
226
|
|
|
|
|
|
|
GOTOS => { |
227
|
|
|
|
|
|
|
'@2-2' => 48 |
228
|
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
}, |
230
|
|
|
|
|
|
|
{#State 27 |
231
|
|
|
|
|
|
|
DEFAULT => -15 |
232
|
|
|
|
|
|
|
}, |
233
|
|
|
|
|
|
|
{#State 28 |
234
|
|
|
|
|
|
|
ACTIONS => { |
235
|
|
|
|
|
|
|
'ID' => 20 |
236
|
|
|
|
|
|
|
}, |
237
|
|
|
|
|
|
|
GOTOS => { |
238
|
|
|
|
|
|
|
'binding' => 49 |
239
|
|
|
|
|
|
|
} |
240
|
|
|
|
|
|
|
}, |
241
|
|
|
|
|
|
|
{#State 29 |
242
|
|
|
|
|
|
|
DEFAULT => -20 |
243
|
|
|
|
|
|
|
}, |
244
|
|
|
|
|
|
|
{#State 30 |
245
|
|
|
|
|
|
|
DEFAULT => -68 |
246
|
|
|
|
|
|
|
}, |
247
|
|
|
|
|
|
|
{#State 31 |
248
|
|
|
|
|
|
|
ACTIONS => { |
249
|
|
|
|
|
|
|
'ID' => 30, |
250
|
|
|
|
|
|
|
'URI' => 41, |
251
|
|
|
|
|
|
|
'EQUAL' => 36, |
252
|
|
|
|
|
|
|
'TILDE' => 47, |
253
|
|
|
|
|
|
|
'DATE' => 32, |
254
|
|
|
|
|
|
|
'WILDCARD' => 33 |
255
|
|
|
|
|
|
|
}, |
256
|
|
|
|
|
|
|
GOTOS => { |
257
|
|
|
|
|
|
|
'characteristic' => 51, |
258
|
|
|
|
|
|
|
'tid' => 50 |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
}, |
261
|
|
|
|
|
|
|
{#State 32 |
262
|
|
|
|
|
|
|
DEFAULT => -70 |
263
|
|
|
|
|
|
|
}, |
264
|
|
|
|
|
|
|
{#State 33 |
265
|
|
|
|
|
|
|
DEFAULT => -69 |
266
|
|
|
|
|
|
|
}, |
267
|
|
|
|
|
|
|
{#State 34 |
268
|
|
|
|
|
|
|
DEFAULT => -61 |
269
|
|
|
|
|
|
|
}, |
270
|
|
|
|
|
|
|
{#State 35 |
271
|
|
|
|
|
|
|
ACTIONS => { |
272
|
|
|
|
|
|
|
'TED' => 45, |
273
|
|
|
|
|
|
|
'HAS' => 52, |
274
|
|
|
|
|
|
|
'ISA' => 46, |
275
|
|
|
|
|
|
|
'SUBCL' => 39 |
276
|
|
|
|
|
|
|
}, |
277
|
|
|
|
|
|
|
GOTOS => { |
278
|
|
|
|
|
|
|
'expansion' => 53, |
279
|
|
|
|
|
|
|
'predefined_inlines' => 43 |
280
|
|
|
|
|
|
|
} |
281
|
|
|
|
|
|
|
}, |
282
|
|
|
|
|
|
|
{#State 36 |
283
|
|
|
|
|
|
|
ACTIONS => { |
284
|
|
|
|
|
|
|
'URI' => 54 |
285
|
|
|
|
|
|
|
} |
286
|
|
|
|
|
|
|
}, |
287
|
|
|
|
|
|
|
{#State 37 |
288
|
|
|
|
|
|
|
DEFAULT => -23 |
289
|
|
|
|
|
|
|
}, |
290
|
|
|
|
|
|
|
{#State 38 |
291
|
|
|
|
|
|
|
ACTIONS => { |
292
|
|
|
|
|
|
|
'ID' => 30, |
293
|
|
|
|
|
|
|
'URI' => 41, |
294
|
|
|
|
|
|
|
'EQUAL' => 36, |
295
|
|
|
|
|
|
|
'TILDE' => 47, |
296
|
|
|
|
|
|
|
'DATE' => 32, |
297
|
|
|
|
|
|
|
'WILDCARD' => 33 |
298
|
|
|
|
|
|
|
}, |
299
|
|
|
|
|
|
|
GOTOS => { |
300
|
|
|
|
|
|
|
'identification' => 55, |
301
|
|
|
|
|
|
|
'tid' => 34 |
302
|
|
|
|
|
|
|
} |
303
|
|
|
|
|
|
|
}, |
304
|
|
|
|
|
|
|
{#State 39 |
305
|
|
|
|
|
|
|
DEFAULT => -56 |
306
|
|
|
|
|
|
|
}, |
307
|
|
|
|
|
|
|
{#State 40 |
308
|
|
|
|
|
|
|
DEFAULT => -25, |
309
|
|
|
|
|
|
|
GOTOS => { |
310
|
|
|
|
|
|
|
'@4-1' => 56 |
311
|
|
|
|
|
|
|
} |
312
|
|
|
|
|
|
|
}, |
313
|
|
|
|
|
|
|
{#State 41 |
314
|
|
|
|
|
|
|
DEFAULT => -73 |
315
|
|
|
|
|
|
|
}, |
316
|
|
|
|
|
|
|
{#State 42 |
317
|
|
|
|
|
|
|
DEFAULT => -47 |
318
|
|
|
|
|
|
|
}, |
319
|
|
|
|
|
|
|
{#State 43 |
320
|
|
|
|
|
|
|
ACTIONS => { |
321
|
|
|
|
|
|
|
'LPAREN' => 14 |
322
|
|
|
|
|
|
|
}, |
323
|
|
|
|
|
|
|
DEFAULT => -14, |
324
|
|
|
|
|
|
|
GOTOS => { |
325
|
|
|
|
|
|
|
'parameters' => 57 |
326
|
|
|
|
|
|
|
} |
327
|
|
|
|
|
|
|
}, |
328
|
|
|
|
|
|
|
{#State 44 |
329
|
|
|
|
|
|
|
DEFAULT => -49 |
330
|
|
|
|
|
|
|
}, |
331
|
|
|
|
|
|
|
{#State 45 |
332
|
|
|
|
|
|
|
DEFAULT => -57 |
333
|
|
|
|
|
|
|
}, |
334
|
|
|
|
|
|
|
{#State 46 |
335
|
|
|
|
|
|
|
DEFAULT => -55 |
336
|
|
|
|
|
|
|
}, |
337
|
|
|
|
|
|
|
{#State 47 |
338
|
|
|
|
|
|
|
ACTIONS => { |
339
|
|
|
|
|
|
|
'URI' => 58 |
340
|
|
|
|
|
|
|
} |
341
|
|
|
|
|
|
|
}, |
342
|
|
|
|
|
|
|
{#State 48 |
343
|
|
|
|
|
|
|
ACTIONS => { |
344
|
|
|
|
|
|
|
'VALUE' => 59 |
345
|
|
|
|
|
|
|
} |
346
|
|
|
|
|
|
|
}, |
347
|
|
|
|
|
|
|
{#State 49 |
348
|
|
|
|
|
|
|
DEFAULT => -17 |
349
|
|
|
|
|
|
|
}, |
350
|
|
|
|
|
|
|
{#State 50 |
351
|
|
|
|
|
|
|
ACTIONS => { |
352
|
|
|
|
|
|
|
'AT' => 60 |
353
|
|
|
|
|
|
|
}, |
354
|
|
|
|
|
|
|
DEFAULT => -64, |
355
|
|
|
|
|
|
|
GOTOS => { |
356
|
|
|
|
|
|
|
'scope' => 61 |
357
|
|
|
|
|
|
|
} |
358
|
|
|
|
|
|
|
}, |
359
|
|
|
|
|
|
|
{#State 51 |
360
|
|
|
|
|
|
|
DEFAULT => -45 |
361
|
|
|
|
|
|
|
}, |
362
|
|
|
|
|
|
|
{#State 52 |
363
|
|
|
|
|
|
|
ACTIONS => { |
364
|
|
|
|
|
|
|
'ID' => 30, |
365
|
|
|
|
|
|
|
'URI' => 41, |
366
|
|
|
|
|
|
|
'EQUAL' => 36, |
367
|
|
|
|
|
|
|
'TILDE' => 47, |
368
|
|
|
|
|
|
|
'DATE' => 32, |
369
|
|
|
|
|
|
|
'WILDCARD' => 33 |
370
|
|
|
|
|
|
|
}, |
371
|
|
|
|
|
|
|
GOTOS => { |
372
|
|
|
|
|
|
|
'characteristic' => 62, |
373
|
|
|
|
|
|
|
'tid' => 50 |
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
}, |
376
|
|
|
|
|
|
|
{#State 53 |
377
|
|
|
|
|
|
|
DEFAULT => -48 |
378
|
|
|
|
|
|
|
}, |
379
|
|
|
|
|
|
|
{#State 54 |
380
|
|
|
|
|
|
|
DEFAULT => -71 |
381
|
|
|
|
|
|
|
}, |
382
|
|
|
|
|
|
|
{#State 55 |
383
|
|
|
|
|
|
|
DEFAULT => -50 |
384
|
|
|
|
|
|
|
}, |
385
|
|
|
|
|
|
|
{#State 56 |
386
|
|
|
|
|
|
|
ACTIONS => { |
387
|
|
|
|
|
|
|
'ID' => 30, |
388
|
|
|
|
|
|
|
'URI' => 41, |
389
|
|
|
|
|
|
|
'EQUAL' => 36, |
390
|
|
|
|
|
|
|
'TILDE' => 47, |
391
|
|
|
|
|
|
|
'DATE' => 32, |
392
|
|
|
|
|
|
|
'WILDCARD' => 33 |
393
|
|
|
|
|
|
|
}, |
394
|
|
|
|
|
|
|
GOTOS => { |
395
|
|
|
|
|
|
|
'identification' => 63, |
396
|
|
|
|
|
|
|
'tid' => 34 |
397
|
|
|
|
|
|
|
} |
398
|
|
|
|
|
|
|
}, |
399
|
|
|
|
|
|
|
{#State 57 |
400
|
|
|
|
|
|
|
DEFAULT => -58, |
401
|
|
|
|
|
|
|
GOTOS => { |
402
|
|
|
|
|
|
|
'@10-2' => 64 |
403
|
|
|
|
|
|
|
} |
404
|
|
|
|
|
|
|
}, |
405
|
|
|
|
|
|
|
{#State 58 |
406
|
|
|
|
|
|
|
DEFAULT => -72 |
407
|
|
|
|
|
|
|
}, |
408
|
|
|
|
|
|
|
{#State 59 |
409
|
|
|
|
|
|
|
DEFAULT => -19 |
410
|
|
|
|
|
|
|
}, |
411
|
|
|
|
|
|
|
{#State 60 |
412
|
|
|
|
|
|
|
ACTIONS => { |
413
|
|
|
|
|
|
|
'ID' => 30, |
414
|
|
|
|
|
|
|
'URI' => 41, |
415
|
|
|
|
|
|
|
'EQUAL' => 36, |
416
|
|
|
|
|
|
|
'TILDE' => 47, |
417
|
|
|
|
|
|
|
'DATE' => 32, |
418
|
|
|
|
|
|
|
'WILDCARD' => 33 |
419
|
|
|
|
|
|
|
}, |
420
|
|
|
|
|
|
|
GOTOS => { |
421
|
|
|
|
|
|
|
'tid' => 65 |
422
|
|
|
|
|
|
|
} |
423
|
|
|
|
|
|
|
}, |
424
|
|
|
|
|
|
|
{#State 61 |
425
|
|
|
|
|
|
|
ACTIONS => { |
426
|
|
|
|
|
|
|
'SUBCL' => 66 |
427
|
|
|
|
|
|
|
}, |
428
|
|
|
|
|
|
|
DEFAULT => -66, |
429
|
|
|
|
|
|
|
GOTOS => { |
430
|
|
|
|
|
|
|
'type' => 67 |
431
|
|
|
|
|
|
|
} |
432
|
|
|
|
|
|
|
}, |
433
|
|
|
|
|
|
|
{#State 62 |
434
|
|
|
|
|
|
|
DEFAULT => -46 |
435
|
|
|
|
|
|
|
}, |
436
|
|
|
|
|
|
|
{#State 63 |
437
|
|
|
|
|
|
|
DEFAULT => -26, |
438
|
|
|
|
|
|
|
GOTOS => { |
439
|
|
|
|
|
|
|
'@5-3' => 68 |
440
|
|
|
|
|
|
|
} |
441
|
|
|
|
|
|
|
}, |
442
|
|
|
|
|
|
|
{#State 64 |
443
|
|
|
|
|
|
|
ACTIONS => { |
444
|
|
|
|
|
|
|
'ID' => 30, |
445
|
|
|
|
|
|
|
'URI' => 41, |
446
|
|
|
|
|
|
|
'EQUAL' => 36, |
447
|
|
|
|
|
|
|
'TILDE' => 47, |
448
|
|
|
|
|
|
|
'DATE' => 32, |
449
|
|
|
|
|
|
|
'WILDCARD' => 33 |
450
|
|
|
|
|
|
|
}, |
451
|
|
|
|
|
|
|
GOTOS => { |
452
|
|
|
|
|
|
|
'identification' => 69, |
453
|
|
|
|
|
|
|
'tid' => 34 |
454
|
|
|
|
|
|
|
} |
455
|
|
|
|
|
|
|
}, |
456
|
|
|
|
|
|
|
{#State 65 |
457
|
|
|
|
|
|
|
DEFAULT => -65 |
458
|
|
|
|
|
|
|
}, |
459
|
|
|
|
|
|
|
{#State 66 |
460
|
|
|
|
|
|
|
ACTIONS => { |
461
|
|
|
|
|
|
|
'ID' => 30, |
462
|
|
|
|
|
|
|
'URI' => 41, |
463
|
|
|
|
|
|
|
'EQUAL' => 36, |
464
|
|
|
|
|
|
|
'TILDE' => 47, |
465
|
|
|
|
|
|
|
'DATE' => 32, |
466
|
|
|
|
|
|
|
'WILDCARD' => 33 |
467
|
|
|
|
|
|
|
}, |
468
|
|
|
|
|
|
|
GOTOS => { |
469
|
|
|
|
|
|
|
'tid' => 70 |
470
|
|
|
|
|
|
|
} |
471
|
|
|
|
|
|
|
}, |
472
|
|
|
|
|
|
|
{#State 67 |
473
|
|
|
|
|
|
|
ACTIONS => { |
474
|
|
|
|
|
|
|
'COLON' => 71 |
475
|
|
|
|
|
|
|
} |
476
|
|
|
|
|
|
|
}, |
477
|
|
|
|
|
|
|
{#State 68 |
478
|
|
|
|
|
|
|
ACTIONS => { |
479
|
|
|
|
|
|
|
'AT' => 60 |
480
|
|
|
|
|
|
|
}, |
481
|
|
|
|
|
|
|
DEFAULT => -64, |
482
|
|
|
|
|
|
|
GOTOS => { |
483
|
|
|
|
|
|
|
'scope' => 72 |
484
|
|
|
|
|
|
|
} |
485
|
|
|
|
|
|
|
}, |
486
|
|
|
|
|
|
|
{#State 69 |
487
|
|
|
|
|
|
|
DEFAULT => -59, |
488
|
|
|
|
|
|
|
GOTOS => { |
489
|
|
|
|
|
|
|
'@11-4' => 73 |
490
|
|
|
|
|
|
|
} |
491
|
|
|
|
|
|
|
}, |
492
|
|
|
|
|
|
|
{#State 70 |
493
|
|
|
|
|
|
|
DEFAULT => -67 |
494
|
|
|
|
|
|
|
}, |
495
|
|
|
|
|
|
|
{#State 71 |
496
|
|
|
|
|
|
|
DEFAULT => -62, |
497
|
|
|
|
|
|
|
GOTOS => { |
498
|
|
|
|
|
|
|
'@12-4' => 74 |
499
|
|
|
|
|
|
|
} |
500
|
|
|
|
|
|
|
}, |
501
|
|
|
|
|
|
|
{#State 72 |
502
|
|
|
|
|
|
|
ACTIONS => { |
503
|
|
|
|
|
|
|
'LPAREN' => 75, |
504
|
|
|
|
|
|
|
'EOL' => 76 |
505
|
|
|
|
|
|
|
}, |
506
|
|
|
|
|
|
|
GOTOS => { |
507
|
|
|
|
|
|
|
'rolesin' => 77 |
508
|
|
|
|
|
|
|
} |
509
|
|
|
|
|
|
|
}, |
510
|
|
|
|
|
|
|
{#State 73 |
511
|
|
|
|
|
|
|
ACTIONS => { |
512
|
|
|
|
|
|
|
'DOWNCOMMA' => 79 |
513
|
|
|
|
|
|
|
}, |
514
|
|
|
|
|
|
|
DEFAULT => -51, |
515
|
|
|
|
|
|
|
GOTOS => { |
516
|
|
|
|
|
|
|
'relative' => 78 |
517
|
|
|
|
|
|
|
} |
518
|
|
|
|
|
|
|
}, |
519
|
|
|
|
|
|
|
{#State 74 |
520
|
|
|
|
|
|
|
ACTIONS => { |
521
|
|
|
|
|
|
|
'VALUE' => 80 |
522
|
|
|
|
|
|
|
} |
523
|
|
|
|
|
|
|
}, |
524
|
|
|
|
|
|
|
{#State 75 |
525
|
|
|
|
|
|
|
DEFAULT => -28 |
526
|
|
|
|
|
|
|
}, |
527
|
|
|
|
|
|
|
{#State 76 |
528
|
|
|
|
|
|
|
DEFAULT => -29 |
529
|
|
|
|
|
|
|
}, |
530
|
|
|
|
|
|
|
{#State 77 |
531
|
|
|
|
|
|
|
DEFAULT => -22, |
532
|
|
|
|
|
|
|
GOTOS => { |
533
|
|
|
|
|
|
|
'@3-0' => 18, |
534
|
|
|
|
|
|
|
'roles' => 82, |
535
|
|
|
|
|
|
|
'topic' => 81, |
536
|
|
|
|
|
|
|
'role' => 83 |
537
|
|
|
|
|
|
|
} |
538
|
|
|
|
|
|
|
}, |
539
|
|
|
|
|
|
|
{#State 78 |
540
|
|
|
|
|
|
|
DEFAULT => -60 |
541
|
|
|
|
|
|
|
}, |
542
|
|
|
|
|
|
|
{#State 79 |
543
|
|
|
|
|
|
|
DEFAULT => -44, |
544
|
|
|
|
|
|
|
GOTOS => { |
545
|
|
|
|
|
|
|
'attachments' => 84 |
546
|
|
|
|
|
|
|
} |
547
|
|
|
|
|
|
|
}, |
548
|
|
|
|
|
|
|
{#State 80 |
549
|
|
|
|
|
|
|
DEFAULT => -63 |
550
|
|
|
|
|
|
|
}, |
551
|
|
|
|
|
|
|
{#State 81 |
552
|
|
|
|
|
|
|
DEFAULT => -37, |
553
|
|
|
|
|
|
|
GOTOS => { |
554
|
|
|
|
|
|
|
'@6-1' => 85 |
555
|
|
|
|
|
|
|
} |
556
|
|
|
|
|
|
|
}, |
557
|
|
|
|
|
|
|
{#State 82 |
558
|
|
|
|
|
|
|
ACTIONS => { |
559
|
|
|
|
|
|
|
'RPAREN' => 86, |
560
|
|
|
|
|
|
|
'COMMA' => 88, |
561
|
|
|
|
|
|
|
'EOL' => 87 |
562
|
|
|
|
|
|
|
}, |
563
|
|
|
|
|
|
|
DEFAULT => -30, |
564
|
|
|
|
|
|
|
GOTOS => { |
565
|
|
|
|
|
|
|
'rolesout' => 89, |
566
|
|
|
|
|
|
|
'rolesep' => 90 |
567
|
|
|
|
|
|
|
} |
568
|
|
|
|
|
|
|
}, |
569
|
|
|
|
|
|
|
{#State 83 |
570
|
|
|
|
|
|
|
DEFAULT => -35 |
571
|
|
|
|
|
|
|
}, |
572
|
|
|
|
|
|
|
{#State 84 |
573
|
|
|
|
|
|
|
ACTIONS => { |
574
|
|
|
|
|
|
|
'ID' => 30, |
575
|
|
|
|
|
|
|
'HAS' => 31, |
576
|
|
|
|
|
|
|
'DATE' => 32, |
577
|
|
|
|
|
|
|
'WILDCARD' => 33, |
578
|
|
|
|
|
|
|
'WHICH' => 35, |
579
|
|
|
|
|
|
|
'EQUAL' => 36, |
580
|
|
|
|
|
|
|
'EOL' => 38, |
581
|
|
|
|
|
|
|
'SUBCL' => 39, |
582
|
|
|
|
|
|
|
'URI' => 41, |
583
|
|
|
|
|
|
|
'COMMA' => 92, |
584
|
|
|
|
|
|
|
'TED' => 45, |
585
|
|
|
|
|
|
|
'TILDE' => 47, |
586
|
|
|
|
|
|
|
'ISA' => 46 |
587
|
|
|
|
|
|
|
}, |
588
|
|
|
|
|
|
|
DEFAULT => -53, |
589
|
|
|
|
|
|
|
GOTOS => { |
590
|
|
|
|
|
|
|
'expansion' => 42, |
591
|
|
|
|
|
|
|
'upcomma' => 91, |
592
|
|
|
|
|
|
|
'predefined_inlines' => 43, |
593
|
|
|
|
|
|
|
'identification' => 44, |
594
|
|
|
|
|
|
|
'tid' => 34 |
595
|
|
|
|
|
|
|
} |
596
|
|
|
|
|
|
|
}, |
597
|
|
|
|
|
|
|
{#State 85 |
598
|
|
|
|
|
|
|
ACTIONS => { |
599
|
|
|
|
|
|
|
'COLON' => 93 |
600
|
|
|
|
|
|
|
} |
601
|
|
|
|
|
|
|
}, |
602
|
|
|
|
|
|
|
{#State 86 |
603
|
|
|
|
|
|
|
DEFAULT => -31 |
604
|
|
|
|
|
|
|
}, |
605
|
|
|
|
|
|
|
{#State 87 |
606
|
|
|
|
|
|
|
ACTIONS => { |
607
|
|
|
|
|
|
|
'COLON' => -32, |
608
|
|
|
|
|
|
|
'DOT' => -32, |
609
|
|
|
|
|
|
|
'KET' => -32 |
610
|
|
|
|
|
|
|
}, |
611
|
|
|
|
|
|
|
DEFAULT => -34 |
612
|
|
|
|
|
|
|
}, |
613
|
|
|
|
|
|
|
{#State 88 |
614
|
|
|
|
|
|
|
DEFAULT => -33 |
615
|
|
|
|
|
|
|
}, |
616
|
|
|
|
|
|
|
{#State 89 |
617
|
|
|
|
|
|
|
DEFAULT => -27 |
618
|
|
|
|
|
|
|
}, |
619
|
|
|
|
|
|
|
{#State 90 |
620
|
|
|
|
|
|
|
DEFAULT => -22, |
621
|
|
|
|
|
|
|
GOTOS => { |
622
|
|
|
|
|
|
|
'@3-0' => 18, |
623
|
|
|
|
|
|
|
'topic' => 81, |
624
|
|
|
|
|
|
|
'role' => 94 |
625
|
|
|
|
|
|
|
} |
626
|
|
|
|
|
|
|
}, |
627
|
|
|
|
|
|
|
{#State 91 |
628
|
|
|
|
|
|
|
DEFAULT => -52 |
629
|
|
|
|
|
|
|
}, |
630
|
|
|
|
|
|
|
{#State 92 |
631
|
|
|
|
|
|
|
DEFAULT => -54 |
632
|
|
|
|
|
|
|
}, |
633
|
|
|
|
|
|
|
{#State 93 |
634
|
|
|
|
|
|
|
DEFAULT => -38, |
635
|
|
|
|
|
|
|
GOTOS => { |
636
|
|
|
|
|
|
|
'@7-3' => 95 |
637
|
|
|
|
|
|
|
} |
638
|
|
|
|
|
|
|
}, |
639
|
|
|
|
|
|
|
{#State 94 |
640
|
|
|
|
|
|
|
DEFAULT => -36 |
641
|
|
|
|
|
|
|
}, |
642
|
|
|
|
|
|
|
{#State 95 |
643
|
|
|
|
|
|
|
ACTIONS => { |
644
|
|
|
|
|
|
|
'ID' => 30, |
645
|
|
|
|
|
|
|
'URI' => 41, |
646
|
|
|
|
|
|
|
'EQUAL' => 36, |
647
|
|
|
|
|
|
|
'TILDE' => 47, |
648
|
|
|
|
|
|
|
'DATE' => 32, |
649
|
|
|
|
|
|
|
'WILDCARD' => 33 |
650
|
|
|
|
|
|
|
}, |
651
|
|
|
|
|
|
|
GOTOS => { |
652
|
|
|
|
|
|
|
'identification' => 97, |
653
|
|
|
|
|
|
|
'identifications' => 96, |
654
|
|
|
|
|
|
|
'tid' => 34 |
655
|
|
|
|
|
|
|
} |
656
|
|
|
|
|
|
|
}, |
657
|
|
|
|
|
|
|
{#State 96 |
658
|
|
|
|
|
|
|
ACTIONS => { |
659
|
|
|
|
|
|
|
'ID' => 30, |
660
|
|
|
|
|
|
|
'URI' => 41, |
661
|
|
|
|
|
|
|
'DATE' => 32, |
662
|
|
|
|
|
|
|
'WILDCARD' => 33, |
663
|
|
|
|
|
|
|
'EQUAL' => 36, |
664
|
|
|
|
|
|
|
'TILDE' => 47 |
665
|
|
|
|
|
|
|
}, |
666
|
|
|
|
|
|
|
DEFAULT => -39, |
667
|
|
|
|
|
|
|
GOTOS => { |
668
|
|
|
|
|
|
|
'identification' => 98, |
669
|
|
|
|
|
|
|
'tid' => 34 |
670
|
|
|
|
|
|
|
} |
671
|
|
|
|
|
|
|
}, |
672
|
|
|
|
|
|
|
{#State 97 |
673
|
|
|
|
|
|
|
DEFAULT => -40, |
674
|
|
|
|
|
|
|
GOTOS => { |
675
|
|
|
|
|
|
|
'@8-1' => 99 |
676
|
|
|
|
|
|
|
} |
677
|
|
|
|
|
|
|
}, |
678
|
|
|
|
|
|
|
{#State 98 |
679
|
|
|
|
|
|
|
DEFAULT => -42, |
680
|
|
|
|
|
|
|
GOTOS => { |
681
|
|
|
|
|
|
|
'@9-2' => 100 |
682
|
|
|
|
|
|
|
} |
683
|
|
|
|
|
|
|
}, |
684
|
|
|
|
|
|
|
{#State 99 |
685
|
|
|
|
|
|
|
DEFAULT => -41 |
686
|
|
|
|
|
|
|
}, |
687
|
|
|
|
|
|
|
{#State 100 |
688
|
|
|
|
|
|
|
DEFAULT => -43 |
689
|
|
|
|
|
|
|
} |
690
|
|
|
|
|
|
|
], |
691
|
|
|
|
|
|
|
yyrules => |
692
|
|
|
|
|
|
|
[ |
693
|
|
|
|
|
|
|
[#Rule 0 |
694
|
|
|
|
|
|
|
'$start', 2, undef |
695
|
|
|
|
|
|
|
], |
696
|
|
|
|
|
|
|
[#Rule 1 |
697
|
|
|
|
|
|
|
'instance', 0, undef |
698
|
|
|
|
|
|
|
], |
699
|
|
|
|
|
|
|
[#Rule 2 |
700
|
|
|
|
|
|
|
'instance', 2, undef |
701
|
|
|
|
|
|
|
], |
702
|
|
|
|
|
|
|
[#Rule 3 |
703
|
|
|
|
|
|
|
'instance', 2, undef |
704
|
|
|
|
|
|
|
], |
705
|
|
|
|
|
|
|
[#Rule 4 |
706
|
|
|
|
|
|
|
'@1-0', 0, |
707
|
|
|
|
|
|
|
sub |
708
|
|
|
|
|
|
|
#line 96 "yapp/astma2-fact.yp" |
709
|
|
|
|
|
|
|
{ $_[0]->{USER}->{ctx} = undef; } |
710
|
|
|
|
|
|
|
], |
711
|
|
|
|
|
|
|
[#Rule 5 |
712
|
|
|
|
|
|
|
'clause', 3, undef |
713
|
|
|
|
|
|
|
], |
714
|
|
|
|
|
|
|
[#Rule 6 |
715
|
|
|
|
|
|
|
'clause', 1, undef |
716
|
|
|
|
|
|
|
], |
717
|
|
|
|
|
|
|
[#Rule 7 |
718
|
|
|
|
|
|
|
'clause', 1, undef |
719
|
|
|
|
|
|
|
], |
720
|
|
|
|
|
|
|
[#Rule 8 |
721
|
|
|
|
|
|
|
'directive', 1, |
722
|
|
|
|
|
|
|
sub |
723
|
|
|
|
|
|
|
#line 102 "yapp/astma2-fact.yp" |
724
|
|
|
|
|
|
|
{ die "Cancelled"; } |
725
|
|
|
|
|
|
|
], |
726
|
|
|
|
|
|
|
[#Rule 9 |
727
|
|
|
|
|
|
|
'directive', 1, |
728
|
|
|
|
|
|
|
sub |
729
|
|
|
|
|
|
|
#line 103 "yapp/astma2-fact.yp" |
730
|
|
|
|
|
|
|
{ warn $_[1]; 1; } |
731
|
|
|
|
|
|
|
], |
732
|
|
|
|
|
|
|
[#Rule 10 |
733
|
|
|
|
|
|
|
'directive', 1, |
734
|
|
|
|
|
|
|
sub |
735
|
|
|
|
|
|
|
#line 104 "yapp/astma2-fact.yp" |
736
|
|
|
|
|
|
|
{ die "unsupported version $_[1]" unless $_[1] =~ /^2\./; 1; } |
737
|
|
|
|
|
|
|
], |
738
|
|
|
|
|
|
|
[#Rule 11 |
739
|
|
|
|
|
|
|
'directive', 1, |
740
|
|
|
|
|
|
|
sub |
741
|
|
|
|
|
|
|
#line 105 "yapp/astma2-fact.yp" |
742
|
|
|
|
|
|
|
{ |
743
|
|
|
|
|
|
|
my $content; |
744
|
|
|
|
|
|
|
|
745
|
|
|
|
|
|
|
if ($_[1] =~ /\|\s*$/) { # a pipe | at the end, this is a UNIX pipe |
746
|
|
|
|
|
|
|
my $fh = IO::File->new ($_[1]) || die "unable to open pipe '$_[1]'"; |
747
|
|
|
|
|
|
|
local $/ = undef; |
748
|
|
|
|
|
|
|
$content = <$fh>; |
749
|
|
|
|
|
|
|
$fh->close; |
750
|
|
|
|
|
|
|
} else { |
751
|
|
|
|
|
|
|
use LWP::Simple; |
752
|
|
|
|
|
|
|
$content = get($_[1]) || die "unable to load '$_[1] with LWP'\n"; |
753
|
|
|
|
|
|
|
} |
754
|
|
|
|
|
|
|
#warn "new content >>>$content<<<"; |
755
|
|
|
|
|
|
|
$_[0]->YYData->{INPUT} = $content . $_[0]->YYData->{INPUT}; # prepend it |
756
|
|
|
|
|
|
|
} |
757
|
|
|
|
|
|
|
], |
758
|
|
|
|
|
|
|
[#Rule 12 |
759
|
|
|
|
|
|
|
'directive', 1, |
760
|
|
|
|
|
|
|
sub |
761
|
|
|
|
|
|
|
#line 120 "yapp/astma2-fact.yp" |
762
|
|
|
|
|
|
|
{ |
763
|
|
|
|
|
|
|
use Encode; |
764
|
|
|
|
|
|
|
Encode::from_to ($_[0]->YYData->{INPUT}, "iso-8859-1", $_[1]); |
765
|
|
|
|
|
|
|
} |
766
|
|
|
|
|
|
|
], |
767
|
|
|
|
|
|
|
[#Rule 13 |
768
|
|
|
|
|
|
|
'template_expansion', 2, |
769
|
|
|
|
|
|
|
sub |
770
|
|
|
|
|
|
|
#line 126 "yapp/astma2-fact.yp" |
771
|
|
|
|
|
|
|
{ $_[0]->YYData->{INPUT} .= "\n" . |
772
|
|
|
|
|
|
|
_expand_template ($_[0]->{USER}->{store}, |
773
|
|
|
|
|
|
|
$_[1], |
774
|
|
|
|
|
|
|
$_[2]) # compute the expanded version |
775
|
|
|
|
|
|
|
. "\n"; # extend the text at the end; |
776
|
|
|
|
|
|
|
} |
777
|
|
|
|
|
|
|
], |
778
|
|
|
|
|
|
|
[#Rule 14 |
779
|
|
|
|
|
|
|
'parameters', 0, |
780
|
|
|
|
|
|
|
sub |
781
|
|
|
|
|
|
|
#line 135 "yapp/astma2-fact.yp" |
782
|
|
|
|
|
|
|
{ { } } |
783
|
|
|
|
|
|
|
], |
784
|
|
|
|
|
|
|
[#Rule 15 |
785
|
|
|
|
|
|
|
'parameters', 3, |
786
|
|
|
|
|
|
|
sub |
787
|
|
|
|
|
|
|
#line 136 "yapp/astma2-fact.yp" |
788
|
|
|
|
|
|
|
{ $_[2] } |
789
|
|
|
|
|
|
|
], |
790
|
|
|
|
|
|
|
[#Rule 16 |
791
|
|
|
|
|
|
|
'bindings', 1, undef |
792
|
|
|
|
|
|
|
], |
793
|
|
|
|
|
|
|
[#Rule 17 |
794
|
|
|
|
|
|
|
'bindings', 3, |
795
|
|
|
|
|
|
|
sub |
796
|
|
|
|
|
|
|
#line 140 "yapp/astma2-fact.yp" |
797
|
|
|
|
|
|
|
{ $_[1] = { %{$_[1]}, %{$_[3]} }; $_[1]; } |
798
|
|
|
|
|
|
|
], |
799
|
|
|
|
|
|
|
[#Rule 18 |
800
|
|
|
|
|
|
|
'@2-2', 0, |
801
|
|
|
|
|
|
|
sub |
802
|
|
|
|
|
|
|
#line 143 "yapp/astma2-fact.yp" |
803
|
|
|
|
|
|
|
{ $_[0]->{USER}->{value} = 1 } |
804
|
|
|
|
|
|
|
], |
805
|
|
|
|
|
|
|
[#Rule 19 |
806
|
|
|
|
|
|
|
'binding', 4, |
807
|
|
|
|
|
|
|
sub |
808
|
|
|
|
|
|
|
#line 143 "yapp/astma2-fact.yp" |
809
|
|
|
|
|
|
|
{ { "$_[1]" => $_[4]->[0] } } |
810
|
|
|
|
|
|
|
], |
811
|
|
|
|
|
|
|
[#Rule 20 |
812
|
|
|
|
|
|
|
'theme', 3, undef |
813
|
|
|
|
|
|
|
], |
814
|
|
|
|
|
|
|
[#Rule 21 |
815
|
|
|
|
|
|
|
'theme', 1, undef |
816
|
|
|
|
|
|
|
], |
817
|
|
|
|
|
|
|
[#Rule 22 |
818
|
|
|
|
|
|
|
'@3-0', 0, |
819
|
|
|
|
|
|
|
sub |
820
|
|
|
|
|
|
|
#line 150 "yapp/astma2-fact.yp" |
821
|
|
|
|
|
|
|
{ unshift @{$_[0]->{USER}->{ctx}}, undef; } |
822
|
|
|
|
|
|
|
], |
823
|
|
|
|
|
|
|
[#Rule 23 |
824
|
|
|
|
|
|
|
'topic', 3, undef |
825
|
|
|
|
|
|
|
], |
826
|
|
|
|
|
|
|
[#Rule 24 |
827
|
|
|
|
|
|
|
'association', 0, undef |
828
|
|
|
|
|
|
|
], |
829
|
|
|
|
|
|
|
[#Rule 25 |
830
|
|
|
|
|
|
|
'@4-1', 0, |
831
|
|
|
|
|
|
|
sub |
832
|
|
|
|
|
|
|
#line 156 "yapp/astma2-fact.yp" |
833
|
|
|
|
|
|
|
{ $_[0]->{USER}->{reifier} = $_[0]->{USER}->{ctx}->[0]; |
834
|
|
|
|
|
|
|
$_[0]->{USER}->{ctx}->[0] = undef; |
835
|
|
|
|
|
|
|
} |
836
|
|
|
|
|
|
|
], |
837
|
|
|
|
|
|
|
[#Rule 26 |
838
|
|
|
|
|
|
|
'@5-3', 0, |
839
|
|
|
|
|
|
|
sub |
840
|
|
|
|
|
|
|
#line 159 "yapp/astma2-fact.yp" |
841
|
|
|
|
|
|
|
{ $_[0]->{USER}->{atype} = $_[0]->{USER}->{ctx}->[0]; |
842
|
|
|
|
|
|
|
$_[0]->{USER}->{assoc} = 1; # indicate to lexer that we are in assoc context |
843
|
|
|
|
|
|
|
} |
844
|
|
|
|
|
|
|
], |
845
|
|
|
|
|
|
|
[#Rule 27 |
846
|
|
|
|
|
|
|
'association', 8, |
847
|
|
|
|
|
|
|
sub |
848
|
|
|
|
|
|
|
#line 164 "yapp/astma2-fact.yp" |
849
|
|
|
|
|
|
|
{ |
850
|
|
|
|
|
|
|
# warn "roles :". Dumper $_[7]; |
851
|
|
|
|
|
|
|
$_[0]->{USER}->{store}->assert ([ $_[0]->{USER}->{reifier}, # LID |
852
|
|
|
|
|
|
|
$_[5], # SCOPE |
853
|
|
|
|
|
|
|
$_[0]->{USER}->{atype}, # TYPE |
854
|
|
|
|
|
|
|
TM->ASSOC, # KIND |
855
|
|
|
|
|
|
|
@{$_[7]}, # ROLES, PLAYERS |
856
|
|
|
|
|
|
|
undef ] ); |
857
|
|
|
|
|
|
|
$_[0]->{USER}->{implicits}->{'isa-scope'}->{$_[5]}++ if $_[5]; |
858
|
|
|
|
|
|
|
$_[0]->{USER}->{assoc} = undef; # indicate to lexer that we left assoc context |
859
|
|
|
|
|
|
|
} |
860
|
|
|
|
|
|
|
], |
861
|
|
|
|
|
|
|
[#Rule 28 |
862
|
|
|
|
|
|
|
'rolesin', 1, undef |
863
|
|
|
|
|
|
|
], |
864
|
|
|
|
|
|
|
[#Rule 29 |
865
|
|
|
|
|
|
|
'rolesin', 1, undef |
866
|
|
|
|
|
|
|
], |
867
|
|
|
|
|
|
|
[#Rule 30 |
868
|
|
|
|
|
|
|
'rolesout', 0, undef |
869
|
|
|
|
|
|
|
], |
870
|
|
|
|
|
|
|
[#Rule 31 |
871
|
|
|
|
|
|
|
'rolesout', 1, undef |
872
|
|
|
|
|
|
|
], |
873
|
|
|
|
|
|
|
[#Rule 32 |
874
|
|
|
|
|
|
|
'rolesout', 1, undef |
875
|
|
|
|
|
|
|
], |
876
|
|
|
|
|
|
|
[#Rule 33 |
877
|
|
|
|
|
|
|
'rolesep', 1, undef |
878
|
|
|
|
|
|
|
], |
879
|
|
|
|
|
|
|
[#Rule 34 |
880
|
|
|
|
|
|
|
'rolesep', 1, undef |
881
|
|
|
|
|
|
|
], |
882
|
|
|
|
|
|
|
[#Rule 35 |
883
|
|
|
|
|
|
|
'roles', 1, undef |
884
|
|
|
|
|
|
|
], |
885
|
|
|
|
|
|
|
[#Rule 36 |
886
|
|
|
|
|
|
|
'roles', 3, |
887
|
|
|
|
|
|
|
sub |
888
|
|
|
|
|
|
|
#line 187 "yapp/astma2-fact.yp" |
889
|
|
|
|
|
|
|
{ |
890
|
|
|
|
|
|
|
push @{$_[1]->[0]}, @{$_[3]->[0]}; |
891
|
|
|
|
|
|
|
push @{$_[1]->[1]}, @{$_[3]->[1]}; |
892
|
|
|
|
|
|
|
$_[1]; |
893
|
|
|
|
|
|
|
} |
894
|
|
|
|
|
|
|
], |
895
|
|
|
|
|
|
|
[#Rule 37 |
896
|
|
|
|
|
|
|
'@6-1', 0, |
897
|
|
|
|
|
|
|
sub |
898
|
|
|
|
|
|
|
#line 194 "yapp/astma2-fact.yp" |
899
|
|
|
|
|
|
|
{ $_[0]->{USER}->{role} = $_[0]->{USER}->{ctx}->[0] } |
900
|
|
|
|
|
|
|
], |
901
|
|
|
|
|
|
|
[#Rule 38 |
902
|
|
|
|
|
|
|
'@7-3', 0, |
903
|
|
|
|
|
|
|
sub |
904
|
|
|
|
|
|
|
#line 195 "yapp/astma2-fact.yp" |
905
|
|
|
|
|
|
|
{ $_[0]->{USER}->{ctx}->[0] = undef } |
906
|
|
|
|
|
|
|
], |
907
|
|
|
|
|
|
|
[#Rule 39 |
908
|
|
|
|
|
|
|
'role', 5, |
909
|
|
|
|
|
|
|
sub |
910
|
|
|
|
|
|
|
#line 196 "yapp/astma2-fact.yp" |
911
|
|
|
|
|
|
|
{ |
912
|
|
|
|
|
|
|
[ [ ($_[0]->{USER}->{role}) x scalar @{$_[5]} ], $_[5] ] |
913
|
|
|
|
|
|
|
} |
914
|
|
|
|
|
|
|
], |
915
|
|
|
|
|
|
|
[#Rule 40 |
916
|
|
|
|
|
|
|
'@8-1', 0, |
917
|
|
|
|
|
|
|
sub |
918
|
|
|
|
|
|
|
#line 201 "yapp/astma2-fact.yp" |
919
|
|
|
|
|
|
|
{ $_[0]->{USER}->{ctx}->[0] = undef } |
920
|
|
|
|
|
|
|
], |
921
|
|
|
|
|
|
|
[#Rule 41 |
922
|
|
|
|
|
|
|
'identifications', 2, |
923
|
|
|
|
|
|
|
sub |
924
|
|
|
|
|
|
|
#line 202 "yapp/astma2-fact.yp" |
925
|
|
|
|
|
|
|
{ [ $_[1] ] } |
926
|
|
|
|
|
|
|
], |
927
|
|
|
|
|
|
|
[#Rule 42 |
928
|
|
|
|
|
|
|
'@9-2', 0, |
929
|
|
|
|
|
|
|
sub |
930
|
|
|
|
|
|
|
#line 203 "yapp/astma2-fact.yp" |
931
|
|
|
|
|
|
|
{ $_[0]->{USER}->{ctx}->[0] = undef } |
932
|
|
|
|
|
|
|
], |
933
|
|
|
|
|
|
|
[#Rule 43 |
934
|
|
|
|
|
|
|
'identifications', 3, |
935
|
|
|
|
|
|
|
sub |
936
|
|
|
|
|
|
|
#line 204 "yapp/astma2-fact.yp" |
937
|
|
|
|
|
|
|
{ push @{$_[1]}, $_[2]; $_[1]; } |
938
|
|
|
|
|
|
|
], |
939
|
|
|
|
|
|
|
[#Rule 44 |
940
|
|
|
|
|
|
|
'attachments', 0, undef |
941
|
|
|
|
|
|
|
], |
942
|
|
|
|
|
|
|
[#Rule 45 |
943
|
|
|
|
|
|
|
'attachments', 3, undef |
944
|
|
|
|
|
|
|
], |
945
|
|
|
|
|
|
|
[#Rule 46 |
946
|
|
|
|
|
|
|
'attachments', 4, undef |
947
|
|
|
|
|
|
|
], |
948
|
|
|
|
|
|
|
[#Rule 47 |
949
|
|
|
|
|
|
|
'attachments', 2, undef |
950
|
|
|
|
|
|
|
], |
951
|
|
|
|
|
|
|
[#Rule 48 |
952
|
|
|
|
|
|
|
'attachments', 3, undef |
953
|
|
|
|
|
|
|
], |
954
|
|
|
|
|
|
|
[#Rule 49 |
955
|
|
|
|
|
|
|
'attachments', 2, undef |
956
|
|
|
|
|
|
|
], |
957
|
|
|
|
|
|
|
[#Rule 50 |
958
|
|
|
|
|
|
|
'attachments', 3, undef |
959
|
|
|
|
|
|
|
], |
960
|
|
|
|
|
|
|
[#Rule 51 |
961
|
|
|
|
|
|
|
'relative', 0, undef |
962
|
|
|
|
|
|
|
], |
963
|
|
|
|
|
|
|
[#Rule 52 |
964
|
|
|
|
|
|
|
'relative', 3, undef |
965
|
|
|
|
|
|
|
], |
966
|
|
|
|
|
|
|
[#Rule 53 |
967
|
|
|
|
|
|
|
'upcomma', 0, undef |
968
|
|
|
|
|
|
|
], |
969
|
|
|
|
|
|
|
[#Rule 54 |
970
|
|
|
|
|
|
|
'upcomma', 1, undef |
971
|
|
|
|
|
|
|
], |
972
|
|
|
|
|
|
|
[#Rule 55 |
973
|
|
|
|
|
|
|
'predefined_inlines', 1, |
974
|
|
|
|
|
|
|
sub |
975
|
|
|
|
|
|
|
#line 224 "yapp/astma2-fact.yp" |
976
|
|
|
|
|
|
|
{ 'isa' } |
977
|
|
|
|
|
|
|
], |
978
|
|
|
|
|
|
|
[#Rule 56 |
979
|
|
|
|
|
|
|
'predefined_inlines', 1, |
980
|
|
|
|
|
|
|
sub |
981
|
|
|
|
|
|
|
#line 225 "yapp/astma2-fact.yp" |
982
|
|
|
|
|
|
|
{ 'subclasses' } |
983
|
|
|
|
|
|
|
], |
984
|
|
|
|
|
|
|
[#Rule 57 |
985
|
|
|
|
|
|
|
'predefined_inlines', 1, undef |
986
|
|
|
|
|
|
|
], |
987
|
|
|
|
|
|
|
[#Rule 58 |
988
|
|
|
|
|
|
|
'@10-2', 0, |
989
|
|
|
|
|
|
|
sub |
990
|
|
|
|
|
|
|
#line 229 "yapp/astma2-fact.yp" |
991
|
|
|
|
|
|
|
{ unshift @{$_[0]->{USER}->{ctx}}, undef; } |
992
|
|
|
|
|
|
|
], |
993
|
|
|
|
|
|
|
[#Rule 59 |
994
|
|
|
|
|
|
|
'@11-4', 0, |
995
|
|
|
|
|
|
|
sub |
996
|
|
|
|
|
|
|
#line 230 "yapp/astma2-fact.yp" |
997
|
|
|
|
|
|
|
{ |
998
|
|
|
|
|
|
|
# warn " expand ctx ".Dumper $_[0]->{USER}->{ctx}; |
999
|
|
|
|
|
|
|
my $left = $_[0]->{USER}->{ctx}->[1]; |
1000
|
|
|
|
|
|
|
my $ted = $_[1]; |
1001
|
|
|
|
|
|
|
my $right = $_[0]->{USER}->{ctx}->[0]; |
1002
|
|
|
|
|
|
|
my $store = $_[0]->{USER}->{store}; |
1003
|
|
|
|
|
|
|
my $params = $_[2]; |
1004
|
|
|
|
|
|
|
|
1005
|
|
|
|
|
|
|
#warn "left $left ted $ted right $right"; |
1006
|
|
|
|
|
|
|
|
1007
|
|
|
|
|
|
|
if ($ted eq 'subclasses') { |
1008
|
|
|
|
|
|
|
$store->assert ([ undef, # LID |
1009
|
|
|
|
|
|
|
undef, # SCOPE |
1010
|
|
|
|
|
|
|
'is-subclass-of', # TYPE |
1011
|
|
|
|
|
|
|
TM->ASSOC, # KIND |
1012
|
|
|
|
|
|
|
[ 'subclass', 'superclass' ], # ROLES |
1013
|
|
|
|
|
|
|
[ $left, $right ], # PLAYERS |
1014
|
|
|
|
|
|
|
undef ] ); |
1015
|
|
|
|
|
|
|
} elsif ($ted eq 'isa') { |
1016
|
|
|
|
|
|
|
$store->assert ([ undef, # LID |
1017
|
|
|
|
|
|
|
undef, # SCOPE |
1018
|
|
|
|
|
|
|
'isa', # TYPE |
1019
|
|
|
|
|
|
|
TM->ASSOC, # KIND |
1020
|
|
|
|
|
|
|
[ 'instance', 'class' ], # ROLES |
1021
|
|
|
|
|
|
|
[ $left, $right ], # PLAYERS |
1022
|
|
|
|
|
|
|
undef ] ); |
1023
|
|
|
|
|
|
|
} elsif ($ted eq 'hasa') { # same, but other way round |
1024
|
|
|
|
|
|
|
$store->assert ([ undef, # LID |
1025
|
|
|
|
|
|
|
undef, # SCOPE |
1026
|
|
|
|
|
|
|
'isa', # TYPE |
1027
|
|
|
|
|
|
|
TM->ASSOC, # KIND |
1028
|
|
|
|
|
|
|
[ 'instance', 'class' ], # ROLES |
1029
|
|
|
|
|
|
|
[ $right, $left ], # PLAYERS |
1030
|
|
|
|
|
|
|
undef ] ); |
1031
|
|
|
|
|
|
|
} else { |
1032
|
|
|
|
|
|
|
$_[0]->YYData->{INPUT} .= "\n" . |
1033
|
|
|
|
|
|
|
_expand_template ($store, |
1034
|
|
|
|
|
|
|
$ted, |
1035
|
|
|
|
|
|
|
{ %$params, |
1036
|
|
|
|
|
|
|
'_left' => $left, |
1037
|
|
|
|
|
|
|
'_right' => $right}) # compute the expanded version |
1038
|
|
|
|
|
|
|
. "\n"; # extend the text at the end; |
1039
|
|
|
|
|
|
|
} |
1040
|
|
|
|
|
|
|
} |
1041
|
|
|
|
|
|
|
], |
1042
|
|
|
|
|
|
|
[#Rule 60 |
1043
|
|
|
|
|
|
|
'expansion', 6, |
1044
|
|
|
|
|
|
|
sub |
1045
|
|
|
|
|
|
|
#line 275 "yapp/astma2-fact.yp" |
1046
|
|
|
|
|
|
|
{ shift @{$_[0]->{USER}->{ctx}}; } |
1047
|
|
|
|
|
|
|
], |
1048
|
|
|
|
|
|
|
[#Rule 61 |
1049
|
|
|
|
|
|
|
'identification', 1, |
1050
|
|
|
|
|
|
|
sub |
1051
|
|
|
|
|
|
|
#line 278 "yapp/astma2-fact.yp" |
1052
|
|
|
|
|
|
|
{ |
1053
|
|
|
|
|
|
|
# warn "tid: >>".$_[1]."<<"; |
1054
|
|
|
|
|
|
|
if (! defined $_[1]) { # wildcard |
1055
|
|
|
|
|
|
|
$_[0]->{USER}->{ctx}->[0] ||= $_[0]->{USER}->{store}->internalize (sprintf "uuid-%010d", $TM::toplet_ctr++); |
1056
|
|
|
|
|
|
|
} elsif (ref ($_[1])) { # reference means indicator |
1057
|
|
|
|
|
|
|
$_[0]->{USER}->{ctx}->[0] = $_[0]->{USER}->{store}->internalize ($_[0]->{USER}->{ctx}->[0] => $_[1]); |
1058
|
|
|
|
|
|
|
} elsif ($_[1] =~ /^\w+:.+/) { # URI means subject address |
1059
|
|
|
|
|
|
|
$_[0]->{USER}->{ctx}->[0] = $_[0]->{USER}->{store}->internalize ($_[0]->{USER}->{ctx}->[0] => $_[1]); |
1060
|
|
|
|
|
|
|
} else { # some lousy identifier |
1061
|
|
|
|
|
|
|
# warn "checking for context ".Dumper $_[0]->{USER}->{ctx}->[0] ; |
1062
|
|
|
|
|
|
|
die "duplicate ID: $_[1] and $_[0]->{USER}->{ctx}->[0]" |
1063
|
|
|
|
|
|
|
if ($_[0]->{USER}->{ctx}->[0]); # we already have an identifier! |
1064
|
|
|
|
|
|
|
$_[0]->{USER}->{ctx}->[0] = $_[0]->{USER}->{store}->internalize ($_[1]); |
1065
|
|
|
|
|
|
|
} |
1066
|
|
|
|
|
|
|
$_[1] = $_[0]->{USER}->{ctx}->[0]; # whatever that was, that's it |
1067
|
|
|
|
|
|
|
} |
1068
|
|
|
|
|
|
|
], |
1069
|
|
|
|
|
|
|
[#Rule 62 |
1070
|
|
|
|
|
|
|
'@12-4', 0, |
1071
|
|
|
|
|
|
|
sub |
1072
|
|
|
|
|
|
|
#line 296 "yapp/astma2-fact.yp" |
1073
|
|
|
|
|
|
|
{ $_[0]->{USER}->{value} = 1 } |
1074
|
|
|
|
|
|
|
], |
1075
|
|
|
|
|
|
|
[#Rule 63 |
1076
|
|
|
|
|
|
|
'characteristic', 6, |
1077
|
|
|
|
|
|
|
sub |
1078
|
|
|
|
|
|
|
#line 297 "yapp/astma2-fact.yp" |
1079
|
|
|
|
|
|
|
{ |
1080
|
|
|
|
|
|
|
my $ctype = $_[1]; |
1081
|
|
|
|
|
|
|
my $cclass; # we do not yet know what this will be |
1082
|
|
|
|
|
|
|
if ($_[3]) { # there is a type specified |
1083
|
|
|
|
|
|
|
$cclass = $_[3]; # take this to be the class of what ctype is |
1084
|
|
|
|
|
|
|
} elsif ($_[1] =~ /.*name$/) { # looks like a name |
1085
|
|
|
|
|
|
|
if ($_[6]->[1] eq XSD_STRING) { # but we check first what type the value is |
1086
|
|
|
|
|
|
|
$cclass = 'name'; # for a string we allow it to be a name |
1087
|
|
|
|
|
|
|
} else { |
1088
|
|
|
|
|
|
|
$cclass = 'occurrence'; # otherwise, we guess it is an occurrence |
1089
|
|
|
|
|
|
|
} |
1090
|
|
|
|
|
|
|
} else { # type does not end with 'name' |
1091
|
|
|
|
|
|
|
$cclass = 'occurrence'; # this is then an occurrence |
1092
|
|
|
|
|
|
|
} |
1093
|
|
|
|
|
|
|
|
1094
|
|
|
|
|
|
|
if ($cclass ne $ctype) { # a new instance was introduced |
1095
|
|
|
|
|
|
|
$store->assert ([ undef, # LID |
1096
|
|
|
|
|
|
|
undef, # SCOPE |
1097
|
|
|
|
|
|
|
'is-subclass-of', # TYPE |
1098
|
|
|
|
|
|
|
TM->ASSOC, # KIND |
1099
|
|
|
|
|
|
|
[ 'subclass', 'superclass' ], # ROLES |
1100
|
|
|
|
|
|
|
[ $ctype, $cclass ], # PLAYERS |
1101
|
|
|
|
|
|
|
undef ] ); |
1102
|
|
|
|
|
|
|
} |
1103
|
|
|
|
|
|
|
# warn "char $_[1] ctx ".Dumper $_[0]->{USER}->{ctx}; |
1104
|
|
|
|
|
|
|
$_[0]->{USER}->{store}->assert ( # |
1105
|
|
|
|
|
|
|
[ |
1106
|
|
|
|
|
|
|
undef, # LID |
1107
|
|
|
|
|
|
|
$_[2], # SCOPE (undef is ok) |
1108
|
|
|
|
|
|
|
$_[1], # TYPE |
1109
|
|
|
|
|
|
|
|
1110
|
|
|
|
|
|
|
$cclass eq 'name' ? TM->NAME |
1111
|
|
|
|
|
|
|
: |
1112
|
|
|
|
|
|
|
($cclass eq 'occurrence' ? TM->OCC |
1113
|
|
|
|
|
|
|
: TM->ASSOC), # KIND |
1114
|
|
|
|
|
|
|
[ 'thing', 'value' ], # ROLES |
1115
|
|
|
|
|
|
|
[ $_[0]->{USER}->{ctx}->[0], $_[6] ], # PLAYERS |
1116
|
|
|
|
|
|
|
undef |
1117
|
|
|
|
|
|
|
] |
1118
|
|
|
|
|
|
|
); |
1119
|
|
|
|
|
|
|
} |
1120
|
|
|
|
|
|
|
], |
1121
|
|
|
|
|
|
|
[#Rule 64 |
1122
|
|
|
|
|
|
|
'scope', 0, undef |
1123
|
|
|
|
|
|
|
], |
1124
|
|
|
|
|
|
|
[#Rule 65 |
1125
|
|
|
|
|
|
|
'scope', 2, |
1126
|
|
|
|
|
|
|
sub |
1127
|
|
|
|
|
|
|
#line 341 "yapp/astma2-fact.yp" |
1128
|
|
|
|
|
|
|
{ $_[2]; } |
1129
|
|
|
|
|
|
|
], |
1130
|
|
|
|
|
|
|
[#Rule 66 |
1131
|
|
|
|
|
|
|
'type', 0, undef |
1132
|
|
|
|
|
|
|
], |
1133
|
|
|
|
|
|
|
[#Rule 67 |
1134
|
|
|
|
|
|
|
'type', 2, |
1135
|
|
|
|
|
|
|
sub |
1136
|
|
|
|
|
|
|
#line 345 "yapp/astma2-fact.yp" |
1137
|
|
|
|
|
|
|
{ $_[2] } |
1138
|
|
|
|
|
|
|
], |
1139
|
|
|
|
|
|
|
[#Rule 68 |
1140
|
|
|
|
|
|
|
'tid', 1, |
1141
|
|
|
|
|
|
|
sub |
1142
|
|
|
|
|
|
|
#line 353 "yapp/astma2-fact.yp" |
1143
|
|
|
|
|
|
|
{ $_[1]; } |
1144
|
|
|
|
|
|
|
], |
1145
|
|
|
|
|
|
|
[#Rule 69 |
1146
|
|
|
|
|
|
|
'tid', 1, |
1147
|
|
|
|
|
|
|
sub |
1148
|
|
|
|
|
|
|
#line 354 "yapp/astma2-fact.yp" |
1149
|
|
|
|
|
|
|
{ undef; } |
1150
|
|
|
|
|
|
|
], |
1151
|
|
|
|
|
|
|
[#Rule 70 |
1152
|
|
|
|
|
|
|
'tid', 1, |
1153
|
|
|
|
|
|
|
sub |
1154
|
|
|
|
|
|
|
#line 355 "yapp/astma2-fact.yp" |
1155
|
|
|
|
|
|
|
{ \ $_[1]; } |
1156
|
|
|
|
|
|
|
], |
1157
|
|
|
|
|
|
|
[#Rule 71 |
1158
|
|
|
|
|
|
|
'tid', 2, |
1159
|
|
|
|
|
|
|
sub |
1160
|
|
|
|
|
|
|
#line 356 "yapp/astma2-fact.yp" |
1161
|
|
|
|
|
|
|
{ $_[2]; } |
1162
|
|
|
|
|
|
|
], |
1163
|
|
|
|
|
|
|
[#Rule 72 |
1164
|
|
|
|
|
|
|
'tid', 2, |
1165
|
|
|
|
|
|
|
sub |
1166
|
|
|
|
|
|
|
#line 357 "yapp/astma2-fact.yp" |
1167
|
|
|
|
|
|
|
{ \ $_[2]; } |
1168
|
|
|
|
|
|
|
], |
1169
|
|
|
|
|
|
|
[#Rule 73 |
1170
|
|
|
|
|
|
|
'tid', 1, |
1171
|
|
|
|
|
|
|
sub |
1172
|
|
|
|
|
|
|
#line 358 "yapp/astma2-fact.yp" |
1173
|
|
|
|
|
|
|
{ |
1174
|
|
|
|
|
|
|
my $baseuri = $_[0]->{USER}->{store}->baseuri; |
1175
|
|
|
|
|
|
|
$_[1] =~ /^$baseuri(.+)/ ? $1 : \ $_[1]; |
1176
|
|
|
|
|
|
|
} |
1177
|
|
|
|
|
|
|
] |
1178
|
|
|
|
|
|
|
], |
1179
|
|
|
|
|
|
|
%options); |
1180
|
|
|
|
|
|
|
$self->{USER}->{store} = $store; |
1181
|
|
|
|
|
|
|
return bless $self, $class; |
1182
|
|
|
|
|
|
|
} |
1183
|
|
|
|
|
|
|
|
1184
|
|
|
|
|
|
|
#line 690 "yapp/astma2-fact.yp" |
1185
|
|
|
|
|
|
|
|
1186
|
|
|
|
|
|
|
|
1187
|
|
|
|
|
|
|
sub _Error { |
1188
|
|
|
|
|
|
|
die "Syntax error: Found ".$_[0]->YYCurtok." but expected ".join (' or ', $_[0]->YYExpect); |
1189
|
|
|
|
|
|
|
} |
1190
|
|
|
|
|
|
|
|
1191
|
|
|
|
|
|
|
sub _Lexer { |
1192
|
|
|
|
|
|
|
my $parser = shift; |
1193
|
|
|
|
|
|
|
my $refINPUT = \$parser->YYData->{INPUT}; |
1194
|
|
|
|
|
|
|
|
1195
|
|
|
|
|
|
|
# study $$refINPUT; |
1196
|
|
|
|
|
|
|
|
1197
|
|
|
|
|
|
|
$$refINPUT or return ('', undef); # this is the end of the world, as we know it |
1198
|
|
|
|
|
|
|
$$refINPUT =~ s/^[ \t]+//o; |
1199
|
|
|
|
|
|
|
|
1200
|
|
|
|
|
|
|
#warn "lexer ($parser->{USER}->{string}):>>>".$parser->YYData->{INPUT}; |
1201
|
|
|
|
|
|
|
|
1202
|
|
|
|
|
|
|
$$refINPUT =~ s/^\n\n//so and return ('DOT', undef); |
1203
|
|
|
|
|
|
|
$$refINPUT =~ s/^\n$//so and return ('DOT', undef); |
1204
|
|
|
|
|
|
|
$$refINPUT =~ s/^\.//so and return ('DOT', undef); |
1205
|
|
|
|
|
|
|
$$refINPUT =~ s/^\~//so and return ('TILDE', undef); |
1206
|
|
|
|
|
|
|
$$refINPUT =~ s/^=//o and return ('EQUAL', undef); |
1207
|
|
|
|
|
|
|
$$refINPUT =~ s/^://o and return ('COLON', undef); |
1208
|
|
|
|
|
|
|
$$refINPUT =~ s/^,\s*(which|who)\b//o and return ('DOWNCOMMA', undef); |
1209
|
|
|
|
|
|
|
$$refINPUT =~ s/^,(?!\s*(which|who)\b)//o and return ('COMMA', undef); |
1210
|
|
|
|
|
|
|
|
1211
|
|
|
|
|
|
|
$$refINPUT =~ s/^is-?a\b//o and return ('ISA', undef); |
1212
|
|
|
|
|
|
|
# $$refINPUT =~ s/^has-?a\b//o and return ('TED', 'hasa'); |
1213
|
|
|
|
|
|
|
$$refINPUT =~ s/^subclasses\b//o and return ('SUBCL', undef); |
1214
|
|
|
|
|
|
|
|
1215
|
|
|
|
|
|
|
$$refINPUT =~ s/^has\b//o and return ('HAS', undef); |
1216
|
|
|
|
|
|
|
|
1217
|
|
|
|
|
|
|
unless ($parser->{USER}->{assoc}) { # in topic context this corresponds to HAS |
1218
|
|
|
|
|
|
|
$$refINPUT =~ s/^\n\s*(?=\w+\s*[:<@]\s)//so and return ('HAS', undef); # positive look-ahead for things like bn : |
1219
|
|
|
|
|
|
|
} |
1220
|
|
|
|
|
|
|
|
1221
|
|
|
|
|
|
|
$$refINPUT =~ s/^(which|who)\b//o and return ('WHICH', undef); |
1222
|
|
|
|
|
|
|
$$refINPUT =~ s/^and(\s+(which|who))?\b//so and return ('WHICH', undef); # (can go over lines) |
1223
|
|
|
|
|
|
|
|
1224
|
|
|
|
|
|
|
|
1225
|
|
|
|
|
|
|
$$refINPUT =~ s/^\n//so and return ('EOL', undef); |
1226
|
|
|
|
|
|
|
|
1227
|
|
|
|
|
|
|
$$refINPUT =~ s/^{//so and return ('BRA', undef); |
1228
|
|
|
|
|
|
|
$$refINPUT =~ s/^}//so and return ('KET', undef); |
1229
|
|
|
|
|
|
|
$$refINPUT =~ s/^\(//so and return ('LPAREN', undef); |
1230
|
|
|
|
|
|
|
$$refINPUT =~ s/^\)//so and return ('RPAREN', undef); |
1231
|
|
|
|
|
|
|
|
1232
|
|
|
|
|
|
|
$$refINPUT =~ s/^</o and return ('REIFIES', undef); |
1233
|
|
|
|
|
|
|
$$refINPUT =~ s/^/o and return ('SUBCL', undef); |
1234
|
|
|
|
|
|
|
|
1235
|
|
|
|
|
|
|
$$refINPUT =~ s/^>>//o and return ('ISREIFIED', undef); |
1236
|
|
|
|
|
|
|
|
1237
|
|
|
|
|
|
|
|
1238
|
|
|
|
|
|
|
$$refINPUT =~ s/^\*//o and return ('WILDCARD', undef); |
1239
|
|
|
|
|
|
|
|
1240
|
|
|
|
|
|
|
$$refINPUT =~ s/^(\d{4}-\d{1,2}-\d{1,2})(T(\d{1,2}):(\d{2}))?//o |
1241
|
|
|
|
|
|
|
and return ('DATE', sprintf "urn:x-date:%s:%02d:%02d", $1, $3 || 0, $4 || 0); # is a date |
1242
|
|
|
|
|
|
|
|
1243
|
|
|
|
|
|
|
$$refINPUT =~ s/^bn\b//o and return ('ID', "name"); |
1244
|
|
|
|
|
|
|
$$refINPUT =~ s/^oc\b//o and return ('ID', "occurrence"); |
1245
|
|
|
|
|
|
|
$$refINPUT =~ s/^in\b//o and return ('ID', "occurrence"); |
1246
|
|
|
|
|
|
|
|
1247
|
|
|
|
|
|
|
if ($parser->{USER}->{value}) { # parser said we should expect a value now |
1248
|
|
|
|
|
|
|
##warn "expect value >>".$$refINPUT."<<"; |
1249
|
|
|
|
|
|
|
$$refINPUT =~ s/^\"{3}(.*?)\"{3}(?=\n)//so and |
1250
|
|
|
|
|
|
|
# (warn "returning multi $1" or 1) and |
1251
|
|
|
|
|
|
|
(undef $parser->{USER}->{value} or return ('VALUE', new TM::Literal ($1))); |
1252
|
|
|
|
|
|
|
$$refINPUT =~ s/^\"(.*?)\"(^^(\S+))?//o and |
1253
|
|
|
|
|
|
|
# (warn "returning simlg $1" or 1) and |
1254
|
|
|
|
|
|
|
(undef $parser->{USER}->{value} or return ('VALUE', new TM::Literal ($1, $3))); |
1255
|
|
|
|
|
|
|
$$refINPUT =~ s/^(\d+\.\d+)//o and |
1256
|
|
|
|
|
|
|
# (warn "returning float $1" or 1) and |
1257
|
|
|
|
|
|
|
(undef $parser->{USER}->{value} or return ('VALUE', new TM::Literal ($1, TM::Literal->DECIMAL))); |
1258
|
|
|
|
|
|
|
$$refINPUT =~ s/^(\d+)//o and |
1259
|
|
|
|
|
|
|
# (warn "returning int $1" or 1) and |
1260
|
|
|
|
|
|
|
(undef $parser->{USER}->{value} or return ('VALUE', new TM::Literal ($1, TM::Literal->INTEGER))); |
1261
|
|
|
|
|
|
|
$$refINPUT =~ s/^(\w+:\S+)//o and |
1262
|
|
|
|
|
|
|
# (warn "returning uri $1" or 1) and |
1263
|
|
|
|
|
|
|
(undef $parser->{USER}->{value} or return ('VALUE', new TM::Literal ($1, TM::Literal->URI))); |
1264
|
|
|
|
|
|
|
$$refINPUT =~ s/^(.+?)(?=\s*\n)//o and |
1265
|
|
|
|
|
|
|
# (warn "returning unquo $1" or 1) and |
1266
|
|
|
|
|
|
|
(undef $parser->{USER}->{value} or return ('VALUE', new TM::Literal ($1))); |
1267
|
|
|
|
|
|
|
|
1268
|
|
|
|
|
|
|
## (warn "returning $1" or 1) and |
1269
|
|
|
|
|
|
|
## (undef $parser->{USER}->{value} or return ('VALUE', new TM::Literal ($1))); |
1270
|
|
|
|
|
|
|
##warn "no string"; |
1271
|
|
|
|
|
|
|
} |
1272
|
|
|
|
|
|
|
|
1273
|
|
|
|
|
|
|
## unfortunately, this does not what I want: |
1274
|
|
|
|
|
|
|
## $$refINPUT =~ s/^([A-Za-z][A-Za-z0-9_-]*)(?!:)//o and return ('ID', $1); # negative look-ahead |
1275
|
|
|
|
|
|
|
## tricky optimization: don't ask |
1276
|
|
|
|
|
|
|
my $aux; # need this to store identifier/uri prefix temporarily (optimization) |
1277
|
|
|
|
|
|
|
my $aux2; # need this to store ontology URL, if there is one |
1278
|
|
|
|
|
|
|
$$refINPUT =~ s/^([A-Za-z][.A-Za-z0-9_-]*)//o and $aux = $1 # save this for later |
1279
|
|
|
|
|
|
|
and $$refINPUT !~ /^:[\w\/]/ |
1280
|
|
|
|
|
|
|
and return (_is_template ($parser->{USER}->{store}, |
1281
|
|
|
|
|
|
|
$aux) |
1282
|
|
|
|
|
|
|
? 'TED' : 'ID', $aux); |
1283
|
|
|
|
|
|
|
|
1284
|
|
|
|
|
|
|
$$refINPUT =~ s/^(:([^\s\)\(\]\[]+))//o and return ('URI', ( $aux2 = _is_ontology ($parser->{USER}->{store}, |
1285
|
|
|
|
|
|
|
$parser->{USER}->{prefixes}, |
1286
|
|
|
|
|
|
|
$aux)) ? $aux2."#$2" : $aux.$1); # is a URL/URN actually |
1287
|
|
|
|
|
|
|
|
1288
|
|
|
|
|
|
|
$$refINPUT =~ s/^@//so and return ('AT', undef); |
1289
|
|
|
|
|
|
|
|
1290
|
|
|
|
|
|
|
|
1291
|
|
|
|
|
|
|
$$refINPUT =~ s/^%include\s+(.*?)(?=\n)//so and return ('INCLUDE', $1); # positive look-ahead |
1292
|
|
|
|
|
|
|
$$refINPUT =~ s/^%log\s+(.*?)(?=\n)//so and return ('LOG', $1); # positive look-ahead |
1293
|
|
|
|
|
|
|
$$refINPUT =~ s/^%cancel(?=\n)//so and return ('CANCEL', $1); # positive look-ahead |
1294
|
|
|
|
|
|
|
$$refINPUT =~ s/^%version\s+(\d+\.\d+)(?=\n)//so and return ('VERSION', $1); # positive look-ahead |
1295
|
|
|
|
|
|
|
|
1296
|
|
|
|
|
|
|
$$refINPUT =~ s/^%encoding\s+(.*?)(?=\n)//so and return ('ENCODING', $1); # positive look-ahead |
1297
|
|
|
|
|
|
|
|
1298
|
|
|
|
|
|
|
|
1299
|
|
|
|
|
|
|
# $$refINPUT =~ s/^\[//so and return ('LBRACKET', undef); |
1300
|
|
|
|
|
|
|
# $$refINPUT =~ s/^\]//so and return ('RBRACKET', undef); |
1301
|
|
|
|
|
|
|
|
1302
|
|
|
|
|
|
|
$$refINPUT =~ s/^(.)//so and return ($1, $1); # should not be an issue except on error |
1303
|
|
|
|
|
|
|
} |
1304
|
|
|
|
|
|
|
|
1305
|
|
|
|
|
|
|
sub _is_template { |
1306
|
|
|
|
|
|
|
my $store = shift; |
1307
|
|
|
|
|
|
|
my $id = shift; |
1308
|
|
|
|
|
|
|
|
1309
|
|
|
|
|
|
|
my $t = $store->tids ($id) or return undef; |
1310
|
|
|
|
|
|
|
return $store->is_a ($t, $store->tids (\ TEMPLATE)); |
1311
|
|
|
|
|
|
|
} |
1312
|
|
|
|
|
|
|
|
1313
|
|
|
|
|
|
|
sub _is_ontology { |
1314
|
|
|
|
|
|
|
my $store = shift; |
1315
|
|
|
|
|
|
|
my $prefixes = shift; |
1316
|
|
|
|
|
|
|
my $prefix = shift; |
1317
|
|
|
|
|
|
|
|
1318
|
|
|
|
|
|
|
#warn "texting prefix '$prefix' on ".Dumper $prefixes; |
1319
|
|
|
|
|
|
|
return $prefixes->{$prefix} if $prefixes->{$prefix}; # cache |
1320
|
|
|
|
|
|
|
|
1321
|
|
|
|
|
|
|
if ($prefix eq 'astma') { # this is one predefined prefix |
1322
|
|
|
|
|
|
|
$prefixes->{$prefix} = ASTMA; |
1323
|
|
|
|
|
|
|
} elsif ($prefix eq 'xsd') { # this is the other predefined prefix |
1324
|
|
|
|
|
|
|
$prefixes->{$prefix} = XSD; |
1325
|
|
|
|
|
|
|
} else { |
1326
|
|
|
|
|
|
|
my $p = $store->tids ($prefix); |
1327
|
|
|
|
|
|
|
if ($p && $store->is_a ($p, $store->tids (\ ONTOLOGY))) { # is the topic an instance of astma:ontology? |
1328
|
|
|
|
|
|
|
$prefixes->{$prefix} = |
1329
|
|
|
|
|
|
|
$store->toplet ($store->tids ($prefix))->[TM->INDICATORS]->[0] # then take its subject indicator as expanded URI |
1330
|
|
|
|
|
|
|
or die "no subject indicator for '$prefix' provided"; # if there is none, complain |
1331
|
|
|
|
|
|
|
} |
1332
|
|
|
|
|
|
|
} |
1333
|
|
|
|
|
|
|
#warn "prefixes now".Dumper $prefixes; |
1334
|
|
|
|
|
|
|
return $prefixes->{$prefix}; |
1335
|
|
|
|
|
|
|
} |
1336
|
|
|
|
|
|
|
|
1337
|
|
|
|
|
|
|
sub parse { |
1338
|
|
|
|
|
|
|
my $self = shift; |
1339
|
|
|
|
|
|
|
$self->YYData->{INPUT} = shift; |
1340
|
|
|
|
|
|
|
|
1341
|
|
|
|
|
|
|
#warn "parse"; |
1342
|
|
|
|
|
|
|
|
1343
|
|
|
|
|
|
|
$self->YYData->{INPUT} =~ s/\r/\n/sg; |
1344
|
|
|
|
|
|
|
$self->YYData->{INPUT} =~ s/(?
|
1345
|
|
|
|
|
|
|
$self->YYData->{INPUT} =~ s/ \+{3} /\n/g; # replace _+++_ with \n |
1346
|
|
|
|
|
|
|
$self->YYData->{INPUT} =~ s/\+{4}/+++/g; # stuffed ++++ cleanout |
1347
|
|
|
|
|
|
|
$self->YYData->{INPUT} =~ s/^\#.*?\n/\n/mg; # # at there start of every line -> gone |
1348
|
|
|
|
|
|
|
$self->YYData->{INPUT} =~ s/\s+\#.*?\n/\n/mg; # anything which starts with #, all blanks are ignored |
1349
|
|
|
|
|
|
|
$self->YYData->{INPUT} =~ s/\n\n\n+/\n\n/sg; |
1350
|
|
|
|
|
|
|
$self->YYData->{INPUT} =~ s/\n\s+\n+/\n\n/sg; # trimm lines with blanks only |
1351
|
|
|
|
|
|
|
|
1352
|
|
|
|
|
|
|
# we not only capture what is said EXPLICITELY in the map, we also collect implicit knowledge |
1353
|
|
|
|
|
|
|
# we could add this immediately into the map at parsing, but it would slow the process down and |
1354
|
|
|
|
|
|
|
# it would probably duplicate/complicate things |
1355
|
|
|
|
|
|
|
$self->{USER}->{implicits} = { |
1356
|
|
|
|
|
|
|
'isa-thing' => undef, # just let them spring into existence |
1357
|
|
|
|
|
|
|
'isa-scope' => undef, # just let them spring into existence |
1358
|
|
|
|
|
|
|
'subclasses' => undef |
1359
|
|
|
|
|
|
|
}; |
1360
|
|
|
|
|
|
|
# $self->{USER}->{topic_count} = 0; |
1361
|
|
|
|
|
|
|
|
1362
|
|
|
|
|
|
|
# $self->{USER}->{templates} = new TM (psis => undef, baseuri => $self->{USER}->{store}->baseuri); |
1363
|
|
|
|
|
|
|
$self->{USER}->{prefixes} = {}; |
1364
|
|
|
|
|
|
|
|
1365
|
|
|
|
|
|
|
eval { |
1366
|
|
|
|
|
|
|
$self->YYParse ( yylex => \&_Lexer, yyerror => \&_Error); #, yydebug => 0x01 ); |
1367
|
|
|
|
|
|
|
}; if ($@ =~ /^Cancelled/) { |
1368
|
|
|
|
|
|
|
warn $@; # de-escalate Cancelling to warning |
1369
|
|
|
|
|
|
|
} elsif ($@) { |
1370
|
|
|
|
|
|
|
die $@; # otherwise re-raise the exception |
1371
|
|
|
|
|
|
|
} |
1372
|
|
|
|
|
|
|
#warn "in parse end ".Dumper $self->{USER}->{implicits}; |
1373
|
|
|
|
|
|
|
{ # resolving implicit stuff |
1374
|
|
|
|
|
|
|
my $implicits = $self->{USER}->{implicits}; |
1375
|
|
|
|
|
|
|
my $store = $self->{USER}->{store}; |
1376
|
|
|
|
|
|
|
|
1377
|
|
|
|
|
|
|
{ # all super/subclasses |
1378
|
|
|
|
|
|
|
foreach my $superclass (keys %{$implicits->{'subclasses'}}) { |
1379
|
|
|
|
|
|
|
$store->assert ( map { |
1380
|
|
|
|
|
|
|
[ undef, undef, 'is-subclass-of', TM->ASSOC, [ 'superclass', 'subclass' ], [ $superclass, $_ ] ] |
1381
|
|
|
|
|
|
|
} keys %{$implicits->{'subclasses'}->{$superclass}}); |
1382
|
|
|
|
|
|
|
} |
1383
|
|
|
|
|
|
|
} |
1384
|
|
|
|
|
|
|
{ # all things in isa-things are THINGS, simply add them |
1385
|
|
|
|
|
|
|
$store->internalize (map { $_ => undef } keys %{$implicits->{'isa-thing'}}); |
1386
|
|
|
|
|
|
|
} |
1387
|
|
|
|
|
|
|
{ # establishing the scoping topics |
1388
|
|
|
|
|
|
|
$store->assert (map { |
1389
|
|
|
|
|
|
|
[ undef, undef, 'isa', TM->ASSOC, [ 'class', 'instance' ], [ 'scope', $_ ] ] |
1390
|
|
|
|
|
|
|
} keys %{$implicits->{'isa-scope'}}); |
1391
|
|
|
|
|
|
|
} |
1392
|
|
|
|
|
|
|
$store->externalize ( $store->instances ($store->tids (\ TEMPLATE)) ); # "removing templates now"; |
1393
|
|
|
|
|
|
|
} |
1394
|
|
|
|
|
|
|
return $self->{USER}->{store}; |
1395
|
|
|
|
|
|
|
} |
1396
|
|
|
|
|
|
|
|
1397
|
|
|
|
|
|
|
#my $f = new TM::AsTMa::Fact; |
1398
|
|
|
|
|
|
|
#$f->Run; |
1399
|
|
|
|
|
|
|
|
1400
|
|
|
|
|
|
|
|
1401
|
|
|
|
|
|
|
1; |