コード例 #1
0
ファイル: RefParseContext.cpp プロジェクト: lonnell/trick
/**
 Destructor
 */
RefParseContext::~RefParseContext() {
    destroy_scanner();
}
コード例 #2
0
ファイル: PHP_context.cpp プロジェクト: TheCypher/phc
PHP_context::~PHP_context()
{
	destroy_scanner();
}
コード例 #3
0
// -----------------------------------------------------------------------
// Invoke yyparse, set hsGlobal structure for each column group.
// -----------------------------------------------------------------------
Lng32 HSFuncParseStmt()
  {
    HSGlobalsClass *hs_globals = GetHSContext();
    Lng32 retcode;
    HSColGroupStruct *mgroup = NULL;

    void* scanner;
    init_scanner (scanner);
    HSFuncResetLexer(scanner);
    retcode = yyparse(scanner);
    HSHandleError(retcode);
    destroy_scanner (scanner);
    
    // The parser does not always return immediately following an error, so that
    // it can report as many errors as possible. This can result in a nonzero
    // return code being overwritten. To detect this case, we check the diagnostics
    // area and return with the appropriate sqlcode if necessary.
    retcode = hs_globals->getRetcodeFromDiags();
    HSHandleError(retcode);
    
    hs_globals->parserError = HSGlobalsClass::ERROR_SEMANTICS;

    //  We are done here if it is the showstats command
    if (hs_globals->optFlags & SHOWSTATS_OPT) 
        return 0;

    // Automatically generate single-column histograms for all multi-column
    // histograms requested. This is required to calculate UEC counts for
    // multi-column histograms.
    // However, do not generate them when the CLEAR option is requested, unless
    // ON EVERY COLUMN or ON EVERY KEY is also specified.
    if (NOT (hs_globals->optFlags & CLEAR_OPT) ||
        hs_globals->optFlags & EVERYCOL_OPT    ||
        hs_globals->optFlags & EVERYKEY_OPT)
      {
        mgroup = hs_globals->multiGroup;
        while (mgroup != NULL)
          {
            for (Int32 i=0; i<mgroup->colCount; i++)
              {
                HSColumnStruct &col = mgroup->colSet[i];
                if (NOT ColumnExists(col.colnum))
                  {
                    retcode = AddSingleColumn(col.colnum);
                    HSHandleError(retcode);
                  }
              }
            mgroup = mgroup->next;
          }
      }

    // ----------------------------------------------------------------------
    // Construct statistics time in the format: YYYY-MM-DD:HH:MM:SS.
    // We use GMT time.
    // ----------------------------------------------------------------------
    time_t t;
    time(&t);
    char pt[30];

    strftime(pt, 30, "%Y-%m-%d:%H:%M:%S", gmtime(&t));
    *hs_globals->statstime = pt;

    // Also store a numerical timestamp with 10 digits MMDDHHMMSS.
    hs_globals->statsTimeInt = (pt[5] - '0')  * 1000000000 +
                            (pt[6] - '0')  * 100000000 +
                            (pt[8] - '0')  * 10000000 +
                            (pt[9] - '0')  * 1000000 +
                            (pt[11] - '0') * 100000 +
                            (pt[12] - '0') * 10000 +
                            (pt[14] - '0') * 1000 +
                            (pt[15] - '0') * 100 +
                            (pt[17] - '0') * 10 +
                            (pt[18] - '0');
    return 0;
  }
コード例 #4
0
ファイル: ChkPtParseContext.cpp プロジェクト: carylogan/Trick
/**
 Destructor
 */
ChkPtParseContext::~ChkPtParseContext() {
    destroy_scanner();
    free( this->buf );
}