Rename plex to pilex, rename PLex object and prefix to AST
authorNick Downing <downing.nick@gmail.com>
Tue, 11 Sep 2018 05:17:31 +0000 (15:17 +1000)
committerNick Downing <downing.nick@gmail.com>
Tue, 11 Sep 2018 05:37:53 +0000 (15:37 +1000)
src/main.c
src/parse.c
src/parse.y
src/scan.c
src/scan.l

index e74b22f..18db943 100644 (file)
@@ -169,7 +169,7 @@ int flex_main (int argc, char *argv[])
 
 #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 ();
 
@@ -191,7 +191,7 @@ int flex_main (int argc, char *argv[])
        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;
index a67dd84..f04daac 100644 (file)
@@ -1554,8 +1554,8 @@ yyreduce:
   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  */
@@ -1564,8 +1564,8 @@ yyreduce:
   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;
@@ -1621,8 +1621,8 @@ yyreduce:
     {
                        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;
@@ -1630,8 +1630,8 @@ yyreduce:
   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;
@@ -1641,8 +1641,8 @@ yyreduce:
     { 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;
@@ -1650,8 +1650,8 @@ yyreduce:
   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;
@@ -1659,8 +1659,8 @@ yyreduce:
   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;
@@ -1668,8 +1668,8 @@ yyreduce:
   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;
@@ -1677,8 +1677,8 @@ yyreduce:
   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;
@@ -1686,8 +1686,8 @@ yyreduce:
   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;
@@ -1742,8 +1742,8 @@ yyreduce:
                                        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;
@@ -1771,8 +1771,8 @@ yyreduce:
                                                        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;
@@ -1799,8 +1799,8 @@ yyreduce:
                                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;
@@ -1820,8 +1820,8 @@ yyreduce:
   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;
@@ -1842,8 +1842,8 @@ yyreduce:
                                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;
@@ -1859,7 +1859,7 @@ yyreduce:
  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;
index 814842a..9563286 100644 (file)
@@ -173,14 +173,14 @@ initlex           :
 
 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
@@ -223,47 +223,47 @@ option            :  TOK_OUTFILE '=' NAME
                        {
                        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>");
  }
                |
                ;
@@ -315,8 +315,8 @@ flexrule    :  '^' rule
                                        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
@@ -341,8 +341,8 @@ flexrule    :  '^' 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
@@ -366,8 +366,8 @@ flexrule    :  '^' rule
                                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
@@ -380,8 +380,8 @@ scon_stk_ptr        :
 
 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>");
  }
 
                |  '<' '*' '>'
@@ -399,8 +399,8 @@ scon                :  '<' scon_stk_ptr namelist2 '>'
                                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\">");
                        }
 
                |
@@ -413,7 +413,7 @@ scon                :  '<' scon_stk_ptr namelist2 '>'
  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 />");
  }
                ;
 
index 6a38f61..d947d7a 100644 (file)
@@ -1954,9 +1954,9 @@ extern const char *escaped_qstart, *escaped_qend;
          { \
        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;*/ \
@@ -1994,14 +1994,14 @@ extern const char *escaped_qstart, *escaped_qend;
     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 */
@@ -2359,7 +2359,7 @@ do_action:        /* This label is used only to access EOF actions. */
 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
@@ -2385,7 +2385,7 @@ case 6:
 /* 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 */
@@ -2419,10 +2419,10 @@ YY_RULE_SETUP
                        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
@@ -2434,13 +2434,13 @@ case 11:
 /* 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
@@ -2620,7 +2620,7 @@ case 39:
 /* 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
@@ -2639,7 +2639,7 @@ 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
 
@@ -3169,9 +3169,9 @@ YY_RULE_SETUP
                        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
@@ -3209,7 +3209,7 @@ YY_RULE_SETUP
 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
@@ -3224,7 +3224,7 @@ YY_RULE_SETUP
             BEGIN(SECT2);
         } else {
             START_CODEBLOCK(true);
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
         }
     }
        YY_BREAK
@@ -3246,7 +3246,7 @@ case YY_STATE_EOF(SECT2PROLOG):
                        sectnum = 0;
 #if 1
  piece_pack();
- piece_append("</PLex_Section2>");
+ piece_append("</AST_Section2>");
  piece_pack();
  return ~YY_NULL;
 #else
@@ -3271,9 +3271,9 @@ YY_RULE_SETUP
                        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:
@@ -3326,7 +3326,7 @@ YY_RULE_SETUP
                        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 )
                                {
@@ -3336,7 +3336,7 @@ YY_RULE_SETUP
  piece_pack();
  piece_escape(yytext, 2);
  piece_pack();
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
  return ~'\n';
 #else
                                return '\n';
@@ -3346,7 +3346,7 @@ YY_RULE_SETUP
  abort();
 #else
  piece_flush(strlen(yytext));
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
 #endif
                        }
        YY_BREAK
@@ -3371,9 +3371,9 @@ YY_RULE_SETUP
   ;
  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
@@ -3428,7 +3428,7 @@ YY_RULE_SETUP
  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';
@@ -3464,7 +3464,7 @@ YY_RULE_SETUP
  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';
@@ -3489,10 +3489,10 @@ YY_RULE_SETUP
                        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 */
@@ -3693,7 +3693,7 @@ case YY_STATE_EOF(SECT2):
                        sectnum = 0;
 #if 1
  piece_pack();
- piece_append("</PLex_Section2>");
+ piece_append("</AST_Section2>");
  piece_pack();
  return ~YY_NULL;
 #else
@@ -4053,7 +4053,7 @@ YY_RULE_SETUP
 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
@@ -4096,9 +4096,9 @@ 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);
         }
