Browse Source

[master] Regenerated lexer.cc

Francis Dupont 9 years ago
parent
commit
cfaeaf74e4
1 changed files with 76 additions and 65 deletions
  1. 76 65
      src/lib/eval/lexer.cc

+ 76 - 65
src/lib/eval/lexer.cc

@@ -18,7 +18,7 @@
 #define FLEX_SCANNER
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #define FLEX_BETA
 #endif
 #endif
@@ -72,7 +72,6 @@ typedef int16_t flex_int16_t;
 typedef uint16_t flex_uint16_t;
 typedef uint16_t flex_uint16_t;
 typedef int32_t flex_int32_t;
 typedef int32_t flex_int32_t;
 typedef uint32_t flex_uint32_t;
 typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
 #else
 #else
 typedef signed char flex_int8_t;
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef short int flex_int16_t;
@@ -80,7 +79,6 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 
 /* Limits of integral types. */
 /* Limits of integral types. */
 #ifndef INT8_MIN
 #ifndef INT8_MIN
@@ -111,6 +109,8 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #define UINT32_MAX             (4294967295U)
 #endif
 #endif
 
 
+#endif /* ! C99 */
+
 #endif /* ! FLEXINT_H */
 #endif /* ! FLEXINT_H */
 
 
 /* %endif */
 /* %endif */
@@ -225,11 +225,18 @@ extern FILE *yyin, *yyout;
      */
      */
     #define  YY_LESS_LINENO(n) \
     #define  YY_LESS_LINENO(n) \
             do { \
             do { \
-                yy_size_t yyl;\
+                int yyl;\
                 for ( yyl = n; yyl < yyleng; ++yyl )\
                 for ( yyl = n; yyl < yyleng; ++yyl )\
                     if ( yytext[yyl] == '\n' )\
                     if ( yytext[yyl] == '\n' )\
                         --yylineno;\
                         --yylineno;\
             }while(0)
             }while(0)
+    #define YY_LINENO_REWIND_TO(dst) \
+            do {\
+                const char *p;\
+                for ( p = yy_cp-1; p >= (dst); --p)\
+                    if ( *p == '\n' )\
+                        --yylineno;\
+            }while(0)
     
     
 /* Return all but the first "n" matched characters back to the input stream. */
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
 #define yyless(n) \
@@ -420,7 +427,7 @@ void yyfree (void *  );
 /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
 /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
 /* Begin user sect3 */
 /* Begin user sect3 */
 
 
-#define yywrap(n) 1
+#define yywrap() 1
 #define YY_SKIP_YYWRAP
 #define YY_SKIP_YYWRAP
 
 
 #define FLEX_DEBUG
 #define FLEX_DEBUG
@@ -438,6 +445,8 @@ int yylineno = 1;
 extern char *yytext;
 extern char *yytext;
 #define yytext_ptr yytext
 #define yytext_ptr yytext
 
 
+/* %% [1.5] DFA */
+
 /* %if-c-only Standard (non-C++) definition */
 /* %if-c-only Standard (non-C++) definition */
 
 
 static yy_state_type yy_get_previous_state (void );
 static yy_state_type yy_get_previous_state (void );
@@ -453,7 +462,7 @@ static void yy_fatal_error (yyconst char msg[]  );
 #define YY_DO_BEFORE_ACTION \
 #define YY_DO_BEFORE_ACTION \
 	(yytext_ptr) = yy_bp; \
 	(yytext_ptr) = yy_bp; \
 /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
 /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
-	yyleng = (yy_size_t) (yy_cp - yy_bp); \
+	yyleng = (size_t) (yy_cp - yy_bp); \
 	(yy_hold_char) = *yy_cp; \
 	(yy_hold_char) = *yy_cp; \
 	*yy_cp = '\0'; \
 	*yy_cp = '\0'; \
 /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
 /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
