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


Java Environment.unusedCheck方法代码示例

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


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

示例1: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment base, TCTypeList qualifiers, NameScope scope, TCType constraint)
{
	def = new TCMultiBindListDefinition(location, bindings);
	def.typeCheck(base, scope);
	Environment local = new FlatCheckedEnvironment(def, base, scope);

	if (predicate != null &&
		!predicate.typeCheck(local, null, scope, new TCBooleanType(location)).isType(TCBooleanType.class, location))
	{
		predicate.report(3118, "Predicate is not boolean");
	}

	TCType domConstraint = null;
	TCType rngConstraint = null;
	
	if (constraint != null && constraint.isMap(location))
	{
		domConstraint = constraint.getMap().from;
		rngConstraint = constraint.getMap().to;
	}

	maptype = first.typeCheck(local, scope, domConstraint, rngConstraint);	// The map from/to type
	local.unusedCheck();
	return maptype;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:27,代码来源:TCMapCompExpression.java

示例2: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment base, TCTypeList qualifiers, NameScope scope, TCType constraint)
{
	def = new TCMultiBindListDefinition(bind.location, bind.getMultipleBindList());
	def.typeCheck(base, scope);
	Environment local = new FlatCheckedEnvironment(def, base, scope);
	
	if (bind instanceof TCTypeBind)
	{
		TCTypeBind tb = (TCTypeBind)bind;
		tb.typeResolve(base);
	}

	if (!predicate.typeCheck(local, null, scope, new TCBooleanType(location)).isType(TCBooleanType.class, location))
	{
		predicate.report(3088, "Predicate is not boolean");
	}

	local.unusedCheck();
	return checkConstraint(constraint, new TCBooleanType(location));
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:22,代码来源:TCExists1Expression.java

示例3: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment base, TCTypeList qualifiers, NameScope scope, TCType constraint)
{
	def = new TCMultiBindListDefinition(location, bindList);
	def.typeCheck(base, scope);

	Environment local = new FlatCheckedEnvironment(def, base, scope);

	if (!predicate.typeCheck(local, null, scope, new TCBooleanType(location)).isType(TCBooleanType.class, location))
	{
		predicate.report(3089, "Predicate is not boolean");
	}

	local.unusedCheck();
	return checkConstraint(constraint, new TCBooleanType(location));
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:17,代码来源:TCExistsExpression.java

示例4: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment base, TCTypeList qualifiers, NameScope scope, TCType constraint)
{
	def = new TCMultiBindListDefinition(location, bind.getMultipleBindList());
	def.typeCheck(base, scope);
	Environment local = new FlatCheckedEnvironment(def, base, scope);

	if (suchThat != null &&
		!suchThat.typeCheck(local, null, scope, null).isType(TCBooleanType.class, location))
	{
		report(3117, "Such that clause is not boolean");
	}

	TCType r = value.typeCheck(local, null, scope, constraint);
	local.unusedCheck();
	return r;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:18,代码来源:TCLetBeStExpression.java

示例5: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment base, NameScope scope, TCType constraint)
{
	TCType stype = exp.typeCheck(base, null, scope, null);
	Environment local = base;

	if (stype.isSeq(location))
	{
		seqType = stype.getSeq();
		patternBind.typeCheck(base, scope, seqType.seqof);
		TCDefinitionList defs = patternBind.getDefinitions();
		defs.typeCheck(base, scope);
		local = new FlatCheckedEnvironment(defs, base, scope);
	}
	else
	{
		exp.report(3223, "Expecting sequence type after 'in'");
	}

	TCType rt = statement.typeCheck(local, scope, constraint);
	local.unusedCheck();
	return rt;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:24,代码来源:TCForPatternBindStatement.java

示例6: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment base, NameScope scope, TCType constraint)
{
	def = new TCMultiBindListDefinition(location, bind.getMultipleBindList());
	def.typeCheck(base, scope);
	
	// Definitions create by the let statement are not references to state, so they
	// cannot be updated. Therefore we wrap them in a local TCQualifiedDefinition.
	TCDefinitionList qualified = new TCDefinitionList();
	
	for (TCDefinition d: def.getDefinitions())
	{
		qualified.add(new TCQualifiedDefinition(d, NameScope.LOCAL));
	}
	
	Environment local = new FlatCheckedEnvironment(qualified, base, scope);

	if (suchThat != null && !suchThat.typeCheck(local, null, scope, null).isType(TCBooleanType.class, location))
	{
		report(3225, "Such that clause is not boolean");
	}

	TCType r = statement.typeCheck(local, scope, constraint);
	local.unusedCheck();
	return r;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:27,代码来源:TCLetBeStStatement.java

示例7: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment env, NameScope scope, TCType constraint)
{
	// Each dcl definition is in scope for later definitions...

	Environment local = env;

	for (TCDefinition d: assignmentDefs)
	{
		local = new FlatCheckedEnvironment(d, local, scope);	// cumulative
		d.implicitDefinitions(local);
		d.typeCheck(local, scope);
	}

	// For type checking purposes, the definitions are treated as
	// local variables. At runtime (below) they have to be treated
	// more like (updatable) state.

	TCType r = super.typeCheck(local, scope, constraint);
	local.unusedCheck(env);
	return r;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:23,代码来源:TCBlockStatement.java

示例8: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment base, NameScope scope, TCType constraint)
{
	setType = set.typeCheck(base, null, scope, null);
	pattern.typeResolve(base);

	if (setType.isSet(location))
	{
		TCSetType st = setType.getSet();
		TCDefinitionList defs = pattern.getDefinitions(st.setof, NameScope.LOCAL);

		Environment local = new FlatCheckedEnvironment(defs, base, scope);
		TCType rt = statement.typeCheck(local, scope, constraint);
		local.unusedCheck();
		return rt;
	}
	else
	{
		report(3219, "For all statement does not contain a set type");
		return new TCUnknownType(location);
	}
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:23,代码来源:TCForAllStatement.java

示例9: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public void typeCheck(Environment base, NameScope scope)
{
	def = new TCMultiBindListDefinition(bind.location, bind.getMultipleBindList());
	def.typeResolve(base);
	def.typeCheck(base, scope);
	Environment local = new FlatCheckedEnvironment(def, base, scope);

	if (stexp != null &&
		!stexp.typeCheck(local, null, scope, null).isType(TCBooleanType.class, location))
	{
		TypeChecker.report(3225,
			"Such that clause is not boolean", stexp.location);
	}

	body.typeCheck(local, scope);
	local.unusedCheck();
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:19,代码来源:TCTraceLetBeStBinding.java

示例10: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment env, TCTypeList qualifiers, NameScope scope, TCType constraint)
{
	// Each local definition is in scope for later local definitions...

	Environment local = env;

	for (TCDefinition d: localDefs)
	{
		if (d instanceof TCExplicitFunctionDefinition)
		{
			// Functions' names are in scope in their bodies, whereas
			// simple variable declarations aren't

			local = new FlatCheckedEnvironment(d, local, scope);	// cumulative
			d.implicitDefinitions(local);
			d.typeResolve(local);

			if (env.isVDMPP())
			{
				TCClassDefinition cdef = env.findClassDefinition();
				d.setClassDefinition(cdef);
				d.setAccessSpecifier(d.accessSpecifier.getStatic(true));
			}

			d.typeCheck(local, scope);
		}
		else
		{
			d.implicitDefinitions(local);
			d.typeResolve(local);
			d.typeCheck(local, scope);
			local = new FlatCheckedEnvironment(d, local, scope);	// cumulative
		}
	}

	TCType r = expression.typeCheck(local, null, scope, constraint);
	local.unusedCheck(env);
	return r;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:41,代码来源:TCLetDefExpression.java

示例11: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment base, TCTypeList qualifiers, NameScope scope, TCType constraint)
{
	def = new TCMultiBindListDefinition(first.location, bindings);
	def.typeCheck(base, scope);
	Environment local = new FlatCheckedEnvironment(def, base, scope);
	TCType elemConstraint = null;
	
	if (constraint != null && constraint.isSet(location))
	{
		elemConstraint = constraint.getSet().setof;
	}

	TCType etype = first.typeCheck(local, null, scope, elemConstraint);

	if (predicate != null)
	{
		if (!predicate.typeCheck(local, null, scope, new TCBooleanType(location)).isType(TCBooleanType.class, location))
		{
			predicate.report(3159, "Predicate is not boolean");
		}
	}

	local.unusedCheck();
	setType = new TCSetType(location, etype);
	return setType;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:28,代码来源:TCSetCompExpression.java

示例12: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment base, TCTypeList qualifiers, NameScope scope, TCType constraint)
{
	def = new TCMultiBindListDefinition(location, bind.getMultipleBindList());
	def.typeCheck(base, scope);

	if (bind instanceof TCSetBind &&
		(bind.pattern.getVariableNames().size() != 1 || !def.getType().isOrdered(location)))
	{
		report(3155, "List comprehension must define one ordered bind variable");
	}

	Environment local = new FlatCheckedEnvironment(def, base, scope);
	TCType elemConstraint = null;
	
	if (constraint != null && constraint.isSeq(location))
	{
		elemConstraint = constraint.getSeq().seqof;
	}

	TCType etype = first.typeCheck(local, null, scope, elemConstraint);

	if (predicate != null)
	{
		if (!predicate.typeCheck(local, null, scope, new TCBooleanType(location)).isType(TCBooleanType.class, location))
		{
			predicate.report(3156, "Predicate is not boolean");
		}
	}

	local.unusedCheck();
	return new TCSeqType(location, etype);
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:34,代码来源:TCSeqCompExpression.java

示例13: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment base, TCTypeList qualifiers, NameScope scope, TCType constraint)
{
	def = new TCMultiBindListDefinition(location, bindList);
	def.typeCheck(base, scope);
	Environment local = new FlatCheckedEnvironment(def, base, scope);

	if (!predicate.typeCheck(local, null, scope, new TCBooleanType(location)).isType(TCBooleanType.class, location))
	{
		predicate.report(3097, "Predicate is not boolean");
	}

	local.unusedCheck();
	return checkConstraint(constraint, new TCBooleanType(location));
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:16,代码来源:TCForAllExpression.java

示例14: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment env, NameScope scope, TCType constraint)
{
	TCType ft = from.typeCheck(env, null, scope, null);
	TCType tt = to.typeCheck(env, null, scope, null);

	if (!ft.isNumeric(location))
	{
		report(3220, "From type is not numeric");
	}

	if (!tt.isNumeric(location))
	{
		report(3221, "To type is not numeric");
	}

	if (by != null)
	{
		TCType bt = by.typeCheck(env, null, scope, null);

		if (!bt.isNumeric(location))
		{
			report(3222, "By type is not numeric");
		}
	}

	TCDefinition vardef = new TCLocalDefinition(var.getLocation(), var, ft);
	Environment local = new FlatCheckedEnvironment(vardef, env, scope);
	TCType rt = statement.typeCheck(local, scope, constraint);
	local.unusedCheck();
	return rt;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:33,代码来源:TCForIndexStatement.java

示例15: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
public void typeCheck(Environment base, NameScope scope, TCType ext, TCType constraint)
{
	patternBind.typeCheck(base, scope, ext);
	TCDefinitionList defs = patternBind.getDefinitions();
	defs.typeCheck(base, scope);
	Environment local = new FlatCheckedEnvironment(defs, base, scope);
	statement.typeCheck(local, scope, constraint);
	local.unusedCheck();
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:10,代码来源:TCTixeStmtAlternative.java


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