-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDebugLookForward.pm
executable file
·298 lines (247 loc) · 5.44 KB
/
DebugLookForward.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
#!/usr/bin/perl
########################################################################################
#
# This file was generated using Parse::Eyapp version 1.182.
#
# (c) Parse::Yapp Copyright 1998-2001 Francois Desarmenien.
# (c) Parse::Eyapp Copyright 2006-2008 Casiano Rodriguez-Leon. Universidad de La Laguna.
# Don't edit this file, use source file 'DebugLookForward.eyp' instead.
#
# ANY CHANGE MADE HERE WILL BE LOST !
#
########################################################################################
package DebugLookForward;
use strict;
push @DebugLookForward::ISA, 'Parse::Eyapp::Driver';
BEGIN {
# This strange way to load the modules is to guarantee compatibility when
# using several standalone and non-standalone Eyapp parsers
require Parse::Eyapp::Driver unless Parse::Eyapp::Driver->can('YYParse');
require Parse::Eyapp::Node unless Parse::Eyapp::Node->can('hnew');
}
sub unexpendedInput { defined($_) ? substr($_, (defined(pos $_) ? pos $_ : 0)) : '' }
#line 2 "DebugLookForward.eyp"
=head1 SYNOPSIS
See
http://search.cpan.org/perldoc?Parse::Eyapp::debuggingtut
file DebugLookForward.eyp
This grammar fixes the conflicts an bugs in Debug.eyp and Debug1.eyp
Be sure C<DebugTail.pm> is reachable
compile it with
eyapp -C DebugLookForward.eyp
execute the generated modulino with:
./DebugLookForward.pm -t -i -c 'D;D;S'
=head1 See also
Debug.eyp Debug1.eyp Debug2.eyp DebugLookForward2.eyp
=cut
our $VERSION = '0.01';
# Default lexical analyzer
our $LEX = sub {
my $self = shift;
my $pos;
for (${$self->input}) {
m{\G(\s+)}gc and $self->tokenline($1 =~ tr{\n}{});
/\G(\;)/gc and return ($1, $1);
/\G(SEMICOLONS)/gc and return ($1, $1);
/\G(S)/gc and return ($1, $1);
/\G(D)/gc and return ($1, $1);
return ('', undef) if ($_ eq '') || (defined(pos($_)) && (pos($_) >= length($_)));
/\G\s*(\S+)/;
my $near = substr($1,0,10);
return($near, $near);
# die( "Error inside the lexical analyzer near '". $near
# ."'. Line: ".$self->line()
# .". File: '".$self->YYFilename()."'. No match found.\n");
}
}
;
#line 93 ./DebugLookForward.pm
my $warnmessage =<< "EOFWARN";
Warning!: Did you changed the \@DebugLookForward::ISA variable inside the header section of the eyapp program?
EOFWARN
sub new {
my($class)=shift;
ref($class) and $class=ref($class);
warn $warnmessage unless __PACKAGE__->isa('Parse::Eyapp::Driver');
my($self)=$class->SUPER::new(
yyversion => '1.182',
yyGRAMMAR =>
[#[productionNameAndLabel => lhs, [ rhs], bypass]]
[ '_SUPERSTART' => '$start', [ 'p', '$end' ], 0 ],
[ 'P' => 'p', [ 'ds', 'SEMICOLONS', 'ss' ], 0 ],
[ 'SS' => 'p', [ 'ss' ], 0 ],
[ 'D2' => 'ds', [ 'D', ';', 'ds' ], 0 ],
[ 'D1' => 'ds', [ 'D' ], 0 ],
[ 'S2' => 'ss', [ 'S', 'SEMICOLONS', 'ss' ], 0 ],
[ 'S1' => 'ss', [ 'S' ], 0 ],
],
yyLABELS =>
{
'_SUPERSTART' => 0,
'P' => 1,
'SS' => 2,
'D2' => 3,
'D1' => 4,
'S2' => 5,
'S1' => 6,
},
yyTERMS =>
{ '' => { ISSEMANTIC => 0 },
';' => { ISSEMANTIC => 0 },
'D' => { ISSEMANTIC => 1 },
'S' => { ISSEMANTIC => 1 },
SEMICOLONS => { ISSEMANTIC => 0 },
error => { ISSEMANTIC => 0 },
},
yyFILENAME => 'DebugLookForward.eyp',
yystates =>
[
{#State 0
ACTIONS => {
"D" => 4,
"S" => 1
},
GOTOS => {
'p' => 3,
'ds' => 5,
'ss' => 2
}
},
{#State 1
ACTIONS => {
'SEMICOLONS' => 6
},
DEFAULT => -6
},
{#State 2
DEFAULT => -2
},
{#State 3
ACTIONS => {
'' => 7
}
},
{#State 4
ACTIONS => {
";" => 8
},
DEFAULT => -4
},
{#State 5
ACTIONS => {
'SEMICOLONS' => 9
}
},
{#State 6
ACTIONS => {
"S" => 1
},
GOTOS => {
'ss' => 10
}
},
{#State 7
DEFAULT => 0
},
{#State 8
ACTIONS => {
"D" => 4
},
GOTOS => {
'ds' => 11
}
},
{#State 9
ACTIONS => {
"S" => 1
},
GOTOS => {
'ss' => 12
}
},
{#State 10
DEFAULT => -5
},
{#State 11
DEFAULT => -3
},
{#State 12
DEFAULT => -1
}
],
yyrules =>
[
[#Rule _SUPERSTART
'$start', 2, undef
#line 214 ./DebugLookForward.pm
],
[#Rule P
'p', 3,
sub {
#line 38 "DebugLookForward.eyp"
goto &Parse::Eyapp::Driver::YYBuildAST }
#line 221 ./DebugLookForward.pm
],
[#Rule SS
'p', 1,
sub {
#line 38 "DebugLookForward.eyp"
goto &Parse::Eyapp::Driver::YYBuildAST }
#line 228 ./DebugLookForward.pm
],
[#Rule D2
'ds', 3,
sub {
#line 38 "DebugLookForward.eyp"
goto &Parse::Eyapp::Driver::YYBuildAST }
#line 235 ./DebugLookForward.pm
],
[#Rule D1
'ds', 1,
sub {
#line 38 "DebugLookForward.eyp"
goto &Parse::Eyapp::Driver::YYBuildAST }
#line 242 ./DebugLookForward.pm
],
[#Rule S2
'ss', 3,
sub {
#line 38 "DebugLookForward.eyp"
goto &Parse::Eyapp::Driver::YYBuildAST }
#line 249 ./DebugLookForward.pm
],
[#Rule S1
'ss', 1,
sub {
#line 38 "DebugLookForward.eyp"
goto &Parse::Eyapp::Driver::YYBuildAST }
#line 256 ./DebugLookForward.pm
]
],
#line 259 ./DebugLookForward.pm
yybypass => 0,
yybuildingtree => 1,
yyprefix => '',
yyaccessors => {
},
yyconflicthandlers => {}
,
yystateconflict => { },
@_,
);
bless($self,$class);
$self->make_node_classes('TERMINAL', '_OPTIONAL', '_STAR_LIST', '_PLUS_LIST',
'_SUPERSTART',
'P',
'SS',
'D2',
'D1',
'S2',
'S1', );
$self;
}
#line 62 "DebugLookForward.eyp"
=for None
=cut
#line 293 ./DebugLookForward.pm
1;