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


C++ Symbol::FeatureDefnData方法代码示例

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


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

示例1: PostParse

DEFINE_THIS_FILE

/***********************************************************************************************
	Forward declarations
***********************************************************************************************/

/***********************************************************************************************
	Local Constants and static variables
***********************************************************************************************/

/***********************************************************************************************
	Methods
***********************************************************************************************/

bool GrcManager::PostParse()
{
	//	Add the system-defined "lang" feature whose values are 4-byte language ID codes.
	//	This feature always has an ID = 1 (kfidStdLang).
	Symbol psymFeat = SymbolTable()->AddFeatureSymbol(GrcStructName("lang"),
		GrpLineAndFile(0, 0, ""));
	GdlFeatureDefn * pfeat = psymFeat->FeatureDefnData();
	Assert(pfeat);
	pfeat->SetName("lang");
	pfeat->MarkAsLanguageFeature();
	m_prndr->AddFeature(pfeat);

	g_cman.ProcessMasterTables();

	if (!m_prndr->ReplaceAliases())
		return false;

	if (!m_prndr->HandleOptionalItems())
		return false;

	if (!m_prndr->CheckSelectors())
		return false;

	return true;
}
开发者ID:FieldDB,项目名称:FieldWorks,代码行数:39,代码来源:PostParser.cpp

示例2: PreCompile

bool GdlLangClass::PreCompile(GrcManager * pcman)
{
	// Each item in the vectors corresponds to a feature assignment.
	for (int ifasgn = 0; ifasgn < m_vstaFeat.Size(); ifasgn++)
	{
		Symbol psymFeat = pcman->SymbolTable()->FindSymbol(m_vstaFeat[ifasgn]);
		if (!psymFeat)
		{
			g_errorList.AddError(3154, NULL, "Undefined feature: ", m_vstaFeat[ifasgn], m_vlnf[ifasgn]);
			continue;
		}

		GdlFeatureDefn * pfeat = psymFeat->FeatureDefnData();
		Assert(pfeat);
		StrAnsi staValue = m_vstaVal[ifasgn];
		GdlExpression * pexpVal = m_vpexpVal[ifasgn];
		int nVal;
		GdlFeatureSetting * pfset;
		if (pexpVal)
		{
			if (!pexpVal->ResolveToInteger(&nVal, false))
			{
				g_errorList.AddError(3155, pexpVal,
					"Feature value cannot be evaluated", m_vlnf[ifasgn]);
				continue;
			}
			else
			{
				pfset = pfeat->FindSettingWithValue(nVal);
				if (!pfset)
				{
					char rgchValue[20];
					itoa(nVal, rgchValue, 10);
					g_errorList.AddWarning(3523, NULL,
						"Feature ", pfeat->Name(), " has no defined setting corresponding to value ",
						rgchValue,
						m_vlnf[ifasgn]);
				}
			}
		}
		else
		{
			// Feature setting identifier
			pfset = pfeat->FindSetting(staValue);
			if (!pfset)
			{
				g_errorList.AddError(3156, NULL, "Undefined feature setting: ", staValue, m_vlnf[ifasgn]);
				continue;
			}
			nVal = pfset->Value();
		}

		// Store the feature values in the language items.
		for (int ilang = 0; ilang < m_vplang.Size(); ilang++)
			m_vplang[ilang]->AddFeatureValue(pfeat, pfset, nVal, m_vlnf[ifasgn]);

		if (m_vplang.Size() == 0 && ifasgn == 0)
		{
			g_errorList.AddWarning(3524, NULL, "No languages specified for language group '", m_staLabel,
				"'; settings will have no effect",
				m_vlnf[0]);
		}
	}
	return true;
}
开发者ID:FieldDB,项目名称:FieldWorks,代码行数:65,代码来源:ErrorCheckFeatures.cpp


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