/** * Notifies the {@link #irObserver} when the initial version of the IR has been constructed. This method allows the * {@link #irObserver} to modify the initial version of the IR. * * @param ast * The initial version of the IR. * @return A possibly modified version of the initial IR. */ public List<IRStatus<PIR>> initialIrEvent(List<IRStatus<PIR>> ast) { if (irObserver != null) { return irObserver.initialIRConstructed(ast, getInfo()); } return ast; }
/** * Notifies the {@link #irObserver} when the final version of the IR has been constructed. This method allows the * {@link #irObserver} to modify the IR. * * @param ast * The final version of the IR. * @return A possibly modified version of the IR */ public List<IRStatus<PIR>> finalIrEvent(List<IRStatus<PIR>> ast) { if (irObserver != null) { return irObserver.finalIRConstructed(ast, getInfo()); } return ast; }
/** * This method extracts the user modules or classes from a VDM AST. * * @param ast * The VDM AST. * @return A list of user modules or classes. */ protected List<INode> getUserModules(List<? extends INode> ast) { List<INode> userModules = new LinkedList<INode>(); for (INode node : ast) { if (!getInfo().getDeclAssistant().isLibrary(node)) { userModules.add(node); } } return userModules; }
/** * Determines whether a VDM module or class should be code generated or not. * * @param vdmNode * The node to be checked. * @return True if <code>node</code> should be code generated - false otherwise. */ protected boolean shouldGenerateVdmNode(INode vdmNode) { DeclAssistantIR declAssistant = getInfo().getDeclAssistant(); if (declAssistant.isLibrary(vdmNode)) { return false; } else { return true; } }
/** * Given a list of IR statuses this method retrieves the names of the user-defined test cases. * * @param statuses * The list of IR statuses from which the test case names are retrieved * @return The names of the user-defined test cases. */ protected List<String> getUserTestCases(List<IRStatus<PIR>> statuses) { List<String> userTestCases = new LinkedList<>(); for (IRStatus<PIR> s : statuses) { if (getInfo().getDeclAssistant().isTestCase(s.getVdmNode())) { userTestCases.add(getInfo().getDeclAssistant().getNodeName(s.getVdmNode())); } } return userTestCases; }
/** * Given an IR status this method determines if it represents a test case or not. * * @param status * The IR status. * @return True if the <code>status</code> represents a test case - false otherwise. */ protected boolean isTestCase(IRStatus<? extends PIR> status) { return getInfo().getDeclAssistant().isTestCase(status.getIrNode().getSourceNode().getVdmNode()); }
if (getInfo().getAssistantManager().getDeclAssistant().isLibrary(node))