@@ -45,18 +45,18 @@ def states_functions
4545 # define YYPUSH_STATE_#{ state_name . upcase } (value) \\
4646 do \\
4747 { \\
48- if (#{ stack_prefix } + #{ states_stack_size_name } - 1 <= #{ stack_prefix } _p) \\
49- YYSTATE_STACK_INCREASE (#{ stack_prefix } _a, #{ stack_prefix } , #{ stack_prefix } _p, #{ states_stack_size_name } , "#{ state_name } "); \\
50- YYDPRINTF ((stderr, "Push %s to #{ state_name } \\ n", #{ state_name_macro } (value))); \\
51- *++#{ stack_prefix } _p = value; \\
48+ if (#{ stack_prefix } _b + #{ states_stack_size_name } - 1 <= #{ stack_prefix } _p) \\
49+ YYSTATE_STACK_INCREASE (#{ stack_prefix } _a, #{ stack_prefix } _b , #{ stack_prefix } _p, #{ states_stack_size_name } , "#{ state_name } "); \\
50+ YYDPRINTF ((stderr, "Push %s to #{ state_name } \\ n", #{ state_name_macro } (yyparser_state_ ## value))); \\
51+ *++#{ stack_prefix } _p = yyparser_state_ ## value; \\
5252 } \\
5353 while (0)
5454
5555 # define YYPOP_STATE_#{ state_name . upcase } () \\
5656 do \\
5757 { \\
5858 YYDPRINTF ((stderr, "Pop #{ state_name } \\ n")); \\
59- if (#{ stack_prefix } _p != #{ stack_prefix } ) \\
59+ if (#{ stack_prefix } _p != #{ stack_prefix } _b ) \\
6060 { \\
6161 #{ stack_prefix } _p -= 1; \\
6262 } \\
@@ -70,8 +70,8 @@ def states_functions
7070 # define YYSET_STATE_#{ state_name . upcase } (value) \\
7171 do \\
7272 { \\
73- YYDPRINTF ((stderr, "Set %s to #{ state_name } \\ n", #{ state_name_macro } (value))); \\
74- *#{ stack_prefix } _p = value; \\
73+ YYDPRINTF ((stderr, "Set %s to #{ state_name } \\ n", #{ state_name_macro } (yyparser_state_ ## value))); \\
74+ *#{ stack_prefix } _p = yyparser_state_ ## value; \\
7575 } \\
7676 while (0)
7777
@@ -81,8 +81,8 @@ def states_functions
8181
8282 def states_clean_up_stack
8383 <<~CODE
84- if (#{ stack_prefix } != #{ stack_prefix } _a)
85- YYSTACK_FREE (#{ stack_prefix } );
84+ if (#{ stack_prefix } _b != #{ stack_prefix } _a)
85+ YYSTACK_FREE (#{ stack_prefix } _b );
8686 CODE
8787 end
8888
@@ -97,8 +97,8 @@ def states_stacks
9797
9898 /* The parser state stack (#{ stack_prefix } ): array, bottom, top. */
9999 int #{ stack_prefix } _a[YYINITDEPTH];
100- int *#{ stack_prefix } = #{ stack_prefix } _a;
101- int *#{ stack_prefix } _p = #{ stack_prefix } ;
100+ int *#{ stack_prefix } _b = #{ stack_prefix } _a;
101+ int *#{ stack_prefix } _p = #{ stack_prefix } _b ;
102102 STACKS
103103 end
104104
0 commit comments