#if 1
void piece_append(const char *str);
- piece_append("<root><PLex ref=\"0\"><PLex_Section1>");
+ piece_append("<root><AST ref=\"0\"><AST_Section1>");
#endif
readin ();
make_tables ();
#if 1
/* at this point flexscan() has been called to copy section 3 to the output */
- piece_append("</PLex></root>\n");
+ piece_append("</AST></root>\n");
extern char *piece[];
extern int piece1;
case 4:
#line 175 "parse.y" /* yacc.c:1646 */
{
- insert_after(2, "</PLex_Section1_StartConditions>");
- sprintf(piece_temp, "<PLex_Section1_StartConditions exclusive=\"%s\">", xcluflg ? "true" : "false");
+ insert_after(2, "</AST_Section1_StartConditions>");
+ sprintf(piece_temp, "<AST_Section1_StartConditions exclusive=\"%s\">", xcluflg ? "true" : "false");
insert_before(1, piece_temp);
}
#line 1551 "parse.c" /* yacc.c:1646 */
case 5:
#line 181 "parse.y" /* yacc.c:1646 */
{
- insert_after(1, "</PLex_Section1_Options>");
- insert_before(1, "<PLex_Section1_Options>");
+ insert_after(1, "</AST_Section1_Options>");
+ insert_before(1, "<AST_Section1_Options>");
}
#line 1560 "parse.c" /* yacc.c:1646 */
break;
{
outfilename = xstrdup(nmstr);
did_outfilename = 1;
- insert_after(2, "</PLex_Section1_Options_OutFile>");
- insert_before(0,"<PLex_Section1_Options_OutFile>");
+ insert_after(2, "</AST_Section1_Options_OutFile>");
+ insert_before(0,"<AST_Section1_Options_OutFile>");
}
#line 1617 "parse.c" /* yacc.c:1646 */
break;
case 18:
#line 230 "parse.y" /* yacc.c:1646 */
{ extra_type = xstrdup(nmstr); /*}*/
- insert_after(2, "</PLex_Section1_Options_ExtraType>");
- insert_before(0, "<PLex_Section1_Options_ExtraType>");
+ insert_after(2, "</AST_Section1_Options_ExtraType>");
+ insert_before(0, "<AST_Section1_Options_ExtraType>");
}
#line 1626 "parse.c" /* yacc.c:1646 */
break;
{ prefix = xstrdup(nmstr);
if (strchr(prefix, '[') || strchr(prefix, ']'))
flexerror(_("Prefix must not contain [ or ]")); /*}*/
- insert_after(2, "</PLex_Section1_Options_Prefix>");
- insert_before(0, "<PLex_Section1_Options_Prefix>");
+ insert_after(2, "</AST_Section1_Options_Prefix>");
+ insert_before(0, "<AST_Section1_Options_Prefix>");
}
#line 1637 "parse.c" /* yacc.c:1646 */
break;
case 20:
#line 242 "parse.y" /* yacc.c:1646 */
{ yyclass = xstrdup(nmstr); /*}*/
- insert_after(2, "</PLex_Section1_Options_YYClass>");
- insert_before(0, "<PLex_Section1_Options_YYClass>");
+ insert_after(2, "</AST_Section1_Options_YYClass>");
+ insert_before(0, "<AST_Section1_Options_YYClass>");
}
#line 1646 "parse.c" /* yacc.c:1646 */
break;
case 21:
#line 247 "parse.y" /* yacc.c:1646 */
{ headerfilename = xstrdup(nmstr); /*}*/
- insert_after(2, "</PLex_Section1_Options_HeaderFile>");
- insert_before(0, "<PLex_Section1_Options_HeaderFile>");
+ insert_after(2, "</AST_Section1_Options_HeaderFile>");
+ insert_before(0, "<AST_Section1_Options_HeaderFile>");
}
#line 1655 "parse.c" /* yacc.c:1646 */
break;
case 22:
#line 252 "parse.y" /* yacc.c:1646 */
{ tablesext = true; tablesfilename = xstrdup(nmstr); /*}*/
- insert_after(2, "</PLex_Section1_Options_TablesFile>");
- insert_before(0, "<PLex_Section1_Options_TablesFile>");
+ insert_after(2, "</AST_Section1_Options_TablesFile>");
+ insert_before(0, "<AST_Section1_Options_TablesFile>");
}
#line 1664 "parse.c" /* yacc.c:1646 */
break;
case 23:
#line 259 "parse.y" /* yacc.c:1646 */
{ scon_stk_ptr = (yyvsp[-3]); /*}*/
- insert_after(4, "</PLex_Section2_Rule>");
- insert_before(1, "<PLex_Section2_Rule>");
+ insert_after(4, "</AST_Section2_Rule>");
+ insert_before(1, "<AST_Section2_Rule>");
}
#line 1673 "parse.c" /* yacc.c:1646 */
break;
case 24:
#line 264 "parse.y" /* yacc.c:1646 */
{ scon_stk_ptr = (yyvsp[-3]); /*}*/
- insert_after(4, "</PLex_Section2_CompoundRule>");
- insert_before(1, "<PLex_Section2_CompoundRule>");
+ insert_after(4, "</AST_Section2_CompoundRule>");
+ insert_before(1, "<AST_Section2_CompoundRule>");
}
#line 1682 "parse.c" /* yacc.c:1646 */
break;
pinpoint_message(
"'^' operator results in sub-optimal performance" );
}
- insert_after(1, "</PLex_Section2_Rule_FLexRule>");
- insert_before(0, "<PLex_Section2_Rule_FLexRule bol=\"true\">");
+ insert_after(1, "</AST_Section2_Rule_FLexRule>");
+ insert_before(0, "<AST_Section2_Rule_FLexRule bol=\"true\">");
}
#line 1738 "parse.c" /* yacc.c:1646 */
break;
mkbranch( scset[i],
pat );
}
- insert_after(0, "</PLex_Section2_Rule_FLexRule>");
- insert_before(0, "<PLex_Section2_Rule_FLexRule bol=\"false\">");
+ insert_after(0, "</AST_Section2_Rule_FLexRule>");
+ insert_before(0, "<AST_Section2_Rule_FLexRule bol=\"false\">");
}
#line 1767 "parse.c" /* yacc.c:1646 */
break;
else
build_eof_action();
}
- insert_after(0, "</PLex_Section2_Rule_EOFRule>");
- insert_before(0, "<PLex_Section2_Rule_EOFRule>");
+ insert_after(0, "</AST_Section2_Rule_EOFRule>");
+ insert_before(0, "<AST_Section2_Rule_EOFRule>");
}
#line 1795 "parse.c" /* yacc.c:1646 */
break;
case 32:
#line 382 "parse.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-2]); /*}*/
- insert_after(3, "</PLex_Section2_StartConditions>");
- insert_before(0, "<PLex_Section2_StartConditions>");
+ insert_after(3, "</AST_Section2_StartConditions>");
+ insert_before(0, "<AST_Section2_StartConditions>");
}
#line 1816 "parse.c" /* yacc.c:1646 */
break;
if ( j > scon_stk_ptr )
scon_stk[++scon_stk_ptr] = i;
}
- insert_after(2, "</PLex_Section2_StartConditions>");
- insert_before(0, "<PLex_Section2_StartConditions wildcard=\"true\">");
+ insert_after(2, "</AST_Section2_StartConditions>");
+ insert_before(0, "<AST_Section2_StartConditions wildcard=\"true\">");
}
#line 1838 "parse.c" /* yacc.c:1646 */
break;
piece[piece2 + 1] = piece[piece2]; /* empty */
piece[piece2] = piece[piece2 - 1]; /* empty */
piece[piece2 - 1] = temp;
- insert_before(0, "<PLex_Section2_StartConditions />");
+ insert_before(0, "<AST_Section2_StartConditions />");
}
#line 1854 "parse.c" /* yacc.c:1646 */
break;
sect1 : sect1 startconddecl namelist1
{
- insert_after(2, "</PLex_Section1_StartConditions>");
- sprintf(piece_temp, "<PLex_Section1_StartConditions exclusive=\"%s\">", xcluflg ? "true" : "false");
+ insert_after(2, "</AST_Section1_StartConditions>");
+ sprintf(piece_temp, "<AST_Section1_StartConditions exclusive=\"%s\">", xcluflg ? "true" : "false");
insert_before(1, piece_temp);
}
| sect1 options
{
- insert_after(1, "</PLex_Section1_Options>");
- insert_before(1, "<PLex_Section1_Options>");
+ insert_after(1, "</AST_Section1_Options>");
+ insert_before(1, "<AST_Section1_Options>");
}
|
| error
{
outfilename = xstrdup(nmstr);
did_outfilename = 1;
- insert_after(2, "</PLex_Section1_Options_OutFile>");
- insert_before(0,"<PLex_Section1_Options_OutFile>");
+ insert_after(2, "</AST_Section1_Options_OutFile>");
+ insert_before(0,"<AST_Section1_Options_OutFile>");
}
| TOK_EXTRA_TYPE '=' NAME
{ extra_type = xstrdup(nmstr); /*}*/
- insert_after(2, "</PLex_Section1_Options_ExtraType>");
- insert_before(0, "<PLex_Section1_Options_ExtraType>");
+ insert_after(2, "</AST_Section1_Options_ExtraType>");
+ insert_before(0, "<AST_Section1_Options_ExtraType>");
}
| TOK_PREFIX '=' NAME
{ prefix = xstrdup(nmstr);
if (strchr(prefix, '[') || strchr(prefix, ']'))
flexerror(_("Prefix must not contain [ or ]")); /*}*/
- insert_after(2, "</PLex_Section1_Options_Prefix>");
- insert_before(0, "<PLex_Section1_Options_Prefix>");
+ insert_after(2, "</AST_Section1_Options_Prefix>");
+ insert_before(0, "<AST_Section1_Options_Prefix>");
}
| TOK_YYCLASS '=' NAME
{ yyclass = xstrdup(nmstr); /*}*/
- insert_after(2, "</PLex_Section1_Options_YYClass>");
- insert_before(0, "<PLex_Section1_Options_YYClass>");
+ insert_after(2, "</AST_Section1_Options_YYClass>");
+ insert_before(0, "<AST_Section1_Options_YYClass>");
}
| TOK_HEADER_FILE '=' NAME
{ headerfilename = xstrdup(nmstr); /*}*/
- insert_after(2, "</PLex_Section1_Options_HeaderFile>");
- insert_before(0, "<PLex_Section1_Options_HeaderFile>");
+ insert_after(2, "</AST_Section1_Options_HeaderFile>");
+ insert_before(0, "<AST_Section1_Options_HeaderFile>");
}
| TOK_TABLES_FILE '=' NAME
{ tablesext = true; tablesfilename = xstrdup(nmstr); /*}*/
- insert_after(2, "</PLex_Section1_Options_TablesFile>");
- insert_before(0, "<PLex_Section1_Options_TablesFile>");
+ insert_after(2, "</AST_Section1_Options_TablesFile>");
+ insert_before(0, "<AST_Section1_Options_TablesFile>");
}
;
sect2 : sect2 scon initforrule flexrule '\n'
{ scon_stk_ptr = $2; /*}*/
- insert_after(4, "</PLex_Section2_Rule>");
- insert_before(1, "<PLex_Section2_Rule>");
+ insert_after(4, "</AST_Section2_Rule>");
+ insert_before(1, "<AST_Section2_Rule>");
}
| sect2 scon '{' sect2 '}'
{ scon_stk_ptr = $2; /*}*/
- insert_after(4, "</PLex_Section2_CompoundRule>");
- insert_before(1, "<PLex_Section2_CompoundRule>");
+ insert_after(4, "</AST_Section2_CompoundRule>");
+ insert_before(1, "<AST_Section2_CompoundRule>");
}
|
;
pinpoint_message(
"'^' operator results in sub-optimal performance" );
}
- insert_after(1, "</PLex_Section2_Rule_FLexRule>");
- insert_before(0, "<PLex_Section2_Rule_FLexRule bol=\"true\">");
+ insert_after(1, "</AST_Section2_Rule_FLexRule>");
+ insert_before(0, "<AST_Section2_Rule_FLexRule bol=\"true\">");
}
| rule
mkbranch( scset[i],
pat );
}
- insert_after(0, "</PLex_Section2_Rule_FLexRule>");
- insert_before(0, "<PLex_Section2_Rule_FLexRule bol=\"false\">");
+ insert_after(0, "</AST_Section2_Rule_FLexRule>");
+ insert_before(0, "<AST_Section2_Rule_FLexRule bol=\"false\">");
}
| EOF_OP
else
build_eof_action();
}
- insert_after(0, "</PLex_Section2_Rule_EOFRule>");
- insert_before(0, "<PLex_Section2_Rule_EOFRule>");
+ insert_after(0, "</AST_Section2_Rule_EOFRule>");
+ insert_before(0, "<AST_Section2_Rule_EOFRule>");
}
| error
scon : '<' scon_stk_ptr namelist2 '>'
{ $$ = $2; /*}*/
- insert_after(3, "</PLex_Section2_StartConditions>");
- insert_before(0, "<PLex_Section2_StartConditions>");
+ insert_after(3, "</AST_Section2_StartConditions>");
+ insert_before(0, "<AST_Section2_StartConditions>");
}
| '<' '*' '>'
if ( j > scon_stk_ptr )
scon_stk[++scon_stk_ptr] = i;
}
- insert_after(2, "</PLex_Section2_StartConditions>");
- insert_before(0, "<PLex_Section2_StartConditions wildcard=\"true\">");
+ insert_after(2, "</AST_Section2_StartConditions>");
+ insert_before(0, "<AST_Section2_StartConditions wildcard=\"true\">");
}
|
piece[piece2 + 1] = piece[piece2]; /* empty */
piece[piece2] = piece[piece2 - 1]; /* empty */
piece[piece2 - 1] = temp;
- insert_before(0, "<PLex_Section2_StartConditions />");
+ insert_before(0, "<AST_Section2_StartConditions />");
}
;
{ \
strncpy( nmstr, yytext, sizeof(nmstr) ); \
piece_pack(); \
- piece_append("<PLex_Name>"); \
+ piece_append("<AST_Name>"); \
piece_escape(yytext, strlen(yytext)); \
- piece_append("</PLex_Name>"); \
+ piece_append("</AST_Name>"); \
piece_pack(); \
return ~NAME; \
/* return NAME;*/ \
add_action(M4QSTART); \
yy_push_state(CODEBLOCK); \
if ((indented_code = x)) ACTION_ECHO; \
- piece_append("<PLex_Section1Or2_CodeBlock>"); \
+ piece_append("<AST_Section1Or2_CodeBlock>"); \
} while(0)
#define END_CODEBLOCK do { \
yy_pop_state();\
add_action(M4QEND); \
if (!indented_code) line_directive_out(NULL, 0);\
- piece_append("</PLex_Section1Or2_CodeBlock>"); \
+ piece_append("</AST_Section1Or2_CodeBlock>"); \
} while (0)
/* Nick */
case 1:
YY_RULE_SETUP
#line 195 "scan.l"
-START_CODEBLOCK(true); piece_append("<PLex_Text>");
+START_CODEBLOCK(true); piece_append("<AST_Text>");
YY_BREAK
case 2:
YY_RULE_SETUP
/* rule 6 can match eol */
YY_RULE_SETUP
#line 200 "scan.l"
-START_CODEBLOCK(false); piece_flush(strlen(yytext)); piece_append("<PLex_Text>");
+START_CODEBLOCK(false); piece_flush(strlen(yytext)); piece_append("<AST_Text>");
YY_BREAK
case 7:
/* rule 7 can match eol */
line_directive_out(NULL, 1);
BEGIN(SECT2PROLOG);
#if 1
- piece_append("</PLex_Section1>");
+ piece_append("</AST_Section1>");
piece_pack();
piece_escape(yytext, strlen(yytext));
- piece_append("<PLex_Section2>");
+ piece_append("<AST_Section2>");
piece_pack();
return ~SECTEND;
#else
/* rule 11 can match eol */
YY_RULE_SETUP
#line 231 "scan.l"
-yytext_is_array = false; ++linenum; piece_append("<PLex_Section1_Options><PLex_Section1_Options_Array>"); piece_flush(strlen(yytext) - 1); piece_append("</PLex_Section1_Options_Array></PLex_Section1_Options>");
+yytext_is_array = false; ++linenum; piece_append("<AST_Section1_Options><AST_Section1_Options_Array>"); piece_flush(strlen(yytext) - 1); piece_append("</AST_Section1_Options_Array></AST_Section1_Options>");
YY_BREAK
case 12:
/* rule 12 can match eol */
YY_RULE_SETUP
#line 232 "scan.l"
-yytext_is_array = true; ++linenum; piece_append("<PLex_Section1_Options><PLex_Section1_Options_Array value=\"true\">"); piece_flush(strlen(yytext) - 1); piece_append("</PLex_Section1_Options_Array></PLex_Section1_Options>");
+yytext_is_array = true; ++linenum; piece_append("<AST_Section1_Options><AST_Section1_Options_Array value=\"true\">"); piece_flush(strlen(yytext) - 1); piece_append("</AST_Section1_Options_Array></AST_Section1_Options>");
YY_BREAK
case 13:
YY_RULE_SETUP
/* rule 39 can match eol */
YY_RULE_SETUP
#line 307 "scan.l"
-++linenum; piece_append("</PLex_Text>"); piece_flush(strlen(yytext)); END_CODEBLOCK;
+++linenum; piece_append("</AST_Text>"); piece_flush(strlen(yytext)); END_CODEBLOCK;
YY_BREAK
case 40:
YY_RULE_SETUP
{
++linenum;
ACTION_ECHO;
- if ( indented_code ) { piece_flush(strlen(yytext)); piece_append("</PLex_Text>"); END_CODEBLOCK; }
+ if ( indented_code ) { piece_flush(strlen(yytext)); piece_append("</AST_Text>"); END_CODEBLOCK; }
}
YY_BREAK
nmstr[strlen( nmstr ) - 1] = '\0';
#if 1
piece_pack();
- piece_append("<PLex_String>\"<PLex_Text>");
+ piece_append("<AST_String>\"<AST_Text>");
piece_escape(yytext + 1, strlen(yytext + 1) - 1);
- piece_append("</PLex_Text>\"</PLex_String>");
+ piece_append("</AST_Text>\"</AST_String>");
piece_pack();
return ~NAME; /* actually a misnomer */
#else
case 133:
YY_RULE_SETUP
#line 539 "scan.l"
-START_CODEBLOCK(true); piece_append("<PLex_Text>"); /* indented code in prolog */
+START_CODEBLOCK(true); piece_append("<AST_Text>"); /* indented code in prolog */
YY_BREAK
case 134:
YY_RULE_SETUP
BEGIN(SECT2);
} else {
START_CODEBLOCK(true);
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
}
}
YY_BREAK
sectnum = 0;
#if 1
piece_pack();
- piece_append("</PLex_Section2>");
+ piece_append("</AST_Section2>");
piece_pack();
return ~YY_NULL;
#else
bracelevel = 1;
BEGIN(PERCENT_BRACE_ACTION);
piece_flush(strlen(yytext) - 2);
- piece_append("<PLex_Section1Or2_CodeBlock>");
+ piece_append("<AST_Section1Or2_CodeBlock>");
piece_flush(2);
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
}
YY_BREAK
case 139:
bracelevel = 1;
BEGIN(PERCENT_BRACE_ACTION);
piece_flush(strlen(yytext) - 2);
- piece_append("<PLex_Section2_Rule_Action>");
+ piece_append("<AST_Section2_Rule_Action>");
if ( in_rule )
{
piece_pack();
piece_escape(yytext, 2);
piece_pack();
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
return ~'\n';
#else
return '\n';
abort();
#else
piece_flush(strlen(yytext));
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
#endif
}
YY_BREAK
;
piece_flush(i);
piece_pack();
- piece_append("<PLex_Section2_Rule_Action continued=\"true\">");
+ piece_append("<AST_Section2_Rule_Action continued=\"true\">");
piece_escape(yytext, strlen(yytext));
- piece_append("</PLex_Section2_Rule_Action>");
+ piece_append("</AST_Section2_Rule_Action>");
piece_pack();
return ~'\n';
#else
piece_pack();
piece_escape(yytext, strlen(yytext));
piece_pack();
- piece_append("<PLex_Section2_Rule_Action><PLex_Text>");
+ piece_append("<AST_Section2_Rule_Action><AST_Text>");
return ~'\n';
#else
return '\n';
piece_pack();
piece_escape(yytext, strlen(yytext));
piece_pack();
- piece_append("<PLex_Section2_Rule_Action><PLex_Text>");
+ piece_append("<AST_Section2_Rule_Action><AST_Text>");
return ~'\n';
#else
return '\n';
outn("/* Begin user sect3 */");
#if 1
piece_pack();
- piece_append("</PLex_Section2>");
+ piece_append("</AST_Section2>");
piece_escape(yytext, strlen(yytext));
piece_pack();
- piece_append("<PLex_Section3>");
+ piece_append("<AST_Section3>");
return ~YY_NULL;
#else
yyterminate(); /* to stop the parser */
sectnum = 0;
#if 1
piece_pack();
- piece_append("</PLex_Section2>");
+ piece_append("</AST_Section2>");
piece_pack();
return ~YY_NULL;
#else
case 220:
YY_RULE_SETUP
#line 1041 "scan.l"
-bracelevel = 0; piece_append("</PLex_Text>");
+bracelevel = 0; piece_append("</AST_Text>");
YY_BREAK
case 221:
YY_RULE_SETUP
piece_flush(strlen(yytext));
if (doing_codeblock)
- piece_append("</PLex_Section1Or2_CodeBlock>");
+ piece_append("</AST_Section1Or2_CodeBlock>");
else
- markup_action("</PLex_Section2_Rule_Action>");
+ markup_action("</AST_Section2_Rule_Action>");
doing_rule_action = doing_codeblock = false;
BEGIN(SECT2);
}
{
add_action( "\tYY_BREAK]""]\n" );
piece_flush(strlen(yytext));
- markup_action("</PLex_Text></PLex_Section2_Rule_Action>");
+ markup_action("</AST_Text></AST_Section2_Rule_Action>");
}
doing_rule_action = false;
/* rule 241 can match eol */
YY_RULE_SETUP
#line 1114 "scan.l"
-++linenum; ACTION_ECHO; if (bracelevel <= 0) { BEGIN(SECT2); piece_flush(strlen(yytext)); if (doing_rule_action) markup_action("</PLex_Text></PLex_Section2_Rule_Action>"); } else { BEGIN(ACTION); }
+++linenum; ACTION_ECHO; if (bracelevel <= 0) { BEGIN(SECT2); piece_flush(strlen(yytext)); if (doing_rule_action) markup_action("</AST_Text></AST_Section2_Rule_Action>"); } else { BEGIN(ACTION); }
YY_BREAK
case 242:
YY_RULE_SETUP
sectnum = 0;
#if 1
piece_pack();
- piece_append("</PLex_Section3>");
+ piece_append("</AST_Section3>");
piece_pack();
return ~YY_NULL;
#else
sectnum = 0;
#if 1
piece_pack();
- piece_append("</PLex_Section3>");
+ piece_append("</AST_Section3>");
piece_pack();
return ~YY_NULL;
#else
}
static void markup_action(const char *text) {
- /* append to last token text so it appears inside <PLex_Section2_Rule>..</PLex_Section2_Rule> */
+ /* append to last token text so it appears inside <AST_Section2_Rule>..</AST_Section2_Rule> */
/* a problem here is that Rule has already been reduced (marked up), */
/* because we returned a '\n' token when we detected start of action, */
- /* hence we need to move the closing </PLex_Section2_Rule> tag over to our right */
+ /* hence we need to move the closing </AST_Section2_Rule> tag over to our right */
int i = strlen(piece[--piece0]);
- if (i < 21 || strcmp(piece[piece0] + i - 21, "</PLex_Section2_Rule>") != 0)
+ if (i < 20 || strcmp(piece[piece0] + i - 20, "</AST_Section2_Rule>") != 0)
abort();
- piece[piece0][i - 21] = 0;
+ piece[piece0][i - 20] = 0;
piece_append(text);
- piece_append("</PLex_Section2_Rule>");
+ piece_append("</AST_Section2_Rule>");
piece_pack();
}
int i = piece1;
while (--i >= piece0 && strcmp(piece[i], "no") == 0)
;
- sprintf(piece_temp, "<PLex_Section1_Options_%s%s>", name, sense ? " value=\"true\"" : "");
+ sprintf(piece_temp, "<AST_Section1_Options_%s%s>", name, sense ? " value=\"true\"" : "");
piece_insert(i + 1, piece_temp);
piece_flush(strlen(yytext));
- sprintf(piece_temp, "</PLex_Section1_Options_%s>", name);
+ sprintf(piece_temp, "</AST_Section1_Options_%s>", name);
piece_append(piece_temp);
- /* append to last token text so it appears inside <PLex_Section1_Options>..</PLex_Section1_Options> */
+ /* append to last token text so it appears inside <AST_Section1_Options>..</AST_Section1_Options> */
--piece0;
piece_pack();
}
{ \
strncpy( nmstr, yytext, sizeof(nmstr) ); \
piece_pack(); \
- piece_append("<PLex_Name>"); \
+ piece_append("<AST_Name>"); \
piece_escape(yytext, strlen(yytext)); \
- piece_append("</PLex_Name>"); \
+ piece_append("</AST_Name>"); \
piece_pack(); \
return ~NAME; \
/* return NAME;*/ \
add_action(M4QSTART); \
yy_push_state(CODEBLOCK); \
if ((indented_code = x)) ACTION_ECHO; \
- piece_append("<PLex_Section1Or2_CodeBlock>"); \
+ piece_append("<AST_Section1Or2_CodeBlock>"); \
} while(0)
#define END_CODEBLOCK do { \
yy_pop_state();\
add_action(M4QEND); \
if (!indented_code) line_directive_out(NULL, 0);\
- piece_append("</PLex_Section1Or2_CodeBlock>"); \
+ piece_append("</AST_Section1Or2_CodeBlock>"); \
} while (0)
/* Nick */
<INITIAL>{
- ^{WS} START_CODEBLOCK(true); piece_append("<PLex_Text>");
+ ^{WS} START_CODEBLOCK(true); piece_append("<AST_Text>");
^"/*" add_action("/*[""["); yy_push_state( COMMENT );
^#{OPTWS}line{WS} yy_push_state( LINEDIR );
^"%s"{NAME}? return SCDECL;
^"%x"{NAME}? return XSCDECL;
- ^"%{".*{NL} START_CODEBLOCK(false); piece_flush(strlen(yytext)); piece_append("<PLex_Text>");
+ ^"%{".*{NL} START_CODEBLOCK(false); piece_flush(strlen(yytext)); piece_append("<AST_Text>");
^"%top"[[:blank:]]*"{"[[:blank:]]*{NL} {
brace_start_line = linenum;
++linenum;
line_directive_out(NULL, 1);
BEGIN(SECT2PROLOG);
#if 1
- piece_append("</PLex_Section1>");
+ piece_append("</AST_Section1>");
piece_pack();
piece_escape(yytext, strlen(yytext));
- piece_append("<PLex_Section2>");
+ piece_append("<AST_Section2>");
piece_pack();
return ~SECTEND;
#else
#endif
}
- ^"%pointer".*{NL} yytext_is_array = false; ++linenum; piece_append("<PLex_Section1_Options><PLex_Section1_Options_Array>"); piece_flush(strlen(yytext) - 1); piece_append("</PLex_Section1_Options_Array></PLex_Section1_Options>");
- ^"%array".*{NL} yytext_is_array = true; ++linenum; piece_append("<PLex_Section1_Options><PLex_Section1_Options_Array value=\"true\">"); piece_flush(strlen(yytext) - 1); piece_append("</PLex_Section1_Options_Array></PLex_Section1_Options>");
+ ^"%pointer".*{NL} yytext_is_array = false; ++linenum; piece_append("<AST_Section1_Options><AST_Section1_Options_Array>"); piece_flush(strlen(yytext) - 1); piece_append("</AST_Section1_Options_Array></AST_Section1_Options>");
+ ^"%array".*{NL} yytext_is_array = true; ++linenum; piece_append("<AST_Section1_Options><AST_Section1_Options_Array value=\"true\">"); piece_flush(strlen(yytext) - 1); piece_append("</AST_Section1_Options_Array></AST_Section1_Options>");
^"%option" BEGIN(OPTION); return TOK_OPTION;
}
<CODEBLOCK>{
- ^"%}".*{NL} ++linenum; piece_append("</PLex_Text>"); piece_flush(strlen(yytext)); END_CODEBLOCK;
+ ^"%}".*{NL} ++linenum; piece_append("</AST_Text>"); piece_flush(strlen(yytext)); END_CODEBLOCK;
[^\n%\[\]]* ACTION_ECHO;
. ACTION_ECHO;
{NL} {
++linenum;
ACTION_ECHO;
- if ( indented_code ) { piece_flush(strlen(yytext)); piece_append("</PLex_Text>"); END_CODEBLOCK; }
+ if ( indented_code ) { piece_flush(strlen(yytext)); piece_append("</AST_Text>"); END_CODEBLOCK; }
}
}
nmstr[strlen( nmstr ) - 1] = '\0';
#if 1
piece_pack();
- piece_append("<PLex_String>\"<PLex_Text>");
+ piece_append("<AST_String>\"<AST_Text>");
piece_escape(yytext + 1, strlen(yytext + 1) - 1);
- piece_append("</PLex_Text>\"</PLex_String>");
+ piece_append("</AST_Text>\"</AST_String>");
piece_pack();
return ~NAME; /* actually a misnomer */
#else
^"%{".* ++bracelevel; yyless( 2 ); /* eat only %{ */
^"%}".* --bracelevel; yyless( 2 ); /* eat only %} */
- ^{WS} START_CODEBLOCK(true); piece_append("<PLex_Text>"); /* indented code in prolog */
+ ^{WS} START_CODEBLOCK(true); piece_append("<AST_Text>"); /* indented code in prolog */
^{NOT_WS}.* {
/* non-indented code */
BEGIN(SECT2);
} else {
START_CODEBLOCK(true);
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
}
}
sectnum = 0;
#if 1
piece_pack();
- piece_append("</PLex_Section2>");
+ piece_append("</AST_Section2>");
piece_pack();
return ~YY_NULL;
#else
bracelevel = 1;
BEGIN(PERCENT_BRACE_ACTION);
piece_flush(strlen(yytext) - 2);
- piece_append("<PLex_Section1Or2_CodeBlock>");
+ piece_append("<AST_Section1Or2_CodeBlock>");
piece_flush(2);
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
}
^{OPTWS}"<" {
bracelevel = 1;
BEGIN(PERCENT_BRACE_ACTION);
piece_flush(strlen(yytext) - 2);
- piece_append("<PLex_Section2_Rule_Action>");
+ piece_append("<AST_Section2_Rule_Action>");
if ( in_rule )
{
piece_pack();
piece_escape(yytext, 2);
piece_pack();
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
return ~'\n';
#else
return '\n';
abort();
#else
piece_flush(strlen(yytext));
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
#endif
}
{WS}"|".*{NL} {
;
piece_flush(i);
piece_pack();
- piece_append("<PLex_Section2_Rule_Action continued=\"true\">");
+ piece_append("<AST_Section2_Rule_Action continued=\"true\">");
piece_escape(yytext, strlen(yytext));
- piece_append("</PLex_Section2_Rule_Action>");
+ piece_append("</AST_Section2_Rule_Action>");
piece_pack();
return ~'\n';
#else
piece_pack();
piece_escape(yytext, strlen(yytext));
piece_pack();
- piece_append("<PLex_Section2_Rule_Action><PLex_Text>");
+ piece_append("<AST_Section2_Rule_Action><AST_Text>");
return ~'\n';
#else
return '\n';
piece_pack();
piece_escape(yytext, strlen(yytext));
piece_pack();
- piece_append("<PLex_Section2_Rule_Action><PLex_Text>");
+ piece_append("<AST_Section2_Rule_Action><AST_Text>");
return ~'\n';
#else
return '\n';
outn("/* Begin user sect3 */");
#if 1
piece_pack();
- piece_append("</PLex_Section2>");
+ piece_append("</AST_Section2>");
piece_escape(yytext, strlen(yytext));
piece_pack();
- piece_append("<PLex_Section3>");
+ piece_append("<AST_Section3>");
return ~YY_NULL;
#else
yyterminate(); /* to stop the parser */
sectnum = 0;
#if 1
piece_pack();
- piece_append("</PLex_Section2>");
+ piece_append("</AST_Section2>");
piece_pack();
return ~YY_NULL;
#else
<PERCENT_BRACE_ACTION>{
- {OPTWS}"%}".* bracelevel = 0; piece_append("</PLex_Text>");
+ {OPTWS}"%}".* bracelevel = 0; piece_append("</AST_Text>");
<ACTION>"/*" ACTION_ECHO; yy_push_state( CODE_COMMENT );
piece_flush(strlen(yytext));
if (doing_codeblock)
- piece_append("</PLex_Section1Or2_CodeBlock>");
+ piece_append("</AST_Section1Or2_CodeBlock>");
else
- markup_action("</PLex_Section2_Rule_Action>");
+ markup_action("</AST_Section2_Rule_Action>");
doing_rule_action = doing_codeblock = false;
BEGIN(SECT2);
}
{
add_action( "\tYY_BREAK]""]\n" );
piece_flush(strlen(yytext));
- markup_action("</PLex_Text></PLex_Section2_Rule_Action>");
+ markup_action("</AST_Text></AST_Section2_Rule_Action>");
}
doing_rule_action = false;
<ACTION_STRING,CHARACTER_CONSTANT>{
(\\\n)* ACTION_ECHO;
\\(\\\n)*. ACTION_ECHO;
- {NL} ++linenum; ACTION_ECHO; if (bracelevel <= 0) { BEGIN(SECT2); piece_flush(strlen(yytext)); if (doing_rule_action) markup_action("</PLex_Text></PLex_Section2_Rule_Action>"); } else { BEGIN(ACTION); }
+ {NL} ++linenum; ACTION_ECHO; if (bracelevel <= 0) { BEGIN(SECT2); piece_flush(strlen(yytext)); if (doing_rule_action) markup_action("</AST_Text></AST_Section2_Rule_Action>"); } else { BEGIN(ACTION); }
. ACTION_ECHO;
}
sectnum = 0;
#if 1
piece_pack();
- piece_append("</PLex_Section3>");
+ piece_append("</AST_Section3>");
piece_pack();
return ~YY_NULL;
#else
sectnum = 0;
#if 1
piece_pack();
- piece_append("</PLex_Section3>");
+ piece_append("</AST_Section3>");
piece_pack();
return ~YY_NULL;
#else
}
static void markup_action(const char *text) {
- /* append to last token text so it appears inside <PLex_Section2_Rule>..</PLex_Section2_Rule> */
+ /* append to last token text so it appears inside <AST_Section2_Rule>..</AST_Section2_Rule> */
/* a problem here is that Rule has already been reduced (marked up), */
/* because we returned a '\n' token when we detected start of action, */
- /* hence we need to move the closing </PLex_Section2_Rule> tag over to our right */
+ /* hence we need to move the closing </AST_Section2_Rule> tag over to our right */
int i = strlen(piece[--piece0]);
- if (i < 21 || strcmp(piece[piece0] + i - 21, "</PLex_Section2_Rule>") != 0)
+ if (i < 20 || strcmp(piece[piece0] + i - 20, "</AST_Section2_Rule>") != 0)
abort();
- piece[piece0][i - 21] = 0;
+ piece[piece0][i - 20] = 0;
piece_append(text);
- piece_append("</PLex_Section2_Rule>");
+ piece_append("</AST_Section2_Rule>");
piece_pack();
}
int i = piece1;
while (--i >= piece0 && strcmp(piece[i], "no") == 0)
;
- sprintf(piece_temp, "<PLex_Section1_Options_%s%s>", name, sense ? " value=\"true\"" : "");
+ sprintf(piece_temp, "<AST_Section1_Options_%s%s>", name, sense ? " value=\"true\"" : "");
piece_insert(i + 1, piece_temp);
piece_flush(strlen(yytext));
- sprintf(piece_temp, "</PLex_Section1_Options_%s>", name);
+ sprintf(piece_temp, "</AST_Section1_Options_%s>", name);
piece_append(piece_temp);
- /* append to last token text so it appears inside <PLex_Section1_Options>..</PLex_Section1_Options> */
+ /* append to last token text so it appears inside <AST_Section1_Options>..</AST_Section1_Options> */
--piece0;
piece_pack();
}