@@ -585,8 +594,8 @@ int yy_flex_debug = 1;
 
 
 static yyconst flex_int16_t yy_rule_linenum[19] =
 static yyconst flex_int16_t yy_rule_linenum[19] =
     {   0,
     {   0,
-       83,   87,   93,  103,  109,  123,  124,  125,  126,  127,
-      128,  129,  130,  131,  132,  133,  134,  136
+       86,   90,   96,  106,  112,  126,  127,  128,  129,  130,
+      131,  132,  133,  134,  135,  136,  137,  139
     } ;
     } ;
 
 
 /* The intent behind this definition is that it'll catch
 /* The intent behind this definition is that it'll catch
@@ -630,6 +639,9 @@ char *yytext;
 // The location of the current token. The lexer will keep updating it. This
 // The location of the current token. The lexer will keep updating it. This
 // variable will be useful for logging errors.
 // variable will be useful for logging errors.
 static isc::eval::location loc;
 static isc::eval::location loc;
+
+// To avoid the call to exit... oops!
+#define YY_FATAL_ERROR(msg) isc::eval::EvalContext::fatal(msg)
 /* noyywrap disables automatic rewinding for the next file to parse. Since we
 /* noyywrap disables automatic rewinding for the next file to parse. Since we
    always parse only a single string, there's no need to do any wraps. And
    always parse only a single string, there's no need to do any wraps. And
    using yywrap requires linking with -lfl, which provides the default yywrap
    using yywrap requires linking with -lfl, which provides the default yywrap
@@ -648,12 +660,12 @@ static isc::eval::location loc;
    useful in more complex cases. */
    useful in more complex cases. */
 /* These are not token expressions yet, just convenience expressions that
 /* These are not token expressions yet, just convenience expressions that
    can be used during actual token definitions. */
    can be used during actual token definitions. */
-#line 70 "lexer.ll"
+#line 73 "lexer.ll"
 // This code run each time a pattern is matched. It updates the location
 // This code run each time a pattern is matched. It updates the location
 // by moving it ahead by yyleng bytes. yyleng specifies the length of the
 // by moving it ahead by yyleng bytes. yyleng specifies the length of the
 // currently matched token.
 // currently matched token.
 #define YY_USER_ACTION  loc.columns(yyleng);
 #define YY_USER_ACTION  loc.columns(yyleng);
-#line 657 "lexer.cc"
+#line 669 "lexer.cc"
 
 
 #define INITIAL 0
 #define INITIAL 0
 
 
@@ -771,7 +783,7 @@ static int input (void );
 /* This used to be an fputs(), but since the string might contain NUL's,
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  * we now use fwrite().
  */
  */
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
 /* %endif */
 /* %endif */
 /* %if-c++-only C++ definition */
 /* %if-c++-only C++ definition */
 /* %endif */
 /* %endif */
