X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=ragel%2Frlscan.h;h=430bef6b1d53a86fa94e15285b2321767b4991fe;hb=d738ba2c5a1131a68264f4b190c456c713a0d5b4;hp=acbc40b8e7d38b71d8f9815d6dc46d1290316d17;hpb=7a3c373482f6466d31ae3fe9a81be0c444bcde57;p=external%2Fragel.git diff --git a/ragel/rlscan.h b/ragel/rlscan.h index acbc40b..430bef6 100644 --- a/ragel/rlscan.h +++ b/ragel/rlscan.h @@ -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 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. */