static yyconst flex_int16_t yy_rule_linenum[18] =
{ 0,
- 118, 128, 129, 139, 144, 149, 155, 156, 157, 158,
- 160, 168, 177, 190, 201, 214, 217
+ 117, 127, 128, 138, 143, 148, 154, 155, 156, 157,
+ 159, 167, 174, 185, 202, 215, 218
} ;
/* The intent behind this definition is that it'll catch
/* Nick */
int no_handle_action;
-const char *before_tag, *after_tag;
/* C and C++ comments in code. */
/* C style identifier. Must start with letter. Will be used for
named symbol references. Shall be kept synchronized with
scan-gram.l "letter" and "id". */
-#line 725 "src/scan-code.c"
+#line 724 "src/scan-code.c"
#define INITIAL 0
#define SC_COMMENT 1
register int yy_act;
/* %% [7.0] user's declarations go here */
-#line 100 "src/scan-code.l"
+#line 99 "src/scan-code.l"
| Scanning a C comment. The initial '/ *' is already eaten. |
`------------------------------------------------------------*/
-#line 993 "src/scan-code.c"
+#line 992 "src/scan-code.c"
if ( !(yy_init) )
{
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
-#line 118 "src/scan-code.l"
+#line 117 "src/scan-code.l"
STRING_GROW; BEGIN sc_context;
YY_BREAK
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
-#line 128 "src/scan-code.l"
+#line 127 "src/scan-code.l"
STRING_GROW; BEGIN sc_context;
YY_BREAK
case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
-#line 129 "src/scan-code.l"
+#line 128 "src/scan-code.l"
STRING_GROW;
YY_BREAK
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
-#line 139 "src/scan-code.l"
+#line 138 "src/scan-code.l"
STRING_GROW;
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 144 "src/scan-code.l"
+#line 143 "src/scan-code.l"
STRING_GROW; BEGIN sc_context;
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 149 "src/scan-code.l"
+#line 148 "src/scan-code.l"
STRING_GROW; BEGIN sc_context;
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 155 "src/scan-code.l"
+#line 154 "src/scan-code.l"
STRING_GROW; BEGIN SC_CHARACTER;
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 156 "src/scan-code.l"
+#line 155 "src/scan-code.l"
STRING_GROW; BEGIN SC_STRING;
YY_BREAK
case 9:
/* rule 9 can match eol */
YY_RULE_SETUP
-#line 157 "src/scan-code.l"
+#line 156 "src/scan-code.l"
STRING_GROW; BEGIN SC_COMMENT;
YY_BREAK
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
-#line 158 "src/scan-code.l"
+#line 157 "src/scan-code.l"
STRING_GROW; BEGIN SC_LINE_COMMENT;
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 160 "src/scan-code.l"
+#line 159 "src/scan-code.l"
{
complain (loc, Wother, _("stray '%s'"), code_text);
obstack_escape (&obstack_for_string, code_text);
case 12:
YY_RULE_SETUP
-#line 168 "src/scan-code.l"
+#line 167 "src/scan-code.l"
{
ref_tail_fields = NULL;
handle_action_dollar (self->rule, code_text, *loc);
+ code_text = yy_c_buf_p;
if (ref_tail_fields)
obstack_sgrow (&obstack_for_string, ref_tail_fields);
- code_piece_append(before_tag);
- flush();
- code_piece_append(after_tag);
}
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 177 "src/scan-code.l"
+#line 174 "src/scan-code.l"
{
ref_tail_fields = NULL;
handle_action_at (self->rule, code_text, *loc);
+ code_text = yy_c_buf_p;
if (ref_tail_fields)
obstack_sgrow (&obstack_for_string, ref_tail_fields);
- code_piece_append(before_tag);
- flush();
- code_piece_append(after_tag);
}
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 190 "src/scan-code.l"
+#line 185 "src/scan-code.l"
{
+ int i = sprintf(code_piece_temp, "<PYACC_Text_ValueReference tag_name=\"");
+ int j = i + sprintf(code_piece_temp + i, "%s", code_text + 2);
+ while (j > i && code_piece_temp[--j] != '>')
+ ;
+ sprintf(code_piece_temp + j, "\">");
+ code_piece_append(code_piece_temp);
+ code_piece_esc(code_text, strlen(code_text));
+ code_piece_append("</PYACC_Text_ValueReference>");
const char *type_name = NULL;
fetch_type_name (code_text + 1, &type_name, *loc)[-1] = 0;
obstack_sgrow (&obstack_for_string, "]b4_dollar_dollar(");
obstack_quote (&obstack_for_string, type_name);
obstack_sgrow (&obstack_for_string, ")[");
self->is_value_used = true;
- code_piece_append("<PYACC_Text_ValueReference>");
- flush();
- code_piece_append("</PYACC_Text_ValueReference>");
+ code_text = yy_c_buf_p;
}
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 201 "src/scan-code.l"
+#line 202 "src/scan-code.l"
{
obstack_sgrow (&obstack_for_string, "]b4_at_dollar[");
muscle_percent_define_ensure("locations", the_location, true);
/* Escape M4 quoting characters in C code. */
case 16:
YY_RULE_SETUP
-#line 214 "src/scan-code.l"
+#line 215 "src/scan-code.l"
obstack_escape (&obstack_for_string, code_text);
YY_BREAK
/* By default, grow the string obstack with the input. */
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
-#line 217 "src/scan-code.l"
+#line 218 "src/scan-code.l"
STRING_GROW;
YY_BREAK
/* End of processing. */
case YY_STATE_EOF(SC_CHARACTER):
case YY_STATE_EOF(SC_RULE_ACTION):
case YY_STATE_EOF(SC_SYMBOL_ACTION):
-#line 220 "src/scan-code.l"
+#line 221 "src/scan-code.l"
STRING_FINISH; /*code_piece_pack(); --code_piece0;*/ return last_string;
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 223 "src/scan-code.l"
+#line 224 "src/scan-code.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 1279 "src/scan-code.c"
+#line 1280 "src/scan-code.c"
case YY_END_OF_BUFFER:
{
/* %ok-for-header */
-#line 223 "src/scan-code.l"
+#line 224 "src/scan-code.l"
rule->midrule_parent_rhs_index, text, dollar_loc, '$');
#if 1
if (n == LHS_REF) {
- before_tag = "<PYACC_Text_ValueReference>";
- after_tag = "</PYACC_Text_ValueReference>";
+ int i = sprintf(code_piece_temp, "<PYACC_Text_ValueReference tag_name=\"");
+ int j = i + sprintf(code_piece_temp + i, "%s", code_text + 2);
+ while (j > i && code_piece_temp[--j] != '>')
+ ;
+ sprintf(code_piece_temp + j, "\">");
+ code_piece_append(code_piece_temp);
+ code_piece_esc(code_text, code_leng);
+ code_piece_append("</PYACC_Text_ValueReference>");
}
else {
- sprintf(code_piece_temp, "<PYACC_Text_StackReference index=\"%d\">", n);
- before_tag = code_piece_temp;
- after_tag = "</PYACC_Text_StackReference>";
+ int i = sprintf(code_piece_temp, "<PYACC_Text_StackReference tag_name=\"");
+ int j = i + sprintf(code_piece_temp + i, "%s", code_text + 2);
+ while (j > i && code_piece_temp[--j] != '>')
+ ;
+ sprintf(code_piece_temp + j, "\" index=\"%d\">", n);
+ code_piece_append(code_piece_temp);
+ code_piece_esc(code_text, code_leng);
+ code_piece_append("</PYACC_Text_StackReference>");
}
if (no_handle_action)
return;
rule->midrule_parent_rhs_index, text, at_loc, '@');
#if 1
if (n == LHS_REF) {
- before_tag = "<PYACC_Text_ValueLocation>";
- after_tag = "</PYACC_Text_ValueLocation>";
+ code_piece_append("<PYACC_Text_ValueLocation>");
+ code_piece_esc(code_text, strlen(code_text));
+ code_piece_append("</PYACC_Text_ValueLocation>");
}
else {
sprintf(code_piece_temp, "<PYACC_Text_StackLocation index=\"%d\">", n);
- before_tag = code_piece_temp;
- after_tag = "</PYACC_Text_StackLocation>";
+ code_piece_append(code_piece_temp);
+ code_piece_esc(code_text, strlen(code_text));
+ code_piece_append("</PYACC_Text_StackLocation>");
}
if (no_handle_action)
return;
/* Nick */
int no_handle_action;
-const char *before_tag, *after_tag;
%}
/* C and C++ comments in code. */
"$"("<"{tag}">")?{ref} {
ref_tail_fields = NULL;
handle_action_dollar (self->rule, yytext, *loc);
+ yytext = yy_c_buf_p;
if (ref_tail_fields)
obstack_sgrow (&obstack_for_string, ref_tail_fields);
- code_piece_append(before_tag);
- flush();
- code_piece_append(after_tag);
}
"@"{ref} {
ref_tail_fields = NULL;
handle_action_at (self->rule, yytext, *loc);
+ yytext = yy_c_buf_p;
if (ref_tail_fields)
obstack_sgrow (&obstack_for_string, ref_tail_fields);
- code_piece_append(before_tag);
- flush();
- code_piece_append(after_tag);
}
}
<SC_SYMBOL_ACTION>
{
"$"("<"{tag}">")?"$" {
+ int i = sprintf(code_piece_temp, "<PYACC_Text_ValueReference tag_name=\"");
+ int j = i + sprintf(code_piece_temp + i, "%s", yytext + 2);
+ while (j > i && code_piece_temp[--j] != '>')
+ ;
+ sprintf(code_piece_temp + j, "\">");
+ code_piece_append(code_piece_temp);
+ code_piece_esc(yytext, strlen(yytext));
+ code_piece_append("</PYACC_Text_ValueReference>");
const char *type_name = NULL;
fetch_type_name (yytext + 1, &type_name, *loc)[-1] = 0;
obstack_sgrow (&obstack_for_string, "]b4_dollar_dollar(");
obstack_quote (&obstack_for_string, type_name);
obstack_sgrow (&obstack_for_string, ")[");
self->is_value_used = true;
- code_piece_append("<PYACC_Text_ValueReference>");
- flush();
- code_piece_append("</PYACC_Text_ValueReference>");
+ yytext = yy_c_buf_p;
}
"@$" {
obstack_sgrow (&obstack_for_string, "]b4_at_dollar[");
rule->midrule_parent_rhs_index, text, dollar_loc, '$');
#if 1
if (n == LHS_REF) {
- before_tag = "<PYACC_Text_ValueReference>";
- after_tag = "</PYACC_Text_ValueReference>";
+ int i = sprintf(code_piece_temp, "<PYACC_Text_ValueReference tag_name=\"");
+ int j = i + sprintf(code_piece_temp + i, "%s", yytext + 2);
+ while (j > i && code_piece_temp[--j] != '>')
+ ;
+ sprintf(code_piece_temp + j, "\">");
+ code_piece_append(code_piece_temp);
+ code_piece_esc(yytext, yyleng);
+ code_piece_append("</PYACC_Text_ValueReference>");
}
else {
- sprintf(code_piece_temp, "<PYACC_Text_StackReference index=\"%d\">", n);
- before_tag = code_piece_temp;
- after_tag = "</PYACC_Text_StackReference>";
+ int i = sprintf(code_piece_temp, "<PYACC_Text_StackReference tag_name=\"");
+ int j = i + sprintf(code_piece_temp + i, "%s", yytext + 2);
+ while (j > i && code_piece_temp[--j] != '>')
+ ;
+ sprintf(code_piece_temp + j, "\" index=\"%d\">", n);
+ code_piece_append(code_piece_temp);
+ code_piece_esc(yytext, yyleng);
+ code_piece_append("</PYACC_Text_StackReference>");
}
if (no_handle_action)
return;
rule->midrule_parent_rhs_index, text, at_loc, '@');
#if 1
if (n == LHS_REF) {
- before_tag = "<PYACC_Text_ValueLocation>";
- after_tag = "</PYACC_Text_ValueLocation>";
+ code_piece_append("<PYACC_Text_ValueLocation>");
+ code_piece_esc(yytext, strlen(yytext));
+ code_piece_append("</PYACC_Text_ValueLocation>");
}
else {
sprintf(code_piece_temp, "<PYACC_Text_StackLocation index=\"%d\">", n);
- before_tag = code_piece_temp;
- after_tag = "</PYACC_Text_StackLocation>";
+ code_piece_append(code_piece_temp);
+ code_piece_esc(yytext, strlen(yytext));
+ code_piece_append("</PYACC_Text_StackLocation>");
}
if (no_handle_action)
return;