@@ -786,7 +798,7 @@ static int input (void );
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
 		{ \
 		int c = '*'; \
 		int c = '*'; \
-		yy_size_t n; \
+		size_t n; \
 		for ( n = 0; n < max_size && \
 		for ( n = 0; n < max_size && \
 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
 			buf[n] = (char) c; \
@@ -892,17 +904,6 @@ YY_DECL
 	register char *yy_cp, *yy_bp;
 	register char *yy_cp, *yy_bp;
 	register int yy_act;
 	register int yy_act;
     
     
-/* %% [7.0] user's declarations go here */
-#line 76 "lexer.ll"
-
-
-
-    // Code run each time yylex is called.
-    loc.step();
-
-
-#line 905 "lexer.cc"
-
 	if ( !(yy_init) )
 	if ( !(yy_init) )
 		{
 		{
 		(yy_init) = 1;
 		(yy_init) = 1;
@@ -937,6 +938,18 @@ YY_DECL
 		yy_load_buffer_state( );
 		yy_load_buffer_state( );
 		}
 		}
 
 
+	{
+/* %% [7.0] user's declarations go here */
+#line 79 "lexer.ll"
+
+
+
+    // Code run each time yylex is called.
+    loc.step();
+
+
+#line 952 "lexer.cc"
+
 	while ( 1 )		/* loops until end-of-file is reached */
 	while ( 1 )		/* loops until end-of-file is reached */
 		{
 		{
 /* %% [8.0] yymore()-related code goes here */
 /* %% [8.0] yymore()-related code goes here */
@@ -955,7 +968,7 @@ YY_DECL
 yy_match:
 yy_match:
 		do
 		do
 			{
 			{
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
 			if ( yy_accept[yy_current_state] )
 			if ( yy_accept[yy_current_state] )
 				{
 				{
 				(yy_last_accepting_state) = yy_current_state;
 				(yy_last_accepting_state) = yy_current_state;
@@ -1023,7 +1036,7 @@ do_action:	/* This label is used only to access EOF actions. */
 
 
 case 1:
 case 1:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 83 "lexer.ll"
+#line 86 "lexer.ll"
 {
 {
     // Ok, we found a with space. Let's ignore it and update loc variable.
     // Ok, we found a with space. Let's ignore it and update loc variable.
     loc.step();
     loc.step();
@@ -1032,7 +1045,7 @@ YY_RULE_SETUP
 case 2:
 case 2:
 /* rule 2 can match eol */
 /* rule 2 can match eol */
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 87 "lexer.ll"
+#line 90 "lexer.ll"
 {
 {
     // Newline found. Let's update the location and continue.
     // Newline found. Let's update the location and continue.
     loc.lines(yyleng);
     loc.lines(yyleng);
@@ -1041,7 +1054,7 @@ YY_RULE_SETUP
 	YY_BREAK
 	YY_BREAK
 case 3:
 case 3:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 93 "lexer.ll"
+#line 96 "lexer.ll"
 {
 {
     // A string has been matched. It contains the actual string and single quotes.
     // A string has been matched. It contains the actual string and single quotes.
     // We need to get those quotes out of the way and just use its content, e.g.
     // We need to get those quotes out of the way and just use its content, e.g.
@@ -1054,7 +1067,7 @@ YY_RULE_SETUP
 	YY_BREAK
 	YY_BREAK
 case 4:
 case 4:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 103 "lexer.ll"
+#line 106 "lexer.ll"
 {
 {
     // A hex string has been matched. It contains the '0x' or '0X' header
     // A hex string has been matched. It contains the '0x' or '0X' header
     // followed by at least one hexadecimal digit.
     // followed by at least one hexadecimal digit.
@@ -1063,7 +1076,7 @@ YY_RULE_SETUP
 	YY_BREAK
 	YY_BREAK
 case 5:
 case 5:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 109 "lexer.ll"
+#line 112 "lexer.ll"
 {
 {
     // An integer was found.
     // An integer was found.
     std::string tmp(yytext);
     std::string tmp(yytext);
@@ -1080,79 +1093,79 @@ YY_RULE_SETUP
 	YY_BREAK
 	YY_BREAK
 case 6:
 case 6:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 123 "lexer.ll"
+#line 126 "lexer.ll"
 return isc::eval::EvalParser::make_EQUAL(loc);
 return isc::eval::EvalParser::make_EQUAL(loc);
 	YY_BREAK
 	YY_BREAK
 case 7:
 case 7:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 124 "lexer.ll"
+#line 127 "lexer.ll"
 return isc::eval::EvalParser::make_OPTION(loc);
 return isc::eval::EvalParser::make_OPTION(loc);
 	YY_BREAK
 	YY_BREAK
 case 8:
 case 8:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 125 "lexer.ll"
+#line 128 "lexer.ll"
 return isc::eval::EvalParser::make_TEXT(loc);
 return isc::eval::EvalParser::make_TEXT(loc);
 	YY_BREAK
 	YY_BREAK
 case 9:
 case 9:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 126 "lexer.ll"
+#line 129 "lexer.ll"
 return isc::eval::EvalParser::make_HEX(loc);
 return isc::eval::EvalParser::make_HEX(loc);
 	YY_BREAK
 	YY_BREAK
 case 10:
 case 10:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 127 "lexer.ll"
+#line 130 "lexer.ll"
 return isc::eval::EvalParser::make_SUBSTRING(loc);
 return isc::eval::EvalParser::make_SUBSTRING(loc);
 	YY_BREAK
 	YY_BREAK
 case 11:
 case 11:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 128 "lexer.ll"
+#line 131 "lexer.ll"
 return isc::eval::EvalParser::make_ALL(loc);
 return isc::eval::EvalParser::make_ALL(loc);
 	YY_BREAK
 	YY_BREAK
 case 12:
 case 12:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 129 "lexer.ll"
+#line 132 "lexer.ll"
 return isc::eval::EvalParser::make_DOT(loc);
 return isc::eval::EvalParser::make_DOT(loc);
 	YY_BREAK
 	YY_BREAK
 case 13:
 case 13:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 130 "lexer.ll"
+#line 133 "lexer.ll"
 return isc::eval::EvalParser::make_LPAREN(loc);
 return isc::eval::EvalParser::make_LPAREN(loc);
 	YY_BREAK
 	YY_BREAK
 case 14:
 case 14:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 131 "lexer.ll"
+#line 134 "lexer.ll"
 return isc::eval::EvalParser::make_RPAREN(loc);
 return isc::eval::EvalParser::make_RPAREN(loc);
 	YY_BREAK
 	YY_BREAK
 case 15:
 case 15:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 132 "lexer.ll"
+#line 135 "lexer.ll"
 return isc::eval::EvalParser::make_LBRACKET(loc);
 return isc::eval::EvalParser::make_LBRACKET(loc);
 	YY_BREAK
 	YY_BREAK
 case 16:
 case 16:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 133 "lexer.ll"
+#line 136 "lexer.ll"
 return isc::eval::EvalParser::make_RBRACKET(loc);
 return isc::eval::EvalParser::make_RBRACKET(loc);
 	YY_BREAK
 	YY_BREAK
 case 17:
 case 17:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 134 "lexer.ll"
+#line 137 "lexer.ll"
 return isc::eval::EvalParser::make_COMA(loc);
 return isc::eval::EvalParser::make_COMA(loc);
 	YY_BREAK
 	YY_BREAK
 case 18:
 case 18:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 136 "lexer.ll"
+#line 139 "lexer.ll"
 driver.error (loc, "Invalid character: " + std::string(yytext));
 driver.error (loc, "Invalid character: " + std::string(yytext));
 	YY_BREAK
 	YY_BREAK
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(INITIAL):
-#line 137 "lexer.ll"
+#line 140 "lexer.ll"
 return isc::eval::EvalParser::make_END(loc);
 return isc::eval::EvalParser::make_END(loc);
 	YY_BREAK
 	YY_BREAK
 case 19:
 case 19:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 138 "lexer.ll"
+#line 141 "lexer.ll"
 ECHO;
 ECHO;
 	YY_BREAK
 	YY_BREAK
-#line 1156 "lexer.cc"
+#line 1169 "lexer.cc"
 
 
 	case YY_END_OF_BUFFER:
 	case YY_END_OF_BUFFER:
 		{
 		{
@@ -1283,6 +1296,7 @@ ECHO;
 			"fatal flex scanner internal error--no action found" );
 			"fatal flex scanner internal error--no action found" );
 	} /* end of action switch */
 	} /* end of action switch */
 		} /* end of scanning one token */
 		} /* end of scanning one token */
+	} /* end of user's declarations */
 } /* end of yylex */
 } /* end of yylex */
 /* %ok-for-header */
 /* %ok-for-header */
 
 
@@ -1357,7 +1371,7 @@ static int yy_get_next_buffer (void)
 			{ /* Not enough room in the buffer - grow it. */
 			{ /* Not enough room in the buffer - grow it. */
 
 
 			/* just a shorter name for the current buffer */
 			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+			YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
 
 
 			int yy_c_buf_p_offset =
 			int yy_c_buf_p_offset =
 				(int) ((yy_c_buf_p) - b->yy_ch_buf);
 				(int) ((yy_c_buf_p) - b->yy_ch_buf);
@@ -1503,7 +1517,7 @@ static int yy_get_next_buffer (void)
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 	yy_is_jam = (yy_current_state == 51);
 	yy_is_jam = (yy_current_state == 51);
 
 
-	return yy_is_jam ? 0 : yy_current_state;
+		return yy_is_jam ? 0 : yy_current_state;
 }
 }
 
 
 /* %if-c-only */
 /* %if-c-only */
@@ -1562,7 +1576,7 @@ static int yy_get_next_buffer (void)
 				case EOB_ACT_END_OF_FILE:
 				case EOB_ACT_END_OF_FILE:
 					{
 					{
 					if ( yywrap( ) )
 					if ( yywrap( ) )
-						return 0;
+						return EOF;
 
 
 					if ( ! (yy_did_buffer_switch_on_eof) )
 					if ( ! (yy_did_buffer_switch_on_eof) )
 						YY_NEW_FILE;
 						YY_NEW_FILE;
@@ -1726,17 +1740,6 @@ static void yy_load_buffer_state  (void)
 	yyfree((void *) b  );
 	yyfree((void *) b  );
 }
 }
 
 
-/* %if-c-only */
-
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-    
-/* %endif */
-
-/* %if-c++-only */
-/* %endif */
-
 /* Initializes or reinitializes a buffer.
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * This function is sometimes called more than once on the same buffer,
  * such as during a yyrestart() or at EOF.
  * such as during a yyrestart() or at EOF.
@@ -1977,8 +1980,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
 /* %if-c-only */
 /* %if-c-only */
 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  * scan from a @e copy of @a bytes.
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  * 
  * 
  * @return the newly allocated buffer state object.
  * @return the newly allocated buffer state object.
  */
  */
@@ -1986,7 +1989,8 @@ YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len
 {
 {
 	YY_BUFFER_STATE b;
 	YY_BUFFER_STATE b;
 	char *buf;
 	char *buf;
-	yy_size_t n, i;
+	yy_size_t n;
+	yy_size_t i;
     
     
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
 	n = _yybytes_len + 2;
@@ -2249,7 +2253,7 @@ void yyfree (void * ptr )
 
 
 /* %ok-for-header */
 /* %ok-for-header */
 
 
-#line 138 "lexer.ll"
+#line 141 "lexer.ll"
 
 
 
 
 
 
@@ -2263,8 +2267,8 @@ EvalContext::scanStringBegin()
     YY_BUFFER_STATE buffer;
     YY_BUFFER_STATE buffer;
     buffer = yy_scan_bytes(string_.c_str(),string_.size());
     buffer = yy_scan_bytes(string_.c_str(),string_.size());
     if (!buffer) {
     if (!buffer) {
-        error("cannot scan string");
-        exit(EXIT_FAILURE);
+        fatal("cannot scan string");
+	// fatal() throws an exception so this can't be reached
     }
     }
 }
 }
 
 
@@ -2274,3 +2278,10 @@ EvalContext::scanStringEnd()
     yy_delete_buffer(YY_CURRENT_BUFFER);
     yy_delete_buffer(YY_CURRENT_BUFFER);
 }
 }
 
 
+namespace {
+/// To avoid unused function error
+class Dummy {
+    void dummy() { yy_fatal_error("Fix me: how to disable its definition?"); }
+};
+}
+