57 |
|
|
58 |
for my $size (1 .. $max) |
for my $size (1 .. $max) |
59 |
{ |
{ |
60 |
print "%token \"$size\" ", $size, "\n"; |
print "%token t$size $size \"$size\"\n"; |
61 |
}; |
}; |
62 |
|
|
63 |
print <<EOF; |
print <<EOF; |
128 |
|
|
129 |
# I have been able to go up to 2000 on my machine. |
# I have been able to go up to 2000 on my machine. |
130 |
# I tried 3000, a 29Mb grammar file, but then my system killed bison. |
# I tried 3000, a 29Mb grammar file, but then my system killed bison. |
131 |
AT_DATA_TRIANGULAR_GRAMMAR([input.y], [500]) |
# With 500 and the new parser, which consume far too much memory, |
132 |
|
# it gets killed too. Of course the parser is to be cleaned. |
133 |
|
AT_DATA_TRIANGULAR_GRAMMAR([input.y], [200]) |
134 |
AT_CHECK([bison input.y -v -o input.c]) |
AT_CHECK([bison input.y -v -o input.c]) |
135 |
AT_CHECK([$CC $CFLAGS $CPPFLAGS input.c -o input], 0, [], [ignore]) |
AT_CHECK([$CC $CFLAGS $CPPFLAGS input.c -o input], 0, [], [ignore]) |
136 |
AT_CHECK([./input]) |
AT_CHECK([./input]) |
166 |
|
|
167 |
for my $size (1 .. $max) |
for my $size (1 .. $max) |
168 |
{ |
{ |
169 |
print "%token \"$size\" ", $size, "\n"; |
print "%token t$size $size \"$size\"\n"; |
170 |
}; |
}; |
171 |
|
|
172 |
print <<EOF; |
print <<EOF; |
274 |
print |
print |
275 |
wrap ("%type <val> ", |
wrap ("%type <val> ", |
276 |
" ", |
" ", |
277 |
map { "token$_" } (1 .. $max)), |
map { "n$_" } (1 .. $max)), |
278 |
"\n"; |
"\n"; |
279 |
|
|
280 |
for my $count (1 .. $max) |
for my $count (1 .. $max) |
281 |
{ |
{ |
282 |
print "%token \"$count\" $count\n"; |
print "%token t$count $count \"$count\"\n"; |
283 |
}; |
}; |
284 |
|
|
285 |
print <<EOF; |
print <<EOF; |
290 |
; |
; |
291 |
|
|
292 |
exp: |
exp: |
293 |
token1 "1" { assert (\@S|@1 == 1); } |
n1 "1" { assert (\@S|@1 == 1); } |
294 |
EOF |
EOF |
295 |
|
|
296 |
for my $count (2 .. $max) |
for my $count (2 .. $max) |
297 |
{ |
{ |
298 |
print "| token$count \"$count\" { assert (\@S|@1 == $count); }\n"; |
print "| n$count \"$count\" { assert (\@S|@1 == $count); }\n"; |
299 |
}; |
}; |
300 |
print ";\n"; |
print ";\n"; |
301 |
|
|
302 |
for my $count (1 .. $max) |
for my $count (1 .. $max) |
303 |
{ |
{ |
304 |
print "token$count: token { \$\$ = $count; };\n"; |
print "n$count: token { \$\$ = $count; };\n"; |
305 |
}; |
}; |
306 |
|
|
307 |
print <<EOF; |
print <<EOF; |