merged -m flag with -j flag

This commit is contained in:
ceriel 1989-07-17 16:40:18 +00:00
parent 3e357f311f
commit c6cbc82178
2 changed files with 11 additions and 11 deletions

View file

@ -6,10 +6,10 @@ LLgen, an extended LL(1) parser generator
.SH SYNOPSIS .SH SYNOPSIS
\fBLLgen\fP \fBLLgen\fP
[ [
\fB\-vxjw\fP \fB\-vxw\fP
] ]
[ [
\fB\-m\fP\fInum\fP \fB\-j\fP[\fInum\fP]
] ]
[ [
\fB\-l\fP\fInum\fP \fB\-l\fP\fInum\fP
@ -89,7 +89,7 @@ symbols and these extended sets are also included in the
file. file.
.IP \fB\-w\fP .IP \fB\-w\fP
no warnings are given. no warnings are given.
.IP \fB\-j\fP .IP \fB\-j\fP[\fInum\fP]
when this flag is given, \fILLgen\fP will generate dense switches, when this flag is given, \fILLgen\fP will generate dense switches,
so that the compiler can generate a jump table for it. This will only be so that the compiler can generate a jump table for it. This will only be
done for switches that have density between done for switches that have density between
@ -98,9 +98,11 @@ Usually, compilers generate a jumptable when the density of the switch
is above a certain threshold. If you want jump tables in more cases, is above a certain threshold. If you want jump tables in more cases,
set \fIhigh_percentage\fP to this threshold, and \fIlow_percentage\fP to set \fIhigh_percentage\fP to this threshold, and \fIlow_percentage\fP to
a minimum threshold. There is a time-space trade-off here. a minimum threshold. There is a time-space trade-off here.
.IP \fB\-m\fP\fInum\fP .I num
minimum number of cases in a switch for the \fB\-j\fP option to be is the minimum number of cases in a switch for the \fB\-j\fP option to be
effective. The default value is 8. effective. The default value (if
.I num
is not given) is 8.
.IP \fB\-l\fP\fInum\fP .IP \fB\-l\fP\fInum\fP
The \fIlow_percentage\fP, as described above. Default value is 10. The \fIlow_percentage\fP, as described above. Default value is 10.
.IP \fB\-h\fP\fInum\fP .IP \fB\-h\fP\fInum\fP

View file

@ -55,7 +55,9 @@ main(argc,argv) register string argv[]; {
case 'j': case 'j':
case 'J': case 'J':
jmptable_option = 1; jmptable_option = 1;
continue; if (*++arg)
min_cases_for_jmptable = atoi(arg);
break;
case 'w': case 'w':
case 'W': case 'W':
wflag = 1; wflag = 1;
@ -72,10 +74,6 @@ main(argc,argv) register string argv[]; {
case 'H': case 'H':
high_percentage = atoi(++arg); high_percentage = atoi(++arg);
break; break;
case 'm':
case 'M':
min_cases_for_jmptable = atoi(++arg);
break;
# ifndef NDEBUG # ifndef NDEBUG
case 'd': case 'd':
case 'D': case 'D':