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


Java Environment.isVDMPP方法代码示例

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


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

示例1: typeResolve

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
public void typeResolve(Environment env, TCTypeDefinition root)
{
	// Recursion defence done by the type
	type = type.typeResolve(env, root);

	if (env.isVDMPP())
	{
		if (type instanceof TCFunctionType)
		{
   			tagname.setTypeQualifier(((TCFunctionType)type).parameters);
		}
		else if (type instanceof TCOperationType)
   		{
   			tagname.setTypeQualifier(((TCOperationType)type).parameters);
   		}
	}
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:18,代码来源:TCField.java

示例2: 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

示例3: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public void typeCheck(Environment base, NameScope scope)
{
	if (base.isVDMPP())
	{
		base = new FlatEnvironment(getSelfDefinition(), base);
	}

	for (TCTraceDefinitionTerm term: terms)
	{
		term.typeCheck(base, NameScope.NAMESANDSTATE);
	}
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:14,代码来源:TCNamedTraceDefinition.java

示例4: typeResolve

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public void typeResolve(Environment base)
{
	if (typeParams != null)
	{
		FlatCheckedEnvironment params =	new FlatCheckedEnvironment(
			getTypeParamDefinitions(), base, NameScope.NAMES);

		type = type.typeResolve(params, null);
	}
	else
	{
		type = type.typeResolve(base, null);
	}

	if (result != null)
	{
		result.typeResolve(base);
	}

	if (base.isVDMPP())
	{
		name.setTypeQualifier(type.parameters);
	}

	if (precondition != null)
	{
		predef.typeResolve(base);
	}

	if (postcondition != null)
	{
		postdef.typeResolve(base);
	}

	for (TCPatternListTypePair pltp: parameterPatterns)
	{
		pltp.typeResolve(base);
	}
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:41,代码来源:TCImplicitFunctionDefinition.java

示例5: typeResolve

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public void typeResolve(Environment base)
{
	type = type.typeResolve(base, null);

	if (result != null)
	{
		result.typeResolve(base);
	}

	if (base.isVDMPP())
	{
		name.setTypeQualifier(type.parameters);

		if (name.getName().equals(classDefinition.name.getName()))
		{
			isConstructor = true;
			classDefinition.hasConstructors = true;
		}
	}

	if (precondition != null)
	{
		predef.typeResolve(base);
	}

	if (postcondition != null)
	{
		postdef.typeResolve(base);
	}

	for (TCPatternListTypePair ptp: parameterPatterns)
	{
		ptp.typeResolve(base);
	}
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:37,代码来源:TCImplicitOperationDefinition.java

示例6: getPreDefinition

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
private TCExplicitFunctionDefinition getPreDefinition(Environment base)
{
	TCPatternListList parameters = new TCPatternListList();
	TCPatternList plist = new TCPatternList();

	for (TCPatternListTypePair pl: parameterPatterns)
	{
		plist.addAll(pl.patterns);
	}

	if (state != null)
	{
		plist.add(new TCIdentifierPattern(state.name));
	}
	else if (base.isVDMPP() && !accessSpecifier.isStatic)
	{
		plist.add(new TCIdentifierPattern(name.getSelfName()));
	}

	parameters.add(plist);
	TCExpression preop = new TCPreOpExpression(name, precondition, errors, state);

	TCExplicitFunctionDefinition def = new TCExplicitFunctionDefinition(TCAccessSpecifier.DEFAULT, name.getPreName(precondition.location),
		null, type.getPreType(state, classDefinition, accessSpecifier.isStatic),
		parameters, preop, null, null, false, null);

	// Operation precondition functions are effectively not static as
	// their expression can directly refer to instance variables, even
	// though at runtime these are passed via a "self" parameter.

	def.setAccessSpecifier(accessSpecifier.getStatic(false));
	def.classDefinition = classDefinition;
	return def;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:35,代码来源:TCImplicitOperationDefinition.java

示例7: typeResolve

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public void typeResolve(Environment base)
{
	type = type.typeResolve(base, null);

	if (base.isVDMPP())
	{
		name.setTypeQualifier(type.parameters);

		if (name.getName().equals(classDefinition.name.getName()))
		{
			isConstructor = true;
			classDefinition.hasConstructors = true;
		}
	}
	
	if (precondition != null)
	{
		predef.typeResolve(base);
	}

	if (postcondition != null)
	{
		postdef.typeResolve(base);
	}

	for (TCPattern p: parameterPatterns)
	{
		p.typeResolve(base);
	}
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:32,代码来源:TCExplicitOperationDefinition.java

示例8: getPreDefinition

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
private TCExplicitFunctionDefinition getPreDefinition(Environment base)
{
	TCPatternListList parameters = new TCPatternListList();
	TCPatternList plist = new TCPatternList();
	plist.addAll(parameterPatterns);

	if (state != null)
	{
		plist.add(new TCIdentifierPattern(state.name));
	}
	else if (base.isVDMPP() && !accessSpecifier.isStatic)
	{
		plist.add(new TCIdentifierPattern(name.getSelfName()));
	}

	parameters.add(plist);
	TCPreOpExpression preop = new TCPreOpExpression(name, precondition, null, state);

	TCExplicitFunctionDefinition def = new TCExplicitFunctionDefinition(accessSpecifier, name.getPreName(precondition.location),
		null, type.getPreType(state, classDefinition, accessSpecifier.isStatic),
		parameters, preop, null, null, false, null);

	// Operation precondition functions are effectively not static as
	// their expression can directly refer to instance variables, even
	// though at runtime these are passed via a "self" parameter.

	def.setAccessSpecifier(accessSpecifier.getStatic(false));
	def.classDefinition = classDefinition;
	return def;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:31,代码来源:TCExplicitOperationDefinition.java

示例9: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public TCType typeCheck(Environment env, 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 = statement.typeCheck(local, scope, constraint);
	local.unusedCheck(env);
	return r;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:41,代码来源:TCLetDefStatement.java

示例10: typeResolve

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public void typeResolve(Environment base)
{
	if (typeParams != null)
	{
		FlatCheckedEnvironment params =	new FlatCheckedEnvironment(
			getTypeParamDefinitions(), base, NameScope.NAMES);

		type = type.typeResolve(params, null);
	}
	else
	{
		type = type.typeResolve(base, null);
	}

	if (base.isVDMPP())
	{
		name.setTypeQualifier(type.parameters);
	}

	if (body instanceof TCSubclassResponsibilityExpression ||
		body instanceof TCNotYetSpecifiedExpression)
	{
		isUndefined = true;
	}

	if (precondition != null)
	{
		predef.typeResolve(base);
	}

	if (postcondition != null)
	{
		postdef.typeResolve(base);
	}

	for (TCPatternList pp: paramPatternList)
	{
		pp.typeResolve(base);
	}
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:42,代码来源:TCExplicitFunctionDefinition.java

示例11: getPostDefinition

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
private TCExplicitFunctionDefinition getPostDefinition(Environment base)
{
	TCPatternListList parameters = new TCPatternListList();
	TCPatternList plist = new TCPatternList();

	for (TCPatternListTypePair pl: parameterPatterns)
	{
		plist.addAll(pl.patterns);
	}

	if (result != null)
	{
		plist.add(result.pattern);
	}

	if (state != null)
	{
		plist.add(new TCIdentifierPattern(state.name.getOldName()));
		plist.add(new TCIdentifierPattern(state.name));
	}
	else if (base.isVDMPP())
	{
		plist.add(new TCIdentifierPattern(name.getSelfName().getOldName()));
		
		if (!accessSpecifier.isStatic)
		{
			plist.add(new TCIdentifierPattern(name.getSelfName()));
		}
	}

	parameters.add(plist);
	TCExpression postop = new TCPostOpExpression(name, precondition, postcondition, errors, state);

	TCExplicitFunctionDefinition def = new TCExplicitFunctionDefinition(accessSpecifier, name.getPostName(postcondition.location),
		null, type.getPostType(state, classDefinition, accessSpecifier.isStatic),
		parameters, postop,
		null, null, false, null);

	// Operation postcondition functions are effectively not static as
	// their expression can directly refer to instance variables, even
	// though at runtime these are passed via a "self" parameter.

	def.setAccessSpecifier(accessSpecifier.getStatic(false));
	def.classDefinition = classDefinition;
	return def;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:47,代码来源:TCImplicitOperationDefinition.java

示例12: typeCheck

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
@Override
public void typeCheck(Environment base, NameScope scope)
{
	getDefinitions().setExcluded(true);
	expType = exp.typeCheck(base, null, scope, type);
	getDefinitions().setExcluded(false);
	
	if (expType instanceof TCUnknownType)
	{
		pass = Pass.FINAL;	// Come back to this
	}
	
	if (expType instanceof TCVoidType)
	{
		exp.report(3048, "Expression does not return a value");
	}
	else if (type != null && !(type instanceof TCUnknownType))
	{
		TypeComparator.checkComposeTypes(type, base, false);
		
		if (!TypeComparator.compatible(type, expType))
		{
			report(3051, "Expression does not match declared type");
			detail2("Declared", type, "Expression", expType);
		}
	}
	else
	{
		type = expType;
	}

	if (base.isVDMPP() && type instanceof TCNamedType)
	{
		TCNamedType named = (TCNamedType)type;
   		TCDefinition typedef = base.findType(named.typename, location.module);

   		if (typedef.accessSpecifier.narrowerThan(accessSpecifier))
   		{
   			report(3052, "Value type visibility less than value definition");
   		}
	}

	pattern.typeResolve(base);
	updateDefs();
	defs.typeCheck(base, scope);
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:47,代码来源:TCValueDefinition.java

示例13: getPostDefinition

import com.fujitsu.vdmj.typechecker.Environment; //导入方法依赖的package包/类
private TCExplicitFunctionDefinition getPostDefinition(Environment base)
{
	TCPatternListList parameters = new TCPatternListList();
	TCPatternList plist = new TCPatternList();
	plist.addAll(parameterPatterns);

	if (!(type.result instanceof TCVoidType))
	{
   		plist.add(new TCIdentifierPattern(name.getResultName(location)));
	}

	if (state != null)	// Two args, called Sigma~ and Sigma
	{
		plist.add(new TCIdentifierPattern(state.name.getOldName()));
		plist.add(new TCIdentifierPattern(state.name));
	}
	else if (base.isVDMPP())
	{
		// Two arguments called "self~" and "self"
		plist.add(new TCIdentifierPattern(name.getSelfName().getOldName()));
		
		if (!accessSpecifier.isStatic)
		{
			plist.add(new TCIdentifierPattern(name.getSelfName()));
		}
	}

	parameters.add(plist);
	TCPostOpExpression postop = new TCPostOpExpression(name, precondition, postcondition, null, state);

	TCExplicitFunctionDefinition def = new TCExplicitFunctionDefinition(accessSpecifier, name.getPostName(postcondition.location),
		null, type.getPostType(state, classDefinition, accessSpecifier.isStatic),
		parameters, postop, null, null, false, null);

	// Operation postcondition functions are effectively not static as
	// their expression can directly refer to instance variables, even
	// though at runtime these are passed via a "self" parameter.

	def.setAccessSpecifier(accessSpecifier.getStatic(false));
	def.classDefinition = classDefinition;
	return def;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:43,代码来源:TCExplicitOperationDefinition.java


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