diff options
author | Vern Paxson <vern@ee.lbl.gov> | 1993-12-26 15:04:47 +0000 |
---|---|---|
committer | Vern Paxson <vern@ee.lbl.gov> | 1993-12-26 15:04:47 +0000 |
commit | 56e26f74d4bebb7c386e3e2ff60f25cb64931e4d (patch) | |
tree | da61be856f6d176dffa42dab27a3dd613a7023d6 /parse.y | |
parent | a09b607cfb81e034eeda6aa5c6cf73cccd908840 (diff) |
Working checkpoint prior to adding <scon>{ stuff
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -60,7 +60,10 @@ char *alloca (); int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, i, actvp, rulelen; int trlcontxt, xcluflg, cclsorted, varlength, variable_trail_rule; -int *active_ss; + +int *actvsc, *active_ss, *scon_stk; +int scon_stk_ptr, max_scon_stk; + Char clower(); void build_eof_action(); void yyerror(); @@ -133,10 +136,15 @@ sect1end : SECTEND * are, so create the "activity" map indicating * which conditions are active. */ + actvsc = allocate_integer_array( lastsc + 1 ); active_ss = allocate_integer_array( lastsc + 1 ); for ( i = 1; i <= lastsc; ++i ) active_ss[i] = 0; + + max_scon_stk = lastsc + 1; + scon_stk = allocate_integer_array( max_scon_stk ); + scon_stk_ptr = 0; } ; @@ -158,7 +166,8 @@ namelist1 : namelist1 NAME ; sect2 : sect2 initforrule flexrule '\n' - | sect2 '{' '\n' sect2 '}' '\n' + | sect2 '\n' scons '{' sect2 '}' + { scon_stk_ptr = $2; } | ; @@ -169,6 +178,7 @@ initforrule : trailcnt = headcnt = rulelen = 0; current_state_type = STATE_NORMAL; previous_continued_action = continued_action; + in_rule = true; new_rule(); } ; @@ -265,6 +275,23 @@ flexrule : scon '^' rule { synerr( "unrecognized rule" ); } ; +scons : scon + { + $$ = scon_stk_ptr; + + scon_stk_ptr += actvp; + + while ( scon_stk_ptr >= max_scon_stk ) + { + max_scon_stk *= 2; + scon_stk = reallocate_integer_array( scon_stk, + max_scon_stk ); + } + + for ( i = 1; i <= actvp; ++i ) + scon_stk[$$ + i] = actvsc[i]; + } + scon : '<' namelist2 '>' | '<' '*' '>' |