当前位置: 首页>>代码示例>>C++>>正文


C++ QueryData::appendQEvalClause方法代码示例

本文整理汇总了C++中QueryData::appendQEvalClause方法的典型用法代码示例。如果您正苦于以下问题:C++ QueryData::appendQEvalClause方法的具体用法?C++ QueryData::appendQEvalClause怎么用?C++ QueryData::appendQEvalClause使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QueryData的用法示例。


在下文中一共展示了QueryData::appendQEvalClause方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: validatePTClause

void QTreeValidator::validatePTClause(QueryData & queryData, PTClauseEntry * ptClausePtr, const std::vector<std::string>& synList)
{
	QEvalPTClause *evalPtClause = new QEvalPTClause();

	evalPtClause->ptType = ptClausePtr->getPatternType();

	idx_t tmpIdx = getVarArgIdx(synList, ptClausePtr->getSynonym());

	assert(ARG_IDX_NOT_FOUND != tmpIdx);
	assert(isDecArgStmtType(queryData.getVarDecType(tmpIdx)));
	
	evalPtClause->stmt = tmpIdx;

	determineVar(evalPtClause->var, evalPtClause->varArgType, ptClausePtr->getFirstParameter(), synList, true);

	if (evalPtClause->ptType == PTClauseType::PT_Assign) {
		std::string patternStr = ptClausePtr->getSecondParameter();
		if (isImplicit(patternStr)) {
			evalPtClause->pattern = "";
			evalPtClause->completeMatch = false;
		}
		else if (isDoubleQuoted(patternStr)) {
			evalPtClause->pattern = dropDoubleQuote(patternStr);
			evalPtClause->completeMatch = true;
		}
		else if (isUnderlineDoubleQuoted(patternStr)) {
			evalPtClause->pattern = dropUnderlineDoubleQuote(patternStr);
			evalPtClause->completeMatch = false;
		}
		else {
			assert(false);
		}
	}

	evalPtClause->inVarArgIdxSet.insert(evalPtClause->stmt);
	if (ArgType::DECVAR == evalPtClause->varArgType) {
		evalPtClause->inVarArgIdxSet.insert(evalPtClause->var);
	}

	queryData.appendQEvalClause(evalPtClause);
}
开发者ID:Pingxia,项目名称:CS3202_SPA,代码行数:41,代码来源:qtreevalidator.cpp

示例2: validateSTClause

void QTreeValidator::validateSTClause(QueryData & queryData, STClauseEntry * stClausePtr, const std::vector<std::string>& synList)
{
	QEvalSTClause* evalStClause = new QEvalSTClause();
	std::string firstInput = stClausePtr->getFirstParameter(), secondInput = stClausePtr->getSecondParameter();

	evalStClause->stType = stClausePtr->getClauseType();
	switch (evalStClause->stType) {
	case ST_ModifiesS:
	case ST_UsesS:
		validateSTSModUseClause(evalStClause, firstInput, secondInput, synList);
		break;
	case ST_ModifiesP:
	case ST_UsesP:
		validateSTPModUseClause(evalStClause, firstInput, secondInput, synList);
		break;
	case ST_Follows:
	case ST_FollowsA:
	case ST_Parent:
	case ST_ParentA:
	case ST_Next:
	case ST_NextA:
	case ST_Affects:
	case ST_AffectsA:
		validateSTPFAXClause(evalStClause, firstInput, secondInput, synList);
		break;
	case ST_Calls:
	case ST_CallsA:
		validateCallClause(evalStClause, firstInput, secondInput, synList);
		break;
	default:
		assert(false);
	}
	if (ArgType::DECVAR == evalStClause->firstType) {
		evalStClause->inVarArgIdxSet.insert(evalStClause->first);
	}
	if (ArgType::DECVAR == evalStClause->secondType) {
		evalStClause->inVarArgIdxSet.insert(evalStClause->second);
	}
	queryData.appendQEvalClause(evalStClause);
}
开发者ID:Pingxia,项目名称:CS3202_SPA,代码行数:40,代码来源:qtreevalidator.cpp

示例3: validateWTClause

void QTreeValidator::validateWTClause(QueryData & queryData, WTClauseEntry * wtClausePtr, const std::vector<std::string>& synList, const std::vector<std::string>& implList)
{
	QEvalWTClause *evalWtClause = new QEvalWTClause();

	const WithRefType refType = wtClausePtr->getLeftRefType();
	assert(refType == wtClausePtr->getRightRefType());

	const std::string lSyn = wtClausePtr->getLeftSyn(), rSyn = wtClausePtr->getRightSyn();

	idx_t firstIdx = IDX_NOT_FOUND, secondIdx = IDX_NOT_FOUND;
	std::string firstStr, secondStr;
	ArgType firstType = ArgType::NOT_SPECIFIED, secondType = ArgType::NOT_SPECIFIED;
	const WithAttrRefType firstAttrRefType = wtClausePtr->getLeftAttrType(), secondAttrRefType = wtClausePtr->getRightAttrType();

	// determine type
	determineArgIdxType(firstIdx, firstType, lSyn, synList, implList);
	determineArgIdxType(secondIdx, secondType, rSyn, synList, implList);

	// determine not specified type
	// not in implList, not in synList
	if (ArgType::NOT_SPECIFIED == firstType) {
		firstType = ArgType::CONST;
		if (refType == WithRefType::W_Integer) {
			firstIdx = std::stoi(lSyn);
		}
		else if (refType == WithRefType::W_String) {
			assert(isDoubleQuoted(lSyn));
			firstStr = dropDoubleQuote(lSyn);
		}
		else {
			assert(false);
		}
	}

	if (ArgType::NOT_SPECIFIED == secondType) {
		secondType = ArgType::CONST;
		if (refType == WithRefType::W_Integer) {
			secondIdx = std::stoi(rSyn);
		}
		else if (refType == WithRefType::W_String) {
			assert(isDoubleQuoted(rSyn));
			secondStr = dropDoubleQuote(rSyn);
		}
		else {
			assert(false);
		}
	}

	evalWtClause->first = firstIdx;
	evalWtClause->second = secondIdx;
	evalWtClause->firstStr = firstStr;
	evalWtClause->secondStr = secondStr;
	evalWtClause->firstType = firstType;
	evalWtClause->secondType = secondType;
	evalWtClause->firstAttrRefType = firstAttrRefType;
	evalWtClause->secondAttrRefType = secondAttrRefType;
	evalWtClause->refType = refType;

	if (evalWtClause->firstType == ArgType::DECVAR) {
		evalWtClause->inVarArgIdxSet.insert(evalWtClause->first);
	}
	if (evalWtClause->secondType == ArgType::DECVAR) {
		evalWtClause->inVarArgIdxSet.insert(evalWtClause->second);
	}

	queryData.appendQEvalClause(evalWtClause);
}
开发者ID:Pingxia,项目名称:CS3202_SPA,代码行数:67,代码来源:qtreevalidator.cpp


注:本文中的QueryData::appendQEvalClause方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。