in src/main/java/workspace/HelloVDMJ4.java [25:48]
public static void extractInformationByVDMJ() throws LexException, ParserException {
LexTokenReader ltr = new LexTokenReader(new File("./vdm_files/Arg2.vdmpp"), Dialect.VDM_PP);
DefinitionReader dr = new DefinitionReader(ltr);
ASTDefinitionList astDefinitionList = dr.readDefinitions();
astDefinitionList.forEach(_astDefinition -> {
if(_astDefinition.kind().equals("explicit function")) {
TCExplicitFunctionDefinition tcExplicitFunctionDefinition = null;
try {
tcExplicitFunctionDefinition = ClassMapper.getInstance(TCExplicitFunctionDefinition.MAPPINGS).init().convert(_astDefinition);
} catch (Exception e) {
e.printStackTrace();
}
/* koituga if-shiki no kouzou wo motteru! ashita ha kokokara!*/
ifExpression = (TCIfExpression) tcExplicitFunctionDefinition.body;
TCFunctionType tcft = tcExplicitFunctionDefinition.type;
TCTypeList tct = tcft.parameters;
System.out.println(tct.toString());
}
});
}