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


Java INClassList类代码示例

本文整理汇总了Java中com.fujitsu.vdmj.in.definitions.INClassList的典型用法代码示例。如果您正苦于以下问题:Java INClassList类的具体用法?Java INClassList怎么用?Java INClassList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


INClassList类属于com.fujitsu.vdmj.in.definitions包,在下文中一共展示了INClassList类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doClasses

import com.fujitsu.vdmj.in.definitions.INClassList; //导入依赖的package包/类
@Override
protected boolean doClasses(String line)
{
	String def = cinterpreter.getDefaultName();
	INClassList classes = cinterpreter.getClasses();

	for (INClassDefinition c: classes)
	{
		if (c.name.getName().equals(def))
		{
			println(c.name.getName() + " (default)");
		}
		else
		{
			println(c.name.getName());
		}
	}

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

示例2: ClassInterpreter

import com.fujitsu.vdmj.in.definitions.INClassList; //导入依赖的package包/类
public ClassInterpreter(INClassList executableClasses, TCClassList checkedClasses) throws Exception
{
	super();
	
	this.checkedClasses = checkedClasses;
	this.executableClasses = executableClasses;
	this.createdValues = new NameValuePairMap();
	this.createdDefinitions = new TCDefinitionSet();

	if (executableClasses.isEmpty())
	{
		setDefaultName(null);
	}
	else
	{
		setDefaultName(executableClasses.get(0).name.getName());
	}
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:19,代码来源:ClassInterpreter.java

示例3: readSpecification

import com.fujitsu.vdmj.in.definitions.INClassList; //导入依赖的package包/类
/**
 * @see com.fujitsu.vdmjunit.SpecificationReader#readSpecification(Charset, java.util.List)
 */
@Override
protected Interpreter readSpecification(Charset charset, List<File> files) throws Exception
{
	ASTClassList parsedClasses = new ASTClassList();
	
	for (File file: files)
	{
		LexTokenReader lexer = new LexTokenReader(file, Settings.dialect, charset.toString());
		ClassReader reader = new ClassReader(lexer);
		parsedClasses.addAll(reader.readClasses());
		
		if (reader.getErrorCount() > 0)
		{
			printMessages(reader.getErrors());
			fail("Syntax errors (see stdout)");
		}
	}
	
	if (Settings.dialect == Dialect.VDM_RT)
	{
		parsedClasses.add(new ASTCPUClassDefinition());
		parsedClasses.add(new ASTBUSClassDefinition());
	}
	
	TCClassList checkedClasses = ClassMapper.getInstance(TCNode.MAPPINGS).init().convert(parsedClasses);
	ClassTypeChecker checker = new ClassTypeChecker(checkedClasses);
	checker.typeCheck();
	
	if (ClassTypeChecker.getErrorCount() > 0)
	{
		printMessages(ClassTypeChecker.getErrors());
		fail("Type errors (see stdout)");
	}
	
	INClassList executableClasses = ClassMapper.getInstance(INNode.MAPPINGS).init().convert(checkedClasses);
	return new ClassInterpreter(executableClasses, checkedClasses);
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:41,代码来源:OOSpecificationReader.java

示例4: processClasses

import com.fujitsu.vdmj.in.definitions.INClassList; //导入依赖的package包/类
private void processClasses() throws IOException, DBGPException
{
	if (!(interpreter instanceof ClassInterpreter))
	{
		throw new DBGPException(
			DBGPErrorCode.INTERNAL_ERROR, "Not available for VDM-SL");
	}

	ClassInterpreter cinterpreter = (ClassInterpreter)interpreter;
	String def = cinterpreter.getDefaultName();
	INClassList classes = cinterpreter.getClasses();
	OutputStream out = new ByteArrayOutputStream();
	PrintWriter pw = new PrintWriter(out);

	for (INClassDefinition cls: classes)
	{
		if (cls.name.getName().equals(def))
		{
			pw.println(cls.name.getName() + " (default)");
		}
		else
		{
			pw.println(cls.name.getName());
		}
	}

	pw.close();
	cdataResponse(out.toString());
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:30,代码来源:DBGPReader.java

示例5: checkErrors

import com.fujitsu.vdmj.in.definitions.INClassList; //导入依赖的package包/类
private void checkErrors(List<VDMMessage> actual)
{
	try
	{
		Interpreter interpreter = new ClassInterpreter(new INClassList(), new TCClassList());
		interpreter.init();

		Value assertions = interpreter.execute(new File(assertName));

		assertTrue("Expecting error list", assertions instanceof SeqValue);

		List<Long> expected = new Vector<Long>();

		for (Value ex: assertions.seqValue(null))
		{
			long n = ex.intValue(null);
			expected.add(n);
		}

		List<Long> actNums = new Vector<Long>();

		for (VDMMessage m: actual)
		{
			actNums.add((long)m.number);
		}

		if (!actNums.equals(expected))
		{
			Console.out.println("Expected errors: " + listErrNos(expected));
			Console.out.println("Actual errors: " + listErrs(actual));
			Console.out.println(Utils.listToString(actual, "\n"));
			fail("Actual errors not as expected");
		}
	}
	catch (Exception e)
	{
		fail("Caught: " + e + " in " + assertName);
	}
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:40,代码来源:OvertureTest.java

示例6: process

import com.fujitsu.vdmj.in.definitions.INClassList; //导入依赖的package包/类
private void process(String resource, String aresource) throws Exception
{
	Console.out.println("Processing " + resource + "...");

	URL rurl = getClass().getResource("/VDMBook/" + resource);
	String file = rurl.getPath();
	URL aurl = getClass().getResource("/VDMBook/" + aresource);
	String assertions = aurl.getPath();

	long before = System.currentTimeMillis();
	ASTClassList parsed = parseClasses(file);
	long after = System.currentTimeMillis();

	Console.out.println("Parsed " + parsed.size() + " classes in " +
  			(double)(after-before)/1000 + " secs. ");

	before = System.currentTimeMillis();
	TCClassList checked = ClassMapper.getInstance(TCNode.MAPPINGS).init().convert(parsed);
	TypeChecker typeChecker = new ClassTypeChecker(checked);
	typeChecker.typeCheck();
	after = System.currentTimeMillis();

  		Console.out.println("Type checked in " + (double)(after-before)/1000 + " secs. ");
	Console.out.println("There were " + TypeChecker.getWarningCount() + " warnings");
	TypeChecker.printErrors(Console.out);
	assertEquals("Type check errors", 0, TypeChecker.getErrorCount());

	INClassList runnable = ClassMapper.getInstance(INNode.MAPPINGS).init().convert(checked);
	ClassInterpreter interpreter = new ClassInterpreter(runnable, checked);
	interpreter.init();
	CommandReader reader = new ClassCommandReader(interpreter, "");
	boolean OK = reader.assertFile(new File(assertions));
	assertEquals("Execution errors", true, OK);
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:35,代码来源:VDMBookTest.java

示例7: getClasses

import com.fujitsu.vdmj.in.definitions.INClassList; //导入依赖的package包/类
public INClassList getClasses()
{
	return executableClasses;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:5,代码来源:ClassInterpreter.java


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