Now supplying the XmlParser to writeMachines.
[external/ragel.git] / ragel / rlparse.kh
index a829d78..e840f8a 100644 (file)
 /* This is used for tracking the include files/machine pairs. */
 struct IncludeHistoryItem
 {
-       IncludeHistoryItem( char *fileName, char *sectionName )
+       IncludeHistoryItem( const char *fileName, const char *sectionName )
                : fileName(fileName), sectionName(sectionName) {}
 
-       char *fileName;
-       char *sectionName;
+       const char *fileName;
+       const char *sectionName;
 };
 
 typedef Vector<IncludeHistoryItem> IncludeHistory;
@@ -106,11 +106,13 @@ struct Parser
        void init();
        int parseLangEl( int type, const Token *token );
 
-       Parser( char *fileName, char *sectionName, InputLoc &sectionLoc )
+       Parser( const char *fileName, char *sectionName, InputLoc &sectionLoc )
                : sectionName(sectionName)
        {
                pd = new ParseData( fileName, sectionName, sectionLoc );
                exportContext.append( false );
+               includeHistory.append( IncludeHistoryItem( 
+                               fileName, sectionName ) );
        }
 
        int token( InputLoc &loc, int tokId, char *tokstart, int toklen );