Added support for DESTDIR variable. Patch from Diego 'Flameeyes' Pettenò.
[external/ragel.git] / ragel / rlscan.h
index acbc40b..430bef6 100644 (file)
@@ -35,22 +35,9 @@ using std::ostream;
 
 extern char *Parser_lelNames[];
 
-/* This is used for tracking the current stack of include file/machine pairs. It is
- * is used to detect and recursive include structure. */
-struct IncludeStackItem
-{
-       IncludeStackItem( char *fileName, char *sectionName )
-               : fileName(fileName), sectionName(sectionName) {}
-
-       char *fileName;
-       char *sectionName;
-};
-
-typedef Vector<IncludeStackItem> IncludeStack;
-
 struct Scanner
 {
-       Scanner( char *fileName, istream &input, ostream &output,
+       Scanner( const char *fileName, istream &input, ostream &output,
                        Parser *inclToParser, char *inclSectionTarg,
                        int includeDepth, bool importMachines )
        : 
@@ -67,10 +54,10 @@ struct Scanner
                lastToken(0)
                {}
 
-       bool recursiveInclude( char *inclFileName, char *inclSectionName );
+       bool duplicateInclude( char *inclFileName, char *inclSectionName );
 
        /* Make a list of places to look for an included file. */
-       char **makeIncludePathChecks( char *curFileName, char *fileName, int len );
+       char **makeIncludePathChecks( const char *curFileName, const char *fileName, int len );
        std::ifstream *tryOpenInclude( char **pathChecks, long &found );
 
        void handleMachine();
@@ -82,7 +69,7 @@ struct Scanner
        void token( int type, char c );
        void token( int type );
        void processToken( int type, char *tokdata, int toklen );
-       void directToParser( Parser *toParser, char *tokFileName, int tokLine, 
+       void directToParser( Parser *toParser, const char *tokFileName, int tokLine, 
                int tokColumn, int type, char *tokdata, int toklen );
        void flushImport( );
        void importToken( int type, char *start, char *end );
@@ -95,7 +82,7 @@ struct Scanner
        bool active();
        ostream &scan_error();
 
-       char *fileName;
+       const char *fileName;
        istream &input;
        ostream &output;
        Parser *inclToParser;
@@ -128,7 +115,6 @@ struct Scanner
         * allowing for unnamed sections. */
        Parser *parser;
        bool ignoreSection;
-       IncludeStack includeStack;
 
        /* This is set if ragel has already emitted an error stating that
         * no section name has been seen and thus no parser exists. */