Added On/Off options to the grammar, for parameters.

This commit is contained in:
Marius Nita 2002-08-26 21:04:00 +00:00
parent 572acce581
commit 656478e3cc
2 changed files with 104 additions and 90 deletions

View file

@ -27,8 +27,12 @@ Control |
control | control |
shift | shift |
Shift yylval = (int) strdup(yytext); return BINDING; Shift yylval = (int) strdup(yytext); return BINDING;
on |
On |
true | true |
True yylval = (int) strdup(yytext); return TRUE; True yylval = (int) strdup(yytext); return TRUE;
Off |
off |
false | false |
False yylval = (int) strdup(yytext); return FALSE; False yylval = (int) strdup(yytext); return FALSE;
[0-9]+ yylval = (int) strdup(yytext); return NUMBER; [0-9]+ yylval = (int) strdup(yytext); return NUMBER;

View file

@ -282,20 +282,20 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
*yy_cp = '\0'; \ *yy_cp = '\0'; \
yy_c_buf_p = yy_cp; yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 29 #define YY_NUM_RULES 33
#define YY_END_OF_BUFFER 30 #define YY_END_OF_BUFFER 34
static yyconst short int yy_accept[93] = static yyconst short int yy_accept[99] =
{ 0, { 0,
0, 0, 30, 29, 28, 27, 29, 29, 4, 23, 0, 0, 34, 33, 32, 31, 33, 33, 4, 27,
3, 25, 25, 25, 25, 25, 25, 25, 25, 25, 3, 29, 29, 29, 29, 29, 29, 29, 29, 29,
25, 25, 25, 25, 1, 2, 28, 0, 0, 23, 29, 29, 29, 29, 1, 2, 32, 0, 0, 27,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 29, 29, 29, 29, 29, 20, 29, 29, 29, 29,
25, 25, 25, 24, 26, 25, 25, 25, 25, 25, 29, 29, 29, 19, 29, 29, 29, 28, 30, 29,
25, 25, 25, 25, 25, 25, 25, 25, 25, 7, 29, 29, 23, 29, 29, 29, 29, 29, 29, 24,
9, 11, 13, 25, 25, 20, 25, 25, 8, 10, 29, 29, 29, 29, 29, 7, 9, 11, 13, 29,
12, 14, 25, 25, 19, 25, 22, 25, 18, 25, 29, 22, 29, 29, 8, 10, 12, 14, 29, 29,
21, 25, 17, 25, 25, 25, 25, 15, 5, 16, 21, 29, 26, 29, 18, 29, 25, 29, 17, 29,
6, 0 29, 29, 29, 15, 5, 16, 6, 0
} ; } ;
@ -339,76 +339,78 @@ static yyconst int yy_meta[38] =
3, 3, 3, 3, 3, 1, 1 3, 3, 3, 3, 3, 1, 1
} ; } ;
static yyconst short int yy_base[96] = static yyconst short int yy_base[102] =
{ 0, { 0,
0, 0, 116, 117, 113, 117, 0, 0, 117, 31, 0, 0, 122, 123, 119, 123, 0, 0, 123, 31,
117, 0, 84, 93, 82, 80, 85, 77, 78, 87, 123, 0, 90, 99, 88, 19, 92, 84, 85, 94,
76, 74, 79, 71, 117, 117, 100, 97, 97, 36, 83, 20, 87, 79, 123, 123, 108, 105, 105, 45,
0, 70, 71, 75, 62, 69, 59, 64, 65, 69, 0, 78, 79, 83, 80, 0, 69, 76, 66, 71,
56, 63, 53, 83, 117, 52, 52, 40, 58, 59, 72, 76, 73, 0, 62, 69, 59, 89, 123, 58,
59, 47, 47, 44, 53, 54, 54, 44, 52, 0, 58, 49, 0, 64, 65, 65, 53, 53, 53, 0,
0, 0, 0, 44, 39, 0, 40, 48, 0, 0, 59, 60, 60, 50, 58, 0, 0, 0, 0, 50,
0, 0, 40, 35, 0, 38, 0, 38, 0, 36, 45, 0, 46, 54, 0, 0, 0, 0, 46, 41,
0, 36, 0, 37, 30, 35, 27, 0, 0, 0, 0, 44, 0, 44, 0, 42, 0, 42, 0, 42,
0, 117, 55, 58, 54 33, 20, 13, 0, 0, 0, 0, 123, 64, 67,
42
} ; } ;
static yyconst short int yy_def[96] = static yyconst short int yy_def[102] =
{ 0, { 0,
92, 1, 92, 92, 92, 92, 93, 94, 92, 95, 98, 1, 98, 98, 98, 98, 99, 100, 98, 101,
92, 95, 95, 95, 95, 95, 95, 95, 95, 95, 98, 101, 101, 101, 101, 101, 101, 101, 101, 101,
95, 95, 95, 95, 92, 92, 92, 93, 94, 95, 101, 101, 101, 101, 98, 98, 98, 99, 100, 101,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
95, 95, 95, 93, 92, 95, 95, 95, 95, 95, 101, 101, 101, 101, 101, 101, 101, 99, 98, 101,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
95, 0, 92, 92, 92 101, 101, 101, 101, 101, 101, 101, 0, 98, 98,
98
} ; } ;
static yyconst short int yy_nxt[155] = static yyconst short int yy_nxt[161] =
{ 0, { 0,
4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
10, 11, 12, 13, 14, 15, 16, 17, 18, 12, 10, 11, 12, 13, 14, 15, 16, 17, 18, 12,
19, 12, 12, 20, 12, 12, 12, 21, 12, 22, 19, 12, 12, 20, 12, 12, 12, 21, 12, 22,
12, 12, 23, 24, 12, 25, 26, 30, 30, 30, 12, 12, 23, 24, 12, 25, 26, 30, 30, 30,
30, 30, 30, 30, 30, 30, 30, 60, 61, 62, 30, 30, 35, 43, 31, 97, 96, 36, 44, 37,
63, 69, 70, 71, 72, 28, 31, 28, 29, 91, 45, 30, 30, 30, 30, 30, 66, 67, 68, 69,
29, 90, 89, 88, 87, 86, 85, 84, 83, 82, 75, 76, 77, 78, 28, 95, 28, 29, 94, 29,
81, 80, 79, 78, 77, 76, 75, 74, 73, 68, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84,
67, 66, 65, 64, 59, 58, 44, 57, 56, 55, 83, 82, 81, 80, 79, 74, 73, 72, 71, 70,
54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 65, 64, 48, 63, 62, 61, 60, 59, 58, 57,
44, 27, 43, 42, 41, 40, 39, 38, 37, 36, 56, 55, 54, 53, 52, 51, 50, 49, 48, 27,
35, 34, 33, 32, 27, 92, 3, 92, 92, 92, 47, 46, 42, 41, 40, 39, 38, 34, 33, 32,
92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 27, 98, 3, 98, 98, 98, 98, 98, 98, 98,
92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
92, 92, 92, 92 98, 98, 98, 98, 98, 98, 98, 98, 98, 98
} ; } ;
static yyconst short int yy_chk[155] = static yyconst short int yy_chk[161] =
{ 0, { 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 10, 10, 10, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10,
10, 10, 30, 30, 30, 30, 30, 48, 48, 48, 10, 10, 16, 22, 101, 93, 92, 16, 22, 16,
48, 54, 54, 54, 54, 93, 95, 93, 94, 87, 22, 30, 30, 30, 30, 30, 52, 52, 52, 52,
94, 86, 85, 84, 82, 80, 78, 76, 74, 73, 59, 59, 59, 59, 99, 91, 99, 100, 90, 100,
68, 67, 65, 64, 59, 58, 57, 56, 55, 53, 88, 86, 84, 82, 80, 79, 74, 73, 71, 70,
52, 51, 50, 49, 47, 46, 44, 43, 42, 41, 65, 64, 63, 62, 61, 58, 57, 56, 55, 54,
40, 39, 38, 37, 36, 35, 34, 33, 32, 29, 51, 50, 48, 47, 46, 45, 43, 42, 41, 40,
28, 27, 24, 23, 22, 21, 20, 19, 18, 17, 39, 38, 37, 35, 34, 33, 32, 29, 28, 27,
16, 15, 14, 13, 5, 3, 92, 92, 92, 92, 24, 23, 21, 20, 19, 18, 17, 15, 14, 13,
92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 5, 3, 98, 98, 98, 98, 98, 98, 98, 98,
92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
92, 92, 92, 92 98, 98, 98, 98, 98, 98, 98, 98, 98, 98
} ; } ;
static yy_state_type yy_last_accepting_state; static yy_state_type yy_last_accepting_state;
@ -431,7 +433,7 @@ char *yytext;
extern YYSTYPE yylval; extern YYSTYPE yylval;
#line 435 "lex.yy.c" #line 437 "lex.yy.c"
/* Macros after this point can all be overridden by user definitions in /* Macros after this point can all be overridden by user definitions in
* section 1. * section 1.
@ -585,7 +587,7 @@ YY_DECL
#line 10 "epist.l" #line 10 "epist.l"
#line 589 "lex.yy.c" #line 591 "lex.yy.c"
if ( yy_init ) if ( yy_init )
{ {
@ -636,13 +638,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 93 ) if ( yy_current_state >= 99 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp; ++yy_cp;
} }
while ( yy_base[yy_current_state] != 117 ); while ( yy_base[yy_current_state] != 123 );
yy_find_action: yy_find_action:
yy_act = yy_accept[yy_current_state]; yy_act = yy_accept[yy_current_state];
@ -725,53 +727,61 @@ yylval = (int) strdup(yytext); return BINDING;
case 19: case 19:
#line 31 "epist.l" #line 31 "epist.l"
case 20: case 20:
YY_RULE_SETUP #line 32 "epist.l"
#line 31 "epist.l"
yylval = (int) strdup(yytext); return TRUE;
YY_BREAK
case 21: case 21:
#line 33 "epist.l" #line 33 "epist.l"
case 22: case 22:
YY_RULE_SETUP YY_RULE_SETUP
#line 33 "epist.l" #line 33 "epist.l"
yylval = (int) strdup(yytext); return FALSE; yylval = (int) strdup(yytext); return TRUE;
YY_BREAK YY_BREAK
case 23: case 23:
YY_RULE_SETUP
#line 34 "epist.l"
yylval = (int) strdup(yytext); return NUMBER;
YY_BREAK
case 24:
YY_RULE_SETUP
#line 35 "epist.l" #line 35 "epist.l"
yylval = (int) strdup(yytext); return QUOTES; case 24:
YY_BREAK
case 25:
YY_RULE_SETUP
#line 36 "epist.l" #line 36 "epist.l"
yylval = (int) strdup(yytext); return WORD; case 25:
YY_BREAK #line 37 "epist.l"
case 26: case 26:
YY_RULE_SETUP YY_RULE_SETUP
#line 37 "epist.l" #line 37 "epist.l"
/* ignore */ yylval = (int) strdup(yytext); return FALSE;
YY_BREAK YY_BREAK
case 27: case 27:
YY_RULE_SETUP YY_RULE_SETUP
#line 38 "epist.l" #line 38 "epist.l"
/* ignore */ yylval = (int) strdup(yytext); return NUMBER;
YY_BREAK YY_BREAK
case 28: case 28:
YY_RULE_SETUP YY_RULE_SETUP
#line 39 "epist.l" #line 39 "epist.l"
/* */ yylval = (int) strdup(yytext); return QUOTES;
YY_BREAK YY_BREAK
case 29: case 29:
YY_RULE_SETUP YY_RULE_SETUP
#line 40 "epist.l" #line 40 "epist.l"
yylval = (int) strdup(yytext); return WORD;
YY_BREAK
case 30:
YY_RULE_SETUP
#line 41 "epist.l"
/* ignore */
YY_BREAK
case 31:
YY_RULE_SETUP
#line 42 "epist.l"
/* ignore */
YY_BREAK
case 32:
YY_RULE_SETUP
#line 43 "epist.l"
/* */
YY_BREAK
case 33:
YY_RULE_SETUP
#line 44 "epist.l"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 775 "lex.yy.c" #line 785 "lex.yy.c"
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
yyterminate(); yyterminate();
@ -1063,7 +1073,7 @@ static yy_state_type yy_get_previous_state()
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 93 ) if ( yy_current_state >= 99 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@ -1098,11 +1108,11 @@ yy_state_type yy_current_state;
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 93 ) if ( yy_current_state >= 99 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 92); yy_is_jam = (yy_current_state == 98);
return yy_is_jam ? 0 : yy_current_state; return yy_is_jam ? 0 : yy_current_state;
} }
@ -1657,6 +1667,6 @@ int main()
return 0; return 0;
} }
#endif #endif
#line 40 "epist.l" #line 44 "epist.l"