當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。