00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00035 #include "OW_config.h"
00036 #include "OW_WQLProcessor.hpp"
00037 #include "OW_WQLAst.hpp"
00038 #include "OW_Format.hpp"
00039 #include "OW_Assertion.hpp"
00040 #include "OW_CIMValueCast.hpp"
00041 #include "OW_CIMException.hpp"
00042 #include "OW_CIMValue.hpp"
00043 #include "OW_CIMProperty.hpp"
00044 #include "OW_CIMClass.hpp"
00045 #include "OW_CIMUrl.hpp"
00046 #include "OW_Logger.hpp"
00047 #include "OW_WQLScanUtils.hpp"
00048 #include "OW_StringStream.hpp"
00049 #include "OW_ResultHandlerIFC.hpp"
00050
00051 #include <errno.h>
00052 #include <iterator>
00053 #include <algorithm>
00054
00055 #define OW_WQL_THROWCIMMSG(type, message) \
00056 do \
00057 { \
00058 OW_WQL_LOG_DEBUG(Format("Throwing %1 %2",(type), (message))); \
00059 OW_THROWCIMMSG((type),(message)); \
00060 }while(0)
00061
00062
00063 namespace OW_NAMESPACE
00064 {
00065
00066 using namespace WBEMFlags;
00067
00068 namespace
00069 {
00070 CIMInstance embedClassInInstance(CIMClass const& x)
00071 {
00072 OW_WQL_LOG_DEBUG(Format("Embedding %1 .", x.getName()));
00073 CIMInstance ret("__SchemaQueryResult");
00074 ret.setProperty(CIMName("CimClass"),CIMValue(x.getName()));
00075 return ret;
00076 }
00077 class ClassesEmbeddedInInstancesResultHandler
00078 : public CIMClassResultHandlerIFC
00079 {
00080 public:
00081 ClassesEmbeddedInInstancesResultHandler(CIMInstanceArray& instances)
00082 :m_instances(instances)
00083 {}
00084
00085 protected:
00086 virtual void doHandle(CIMClass const& x);
00087
00088 private:
00089
00090 ClassesEmbeddedInInstancesResultHandler
00091 (ClassesEmbeddedInInstancesResultHandler const&);
00092 ClassesEmbeddedInInstancesResultHandler& operator=
00093 (ClassesEmbeddedInInstancesResultHandler const&);
00094 CIMInstanceArray& m_instances;
00095 };
00096
00097
00098 void ClassesEmbeddedInInstancesResultHandler::doHandle(CIMClass const& x)
00099 {
00100 OW_WQL_LOG_DEBUG(Format("About to add %1 to results.", x.getName()));
00101
00102
00103 m_instances.push_back(embedClassInInstance(x));
00104 }
00105
00106 bool isTableRefMetaClass(tableRef* table_ref)
00107 {
00108
00109 if (tableRef_relationExpr* trre
00110 = dynamic_cast<tableRef_relationExpr*>(table_ref))
00111 {
00112 if (relationExpr_strRelationName* resr
00113 = dynamic_cast<relationExpr_strRelationName*>(trre->m_prelationExpr1))
00114 {
00115 return resr->m_pstrRelationName1->equalsIgnoreCase("meta_class");
00116 }
00117 }
00118 return false;
00119 }
00120
00121 String debugDump(CIMInstanceArray const& array)
00122 {
00123 OStringStream arrayString;
00124 arrayString << "{{";
00125 for (CIMInstanceArray::const_iterator current= array.begin(); current != array.end() ; ++current)
00126 {
00127 arrayString << " { " << current->toString() << " }\n";
00128 }
00129 arrayString << "}}\n";
00130 return String(arrayString.toString());
00131 }
00132
00133 const char * typeStrings[] =
00134 {
00135 "CIMInstanceArray",
00136 "String",
00137 "IntType",
00138 "Real",
00139 "Bool",
00140 "ColumnName",
00141 "Null",
00142 "Invalid"
00143 };
00144
00145 char const* typeName(WQLProcessor::DataType::Type type)
00146 {
00147 size_t index(type);
00148 if(index >= sizeof(typeStrings)/sizeof(typeStrings[0]))
00149 {
00150 return "Unknown";
00151 }
00152 else
00153 {
00154 return typeStrings[index];
00155 }
00156 }
00157
00158 }
00159
00160 WQLProcessor::WQLProcessor(
00161 const CIMOMHandleIFCRef& hdl,
00162 const String& ns)
00163 : m_hdl(hdl)
00164 , m_ns(ns)
00165 , m_doingSelect(false)
00166 , m_isSchemaQuery(false)
00167 {
00168 }
00169 void WQLProcessor::visit_stmt_selectStmt_optSemicolon(
00170 const stmt_selectStmt_optSemicolon* pstmt_selectStmt_optSemicolon
00171 )
00172 {
00173 pstmt_selectStmt_optSemicolon->m_pselectStmt1->acceptInterface(this);
00174 if (pstmt_selectStmt_optSemicolon->m_poptSemicolon2)
00175 {
00176 pstmt_selectStmt_optSemicolon->m_poptSemicolon2->acceptInterface(this);
00177 }
00178 }
00179 void WQLProcessor::visit_stmt_updateStmt_optSemicolon(
00180 const stmt_updateStmt_optSemicolon* pstmt_updateStmt_optSemicolon
00181 )
00182 {
00183 pstmt_updateStmt_optSemicolon->m_pupdateStmt1->acceptInterface(this);
00184 if (pstmt_updateStmt_optSemicolon->m_poptSemicolon2)
00185 {
00186 pstmt_updateStmt_optSemicolon->m_poptSemicolon2->acceptInterface(this);
00187 }
00188 }
00189 void WQLProcessor::visit_stmt_insertStmt_optSemicolon(
00190 const stmt_insertStmt_optSemicolon* pstmt_insertStmt_optSemicolon
00191 )
00192 {
00193 pstmt_insertStmt_optSemicolon->m_pinsertStmt1->acceptInterface(this);
00194 if (pstmt_insertStmt_optSemicolon->m_poptSemicolon2)
00195 {
00196 pstmt_insertStmt_optSemicolon->m_poptSemicolon2->acceptInterface(this);
00197 }
00198 }
00199 void WQLProcessor::visit_stmt_deleteStmt_optSemicolon(
00200 const stmt_deleteStmt_optSemicolon* pstmt_deleteStmt_optSemicolon
00201 )
00202 {
00203 pstmt_deleteStmt_optSemicolon->m_pdeleteStmt1->acceptInterface(this);
00204 if (pstmt_deleteStmt_optSemicolon->m_poptSemicolon2)
00205 {
00206 pstmt_deleteStmt_optSemicolon->m_poptSemicolon2->acceptInterface(this);
00207 }
00208 }
00209 void WQLProcessor::visit_optSemicolon_empty(
00210 const optSemicolon_empty* poptSemicolon_empty
00211 )
00212 {
00213 }
00214 void WQLProcessor::visit_optSemicolon_SEMICOLON(
00215 const optSemicolon_SEMICOLON* poptSemicolon_SEMICOLON
00216 )
00217 {
00218 }
00219 void WQLProcessor::visit_insertStmt(
00220 const insertStmt* pinsertStmt
00221 )
00222 {
00223 m_tableRef = *pinsertStmt->m_pstrRelationName3;
00224 pinsertStmt->m_pinsertRest4->acceptInterface(this);
00225 }
00226 void WQLProcessor::visit_insertRest_VALUES_LEFTPAREN_targetList_RIGHTPAREN(
00227 const insertRest_VALUES_LEFTPAREN_targetList_RIGHTPAREN* pinsertRest_VALUES_LEFTPAREN_targetList_RIGHTPAREN
00228 )
00229 {
00230 #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00231 CIMClass cc = m_hdl->getClass(m_ns, m_tableRef, E_NOT_LOCAL_ONLY,
00232 E_INCLUDE_QUALIFIERS, E_INCLUDE_CLASS_ORIGIN, 0);
00233 CIMInstance ci = cc.newInstance();
00234 CIMPropertyArray cpa = ci.getProperties();
00235 if (pinsertRest_VALUES_LEFTPAREN_targetList_RIGHTPAREN->m_ptargetList3->size() !=
00236 cpa.size())
00237 {
00238 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Number of values must be the same as the number of properties in the class");
00239 }
00240 CIMPropertyArray::const_iterator curProperty = cpa.begin();
00241 for (List<targetEl*>::const_iterator i = pinsertRest_VALUES_LEFTPAREN_targetList_RIGHTPAREN->m_ptargetList3->begin();
00242 i != pinsertRest_VALUES_LEFTPAREN_targetList_RIGHTPAREN->m_ptargetList3->end();
00243 ++i, ++curProperty )
00244 {
00245 (*i)->acceptInterface(this);
00246
00247 CIMProperty cp = *curProperty;
00248
00249 CIMValue newVal(CIMNULL);
00250 switch (m_exprValue.type)
00251 {
00252 case DataType::BoolType:
00253 {
00254 newVal = CIMValueCast::castValueToDataType(CIMValue(m_exprValue.b), cp.getDataType());
00255 }
00256 break;
00257 case DataType::IntType:
00258 {
00259 newVal = CIMValueCast::castValueToDataType(CIMValue(m_exprValue.i), cp.getDataType());
00260 }
00261 break;
00262 case DataType::RealType:
00263 {
00264 newVal = CIMValueCast::castValueToDataType(CIMValue(m_exprValue.r), cp.getDataType());
00265 }
00266 break;
00267 case DataType::StringType:
00268 {
00269 newVal = CIMValueCast::castValueToDataType(CIMValue(m_exprValue.str), cp.getDataType());
00270 }
00271 break;
00272 default:
00273 {
00274 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Invalid value");
00275 }
00276 break;
00277 }
00278 cp.setValue(newVal);
00279 ci.setProperty(cp);
00280 }
00281
00282
00283
00284 m_hdl->createInstance(m_ns, ci);
00285 m_instances.clear();
00286 m_instances.push_back(ci);
00287 #else
00288 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00289 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00290 }
00291 void WQLProcessor::visit_insertRest_DEFAULT_VALUES(
00292 const insertRest_DEFAULT_VALUES* pinsertRest_DEFAULT_VALUES
00293 )
00294 {
00295 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "You must specify key values to create an instance.");
00296 }
00297 void WQLProcessor::visit_insertRest_LEFTPAREN_columnList_RIGHTPAREN_VALUES_LEFTPAREN_targetList_RIGHTPAREN(
00298 const insertRest_LEFTPAREN_columnList_RIGHTPAREN_VALUES_LEFTPAREN_targetList_RIGHTPAREN* pinsertRest_LEFTPAREN_columnList_RIGHTPAREN_VALUES_LEFTPAREN_targetList_RIGHTPAREN
00299 )
00300 {
00301 #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00302 CIMClass cc = m_hdl->getClass(m_ns, m_tableRef, E_NOT_LOCAL_ONLY,
00303 E_INCLUDE_QUALIFIERS, E_INCLUDE_CLASS_ORIGIN, 0);
00304 if (pinsertRest_LEFTPAREN_columnList_RIGHTPAREN_VALUES_LEFTPAREN_targetList_RIGHTPAREN->m_pcolumnList2->size() !=
00305 pinsertRest_LEFTPAREN_columnList_RIGHTPAREN_VALUES_LEFTPAREN_targetList_RIGHTPAREN->m_ptargetList6->size())
00306 {
00307 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Number of columns and values must be the same");
00308 }
00309 CIMInstance ci = cc.newInstance();
00310 StringArray columns;
00311 for (List<String*>::const_iterator i = pinsertRest_LEFTPAREN_columnList_RIGHTPAREN_VALUES_LEFTPAREN_targetList_RIGHTPAREN->m_pcolumnList2->begin();
00312 i != pinsertRest_LEFTPAREN_columnList_RIGHTPAREN_VALUES_LEFTPAREN_targetList_RIGHTPAREN->m_pcolumnList2->end();
00313 ++i )
00314 {
00315 columns.push_back(**i);
00316 }
00317 StringArray::const_iterator column = columns.begin();
00318 for (List<targetEl*>::const_iterator i = pinsertRest_LEFTPAREN_columnList_RIGHTPAREN_VALUES_LEFTPAREN_targetList_RIGHTPAREN->m_ptargetList6->begin();
00319 i != pinsertRest_LEFTPAREN_columnList_RIGHTPAREN_VALUES_LEFTPAREN_targetList_RIGHTPAREN->m_ptargetList6->end();
00320 ++i, ++column )
00321 {
00322 (*i)->acceptInterface(this);
00323
00324 CIMProperty cp = ci.getProperty(*column);
00325 if (!cp)
00326 {
00327 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, Format("Property %1 does not exist on class", *column).c_str());
00328 }
00329 CIMValue newVal(CIMNULL);
00330 switch (m_exprValue.type)
00331 {
00332 case DataType::BoolType:
00333 {
00334 newVal = CIMValueCast::castValueToDataType(CIMValue(m_exprValue.b), cp.getDataType());
00335 }
00336 break;
00337 case DataType::IntType:
00338 {
00339 newVal = CIMValueCast::castValueToDataType(CIMValue(m_exprValue.i), cp.getDataType());
00340 }
00341 break;
00342 case DataType::RealType:
00343 {
00344 newVal = CIMValueCast::castValueToDataType(CIMValue(m_exprValue.r), cp.getDataType());
00345 }
00346 break;
00347 case DataType::StringType:
00348 {
00349 newVal = CIMValueCast::castValueToDataType(CIMValue(m_exprValue.str), cp.getDataType());
00350 }
00351 break;
00352 default:
00353 {
00354 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Invalid value");
00355 }
00356 break;
00357 }
00358 cp.setValue(newVal);
00359 ci.setProperty(cp);
00360 }
00361
00362
00363 m_hdl->createInstance(m_ns, ci);
00364 m_instances.clear();
00365 m_instances.push_back(ci);
00366 #else
00367 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00368 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00369 }
00370 void WQLProcessor::visit_deleteStmt(
00371 const deleteStmt* pdeleteStmt
00372 )
00373 {
00374 #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00375 populateInstances(*pdeleteStmt->m_pstrRelationName3);
00376 if (pdeleteStmt->m_poptWhereClause4)
00377 {
00378 pdeleteStmt->m_poptWhereClause4->acceptInterface(this);
00379 }
00380
00381
00382 for (CIMInstanceArray::const_iterator i = m_instances.begin();
00383 i != m_instances.end();
00384 ++i)
00385 {
00386 CIMObjectPath cop(m_ns, *i);
00387
00388 m_hdl->deleteInstance(m_ns, cop);
00389 }
00390 #else
00391 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00392 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00393 }
00394 void WQLProcessor::visit_updateStmt(
00395 const updateStmt* pupdateStmt
00396 )
00397 {
00398 #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00399 populateInstances(*pupdateStmt->m_pstrRelationName2);
00400
00401 if (pupdateStmt->m_poptWhereClause5)
00402 {
00403 pupdateStmt->m_poptWhereClause5->acceptInterface(this);
00404 }
00405
00406 for (List<updateTargetEl*>::const_iterator i = pupdateStmt->m_pupdateTargetList4->begin();
00407 i != pupdateStmt->m_pupdateTargetList4->end();
00408 ++i )
00409 {
00410 (*i)->acceptInterface(this);
00411 }
00412
00413
00414 for (CIMInstanceArray::iterator curInstance = m_instances.begin();
00415 curInstance != m_instances.end();
00416 ++curInstance)
00417 {
00418 CIMInstance& ci = *curInstance;
00419
00420 StringArray::const_iterator curProperty = m_propertyArray.begin();
00421 for (Array<DataType>::const_iterator curValue = m_valueArray.begin();
00422 curValue != m_valueArray.end() && curProperty != m_propertyArray.end();
00423 ++curValue, ++curProperty )
00424 {
00425
00426 CIMProperty cp = ci.getProperty(*curProperty);
00427 if (!cp)
00428 {
00429 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, Format("Property %1 does not exist on class", *curProperty).c_str());
00430 }
00431 CIMValue newVal(CIMNULL);
00432 switch (curValue->type)
00433 {
00434 case DataType::BoolType:
00435 {
00436 newVal = CIMValueCast::castValueToDataType(CIMValue(curValue->b), cp.getDataType());
00437 }
00438 break;
00439 case DataType::IntType:
00440 {
00441 newVal = CIMValueCast::castValueToDataType(CIMValue(curValue->i), cp.getDataType());
00442 }
00443 break;
00444 case DataType::RealType:
00445 {
00446 newVal = CIMValueCast::castValueToDataType(CIMValue(curValue->r), cp.getDataType());
00447 }
00448 break;
00449 case DataType::StringType:
00450 {
00451 newVal = CIMValueCast::castValueToDataType(CIMValue(curValue->str), cp.getDataType());
00452 }
00453 break;
00454 case DataType::NullType:
00455 {
00456 newVal.setNull();
00457 }
00458 break;
00459 default:
00460 {
00461 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Invalid value");
00462 }
00463 break;
00464 }
00465 cp.setValue(newVal);
00466 ci.setProperty(cp);
00467 }
00468
00469
00470 m_hdl->modifyInstance(m_ns, ci);
00471 }
00472 #else
00473 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00474 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00475
00476 }
00477
00478
00479
00480
00481
00482 void WQLProcessor::visit_selectStmt(
00483 const selectStmt* pselectStmt
00484 )
00485 {
00486 m_doingSelect = true;
00487 if (pselectStmt->m_poptDistinct2)
00488 {
00489 pselectStmt->m_poptDistinct2->acceptInterface(this);
00490 }
00491
00492 if (pselectStmt->m_poptFromClause4)
00493 {
00494 pselectStmt->m_poptFromClause4->acceptInterface(this);
00495 }
00496
00497 if (pselectStmt->m_poptWhereClause5)
00498 {
00499 pselectStmt->m_poptWhereClause5->acceptInterface(this);
00500 }
00501 if (pselectStmt->m_poptGroupClause6)
00502 {
00503 pselectStmt->m_poptGroupClause6->acceptInterface(this);
00504 }
00505 if (pselectStmt->m_poptHavingClause7)
00506 {
00507 pselectStmt->m_poptHavingClause7->acceptInterface(this);
00508 }
00509 if (pselectStmt->m_poptSortClause8)
00510 {
00511 pselectStmt->m_poptSortClause8->acceptInterface(this);
00512 }
00513
00514 for (List<targetEl*>::const_iterator i = pselectStmt->m_ptargetList3->begin();
00515 i != pselectStmt->m_ptargetList3->end();
00516 ++i )
00517 {
00518 (*i)->acceptInterface(this);
00519 }
00520 OW_WQL_LOG_DEBUG("Filtering the properties");
00521 for (size_t i = 0; i < m_propertyArray.size(); ++i)
00522 {
00523 OW_WQL_LOG_DEBUG(Format("Property %1: ", i));
00524 size_t j = m_propertyArray[i].indexOf('.');
00525 if (j != String::npos)
00526 {
00527 m_propertyArray[i] = m_propertyArray[i].substring(j+1);
00528 }
00529 OW_WQL_LOG_DEBUG(m_propertyArray[i].toString());
00530 }
00531 if (m_propertyArray.size() > 1 || (m_propertyArray.size() > 0 && m_propertyArray[0] != "*"))
00532 {
00533 for (size_t i = 0; i < m_instances.size(); ++i)
00534 {
00535
00536
00537 m_instances[i] = m_instances[i].filterProperties(m_propertyArray, E_INCLUDE_QUALIFIERS, E_INCLUDE_CLASS_ORIGIN);
00538 }
00539 }
00540 }
00541 void WQLProcessor::visit_exprSeq_aExpr(
00542 const exprSeq_aExpr* pexprSeq_aExpr
00543 )
00544 {
00545 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00546 pexprSeq_aExpr->m_paExpr1->acceptInterface(this);
00547 }
00548 void WQLProcessor::visit_exprSeq_exprSeq_COMMA_aExpr(
00549 const exprSeq_exprSeq_COMMA_aExpr* pexprSeq_exprSeq_COMMA_aExpr
00550 )
00551 {
00552 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00553 pexprSeq_exprSeq_COMMA_aExpr->m_pexprSeq1->acceptInterface(this);
00554 pexprSeq_exprSeq_COMMA_aExpr->m_paExpr3->acceptInterface(this);
00555 }
00556 void WQLProcessor::visit_exprSeq_exprSeq_USING_aExpr(
00557 const exprSeq_exprSeq_USING_aExpr* pexprSeq_exprSeq_USING_aExpr
00558 )
00559 {
00560 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00561 pexprSeq_exprSeq_USING_aExpr->m_pexprSeq1->acceptInterface(this);
00562 pexprSeq_exprSeq_USING_aExpr->m_paExpr3->acceptInterface(this);
00563 }
00564 void WQLProcessor::visit_optDistinct_empty(
00565 const optDistinct_empty* poptDistinct_empty
00566 )
00567 {
00568 }
00569 void WQLProcessor::visit_optDistinct_DISTINCT(
00570 const optDistinct_DISTINCT* poptDistinct_DISTINCT
00571 )
00572 {
00573 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00574 }
00575 void WQLProcessor::visit_optDistinct_DISTINCT_ON_LEFTPAREN_exprSeq_RIGHTPAREN(
00576 const optDistinct_DISTINCT_ON_LEFTPAREN_exprSeq_RIGHTPAREN* poptDistinct_DISTINCT_ON_LEFTPAREN_exprSeq_RIGHTPAREN
00577 )
00578 {
00579 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00580 poptDistinct_DISTINCT_ON_LEFTPAREN_exprSeq_RIGHTPAREN->m_pexprSeq4->acceptInterface(this);
00581 }
00582 void WQLProcessor::visit_optDistinct_ALL(
00583 const optDistinct_ALL* poptDistinct_ALL
00584 )
00585 {
00586 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00587 }
00588 void WQLProcessor::visit_sortClause(
00589 const sortClause* psortClause
00590 )
00591 {
00592 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00593 for (List<sortby*>::const_iterator i = psortClause->m_psortbyList3->begin();
00594 i != psortClause->m_psortbyList3->end();
00595 ++i )
00596 {
00597 (*i)->acceptInterface(this);
00598 }
00599 }
00600 void WQLProcessor::visit_optSortClause_empty(
00601 const optSortClause_empty* poptSortClause_empty
00602 )
00603 {
00604 }
00605 void WQLProcessor::visit_optSortClause_sortClause(
00606 const optSortClause_sortClause* poptSortClause_sortClause
00607 )
00608 {
00609 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00610 poptSortClause_sortClause->m_psortClause1->acceptInterface(this);
00611 }
00612 void WQLProcessor::visit_sortby(
00613 const sortby* psortby
00614 )
00615 {
00616 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00617 psortby->m_paExpr1->acceptInterface(this);
00618 }
00619 void WQLProcessor::visit_optGroupClause_empty(
00620 const optGroupClause_empty* poptGroupClause_empty
00621 )
00622 {
00623 }
00624 void WQLProcessor::visit_optGroupClause_GROUP_BY_exprSeq(
00625 const optGroupClause_GROUP_BY_exprSeq* poptGroupClause_GROUP_BY_exprSeq
00626 )
00627 {
00628 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00629 poptGroupClause_GROUP_BY_exprSeq->m_pexprSeq3->acceptInterface(this);
00630 }
00631 void WQLProcessor::visit_optHavingClause_empty(
00632 const optHavingClause_empty* poptHavingClause_empty
00633 )
00634 {
00635 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00636 }
00637 void WQLProcessor::visit_optHavingClause_HAVING_aExpr(
00638 const optHavingClause_HAVING_aExpr* poptHavingClause_HAVING_aExpr
00639 )
00640 {
00641 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00642 poptHavingClause_HAVING_aExpr->m_paExpr2->acceptInterface(this);
00643 }
00644 void WQLProcessor::visit_optFromClause_empty(
00645 const optFromClause_empty* poptFromClause_empty
00646 )
00647 {
00648 }
00649 void WQLProcessor::visit_optFromClause_FROM_fromList(
00650 const optFromClause_FROM_fromList* poptFromClause_FROM_fromList
00651 )
00652 {
00653 for (List<tableRef*>::const_iterator i = poptFromClause_FROM_fromList->m_pfromList2->begin();
00654 i != poptFromClause_FROM_fromList->m_pfromList2->end();
00655 ++i )
00656 {
00657 (*i)->acceptInterface(this);
00658
00659 m_isSchemaQuery= isTableRefMetaClass(*i);
00660
00661
00662 if (!m_isSchemaQuery)
00663 {
00664 populateInstances();
00665 }
00666 }
00667 }
00668 void WQLProcessor::visit_tableRef_relationExpr(
00669 const tableRef_relationExpr* ptableRef_relationExpr
00670 )
00671 {
00672 ptableRef_relationExpr->m_prelationExpr1->acceptInterface(this);
00673 }
00674 void WQLProcessor::visit_tableRef_relationExpr_aliasClause(
00675 const tableRef_relationExpr_aliasClause* ptableRef_relationExpr_aliasClause
00676 )
00677 {
00678 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00679 ptableRef_relationExpr_aliasClause->m_prelationExpr1->acceptInterface(this);
00680 ptableRef_relationExpr_aliasClause->m_paliasClause2->acceptInterface(this);
00681 }
00682 void WQLProcessor::visit_tableRef_joinedTable(
00683 const tableRef_joinedTable* ptableRef_joinedTable
00684 )
00685 {
00686 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00687 ptableRef_joinedTable->m_pjoinedTable1->acceptInterface(this);
00688 }
00689 void WQLProcessor::visit_tableRef_LEFTPAREN_joinedTable_RIGHTPAREN_aliasClause(
00690 const tableRef_LEFTPAREN_joinedTable_RIGHTPAREN_aliasClause* ptableRef_LEFTPAREN_joinedTable_RIGHTPAREN_aliasClause
00691 )
00692 {
00693 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00694 ptableRef_LEFTPAREN_joinedTable_RIGHTPAREN_aliasClause->m_pjoinedTable2->acceptInterface(this);
00695 ptableRef_LEFTPAREN_joinedTable_RIGHTPAREN_aliasClause->m_paliasClause4->acceptInterface(this);
00696 }
00697 void WQLProcessor::visit_joinedTable_LEFTPAREN_joinedTable_RIGHTPAREN(
00698 const joinedTable_LEFTPAREN_joinedTable_RIGHTPAREN* pjoinedTable_LEFTPAREN_joinedTable_RIGHTPAREN
00699 )
00700 {
00701 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00702 pjoinedTable_LEFTPAREN_joinedTable_RIGHTPAREN->m_pjoinedTable2->acceptInterface(this);
00703 }
00704 void WQLProcessor::visit_joinedTable_tableRef_CROSS_JOIN_tableRef(
00705 const joinedTable_tableRef_CROSS_JOIN_tableRef* pjoinedTable_tableRef_CROSS_JOIN_tableRef
00706 )
00707 {
00708 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00709 pjoinedTable_tableRef_CROSS_JOIN_tableRef->m_ptableRef1->acceptInterface(this);
00710 pjoinedTable_tableRef_CROSS_JOIN_tableRef->m_ptableRef4->acceptInterface(this);
00711 }
00712 void WQLProcessor::visit_joinedTable_tableRef_UNIONJOIN_tableRef(
00713 const joinedTable_tableRef_UNIONJOIN_tableRef* pjoinedTable_tableRef_UNIONJOIN_tableRef
00714 )
00715 {
00716 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00717 pjoinedTable_tableRef_UNIONJOIN_tableRef->m_ptableRef1->acceptInterface(this);
00718 pjoinedTable_tableRef_UNIONJOIN_tableRef->m_ptableRef3->acceptInterface(this);
00719 }
00720 void WQLProcessor::visit_joinedTable_tableRef_joinType_JOIN_tableRef_joinQual(
00721 const joinedTable_tableRef_joinType_JOIN_tableRef_joinQual* pjoinedTable_tableRef_joinType_JOIN_tableRef_joinQual
00722 )
00723 {
00724 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00725 pjoinedTable_tableRef_joinType_JOIN_tableRef_joinQual->m_ptableRef1->acceptInterface(this);
00726 pjoinedTable_tableRef_joinType_JOIN_tableRef_joinQual->m_pjoinType2->acceptInterface(this);
00727 pjoinedTable_tableRef_joinType_JOIN_tableRef_joinQual->m_ptableRef4->acceptInterface(this);
00728 pjoinedTable_tableRef_joinType_JOIN_tableRef_joinQual->m_pjoinQual5->acceptInterface(this);
00729 }
00730 void WQLProcessor::visit_joinedTable_tableRef_JOIN_tableRef_joinQual(
00731 const joinedTable_tableRef_JOIN_tableRef_joinQual* pjoinedTable_tableRef_JOIN_tableRef_joinQual
00732 )
00733 {
00734 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00735 pjoinedTable_tableRef_JOIN_tableRef_joinQual->m_ptableRef1->acceptInterface(this);
00736 pjoinedTable_tableRef_JOIN_tableRef_joinQual->m_ptableRef3->acceptInterface(this);
00737 pjoinedTable_tableRef_JOIN_tableRef_joinQual->m_pjoinQual4->acceptInterface(this);
00738 }
00739 void WQLProcessor::visit_joinedTable_tableRef_NATURAL_joinType_JOIN_tableRef(
00740 const joinedTable_tableRef_NATURAL_joinType_JOIN_tableRef* pjoinedTable_tableRef_NATURAL_joinType_JOIN_tableRef
00741 )
00742 {
00743 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00744 pjoinedTable_tableRef_NATURAL_joinType_JOIN_tableRef->m_ptableRef1->acceptInterface(this);
00745 pjoinedTable_tableRef_NATURAL_joinType_JOIN_tableRef->m_pjoinType3->acceptInterface(this);
00746 pjoinedTable_tableRef_NATURAL_joinType_JOIN_tableRef->m_ptableRef5->acceptInterface(this);
00747 }
00748 void WQLProcessor::visit_joinedTable_tableRef_NATURAL_JOIN_tableRef(
00749 const joinedTable_tableRef_NATURAL_JOIN_tableRef* pjoinedTable_tableRef_NATURAL_JOIN_tableRef
00750 )
00751 {
00752 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00753 pjoinedTable_tableRef_NATURAL_JOIN_tableRef->m_ptableRef1->acceptInterface(this);
00754 pjoinedTable_tableRef_NATURAL_JOIN_tableRef->m_ptableRef4->acceptInterface(this);
00755 }
00756 void WQLProcessor::visit_aliasClause_AS_strColId_LEFTPAREN_nameList_RIGHTPAREN(
00757 const aliasClause_AS_strColId_LEFTPAREN_nameList_RIGHTPAREN* paliasClause_AS_strColId_LEFTPAREN_nameList_RIGHTPAREN
00758 )
00759 {
00760 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00761 for (List<String*>::const_iterator i = paliasClause_AS_strColId_LEFTPAREN_nameList_RIGHTPAREN->m_pnameList4->begin();
00762 i != paliasClause_AS_strColId_LEFTPAREN_nameList_RIGHTPAREN->m_pnameList4->end();
00763 ++i )
00764 {
00765 }
00766 }
00767 void WQLProcessor::visit_aliasClause_AS_strColId(
00768 const aliasClause_AS_strColId* paliasClause_AS_strColId
00769 )
00770 {
00771 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00772 }
00773 void WQLProcessor::visit_aliasClause_strColId_LEFTPAREN_nameList_RIGHTPAREN(
00774 const aliasClause_strColId_LEFTPAREN_nameList_RIGHTPAREN* paliasClause_strColId_LEFTPAREN_nameList_RIGHTPAREN
00775 )
00776 {
00777 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00778 for (List<String*>::const_iterator i = paliasClause_strColId_LEFTPAREN_nameList_RIGHTPAREN->m_pnameList3->begin();
00779 i != paliasClause_strColId_LEFTPAREN_nameList_RIGHTPAREN->m_pnameList3->end();
00780 ++i )
00781 {
00782 }
00783 }
00784 void WQLProcessor::visit_aliasClause_strColId(
00785 const aliasClause_strColId* paliasClause_strColId
00786 )
00787 {
00788 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00789 }
00790 void WQLProcessor::visit_joinType_FULL_strOptJoinOuter(
00791 const joinType_FULL_strOptJoinOuter* pjoinType_FULL_strOptJoinOuter
00792 )
00793 {
00794 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00795 }
00796 void WQLProcessor::visit_joinType_LEFT_strOptJoinOuter(
00797 const joinType_LEFT_strOptJoinOuter* pjoinType_LEFT_strOptJoinOuter
00798 )
00799 {
00800 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00801 }
00802 void WQLProcessor::visit_joinType_RIGHT_strOptJoinOuter(
00803 const joinType_RIGHT_strOptJoinOuter* pjoinType_RIGHT_strOptJoinOuter
00804 )
00805 {
00806 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00807 }
00808 void WQLProcessor::visit_joinType_INNERP(
00809 const joinType_INNERP* pjoinType_INNERP
00810 )
00811 {
00812 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00813 }
00814 void WQLProcessor::visit_joinQual_USING_LEFTPAREN_nameList_RIGHTPAREN(
00815 const joinQual_USING_LEFTPAREN_nameList_RIGHTPAREN* pjoinQual_USING_LEFTPAREN_nameList_RIGHTPAREN
00816 )
00817 {
00818 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00819 for (List<String*>::const_iterator i = pjoinQual_USING_LEFTPAREN_nameList_RIGHTPAREN->m_pnameList3->begin();
00820 i != pjoinQual_USING_LEFTPAREN_nameList_RIGHTPAREN->m_pnameList3->end();
00821 ++i )
00822 {
00823 }
00824 }
00825 void WQLProcessor::visit_joinQual_ON_aExpr(
00826 const joinQual_ON_aExpr* pjoinQual_ON_aExpr
00827 )
00828 {
00829 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00830 pjoinQual_ON_aExpr->m_paExpr2->acceptInterface(this);
00831 }
00832 void WQLProcessor::visit_relationExpr_strRelationName(
00833 const relationExpr_strRelationName* prelationExpr_strRelationName
00834 )
00835 {
00836 m_tableRef = *prelationExpr_strRelationName->m_pstrRelationName1;
00837
00838 }
00839 void WQLProcessor::visit_relationExpr_strRelationName_ASTERISK(
00840 const relationExpr_strRelationName_ASTERISK* prelationExpr_strRelationName_ASTERISK
00841 )
00842 {
00843 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00844 }
00845 void WQLProcessor::visit_relationExpr_ONLY_strRelationName(
00846 const relationExpr_ONLY_strRelationName* prelationExpr_ONLY_strRelationName
00847 )
00848 {
00849 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00850 }
00851 void WQLProcessor::visit_optWhereClause_empty(
00852 const optWhereClause_empty* poptWhereClause_empty
00853 )
00854 {
00855 }
00856 void WQLProcessor::visit_optWhereClause_WHERE_aExpr(
00857 const optWhereClause_WHERE_aExpr* poptWhereClause_WHERE_aExpr
00858 )
00859 {
00860 poptWhereClause_WHERE_aExpr->m_paExpr2->acceptInterface(this);
00861 if (m_exprValue.type == DataType::CIMInstanceArrayType)
00862 {
00863 m_instances = m_exprValue.cia;
00864 }
00865 else
00866 {
00867 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "WHERE clause did not evalue to m_instances");
00868 }
00869 }
00870 void WQLProcessor::visit_rowExpr(
00871 const rowExpr* prowExpr
00872 )
00873 {
00874 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00875 prowExpr->m_prowDescriptor2->acceptInterface(this);
00876 prowExpr->m_prowDescriptor6->acceptInterface(this);
00877 }
00878 void WQLProcessor::visit_rowDescriptor(
00879 const rowDescriptor* prowDescriptor
00880 )
00881 {
00882 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00883 for (List<aExpr*>::const_iterator i = prowDescriptor->m_prowList1->begin();
00884 i != prowDescriptor->m_prowList1->end();
00885 ++i )
00886 {
00887 (*i)->acceptInterface(this);
00888 }
00889 prowDescriptor->m_paExpr3->acceptInterface(this);
00890 }
00891 void WQLProcessor::visit_aExpr_cExpr(
00892 const aExpr_cExpr* paExpr_cExpr
00893 )
00894 {
00895 paExpr_cExpr->m_pcExpr1->acceptInterface(this);
00896 }
00897 void WQLProcessor::visit_aExpr_aExpr_AT_TIME_ZONE_cExpr(
00898 const aExpr_aExpr_AT_TIME_ZONE_cExpr* paExpr_aExpr_AT_TIME_ZONE_cExpr
00899 )
00900 {
00901 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00902 paExpr_aExpr_AT_TIME_ZONE_cExpr->m_paExpr1->acceptInterface(this);
00903 paExpr_aExpr_AT_TIME_ZONE_cExpr->m_pcExpr5->acceptInterface(this);
00904 }
00905 void WQLProcessor::visit_aExpr_PLUS_aExpr(
00906 const aExpr_PLUS_aExpr* paExpr_PLUS_aExpr
00907 )
00908 {
00909 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00910 paExpr_PLUS_aExpr->m_paExpr2->acceptInterface(this);
00911 }
00912 void WQLProcessor::visit_aExpr_MINUS_aExpr(
00913 const aExpr_MINUS_aExpr* paExpr_MINUS_aExpr
00914 )
00915 {
00916 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00917 paExpr_MINUS_aExpr->m_paExpr2->acceptInterface(this);
00918 }
00919 void WQLProcessor::visit_aExpr_BITINVERT_aExpr(
00920 const aExpr_BITINVERT_aExpr* paExpr_BITINVERT_aExpr
00921 )
00922 {
00923 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00924 paExpr_BITINVERT_aExpr->m_paExpr2->acceptInterface(this);
00925 }
00926 void WQLProcessor::visit_aExpr_aExpr_PLUS_aExpr(
00927 const aExpr_aExpr_PLUS_aExpr* paExpr_aExpr_PLUS_aExpr
00928 )
00929 {
00930 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00931 paExpr_aExpr_PLUS_aExpr->m_paExpr1->acceptInterface(this);
00932 paExpr_aExpr_PLUS_aExpr->m_paExpr3->acceptInterface(this);
00933 }
00934 void WQLProcessor::visit_aExpr_aExpr_MINUS_aExpr(
00935 const aExpr_aExpr_MINUS_aExpr* paExpr_aExpr_MINUS_aExpr
00936 )
00937 {
00938 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00939 paExpr_aExpr_MINUS_aExpr->m_paExpr1->acceptInterface(this);
00940 paExpr_aExpr_MINUS_aExpr->m_paExpr3->acceptInterface(this);
00941 }
00942 void WQLProcessor::visit_aExpr_aExpr_ASTERISK_aExpr(
00943 const aExpr_aExpr_ASTERISK_aExpr* paExpr_aExpr_ASTERISK_aExpr
00944 )
00945 {
00946 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00947 paExpr_aExpr_ASTERISK_aExpr->m_paExpr1->acceptInterface(this);
00948 paExpr_aExpr_ASTERISK_aExpr->m_paExpr3->acceptInterface(this);
00949 }
00950 void WQLProcessor::visit_aExpr_aExpr_SOLIDUS_aExpr(
00951 const aExpr_aExpr_SOLIDUS_aExpr* paExpr_aExpr_SOLIDUS_aExpr
00952 )
00953 {
00954 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00955 paExpr_aExpr_SOLIDUS_aExpr->m_paExpr1->acceptInterface(this);
00956 paExpr_aExpr_SOLIDUS_aExpr->m_paExpr3->acceptInterface(this);
00957 }
00958 void WQLProcessor::visit_aExpr_aExpr_PERCENT_aExpr(
00959 const aExpr_aExpr_PERCENT_aExpr* paExpr_aExpr_PERCENT_aExpr
00960 )
00961 {
00962 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00963 paExpr_aExpr_PERCENT_aExpr->m_paExpr1->acceptInterface(this);
00964 paExpr_aExpr_PERCENT_aExpr->m_paExpr3->acceptInterface(this);
00965 }
00966 void WQLProcessor::visit_aExpr_aExpr_BITAND_aExpr(
00967 const aExpr_aExpr_BITAND_aExpr* paExpr_aExpr_BITAND_aExpr
00968 )
00969 {
00970 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00971 paExpr_aExpr_BITAND_aExpr->m_paExpr1->acceptInterface(this);
00972 paExpr_aExpr_BITAND_aExpr->m_paExpr3->acceptInterface(this);
00973 }
00974 void WQLProcessor::visit_aExpr_aExpr_BITOR_aExpr(
00975 const aExpr_aExpr_BITOR_aExpr* paExpr_aExpr_BITOR_aExpr
00976 )
00977 {
00978 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00979 paExpr_aExpr_BITOR_aExpr->m_paExpr1->acceptInterface(this);
00980 paExpr_aExpr_BITOR_aExpr->m_paExpr3->acceptInterface(this);
00981 }
00982 void WQLProcessor::visit_aExpr_aExpr_BITSHIFTLEFT_aExpr(
00983 const aExpr_aExpr_BITSHIFTLEFT_aExpr* paExpr_aExpr_BITSHIFTLEFT_aExpr
00984 )
00985 {
00986 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00987 paExpr_aExpr_BITSHIFTLEFT_aExpr->m_paExpr1->acceptInterface(this);
00988 paExpr_aExpr_BITSHIFTLEFT_aExpr->m_paExpr3->acceptInterface(this);
00989 }
00990 void WQLProcessor::visit_aExpr_aExpr_BITSHIFTRIGHT_aExpr(
00991 const aExpr_aExpr_BITSHIFTRIGHT_aExpr* paExpr_aExpr_BITSHIFTRIGHT_aExpr
00992 )
00993 {
00994 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
00995 paExpr_aExpr_BITSHIFTRIGHT_aExpr->m_paExpr1->acceptInterface(this);
00996 paExpr_aExpr_BITSHIFTRIGHT_aExpr->m_paExpr3->acceptInterface(this);
00997 }
00998 void WQLProcessor::visit_aExpr_aExpr_LESSTHAN_aExpr(
00999 const aExpr_aExpr_LESSTHAN_aExpr* paExpr_aExpr_LESSTHAN_aExpr
01000 )
01001 {
01002 paExpr_aExpr_LESSTHAN_aExpr->m_paExpr1->acceptInterface(this);
01003 DataType lhs = m_exprValue;
01004 paExpr_aExpr_LESSTHAN_aExpr->m_paExpr3->acceptInterface(this);
01005 DataType rhs = m_exprValue;
01006
01007 doComparison(lhs, rhs, Compare(Compare::LessThanType));
01008 }
01009 void WQLProcessor::visit_aExpr_aExpr_LESSTHANOREQUALS_aExpr(
01010 const aExpr_aExpr_LESSTHANOREQUALS_aExpr* paExpr_aExpr_LESSTHANOREQUALS_aExpr
01011 )
01012 {
01013 paExpr_aExpr_LESSTHANOREQUALS_aExpr->m_paExpr1->acceptInterface(this);
01014 DataType lhs = m_exprValue;
01015
01016 paExpr_aExpr_LESSTHANOREQUALS_aExpr->m_paExpr3->acceptInterface(this);
01017 DataType rhs = m_exprValue;
01018
01019 doComparison(lhs, rhs, Compare(Compare::LessThanOrEqualsType));
01020 }
01021 void WQLProcessor::visit_aExpr_aExpr_GREATERTHAN_aExpr(
01022 const aExpr_aExpr_GREATERTHAN_aExpr* paExpr_aExpr_GREATERTHAN_aExpr
01023 )
01024 {
01025 paExpr_aExpr_GREATERTHAN_aExpr->m_paExpr1->acceptInterface(this);
01026 DataType lhs = m_exprValue;
01027
01028 paExpr_aExpr_GREATERTHAN_aExpr->m_paExpr3->acceptInterface(this);
01029 DataType rhs = m_exprValue;
01030
01031 doComparison(lhs, rhs, Compare(Compare::GreaterThanType));
01032 }
01033 void WQLProcessor::visit_aExpr_aExpr_GREATERTHANOREQUALS_aExpr(
01034 const aExpr_aExpr_GREATERTHANOREQUALS_aExpr* paExpr_aExpr_GREATERTHANOREQUALS_aExpr
01035 )
01036 {
01037 paExpr_aExpr_GREATERTHANOREQUALS_aExpr->m_paExpr1->acceptInterface(this);
01038 DataType lhs = m_exprValue;
01039
01040 paExpr_aExpr_GREATERTHANOREQUALS_aExpr->m_paExpr3->acceptInterface(this);
01041 DataType rhs = m_exprValue;
01042 doComparison(lhs, rhs, Compare(Compare::GreaterThanOrEqualsType));
01043 }
01044 void WQLProcessor::visit_aExpr_aExpr_EQUALS_aExpr(
01045 const aExpr_aExpr_EQUALS_aExpr* paExpr_aExpr_EQUALS_aExpr
01046 )
01047 {
01048 paExpr_aExpr_EQUALS_aExpr->m_paExpr1->acceptInterface(this);
01049 DataType lhs = m_exprValue;
01050 paExpr_aExpr_EQUALS_aExpr->m_paExpr3->acceptInterface(this);
01051 DataType rhs = m_exprValue;
01052 if (m_isSchemaQuery)
01053 {
01054 OW_WQL_LOG_DEBUG("Handling schema query.");
01055
01056 if (rhs.type == DataType::StringType)
01057 {
01058 CIMInstanceArray newInstances;
01059 String nameSpace= m_ns;
01060 String className= rhs.str;
01061 OW_WQL_LOG_DEBUG(Format("namespace: %1 , class name: %2", nameSpace, className));
01062
01063 if (lhs.str.equalsIgnoreCase("__Class"))
01064 {
01065 OW_WQL_LOG_DEBUG("Handling __Class query.");
01066
01067 newInstances.push_back(embedClassInInstance(m_hdl->getClass(nameSpace, className)));
01068 }
01069 else if (lhs.str.equalsIgnoreCase("__Dynasty"))
01070 {
01071 OW_WQL_LOG_DEBUG("Handling __Dynasty query.");
01072
01073 CIMClass cl= m_hdl->getClass(nameSpace, className);
01074 if (cl && cl.getSuperClass() == "")
01075 {
01076
01077 CIMInstance rhsClass= embedClassInInstance(m_hdl->getClass(nameSpace, className));
01078 OW_WQL_LOG_DEBUG(Format("Found class: %1", rhsClass.toString()));
01079 newInstances.push_back(rhsClass);
01080
01081 ClassesEmbeddedInInstancesResultHandler result(newInstances);
01082 m_hdl->enumClass(nameSpace, className, result, E_DEEP);
01083 }
01084 else
01085 {
01086 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, Format("rhs %1 of = in schema query must be a root class.", rhs.str).c_str());
01087 }
01088 }
01089 else
01090 {
01091 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, Format("%1 not understood in schema query.", rhs.str).c_str());
01092 }
01093 m_exprValue= DataType(newInstances);
01094 }
01095 else
01096 {
01097 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Schema query must use string for rhs of ISA.");
01098 }
01099 }
01100 else
01101 {
01102 doComparison(lhs, rhs, Compare(Compare::EqualsType));
01103 }
01104 }
01105 void WQLProcessor::doComparison(const DataType& lhs, const DataType& rhs, const Compare& compare)
01106 {
01107 switch (lhs.type)
01108 {
01109 case DataType::ColumnNameType:
01110 {
01111 switch (rhs.type)
01112 {
01113 case DataType::StringType:
01114 {
01115 m_exprValue = DataType(filterInstancesOnPropertyValue(lhs.str, CIMValue(rhs.str), compare));
01116 }
01117 break;
01118 case DataType::IntType:
01119 {
01120 m_exprValue = DataType(filterInstancesOnPropertyValue(lhs.str, CIMValue(rhs.i), compare));
01121 }
01122 break;
01123 case DataType::BoolType:
01124 {
01125 m_exprValue = DataType(filterInstancesOnPropertyValue(lhs.str, CIMValue(rhs.b), compare));
01126 }
01127 break;
01128 case DataType::RealType:
01129 {
01130 m_exprValue = DataType(filterInstancesOnPropertyValue(lhs.str, CIMValue(rhs.r), compare));
01131 }
01132 break;
01133 case DataType::NullType:
01134 {
01135 m_exprValue = DataType(filterInstancesOnPropertyValue(lhs.str, CIMValue(CIMNULL), compare));
01136 }
01137 break;
01138 default:
01139 {
01140 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, Format("Unsupported comparison. lhs.type = %1, rhs.type = %2", typeName(lhs.type), typeName(rhs.type)).c_str());
01141 }
01142 break;
01143 }
01144 }
01145 break;
01146 case DataType::StringType:
01147 {
01148 switch (rhs.type)
01149 {
01150 case DataType::ColumnNameType:
01151 {
01152 m_exprValue = DataType(filterInstancesOnPropertyValue(rhs.str, CIMValue(lhs.str), Compare(compare).reverseOrder()));
01153 }
01154 break;
01155
01156 default:
01157 {
01158 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, Format("Unsupported comparison. lhs.type = %1, rhs.type = %2", typeName(lhs.type), typeName(rhs.type)).c_str());
01159 }
01160 break;
01161 }
01162 }
01163 break;
01164 case DataType::IntType:
01165 {
01166 switch (rhs.type)
01167 {
01168 case DataType::ColumnNameType:
01169 {
01170 m_exprValue = DataType(filterInstancesOnPropertyValue(rhs.str, CIMValue(lhs.i), Compare(compare).reverseOrder()));
01171 }
01172 break;
01173
01174 default:
01175 {
01176 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, Format("Unsupported comparison. lhs.type = %1, rhs.type = %2", typeName(lhs.type), typeName(rhs.type)).c_str());
01177 }
01178 break;
01179 }
01180 }
01181 break;
01182 case DataType::BoolType:
01183 {
01184 switch (rhs.type)
01185 {
01186 case DataType::ColumnNameType:
01187 {
01188 m_exprValue = DataType(filterInstancesOnPropertyValue(rhs.str, CIMValue(lhs.b), Compare(compare).reverseOrder()));
01189 }
01190 break;
01191
01192 default:
01193 {
01194 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, Format("Unsupported comparison. lhs.type = %1, rhs.type = %2", typeName(lhs.type), typeName(rhs.type)).c_str());
01195 }
01196 break;
01197 }
01198 }
01199 break;
01200
01201 case DataType::RealType:
01202 {
01203 switch (rhs.type)
01204 {
01205 case DataType::ColumnNameType:
01206 {
01207 m_exprValue = DataType(filterInstancesOnPropertyValue(rhs.str, CIMValue(lhs.r), Compare(compare).reverseOrder()));
01208 }
01209 break;
01210
01211 default:
01212 {
01213 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, Format("Unsupported comparison. lhs.type = %1, rhs.type = %2", typeName(lhs.type), typeName(rhs.type)).c_str());
01214 }
01215 break;
01216 }
01217 }
01218 break;
01219
01220 case DataType::NullType:
01221 {
01222 switch (rhs.type)
01223 {
01224 case DataType::ColumnNameType:
01225 {
01226 m_exprValue = DataType(filterInstancesOnPropertyValue(rhs.str, CIMValue(CIMNULL), Compare(compare).reverseOrder()));
01227 }
01228 break;
01229
01230 default:
01231 {
01232 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, Format("Unsupported comparison. lhs.type = %1, rhs.type = %2", typeName(lhs.type), typeName(rhs.type)).c_str());
01233 }
01234 break;
01235 }
01236 }
01237 break;
01238
01239 default:
01240 {
01241 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Unsupported comparison");
01242 }
01243 break;
01244 }
01245 }
01246 void WQLProcessor::visit_aExpr_aExpr_NOTEQUALS_aExpr(
01247 const aExpr_aExpr_NOTEQUALS_aExpr* paExpr_aExpr_NOTEQUALS_aExpr
01248 )
01249 {
01250 paExpr_aExpr_NOTEQUALS_aExpr->m_paExpr1->acceptInterface(this);
01251 DataType lhs = m_exprValue;
01252 paExpr_aExpr_NOTEQUALS_aExpr->m_paExpr3->acceptInterface(this);
01253 DataType rhs = m_exprValue;
01254 doComparison(lhs, rhs, Compare(Compare::NotEqualsType));
01255 }
01256 void WQLProcessor::visit_aExpr_aExpr_AND_aExpr(
01257 const aExpr_aExpr_AND_aExpr* paExpr_aExpr_AND_aExpr
01258 )
01259 {
01260 paExpr_aExpr_AND_aExpr->m_paExpr1->acceptInterface(this);
01261 DataType lhs = m_exprValue;
01262 if (lhs.type != DataType::CIMInstanceArrayType)
01263 {
01264 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "invalid OR argument");
01265 }
01266
01267 paExpr_aExpr_AND_aExpr->m_paExpr3->acceptInterface(this);
01268 DataType rhs = m_exprValue;
01269 if (rhs.type != DataType::CIMInstanceArrayType)
01270 {
01271 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "invalid OR argument");
01272 }
01273
01274
01275
01276 std::sort(lhs.cia.begin(), lhs.cia.end(), CIMInstanceSortCriterion);
01277
01278 std::sort(rhs.cia.begin(), rhs.cia.end(), CIMInstanceSortCriterion);
01279
01280
01281
01282 CIMInstanceArray rVal;
01283 std::set_intersection(lhs.cia.begin(), lhs.cia.end(), rhs.cia.begin(), rhs.cia.end(), std::back_inserter(rVal), CIMInstanceSortCriterion);
01284
01285 m_exprValue = DataType(rVal);
01286 }
01287 void WQLProcessor::visit_aExpr_aExpr_OR_aExpr(
01288 const aExpr_aExpr_OR_aExpr* paExpr_aExpr_OR_aExpr
01289 )
01290 {
01291 paExpr_aExpr_OR_aExpr->m_paExpr1->acceptInterface(this);
01292 DataType lhs = m_exprValue;
01293 if (lhs.type != DataType::CIMInstanceArrayType)
01294 {
01295 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "invalid OR argument");
01296 }
01297
01298 paExpr_aExpr_OR_aExpr->m_paExpr3->acceptInterface(this);
01299 DataType rhs = m_exprValue;
01300 if (rhs.type != DataType::CIMInstanceArrayType)
01301 {
01302 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "invalid OR argument");
01303 }
01304
01305 std::sort(lhs.cia.begin(), lhs.cia.end(), CIMInstanceSortCriterion);
01306 std::sort(rhs.cia.begin(), rhs.cia.end(), CIMInstanceSortCriterion);
01307
01308
01309 CIMInstanceArray unionArray;
01310 std::set_union(lhs.cia.begin(), lhs.cia.end(), rhs.cia.begin(), rhs.cia.end(), std::back_inserter(unionArray), CIMInstanceSortCriterion);
01311
01312 m_exprValue = DataType(unionArray);
01313 }
01314 bool CIMInstanceSortCriterion( const CIMInstance& lhs, const CIMInstance& rhs)
01315 {
01316
01317 return lhs.toString() < rhs.toString();
01318 }
01319 void WQLProcessor::visit_aExpr_NOT_aExpr(
01320 const aExpr_NOT_aExpr* paExpr_NOT_aExpr
01321 )
01322 {
01323 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01324 paExpr_NOT_aExpr->m_paExpr2->acceptInterface(this);
01325 }
01326 void WQLProcessor::visit_aExpr_aExpr_CONCATENATION_aExpr(
01327 const aExpr_aExpr_CONCATENATION_aExpr* paExpr_aExpr_CONCATENATION_aExpr
01328 )
01329 {
01330 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01331 paExpr_aExpr_CONCATENATION_aExpr->m_paExpr1->acceptInterface(this);
01332 paExpr_aExpr_CONCATENATION_aExpr->m_paExpr3->acceptInterface(this);
01333 }
01334 void WQLProcessor::visit_aExpr_aExpr_LIKE_aExpr(
01335 const aExpr_aExpr_LIKE_aExpr* paExpr_aExpr_LIKE_aExpr
01336 )
01337 {
01338 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01339 paExpr_aExpr_LIKE_aExpr->m_paExpr1->acceptInterface(this);
01340 paExpr_aExpr_LIKE_aExpr->m_paExpr3->acceptInterface(this);
01341 }
01342 void WQLProcessor::visit_aExpr_aExpr_LIKE_aExpr_ESCAPE_aExpr(
01343 const aExpr_aExpr_LIKE_aExpr_ESCAPE_aExpr* paExpr_aExpr_LIKE_aExpr_ESCAPE_aExpr
01344 )
01345 {
01346 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01347 paExpr_aExpr_LIKE_aExpr_ESCAPE_aExpr->m_paExpr1->acceptInterface(this);
01348 paExpr_aExpr_LIKE_aExpr_ESCAPE_aExpr->m_paExpr3->acceptInterface(this);
01349 paExpr_aExpr_LIKE_aExpr_ESCAPE_aExpr->m_paExpr5->acceptInterface(this);
01350 }
01351 void WQLProcessor::visit_aExpr_aExpr_NOT_LIKE_aExpr(
01352 const aExpr_aExpr_NOT_LIKE_aExpr* paExpr_aExpr_NOT_LIKE_aExpr
01353 )
01354 {
01355 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01356 paExpr_aExpr_NOT_LIKE_aExpr->m_paExpr1->acceptInterface(this);
01357 paExpr_aExpr_NOT_LIKE_aExpr->m_paExpr4->acceptInterface(this);
01358 }
01359 void WQLProcessor::visit_aExpr_aExpr_NOT_LIKE_aExpr_ESCAPE_aExpr(
01360 const aExpr_aExpr_NOT_LIKE_aExpr_ESCAPE_aExpr* paExpr_aExpr_NOT_LIKE_aExpr_ESCAPE_aExpr
01361 )
01362 {
01363 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01364 paExpr_aExpr_NOT_LIKE_aExpr_ESCAPE_aExpr->m_paExpr1->acceptInterface(this);
01365 paExpr_aExpr_NOT_LIKE_aExpr_ESCAPE_aExpr->m_paExpr4->acceptInterface(this);
01366 paExpr_aExpr_NOT_LIKE_aExpr_ESCAPE_aExpr->m_paExpr6->acceptInterface(this);
01367 }
01368 void WQLProcessor::visit_aExpr_aExpr_ISNULL(
01369 const aExpr_aExpr_ISNULL* paExpr_aExpr_ISNULL
01370 )
01371 {
01372 paExpr_aExpr_ISNULL->m_paExpr1->acceptInterface(this);
01373 DataType lhs = m_exprValue;
01374 DataType rhs = DataType(DataType::NullType);
01375 doComparison(lhs, rhs, Compare(Compare::EqualsType));
01376 }
01377 void WQLProcessor::visit_aExpr_aExpr_IS_NULLP(
01378 const aExpr_aExpr_IS_NULLP* paExpr_aExpr_IS_NULLP
01379 )
01380 {
01381 paExpr_aExpr_IS_NULLP->m_paExpr1->acceptInterface(this);
01382 DataType lhs = m_exprValue;
01383 DataType rhs = DataType(DataType::NullType);
01384 doComparison(lhs, rhs, Compare(Compare::EqualsType));
01385 }
01386 void WQLProcessor::visit_aExpr_aExpr_NOTNULL(
01387 const aExpr_aExpr_NOTNULL* paExpr_aExpr_NOTNULL
01388 )
01389 {
01390 paExpr_aExpr_NOTNULL->m_paExpr1->acceptInterface(this);
01391 DataType lhs = m_exprValue;
01392 DataType rhs = DataType(DataType::NullType);
01393 doComparison(lhs, rhs, Compare(Compare::NotEqualsType));
01394 }
01395 void WQLProcessor::visit_aExpr_aExpr_IS_NOT_NULLP(
01396 const aExpr_aExpr_IS_NOT_NULLP* paExpr_aExpr_IS_NOT_NULLP
01397 )
01398 {
01399 paExpr_aExpr_IS_NOT_NULLP->m_paExpr1->acceptInterface(this);
01400 DataType lhs = m_exprValue;
01401 DataType rhs = DataType(DataType::NullType);
01402 doComparison(lhs, rhs, Compare(Compare::NotEqualsType));
01403 }
01404 void WQLProcessor::visit_aExpr_aExpr_IS_TRUEP(
01405 const aExpr_aExpr_IS_TRUEP* paExpr_aExpr_IS_TRUEP
01406 )
01407 {
01408 paExpr_aExpr_IS_TRUEP->m_paExpr1->acceptInterface(this);
01409 DataType lhs = m_exprValue;
01410 DataType rhs = DataType(Bool(true));
01411 doComparison(lhs, rhs, Compare(Compare::EqualsType));
01412 }
01413 void WQLProcessor::visit_aExpr_aExpr_IS_NOT_FALSEP(
01414 const aExpr_aExpr_IS_NOT_FALSEP* paExpr_aExpr_IS_NOT_FALSEP
01415 )
01416 {
01417 paExpr_aExpr_IS_NOT_FALSEP->m_paExpr1->acceptInterface(this);
01418 DataType lhs = m_exprValue;
01419 DataType rhs = DataType(Bool(false));
01420 doComparison(lhs, rhs, Compare(Compare::NotEqualsType));
01421 }
01422 void WQLProcessor::visit_aExpr_aExpr_IS_FALSEP(
01423 const aExpr_aExpr_IS_FALSEP* paExpr_aExpr_IS_FALSEP
01424 )
01425 {
01426 paExpr_aExpr_IS_FALSEP->m_paExpr1->acceptInterface(this);
01427 DataType lhs = m_exprValue;
01428 DataType rhs = DataType(Bool(false));
01429 doComparison(lhs, rhs, Compare(Compare::EqualsType));
01430 }
01431 void WQLProcessor::visit_aExpr_aExpr_IS_NOT_TRUEP(
01432 const aExpr_aExpr_IS_NOT_TRUEP* paExpr_aExpr_IS_NOT_TRUEP
01433 )
01434 {
01435 paExpr_aExpr_IS_NOT_TRUEP->m_paExpr1->acceptInterface(this);
01436 DataType lhs = m_exprValue;
01437 DataType rhs = DataType(Bool(true));
01438 doComparison(lhs, rhs, Compare(Compare::NotEqualsType));
01439 }
01440 bool WQLProcessor::instanceIsDerivedFrom(const CIMInstance& inst,
01441 const String& className)
01442 {
01443 return classIsDerivedFrom(inst.getClassName(), className);
01444 }
01445 bool WQLProcessor::classIsDerivedFrom(const String& cls,
01446 const String& className)
01447 {
01448 CIMName curClassName = cls;
01449 while (curClassName != CIMName())
01450 {
01451 if (curClassName == className)
01452 {
01453 return true;
01454 }
01455
01456 CIMClass cls2 = m_hdl->getClass(m_ns, curClassName.toString());
01457 curClassName = cls2.getSuperClass();
01458 }
01459 return false;
01460 }
01461
01462 void WQLProcessor::visit_aExpr_aExpr_ISA_aExpr(
01463 const aExpr_aExpr_ISA_aExpr* paExpr_aExpr_ISA_aExpr
01464 )
01465 {
01466 paExpr_aExpr_ISA_aExpr->m_paExpr1->acceptInterface(this);
01467 DataType lhs = m_exprValue;
01468 if (lhs.type != DataType::ColumnNameType)
01469 {
01470 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Invalid first parameter type for ISA (should be a property name)");
01471 }
01472 String propName = lhs.str;
01473 paExpr_aExpr_ISA_aExpr->m_paExpr3->acceptInterface(this);
01474 DataType rhs = m_exprValue;
01475 if (rhs.type != DataType::StringType && rhs.type != DataType::ColumnNameType)
01476 {
01477 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Invalid second parameter type for ISA (should be a string or class name)");
01478 }
01479 String className = rhs.str;
01480 CIMInstanceArray newInstances;
01481 if (m_isSchemaQuery)
01482 {
01483 OW_WQL_LOG_DEBUG("Handling schema query.");
01484
01485 if (lhs.str.equalsIgnoreCase("__This"))
01486 {
01487 OW_WQL_LOG_DEBUG(Format("Found %1", lhs.str));
01488 if (rhs.type == DataType::StringType)
01489 {
01490 String nameSpace= m_ns;
01491 OW_WQL_LOG_DEBUG(Format("namespace: %1 , class name: %2", nameSpace, className));
01492
01493 CIMInstance rhsClass= embedClassInInstance(m_hdl->getClass(nameSpace, className));
01494 OW_WQL_LOG_DEBUG(Format("Found class: %1", rhsClass.toString()));
01495 newInstances.push_back(rhsClass);
01496
01497 ClassesEmbeddedInInstancesResultHandler result(newInstances);
01498 OW_WQL_LOG_DEBUG(Format("About to call enumClass(%1, %2, result, E_DEEP)", nameSpace, className));
01499 m_hdl->enumClass(nameSpace, className, result, E_DEEP);
01500 OW_WQL_LOG_DEBUG(Format("Enumerated classes: %1", debugDump(newInstances)));
01501 }
01502 else
01503 {
01504 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Schema query must use string for rhs of ISA.");
01505 }
01506 }
01507 else
01508 {
01509 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Schema query must use __This with ISA.");
01510 }
01511 }
01512 else
01513 {
01514 for (size_t i = 0; i < m_instances.size(); ++i)
01515 {
01516 CIMInstance ci = m_instances[i];
01517 if (ci)
01518 {
01519 CIMProperty cp = ci.getProperty(propName);
01520 if (cp)
01521 {
01522 CIMValue cv = cp.getValue();
01523 if (cv)
01524 {
01525 int valType = cv.getType();
01526 if (valType == CIMDataType::EMBEDDEDINSTANCE)
01527 {
01528 CIMInstance embeddedinst(CIMNULL);
01529 cv.get(embeddedinst);
01530 if (instanceIsDerivedFrom(embeddedinst, className))
01531 {
01532 newInstances.push_back(ci);
01533 }
01534 }
01535 else if (valType == CIMDataType::EMBEDDEDCLASS)
01536 {
01537 CIMClass embeddedcls(CIMNULL);
01538 cv.get(embeddedcls);
01539 if (classIsDerivedFrom(embeddedcls.getName(), className))
01540 {
01541 newInstances.push_back(ci);
01542 }
01543 }
01544 }
01545 }
01546 }
01547 }
01548 }
01549 m_exprValue = DataType(newInstances);
01550 }
01551 void WQLProcessor::visit_aExpr_rowExpr(
01552 const aExpr_rowExpr* paExpr_rowExpr
01553 )
01554 {
01555 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01556 paExpr_rowExpr->m_prowExpr1->acceptInterface(this);
01557 }
01558 void WQLProcessor::visit_bExpr_cExpr(
01559 const bExpr_cExpr* pbExpr_cExpr
01560 )
01561 {
01562 pbExpr_cExpr->m_pcExpr1->acceptInterface(this);
01563 }
01564 void WQLProcessor::visit_bExpr_PLUS_bExpr(
01565 const bExpr_PLUS_bExpr* pbExpr_PLUS_bExpr
01566 )
01567 {
01568 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01569 pbExpr_PLUS_bExpr->m_pbExpr2->acceptInterface(this);
01570 }
01571 void WQLProcessor::visit_bExpr_MINUS_bExpr(
01572 const bExpr_MINUS_bExpr* pbExpr_MINUS_bExpr
01573 )
01574 {
01575 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01576 pbExpr_MINUS_bExpr->m_pbExpr2->acceptInterface(this);
01577 }
01578 void WQLProcessor::visit_bExpr_BITINVERT_bExpr(
01579 const bExpr_BITINVERT_bExpr* pbExpr_BITINVERT_bExpr
01580 )
01581 {
01582 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01583 pbExpr_BITINVERT_bExpr->m_pbExpr2->acceptInterface(this);
01584 }
01585 void WQLProcessor::visit_bExpr_bExpr_PLUS_bExpr(
01586 const bExpr_bExpr_PLUS_bExpr* pbExpr_bExpr_PLUS_bExpr
01587 )
01588 {
01589 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01590 pbExpr_bExpr_PLUS_bExpr->m_pbExpr1->acceptInterface(this);
01591 pbExpr_bExpr_PLUS_bExpr->m_pbExpr3->acceptInterface(this);
01592 }
01593 void WQLProcessor::visit_bExpr_bExpr_MINUS_bExpr(
01594 const bExpr_bExpr_MINUS_bExpr* pbExpr_bExpr_MINUS_bExpr
01595 )
01596 {
01597 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01598 pbExpr_bExpr_MINUS_bExpr->m_pbExpr1->acceptInterface(this);
01599 pbExpr_bExpr_MINUS_bExpr->m_pbExpr3->acceptInterface(this);
01600 }
01601 void WQLProcessor::visit_bExpr_bExpr_ASTERISK_bExpr(
01602 const bExpr_bExpr_ASTERISK_bExpr* pbExpr_bExpr_ASTERISK_bExpr
01603 )
01604 {
01605 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01606 pbExpr_bExpr_ASTERISK_bExpr->m_pbExpr1->acceptInterface(this);
01607 pbExpr_bExpr_ASTERISK_bExpr->m_pbExpr3->acceptInterface(this);
01608 }
01609 void WQLProcessor::visit_bExpr_bExpr_SOLIDUS_bExpr(
01610 const bExpr_bExpr_SOLIDUS_bExpr* pbExpr_bExpr_SOLIDUS_bExpr
01611 )
01612 {
01613 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01614 pbExpr_bExpr_SOLIDUS_bExpr->m_pbExpr1->acceptInterface(this);
01615 pbExpr_bExpr_SOLIDUS_bExpr->m_pbExpr3->acceptInterface(this);
01616 }
01617 void WQLProcessor::visit_bExpr_bExpr_PERCENT_bExpr(
01618 const bExpr_bExpr_PERCENT_bExpr* pbExpr_bExpr_PERCENT_bExpr
01619 )
01620 {
01621 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01622 pbExpr_bExpr_PERCENT_bExpr->m_pbExpr1->acceptInterface(this);
01623 pbExpr_bExpr_PERCENT_bExpr->m_pbExpr3->acceptInterface(this);
01624 }
01625 void WQLProcessor::visit_bExpr_bExpr_BITAND_bExpr(
01626 const bExpr_bExpr_BITAND_bExpr* pbExpr_bExpr_BITAND_bExpr
01627 )
01628 {
01629 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01630 pbExpr_bExpr_BITAND_bExpr->m_pbExpr1->acceptInterface(this);
01631 pbExpr_bExpr_BITAND_bExpr->m_pbExpr3->acceptInterface(this);
01632 }
01633 void WQLProcessor::visit_bExpr_bExpr_BITOR_bExpr(
01634 const bExpr_bExpr_BITOR_bExpr* pbExpr_bExpr_BITOR_bExpr
01635 )
01636 {
01637 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01638 pbExpr_bExpr_BITOR_bExpr->m_pbExpr1->acceptInterface(this);
01639 pbExpr_bExpr_BITOR_bExpr->m_pbExpr3->acceptInterface(this);
01640 }
01641 void WQLProcessor::visit_bExpr_bExpr_BITSHIFTLEFT_bExpr(
01642 const bExpr_bExpr_BITSHIFTLEFT_bExpr* pbExpr_bExpr_BITSHIFTLEFT_bExpr
01643 )
01644 {
01645 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01646 pbExpr_bExpr_BITSHIFTLEFT_bExpr->m_pbExpr1->acceptInterface(this);
01647 pbExpr_bExpr_BITSHIFTLEFT_bExpr->m_pbExpr3->acceptInterface(this);
01648 }
01649 void WQLProcessor::visit_bExpr_bExpr_BITSHIFTRIGHT_bExpr(
01650 const bExpr_bExpr_BITSHIFTRIGHT_bExpr* pbExpr_bExpr_BITSHIFTRIGHT_bExpr
01651 )
01652 {
01653 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01654 pbExpr_bExpr_BITSHIFTRIGHT_bExpr->m_pbExpr1->acceptInterface(this);
01655 pbExpr_bExpr_BITSHIFTRIGHT_bExpr->m_pbExpr3->acceptInterface(this);
01656 }
01657 void WQLProcessor::visit_bExpr_bExpr_LESSTHAN_bExpr(
01658 const bExpr_bExpr_LESSTHAN_bExpr* pbExpr_bExpr_LESSTHAN_bExpr
01659 )
01660 {
01661 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01662 pbExpr_bExpr_LESSTHAN_bExpr->m_pbExpr1->acceptInterface(this);
01663 pbExpr_bExpr_LESSTHAN_bExpr->m_pbExpr3->acceptInterface(this);
01664 }
01665 void WQLProcessor::visit_bExpr_bExpr_LESSTHANOREQUALS_bExpr(
01666 const bExpr_bExpr_LESSTHANOREQUALS_bExpr* pbExpr_bExpr_LESSTHANOREQUALS_bExpr
01667 )
01668 {
01669 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01670 pbExpr_bExpr_LESSTHANOREQUALS_bExpr->m_pbExpr1->acceptInterface(this);
01671 pbExpr_bExpr_LESSTHANOREQUALS_bExpr->m_pbExpr3->acceptInterface(this);
01672 }
01673 void WQLProcessor::visit_bExpr_bExpr_GREATERTHAN_bExpr(
01674 const bExpr_bExpr_GREATERTHAN_bExpr* pbExpr_bExpr_GREATERTHAN_bExpr
01675 )
01676 {
01677 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01678 pbExpr_bExpr_GREATERTHAN_bExpr->m_pbExpr1->acceptInterface(this);
01679 pbExpr_bExpr_GREATERTHAN_bExpr->m_pbExpr3->acceptInterface(this);
01680 }
01681 void WQLProcessor::visit_bExpr_bExpr_GREATERTHANOREQUALS_bExpr(
01682 const bExpr_bExpr_GREATERTHANOREQUALS_bExpr* pbExpr_bExpr_GREATERTHANOREQUALS_bExpr
01683 )
01684 {
01685 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01686 pbExpr_bExpr_GREATERTHANOREQUALS_bExpr->m_pbExpr1->acceptInterface(this);
01687 pbExpr_bExpr_GREATERTHANOREQUALS_bExpr->m_pbExpr3->acceptInterface(this);
01688 }
01689 void WQLProcessor::visit_bExpr_bExpr_EQUALS_bExpr(
01690 const bExpr_bExpr_EQUALS_bExpr* pbExpr_bExpr_EQUALS_bExpr
01691 )
01692 {
01693 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01694 pbExpr_bExpr_EQUALS_bExpr->m_pbExpr1->acceptInterface(this);
01695 pbExpr_bExpr_EQUALS_bExpr->m_pbExpr3->acceptInterface(this);
01696 }
01697 void WQLProcessor::visit_bExpr_bExpr_NOTEQUALS_bExpr(
01698 const bExpr_bExpr_NOTEQUALS_bExpr* pbExpr_bExpr_NOTEQUALS_bExpr
01699 )
01700 {
01701 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01702 pbExpr_bExpr_NOTEQUALS_bExpr->m_pbExpr1->acceptInterface(this);
01703 pbExpr_bExpr_NOTEQUALS_bExpr->m_pbExpr3->acceptInterface(this);
01704 }
01705 void WQLProcessor::visit_bExpr_bExpr_CONCATENATION_bExpr(
01706 const bExpr_bExpr_CONCATENATION_bExpr* pbExpr_bExpr_CONCATENATION_bExpr
01707 )
01708 {
01709 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01710 pbExpr_bExpr_CONCATENATION_bExpr->m_pbExpr1->acceptInterface(this);
01711 pbExpr_bExpr_CONCATENATION_bExpr->m_pbExpr3->acceptInterface(this);
01712 }
01713 void WQLProcessor::visit_cExpr_attr(
01714 const cExpr_attr* pcExpr_attr
01715 )
01716 {
01717 pcExpr_attr->m_pattr1->acceptInterface(this);
01718 }
01719 void WQLProcessor::visit_cExpr_strColId_optIndirection(
01720 const cExpr_strColId_optIndirection* pcExpr_strColId_optIndirection
01721 )
01722 {
01723 m_exprValue = DataType(*pcExpr_strColId_optIndirection->m_pstrColId1, DataType::ColumnNameType);
01724
01725 if (pcExpr_strColId_optIndirection->m_poptIndirection2)
01726 {
01727 pcExpr_strColId_optIndirection->m_poptIndirection2->acceptInterface(this);
01728 }
01729 }
01730 void WQLProcessor::visit_cExpr_aExprConst(
01731 const cExpr_aExprConst* pcExpr_aExprConst
01732 )
01733 {
01734 pcExpr_aExprConst->m_paExprConst1->acceptInterface(this);
01735 }
01736 void WQLProcessor::visit_cExpr_LEFTPAREN_aExpr_RIGHTPAREN(
01737 const cExpr_LEFTPAREN_aExpr_RIGHTPAREN* pcExpr_LEFTPAREN_aExpr_RIGHTPAREN
01738 )
01739 {
01740 pcExpr_LEFTPAREN_aExpr_RIGHTPAREN->m_paExpr2->acceptInterface(this);
01741 }
01742 void WQLProcessor::visit_cExpr_strFuncName_LEFTPAREN_RIGHTPAREN(
01743 const cExpr_strFuncName_LEFTPAREN_RIGHTPAREN* pcExpr_strFuncName_LEFTPAREN_RIGHTPAREN
01744 )
01745 {
01746 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01747 }
01748 void WQLProcessor::visit_cExpr_strFuncName_LEFTPAREN_exprSeq_RIGHTPAREN(
01749 const cExpr_strFuncName_LEFTPAREN_exprSeq_RIGHTPAREN* pcExpr_strFuncName_LEFTPAREN_exprSeq_RIGHTPAREN
01750 )
01751 {
01752 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01753 pcExpr_strFuncName_LEFTPAREN_exprSeq_RIGHTPAREN->m_pexprSeq3->acceptInterface(this);
01754 }
01755 void WQLProcessor::visit_cExpr_strFuncName_LEFTPAREN_ALL_exprSeq_RIGHTPAREN(
01756 const cExpr_strFuncName_LEFTPAREN_ALL_exprSeq_RIGHTPAREN* pcExpr_strFuncName_LEFTPAREN_ALL_exprSeq_RIGHTPAREN
01757 )
01758 {
01759 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01760 pcExpr_strFuncName_LEFTPAREN_ALL_exprSeq_RIGHTPAREN->m_pexprSeq4->acceptInterface(this);
01761 }
01762 void WQLProcessor::visit_cExpr_strFuncName_LEFTPAREN_DISTINCT_exprSeq_RIGHTPAREN(
01763 const cExpr_strFuncName_LEFTPAREN_DISTINCT_exprSeq_RIGHTPAREN* pcExpr_strFuncName_LEFTPAREN_DISTINCT_exprSeq_RIGHTPAREN
01764 )
01765 {
01766 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01767 pcExpr_strFuncName_LEFTPAREN_DISTINCT_exprSeq_RIGHTPAREN->m_pexprSeq4->acceptInterface(this);
01768 }
01769 void WQLProcessor::visit_cExpr_strFuncName_LEFTPAREN_ASTERISK_RIGHTPAREN(
01770 const cExpr_strFuncName_LEFTPAREN_ASTERISK_RIGHTPAREN* pcExpr_strFuncName_LEFTPAREN_ASTERISK_RIGHTPAREN
01771 )
01772 {
01773 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01774 }
01775 void WQLProcessor::visit_cExpr_CURRENTDATE(
01776 const cExpr_CURRENTDATE* pcExpr_CURRENTDATE
01777 )
01778 {
01779 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01780 }
01781 void WQLProcessor::visit_cExpr_CURRENTTIME(
01782 const cExpr_CURRENTTIME* pcExpr_CURRENTTIME
01783 )
01784 {
01785 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01786 }
01787 void WQLProcessor::visit_cExpr_CURRENTTIME_LEFTPAREN_ICONST_RIGHTPAREN(
01788 const cExpr_CURRENTTIME_LEFTPAREN_ICONST_RIGHTPAREN* pcExpr_CURRENTTIME_LEFTPAREN_ICONST_RIGHTPAREN
01789 )
01790 {
01791 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01792 }
01793 void WQLProcessor::visit_cExpr_CURRENTTIMESTAMP(
01794 const cExpr_CURRENTTIMESTAMP* pcExpr_CURRENTTIMESTAMP
01795 )
01796 {
01797 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01798 }
01799 void WQLProcessor::visit_cExpr_CURRENTTIMESTAMP_LEFTPAREN_ICONST_RIGHTPAREN(
01800 const cExpr_CURRENTTIMESTAMP_LEFTPAREN_ICONST_RIGHTPAREN* pcExpr_CURRENTTIMESTAMP_LEFTPAREN_ICONST_RIGHTPAREN
01801 )
01802 {
01803 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01804 }
01805 void WQLProcessor::visit_cExpr_CURRENTUSER(
01806 const cExpr_CURRENTUSER* pcExpr_CURRENTUSER
01807 )
01808 {
01809 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01810 }
01811 void WQLProcessor::visit_cExpr_SESSIONUSER(
01812 const cExpr_SESSIONUSER* pcExpr_SESSIONUSER
01813 )
01814 {
01815 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01816 }
01817 void WQLProcessor::visit_cExpr_USER(
01818 const cExpr_USER* pcExpr_USER
01819 )
01820 {
01821 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01822 }
01823 void WQLProcessor::visit_cExpr_EXTRACT_LEFTPAREN_optExtract_RIGHTPAREN(
01824 const cExpr_EXTRACT_LEFTPAREN_optExtract_RIGHTPAREN* pcExpr_EXTRACT_LEFTPAREN_optExtract_RIGHTPAREN
01825 )
01826 {
01827 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01828 if (pcExpr_EXTRACT_LEFTPAREN_optExtract_RIGHTPAREN->m_poptExtract3)
01829 {
01830 pcExpr_EXTRACT_LEFTPAREN_optExtract_RIGHTPAREN->m_poptExtract3->acceptInterface(this);
01831 }
01832 }
01833 void WQLProcessor::visit_cExpr_POSITION_LEFTPAREN_positionExpr_RIGHTPAREN(
01834 const cExpr_POSITION_LEFTPAREN_positionExpr_RIGHTPAREN* pcExpr_POSITION_LEFTPAREN_positionExpr_RIGHTPAREN
01835 )
01836 {
01837 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01838 pcExpr_POSITION_LEFTPAREN_positionExpr_RIGHTPAREN->m_ppositionExpr3->acceptInterface(this);
01839 }
01840 void WQLProcessor::visit_cExpr_SUBSTRING_LEFTPAREN_optSubstrExpr_RIGHTPAREN(
01841 const cExpr_SUBSTRING_LEFTPAREN_optSubstrExpr_RIGHTPAREN* pcExpr_SUBSTRING_LEFTPAREN_optSubstrExpr_RIGHTPAREN
01842 )
01843 {
01844 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01845 if (pcExpr_SUBSTRING_LEFTPAREN_optSubstrExpr_RIGHTPAREN->m_poptSubstrExpr3)
01846 {
01847 pcExpr_SUBSTRING_LEFTPAREN_optSubstrExpr_RIGHTPAREN->m_poptSubstrExpr3->acceptInterface(this);
01848 }
01849 }
01850 void WQLProcessor::visit_cExpr_TRIM_LEFTPAREN_LEADING_trimExpr_RIGHTPAREN(
01851 const cExpr_TRIM_LEFTPAREN_LEADING_trimExpr_RIGHTPAREN* pcExpr_TRIM_LEFTPAREN_LEADING_trimExpr_RIGHTPAREN
01852 )
01853 {
01854 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01855 pcExpr_TRIM_LEFTPAREN_LEADING_trimExpr_RIGHTPAREN->m_ptrimExpr4->acceptInterface(this);
01856 }
01857 void WQLProcessor::visit_cExpr_TRIM_LEFTPAREN_TRAILING_trimExpr_RIGHTPAREN(
01858 const cExpr_TRIM_LEFTPAREN_TRAILING_trimExpr_RIGHTPAREN* pcExpr_TRIM_LEFTPAREN_TRAILING_trimExpr_RIGHTPAREN
01859 )
01860 {
01861 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01862 pcExpr_TRIM_LEFTPAREN_TRAILING_trimExpr_RIGHTPAREN->m_ptrimExpr4->acceptInterface(this);
01863 }
01864 void WQLProcessor::visit_cExpr_TRIM_LEFTPAREN_trimExpr_RIGHTPAREN(
01865 const cExpr_TRIM_LEFTPAREN_trimExpr_RIGHTPAREN* pcExpr_TRIM_LEFTPAREN_trimExpr_RIGHTPAREN
01866 )
01867 {
01868 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01869 pcExpr_TRIM_LEFTPAREN_trimExpr_RIGHTPAREN->m_ptrimExpr3->acceptInterface(this);
01870 }
01871 void WQLProcessor::visit_optIndirection_empty(
01872 const optIndirection_empty* poptIndirection_empty
01873 )
01874 {
01875 }
01876 void WQLProcessor::visit_optIndirection_optIndirection_LEFTBRACKET_aExpr_RIGHTBRACKET(
01877 const optIndirection_optIndirection_LEFTBRACKET_aExpr_RIGHTBRACKET* poptIndirection_optIndirection_LEFTBRACKET_aExpr_RIGHTBRACKET
01878 )
01879 {
01880 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01881 if (poptIndirection_optIndirection_LEFTBRACKET_aExpr_RIGHTBRACKET->m_poptIndirection1)
01882 {
01883 poptIndirection_optIndirection_LEFTBRACKET_aExpr_RIGHTBRACKET->m_poptIndirection1->acceptInterface(this);
01884 }
01885 poptIndirection_optIndirection_LEFTBRACKET_aExpr_RIGHTBRACKET->m_paExpr3->acceptInterface(this);
01886 }
01887 void WQLProcessor::visit_optIndirection_optIndirection_LEFTBRACKET_aExpr_COLON_aExpr_RIGHTBRACKET(
01888 const optIndirection_optIndirection_LEFTBRACKET_aExpr_COLON_aExpr_RIGHTBRACKET* poptIndirection_optIndirection_LEFTBRACKET_aExpr_COLON_aExpr_RIGHTBRACKET
01889 )
01890 {
01891 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01892 if (poptIndirection_optIndirection_LEFTBRACKET_aExpr_COLON_aExpr_RIGHTBRACKET->m_poptIndirection1)
01893 {
01894 poptIndirection_optIndirection_LEFTBRACKET_aExpr_COLON_aExpr_RIGHTBRACKET->m_poptIndirection1->acceptInterface(this);
01895 }
01896 poptIndirection_optIndirection_LEFTBRACKET_aExpr_COLON_aExpr_RIGHTBRACKET->m_paExpr3->acceptInterface(this);
01897 poptIndirection_optIndirection_LEFTBRACKET_aExpr_COLON_aExpr_RIGHTBRACKET->m_paExpr5->acceptInterface(this);
01898 }
01899 void WQLProcessor::visit_optExtract_empty(
01900 const optExtract_empty* poptExtract_empty
01901 )
01902 {
01903 }
01904 void WQLProcessor::visit_optExtract_strExtractArg_FROM_aExpr(
01905 const optExtract_strExtractArg_FROM_aExpr* poptExtract_strExtractArg_FROM_aExpr
01906 )
01907 {
01908 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01909 poptExtract_strExtractArg_FROM_aExpr->m_paExpr3->acceptInterface(this);
01910 }
01911 void WQLProcessor::visit_positionExpr_bExpr_IN_bExpr(
01912 const positionExpr_bExpr_IN_bExpr* ppositionExpr_bExpr_IN_bExpr
01913 )
01914 {
01915 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01916 ppositionExpr_bExpr_IN_bExpr->m_pbExpr1->acceptInterface(this);
01917 ppositionExpr_bExpr_IN_bExpr->m_pbExpr3->acceptInterface(this);
01918 }
01919 void WQLProcessor::visit_positionExpr_empty(
01920 const positionExpr_empty* ppositionExpr_empty
01921 )
01922 {
01923 }
01924 void WQLProcessor::visit_optSubstrExpr_empty(
01925 const optSubstrExpr_empty* poptSubstrExpr_empty
01926 )
01927 {
01928 }
01929 void WQLProcessor::visit_optSubstrExpr_aExpr_substrFrom_substrFor(
01930 const optSubstrExpr_aExpr_substrFrom_substrFor* poptSubstrExpr_aExpr_substrFrom_substrFor
01931 )
01932 {
01933 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01934 poptSubstrExpr_aExpr_substrFrom_substrFor->m_paExpr1->acceptInterface(this);
01935 poptSubstrExpr_aExpr_substrFrom_substrFor->m_psubstrFrom2->acceptInterface(this);
01936 poptSubstrExpr_aExpr_substrFrom_substrFor->m_psubstrFor3->acceptInterface(this);
01937 }
01938 void WQLProcessor::visit_optSubstrExpr_aExpr_substrFor_substrFrom(
01939 const optSubstrExpr_aExpr_substrFor_substrFrom* poptSubstrExpr_aExpr_substrFor_substrFrom
01940 )
01941 {
01942 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01943 poptSubstrExpr_aExpr_substrFor_substrFrom->m_paExpr1->acceptInterface(this);
01944 poptSubstrExpr_aExpr_substrFor_substrFrom->m_psubstrFor2->acceptInterface(this);
01945 poptSubstrExpr_aExpr_substrFor_substrFrom->m_psubstrFrom3->acceptInterface(this);
01946 }
01947 void WQLProcessor::visit_optSubstrExpr_aExpr_substrFrom(
01948 const optSubstrExpr_aExpr_substrFrom* poptSubstrExpr_aExpr_substrFrom
01949 )
01950 {
01951 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01952 poptSubstrExpr_aExpr_substrFrom->m_paExpr1->acceptInterface(this);
01953 poptSubstrExpr_aExpr_substrFrom->m_psubstrFrom2->acceptInterface(this);
01954 }
01955 void WQLProcessor::visit_optSubstrExpr_aExpr_substrFor(
01956 const optSubstrExpr_aExpr_substrFor* poptSubstrExpr_aExpr_substrFor
01957 )
01958 {
01959 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01960 poptSubstrExpr_aExpr_substrFor->m_paExpr1->acceptInterface(this);
01961 poptSubstrExpr_aExpr_substrFor->m_psubstrFor2->acceptInterface(this);
01962 }
01963 void WQLProcessor::visit_optSubstrExpr_exprSeq(
01964 const optSubstrExpr_exprSeq* poptSubstrExpr_exprSeq
01965 )
01966 {
01967 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01968 poptSubstrExpr_exprSeq->m_pexprSeq1->acceptInterface(this);
01969 }
01970 void WQLProcessor::visit_substrFrom(
01971 const substrFrom* psubstrFrom
01972 )
01973 {
01974 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01975 psubstrFrom->m_paExpr2->acceptInterface(this);
01976 }
01977 void WQLProcessor::visit_substrFor(
01978 const substrFor* psubstrFor
01979 )
01980 {
01981 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01982 psubstrFor->m_paExpr2->acceptInterface(this);
01983 }
01984 void WQLProcessor::visit_trimExpr_aExpr_FROM_exprSeq(
01985 const trimExpr_aExpr_FROM_exprSeq* ptrimExpr_aExpr_FROM_exprSeq
01986 )
01987 {
01988 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01989 ptrimExpr_aExpr_FROM_exprSeq->m_paExpr1->acceptInterface(this);
01990 ptrimExpr_aExpr_FROM_exprSeq->m_pexprSeq3->acceptInterface(this);
01991 }
01992 void WQLProcessor::visit_trimExpr_FROM_exprSeq(
01993 const trimExpr_FROM_exprSeq* ptrimExpr_FROM_exprSeq
01994 )
01995 {
01996 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
01997 ptrimExpr_FROM_exprSeq->m_pexprSeq2->acceptInterface(this);
01998 }
01999 void WQLProcessor::visit_trimExpr_exprSeq(
02000 const trimExpr_exprSeq* ptrimExpr_exprSeq
02001 )
02002 {
02003 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
02004 ptrimExpr_exprSeq->m_pexprSeq1->acceptInterface(this);
02005 }
02006 void WQLProcessor::visit_attr(
02007 const attr* pattr
02008 )
02009 {
02010 m_exprValue = DataType(*pattr->m_pstrRelationName1, DataType::ColumnNameType);
02011 pattr->m_pattrs3->acceptInterface(this);
02012
02013 if (pattr->m_poptIndirection4)
02014 {
02015 pattr->m_poptIndirection4->acceptInterface(this);
02016 }
02017 }
02018 void WQLProcessor::visit_attrs_strAttrName(
02019 const attrs_strAttrName* pattrs_strAttrName
02020 )
02021 {
02022 m_exprValue = DataType(m_exprValue.str + "." + *pattrs_strAttrName->m_pstrAttrName1, DataType::ColumnNameType);
02023 }
02024 void WQLProcessor::visit_attrs_attrs_PERIOD_strAttrName(
02025 const attrs_attrs_PERIOD_strAttrName* pattrs_attrs_PERIOD_strAttrName
02026 )
02027 {
02028 pattrs_attrs_PERIOD_strAttrName->m_pattrs1->acceptInterface(this);
02029 m_exprValue = DataType(m_exprValue.str + "." + *pattrs_attrs_PERIOD_strAttrName->m_pstrAttrName3, DataType::ColumnNameType);
02030 }
02031 void WQLProcessor::visit_attrs_attrs_PERIOD_ASTERISK(
02032 const attrs_attrs_PERIOD_ASTERISK* pattrs_attrs_PERIOD_ASTERISK
02033 )
02034 {
02035 pattrs_attrs_PERIOD_ASTERISK->m_pattrs1->acceptInterface(this);
02036 m_exprValue = DataType(m_exprValue.str + ".*", DataType::ColumnNameType);
02037 }
02038 void WQLProcessor::visit_targetEl_aExpr_AS_strColLabel(
02039 const targetEl_aExpr_AS_strColLabel* ptargetEl_aExpr_AS_strColLabel
02040 )
02041 {
02042 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
02043 ptargetEl_aExpr_AS_strColLabel->m_paExpr1->acceptInterface(this);
02044 }
02045 void WQLProcessor::visit_targetEl_aExpr(
02046 const targetEl_aExpr* ptargetEl_aExpr
02047 )
02048 {
02049 ptargetEl_aExpr->m_paExpr1->acceptInterface(this);
02050 if (m_doingSelect)
02051 {
02052 if (m_isSchemaQuery)
02053 {
02054 OW_WQL_LOG_DEBUG("Doing schema query.");
02055 }
02056 else
02057 {
02058 if (m_exprValue.type != DataType::ColumnNameType)
02059 {
02060 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "FROM clause properties must be property names");
02061 }
02062 m_propertyArray.push_back(m_exprValue.str);
02063 }
02064 }
02065
02066
02067
02068
02069 }
02070 void WQLProcessor::visit_targetEl_strRelationName_PERIOD_ASTERISK(
02071 const targetEl_strRelationName_PERIOD_ASTERISK* ptargetEl_strRelationName_PERIOD_ASTERISK
02072 )
02073 {
02074 m_propertyArray.push_back(*ptargetEl_strRelationName_PERIOD_ASTERISK->m_pstrRelationName1 + ".*");
02075 }
02076 void WQLProcessor::visit_targetEl_ASTERISK(
02077 const targetEl_ASTERISK* ptargetEl_ASTERISK
02078 )
02079 {
02080 m_propertyArray.push_back("*");
02081 }
02082 void WQLProcessor::visit_updateTargetEl(
02083 const updateTargetEl* pupdateTargetEl
02084 )
02085 {
02086 m_propertyArray.push_back(*pupdateTargetEl->m_pstrColId1);
02087
02088 if (pupdateTargetEl->m_poptIndirection2)
02089 {
02090 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, "Internal Parser Error: unimplemented functionality");
02091 pupdateTargetEl->m_poptIndirection2->acceptInterface(this);
02092 }
02093 pupdateTargetEl->m_paExpr4->acceptInterface(this);
02094 m_valueArray.push_back(m_exprValue);
02095 }
02096 void WQLProcessor::visit_aExprConst_ICONST(
02097 const aExprConst_ICONST* paExprConst_ICONST
02098 )
02099 {
02100 try
02101 {
02102 m_exprValue = DataType(paExprConst_ICONST->m_pICONST1->toInt64());
02103 }
02104 catch (const StringConversionException& e)
02105 {
02106 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, e.getMessage());
02107 }
02108 }
02109 void WQLProcessor::visit_aExprConst_FCONST(
02110 const aExprConst_FCONST* paExprConst_FCONST
02111 )
02112 {
02113 try
02114 {
02115 m_exprValue = DataType(paExprConst_FCONST->m_pFCONST1->toReal64());
02116 }
02117 catch (const StringConversionException& e)
02118 {
02119 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY, e.getMessage());
02120 }
02121 }
02122 void WQLProcessor::visit_aExprConst_SCONST(
02123 const aExprConst_SCONST* paExprConst_SCONST
02124 )
02125 {
02126 m_exprValue = DataType(WQLRemoveStringEscapes(*paExprConst_SCONST->m_pSCONST1), DataType::StringType);
02127 }
02128 void WQLProcessor::visit_aExprConst_BITCONST(
02129 const aExprConst_BITCONST* paExprConst_BITCONST
02130 )
02131 {
02132 char* endptr;
02133 const char* p = paExprConst_BITCONST->m_pBITCONST1->c_str();
02134 errno = 0;
02135 Int64 val = String::strtoll(p, &endptr, 2);
02136 if (*endptr != '\0' || errno == ERANGE)
02137 {
02138 OW_WQL_THROWCIMMSG( CIMException::INVALID_QUERY, Format( "Bad bitstring integer input '%1'",
02139 p).c_str() );
02140 }
02141
02142 m_exprValue = DataType(val);
02143 }
02144 void WQLProcessor::visit_aExprConst_HEXCONST(
02145 const aExprConst_HEXCONST* paExprConst_HEXCONST
02146 )
02147 {
02148 char* endptr;
02149 const char* p = paExprConst_HEXCONST->m_pHEXCONST1->c_str();
02150 errno = 0;
02151 Int64 val = String::strtoll(p, &endptr, 16);
02152 if (*endptr != '\0' || errno == ERANGE)
02153 {
02154 OW_WQL_THROWCIMMSG( CIMException::INVALID_QUERY, Format( "Bad bitstring integer input '%1'",
02155 p).c_str() );
02156 }
02157
02158 m_exprValue = DataType(val);
02159 }
02160 void WQLProcessor::visit_aExprConst_TRUEP(
02161 const aExprConst_TRUEP* paExprConst_TRUEP
02162 )
02163 {
02164 m_exprValue = DataType(Bool(true));
02165 }
02166 void WQLProcessor::visit_aExprConst_FALSEP(
02167 const aExprConst_FALSEP* paExprConst_FALSEP
02168 )
02169 {
02170 m_exprValue = DataType(Bool(false));
02171 }
02172 void WQLProcessor::visit_aExprConst_NULLP(
02173 const aExprConst_NULLP* paExprConst_NULLP
02174 )
02175 {
02176 m_exprValue = DataType(DataType::NullType);
02177 }
02178 CIMInstanceArray
02179 WQLProcessor::filterInstancesOnPropertyValue(const String& propName, const CIMValue& val, const Compare& compare)
02180 {
02181 OW_WQL_LOG_DEBUG(Format("WQLProcessor::filterInstancesOnPropertyValue\n"
02182 "\tFiltering m_instances on property: %1 %2 %3", propName, compare.c_str(), val ? val.toString() : "NULL" ));
02183 CIMInstanceArray rval;
02184 for (size_t i = 0; i < m_instances.size(); ++i)
02185 {
02186 CIMInstance ci = m_instances[i];
02187 if (ci)
02188 {
02189 if (propName.equalsIgnoreCase("__Path"))
02190 {
02191 if (val.getType() == CIMDataType::STRING)
02192 {
02193 CIMObjectPath valCop = CIMObjectPath::parse(
02194 CIMObjectPath::unEscape(val.toString()));
02195 valCop.setNameSpace(m_ns);
02196 CIMObjectPath instCop(m_ns, ci);
02197 if (compare(CIMValue(instCop.toString()),
02198 CIMValue(valCop.toString())))
02199 {
02200 rval.push_back(ci);
02201 }
02202
02203 }
02204 else
02205 {
02206 OW_WQL_THROWCIMMSG(CIMException::INVALID_QUERY,
02207 "The property __Path must be compared to a string");
02208 }
02209 }
02210 else
02211 {
02212 CIMProperty cp(CIMNULL);
02213 if (propName.indexOf('.') != String::npos)
02214 {
02215
02216 String curPropName;
02217 CIMInstance curci = ci;
02218 StringArray propNames = propName.tokenize(".");
02219 for (size_t i = 0; i < propNames.size(); ++i)
02220 {
02221 cp = curci.getProperty(propNames[i]);
02222 if (cp)
02223 {
02224
02225 if (i < propNames.size() - 1)
02226 {
02227 CIMValue v(cp.getValue());
02228 if (v)
02229 {
02230 if (v.getType() != CIMDataType::EMBEDDEDINSTANCE)
02231 {
02232 cp.setNull();
02233 break;
02234 }
02235 v.get(curci);
02236 }
02237 }
02238 }
02239 }
02240 }
02241 else
02242 {
02243 cp = ci.getProperty(propName);
02244 }
02245
02246 if (cp)
02247 {
02248 CIMValue cv = cp.getValue();
02249 if (cv)
02250 {
02251 int valType = cv.getType();
02252 if (valType == CIMDataType::SINT8 ||
02253 valType == CIMDataType::SINT16 ||
02254 valType == CIMDataType::SINT32 ||
02255 valType == CIMDataType::SINT64 ||
02256 valType == CIMDataType::UINT8 ||
02257 valType == CIMDataType::UINT16 ||
02258 valType == CIMDataType::UINT32
02259 )
02260 {
02261
02262 cv = CIMValueCast::castValueToDataType(cv, CIMDataType::SINT64);
02263 }
02264 else if (valType == CIMDataType::REAL32)
02265 {
02266
02267 cv = CIMValueCast::castValueToDataType(cv, CIMDataType::REAL64);
02268 }
02269 }
02270 if (compare(cv, val))
02271 {
02272 rval.push_back(ci);
02273 }
02274 }
02275 }
02276 }
02277 }
02278 OW_WQL_LOG_DEBUG(Format("WQLProcessor::filterInstancesOnPropertyValue\n"
02279 "\treturning %1 m_instances", rval.size()));
02280 return rval;
02281 }
02282 bool WQLProcessor::Equals::operator()(const CIMValue& lhs, const CIMValue& rhs) const
02283 {
02284 if (lhs && rhs)
02285 {
02286 return lhs == rhs;
02287 }
02288 else if (!lhs && !rhs)
02289 {
02290 return true;
02291 }
02292 else
02293 {
02294 return false;
02295 }
02296 }
02297 bool WQLProcessor::NotEquals::operator()(const CIMValue& lhs, const CIMValue& rhs) const
02298 {
02299 if (lhs && rhs)
02300 {
02301 return !(lhs == rhs);
02302 }
02303 if (lhs && !rhs)
02304 {
02305 return true;
02306 }
02307 else
02308 {
02309 return false;
02310 }
02311 }
02312 bool WQLProcessor::GreaterThanOrEquals::operator()(const CIMValue& lhs, const CIMValue& rhs) const
02313 {
02314 if (lhs && rhs)
02315 {
02316 return lhs >= rhs;
02317 }
02318 else
02319 {
02320 return false;
02321 }
02322 }
02323 bool WQLProcessor::LessThanOrEquals::operator()(const CIMValue& lhs, const CIMValue& rhs) const
02324 {
02325 if (lhs && rhs)
02326 {
02327 return lhs <= rhs;
02328 }
02329 else
02330 {
02331 return false;
02332 }
02333 }
02334 bool WQLProcessor::GreaterThan::operator()(const CIMValue& lhs, const CIMValue& rhs) const
02335 {
02336 if (lhs && rhs)
02337 {
02338 return lhs > rhs;
02339 }
02340 else
02341 {
02342 return false;
02343 }
02344 }
02345 bool WQLProcessor::LessThan::operator()(const CIMValue& lhs, const CIMValue& rhs) const
02346 {
02347 if (lhs && rhs)
02348 {
02349 return lhs < rhs;
02350 }
02351 else
02352 {
02353 return false;
02354 }
02355 }
02356 void WQLProcessor::populateInstances(const String& className)
02357 {
02358 m_tableRef = className;
02359 populateInstances();
02360 }
02361 namespace
02362 {
02363 class InstanceArrayBuilder : public CIMInstanceResultHandlerIFC
02364 {
02365 public:
02366 InstanceArrayBuilder(CIMInstanceArray& cia_)
02367 : cia(cia_)
02368 {}
02369 protected:
02370 virtual void doHandle(const CIMInstance &i)
02371 {
02372 cia.push_back(i);
02373 }
02374 private:
02375 CIMInstanceArray& cia;
02376 };
02377 }
02378 void WQLProcessor::populateInstances()
02379 {
02380 OW_WQL_LOG_DEBUG("");
02381 InstanceArrayBuilder handler(m_instances);
02382 m_hdl->enumInstances(m_ns, m_tableRef, handler, E_DEEP);
02383 }
02384
02385 }
02386