|
@@ -18,7 +18,7 @@
|
|
|
#define FLEX_SCANNER
|
|
|
#define YY_FLEX_MAJOR_VERSION 2
|
|
|
#define YY_FLEX_MINOR_VERSION 5
|
|
|
-#define YY_FLEX_SUBMINOR_VERSION 37
|
|
|
+#define YY_FLEX_SUBMINOR_VERSION 39
|
|
|
#if YY_FLEX_SUBMINOR_VERSION > 0
|
|
|
#define FLEX_BETA
|
|
|
#endif
|
|
@@ -230,6 +230,13 @@ extern FILE *yyin, *yyout;
|
|
|
if ( yytext[yyl] == '\n' )\
|
|
|
--yylineno;\
|
|
|
}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. */
|
|
|
#define yyless(n) \
|
|
@@ -438,6 +445,8 @@ int yylineno = 1;
|
|
|
extern char *yytext;
|
|
|
#define yytext_ptr yytext
|
|
|
|
|
|
+/* %% [1.5] DFA */
|
|
|
+
|
|
|
/* %if-c-only Standard (non-C++) definition */
|
|
|
|
|
|
static yy_state_type yy_get_previous_state (void );
|
|
@@ -460,8 +469,8 @@ static void yy_fatal_error (yyconst char msg[] );
|
|
|
(yy_c_buf_p) = yy_cp;
|
|
|
|
|
|
/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
|
|
|
-#define YY_NUM_RULES 11
|
|
|
-#define YY_END_OF_BUFFER 12
|
|
|
+#define YY_NUM_RULES 16
|
|
|
+#define YY_END_OF_BUFFER 17
|
|
|
/* This struct is not used in this scanner,
|
|
|
but its presence is necessary. */
|
|
|
struct yy_trans_info
|
|
@@ -469,12 +478,13 @@ struct yy_trans_info
|
|
|
flex_int32_t yy_verify;
|
|
|
flex_int32_t yy_nxt;
|
|
|
};
|
|
|
-static yyconst flex_int16_t yy_accept[36] =
|
|
|
+static yyconst flex_int16_t yy_accept[44] =
|
|
|
{ 0,
|
|
|
- 0, 0, 12, 10, 1, 2, 10, 7, 8, 9,
|
|
|
- 10, 10, 10, 1, 2, 3, 0, 5, 0, 0,
|
|
|
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
- 0, 0, 4, 6, 0
|
|
|
+ 0, 0, 17, 15, 1, 2, 15, 10, 11, 14,
|
|
|
+ 15, 5, 5, 15, 12, 13, 15, 15, 15, 1,
|
|
|
+ 2, 0, 3, 5, 0, 6, 0, 0, 0, 4,
|
|
|
+ 9, 0, 0, 0, 0, 0, 0, 7, 0, 0,
|
|
|
+ 0, 8, 0
|
|
|
} ;
|
|
|
|
|
|
static yyconst flex_int32_t yy_ec[256] =
|
|
@@ -483,16 +493,16 @@ static yyconst flex_int32_t yy_ec[256] =
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
1, 2, 1, 1, 1, 1, 1, 1, 4, 5,
|
|
|
- 6, 1, 1, 7, 1, 1, 1, 8, 8, 8,
|
|
|
- 8, 8, 8, 8, 8, 8, 8, 1, 1, 1,
|
|
|
- 9, 1, 1, 1, 10, 10, 10, 10, 10, 10,
|
|
|
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
|
|
|
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
|
|
|
- 11, 1, 12, 1, 10, 1, 10, 13, 10, 10,
|
|
|
-
|
|
|
- 10, 10, 14, 10, 15, 10, 10, 10, 10, 16,
|
|
|
- 17, 18, 10, 19, 20, 21, 22, 10, 10, 10,
|
|
|
- 10, 10, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
+ 6, 1, 1, 7, 8, 1, 1, 9, 10, 10,
|
|
|
+ 10, 10, 10, 10, 10, 10, 10, 1, 1, 1,
|
|
|
+ 11, 1, 1, 1, 12, 12, 12, 12, 12, 12,
|
|
|
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
+ 1, 1, 1, 1, 1, 1, 1, 13, 1, 1,
|
|
|
+ 14, 1, 15, 1, 1, 1, 16, 17, 12, 12,
|
|
|
+
|
|
|
+ 12, 12, 18, 1, 19, 1, 1, 20, 1, 21,
|
|
|
+ 22, 23, 1, 24, 25, 26, 27, 1, 1, 13,
|
|
|
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
@@ -509,57 +519,61 @@ static yyconst flex_int32_t yy_ec[256] =
|
|
|
1, 1, 1, 1, 1
|
|
|
} ;
|
|
|
|
|
|
-static yyconst flex_int32_t yy_meta[23] =
|
|
|
+static yyconst flex_int32_t yy_meta[28] =
|
|
|
{ 0,
|
|
|
- 1, 1, 1, 2, 1, 1, 1, 2, 1, 2,
|
|
|
- 1, 1, 2, 2, 2, 2, 2, 2, 2, 2,
|
|
|
- 2, 2
|
|
|
+ 1, 1, 2, 1, 1, 1, 1, 1, 3, 3,
|
|
|
+ 1, 3, 1, 1, 1, 3, 3, 1, 1, 1,
|
|
|
+ 1, 1, 1, 1, 1, 1, 1
|
|
|
} ;
|
|
|
|
|
|
-static yyconst flex_int16_t yy_base[37] =
|
|
|
+static yyconst flex_int16_t yy_base[46] =
|
|
|
{ 0,
|
|
|
- 0, 0, 48, 49, 45, 43, 41, 49, 49, 49,
|
|
|
- 35, 25, 20, 39, 37, 49, 35, 49, 17, 24,
|
|
|
- 21, 15, 17, 12, 16, 12, 19, 14, 20, 10,
|
|
|
- 15, 11, 49, 49, 49, 22
|
|
|
+ 0, 0, 62, 63, 59, 57, 55, 63, 63, 63,
|
|
|
+ 19, 21, 23, 47, 63, 63, 37, 33, 28, 52,
|
|
|
+ 50, 48, 63, 26, 0, 63, 31, 24, 32, 0,
|
|
|
+ 63, 29, 22, 24, 19, 23, 19, 63, 23, 20,
|
|
|
+ 22, 63, 63, 36, 35
|
|
|
} ;
|
|
|
|
|
|
-static yyconst flex_int16_t yy_def[37] =
|
|
|
+static yyconst flex_int16_t yy_def[46] =
|
|
|
{ 0,
|
|
|
- 35, 1, 35, 35, 35, 35, 36, 35, 35, 35,
|
|
|
- 35, 35, 35, 35, 35, 35, 36, 35, 35, 35,
|
|
|
- 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
|
|
|
- 35, 35, 35, 35, 0, 35
|
|
|
+ 43, 1, 43, 43, 43, 43, 44, 43, 43, 43,
|
|
|
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
|
|
|
+ 43, 44, 43, 43, 45, 43, 43, 43, 43, 45,
|
|
|
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
|
|
|
+ 43, 43, 0, 43, 43
|
|
|
} ;
|
|
|
|
|
|
-static yyconst flex_int16_t yy_nxt[72] =
|
|
|
+static yyconst flex_int16_t yy_nxt[91] =
|
|
|
{ 0,
|
|
|
- 4, 5, 6, 7, 8, 9, 10, 4, 11, 4,
|
|
|
- 4, 4, 4, 4, 4, 4, 12, 4, 4, 13,
|
|
|
- 4, 4, 31, 17, 34, 32, 33, 31, 30, 29,
|
|
|
- 28, 27, 26, 25, 24, 23, 22, 21, 16, 15,
|
|
|
- 14, 20, 19, 18, 16, 15, 14, 35, 3, 35,
|
|
|
- 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
|
|
|
- 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
|
|
|
- 35
|
|
|
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
|
|
|
+ 14, 4, 4, 15, 16, 17, 4, 4, 4, 4,
|
|
|
+ 4, 18, 4, 4, 19, 4, 4, 24, 24, 24,
|
|
|
+ 24, 24, 24, 25, 24, 24, 22, 30, 22, 42,
|
|
|
+ 41, 40, 39, 38, 37, 36, 35, 34, 33, 32,
|
|
|
+ 31, 23, 21, 20, 29, 28, 27, 26, 23, 21,
|
|
|
+ 20, 43, 3, 43, 43, 43, 43, 43, 43, 43,
|
|
|
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
|
|
|
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43
|
|
|
} ;
|
|
|
|
|
|
-static yyconst flex_int16_t yy_chk[72] =
|
|
|
+static yyconst flex_int16_t yy_chk[91] =
|
|
|
{ 0,
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
- 1, 1, 31, 36, 32, 30, 31, 29, 28, 27,
|
|
|
- 26, 25, 24, 23, 22, 21, 20, 19, 17, 15,
|
|
|
- 14, 13, 12, 11, 7, 6, 5, 3, 35, 35,
|
|
|
- 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
|
|
|
- 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
|
|
|
- 35
|
|
|
+ 1, 1, 1, 1, 1, 1, 1, 11, 11, 12,
|
|
|
+ 12, 13, 13, 12, 24, 24, 44, 45, 44, 41,
|
|
|
+ 40, 39, 37, 36, 35, 34, 33, 32, 29, 28,
|
|
|
+ 27, 22, 21, 20, 19, 18, 17, 14, 7, 6,
|
|
|
+ 5, 3, 43, 43, 43, 43, 43, 43, 43, 43,
|
|
|
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
|
|
|
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43
|
|
|
} ;
|
|
|
|
|
|
/* Table of booleans, true if rule could match eol. */
|
|
|
-static yyconst flex_int32_t yy_rule_can_match_eol[12] =
|
|
|
+static yyconst flex_int32_t yy_rule_can_match_eol[17] =
|
|
|
{ 0,
|
|
|
-0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
|
|
|
+0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
|
|
|
|
|
|
static yy_state_type yy_last_accepting_state;
|
|
|
static char *yy_last_accepting_cpos;
|
|
@@ -567,9 +581,10 @@ static char *yy_last_accepting_cpos;
|
|
|
extern int yy_flex_debug;
|
|
|
int yy_flex_debug = 1;
|
|
|
|
|
|
-static yyconst flex_int16_t yy_rule_linenum[11] =
|
|
|
+static yyconst flex_int16_t yy_rule_linenum[16] =
|
|
|
{ 0,
|
|
|
- 83, 87, 93, 103, 154, 155, 156, 157, 158, 160
|
|
|
+ 83, 87, 93, 103, 109, 123, 124, 125, 126, 127,
|
|
|
+ 128, 129, 130, 131, 133
|
|
|
} ;
|
|
|
|
|
|
/* The intent behind this definition is that it'll catch
|
|
@@ -636,7 +651,7 @@ static isc::eval::location loc;
|
|
|
// by moving it ahead by yyleng bytes. yyleng specifies the length of the
|
|
|
// currently matched token.
|
|
|
#define YY_USER_ACTION loc.columns(yyleng);
|
|
|
-#line 640 "lexer.cc"
|
|
|
+#line 655 "lexer.cc"
|
|
|
|
|
|
#define INITIAL 0
|
|
|
|
|
@@ -875,17 +890,6 @@ YY_DECL
|
|
|
register char *yy_cp, *yy_bp;
|
|
|
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 888 "lexer.cc"
|
|
|
-
|
|
|
if ( !(yy_init) )
|
|
|
{
|
|
|
(yy_init) = 1;
|
|
@@ -920,6 +924,18 @@ YY_DECL
|
|
|
yy_load_buffer_state( );
|
|
|
}
|
|
|
|
|
|
+ {
|
|
|
+/* %% [7.0] user's declarations go here */
|
|
|
+#line 76 "lexer.ll"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // Code run each time yylex is called.
|
|
|
+ loc.step();
|
|
|
+
|
|
|
+
|
|
|
+#line 938 "lexer.cc"
|
|
|
+
|
|
|
while ( 1 ) /* loops until end-of-file is reached */
|
|
|
{
|
|
|
/* %% [8.0] yymore()-related code goes here */
|
|
@@ -938,7 +954,7 @@ YY_DECL
|
|
|
yy_match:
|
|
|
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] )
|
|
|
{
|
|
|
(yy_last_accepting_state) = yy_current_state;
|
|
@@ -947,13 +963,13 @@ yy_match:
|
|
|
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
|
|
{
|
|
|
yy_current_state = (int) yy_def[yy_current_state];
|
|
|
- if ( yy_current_state >= 36 )
|
|
|
+ if ( yy_current_state >= 44 )
|
|
|
yy_c = yy_meta[(unsigned int) yy_c];
|
|
|
}
|
|
|
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
|
|
++yy_cp;
|
|
|
}
|
|
|
- while ( yy_current_state != 35 );
|
|
|
+ while ( yy_current_state != 43 );
|
|
|
yy_cp = (yy_last_accepting_cpos);
|
|
|
yy_current_state = (yy_last_accepting_state);
|
|
|
|
|
@@ -967,7 +983,7 @@ yy_find_action:
|
|
|
|
|
|
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
|
|
|
{
|
|
|
- int yyl;
|
|
|
+ yy_size_t yyl;
|
|
|
for ( yyl = 0; yyl < yyleng; ++yyl )
|
|
|
if ( yytext[yyl] == '\n' )
|
|
|
|
|
@@ -982,13 +998,13 @@ do_action: /* This label is used only to access EOF actions. */
|
|
|
{
|
|
|
if ( yy_act == 0 )
|
|
|
fprintf( stderr, "--scanner backing up\n" );
|
|
|
- else if ( yy_act < 11 )
|
|
|
+ else if ( yy_act < 16 )
|
|
|
fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
|
|
|
(long)yy_rule_linenum[yy_act], yytext );
|
|
|
- else if ( yy_act == 11 )
|
|
|
+ else if ( yy_act == 16 )
|
|
|
fprintf( stderr, "--accepting default rule (\"%s\")\n",
|
|
|
yytext );
|
|
|
- else if ( yy_act == 12 )
|
|
|
+ else if ( yy_act == 17 )
|
|
|
fprintf( stderr, "--(end of buffer or a NUL)\n" );
|
|
|
else
|
|
|
fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
|
|
@@ -1039,96 +1055,88 @@ case 4:
|
|
|
YY_RULE_SETUP
|
|
|
#line 103 "lexer.ll"
|
|
|
{
|
|
|
- // option[123] token found. Let's see if the numeric value can be
|
|
|
- // converted to integer and if it has a reasonable value.
|
|
|
- // yytext contains the whole expression (.e.g. option[123]). We need
|
|
|
- // to trim it down to just the code, which will be transformed to
|
|
|
- // integer.
|
|
|
+ // A hex string has been matched. It contains the '0x' or '0X' header
|
|
|
+ // followed by at least one hexadecimal digit.
|
|
|
+ return isc::eval::EvalParser::make_HEXSTRING(yytext, loc);
|
|
|
+}
|
|
|
+ YY_BREAK
|
|
|
+case 5:
|
|
|
+YY_RULE_SETUP
|
|
|
+#line 109 "lexer.ll"
|
|
|
+{
|
|
|
+ // An integer was found.
|
|
|
std::string tmp(yytext);
|
|
|
|
|
|
- // Sanity check if the token is at least 9 (strlen("option[X]")) long.
|
|
|
- // This should never happen as it would indicate bison bug.
|
|
|
- if (tmp.length() < 9) {
|
|
|
- driver.error(loc, "The string matched (" + tmp + ") is too short,"
|
|
|
- " expected at least 9 (option[X]) characters");
|
|
|
- }
|
|
|
- size_t pos = tmp.find("[");
|
|
|
- if (pos == std::string::npos) {
|
|
|
- driver.error(loc, "The string matched (" + tmp + ") is invalid,"
|
|
|
- " as it does not contain opening bracket.");
|
|
|
- }
|
|
|
- // Let's get rid of all the text before [, including [.
|
|
|
- tmp = tmp.substr(pos + 1);
|
|
|
-
|
|
|
- // And finally remove the trailing ].
|
|
|
- pos = tmp.find("]");
|
|
|
- if (pos == std::string::npos) {
|
|
|
- driver.error(loc, "The string matched (" + tmp + ") is invalid,"
|
|
|
- " as it does not contain closing bracket.");
|
|
|
- }
|
|
|
- tmp = tmp.substr(0, pos);
|
|
|
-
|
|
|
- uint16_t n = 0;
|
|
|
try {
|
|
|
- n = boost::lexical_cast<int>(tmp);
|
|
|
+ static_cast<void>(boost::lexical_cast<int>(tmp));
|
|
|
} catch (const boost::bad_lexical_cast &) {
|
|
|
- driver.error(loc, "Failed to convert specified option code to "
|
|
|
- "number ('" + tmp + "' in expression " + std::string(yytext));
|
|
|
- }
|
|
|
-
|
|
|
- // 65535 is the maximum value of the option code in DHCPv6. We want the
|
|
|
- // code to be the same for v4 and v6, so let's ignore for a moment that
|
|
|
- // max. option code in DHCPv4 is 255.
|
|
|
- /// @todo: Maybe add a flag somewhere in EvalContext to indicate if we're
|
|
|
- /// running in v4 (allowed max 255) or v6 (allowed max 65535).
|
|
|
- if (n<0 || n>65535) {
|
|
|
- driver.error(loc, "Option code has invalid value in " +
|
|
|
- std::string(yytext) + ". Allowed range: 0..65535");
|
|
|
+ driver.error(loc, "Failed to convert " + tmp + " to an integer.");
|
|
|
}
|
|
|
|
|
|
- return isc::eval::EvalParser::make_OPTION(n, loc);
|
|
|
+ // The parser needs the string form as double conversion is no lossless
|
|
|
+ return isc::eval::EvalParser::make_INTEGER(tmp, loc);
|
|
|
}
|
|
|
YY_BREAK
|
|
|
-case 5:
|
|
|
+case 6:
|
|
|
YY_RULE_SETUP
|
|
|
-#line 154 "lexer.ll"
|
|
|
+#line 123 "lexer.ll"
|
|
|
return isc::eval::EvalParser::make_EQUAL(loc);
|
|
|
YY_BREAK
|
|
|
-case 6:
|
|
|
+case 7:
|
|
|
YY_RULE_SETUP
|
|
|
-#line 155 "lexer.ll"
|
|
|
+#line 124 "lexer.ll"
|
|
|
+return isc::eval::EvalParser::make_OPTION(loc);
|
|
|
+ YY_BREAK
|
|
|
+case 8:
|
|
|
+YY_RULE_SETUP
|
|
|
+#line 125 "lexer.ll"
|
|
|
return isc::eval::EvalParser::make_SUBSTRING(loc);
|
|
|
YY_BREAK
|
|
|
-case 7:
|
|
|
+case 9:
|
|
|
+YY_RULE_SETUP
|
|
|
+#line 126 "lexer.ll"
|
|
|
+return isc::eval::EvalParser::make_ALL(loc);
|
|
|
+ YY_BREAK
|
|
|
+case 10:
|
|
|
YY_RULE_SETUP
|
|
|
-#line 156 "lexer.ll"
|
|
|
+#line 127 "lexer.ll"
|
|
|
return isc::eval::EvalParser::make_LPAREN(loc);
|
|
|
YY_BREAK
|
|
|
-case 8:
|
|
|
+case 11:
|
|
|
YY_RULE_SETUP
|
|
|
-#line 157 "lexer.ll"
|
|
|
+#line 128 "lexer.ll"
|
|
|
return isc::eval::EvalParser::make_RPAREN(loc);
|
|
|
YY_BREAK
|
|
|
-case 9:
|
|
|
+case 12:
|
|
|
YY_RULE_SETUP
|
|
|
-#line 158 "lexer.ll"
|
|
|
+#line 129 "lexer.ll"
|
|
|
+return isc::eval::EvalParser::make_LBRACKET(loc);
|
|
|
+ YY_BREAK
|
|
|
+case 13:
|
|
|
+YY_RULE_SETUP
|
|
|
+#line 130 "lexer.ll"
|
|
|
+return isc::eval::EvalParser::make_RBRACKET(loc);
|
|
|
+ YY_BREAK
|
|
|
+case 14:
|
|
|
+YY_RULE_SETUP
|
|
|
+#line 131 "lexer.ll"
|
|
|
return isc::eval::EvalParser::make_COMA(loc);
|
|
|
YY_BREAK
|
|
|
-case 10:
|
|
|
+case 15:
|
|
|
YY_RULE_SETUP
|
|
|
-#line 160 "lexer.ll"
|
|
|
+#line 133 "lexer.ll"
|
|
|
driver.error (loc, "Invalid character: " + std::string(yytext));
|
|
|
YY_BREAK
|
|
|
case YY_STATE_EOF(INITIAL):
|
|
|
-#line 161 "lexer.ll"
|
|
|
+#line 134 "lexer.ll"
|
|
|
return isc::eval::EvalParser::make_END(loc);
|
|
|
YY_BREAK
|
|
|
-case 11:
|
|
|
+case 16:
|
|
|
YY_RULE_SETUP
|
|
|
-#line 162 "lexer.ll"
|
|
|
+#line 135 "lexer.ll"
|
|
|
ECHO;
|
|
|
YY_BREAK
|
|
|
-#line 1132 "lexer.cc"
|
|
|
+#line 1140 "lexer.cc"
|
|
|
|
|
|
case YY_END_OF_BUFFER:
|
|
|
{
|
|
@@ -1259,6 +1267,7 @@ ECHO;
|
|
|
"fatal flex scanner internal error--no action found" );
|
|
|
} /* end of action switch */
|
|
|
} /* end of scanning one token */
|
|
|
+ } /* end of user's declarations */
|
|
|
} /* end of yylex */
|
|
|
/* %ok-for-header */
|
|
|
|
|
@@ -1440,7 +1449,7 @@ static int yy_get_next_buffer (void)
|
|
|
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
|
|
{
|
|
|
yy_current_state = (int) yy_def[yy_current_state];
|
|
|
- if ( yy_current_state >= 36 )
|
|
|
+ if ( yy_current_state >= 44 )
|
|
|
yy_c = yy_meta[(unsigned int) yy_c];
|
|
|
}
|
|
|
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
|
@@ -1473,11 +1482,11 @@ static int yy_get_next_buffer (void)
|
|
|
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
|
|
{
|
|
|
yy_current_state = (int) yy_def[yy_current_state];
|
|
|
- if ( yy_current_state >= 36 )
|
|
|
+ if ( yy_current_state >= 44 )
|
|
|
yy_c = yy_meta[(unsigned int) yy_c];
|
|
|
}
|
|
|
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
|
|
- yy_is_jam = (yy_current_state == 35);
|
|
|
+ yy_is_jam = (yy_current_state == 43);
|
|
|
|
|
|
return yy_is_jam ? 0 : yy_current_state;
|
|
|
}
|
|
@@ -1952,7 +1961,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len
|
|
|
YY_BUFFER_STATE b;
|
|
|
char *buf;
|
|
|
yy_size_t n;
|
|
|
- int i;
|
|
|
+ yy_size_t i;
|
|
|
|
|
|
/* Get memory for full buffer, including space for trailing EOB's. */
|
|
|
n = _yybytes_len + 2;
|
|
@@ -2215,26 +2224,28 @@ void yyfree (void * ptr )
|
|
|
|
|
|
/* %ok-for-header */
|
|
|
|
|
|
-#line 162 "lexer.ll"
|
|
|
+#line 135 "lexer.ll"
|
|
|
+
|
|
|
|
|
|
|
|
|
+using namespace isc::eval;
|
|
|
|
|
|
void
|
|
|
-EvalContext::scanBegin()
|
|
|
+EvalContext::scanStringBegin()
|
|
|
{
|
|
|
+ loc.initialize(&file_);
|
|
|
yy_flex_debug = trace_scanning_;
|
|
|
- if (file.empty () || file == "-") {
|
|
|
- yyin = stdin;
|
|
|
- }
|
|
|
- else if (!(yyin = fopen(file.c_str (), "r"))) {
|
|
|
- error("cannot open " + file + ": " + strerror(errno));
|
|
|
+ YY_BUFFER_STATE buffer;
|
|
|
+ buffer = yy_scan_bytes(string_.c_str(),string_.size());
|
|
|
+ if (!buffer) {
|
|
|
+ error("cannot scan string");
|
|
|
exit(EXIT_FAILURE);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void
|
|
|
-EvalContext::scanEnd()
|
|
|
+EvalContext::scanStringEnd()
|
|
|
{
|
|
|
- fclose(yyin);
|
|
|
+ yy_delete_buffer(YY_CURRENT_BUFFER);
|
|
|
}
|
|
|
|