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


Java TCNameList.add方法代码示例

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


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

示例1: getAllVariableNames

import com.fujitsu.vdmj.tc.lex.TCNameList; //导入方法依赖的package包/类
@Override
public TCNameList getAllVariableNames()
{
	TCNameList list = new TCNameList();
	list.add(name);
	return list;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:8,代码来源:INIdentifierPattern.java

示例2: getVariableNames

import com.fujitsu.vdmj.tc.lex.TCNameList; //导入方法依赖的package包/类
@Override
public TCNameList getVariableNames()
{
	TCNameList names = new TCNameList();
	
	for (TCField field: fields)
	{
		names.add(field.tagname);
	}
	
	return names;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:13,代码来源:POStateDefinition.java

示例3: getVariableNames

import com.fujitsu.vdmj.tc.lex.TCNameList; //导入方法依赖的package包/类
@Override
public TCNameList getVariableNames()
{
	TCNameList names = new TCNameList();

	for (TCNameToken vn: superdef.getVariableNames())
	{
		names.add(vn.getModifiedName(name.getModule()));
	}

	return names;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:13,代码来源:POInheritedDefinition.java

示例4: getVariableNames

import com.fujitsu.vdmj.tc.lex.TCNameList; //导入方法依赖的package包/类
@Override
public TCNameList getVariableNames()
{
	TCNameList both = new TCNameList(name);
	both.add(def.name);
	return both;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:8,代码来源:PORenamedDefinition.java

示例5: getOverloadNames

import com.fujitsu.vdmj.tc.lex.TCNameList; //导入方法依赖的package包/类
public TCNameList getOverloadNames(TCNameToken name)
{
	TCNameList list = new TCNameList();

	for (Entry<TCNameToken, Value> entry: this.entrySet())
	{
		if (entry.getKey().matches(name))		// All overloaded names
		{
			list.add(entry.getKey());
		}
	}

	return list;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:15,代码来源:NameValuePairMap.java

示例6: getVariableNames

import com.fujitsu.vdmj.tc.lex.TCNameList; //导入方法依赖的package包/类
@Override
public TCNameList getVariableNames()
{
	TCNameList names = new TCNameList();
	checkSuperDefinition();

	for (TCNameToken vn: superdef.getVariableNames())
	{
		names.add(vn.getModifiedName(name.getModule()));
	}

	return names;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:14,代码来源:TCInheritedDefinition.java

示例7: checkComposeTypes

import com.fujitsu.vdmj.tc.lex.TCNameList; //导入方法依赖的package包/类
/**
 * Check that the compose types that are referred to in a type have a matching
 * definition in the environment. The method returns a list of types that do not
 * exist if the newTypes parameter is passed. 
 */
public static TCTypeList checkComposeTypes(TCType type, Environment env, boolean newTypes)
{
	TCTypeList undefined = new TCTypeList();
	
	for (TCType compose: type.getComposeTypes())
	{
		TCRecordType composeType = (TCRecordType)compose;
		TCDefinition existing = env.findType(composeType.name, null);
		
		if (existing != null)
		{
			// If the type is already defined, check that it has the same shape and
			// does not have an invariant (which cannot match a compose definition).
			boolean matches = false;
			
			if (existing instanceof TCTypeDefinition)
			{
				TCTypeDefinition edef = (TCTypeDefinition)existing;
				TCType etype = existing.getType();
				
				if (edef.invExpression == null && etype instanceof TCRecordType)
				{
					TCRecordType retype = (TCRecordType)etype;
					
					if (retype.fields.equals(composeType.fields))
					{
						matches = true;
					}
				}
			}
				
			if (!matches)
			{
				TypeChecker.report(3325, "Mismatched compose definitions for " + composeType.name, composeType.location);
				TypeChecker.detail2(composeType.name.getName(), composeType.location, existing.name.getName(), existing.location);
			}
		}
		else
		{
			if (newTypes)
			{
				undefined.add(composeType);
			}
			else
			{
				TypeChecker.report(3113, "Unknown type name '" + composeType.name + "'", composeType.location);
			}
		}
	}
	
	// Lastly, check that the compose types extracted are compatible
	TCNameList done = new TCNameList();
	
	for (TCType c1: undefined)
	{
		for (TCType c2: undefined)
		{
			if (c1 != c2)
			{
				TCRecordType r1 = (TCRecordType)c1;
				TCRecordType r2 = (TCRecordType)c2;
				
				if (r1.name.equals(r2.name) && !done.contains(r1.name) && !r1.fields.equals(r2.fields))
				{
					TypeChecker.report(3325, "Mismatched compose definitions for " + r1.name, r1.location);
					TypeChecker.detail2(r1.name.getName(), r1.location, r2.name.getName(), r2.location);
					done.add(r1.name);
				}
			}
		}
	}
	
	return undefined;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:80,代码来源:TypeComparator.java

示例8: dupHideCheck

import com.fujitsu.vdmj.tc.lex.TCNameList; //导入方法依赖的package包/类
/**
 * Check whether the list of definitions passed contains any duplicates,
 * or whether any names in the list hide the same name further down the
 * environment chain.
 *
 * @param list	The list of definitions to check.
 */

protected void dupHideCheck(TCDefinitionList list, NameScope scope)
{
	TCNameList allnames = list.getVariableNames();

	for (TCNameToken n1: allnames)
	{
		TCNameList done = new TCNameList();

		for (TCNameToken n2: allnames)
		{
			if (n1 != n2 && n1.equals(n2) && !done.contains(n1))
			{
				TypeChecker.warning(5007, "Duplicate definition: " + n1, n1.getLocation());
				done.add(n1);
			}
		}

		if (outer != null)
		{
			// We search for any scoped name (ie. the first), but then check
			// the scope matches what we can see. If we pass scope to findName
			// it throws errors if the name does not match the scope.

			TCDefinition def = outer.findName(n1, NameScope.NAMESANDSTATE);

			if (def != null && def.location != n1.getLocation() &&
				def.nameScope.matches(scope))
			{
				// Reduce clutter for names in the same module/class
				String message = null;

				if (def.location.file.equals(n1.getLocation().file))
				{
					message = def.name.getName() + " " + def.location.toShortString() +
						" hidden by " +	n1.toString();
				}
				else
				{
					message = def.name.getName() + " " + def.location +
						" hidden by " + n1.toString();
				}

				TypeChecker.warning(5008, message, n1.getLocation());
			}
		}
	}
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:56,代码来源:Environment.java


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