From 2d21b62007e0d8ac209ffd6f7f0a989417e13388 Mon Sep 17 00:00:00 2001 From: Kaveh Vahedipour Date: Tue, 17 Jan 2017 12:15:18 +0100 Subject: [PATCH] agency compaction leaves last compaction-keep-size indices behind for reference --- arangod/Agency/AgencyFeature.cpp | 10 +- arangod/Agency/AgencyFeature.h | 1 + arangod/Agency/Agent.cpp | 2 +- arangod/Agency/AgentConfiguration.cpp | 42 +- arangod/Agency/AgentConfiguration.h | 7 +- arangod/Aql/tokens.cpp | 617 +++++++++++++++++++++++--- js/client/tests/agency/agency-test.js | 26 +- lib/V8/v8-json.cpp | 568 +++++++++++++++++++++--- scripts/startLocalCluster.sh | 4 +- 9 files changed, 1151 insertions(+), 126 deletions(-) diff --git a/arangod/Agency/AgencyFeature.cpp b/arangod/Agency/AgencyFeature.cpp index 4ee1be966b..5fcd0bb723 100644 --- a/arangod/Agency/AgencyFeature.cpp +++ b/arangod/Agency/AgencyFeature.cpp @@ -45,7 +45,8 @@ AgencyFeature::AgencyFeature(application_features::ApplicationServer* server) _supervision(false), _waitForSync(true), _supervisionFrequency(5.0), - _compactionStepSize(1000), + _compactionStepSize(2000), + _compactionKeepSize(500), _supervisionGracePeriod(15.0), _cmdLineTimings(false) { @@ -108,6 +109,10 @@ void AgencyFeature::collectOptions(std::shared_ptr options) { "step size between state machine compactions", new UInt64Parameter(&_compactionStepSize)); + options->addOption("--agency.compaction-keep-size", + "keep as many indices before compaction point", + new UInt64Parameter(&_compactionKeepSize)); + options->addHiddenOption("--agency.wait-for-sync", "wait for hard disk syncs on every persistence call " "(required in production)", @@ -228,7 +233,8 @@ void AgencyFeature::start() { _agent.reset(new consensus::Agent(consensus::config_t( _size, _poolSize, _minElectionTimeout, _maxElectionTimeout, endpoint, _agencyEndpoints, _supervision, _waitForSync, _supervisionFrequency, - _compactionStepSize, _supervisionGracePeriod, _cmdLineTimings))); + _compactionStepSize, _compactionKeepSize, _supervisionGracePeriod, + _cmdLineTimings))); LOG_TOPIC(DEBUG, Logger::AGENCY) << "Starting agency personality"; _agent->start(); diff --git a/arangod/Agency/AgencyFeature.h b/arangod/Agency/AgencyFeature.h index 1187e84313..e2a0c8f406 100644 --- a/arangod/Agency/AgencyFeature.h +++ b/arangod/Agency/AgencyFeature.h @@ -54,6 +54,7 @@ class AgencyFeature : virtual public application_features::ApplicationFeature { bool _waitForSync; double _supervisionFrequency; uint64_t _compactionStepSize; + uint64_t _compactionKeepSize; double _supervisionGracePeriod; std::string _agencyMyAddress; std::vector _agencyEndpoints; diff --git a/arangod/Agency/Agent.cpp b/arangod/Agency/Agent.cpp index 696e193511..3d4a1f8eb6 100644 --- a/arangod/Agency/Agent.cpp +++ b/arangod/Agency/Agent.cpp @@ -236,7 +236,7 @@ void Agent::reportIn(std::string const& peerId, index_t index) { _lastCommitIndex = index; if (_lastCommitIndex >= _nextCompationAfter) { - _state.compact(_lastCommitIndex); + _state.compact(_lastCommitIndex-_config.compactionKeepSize()); _nextCompationAfter += _config.compactionStepSize(); } diff --git a/arangod/Agency/AgentConfiguration.cpp b/arangod/Agency/AgentConfiguration.cpp index aa5523924f..16e02462fc 100644 --- a/arangod/Agency/AgentConfiguration.cpp +++ b/arangod/Agency/AgentConfiguration.cpp @@ -37,7 +37,8 @@ config_t::config_t() _supervision(false), _waitForSync(true), _supervisionFrequency(5.0), - _compactionStepSize(1000), + _compactionStepSize(2000), + _compactionKeepSize(500), _supervisionGracePeriod(15.0), _cmdLineTimings(false), _version(0), @@ -47,7 +48,8 @@ config_t::config_t() config_t::config_t(size_t as, size_t ps, double minp, double maxp, std::string const& e, std::vector const& g, - bool s, bool w, double f, uint64_t c, double p, bool t) + bool s, bool w, double f, uint64_t c, uint64_t k, double p, + bool t) : _agencySize(as), _poolSize(ps), _minPing(minp), @@ -58,6 +60,7 @@ config_t::config_t(size_t as, size_t ps, double minp, double maxp, _waitForSync(w), _supervisionFrequency(f), _compactionStepSize(c), + _compactionKeepSize(k), _supervisionGracePeriod(p), _cmdLineTimings(t), _version(0), @@ -80,6 +83,7 @@ config_t::config_t(config_t&& other) _waitForSync(std::move(other._waitForSync)), _supervisionFrequency(std::move(other._supervisionFrequency)), _compactionStepSize(std::move(other._compactionStepSize)), + _compactionKeepSize(std::move(other._compactionKeepSize)), _supervisionGracePeriod(std::move(other._supervisionGracePeriod)), _cmdLineTimings(std::move(other._cmdLineTimings)), _version(std::move(other._version)), @@ -102,6 +106,7 @@ config_t& config_t::operator=(config_t const& other) { _waitForSync = other._waitForSync; _supervisionFrequency = other._supervisionFrequency; _compactionStepSize = other._compactionStepSize; + _compactionKeepSize = other._compactionKeepSize; _supervisionGracePeriod = other._supervisionGracePeriod; _cmdLineTimings = other._cmdLineTimings; _version = other._version; @@ -123,6 +128,7 @@ config_t& config_t::operator=(config_t&& other) { _waitForSync = std::move(other._waitForSync); _supervisionFrequency = std::move(other._supervisionFrequency); _compactionStepSize = std::move(other._compactionStepSize); + _compactionKeepSize = std::move(other._compactionKeepSize); _supervisionGracePeriod = std::move(other._supervisionGracePeriod); _cmdLineTimings = std::move(other._cmdLineTimings); _version = std::move(other._version); @@ -287,6 +293,11 @@ size_t config_t::compactionStepSize() const { return _compactionStepSize; } +size_t config_t::compactionKeepSize() const { + READ_LOCKER(readLocker, _lock); + return _compactionKeepSize; +} + size_t config_t::size() const { READ_LOCKER(readLocker, _lock); return _agencySize; @@ -479,6 +490,15 @@ void config_t::override(VPackSlice const& conf) { << conf.toJson(); } + if (conf.hasKey(compactionKeepSizeStr) && + conf.get(compactionKeepSizeStr).isUInt()) { + _compactionKeepSize = conf.get(compactionKeepSizeStr).getUInt(); + } else { + LOG_TOPIC(ERR, Logger::AGENCY) << "Failed to override " + << compactionKeepSizeStr << " from " + << conf.toJson(); + } + ++_version; } @@ -515,6 +535,7 @@ query_t config_t::toBuilder() const { ret->add(supervisionStr, VPackValue(_supervision)); ret->add(supervisionFrequencyStr, VPackValue(_supervisionFrequency)); ret->add(compactionStepSizeStr, VPackValue(_compactionStepSize)); + ret->add(compactionKeepSizeStr, VPackValue(_compactionKeepSize)); ret->add(supervisionGracePeriodStr, VPackValue(_supervisionGracePeriod)); ret->add(versionStr, VPackValue(_version)); ret->add(startupStr, VPackValue(_startup)); @@ -685,7 +706,7 @@ bool config_t::merge(VPackSlice const& conf) { _compactionStepSize = conf.get(compactionStepSizeStr).getUInt(); ss << _compactionStepSize << " (persisted)"; } else { - _compactionStepSize = 1000; + _compactionStepSize = 2000; ss << _compactionStepSize << " (default)"; } } else { @@ -693,6 +714,21 @@ bool config_t::merge(VPackSlice const& conf) { } LOG_TOPIC(DEBUG, Logger::AGENCY) << ss.str(); + ss.str(""); + ss.clear(); + ss << "Compaction keep size: "; + if (_compactionKeepSize == 0) { // Command line beats persistence + if (conf.hasKey(compactionKeepSizeStr)) { + _compactionKeepSize = conf.get(compactionKeepSizeStr).getUInt(); + ss << _compactionKeepSize << " (persisted)"; + } else { + _compactionStepSize = 500; + ss << _compactionKeepSize << " (default)"; + } + } else { + ss << _compactionKeepSize << " (command line)"; + } + LOG_TOPIC(DEBUG, Logger::AGENCY) << ss.str(); ++_version; return true; } diff --git a/arangod/Agency/AgentConfiguration.h b/arangod/Agency/AgentConfiguration.h index 9d36b55626..55c5998a36 100644 --- a/arangod/Agency/AgentConfiguration.h +++ b/arangod/Agency/AgentConfiguration.h @@ -51,6 +51,7 @@ static const std::string waitForSyncStr = "wait for sync"; static const std::string supervisionFrequencyStr = "supervision frequency"; static const std::string supervisionGracePeriodStr = "supervision grace period"; static const std::string compactionStepSizeStr = "compaction step size"; +static const std::string compactionKeepSizeStr = "compaction keep size"; static const std::string defaultEndpointStr = "tcp://localhost:8529"; static const std::string versionStr = "version"; static const std::string startupStr = "startup"; @@ -69,6 +70,7 @@ struct config_t { bool _waitForSync; double _supervisionFrequency; uint64_t _compactionStepSize; + uint64_t _compactionKeepSize; double _supervisionGracePeriod; bool _cmdLineTimings; size_t _version; @@ -82,7 +84,7 @@ struct config_t { /// @brief ctor config_t(size_t as, size_t ps, double minp, double maxp, std::string const& e, std::vector const& g, bool s, bool w, double f, - uint64_t c, double p, bool t); + uint64_t c, uint64_t k, double p, bool t); /// @brief copy constructor config_t(config_t const&); @@ -129,6 +131,9 @@ struct config_t { /// @brief pool size size_t compactionStepSize() const; + /// @brief pool size + size_t compactionKeepSize() const; + /// @brief pool size size_t version() const; diff --git a/arangod/Aql/tokens.cpp b/arangod/Aql/tokens.cpp index 47bad339e5..f8211a742b 100644 --- a/arangod/Aql/tokens.cpp +++ b/arangod/Aql/tokens.cpp @@ -3,20 +3,96 @@ -#line 7 "Aql/tokens.cpp" - #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ + + + + + + + + + + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -50,7 +126,6 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -58,7 +133,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -89,8 +163,12 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ + + #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ @@ -112,9 +190,16 @@ typedef unsigned int flex_uint32_t; #define yyconst #endif + + + + + /* Returned upon end-of-file. */ #define YY_NULL 0 + + /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the @@ -122,12 +207,34 @@ typedef unsigned int flex_uint32_t; */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + + + + /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T #define YY_TYPEDEF_YY_SCANNER_T typedef void* yyscan_t; #endif + + + + + + + + + + + + + + + + + + /* For convenience, these vars (plus the bison vars far below) are macros in the reentrant scanner. */ #define yyin yyg->yyin_r @@ -139,12 +246,29 @@ typedef void* yyscan_t; #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) #define yy_flex_debug yyg->yy_flex_debug_r + + + + + + + + + + + + + + + /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * + + /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. @@ -152,23 +276,41 @@ typedef void* yyscan_t; #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START + + /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + + /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE Aqlrestart(yyin ,yyscanner ) + + #define YY_END_OF_BUFFER_CHAR 0 + /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif + /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + + #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; @@ -179,10 +321,16 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif + + + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 + + + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break * existing scanners that call yyless() from OUTSIDE Aqllex. @@ -192,12 +340,22 @@ typedef size_t yy_size_t; */ #define YY_LESS_LINENO(n) \ do { \ - yy_size_t yyl;\ + size_t yyl;\ for ( yyl = n; yyl < yyleng; ++yyl )\ 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) \ do \ @@ -212,14 +370,19 @@ typedef size_t yy_size_t; } \ while ( 0 ) + + #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ @@ -231,7 +394,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -255,6 +418,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -279,6 +443,10 @@ struct yy_buffer_state }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ + + + + /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". @@ -289,11 +457,18 @@ struct yy_buffer_state ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) + + /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + + + + + void Aqlrestart (FILE *input_file ,yyscan_t yyscanner ); void Aql_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); YY_BUFFER_STATE Aql_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); @@ -302,22 +477,30 @@ void Aql_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void Aqlpush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); void Aqlpop_buffer_state (yyscan_t yyscanner ); + static void Aqlensure_buffer_stack (yyscan_t yyscanner ); static void Aql_load_buffer_state (yyscan_t yyscanner ); static void Aql_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); + + #define YY_FLUSH_BUFFER Aql_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) + YY_BUFFER_STATE Aql_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE Aql_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); YY_BUFFER_STATE Aql_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); + void *Aqlalloc (yy_size_t ,yyscan_t yyscanner ); void *Aqlrealloc (void *,yy_size_t ,yyscan_t yyscanner ); void Aqlfree (void * ,yyscan_t yyscanner ); + #define yy_new_buffer Aql_create_buffer + + #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ @@ -328,6 +511,8 @@ void Aqlfree (void * ,yyscan_t yyscanner ); YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } + + #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ @@ -338,34 +523,53 @@ void Aqlfree (void * ,yyscan_t yyscanner ); YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } + + #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + /* Begin user sect3 */ -#define Aqlwrap(n) 1 +#define Aqlwrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; + + + typedef int yy_state_type; #define yytext_ptr yytext_r + + + + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); static int yy_get_next_buffer (yyscan_t yyscanner ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); + + + /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = (yy_size_t) (yy_cp - yy_bp); \ + yyleng = (size_t) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; + + #define YY_NUM_RULES 100 #define YY_END_OF_BUFFER 101 /* This struct is not used in this scanner, @@ -407,7 +611,7 @@ static yyconst flex_int16_t yy_accept[259] = 62, 9, 62, 62, 62, 62, 24, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, @@ -439,7 +643,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[82] = +static yyconst YY_CHAR yy_meta[82] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 4, 4, 1, @@ -452,7 +656,7 @@ static yyconst flex_int32_t yy_meta[82] = 1 } ; -static yyconst flex_int16_t yy_base[282] = +static yyconst flex_uint16_t yy_base[282] = { 0, 0, 0, 79, 80, 81, 84, 85, 86, 87, 88, 417, 416, 93, 94, 83, 105, 415, 565, 412, 565, @@ -522,7 +726,7 @@ static yyconst flex_int16_t yy_def[282] = 258 } ; -static yyconst flex_int16_t yy_nxt[647] = +static yyconst flex_uint16_t yy_nxt[647] = { 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, @@ -672,6 +876,7 @@ static yyconst flex_int16_t yy_chk[647] = 258, 258, 258, 258, 258, 258 } ; + /* Table of booleans, true if rule could match eol. */ static yyconst flex_int32_t yy_rule_can_match_eol[101] = { 0, @@ -690,6 +895,13 @@ static yyconst flex_int32_t yy_rule_can_match_eol[101] = #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET + + + + + + + #include "Basics/Common.h" #include "Basics/conversions.h" #include "Basics/StringUtils.h" @@ -704,6 +916,7 @@ namespace arangodb { } } + #include "Aql/AstNode.h" #include "Aql/grammar.h" #include "Aql/Parser.h" @@ -728,6 +941,8 @@ namespace arangodb { } \ } + + #define INITIAL 0 #define BACKTICK 1 #define FORWARDTICK 2 @@ -737,6 +952,9 @@ namespace arangodb { #define COMMENT_MULTI 6 #define NOT 7 + + + #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. @@ -745,10 +963,16 @@ namespace arangodb { #include #endif + + #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif + + + + /* Holds the entire state of the reentrant scanner. */ struct yyguts_t { @@ -762,7 +986,7 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - yy_size_t yy_n_chars; + int yy_n_chars; yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; @@ -777,65 +1001,132 @@ struct yyguts_t int yylineno_r; int yy_flex_debug_r; + + + char *yytext_r; int yy_more_flag; int yy_more_len; + + YYSTYPE * yylval_r; + + YYLTYPE * yylloc_r; + }; /* end struct yyguts_t */ + + + static int yy_init_globals (yyscan_t yyscanner ); + + + + /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ # define yylval yyg->yylval_r + + # define yylloc yyg->yylloc_r + + int Aqllex_init (yyscan_t* scanner); int Aqllex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); + + /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ + int Aqllex_destroy (yyscan_t yyscanner ); + + int Aqlget_debug (yyscan_t yyscanner ); + + void Aqlset_debug (int debug_flag ,yyscan_t yyscanner ); + + YY_EXTRA_TYPE Aqlget_extra (yyscan_t yyscanner ); + + void Aqlset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); + + FILE *Aqlget_in (yyscan_t yyscanner ); -void Aqlset_in (FILE * in_str ,yyscan_t yyscanner ); + + +void Aqlset_in (FILE * _in_str ,yyscan_t yyscanner ); + + FILE *Aqlget_out (yyscan_t yyscanner ); -void Aqlset_out (FILE * out_str ,yyscan_t yyscanner ); + + +void Aqlset_out (FILE * _out_str ,yyscan_t yyscanner ); + + yy_size_t Aqlget_leng (yyscan_t yyscanner ); + + char *Aqlget_text (yyscan_t yyscanner ); + + int Aqlget_lineno (yyscan_t yyscanner ); -void Aqlset_lineno (int line_number ,yyscan_t yyscanner ); + + +void Aqlset_lineno (int _line_number ,yyscan_t yyscanner ); + + + + +int Aqlget_column (yyscan_t yyscanner ); + + + + + +void Aqlset_column (int _column_no ,yyscan_t yyscanner ); + + + YYSTYPE * Aqlget_lval (yyscan_t yyscanner ); + void Aqlset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); + + YYLTYPE *Aqlget_lloc (yyscan_t yyscanner ); + + void Aqlset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); + + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -848,6 +1139,12 @@ extern int Aqlwrap (yyscan_t yyscanner ); #endif #endif + +#ifndef YY_NO_UNPUT + +#endif + + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif @@ -866,19 +1163,34 @@ static int input (yyscan_t yyscanner ); #endif + + + + + + + /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif + /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif + + /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ @@ -887,7 +1199,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - yy_size_t n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -915,6 +1227,8 @@ static int input (yyscan_t yyscanner ); #endif + + /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. @@ -923,24 +1237,48 @@ static int input (yyscan_t yyscanner ); #define yyterminate() return YY_NULL #endif + /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif + /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) #endif + + + + /* end tables serialization structures and prototypes */ + + /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 + + + + + + + + + + + + + + + + extern int Aqllex \ (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); @@ -948,6 +1286,7 @@ extern int Aqllex \ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) #endif /* !YY_DECL */ + /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ @@ -955,14 +1294,20 @@ extern int Aqllex \ #define YY_USER_ACTION #endif + + /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif + + #define YY_RULE_SETUP \ YY_USER_ACTION + + /** The main scanner function which does all the work. */ YY_DECL @@ -972,14 +1317,16 @@ YY_DECL int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* --------------------------------------------------------------------------- - * language keywords - * --------------------------------------------------------------------------- */ + + yylval = yylval_param; + + yylloc = yylloc_param; + if ( !yyg->yy_init ) { yyg->yy_init = 1; @@ -988,6 +1335,8 @@ YY_DECL YY_USER_INIT; #endif + + if ( ! yyg->yy_start ) yyg->yy_start = 1; /* first start state */ @@ -1006,7 +1355,15 @@ YY_DECL Aql_load_buffer_state(yyscanner ); } - while ( 1 ) /* loops until end-of-file is reached */ + { + + + /* --------------------------------------------------------------------------- + * language keywords + * --------------------------------------------------------------------------- */ + + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; @@ -1022,7 +1379,7 @@ YY_DECL yy_match: do { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1046,6 +1403,7 @@ yy_find_action: YY_DO_BEFORE_ACTION; + if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { yy_size_t yyl; @@ -1058,8 +1416,10 @@ yy_find_action: ; } + do_action: /* This label is used only to access EOF actions. */ + switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ @@ -1932,8 +2292,14 @@ case YY_STATE_EOF(COMMENT_MULTI): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of Aqllex */ + + + + + /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: @@ -1946,7 +2312,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = yyg->yytext_ptr; - int number_to_move, i; + yy_size_t number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) @@ -1975,7 +2341,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; + number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1995,7 +2361,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { /* Not enough room in the buffer - grow it. */ /* 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) (yyg->yy_c_buf_p - b->yy_ch_buf); @@ -2059,7 +2425,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) Aqlrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); @@ -2074,8 +2440,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner) return ret_val; } + /* yy_get_previous_state - get the state just before the EOB char was reached */ + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { yy_state_type yy_current_state; @@ -2104,6 +2472,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) return yy_current_state; } + /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis @@ -2130,9 +2499,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 258); + (void)yyg; return yy_is_jam ? 0 : yy_current_state; } + +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) @@ -2182,7 +2557,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) case EOB_ACT_END_OF_FILE: { if ( Aqlwrap(yyscanner ) ) - return 0; + return EOF; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -2234,6 +2609,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) Aql_load_buffer_state(yyscanner ); } + /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param yyscanner The scanner object. @@ -2270,6 +2646,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yyg->yy_did_buffer_switch_on_eof = 1; } + static void Aql_load_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; @@ -2293,7 +2670,7 @@ static void Aql_load_buffer_state (yyscan_t yyscanner) if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in Aql_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. @@ -2309,6 +2686,7 @@ static void Aql_load_buffer_state (yyscan_t yyscanner) return b; } + /** Destroy the buffer. * @param b a buffer created with Aql_create_buffer() * @param yyscanner The scanner object. @@ -2329,10 +2707,7 @@ static void Aql_load_buffer_state (yyscan_t yyscanner) Aqlfree((void *) b ,yyscanner ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - + /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a Aqlrestart() or at EOF. @@ -2357,8 +2732,11 @@ extern int isatty (int ); b->yy_bs_column = 0; } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + errno = oerrno; } @@ -2423,6 +2801,7 @@ void Aqlpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) yyg->yy_did_buffer_switch_on_eof = 1; } + /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * @param yyscanner The scanner object. @@ -2444,6 +2823,7 @@ void Aqlpop_buffer_state (yyscan_t yyscanner) } } + /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ @@ -2458,13 +2838,14 @@ static void Aqlensure_buffer_stack (yyscan_t yyscanner) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ yyg->yy_buffer_stack = (struct yy_buffer_state**)Aqlalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in Aqlensure_buffer_stack()" ); + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); yyg->yy_buffer_stack_max = num_to_alloc; @@ -2475,7 +2856,7 @@ static void Aqlensure_buffer_stack (yyscan_t yyscanner) if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = yyg->yy_buffer_stack_max + grow_size; yyg->yy_buffer_stack = (struct yy_buffer_state**)Aqlrealloc @@ -2491,6 +2872,10 @@ static void Aqlensure_buffer_stack (yyscan_t yyscanner) } } + + + + /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer @@ -2526,6 +2911,9 @@ YY_BUFFER_STATE Aql_scan_buffer (char * base, yy_size_t size , yyscan_t yyscan return b; } + + + /** Setup the input buffer state to scan a string. The next call to Aqllex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan @@ -2540,10 +2928,13 @@ YY_BUFFER_STATE Aql_scan_string (yyconst char * yystr , yyscan_t yyscanner) return Aql_scan_bytes(yystr,strlen(yystr) ,yyscanner); } + + + /** Setup the input buffer state to scan the given bytes. The next call to Aqllex() will * 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. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ @@ -2551,7 +2942,8 @@ YY_BUFFER_STATE Aql_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len { YY_BUFFER_STATE b; 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. */ n = _yybytes_len + 2; @@ -2576,13 +2968,25 @@ YY_BUFFER_STATE Aql_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len return b; } + + + + + + + + + + #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) { - (void) fprintf( stderr, "%s\n", msg ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2603,8 +3007,11 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) } \ while ( 0 ) + + /* Accessor methods (get/set functions) to struct members. */ + /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ @@ -2614,6 +3021,8 @@ YY_EXTRA_TYPE Aqlget_extra (yyscan_t yyscanner) return yyextra; } + + /** Get the current line number. * @param yyscanner The scanner object. */ @@ -2621,12 +3030,16 @@ int Aqlget_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (! YY_CURRENT_BUFFER) return 0; return yylineno; } + + + /** Get the current column number. * @param yyscanner The scanner object. */ @@ -2634,12 +3047,16 @@ int Aqlget_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (! YY_CURRENT_BUFFER) return 0; return yycolumn; } + + + /** Get the input stream. * @param yyscanner The scanner object. */ @@ -2649,6 +3066,8 @@ FILE *Aqlget_in (yyscan_t yyscanner) return yyin; } + + /** Get the output stream. * @param yyscanner The scanner object. */ @@ -2658,6 +3077,8 @@ FILE *Aqlget_out (yyscan_t yyscanner) return yyout; } + + /** Get the length of the current token. * @param yyscanner The scanner object. */ @@ -2667,6 +3088,7 @@ yy_size_t Aqlget_leng (yyscan_t yyscanner) return yyleng; } + /** Get the current token. * @param yyscanner The scanner object. */ @@ -2677,6 +3099,8 @@ char *Aqlget_text (yyscan_t yyscanner) return yytext; } + + /** Set the user-defined data. This data is never touched by the scanner. * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. @@ -2687,92 +3111,123 @@ void Aqlset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) yyextra = user_defined ; } + + /** Set the current line number. - * @param line_number + * @param _line_number line number * @param yyscanner The scanner object. */ -void Aqlset_lineno (int line_number , yyscan_t yyscanner) +void Aqlset_lineno (int _line_number , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "Aqlset_lineno called with no buffer" , yyscanner); + YY_FATAL_ERROR( "Aqlset_lineno called with no buffer" ); - yylineno = line_number; + yylineno = _line_number; } + + + /** Set the current column. - * @param line_number + * @param _column_no column number * @param yyscanner The scanner object. */ -void Aqlset_column (int column_no , yyscan_t yyscanner) +void Aqlset_column (int _column_no , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "Aqlset_column called with no buffer" , yyscanner); + YY_FATAL_ERROR( "Aqlset_column called with no buffer" ); - yycolumn = column_no; + yycolumn = _column_no; } + + + + /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * @param yyscanner The scanner object. * @see Aql_switch_to_buffer */ -void Aqlset_in (FILE * in_str , yyscan_t yyscanner) +void Aqlset_in (FILE * _in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; + yyin = _in_str ; } -void Aqlset_out (FILE * out_str , yyscan_t yyscanner) + + +void Aqlset_out (FILE * _out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; + yyout = _out_str ; } + + + int Aqlget_debug (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yy_flex_debug; } -void Aqlset_debug (int bdebug , yyscan_t yyscanner) + + +void Aqlset_debug (int _bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } + /* Accessor methods for yylval and yylloc */ + YYSTYPE * Aqlget_lval (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylval; } + + void Aqlset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylval = yylval_param; } + + + YYLTYPE *Aqlget_lloc (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylloc; } + + void Aqlset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylloc = yylloc_param; } + + + + /* User-visible API */ /* Aqllex_init is special because it creates the scanner itself, so it is @@ -2801,6 +3256,7 @@ int Aqllex_init(yyscan_t* ptr_yy_globals) return yy_init_globals ( *ptr_yy_globals ); } + /* Aqllex_init_extra has the same functionality as Aqllex_init, but follows the * convention of taking the scanner as the last argument. Note however, that * this is a *pointer* to a scanner, as it will be allocated by this call (and @@ -2837,6 +3293,7 @@ int Aqllex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) return yy_init_globals ( *ptr_yy_globals ); } + static int yy_init_globals (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; @@ -2844,6 +3301,9 @@ static int yy_init_globals (yyscan_t yyscanner) * This function is called from Aqllex_destroy(), so don't allocate here. */ + + + yyg->yy_buffer_stack = 0; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; @@ -2851,10 +3311,16 @@ static int yy_init_globals (yyscan_t yyscanner) yyg->yy_init = 0; yyg->yy_start = 0; + yyg->yy_start_stack_ptr = 0; yyg->yy_start_stack_depth = 0; yyg->yy_start_stack = NULL; + + + + + /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; @@ -2870,6 +3336,7 @@ static int yy_init_globals (yyscan_t yyscanner) return 0; } + /* Aqllex_destroy is for both reentrant and non-reentrant scanners. */ int Aqllex_destroy (yyscan_t yyscanner) { @@ -2886,10 +3353,14 @@ int Aqllex_destroy (yyscan_t yyscanner) Aqlfree(yyg->yy_buffer_stack ,yyscanner); yyg->yy_buffer_stack = NULL; + /* Destroy the start condition stack. */ Aqlfree(yyg->yy_start_stack ,yyscanner ); yyg->yy_start_stack = NULL; + + + /* Reset the globals. This is important in a non-reentrant scanner so the next time * Aqllex() is called, initialization will occur. */ yy_init_globals( yyscanner); @@ -2900,19 +3371,28 @@ int Aqllex_destroy (yyscan_t yyscanner) return 0; } + + /* * Internal utility routines. */ + + #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif + + #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) { @@ -2924,13 +3404,22 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) } #endif + + void *Aqlalloc (yy_size_t size , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; return (void *) malloc( size ); } + + void *Aqlrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2941,10 +3430,24 @@ void *Aqlrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) return (void *) realloc( (char *) ptr, size ); } + + void Aqlfree (void * ptr , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; free( (char *) ptr ); /* see Aqlrealloc() for (char *) cast */ } + #define YYTABLES_NAME "yytables" + + + + + + + + + diff --git a/js/client/tests/agency/agency-test.js b/js/client/tests/agency/agency-test.js index f63e8b212a..18c95910c2 100644 --- a/js/client/tests/agency/agency-test.js +++ b/js/client/tests/agency/agency-test.js @@ -30,7 +30,6 @@ var jsunity = require("jsunity"); var wait = require("internal").wait; -const instanceInfo = JSON.parse(require('fs').read('instanceinfo.json')); //////////////////////////////////////////////////////////////////////////////// /// @brief test suite @@ -39,9 +38,28 @@ const instanceInfo = JSON.parse(require('fs').read('instanceinfo.json')); function agencyTestSuite () { 'use strict'; -//////////////////////////////////////////////////////////////////////////////// -/// @brief the agency servers -//////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /// @brief the agency servers + //////////////////////////////////////////////////////////////////////////////// + + var count = 20; + while (true) { + if (require('fs').exists('instanceinfo.json')) { + var instanceInfoData = require('fs').read('instanceinfo.json'); + var instanceInfo; + try { + instanceInfo = JSON.parse(instanceInfoData); + break; + } catch (err) { + console.error('Failed to parse JSON: instanceinfo.json') + console.error(data); + } + } + wait(1.0); + if (--count <= 0) { + throw 'peng'; + } + } var agencyServers = instanceInfo.arangods.map(arangod => { return arangod.url; diff --git a/lib/V8/v8-json.cpp b/lib/V8/v8-json.cpp index 21e9259d76..226a4f04ff 100644 --- a/lib/V8/v8-json.cpp +++ b/lib/V8/v8-json.cpp @@ -35,20 +35,90 @@ -#line 39 "lib/V8/v8-json.cpp" - #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ + + + + + + + + + + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -82,7 +152,6 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -90,7 +159,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -121,8 +189,12 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ + + #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ @@ -144,9 +216,16 @@ typedef unsigned int flex_uint32_t; #define yyconst #endif + + + + + /* Returned upon end-of-file. */ #define YY_NULL 0 + + /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the @@ -154,12 +233,34 @@ typedef unsigned int flex_uint32_t; */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + + + + /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T #define YY_TYPEDEF_YY_SCANNER_T typedef void* yyscan_t; #endif + + + + + + + + + + + + + + + + + + /* For convenience, these vars (plus the bison vars far below) are macros in the reentrant scanner. */ #define yyin yyg->yyin_r @@ -171,12 +272,29 @@ typedef void* yyscan_t; #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) #define yy_flex_debug yyg->yy_flex_debug_r + + + + + + + + + + + + + + + /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * + + /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. @@ -184,23 +302,41 @@ typedef void* yyscan_t; #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START + + /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + + /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE tri_v8_restart(yyin ,yyscanner ) + + #define YY_END_OF_BUFFER_CHAR 0 + /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif + /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + + #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; @@ -211,12 +347,22 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif + + + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - #define YY_LESS_LINENO(n) + + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + + + + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -231,14 +377,19 @@ typedef size_t yy_size_t; } \ while ( 0 ) + + #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ @@ -250,7 +401,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -274,6 +425,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -298,6 +450,10 @@ struct yy_buffer_state }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ + + + + /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". @@ -308,11 +464,18 @@ struct yy_buffer_state ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) + + /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + + + + + void tri_v8_restart (FILE *input_file ,yyscan_t yyscanner ); void tri_v8__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); YY_BUFFER_STATE tri_v8__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); @@ -321,22 +484,30 @@ void tri_v8__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void tri_v8_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); void tri_v8_pop_buffer_state (yyscan_t yyscanner ); + static void tri_v8_ensure_buffer_stack (yyscan_t yyscanner ); static void tri_v8__load_buffer_state (yyscan_t yyscanner ); static void tri_v8__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); + + #define YY_FLUSH_BUFFER tri_v8__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) + YY_BUFFER_STATE tri_v8__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE tri_v8__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); YY_BUFFER_STATE tri_v8__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); + void *tri_v8_alloc (yy_size_t ,yyscan_t yyscanner ); void *tri_v8_realloc (void *,yy_size_t ,yyscan_t yyscanner ); void tri_v8_free (void * ,yyscan_t yyscanner ); + #define yy_new_buffer tri_v8__create_buffer + + #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ @@ -347,6 +518,8 @@ void tri_v8_free (void * ,yyscan_t yyscanner ); YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } + + #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ @@ -357,34 +530,53 @@ void tri_v8_free (void * ,yyscan_t yyscanner ); YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } + + #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + /* Begin user sect3 */ -#define tri_v8_wrap(n) 1 +#define tri_v8_wrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; + + + typedef int yy_state_type; #define yytext_ptr yytext_r + + + + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); static int yy_get_next_buffer (yyscan_t yyscanner ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); + + + /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = (yy_size_t) (yy_cp - yy_bp); \ + yyleng = (size_t) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; + + #define YY_NUM_RULES 15 #define YY_END_OF_BUFFER 16 /* This struct is not used in this scanner, @@ -403,7 +595,7 @@ static yyconst flex_int16_t yy_accept[45] = 2, 3, 1, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, @@ -435,7 +627,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[37] = +static yyconst YY_CHAR yy_meta[37] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -443,7 +635,7 @@ static yyconst flex_int32_t yy_meta[37] = 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[47] = +static yyconst flex_uint16_t yy_base[47] = { 0, 0, 0, 114, 126, 35, 38, 42, 35, 126, 40, 41, 126, 35, 35, 39, 126, 126, 126, 126, 60, @@ -461,7 +653,7 @@ static yyconst flex_int16_t yy_def[47] = 44, 44, 44, 0, 44, 44 } ; -static yyconst flex_int16_t yy_nxt[163] = +static yyconst flex_uint16_t yy_nxt[163] = { 0, 4, 5, 6, 5, 4, 7, 8, 9, 8, 4, 10, 11, 12, 4, 4, 13, 4, 14, 4, 4, @@ -541,8 +733,13 @@ struct jsonData { } \ while (0) + + #define INITIAL 0 + + + #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. @@ -551,8 +748,13 @@ struct jsonData { #include #endif + + #define YY_EXTRA_TYPE struct jsonData + + + /* Holds the entire state of the reentrant scanner. */ struct yyguts_t { @@ -566,7 +768,7 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - yy_size_t yy_n_chars; + int yy_n_chars; yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; @@ -581,46 +783,106 @@ struct yyguts_t int yylineno_r; int yy_flex_debug_r; + + + char *yytext_r; int yy_more_flag; int yy_more_len; + + + + + }; /* end struct yyguts_t */ + + + static int yy_init_globals (yyscan_t yyscanner ); + + + + + + + + int tri_v8_lex_init (yyscan_t* scanner); int tri_v8_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); + + /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ + int tri_v8_lex_destroy (yyscan_t yyscanner ); + + int tri_v8_get_debug (yyscan_t yyscanner ); + + void tri_v8_set_debug (int debug_flag ,yyscan_t yyscanner ); + + YY_EXTRA_TYPE tri_v8_get_extra (yyscan_t yyscanner ); + + void tri_v8_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); + + FILE *tri_v8_get_in (yyscan_t yyscanner ); -void tri_v8_set_in (FILE * in_str ,yyscan_t yyscanner ); + + +void tri_v8_set_in (FILE * _in_str ,yyscan_t yyscanner ); + + FILE *tri_v8_get_out (yyscan_t yyscanner ); -void tri_v8_set_out (FILE * out_str ,yyscan_t yyscanner ); + + +void tri_v8_set_out (FILE * _out_str ,yyscan_t yyscanner ); + + yy_size_t tri_v8_get_leng (yyscan_t yyscanner ); + + char *tri_v8_get_text (yyscan_t yyscanner ); + + int tri_v8_get_lineno (yyscan_t yyscanner ); -void tri_v8_set_lineno (int line_number ,yyscan_t yyscanner ); + + +void tri_v8_set_lineno (int _line_number ,yyscan_t yyscanner ); + + + + +int tri_v8_get_column (yyscan_t yyscanner ); + + + + + +void tri_v8_set_column (int _column_no ,yyscan_t yyscanner ); + + + /* Macros after this point can all be overridden by user definitions in * section 1. @@ -634,6 +896,12 @@ extern int tri_v8_wrap (yyscan_t yyscanner ); #endif #endif + +#ifndef YY_NO_UNPUT + +#endif + + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif @@ -652,19 +920,34 @@ static int input (yyscan_t yyscanner ); #endif + + + + + + + /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif + /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif + + /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ @@ -673,7 +956,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - yy_size_t n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -701,6 +984,8 @@ static int input (yyscan_t yyscanner ); #endif + + /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. @@ -709,29 +994,46 @@ static int input (yyscan_t yyscanner ); #define yyterminate() return YY_NULL #endif + /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif + /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) #endif + + + + /* end tables serialization structures and prototypes */ + + /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 + + + + + + + + extern int tri_v8_lex (yyscan_t yyscanner); #define YY_DECL int tri_v8_lex (yyscan_t yyscanner) #endif /* !YY_DECL */ + /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ @@ -739,14 +1041,20 @@ extern int tri_v8_lex (yyscan_t yyscanner); #define YY_USER_ACTION #endif + + /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif + + #define YY_RULE_SETUP \ YY_USER_ACTION + + /** The main scanner function which does all the work. */ YY_DECL @@ -756,9 +1064,11 @@ YY_DECL int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* ----------------------------------------------------------------------------- - * keywords - * ----------------------------------------------------------------------------- */ + + + + + if ( !yyg->yy_init ) { @@ -768,6 +1078,8 @@ YY_DECL YY_USER_INIT; #endif + + if ( ! yyg->yy_start ) yyg->yy_start = 1; /* first start state */ @@ -786,7 +1098,15 @@ YY_DECL tri_v8__load_buffer_state(yyscanner ); } - while ( 1 ) /* loops until end-of-file is reached */ + { + + + /* ----------------------------------------------------------------------------- + * keywords + * ----------------------------------------------------------------------------- */ + + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; @@ -802,7 +1122,7 @@ YY_DECL yy_match: do { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -826,8 +1146,11 @@ yy_find_action: YY_DO_BEFORE_ACTION; + + do_action: /* This label is used only to access EOF actions. */ + switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ @@ -1073,8 +1396,14 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of tri_v8_lex */ + + + + + /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: @@ -1087,7 +1416,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = yyg->yytext_ptr; - int number_to_move, i; + yy_size_t number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) @@ -1116,7 +1445,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; + number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1136,7 +1465,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { /* Not enough room in the buffer - grow it. */ /* 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) (yyg->yy_c_buf_p - b->yy_ch_buf); @@ -1200,7 +1529,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) tri_v8_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); @@ -1215,8 +1544,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner) return ret_val; } + /* yy_get_previous_state - get the state just before the EOB char was reached */ + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { yy_state_type yy_current_state; @@ -1245,6 +1576,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) return yy_current_state; } + /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis @@ -1271,9 +1603,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 44); + (void)yyg; return yy_is_jam ? 0 : yy_current_state; } + +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) @@ -1323,7 +1661,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) case EOB_ACT_END_OF_FILE: { if ( tri_v8_wrap(yyscanner ) ) - return 0; + return EOF; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -1345,6 +1683,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ yyg->yy_hold_char = *++yyg->yy_c_buf_p; + return c; } #endif /* ifndef YY_NO_INPUT */ @@ -1368,6 +1707,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) tri_v8__load_buffer_state(yyscanner ); } + /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param yyscanner The scanner object. @@ -1404,6 +1744,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yyg->yy_did_buffer_switch_on_eof = 1; } + static void tri_v8__load_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; @@ -1427,7 +1768,7 @@ static void tri_v8__load_buffer_state (yyscan_t yyscanner) if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in tri_v8__create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. @@ -1443,6 +1784,7 @@ static void tri_v8__load_buffer_state (yyscan_t yyscanner) return b; } + /** Destroy the buffer. * @param b a buffer created with tri_v8__create_buffer() * @param yyscanner The scanner object. @@ -1463,10 +1805,7 @@ static void tri_v8__load_buffer_state (yyscan_t yyscanner) tri_v8_free((void *) b ,yyscanner ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - + /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a tri_v8_restart() or at EOF. @@ -1491,8 +1830,11 @@ extern int isatty (int ); b->yy_bs_column = 0; } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + errno = oerrno; } @@ -1557,6 +1899,7 @@ void tri_v8_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) yyg->yy_did_buffer_switch_on_eof = 1; } + /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * @param yyscanner The scanner object. @@ -1578,6 +1921,7 @@ void tri_v8_pop_buffer_state (yyscan_t yyscanner) } } + /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ @@ -1592,13 +1936,14 @@ static void tri_v8_ensure_buffer_stack (yyscan_t yyscanner) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ yyg->yy_buffer_stack = (struct yy_buffer_state**)tri_v8_alloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in tri_v8_ensure_buffer_stack()" ); + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); yyg->yy_buffer_stack_max = num_to_alloc; @@ -1609,7 +1954,7 @@ static void tri_v8_ensure_buffer_stack (yyscan_t yyscanner) if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = yyg->yy_buffer_stack_max + grow_size; yyg->yy_buffer_stack = (struct yy_buffer_state**)tri_v8_realloc @@ -1625,6 +1970,10 @@ static void tri_v8_ensure_buffer_stack (yyscan_t yyscanner) } } + + + + /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer @@ -1660,6 +2009,9 @@ YY_BUFFER_STATE tri_v8__scan_buffer (char * base, yy_size_t size , yyscan_t yy return b; } + + + /** Setup the input buffer state to scan a string. The next call to tri_v8_lex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan @@ -1674,10 +2026,13 @@ YY_BUFFER_STATE tri_v8__scan_string (yyconst char * yystr , yyscan_t yyscanner) return tri_v8__scan_bytes(yystr,strlen(yystr) ,yyscanner); } + + + /** Setup the input buffer state to scan the given bytes. The next call to tri_v8_lex() will * 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. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ @@ -1685,7 +2040,8 @@ YY_BUFFER_STATE tri_v8__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes { YY_BUFFER_STATE b; 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. */ n = _yybytes_len + 2; @@ -1710,13 +2066,25 @@ YY_BUFFER_STATE tri_v8__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes return b; } + + + + + + + + + + #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) { - (void) fprintf( stderr, "%s\n", msg ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -1737,8 +2105,11 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) } \ while ( 0 ) + + /* Accessor methods (get/set functions) to struct members. */ + /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ @@ -1748,6 +2119,8 @@ YY_EXTRA_TYPE tri_v8_get_extra (yyscan_t yyscanner) return yyextra; } + + /** Get the current line number. * @param yyscanner The scanner object. */ @@ -1755,12 +2128,16 @@ int tri_v8_get_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (! YY_CURRENT_BUFFER) return 0; return yylineno; } + + + /** Get the current column number. * @param yyscanner The scanner object. */ @@ -1768,12 +2145,16 @@ int tri_v8_get_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (! YY_CURRENT_BUFFER) return 0; return yycolumn; } + + + /** Get the input stream. * @param yyscanner The scanner object. */ @@ -1783,6 +2164,8 @@ FILE *tri_v8_get_in (yyscan_t yyscanner) return yyin; } + + /** Get the output stream. * @param yyscanner The scanner object. */ @@ -1792,6 +2175,8 @@ FILE *tri_v8_get_out (yyscan_t yyscanner) return yyout; } + + /** Get the length of the current token. * @param yyscanner The scanner object. */ @@ -1801,6 +2186,7 @@ yy_size_t tri_v8_get_leng (yyscan_t yyscanner) return yyleng; } + /** Get the current token. * @param yyscanner The scanner object. */ @@ -1811,6 +2197,8 @@ char *tri_v8_get_text (yyscan_t yyscanner) return yytext; } + + /** Set the user-defined data. This data is never touched by the scanner. * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. @@ -1821,68 +2209,89 @@ void tri_v8_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) yyextra = user_defined ; } + + /** Set the current line number. - * @param line_number + * @param _line_number line number * @param yyscanner The scanner object. */ -void tri_v8_set_lineno (int line_number , yyscan_t yyscanner) +void tri_v8_set_lineno (int _line_number , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "tri_v8_set_lineno called with no buffer" , yyscanner); + YY_FATAL_ERROR( "tri_v8_set_lineno called with no buffer" ); - yylineno = line_number; + yylineno = _line_number; } + + + /** Set the current column. - * @param line_number + * @param _column_no column number * @param yyscanner The scanner object. */ -void tri_v8_set_column (int column_no , yyscan_t yyscanner) +void tri_v8_set_column (int _column_no , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "tri_v8_set_column called with no buffer" , yyscanner); + YY_FATAL_ERROR( "tri_v8_set_column called with no buffer" ); - yycolumn = column_no; + yycolumn = _column_no; } + + + + /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * @param yyscanner The scanner object. * @see tri_v8__switch_to_buffer */ -void tri_v8_set_in (FILE * in_str , yyscan_t yyscanner) +void tri_v8_set_in (FILE * _in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; + yyin = _in_str ; } -void tri_v8_set_out (FILE * out_str , yyscan_t yyscanner) + + +void tri_v8_set_out (FILE * _out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; + yyout = _out_str ; } + + + int tri_v8_get_debug (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yy_flex_debug; } -void tri_v8_set_debug (int bdebug , yyscan_t yyscanner) + + +void tri_v8_set_debug (int _bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } + /* Accessor methods for yylval and yylloc */ + + /* User-visible API */ /* tri_v8_lex_init is special because it creates the scanner itself, so it is @@ -1911,6 +2320,7 @@ int tri_v8_lex_init(yyscan_t* ptr_yy_globals) return yy_init_globals ( *ptr_yy_globals ); } + /* tri_v8_lex_init_extra has the same functionality as tri_v8_lex_init, but follows the * convention of taking the scanner as the last argument. Note however, that * this is a *pointer* to a scanner, as it will be allocated by this call (and @@ -1947,6 +2357,7 @@ int tri_v8_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals return yy_init_globals ( *ptr_yy_globals ); } + static int yy_init_globals (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; @@ -1954,6 +2365,7 @@ static int yy_init_globals (yyscan_t yyscanner) * This function is called from tri_v8_lex_destroy(), so don't allocate here. */ + yyg->yy_buffer_stack = 0; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; @@ -1961,10 +2373,16 @@ static int yy_init_globals (yyscan_t yyscanner) yyg->yy_init = 0; yyg->yy_start = 0; + yyg->yy_start_stack_ptr = 0; yyg->yy_start_stack_depth = 0; yyg->yy_start_stack = NULL; + + + + + /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; @@ -1980,6 +2398,7 @@ static int yy_init_globals (yyscan_t yyscanner) return 0; } + /* tri_v8_lex_destroy is for both reentrant and non-reentrant scanners. */ int tri_v8_lex_destroy (yyscan_t yyscanner) { @@ -1996,10 +2415,14 @@ int tri_v8_lex_destroy (yyscan_t yyscanner) tri_v8_free(yyg->yy_buffer_stack ,yyscanner); yyg->yy_buffer_stack = NULL; + /* Destroy the start condition stack. */ tri_v8_free(yyg->yy_start_stack ,yyscanner ); yyg->yy_start_stack = NULL; + + + /* Reset the globals. This is important in a non-reentrant scanner so the next time * tri_v8_lex() is called, initialization will occur. */ yy_init_globals( yyscanner); @@ -2010,19 +2433,28 @@ int tri_v8_lex_destroy (yyscan_t yyscanner) return 0; } + + /* * Internal utility routines. */ + + #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif + + #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) { @@ -2034,13 +2466,22 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) } #endif + + void *tri_v8_alloc (yy_size_t size , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; return (void *) malloc( size ); } + + void *tri_v8_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2051,13 +2492,26 @@ void *tri_v8_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) return (void *) realloc( (char *) ptr, size ); } + + void tri_v8_free (void * ptr , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; free( (char *) ptr ); /* see tri_v8_realloc() for (char *) cast */ } + #define YYTABLES_NAME "yytables" + + + + + + + + // ----------------------------------------------------------------------------- // --SECTION-- forward declarations // ----------------------------------------------------------------------------- diff --git a/scripts/startLocalCluster.sh b/scripts/startLocalCluster.sh index 546def3b06..a3558e2cee 100755 --- a/scripts/startLocalCluster.sh +++ b/scripts/startLocalCluster.sh @@ -146,7 +146,8 @@ if [ ! -z "$INTERACTIVE_MODE" ] ; then fi SFRE=5.0 -COMP=1000 +COMP=2000 +KEEP=0 BASE=4001 NATH=$(( $NRDBSERVERS + $NRCOORDINATORS + $NRAGENTS )) @@ -180,6 +181,7 @@ for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do -c none \ --agency.activate true \ --agency.compaction-step-size $COMP \ + --agency.compaction-keep-size $KEEP \ --agency.endpoint $TRANSPORT://localhost:$BASE \ --agency.my-address $TRANSPORT://localhost:$port \ --agency.pool-size $NRAGENTS \