コード例 #1
0
ファイル: type_extractor.c プロジェクト: adi2412/compilers
token checkTypeInSymbolTable(char* name,int lineNum, int charNum)
{
	STable entry = stList->table;
	STList readList = stList;
	if(entry->data == NULL)
	{
		if(readList->parentList == NULL)
		{
			typeError(2,name,lineNum,charNum);
			return INVALID;
		}
		entry = readList->parentList->table;
		readList = readList->parentList;
	}
	while(strcmp(entry->data->value,name))
	{
		entry = entry->nextEntry;
		if(entry->data == NULL)
		{
			// All entries in current scope over. Check above scope.
			if(readList->parentList == NULL)
			{
				typeError(2,name,lineNum,charNum);
				entry = NULL;
				return INVALID;
			}
			entry = readList->parentList->table;
			readList = readList->parentList;
		}
	}
	return convertToType(entry->data->type);
}
コード例 #2
0
ファイル: BulkPacket.cpp プロジェクト: Su27SK/BulkSimulation
/**
 * @brief BulkPacket&setPacketType 
 * set the packet size unit 单位
 * @param {unit} type 枚举类型
 */
BulkPacket& BulkPacket::setPacketType(unit type)
{
	if (type != _type) {
		bool plusMinus = (type - _type) > 0 ? true : false;
		convertToType(abs(type - _type), plusMinus);
	}
	return *this;
}
コード例 #3
0
ファイル: irgen-sprop-global.cpp プロジェクト: bjori/hhvm
SSATmp* ldClsPropAddrKnown(HTS& env,
                           const Class* cls,
                           const StringData* name) {
  initSProps(env, cls); // calls init; must be above sPropHandle()
  auto const slot = cls->lookupSProp(name);
  auto const handle = cls->sPropHandle(slot);
  auto const repoTy =
    !RuntimeOption::RepoAuthoritative
      ? RepoAuthType{}
      : cls->staticPropRepoAuthType(slot);
  auto const ptrTy = convertToType(repoTy).ptr(Ptr::SProp);
  return gen(env, LdRDSAddr, RDSHandleData { handle }, ptrTy);
}