@@ -4154,7 +4154,7 @@ YY_RULE_SETUP
  {
                       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;
@@ -4209,7 +4209,7 @@ case 241:
 /* 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
@@ -4278,7 +4278,7 @@ case YY_STATE_EOF(SECT3):
         sectnum = 0;
 #if 1
  piece_pack();
- piece_append("</PLex_Section3>");
+ piece_append("</AST_Section3>");
  piece_pack();
  return ~YY_NULL;
 #else
@@ -4315,7 +4315,7 @@ case YY_STATE_EOF(SECT3_NOESCAPE):
        sectnum = 0;
 #if 1
  piece_pack();
- piece_append("</PLex_Section3>");
+ piece_append("</AST_Section3>");
  piece_pack();
  return ~YY_NULL;
 #else
@@ -5512,16 +5512,16 @@ int flexscan(void) {
 }
 
 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();
 }
 
@@ -5531,12 +5531,12 @@ static void markup_option(const char *name, int sense) {
  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();
 }
index 8e21e78..a3563e9 100644 (file)
@@ -81,9 +81,9 @@ extern const char *escaped_qstart, *escaped_qend;
          { \
        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;*/ \
@@ -121,14 +121,14 @@ extern const char *escaped_qstart, *escaped_qend;
     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 */
@@ -192,12 +192,12 @@ M4QEND      "]""]"
 
 
 <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;
@@ -217,10 +217,10 @@ M4QEND      "]""]"
                        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
@@ -228,8 +228,8 @@ M4QEND      "]""]"
 #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;
 
@@ -304,13 +304,13 @@ M4QEND      "]""]"
 }
 
 <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; }
                        }
 }
 
@@ -512,9 +512,9 @@ M4QEND      "]""]"
                        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
@@ -536,7 +536,7 @@ M4QEND      "]""]"
        ^"%{".* ++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 */
@@ -548,7 +548,7 @@ M4QEND      "]""]"
             BEGIN(SECT2);
         } else {
             START_CODEBLOCK(true);
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
         }
     }
 
@@ -560,7 +560,7 @@ M4QEND      "]""]"
                        sectnum = 0;
 #if 1
  piece_pack();
- piece_append("</PLex_Section2>");
+ piece_append("</AST_Section2>");
  piece_pack();
  return ~YY_NULL;
 #else
@@ -578,9 +578,9 @@ M4QEND      "]""]"
                        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}"<"         {
@@ -604,7 +604,7 @@ M4QEND      "]""]"
                        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 )
                                {
@@ -614,7 +614,7 @@ M4QEND      "]""]"
  piece_pack();
  piece_escape(yytext, 2);
  piece_pack();
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
  return ~'\n';
 #else
                                return '\n';
@@ -624,7 +624,7 @@ M4QEND      "]""]"
  abort();
 #else
  piece_flush(strlen(yytext));
- piece_append("<PLex_Text>");
+ piece_append("<AST_Text>");
 #endif
                        }
        {WS}"|".*{NL}   {
@@ -644,9 +644,9 @@ M4QEND      "]""]"
   ;
  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
@@ -692,7 +692,7 @@ M4QEND      "]""]"
  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';
@@ -724,7 +724,7 @@ M4QEND      "]""]"
  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';
@@ -742,10 +742,10 @@ M4QEND      "]""]"
                        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 */
@@ -905,7 +905,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0';  /* chop trailing brace */
                        sectnum = 0;
 #if 1
  piece_pack();
- piece_append("</PLex_Section2>");
+ piece_append("</AST_Section2>");
  piece_pack();
  return ~YY_NULL;
 #else
@@ -1038,7 +1038,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0';  /* chop trailing brace */
 
 
 <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 );
 
@@ -1063,9 +1063,9 @@ nmstr[yyleng - 2 - end_is_ws] = '\0';  /* chop trailing brace */
 
  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);
         }
@@ -1090,7 +1090,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0';  /* chop trailing brace */
  {
                       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;
@@ -1111,7 +1111,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0';  /* chop trailing brace */
 <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;
 }
 
@@ -1143,7 +1143,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0';  /* chop trailing brace */
         sectnum = 0;
 #if 1
  piece_pack();
- piece_append("</PLex_Section3>");
+ piece_append("</AST_Section3>");
  piece_pack();
  return ~YY_NULL;
 #else
@@ -1160,7 +1160,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0';  /* chop trailing brace */
        sectnum = 0;
 #if 1
  piece_pack();
- piece_append("</PLex_Section3>");
+ piece_append("</AST_Section3>");
  piece_pack();
  return ~YY_NULL;
 #else
@@ -1292,16 +1292,16 @@ int flexscan(void) {
 }
 
 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();
 }
 
@@ -1311,12 +1311,12 @@ static void markup_option(const char *name, int sense) {
  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();
 }