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 )
:
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();
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 );
bool active();
ostream &scan_error();
- char *fileName;
+ const char *fileName;
istream &input;
ostream &output;
Parser *inclToParser;
* 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. */