line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright 2022 Jeffrey Kegler |
2
|
|
|
|
|
|
|
# This file is part of Marpa::R2. Marpa::R2 is free software: you can |
3
|
|
|
|
|
|
|
# redistribute it and/or modify it under the terms of the GNU Lesser |
4
|
|
|
|
|
|
|
# General Public License as published by the Free Software Foundation, |
5
|
|
|
|
|
|
|
# either version 3 of the License, or (at your option) any later version. |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# Marpa::R2 is distributed in the hope that it will be useful, |
8
|
|
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
9
|
|
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
10
|
|
|
|
|
|
|
# Lesser General Public License for more details. |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# You should have received a copy of the GNU Lesser |
13
|
|
|
|
|
|
|
# General Public License along with Marpa::R2. If not, see |
14
|
|
|
|
|
|
|
# http://www.gnu.org/licenses/. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Generated automatically by gp_generate.pl |
17
|
|
|
|
|
|
|
# NOTE: Changes made to this file will be lost: look at gp_generate.pl. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
MODULE = Marpa::R2 PACKAGE = Marpa::R2::Thin::G |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
void |
22
|
|
|
|
|
|
|
completion_symbol_activate( g_wrapper, sym_id, activate ) |
23
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
24
|
|
|
|
|
|
|
Marpa_Symbol_ID sym_id; |
25
|
|
|
|
|
|
|
int activate; |
26
|
|
|
|
|
|
|
PPCODE: |
27
|
|
|
|
|
|
|
{ |
28
|
13
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
29
|
13
|
|
|
|
|
|
int gp_result = marpa_g_completion_symbol_activate(self, sym_id, activate); |
30
|
13
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
31
|
13
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
croak( "Problem in g->completion_symbol_activate(%d, %d): %s", |
33
|
|
|
|
|
|
|
sym_id, activate, xs_g_error( g_wrapper )); |
34
|
|
|
|
|
|
|
} |
35
|
13
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
void |
39
|
|
|
|
|
|
|
error_clear( g_wrapper ) |
40
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
41
|
|
|
|
|
|
|
PPCODE: |
42
|
|
|
|
|
|
|
{ |
43
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
44
|
0
|
|
|
|
|
|
int gp_result = marpa_g_error_clear(self); |
45
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
46
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
croak( "Problem in g->error_clear(): %s", |
48
|
|
|
|
|
|
|
xs_g_error( g_wrapper )); |
49
|
|
|
|
|
|
|
} |
50
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
void |
54
|
|
|
|
|
|
|
event_count( g_wrapper ) |
55
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
56
|
|
|
|
|
|
|
PPCODE: |
57
|
|
|
|
|
|
|
{ |
58
|
952
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
59
|
952
|
|
|
|
|
|
int gp_result = marpa_g_event_count(self); |
60
|
952
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
61
|
952
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
croak( "Problem in g->event_count(): %s", |
63
|
|
|
|
|
|
|
xs_g_error( g_wrapper )); |
64
|
|
|
|
|
|
|
} |
65
|
952
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
void |
69
|
|
|
|
|
|
|
force_valued( g_wrapper ) |
70
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
71
|
|
|
|
|
|
|
PPCODE: |
72
|
|
|
|
|
|
|
{ |
73
|
546
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
74
|
546
|
|
|
|
|
|
int gp_result = marpa_g_force_valued(self); |
75
|
546
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
76
|
546
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
croak( "Problem in g->force_valued(): %s", |
78
|
|
|
|
|
|
|
xs_g_error( g_wrapper )); |
79
|
|
|
|
|
|
|
} |
80
|
546
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
void |
84
|
|
|
|
|
|
|
has_cycle( g_wrapper ) |
85
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
86
|
|
|
|
|
|
|
PPCODE: |
87
|
|
|
|
|
|
|
{ |
88
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
89
|
0
|
|
|
|
|
|
int gp_result = marpa_g_has_cycle(self); |
90
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
91
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
croak( "Problem in g->has_cycle(): %s", |
93
|
|
|
|
|
|
|
xs_g_error( g_wrapper )); |
94
|
|
|
|
|
|
|
} |
95
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
void |
99
|
|
|
|
|
|
|
highest_rule_id( g_wrapper ) |
100
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
101
|
|
|
|
|
|
|
PPCODE: |
102
|
|
|
|
|
|
|
{ |
103
|
6458
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
104
|
6458
|
|
|
|
|
|
int gp_result = marpa_g_highest_rule_id(self); |
105
|
6458
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
106
|
6458
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
107
|
0
|
|
|
|
|
|
croak( "Problem in g->highest_rule_id(): %s", |
108
|
|
|
|
|
|
|
xs_g_error( g_wrapper )); |
109
|
|
|
|
|
|
|
} |
110
|
6458
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
void |
114
|
|
|
|
|
|
|
highest_symbol_id( g_wrapper ) |
115
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
116
|
|
|
|
|
|
|
PPCODE: |
117
|
|
|
|
|
|
|
{ |
118
|
706
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
119
|
706
|
|
|
|
|
|
int gp_result = marpa_g_highest_symbol_id(self); |
120
|
706
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
121
|
706
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
122
|
0
|
|
|
|
|
|
croak( "Problem in g->highest_symbol_id(): %s", |
123
|
|
|
|
|
|
|
xs_g_error( g_wrapper )); |
124
|
|
|
|
|
|
|
} |
125
|
706
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
void |
129
|
|
|
|
|
|
|
is_precomputed( g_wrapper ) |
130
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
131
|
|
|
|
|
|
|
PPCODE: |
132
|
|
|
|
|
|
|
{ |
133
|
2588
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
134
|
2588
|
|
|
|
|
|
int gp_result = marpa_g_is_precomputed(self); |
135
|
2588
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
136
|
2588
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
137
|
0
|
|
|
|
|
|
croak( "Problem in g->is_precomputed(): %s", |
138
|
|
|
|
|
|
|
xs_g_error( g_wrapper )); |
139
|
|
|
|
|
|
|
} |
140
|
2588
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
141
|
|
|
|
|
|
|
} |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
void |
144
|
|
|
|
|
|
|
nulled_symbol_activate( g_wrapper, sym_id, activate ) |
145
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
146
|
|
|
|
|
|
|
Marpa_Symbol_ID sym_id; |
147
|
|
|
|
|
|
|
int activate; |
148
|
|
|
|
|
|
|
PPCODE: |
149
|
|
|
|
|
|
|
{ |
150
|
13
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
151
|
13
|
|
|
|
|
|
int gp_result = marpa_g_nulled_symbol_activate(self, sym_id, activate); |
152
|
13
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
153
|
13
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
154
|
0
|
|
|
|
|
|
croak( "Problem in g->nulled_symbol_activate(%d, %d): %s", |
155
|
|
|
|
|
|
|
sym_id, activate, xs_g_error( g_wrapper )); |
156
|
|
|
|
|
|
|
} |
157
|
13
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
158
|
|
|
|
|
|
|
} |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
void |
161
|
|
|
|
|
|
|
precompute( g_wrapper ) |
162
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
163
|
|
|
|
|
|
|
PPCODE: |
164
|
|
|
|
|
|
|
{ |
165
|
761
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
166
|
761
|
|
|
|
|
|
int gp_result = marpa_g_precompute(self); |
167
|
761
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
168
|
761
|
100
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
50
|
|
|
|
|
|
169
|
0
|
|
|
|
|
|
croak( "Problem in g->precompute(): %s", |
170
|
|
|
|
|
|
|
xs_g_error( g_wrapper )); |
171
|
|
|
|
|
|
|
} |
172
|
761
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
void |
176
|
|
|
|
|
|
|
prediction_symbol_activate( g_wrapper, sym_id, activate ) |
177
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
178
|
|
|
|
|
|
|
Marpa_Symbol_ID sym_id; |
179
|
|
|
|
|
|
|
int activate; |
180
|
|
|
|
|
|
|
PPCODE: |
181
|
|
|
|
|
|
|
{ |
182
|
13
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
183
|
13
|
|
|
|
|
|
int gp_result = marpa_g_prediction_symbol_activate(self, sym_id, activate); |
184
|
13
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
185
|
13
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
186
|
0
|
|
|
|
|
|
croak( "Problem in g->prediction_symbol_activate(%d, %d): %s", |
187
|
|
|
|
|
|
|
sym_id, activate, xs_g_error( g_wrapper )); |
188
|
|
|
|
|
|
|
} |
189
|
13
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
190
|
|
|
|
|
|
|
} |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
void |
193
|
|
|
|
|
|
|
rule_is_accessible( g_wrapper, rule_id ) |
194
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
195
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
196
|
|
|
|
|
|
|
PPCODE: |
197
|
|
|
|
|
|
|
{ |
198
|
135
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
199
|
135
|
|
|
|
|
|
int gp_result = marpa_g_rule_is_accessible(self, rule_id); |
200
|
135
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
201
|
135
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
202
|
0
|
|
|
|
|
|
croak( "Problem in g->rule_is_accessible(%d): %s", |
203
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
204
|
|
|
|
|
|
|
} |
205
|
135
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
206
|
|
|
|
|
|
|
} |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
void |
209
|
|
|
|
|
|
|
rule_is_loop( g_wrapper, rule_id ) |
210
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
211
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
212
|
|
|
|
|
|
|
PPCODE: |
213
|
|
|
|
|
|
|
{ |
214
|
35
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
215
|
35
|
|
|
|
|
|
int gp_result = marpa_g_rule_is_loop(self, rule_id); |
216
|
35
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
217
|
35
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
218
|
0
|
|
|
|
|
|
croak( "Problem in g->rule_is_loop(%d): %s", |
219
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
220
|
|
|
|
|
|
|
} |
221
|
35
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
void |
225
|
|
|
|
|
|
|
rule_is_nullable( g_wrapper, rule_id ) |
226
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
227
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
228
|
|
|
|
|
|
|
PPCODE: |
229
|
|
|
|
|
|
|
{ |
230
|
31944
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
231
|
31944
|
|
|
|
|
|
int gp_result = marpa_g_rule_is_nullable(self, rule_id); |
232
|
31944
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
233
|
31944
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
234
|
0
|
|
|
|
|
|
croak( "Problem in g->rule_is_nullable(%d): %s", |
235
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
236
|
|
|
|
|
|
|
} |
237
|
31944
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
void |
241
|
|
|
|
|
|
|
rule_is_nulling( g_wrapper, rule_id ) |
242
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
243
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
244
|
|
|
|
|
|
|
PPCODE: |
245
|
|
|
|
|
|
|
{ |
246
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
247
|
0
|
|
|
|
|
|
int gp_result = marpa_g_rule_is_nulling(self, rule_id); |
248
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
249
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
250
|
0
|
|
|
|
|
|
croak( "Problem in g->rule_is_nulling(%d): %s", |
251
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
252
|
|
|
|
|
|
|
} |
253
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
254
|
|
|
|
|
|
|
} |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
void |
257
|
|
|
|
|
|
|
rule_is_productive( g_wrapper, rule_id ) |
258
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
259
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
260
|
|
|
|
|
|
|
PPCODE: |
261
|
|
|
|
|
|
|
{ |
262
|
135
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
263
|
135
|
|
|
|
|
|
int gp_result = marpa_g_rule_is_productive(self, rule_id); |
264
|
135
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
265
|
135
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
266
|
0
|
|
|
|
|
|
croak( "Problem in g->rule_is_productive(%d): %s", |
267
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
268
|
|
|
|
|
|
|
} |
269
|
135
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
270
|
|
|
|
|
|
|
} |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
void |
273
|
|
|
|
|
|
|
rule_is_proper_separation( g_wrapper, rule_id ) |
274
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
275
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
276
|
|
|
|
|
|
|
PPCODE: |
277
|
|
|
|
|
|
|
{ |
278
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
279
|
0
|
|
|
|
|
|
int gp_result = marpa_g_rule_is_proper_separation(self, rule_id); |
280
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
281
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
282
|
0
|
|
|
|
|
|
croak( "Problem in g->rule_is_proper_separation(%d): %s", |
283
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
284
|
|
|
|
|
|
|
} |
285
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
286
|
|
|
|
|
|
|
} |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
void |
289
|
|
|
|
|
|
|
rule_length( g_wrapper, rule_id ) |
290
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
291
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
292
|
|
|
|
|
|
|
PPCODE: |
293
|
|
|
|
|
|
|
{ |
294
|
50943
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
295
|
50943
|
|
|
|
|
|
int gp_result = marpa_g_rule_length(self, rule_id); |
296
|
50943
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
297
|
50943
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
298
|
0
|
|
|
|
|
|
croak( "Problem in g->rule_length(%d): %s", |
299
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
300
|
|
|
|
|
|
|
} |
301
|
50943
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
302
|
|
|
|
|
|
|
} |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
void |
305
|
|
|
|
|
|
|
rule_lhs( g_wrapper, rule_id ) |
306
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
307
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
308
|
|
|
|
|
|
|
PPCODE: |
309
|
|
|
|
|
|
|
{ |
310
|
102623
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
311
|
102623
|
|
|
|
|
|
int gp_result = marpa_g_rule_lhs(self, rule_id); |
312
|
102623
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
313
|
102623
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
314
|
0
|
|
|
|
|
|
croak( "Problem in g->rule_lhs(%d): %s", |
315
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
316
|
|
|
|
|
|
|
} |
317
|
102623
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
318
|
|
|
|
|
|
|
} |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
void |
321
|
|
|
|
|
|
|
rule_null_high( g_wrapper, rule_id ) |
322
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
323
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
324
|
|
|
|
|
|
|
PPCODE: |
325
|
|
|
|
|
|
|
{ |
326
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
327
|
0
|
|
|
|
|
|
int gp_result = marpa_g_rule_null_high(self, rule_id); |
328
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
329
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
330
|
0
|
|
|
|
|
|
croak( "Problem in g->rule_null_high(%d): %s", |
331
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
332
|
|
|
|
|
|
|
} |
333
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
334
|
|
|
|
|
|
|
} |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
void |
337
|
|
|
|
|
|
|
rule_null_high_set( g_wrapper, rule_id, flag ) |
338
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
339
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
340
|
|
|
|
|
|
|
int flag; |
341
|
|
|
|
|
|
|
PPCODE: |
342
|
|
|
|
|
|
|
{ |
343
|
34458
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
344
|
34458
|
|
|
|
|
|
int gp_result = marpa_g_rule_null_high_set(self, rule_id, flag); |
345
|
34458
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
346
|
34458
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
347
|
0
|
|
|
|
|
|
croak( "Problem in g->rule_null_high_set(%d, %d): %s", |
348
|
|
|
|
|
|
|
rule_id, flag, xs_g_error( g_wrapper )); |
349
|
|
|
|
|
|
|
} |
350
|
34458
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
351
|
|
|
|
|
|
|
} |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
void |
354
|
|
|
|
|
|
|
rule_rhs( g_wrapper, rule_id, ix ) |
355
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
356
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
357
|
|
|
|
|
|
|
int ix; |
358
|
|
|
|
|
|
|
PPCODE: |
359
|
|
|
|
|
|
|
{ |
360
|
13185
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
361
|
13185
|
|
|
|
|
|
int gp_result = marpa_g_rule_rhs(self, rule_id, ix); |
362
|
13185
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
363
|
13185
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
364
|
0
|
|
|
|
|
|
croak( "Problem in g->rule_rhs(%d, %d): %s", |
365
|
|
|
|
|
|
|
rule_id, ix, xs_g_error( g_wrapper )); |
366
|
|
|
|
|
|
|
} |
367
|
13185
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
368
|
|
|
|
|
|
|
} |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
void |
371
|
|
|
|
|
|
|
sequence_min( g_wrapper, rule_id ) |
372
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
373
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
374
|
|
|
|
|
|
|
PPCODE: |
375
|
|
|
|
|
|
|
{ |
376
|
34179
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
377
|
34179
|
|
|
|
|
|
int gp_result = marpa_g_sequence_min(self, rule_id); |
378
|
34179
|
100
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
379
|
1592
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
380
|
0
|
|
|
|
|
|
croak( "Problem in g->sequence_min(%d): %s", |
381
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
382
|
|
|
|
|
|
|
} |
383
|
1592
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
384
|
|
|
|
|
|
|
} |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
void |
387
|
|
|
|
|
|
|
sequence_separator( g_wrapper, rule_id ) |
388
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
389
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
390
|
|
|
|
|
|
|
PPCODE: |
391
|
|
|
|
|
|
|
{ |
392
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
393
|
0
|
|
|
|
|
|
int gp_result = marpa_g_sequence_separator(self, rule_id); |
394
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
395
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
396
|
0
|
|
|
|
|
|
croak( "Problem in g->sequence_separator(%d): %s", |
397
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
398
|
|
|
|
|
|
|
} |
399
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
400
|
|
|
|
|
|
|
} |
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
void |
403
|
|
|
|
|
|
|
start_symbol( g_wrapper ) |
404
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
405
|
|
|
|
|
|
|
PPCODE: |
406
|
|
|
|
|
|
|
{ |
407
|
1
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
408
|
1
|
|
|
|
|
|
int gp_result = marpa_g_start_symbol(self); |
409
|
1
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
410
|
1
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
411
|
0
|
|
|
|
|
|
croak( "Problem in g->start_symbol(): %s", |
412
|
|
|
|
|
|
|
xs_g_error( g_wrapper )); |
413
|
|
|
|
|
|
|
} |
414
|
1
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
415
|
|
|
|
|
|
|
} |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
void |
418
|
|
|
|
|
|
|
start_symbol_set( g_wrapper, id ) |
419
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
420
|
|
|
|
|
|
|
Marpa_Symbol_ID id; |
421
|
|
|
|
|
|
|
PPCODE: |
422
|
|
|
|
|
|
|
{ |
423
|
761
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
424
|
761
|
|
|
|
|
|
int gp_result = marpa_g_start_symbol_set(self, id); |
425
|
761
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
426
|
761
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
427
|
0
|
|
|
|
|
|
croak( "Problem in g->start_symbol_set(%d): %s", |
428
|
|
|
|
|
|
|
id, xs_g_error( g_wrapper )); |
429
|
|
|
|
|
|
|
} |
430
|
761
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
431
|
|
|
|
|
|
|
} |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
void |
434
|
|
|
|
|
|
|
symbol_is_accessible( g_wrapper, symbol_id ) |
435
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
436
|
|
|
|
|
|
|
Marpa_Symbol_ID symbol_id; |
437
|
|
|
|
|
|
|
PPCODE: |
438
|
|
|
|
|
|
|
{ |
439
|
42498
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
440
|
42498
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_accessible(self, symbol_id); |
441
|
42498
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
442
|
42498
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
443
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_accessible(%d): %s", |
444
|
|
|
|
|
|
|
symbol_id, xs_g_error( g_wrapper )); |
445
|
|
|
|
|
|
|
} |
446
|
42498
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
447
|
|
|
|
|
|
|
} |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
void |
450
|
|
|
|
|
|
|
symbol_is_completion_event( g_wrapper, sym_id ) |
451
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
452
|
|
|
|
|
|
|
Marpa_Symbol_ID sym_id; |
453
|
|
|
|
|
|
|
PPCODE: |
454
|
|
|
|
|
|
|
{ |
455
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
456
|
0
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_completion_event(self, sym_id); |
457
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
458
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
459
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_completion_event(%d): %s", |
460
|
|
|
|
|
|
|
sym_id, xs_g_error( g_wrapper )); |
461
|
|
|
|
|
|
|
} |
462
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
463
|
|
|
|
|
|
|
} |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
void |
466
|
|
|
|
|
|
|
symbol_is_completion_event_set( g_wrapper, sym_id, value ) |
467
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
468
|
|
|
|
|
|
|
Marpa_Symbol_ID sym_id; |
469
|
|
|
|
|
|
|
int value; |
470
|
|
|
|
|
|
|
PPCODE: |
471
|
|
|
|
|
|
|
{ |
472
|
54
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
473
|
54
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_completion_event_set(self, sym_id, value); |
474
|
54
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
475
|
54
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
476
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_completion_event_set(%d, %d): %s", |
477
|
|
|
|
|
|
|
sym_id, value, xs_g_error( g_wrapper )); |
478
|
|
|
|
|
|
|
} |
479
|
54
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
480
|
|
|
|
|
|
|
} |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
void |
483
|
|
|
|
|
|
|
symbol_is_counted( g_wrapper, symbol_id ) |
484
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
485
|
|
|
|
|
|
|
Marpa_Symbol_ID symbol_id; |
486
|
|
|
|
|
|
|
PPCODE: |
487
|
|
|
|
|
|
|
{ |
488
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
489
|
0
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_counted(self, symbol_id); |
490
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
491
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
492
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_counted(%d): %s", |
493
|
|
|
|
|
|
|
symbol_id, xs_g_error( g_wrapper )); |
494
|
|
|
|
|
|
|
} |
495
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
496
|
|
|
|
|
|
|
} |
497
|
|
|
|
|
|
|
|
498
|
|
|
|
|
|
|
void |
499
|
|
|
|
|
|
|
symbol_is_nullable( g_wrapper, symbol_id ) |
500
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
501
|
|
|
|
|
|
|
Marpa_Symbol_ID symbol_id; |
502
|
|
|
|
|
|
|
PPCODE: |
503
|
|
|
|
|
|
|
{ |
504
|
883
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
505
|
883
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_nullable(self, symbol_id); |
506
|
883
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
507
|
883
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
508
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_nullable(%d): %s", |
509
|
|
|
|
|
|
|
symbol_id, xs_g_error( g_wrapper )); |
510
|
|
|
|
|
|
|
} |
511
|
883
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
512
|
|
|
|
|
|
|
} |
513
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
void |
515
|
|
|
|
|
|
|
symbol_is_nulled_event( g_wrapper, sym_id ) |
516
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
517
|
|
|
|
|
|
|
Marpa_Symbol_ID sym_id; |
518
|
|
|
|
|
|
|
PPCODE: |
519
|
|
|
|
|
|
|
{ |
520
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
521
|
0
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_nulled_event(self, sym_id); |
522
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
523
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
524
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_nulled_event(%d): %s", |
525
|
|
|
|
|
|
|
sym_id, xs_g_error( g_wrapper )); |
526
|
|
|
|
|
|
|
} |
527
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
528
|
|
|
|
|
|
|
} |
529
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
void |
531
|
|
|
|
|
|
|
symbol_is_nulled_event_set( g_wrapper, sym_id, value ) |
532
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
533
|
|
|
|
|
|
|
Marpa_Symbol_ID sym_id; |
534
|
|
|
|
|
|
|
int value; |
535
|
|
|
|
|
|
|
PPCODE: |
536
|
|
|
|
|
|
|
{ |
537
|
46
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
538
|
46
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_nulled_event_set(self, sym_id, value); |
539
|
46
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
540
|
46
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
541
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_nulled_event_set(%d, %d): %s", |
542
|
|
|
|
|
|
|
sym_id, value, xs_g_error( g_wrapper )); |
543
|
|
|
|
|
|
|
} |
544
|
46
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
545
|
|
|
|
|
|
|
} |
546
|
|
|
|
|
|
|
|
547
|
|
|
|
|
|
|
void |
548
|
|
|
|
|
|
|
symbol_is_nulling( g_wrapper, symbol_id ) |
549
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
550
|
|
|
|
|
|
|
Marpa_Symbol_ID symbol_id; |
551
|
|
|
|
|
|
|
PPCODE: |
552
|
|
|
|
|
|
|
{ |
553
|
142
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
554
|
142
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_nulling(self, symbol_id); |
555
|
142
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
556
|
142
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
557
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_nulling(%d): %s", |
558
|
|
|
|
|
|
|
symbol_id, xs_g_error( g_wrapper )); |
559
|
|
|
|
|
|
|
} |
560
|
142
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
561
|
|
|
|
|
|
|
} |
562
|
|
|
|
|
|
|
|
563
|
|
|
|
|
|
|
void |
564
|
|
|
|
|
|
|
symbol_is_prediction_event( g_wrapper, sym_id ) |
565
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
566
|
|
|
|
|
|
|
Marpa_Symbol_ID sym_id; |
567
|
|
|
|
|
|
|
PPCODE: |
568
|
|
|
|
|
|
|
{ |
569
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
570
|
0
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_prediction_event(self, sym_id); |
571
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
572
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
573
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_prediction_event(%d): %s", |
574
|
|
|
|
|
|
|
sym_id, xs_g_error( g_wrapper )); |
575
|
|
|
|
|
|
|
} |
576
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
577
|
|
|
|
|
|
|
} |
578
|
|
|
|
|
|
|
|
579
|
|
|
|
|
|
|
void |
580
|
|
|
|
|
|
|
symbol_is_prediction_event_set( g_wrapper, sym_id, value ) |
581
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
582
|
|
|
|
|
|
|
Marpa_Symbol_ID sym_id; |
583
|
|
|
|
|
|
|
int value; |
584
|
|
|
|
|
|
|
PPCODE: |
585
|
|
|
|
|
|
|
{ |
586
|
52
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
587
|
52
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_prediction_event_set(self, sym_id, value); |
588
|
52
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
589
|
52
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
590
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_prediction_event_set(%d, %d): %s", |
591
|
|
|
|
|
|
|
sym_id, value, xs_g_error( g_wrapper )); |
592
|
|
|
|
|
|
|
} |
593
|
52
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
594
|
|
|
|
|
|
|
} |
595
|
|
|
|
|
|
|
|
596
|
|
|
|
|
|
|
void |
597
|
|
|
|
|
|
|
symbol_is_productive( g_wrapper, symbol_id ) |
598
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
599
|
|
|
|
|
|
|
Marpa_Symbol_ID symbol_id; |
600
|
|
|
|
|
|
|
PPCODE: |
601
|
|
|
|
|
|
|
{ |
602
|
33817
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
603
|
33817
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_productive(self, symbol_id); |
604
|
33817
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
605
|
33817
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
606
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_productive(%d): %s", |
607
|
|
|
|
|
|
|
symbol_id, xs_g_error( g_wrapper )); |
608
|
|
|
|
|
|
|
} |
609
|
33817
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
610
|
|
|
|
|
|
|
} |
611
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
void |
613
|
|
|
|
|
|
|
symbol_is_start( g_wrapper, symbol_id ) |
614
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
615
|
|
|
|
|
|
|
Marpa_Symbol_ID symbol_id; |
616
|
|
|
|
|
|
|
PPCODE: |
617
|
|
|
|
|
|
|
{ |
618
|
3
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
619
|
3
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_start(self, symbol_id); |
620
|
3
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
621
|
3
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
622
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_start(%d): %s", |
623
|
|
|
|
|
|
|
symbol_id, xs_g_error( g_wrapper )); |
624
|
|
|
|
|
|
|
} |
625
|
3
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
626
|
|
|
|
|
|
|
} |
627
|
|
|
|
|
|
|
|
628
|
|
|
|
|
|
|
void |
629
|
|
|
|
|
|
|
symbol_is_terminal( g_wrapper, symbol_id ) |
630
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
631
|
|
|
|
|
|
|
Marpa_Symbol_ID symbol_id; |
632
|
|
|
|
|
|
|
PPCODE: |
633
|
|
|
|
|
|
|
{ |
634
|
31417
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
635
|
31417
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_terminal(self, symbol_id); |
636
|
31417
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
637
|
31417
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
638
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_terminal(%d): %s", |
639
|
|
|
|
|
|
|
symbol_id, xs_g_error( g_wrapper )); |
640
|
|
|
|
|
|
|
} |
641
|
31417
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
642
|
|
|
|
|
|
|
} |
643
|
|
|
|
|
|
|
|
644
|
|
|
|
|
|
|
void |
645
|
|
|
|
|
|
|
symbol_is_terminal_set( g_wrapper, symbol_id, boolean ) |
646
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
647
|
|
|
|
|
|
|
Marpa_Symbol_ID symbol_id; |
648
|
|
|
|
|
|
|
int boolean; |
649
|
|
|
|
|
|
|
PPCODE: |
650
|
|
|
|
|
|
|
{ |
651
|
104
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
652
|
104
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_terminal_set(self, symbol_id, boolean); |
653
|
104
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
654
|
104
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
655
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_terminal_set(%d, %d): %s", |
656
|
|
|
|
|
|
|
symbol_id, boolean, xs_g_error( g_wrapper )); |
657
|
|
|
|
|
|
|
} |
658
|
104
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
659
|
|
|
|
|
|
|
} |
660
|
|
|
|
|
|
|
|
661
|
|
|
|
|
|
|
void |
662
|
|
|
|
|
|
|
symbol_is_valued( g_wrapper, symbol_id ) |
663
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
664
|
|
|
|
|
|
|
Marpa_Symbol_ID symbol_id; |
665
|
|
|
|
|
|
|
PPCODE: |
666
|
|
|
|
|
|
|
{ |
667
|
3
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
668
|
3
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_valued(self, symbol_id); |
669
|
3
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
670
|
3
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
671
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_valued(%d): %s", |
672
|
|
|
|
|
|
|
symbol_id, xs_g_error( g_wrapper )); |
673
|
|
|
|
|
|
|
} |
674
|
3
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
675
|
|
|
|
|
|
|
} |
676
|
|
|
|
|
|
|
|
677
|
|
|
|
|
|
|
void |
678
|
|
|
|
|
|
|
symbol_is_valued_set( g_wrapper, symbol_id, boolean ) |
679
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
680
|
|
|
|
|
|
|
Marpa_Symbol_ID symbol_id; |
681
|
|
|
|
|
|
|
int boolean; |
682
|
|
|
|
|
|
|
PPCODE: |
683
|
|
|
|
|
|
|
{ |
684
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
685
|
0
|
|
|
|
|
|
int gp_result = marpa_g_symbol_is_valued_set(self, symbol_id, boolean); |
686
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
687
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
688
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_is_valued_set(%d, %d): %s", |
689
|
|
|
|
|
|
|
symbol_id, boolean, xs_g_error( g_wrapper )); |
690
|
|
|
|
|
|
|
} |
691
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
692
|
|
|
|
|
|
|
} |
693
|
|
|
|
|
|
|
|
694
|
|
|
|
|
|
|
void |
695
|
|
|
|
|
|
|
symbol_new( g_wrapper ) |
696
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
697
|
|
|
|
|
|
|
PPCODE: |
698
|
|
|
|
|
|
|
{ |
699
|
50716
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
700
|
50716
|
|
|
|
|
|
int gp_result = marpa_g_symbol_new(self); |
701
|
50716
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
702
|
50716
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
703
|
0
|
|
|
|
|
|
croak( "Problem in g->symbol_new(): %s", |
704
|
|
|
|
|
|
|
xs_g_error( g_wrapper )); |
705
|
|
|
|
|
|
|
} |
706
|
50716
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
707
|
|
|
|
|
|
|
} |
708
|
|
|
|
|
|
|
|
709
|
|
|
|
|
|
|
void |
710
|
|
|
|
|
|
|
zwa_new( g_wrapper, default_value ) |
711
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
712
|
|
|
|
|
|
|
int default_value; |
713
|
|
|
|
|
|
|
PPCODE: |
714
|
|
|
|
|
|
|
{ |
715
|
8243
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
716
|
8243
|
|
|
|
|
|
int gp_result = marpa_g_zwa_new(self, default_value); |
717
|
8243
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
718
|
8243
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
719
|
0
|
|
|
|
|
|
croak( "Problem in g->zwa_new(%d): %s", |
720
|
|
|
|
|
|
|
default_value, xs_g_error( g_wrapper )); |
721
|
|
|
|
|
|
|
} |
722
|
8243
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
723
|
|
|
|
|
|
|
} |
724
|
|
|
|
|
|
|
|
725
|
|
|
|
|
|
|
void |
726
|
|
|
|
|
|
|
zwa_place( g_wrapper, zwaid, xrl_id, rhs_ix ) |
727
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
728
|
|
|
|
|
|
|
Marpa_Assertion_ID zwaid; |
729
|
|
|
|
|
|
|
Marpa_Rule_ID xrl_id; |
730
|
|
|
|
|
|
|
int rhs_ix; |
731
|
|
|
|
|
|
|
PPCODE: |
732
|
|
|
|
|
|
|
{ |
733
|
8243
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
734
|
8243
|
|
|
|
|
|
int gp_result = marpa_g_zwa_place(self, zwaid, xrl_id, rhs_ix); |
735
|
8243
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
736
|
8243
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
737
|
0
|
|
|
|
|
|
croak( "Problem in g->zwa_place(%d, %d, %d): %s", |
738
|
|
|
|
|
|
|
zwaid, xrl_id, rhs_ix, xs_g_error( g_wrapper )); |
739
|
|
|
|
|
|
|
} |
740
|
8243
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
741
|
|
|
|
|
|
|
} |
742
|
|
|
|
|
|
|
|
743
|
|
|
|
|
|
|
MODULE = Marpa::R2 PACKAGE = Marpa::R2::Thin::R |
744
|
|
|
|
|
|
|
|
745
|
|
|
|
|
|
|
void |
746
|
|
|
|
|
|
|
completion_symbol_activate( r_wrapper, sym_id, reactivate ) |
747
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
748
|
|
|
|
|
|
|
Marpa_Symbol_ID sym_id; |
749
|
|
|
|
|
|
|
int reactivate; |
750
|
|
|
|
|
|
|
PPCODE: |
751
|
|
|
|
|
|
|
{ |
752
|
252
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
753
|
252
|
|
|
|
|
|
int gp_result = marpa_r_completion_symbol_activate(self, sym_id, reactivate); |
754
|
252
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
755
|
252
|
50
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
756
|
0
|
|
|
|
|
|
croak( "Problem in r->completion_symbol_activate(%d, %d): %s", |
757
|
|
|
|
|
|
|
sym_id, reactivate, xs_g_error( r_wrapper->base )); |
758
|
|
|
|
|
|
|
} |
759
|
252
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
760
|
|
|
|
|
|
|
} |
761
|
|
|
|
|
|
|
|
762
|
|
|
|
|
|
|
void |
763
|
|
|
|
|
|
|
current_earleme( r_wrapper ) |
764
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
765
|
|
|
|
|
|
|
PPCODE: |
766
|
|
|
|
|
|
|
{ |
767
|
28191
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
768
|
28191
|
|
|
|
|
|
int gp_result = marpa_r_current_earleme(self); |
769
|
28191
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
770
|
28191
|
50
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
771
|
0
|
|
|
|
|
|
croak( "Problem in r->current_earleme(): %s", |
772
|
|
|
|
|
|
|
xs_g_error( r_wrapper->base )); |
773
|
|
|
|
|
|
|
} |
774
|
28191
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
775
|
|
|
|
|
|
|
} |
776
|
|
|
|
|
|
|
|
777
|
|
|
|
|
|
|
void |
778
|
|
|
|
|
|
|
earleme( r_wrapper, ordinal ) |
779
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
780
|
|
|
|
|
|
|
Marpa_Earley_Set_ID ordinal; |
781
|
|
|
|
|
|
|
PPCODE: |
782
|
|
|
|
|
|
|
{ |
783
|
17195
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
784
|
17195
|
|
|
|
|
|
int gp_result = marpa_r_earleme(self, ordinal); |
785
|
17195
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
786
|
17195
|
50
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
787
|
0
|
|
|
|
|
|
croak( "Problem in r->earleme(%d): %s", |
788
|
|
|
|
|
|
|
ordinal, xs_g_error( r_wrapper->base )); |
789
|
|
|
|
|
|
|
} |
790
|
17195
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
791
|
|
|
|
|
|
|
} |
792
|
|
|
|
|
|
|
|
793
|
|
|
|
|
|
|
void |
794
|
|
|
|
|
|
|
earleme_complete( r_wrapper ) |
795
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
796
|
|
|
|
|
|
|
PPCODE: |
797
|
|
|
|
|
|
|
{ |
798
|
34421
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
799
|
34421
|
|
|
|
|
|
int gp_result = marpa_r_earleme_complete(self); |
800
|
34421
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
801
|
34421
|
50
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
802
|
0
|
|
|
|
|
|
croak( "Problem in r->earleme_complete(): %s", |
803
|
|
|
|
|
|
|
xs_g_error( r_wrapper->base )); |
804
|
|
|
|
|
|
|
} |
805
|
34421
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
806
|
|
|
|
|
|
|
} |
807
|
|
|
|
|
|
|
|
808
|
|
|
|
|
|
|
void |
809
|
|
|
|
|
|
|
earley_item_warning_threshold( r_wrapper ) |
810
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
811
|
|
|
|
|
|
|
PPCODE: |
812
|
|
|
|
|
|
|
{ |
813
|
0
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
814
|
0
|
|
|
|
|
|
int gp_result = marpa_r_earley_item_warning_threshold(self); |
815
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
816
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
817
|
0
|
|
|
|
|
|
croak( "Problem in r->earley_item_warning_threshold(): %s", |
818
|
|
|
|
|
|
|
xs_g_error( r_wrapper->base )); |
819
|
|
|
|
|
|
|
} |
820
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
821
|
|
|
|
|
|
|
} |
822
|
|
|
|
|
|
|
|
823
|
|
|
|
|
|
|
void |
824
|
|
|
|
|
|
|
earley_item_warning_threshold_set( r_wrapper, too_many_earley_items ) |
825
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
826
|
|
|
|
|
|
|
int too_many_earley_items; |
827
|
|
|
|
|
|
|
PPCODE: |
828
|
|
|
|
|
|
|
{ |
829
|
2
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
830
|
2
|
|
|
|
|
|
int gp_result = marpa_r_earley_item_warning_threshold_set(self, too_many_earley_items); |
831
|
2
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
832
|
2
|
50
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
833
|
0
|
|
|
|
|
|
croak( "Problem in r->earley_item_warning_threshold_set(%d): %s", |
834
|
|
|
|
|
|
|
too_many_earley_items, xs_g_error( r_wrapper->base )); |
835
|
|
|
|
|
|
|
} |
836
|
2
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
837
|
|
|
|
|
|
|
} |
838
|
|
|
|
|
|
|
|
839
|
|
|
|
|
|
|
void |
840
|
|
|
|
|
|
|
earley_set_value( r_wrapper, ordinal ) |
841
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
842
|
|
|
|
|
|
|
Marpa_Earley_Set_ID ordinal; |
843
|
|
|
|
|
|
|
PPCODE: |
844
|
|
|
|
|
|
|
{ |
845
|
0
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
846
|
0
|
|
|
|
|
|
int gp_result = marpa_r_earley_set_value(self, ordinal); |
847
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
848
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
849
|
0
|
|
|
|
|
|
croak( "Problem in r->earley_set_value(%d): %s", |
850
|
|
|
|
|
|
|
ordinal, xs_g_error( r_wrapper->base )); |
851
|
|
|
|
|
|
|
} |
852
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
853
|
|
|
|
|
|
|
} |
854
|
|
|
|
|
|
|
|
855
|
|
|
|
|
|
|
void |
856
|
|
|
|
|
|
|
expected_symbol_event_set( r_wrapper, xsyid, value ) |
857
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
858
|
|
|
|
|
|
|
Marpa_Symbol_ID xsyid; |
859
|
|
|
|
|
|
|
int value; |
860
|
|
|
|
|
|
|
PPCODE: |
861
|
|
|
|
|
|
|
{ |
862
|
25
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
863
|
25
|
|
|
|
|
|
int gp_result = marpa_r_expected_symbol_event_set(self, xsyid, value); |
864
|
25
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
865
|
25
|
50
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
866
|
0
|
|
|
|
|
|
croak( "Problem in r->expected_symbol_event_set(%d, %d): %s", |
867
|
|
|
|
|
|
|
xsyid, value, xs_g_error( r_wrapper->base )); |
868
|
|
|
|
|
|
|
} |
869
|
25
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
870
|
|
|
|
|
|
|
} |
871
|
|
|
|
|
|
|
|
872
|
|
|
|
|
|
|
void |
873
|
|
|
|
|
|
|
furthest_earleme( r_wrapper ) |
874
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
875
|
|
|
|
|
|
|
PPCODE: |
876
|
|
|
|
|
|
|
{ |
877
|
4044
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
878
|
4044
|
|
|
|
|
|
int gp_result = marpa_r_furthest_earleme(self); |
879
|
4044
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
880
|
4044
|
50
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
881
|
0
|
|
|
|
|
|
croak( "Problem in r->furthest_earleme(): %s", |
882
|
|
|
|
|
|
|
xs_g_error( r_wrapper->base )); |
883
|
|
|
|
|
|
|
} |
884
|
4044
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
885
|
|
|
|
|
|
|
} |
886
|
|
|
|
|
|
|
|
887
|
|
|
|
|
|
|
void |
888
|
|
|
|
|
|
|
is_exhausted( r_wrapper ) |
889
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
890
|
|
|
|
|
|
|
PPCODE: |
891
|
|
|
|
|
|
|
{ |
892
|
321
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
893
|
321
|
|
|
|
|
|
int gp_result = marpa_r_is_exhausted(self); |
894
|
321
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
895
|
321
|
50
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
896
|
0
|
|
|
|
|
|
croak( "Problem in r->is_exhausted(): %s", |
897
|
|
|
|
|
|
|
xs_g_error( r_wrapper->base )); |
898
|
|
|
|
|
|
|
} |
899
|
321
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
900
|
|
|
|
|
|
|
} |
901
|
|
|
|
|
|
|
|
902
|
|
|
|
|
|
|
void |
903
|
|
|
|
|
|
|
latest_earley_set( r_wrapper ) |
904
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
905
|
|
|
|
|
|
|
PPCODE: |
906
|
|
|
|
|
|
|
{ |
907
|
11349
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
908
|
11349
|
|
|
|
|
|
int gp_result = marpa_r_latest_earley_set(self); |
909
|
11349
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
910
|
11349
|
50
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
911
|
0
|
|
|
|
|
|
croak( "Problem in r->latest_earley_set(): %s", |
912
|
|
|
|
|
|
|
xs_g_error( r_wrapper->base )); |
913
|
|
|
|
|
|
|
} |
914
|
11349
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
915
|
|
|
|
|
|
|
} |
916
|
|
|
|
|
|
|
|
917
|
|
|
|
|
|
|
void |
918
|
|
|
|
|
|
|
latest_earley_set_value_set( r_wrapper, value ) |
919
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
920
|
|
|
|
|
|
|
int value; |
921
|
|
|
|
|
|
|
PPCODE: |
922
|
|
|
|
|
|
|
{ |
923
|
0
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
924
|
0
|
|
|
|
|
|
int gp_result = marpa_r_latest_earley_set_value_set(self, value); |
925
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
926
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
927
|
0
|
|
|
|
|
|
croak( "Problem in r->latest_earley_set_value_set(%d): %s", |
928
|
|
|
|
|
|
|
value, xs_g_error( r_wrapper->base )); |
929
|
|
|
|
|
|
|
} |
930
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
931
|
|
|
|
|
|
|
} |
932
|
|
|
|
|
|
|
|
933
|
|
|
|
|
|
|
void |
934
|
|
|
|
|
|
|
nulled_symbol_activate( r_wrapper, sym_id, reactivate ) |
935
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
936
|
|
|
|
|
|
|
Marpa_Symbol_ID sym_id; |
937
|
|
|
|
|
|
|
int reactivate; |
938
|
|
|
|
|
|
|
PPCODE: |
939
|
|
|
|
|
|
|
{ |
940
|
96
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
941
|
96
|
|
|
|
|
|
int gp_result = marpa_r_nulled_symbol_activate(self, sym_id, reactivate); |
942
|
96
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
943
|
96
|
50
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
944
|
0
|
|
|
|
|
|
croak( "Problem in r->nulled_symbol_activate(%d, %d): %s", |
945
|
|
|
|
|
|
|
sym_id, reactivate, xs_g_error( r_wrapper->base )); |
946
|
|
|
|
|
|
|
} |
947
|
96
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
948
|
|
|
|
|
|
|
} |
949
|
|
|
|
|
|
|
|
950
|
|
|
|
|
|
|
void |
951
|
|
|
|
|
|
|
prediction_symbol_activate( r_wrapper, sym_id, reactivate ) |
952
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
953
|
|
|
|
|
|
|
Marpa_Symbol_ID sym_id; |
954
|
|
|
|
|
|
|
int reactivate; |
955
|
|
|
|
|
|
|
PPCODE: |
956
|
|
|
|
|
|
|
{ |
957
|
239
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
958
|
239
|
|
|
|
|
|
int gp_result = marpa_r_prediction_symbol_activate(self, sym_id, reactivate); |
959
|
239
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
960
|
239
|
50
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
961
|
0
|
|
|
|
|
|
croak( "Problem in r->prediction_symbol_activate(%d, %d): %s", |
962
|
|
|
|
|
|
|
sym_id, reactivate, xs_g_error( r_wrapper->base )); |
963
|
|
|
|
|
|
|
} |
964
|
239
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
965
|
|
|
|
|
|
|
} |
966
|
|
|
|
|
|
|
|
967
|
|
|
|
|
|
|
void |
968
|
|
|
|
|
|
|
progress_report_finish( r_wrapper ) |
969
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
970
|
|
|
|
|
|
|
PPCODE: |
971
|
|
|
|
|
|
|
{ |
972
|
360
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
973
|
360
|
|
|
|
|
|
int gp_result = marpa_r_progress_report_finish(self); |
974
|
360
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
975
|
360
|
50
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
976
|
0
|
|
|
|
|
|
croak( "Problem in r->progress_report_finish(): %s", |
977
|
|
|
|
|
|
|
xs_g_error( r_wrapper->base )); |
978
|
|
|
|
|
|
|
} |
979
|
360
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
980
|
|
|
|
|
|
|
} |
981
|
|
|
|
|
|
|
|
982
|
|
|
|
|
|
|
void |
983
|
|
|
|
|
|
|
progress_report_start( r_wrapper, ordinal ) |
984
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
985
|
|
|
|
|
|
|
Marpa_Earley_Set_ID ordinal; |
986
|
|
|
|
|
|
|
PPCODE: |
987
|
|
|
|
|
|
|
{ |
988
|
360
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
989
|
360
|
|
|
|
|
|
int gp_result = marpa_r_progress_report_start(self, ordinal); |
990
|
360
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
991
|
360
|
50
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
992
|
0
|
|
|
|
|
|
croak( "Problem in r->progress_report_start(%d): %s", |
993
|
|
|
|
|
|
|
ordinal, xs_g_error( r_wrapper->base )); |
994
|
|
|
|
|
|
|
} |
995
|
360
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
996
|
|
|
|
|
|
|
} |
997
|
|
|
|
|
|
|
|
998
|
|
|
|
|
|
|
void |
999
|
|
|
|
|
|
|
terminal_is_expected( r_wrapper, xsyid ) |
1000
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
1001
|
|
|
|
|
|
|
Marpa_Symbol_ID xsyid; |
1002
|
|
|
|
|
|
|
PPCODE: |
1003
|
|
|
|
|
|
|
{ |
1004
|
0
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
1005
|
0
|
|
|
|
|
|
int gp_result = marpa_r_terminal_is_expected(self, xsyid); |
1006
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1007
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1008
|
0
|
|
|
|
|
|
croak( "Problem in r->terminal_is_expected(%d): %s", |
1009
|
|
|
|
|
|
|
xsyid, xs_g_error( r_wrapper->base )); |
1010
|
|
|
|
|
|
|
} |
1011
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1012
|
|
|
|
|
|
|
} |
1013
|
|
|
|
|
|
|
|
1014
|
|
|
|
|
|
|
void |
1015
|
|
|
|
|
|
|
zwa_default( r_wrapper, zwaid ) |
1016
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
1017
|
|
|
|
|
|
|
Marpa_Assertion_ID zwaid; |
1018
|
|
|
|
|
|
|
PPCODE: |
1019
|
|
|
|
|
|
|
{ |
1020
|
0
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
1021
|
0
|
|
|
|
|
|
int gp_result = marpa_r_zwa_default(self, zwaid); |
1022
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1023
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1024
|
0
|
|
|
|
|
|
croak( "Problem in r->zwa_default(%d): %s", |
1025
|
|
|
|
|
|
|
zwaid, xs_g_error( r_wrapper->base )); |
1026
|
|
|
|
|
|
|
} |
1027
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1028
|
|
|
|
|
|
|
} |
1029
|
|
|
|
|
|
|
|
1030
|
|
|
|
|
|
|
void |
1031
|
|
|
|
|
|
|
zwa_default_set( r_wrapper, zwaid, default_value ) |
1032
|
|
|
|
|
|
|
R_Wrapper *r_wrapper; |
1033
|
|
|
|
|
|
|
Marpa_Assertion_ID zwaid; |
1034
|
|
|
|
|
|
|
int default_value; |
1035
|
|
|
|
|
|
|
PPCODE: |
1036
|
|
|
|
|
|
|
{ |
1037
|
0
|
|
|
|
|
|
Marpa_Recognizer self = r_wrapper->r; |
1038
|
0
|
|
|
|
|
|
int gp_result = marpa_r_zwa_default_set(self, zwaid, default_value); |
1039
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1040
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && r_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1041
|
0
|
|
|
|
|
|
croak( "Problem in r->zwa_default_set(%d, %d): %s", |
1042
|
|
|
|
|
|
|
zwaid, default_value, xs_g_error( r_wrapper->base )); |
1043
|
|
|
|
|
|
|
} |
1044
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1045
|
|
|
|
|
|
|
} |
1046
|
|
|
|
|
|
|
|
1047
|
|
|
|
|
|
|
MODULE = Marpa::R2 PACKAGE = Marpa::R2::Thin::B |
1048
|
|
|
|
|
|
|
|
1049
|
|
|
|
|
|
|
void |
1050
|
|
|
|
|
|
|
ambiguity_metric( b_wrapper ) |
1051
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1052
|
|
|
|
|
|
|
PPCODE: |
1053
|
|
|
|
|
|
|
{ |
1054
|
1
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1055
|
1
|
|
|
|
|
|
int gp_result = marpa_b_ambiguity_metric(self); |
1056
|
1
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1057
|
1
|
50
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1058
|
0
|
|
|
|
|
|
croak( "Problem in b->ambiguity_metric(): %s", |
1059
|
|
|
|
|
|
|
xs_g_error( b_wrapper->base )); |
1060
|
|
|
|
|
|
|
} |
1061
|
1
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1062
|
|
|
|
|
|
|
} |
1063
|
|
|
|
|
|
|
|
1064
|
|
|
|
|
|
|
void |
1065
|
|
|
|
|
|
|
is_null( b_wrapper ) |
1066
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1067
|
|
|
|
|
|
|
PPCODE: |
1068
|
|
|
|
|
|
|
{ |
1069
|
0
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1070
|
0
|
|
|
|
|
|
int gp_result = marpa_b_is_null(self); |
1071
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1072
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1073
|
0
|
|
|
|
|
|
croak( "Problem in b->is_null(): %s", |
1074
|
|
|
|
|
|
|
xs_g_error( b_wrapper->base )); |
1075
|
|
|
|
|
|
|
} |
1076
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1077
|
|
|
|
|
|
|
} |
1078
|
|
|
|
|
|
|
|
1079
|
|
|
|
|
|
|
MODULE = Marpa::R2 PACKAGE = Marpa::R2::Thin::O |
1080
|
|
|
|
|
|
|
|
1081
|
|
|
|
|
|
|
void |
1082
|
|
|
|
|
|
|
ambiguity_metric( o_wrapper ) |
1083
|
|
|
|
|
|
|
O_Wrapper *o_wrapper; |
1084
|
|
|
|
|
|
|
PPCODE: |
1085
|
|
|
|
|
|
|
{ |
1086
|
229
|
|
|
|
|
|
Marpa_Order self = o_wrapper->o; |
1087
|
229
|
|
|
|
|
|
int gp_result = marpa_o_ambiguity_metric(self); |
1088
|
229
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1089
|
229
|
50
|
|
|
|
|
if ( gp_result < 0 && o_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1090
|
0
|
|
|
|
|
|
croak( "Problem in o->ambiguity_metric(): %s", |
1091
|
|
|
|
|
|
|
xs_g_error( o_wrapper->base )); |
1092
|
|
|
|
|
|
|
} |
1093
|
229
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1094
|
|
|
|
|
|
|
} |
1095
|
|
|
|
|
|
|
|
1096
|
|
|
|
|
|
|
void |
1097
|
|
|
|
|
|
|
high_rank_only_set( o_wrapper, flag ) |
1098
|
|
|
|
|
|
|
O_Wrapper *o_wrapper; |
1099
|
|
|
|
|
|
|
int flag; |
1100
|
|
|
|
|
|
|
PPCODE: |
1101
|
|
|
|
|
|
|
{ |
1102
|
99
|
|
|
|
|
|
Marpa_Order self = o_wrapper->o; |
1103
|
99
|
|
|
|
|
|
int gp_result = marpa_o_high_rank_only_set(self, flag); |
1104
|
99
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1105
|
99
|
50
|
|
|
|
|
if ( gp_result < 0 && o_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1106
|
0
|
|
|
|
|
|
croak( "Problem in o->high_rank_only_set(%d): %s", |
1107
|
|
|
|
|
|
|
flag, xs_g_error( o_wrapper->base )); |
1108
|
|
|
|
|
|
|
} |
1109
|
99
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1110
|
|
|
|
|
|
|
} |
1111
|
|
|
|
|
|
|
|
1112
|
|
|
|
|
|
|
void |
1113
|
|
|
|
|
|
|
high_rank_only( o_wrapper ) |
1114
|
|
|
|
|
|
|
O_Wrapper *o_wrapper; |
1115
|
|
|
|
|
|
|
PPCODE: |
1116
|
|
|
|
|
|
|
{ |
1117
|
0
|
|
|
|
|
|
Marpa_Order self = o_wrapper->o; |
1118
|
0
|
|
|
|
|
|
int gp_result = marpa_o_high_rank_only(self); |
1119
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1120
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && o_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1121
|
0
|
|
|
|
|
|
croak( "Problem in o->high_rank_only(): %s", |
1122
|
|
|
|
|
|
|
xs_g_error( o_wrapper->base )); |
1123
|
|
|
|
|
|
|
} |
1124
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1125
|
|
|
|
|
|
|
} |
1126
|
|
|
|
|
|
|
|
1127
|
|
|
|
|
|
|
void |
1128
|
|
|
|
|
|
|
is_null( o_wrapper ) |
1129
|
|
|
|
|
|
|
O_Wrapper *o_wrapper; |
1130
|
|
|
|
|
|
|
PPCODE: |
1131
|
|
|
|
|
|
|
{ |
1132
|
49
|
|
|
|
|
|
Marpa_Order self = o_wrapper->o; |
1133
|
49
|
|
|
|
|
|
int gp_result = marpa_o_is_null(self); |
1134
|
49
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1135
|
49
|
50
|
|
|
|
|
if ( gp_result < 0 && o_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1136
|
0
|
|
|
|
|
|
croak( "Problem in o->is_null(): %s", |
1137
|
|
|
|
|
|
|
xs_g_error( o_wrapper->base )); |
1138
|
|
|
|
|
|
|
} |
1139
|
49
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1140
|
|
|
|
|
|
|
} |
1141
|
|
|
|
|
|
|
|
1142
|
|
|
|
|
|
|
void |
1143
|
|
|
|
|
|
|
rank( o_wrapper ) |
1144
|
|
|
|
|
|
|
O_Wrapper *o_wrapper; |
1145
|
|
|
|
|
|
|
PPCODE: |
1146
|
|
|
|
|
|
|
{ |
1147
|
99
|
|
|
|
|
|
Marpa_Order self = o_wrapper->o; |
1148
|
99
|
|
|
|
|
|
int gp_result = marpa_o_rank(self); |
1149
|
99
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1150
|
99
|
50
|
|
|
|
|
if ( gp_result < 0 && o_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1151
|
0
|
|
|
|
|
|
croak( "Problem in o->rank(): %s", |
1152
|
|
|
|
|
|
|
xs_g_error( o_wrapper->base )); |
1153
|
|
|
|
|
|
|
} |
1154
|
99
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1155
|
|
|
|
|
|
|
} |
1156
|
|
|
|
|
|
|
|
1157
|
|
|
|
|
|
|
MODULE = Marpa::R2 PACKAGE = Marpa::R2::Thin::T |
1158
|
|
|
|
|
|
|
|
1159
|
|
|
|
|
|
|
void |
1160
|
|
|
|
|
|
|
next( t_wrapper ) |
1161
|
|
|
|
|
|
|
T_Wrapper *t_wrapper; |
1162
|
|
|
|
|
|
|
PPCODE: |
1163
|
|
|
|
|
|
|
{ |
1164
|
4033
|
|
|
|
|
|
Marpa_Tree self = t_wrapper->t; |
1165
|
4033
|
|
|
|
|
|
int gp_result = marpa_t_next(self); |
1166
|
4033
|
100
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1167
|
3923
|
50
|
|
|
|
|
if ( gp_result < 0 && t_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1168
|
0
|
|
|
|
|
|
croak( "Problem in t->next(): %s", |
1169
|
|
|
|
|
|
|
xs_g_error( t_wrapper->base )); |
1170
|
|
|
|
|
|
|
} |
1171
|
3923
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1172
|
|
|
|
|
|
|
} |
1173
|
|
|
|
|
|
|
|
1174
|
|
|
|
|
|
|
void |
1175
|
|
|
|
|
|
|
parse_count( t_wrapper ) |
1176
|
|
|
|
|
|
|
T_Wrapper *t_wrapper; |
1177
|
|
|
|
|
|
|
PPCODE: |
1178
|
|
|
|
|
|
|
{ |
1179
|
2776
|
|
|
|
|
|
Marpa_Tree self = t_wrapper->t; |
1180
|
2776
|
|
|
|
|
|
int gp_result = marpa_t_parse_count(self); |
1181
|
2776
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1182
|
2776
|
50
|
|
|
|
|
if ( gp_result < 0 && t_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1183
|
0
|
|
|
|
|
|
croak( "Problem in t->parse_count(): %s", |
1184
|
|
|
|
|
|
|
xs_g_error( t_wrapper->base )); |
1185
|
|
|
|
|
|
|
} |
1186
|
2776
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1187
|
|
|
|
|
|
|
} |
1188
|
|
|
|
|
|
|
|
1189
|
|
|
|
|
|
|
MODULE = Marpa::R2 PACKAGE = Marpa::R2::Thin::V |
1190
|
|
|
|
|
|
|
|
1191
|
|
|
|
|
|
|
void |
1192
|
|
|
|
|
|
|
valued_force( v_wrapper ) |
1193
|
|
|
|
|
|
|
V_Wrapper *v_wrapper; |
1194
|
|
|
|
|
|
|
PPCODE: |
1195
|
|
|
|
|
|
|
{ |
1196
|
2281
|
|
|
|
|
|
Marpa_Value self = v_wrapper->v; |
1197
|
2281
|
|
|
|
|
|
int gp_result = marpa_v_valued_force(self); |
1198
|
2281
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1199
|
2281
|
50
|
|
|
|
|
if ( gp_result < 0 && v_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1200
|
0
|
|
|
|
|
|
croak( "Problem in v->valued_force(): %s", |
1201
|
|
|
|
|
|
|
xs_g_error( v_wrapper->base )); |
1202
|
|
|
|
|
|
|
} |
1203
|
2281
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1204
|
|
|
|
|
|
|
} |
1205
|
|
|
|
|
|
|
|
1206
|
|
|
|
|
|
|
void |
1207
|
|
|
|
|
|
|
rule_is_valued_set( v_wrapper, symbol_id, value ) |
1208
|
|
|
|
|
|
|
V_Wrapper *v_wrapper; |
1209
|
|
|
|
|
|
|
Marpa_Rule_ID symbol_id; |
1210
|
|
|
|
|
|
|
int value; |
1211
|
|
|
|
|
|
|
PPCODE: |
1212
|
|
|
|
|
|
|
{ |
1213
|
14856
|
|
|
|
|
|
Marpa_Value self = v_wrapper->v; |
1214
|
14856
|
|
|
|
|
|
int gp_result = marpa_v_rule_is_valued_set(self, symbol_id, value); |
1215
|
14856
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1216
|
14856
|
50
|
|
|
|
|
if ( gp_result < 0 && v_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1217
|
0
|
|
|
|
|
|
croak( "Problem in v->rule_is_valued_set(%d, %d): %s", |
1218
|
|
|
|
|
|
|
symbol_id, value, xs_g_error( v_wrapper->base )); |
1219
|
|
|
|
|
|
|
} |
1220
|
14856
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1221
|
|
|
|
|
|
|
} |
1222
|
|
|
|
|
|
|
|
1223
|
|
|
|
|
|
|
void |
1224
|
|
|
|
|
|
|
symbol_is_valued_set( v_wrapper, symbol_id, value ) |
1225
|
|
|
|
|
|
|
V_Wrapper *v_wrapper; |
1226
|
|
|
|
|
|
|
Marpa_Symbol_ID symbol_id; |
1227
|
|
|
|
|
|
|
int value; |
1228
|
|
|
|
|
|
|
PPCODE: |
1229
|
|
|
|
|
|
|
{ |
1230
|
0
|
|
|
|
|
|
Marpa_Value self = v_wrapper->v; |
1231
|
0
|
|
|
|
|
|
int gp_result = marpa_v_symbol_is_valued_set(self, symbol_id, value); |
1232
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1233
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && v_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1234
|
0
|
|
|
|
|
|
croak( "Problem in v->symbol_is_valued_set(%d, %d): %s", |
1235
|
|
|
|
|
|
|
symbol_id, value, xs_g_error( v_wrapper->base )); |
1236
|
|
|
|
|
|
|
} |
1237
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1238
|
|
|
|
|
|
|
} |
1239
|
|
|
|
|
|
|
|
1240
|
|
|
|
|
|
|
MODULE = Marpa::R2 PACKAGE = Marpa::R2::Thin::G |
1241
|
|
|
|
|
|
|
|
1242
|
|
|
|
|
|
|
void |
1243
|
|
|
|
|
|
|
_marpa_g_rule_is_keep_separation( g_wrapper, rule_id ) |
1244
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
1245
|
|
|
|
|
|
|
Marpa_Rule_ID rule_id; |
1246
|
|
|
|
|
|
|
PPCODE: |
1247
|
|
|
|
|
|
|
{ |
1248
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
1249
|
0
|
|
|
|
|
|
int gp_result = _marpa_g_rule_is_keep_separation(self, rule_id); |
1250
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1251
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
1252
|
0
|
|
|
|
|
|
croak( "Problem in g->_marpa_g_rule_is_keep_separation(%d): %s", |
1253
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
1254
|
|
|
|
|
|
|
} |
1255
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1256
|
|
|
|
|
|
|
} |
1257
|
|
|
|
|
|
|
|
1258
|
|
|
|
|
|
|
void |
1259
|
|
|
|
|
|
|
_marpa_g_irl_lhs( g_wrapper, rule_id ) |
1260
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
1261
|
|
|
|
|
|
|
Marpa_IRL_ID rule_id; |
1262
|
|
|
|
|
|
|
PPCODE: |
1263
|
|
|
|
|
|
|
{ |
1264
|
1054
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
1265
|
1054
|
|
|
|
|
|
int gp_result = _marpa_g_irl_lhs(self, rule_id); |
1266
|
1054
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1267
|
1054
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
1268
|
0
|
|
|
|
|
|
croak( "Problem in g->_marpa_g_irl_lhs(%d): %s", |
1269
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
1270
|
|
|
|
|
|
|
} |
1271
|
1054
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1272
|
|
|
|
|
|
|
} |
1273
|
|
|
|
|
|
|
|
1274
|
|
|
|
|
|
|
void |
1275
|
|
|
|
|
|
|
_marpa_g_irl_rhs( g_wrapper, rule_id, ix ) |
1276
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
1277
|
|
|
|
|
|
|
Marpa_IRL_ID rule_id; |
1278
|
|
|
|
|
|
|
int ix; |
1279
|
|
|
|
|
|
|
PPCODE: |
1280
|
|
|
|
|
|
|
{ |
1281
|
48056
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
1282
|
48056
|
|
|
|
|
|
int gp_result = _marpa_g_irl_rhs(self, rule_id, ix); |
1283
|
48056
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1284
|
48056
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
1285
|
0
|
|
|
|
|
|
croak( "Problem in g->_marpa_g_irl_rhs(%d, %d): %s", |
1286
|
|
|
|
|
|
|
rule_id, ix, xs_g_error( g_wrapper )); |
1287
|
|
|
|
|
|
|
} |
1288
|
48056
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1289
|
|
|
|
|
|
|
} |
1290
|
|
|
|
|
|
|
|
1291
|
|
|
|
|
|
|
void |
1292
|
|
|
|
|
|
|
_marpa_g_irl_length( g_wrapper, rule_id ) |
1293
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
1294
|
|
|
|
|
|
|
Marpa_IRL_ID rule_id; |
1295
|
|
|
|
|
|
|
PPCODE: |
1296
|
|
|
|
|
|
|
{ |
1297
|
1086
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
1298
|
1086
|
|
|
|
|
|
int gp_result = _marpa_g_irl_length(self, rule_id); |
1299
|
1086
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1300
|
1086
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
1301
|
0
|
|
|
|
|
|
croak( "Problem in g->_marpa_g_irl_length(%d): %s", |
1302
|
|
|
|
|
|
|
rule_id, xs_g_error( g_wrapper )); |
1303
|
|
|
|
|
|
|
} |
1304
|
1086
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1305
|
|
|
|
|
|
|
} |
1306
|
|
|
|
|
|
|
|
1307
|
|
|
|
|
|
|
void |
1308
|
|
|
|
|
|
|
_marpa_g_irl_rank( g_wrapper, irl_id ) |
1309
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
1310
|
|
|
|
|
|
|
Marpa_IRL_ID irl_id; |
1311
|
|
|
|
|
|
|
PPCODE: |
1312
|
|
|
|
|
|
|
{ |
1313
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
1314
|
0
|
|
|
|
|
|
int gp_result = _marpa_g_irl_rank(self, irl_id); |
1315
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1316
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
1317
|
0
|
|
|
|
|
|
croak( "Problem in g->_marpa_g_irl_rank(%d): %s", |
1318
|
|
|
|
|
|
|
irl_id, xs_g_error( g_wrapper )); |
1319
|
|
|
|
|
|
|
} |
1320
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1321
|
|
|
|
|
|
|
} |
1322
|
|
|
|
|
|
|
|
1323
|
|
|
|
|
|
|
void |
1324
|
|
|
|
|
|
|
_marpa_g_nsy_rank( g_wrapper, nsy_id ) |
1325
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
1326
|
|
|
|
|
|
|
Marpa_NSY_ID nsy_id; |
1327
|
|
|
|
|
|
|
PPCODE: |
1328
|
|
|
|
|
|
|
{ |
1329
|
0
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
1330
|
0
|
|
|
|
|
|
int gp_result = _marpa_g_nsy_rank(self, nsy_id); |
1331
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1332
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
1333
|
0
|
|
|
|
|
|
croak( "Problem in g->_marpa_g_nsy_rank(%d): %s", |
1334
|
|
|
|
|
|
|
nsy_id, xs_g_error( g_wrapper )); |
1335
|
|
|
|
|
|
|
} |
1336
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1337
|
|
|
|
|
|
|
} |
1338
|
|
|
|
|
|
|
|
1339
|
|
|
|
|
|
|
void |
1340
|
|
|
|
|
|
|
_marpa_g_nsy_is_semantic( g_wrapper, nsy_id ) |
1341
|
|
|
|
|
|
|
G_Wrapper *g_wrapper; |
1342
|
|
|
|
|
|
|
Marpa_NSY_ID nsy_id; |
1343
|
|
|
|
|
|
|
PPCODE: |
1344
|
|
|
|
|
|
|
{ |
1345
|
45994
|
|
|
|
|
|
Marpa_Grammar self = g_wrapper->g; |
1346
|
45994
|
|
|
|
|
|
int gp_result = _marpa_g_nsy_is_semantic(self, nsy_id); |
1347
|
45994
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1348
|
45994
|
50
|
|
|
|
|
if ( gp_result < 0 && g_wrapper->throw ) { |
|
|
0
|
|
|
|
|
|
1349
|
0
|
|
|
|
|
|
croak( "Problem in g->_marpa_g_nsy_is_semantic(%d): %s", |
1350
|
|
|
|
|
|
|
nsy_id, xs_g_error( g_wrapper )); |
1351
|
|
|
|
|
|
|
} |
1352
|
45994
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1353
|
|
|
|
|
|
|
} |
1354
|
|
|
|
|
|
|
|
1355
|
|
|
|
|
|
|
MODULE = Marpa::R2 PACKAGE = Marpa::R2::Thin::B |
1356
|
|
|
|
|
|
|
|
1357
|
|
|
|
|
|
|
void |
1358
|
|
|
|
|
|
|
_marpa_b_and_node_cause( b_wrapper, ordinal ) |
1359
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1360
|
|
|
|
|
|
|
Marpa_And_Node_ID ordinal; |
1361
|
|
|
|
|
|
|
PPCODE: |
1362
|
|
|
|
|
|
|
{ |
1363
|
13857
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1364
|
13857
|
|
|
|
|
|
int gp_result = _marpa_b_and_node_cause(self, ordinal); |
1365
|
13857
|
100
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1366
|
8333
|
50
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1367
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_and_node_cause(%d): %s", |
1368
|
|
|
|
|
|
|
ordinal, xs_g_error( b_wrapper->base )); |
1369
|
|
|
|
|
|
|
} |
1370
|
8333
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1371
|
|
|
|
|
|
|
} |
1372
|
|
|
|
|
|
|
|
1373
|
|
|
|
|
|
|
void |
1374
|
|
|
|
|
|
|
_marpa_b_and_node_count( b_wrapper ) |
1375
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1376
|
|
|
|
|
|
|
PPCODE: |
1377
|
|
|
|
|
|
|
{ |
1378
|
0
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1379
|
0
|
|
|
|
|
|
int gp_result = _marpa_b_and_node_count(self); |
1380
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1381
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1382
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_and_node_count(): %s", |
1383
|
|
|
|
|
|
|
xs_g_error( b_wrapper->base )); |
1384
|
|
|
|
|
|
|
} |
1385
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1386
|
|
|
|
|
|
|
} |
1387
|
|
|
|
|
|
|
|
1388
|
|
|
|
|
|
|
void |
1389
|
|
|
|
|
|
|
_marpa_b_and_node_middle( b_wrapper, and_node_id ) |
1390
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1391
|
|
|
|
|
|
|
Marpa_And_Node_ID and_node_id; |
1392
|
|
|
|
|
|
|
PPCODE: |
1393
|
|
|
|
|
|
|
{ |
1394
|
127
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1395
|
127
|
|
|
|
|
|
int gp_result = _marpa_b_and_node_middle(self, and_node_id); |
1396
|
127
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1397
|
127
|
50
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1398
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_and_node_middle(%d): %s", |
1399
|
|
|
|
|
|
|
and_node_id, xs_g_error( b_wrapper->base )); |
1400
|
|
|
|
|
|
|
} |
1401
|
127
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1402
|
|
|
|
|
|
|
} |
1403
|
|
|
|
|
|
|
|
1404
|
|
|
|
|
|
|
void |
1405
|
|
|
|
|
|
|
_marpa_b_and_node_parent( b_wrapper, and_node_id ) |
1406
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1407
|
|
|
|
|
|
|
Marpa_And_Node_ID and_node_id; |
1408
|
|
|
|
|
|
|
PPCODE: |
1409
|
|
|
|
|
|
|
{ |
1410
|
767
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1411
|
767
|
|
|
|
|
|
int gp_result = _marpa_b_and_node_parent(self, and_node_id); |
1412
|
767
|
100
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1413
|
765
|
50
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1414
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_and_node_parent(%d): %s", |
1415
|
|
|
|
|
|
|
and_node_id, xs_g_error( b_wrapper->base )); |
1416
|
|
|
|
|
|
|
} |
1417
|
765
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1418
|
|
|
|
|
|
|
} |
1419
|
|
|
|
|
|
|
|
1420
|
|
|
|
|
|
|
void |
1421
|
|
|
|
|
|
|
_marpa_b_and_node_predecessor( b_wrapper, ordinal ) |
1422
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1423
|
|
|
|
|
|
|
Marpa_And_Node_ID ordinal; |
1424
|
|
|
|
|
|
|
PPCODE: |
1425
|
|
|
|
|
|
|
{ |
1426
|
32642
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1427
|
32642
|
|
|
|
|
|
int gp_result = _marpa_b_and_node_predecessor(self, ordinal); |
1428
|
32642
|
100
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1429
|
12673
|
50
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1430
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_and_node_predecessor(%d): %s", |
1431
|
|
|
|
|
|
|
ordinal, xs_g_error( b_wrapper->base )); |
1432
|
|
|
|
|
|
|
} |
1433
|
12673
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1434
|
|
|
|
|
|
|
} |
1435
|
|
|
|
|
|
|
|
1436
|
|
|
|
|
|
|
void |
1437
|
|
|
|
|
|
|
_marpa_b_and_node_symbol( b_wrapper, and_node_id ) |
1438
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1439
|
|
|
|
|
|
|
Marpa_And_Node_ID and_node_id; |
1440
|
|
|
|
|
|
|
PPCODE: |
1441
|
|
|
|
|
|
|
{ |
1442
|
815
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1443
|
815
|
|
|
|
|
|
int gp_result = _marpa_b_and_node_symbol(self, and_node_id); |
1444
|
815
|
100
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1445
|
771
|
50
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1446
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_and_node_symbol(%d): %s", |
1447
|
|
|
|
|
|
|
and_node_id, xs_g_error( b_wrapper->base )); |
1448
|
|
|
|
|
|
|
} |
1449
|
771
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1450
|
|
|
|
|
|
|
} |
1451
|
|
|
|
|
|
|
|
1452
|
|
|
|
|
|
|
void |
1453
|
|
|
|
|
|
|
_marpa_b_or_node_and_count( b_wrapper, or_node_id ) |
1454
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1455
|
|
|
|
|
|
|
Marpa_Or_Node_ID or_node_id; |
1456
|
|
|
|
|
|
|
PPCODE: |
1457
|
|
|
|
|
|
|
{ |
1458
|
0
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1459
|
0
|
|
|
|
|
|
int gp_result = _marpa_b_or_node_and_count(self, or_node_id); |
1460
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1461
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1462
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_or_node_and_count(%d): %s", |
1463
|
|
|
|
|
|
|
or_node_id, xs_g_error( b_wrapper->base )); |
1464
|
|
|
|
|
|
|
} |
1465
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1466
|
|
|
|
|
|
|
} |
1467
|
|
|
|
|
|
|
|
1468
|
|
|
|
|
|
|
void |
1469
|
|
|
|
|
|
|
_marpa_b_or_node_first_and( b_wrapper, ordinal ) |
1470
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1471
|
|
|
|
|
|
|
Marpa_Or_Node_ID ordinal; |
1472
|
|
|
|
|
|
|
PPCODE: |
1473
|
|
|
|
|
|
|
{ |
1474
|
20
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1475
|
20
|
|
|
|
|
|
int gp_result = _marpa_b_or_node_first_and(self, ordinal); |
1476
|
20
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1477
|
20
|
50
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1478
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_or_node_first_and(%d): %s", |
1479
|
|
|
|
|
|
|
ordinal, xs_g_error( b_wrapper->base )); |
1480
|
|
|
|
|
|
|
} |
1481
|
20
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1482
|
|
|
|
|
|
|
} |
1483
|
|
|
|
|
|
|
|
1484
|
|
|
|
|
|
|
void |
1485
|
|
|
|
|
|
|
_marpa_b_or_node_irl( b_wrapper, ordinal ) |
1486
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1487
|
|
|
|
|
|
|
Marpa_Or_Node_ID ordinal; |
1488
|
|
|
|
|
|
|
PPCODE: |
1489
|
|
|
|
|
|
|
{ |
1490
|
47032
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1491
|
47032
|
|
|
|
|
|
int gp_result = _marpa_b_or_node_irl(self, ordinal); |
1492
|
47032
|
100
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1493
|
47029
|
50
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1494
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_or_node_irl(%d): %s", |
1495
|
|
|
|
|
|
|
ordinal, xs_g_error( b_wrapper->base )); |
1496
|
|
|
|
|
|
|
} |
1497
|
47029
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1498
|
|
|
|
|
|
|
} |
1499
|
|
|
|
|
|
|
|
1500
|
|
|
|
|
|
|
void |
1501
|
|
|
|
|
|
|
_marpa_b_or_node_is_semantic( b_wrapper, or_node_id ) |
1502
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1503
|
|
|
|
|
|
|
Marpa_Or_Node_ID or_node_id; |
1504
|
|
|
|
|
|
|
PPCODE: |
1505
|
|
|
|
|
|
|
{ |
1506
|
0
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1507
|
0
|
|
|
|
|
|
int gp_result = _marpa_b_or_node_is_semantic(self, or_node_id); |
1508
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1509
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1510
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_or_node_is_semantic(%d): %s", |
1511
|
|
|
|
|
|
|
or_node_id, xs_g_error( b_wrapper->base )); |
1512
|
|
|
|
|
|
|
} |
1513
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1514
|
|
|
|
|
|
|
} |
1515
|
|
|
|
|
|
|
|
1516
|
|
|
|
|
|
|
void |
1517
|
|
|
|
|
|
|
_marpa_b_or_node_is_whole( b_wrapper, or_node_id ) |
1518
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1519
|
|
|
|
|
|
|
Marpa_Or_Node_ID or_node_id; |
1520
|
|
|
|
|
|
|
PPCODE: |
1521
|
|
|
|
|
|
|
{ |
1522
|
0
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1523
|
0
|
|
|
|
|
|
int gp_result = _marpa_b_or_node_is_whole(self, or_node_id); |
1524
|
0
|
0
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1525
|
0
|
0
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1526
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_or_node_is_whole(%d): %s", |
1527
|
|
|
|
|
|
|
or_node_id, xs_g_error( b_wrapper->base )); |
1528
|
|
|
|
|
|
|
} |
1529
|
0
|
0
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1530
|
|
|
|
|
|
|
} |
1531
|
|
|
|
|
|
|
|
1532
|
|
|
|
|
|
|
void |
1533
|
|
|
|
|
|
|
_marpa_b_or_node_last_and( b_wrapper, ordinal ) |
1534
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1535
|
|
|
|
|
|
|
Marpa_Or_Node_ID ordinal; |
1536
|
|
|
|
|
|
|
PPCODE: |
1537
|
|
|
|
|
|
|
{ |
1538
|
20
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1539
|
20
|
|
|
|
|
|
int gp_result = _marpa_b_or_node_last_and(self, ordinal); |
1540
|
20
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1541
|
20
|
50
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1542
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_or_node_last_and(%d): %s", |
1543
|
|
|
|
|
|
|
ordinal, xs_g_error( b_wrapper->base )); |
1544
|
|
|
|
|
|
|
} |
1545
|
20
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1546
|
|
|
|
|
|
|
} |
1547
|
|
|
|
|
|
|
|
1548
|
|
|
|
|
|
|
void |
1549
|
|
|
|
|
|
|
_marpa_b_or_node_origin( b_wrapper, ordinal ) |
1550
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1551
|
|
|
|
|
|
|
Marpa_Or_Node_ID ordinal; |
1552
|
|
|
|
|
|
|
PPCODE: |
1553
|
|
|
|
|
|
|
{ |
1554
|
1930
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1555
|
1930
|
|
|
|
|
|
int gp_result = _marpa_b_or_node_origin(self, ordinal); |
1556
|
1930
|
100
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1557
|
1928
|
50
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1558
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_or_node_origin(%d): %s", |
1559
|
|
|
|
|
|
|
ordinal, xs_g_error( b_wrapper->base )); |
1560
|
|
|
|
|
|
|
} |
1561
|
1928
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1562
|
|
|
|
|
|
|
} |
1563
|
|
|
|
|
|
|
|
1564
|
|
|
|
|
|
|
void |
1565
|
|
|
|
|
|
|
_marpa_b_or_node_position( b_wrapper, ordinal ) |
1566
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1567
|
|
|
|
|
|
|
Marpa_Or_Node_ID ordinal; |
1568
|
|
|
|
|
|
|
PPCODE: |
1569
|
|
|
|
|
|
|
{ |
1570
|
46305
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1571
|
46305
|
|
|
|
|
|
int gp_result = _marpa_b_or_node_position(self, ordinal); |
1572
|
46305
|
100
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1573
|
46303
|
50
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1574
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_or_node_position(%d): %s", |
1575
|
|
|
|
|
|
|
ordinal, xs_g_error( b_wrapper->base )); |
1576
|
|
|
|
|
|
|
} |
1577
|
46303
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1578
|
|
|
|
|
|
|
} |
1579
|
|
|
|
|
|
|
|
1580
|
|
|
|
|
|
|
void |
1581
|
|
|
|
|
|
|
_marpa_b_or_node_set( b_wrapper, ordinal ) |
1582
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1583
|
|
|
|
|
|
|
Marpa_Or_Node_ID ordinal; |
1584
|
|
|
|
|
|
|
PPCODE: |
1585
|
|
|
|
|
|
|
{ |
1586
|
2428
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1587
|
2428
|
|
|
|
|
|
int gp_result = _marpa_b_or_node_set(self, ordinal); |
1588
|
2428
|
100
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1589
|
2426
|
50
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1590
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_or_node_set(%d): %s", |
1591
|
|
|
|
|
|
|
ordinal, xs_g_error( b_wrapper->base )); |
1592
|
|
|
|
|
|
|
} |
1593
|
2426
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1594
|
|
|
|
|
|
|
} |
1595
|
|
|
|
|
|
|
|
1596
|
|
|
|
|
|
|
void |
1597
|
|
|
|
|
|
|
_marpa_b_top_or_node( b_wrapper ) |
1598
|
|
|
|
|
|
|
B_Wrapper *b_wrapper; |
1599
|
|
|
|
|
|
|
PPCODE: |
1600
|
|
|
|
|
|
|
{ |
1601
|
52
|
|
|
|
|
|
Marpa_Bocage self = b_wrapper->b; |
1602
|
52
|
|
|
|
|
|
int gp_result = _marpa_b_top_or_node(self); |
1603
|
52
|
50
|
|
|
|
|
if ( gp_result == -1 ) { XSRETURN_UNDEF; } |
1604
|
52
|
50
|
|
|
|
|
if ( gp_result < 0 && b_wrapper->base->throw ) { |
|
|
0
|
|
|
|
|
|
1605
|
0
|
|
|
|
|
|
croak( "Problem in b->_marpa_b_top_or_node(): %s", |
1606
|
|
|
|
|
|
|
xs_g_error( b_wrapper->base )); |
1607
|
|
|
|
|
|
|
} |
1608
|
52
|
50
|
|
|
|
|
XPUSHs (sv_2mortal (newSViv (gp_result))); |
1609
|
|
|
|
|
|
|
} |
1610
|
|
|
|
|
|
|
|