@Override public PExp caseACyclesStm(ACyclesStm stm, Integer lineno) throws AnalysisException { return stm.getStatement().apply(THIS, lineno); }
@Override public PStm caseACyclesStm(ACyclesStm stm, Integer lineno) throws AnalysisException { return stm.getStatement().apply(THIS, lineno); }
/** * Called by the {@link ACyclesStm} node from {@link ACyclesStm#apply(IAnalysis)}. * @param node the calling {@link ACyclesStm} node */ public void caseACyclesStm(ACyclesStm node) throws AnalysisException { _visitedNodes.add(node); inACyclesStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getCycles() != null && !_visitedNodes.contains(node.getCycles())) { node.getCycles().apply(this); } if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) { node.getStatement().apply(this); } outACyclesStm(node); }
/** * Called by the {@link ACyclesStm} node from {@link ACyclesStm#apply(IAnalysis)}. * @param node the calling {@link ACyclesStm} node */ public void caseACyclesStm(ACyclesStm node, Q question) throws AnalysisException { _visitedNodes.add(node); inACyclesStm(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getCycles() != null && !_visitedNodes.contains(node.getCycles())) { node.getCycles().apply(this, question); } if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) { node.getStatement().apply(this, question); } outACyclesStm(node, question); }
/** * Called by the {@link ACyclesStm} node from {@link ACyclesStm#apply(IPOFAnalysis)}. * @param node the calling {@link ACyclesStm} node */ public void caseACyclesStm(ACyclesStm node) throws AnalysisException { _visitedNodes.add(node); inACyclesStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getCycles() != null && !_visitedNodes.contains(node.getCycles())) { node.getCycles().apply(this); } if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) { node.getStatement().apply(this); } outACyclesStm(node); }
@Override public LexNameSet caseACyclesStm(ACyclesStm node, FreeVarInfo info) throws AnalysisException { LexNameSet names = node.getCycles().apply(this, info); names.addAll(node.getStatement().apply(this, info)); return names; }
/** * Called by the {@link ACyclesStm} node from {@link ACyclesStm#apply(IAnalysis)}. * @param node the calling {@link ACyclesStm} node */ public A caseACyclesStm(ACyclesStm node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inACyclesStm(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getCycles() != null && !_visitedNodes.contains(node.getCycles())) { mergeReturns(retVal,node.getCycles().apply(this, question)); } if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) { mergeReturns(retVal,node.getStatement().apply(this, question)); } mergeReturns(retVal,outACyclesStm(node, question)); return retVal; }
/** * Called by the {@link ACyclesStm} node from {@link ACyclesStm#apply(IAnalysis)}. * @param node the calling {@link ACyclesStm} node */ public A caseACyclesStm(ACyclesStm node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inACyclesStm(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getCycles() != null && !_visitedNodes.contains(node.getCycles())) { mergeReturns(retVal,node.getCycles().apply(this)); } if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) { mergeReturns(retVal,node.getStatement().apply(this)); } mergeReturns(retVal,outACyclesStm(node)); return retVal; }
@Override public SStmIR caseACyclesStm(ACyclesStm node, IRInfo question) throws AnalysisException { PExp cycles = node.getCycles(); PStm stm = node.getStatement(); SExpIR cyclesCg = cycles.apply(question.getExpVisitor(), question); SStmIR stmCg = stm.apply(question.getStmVisitor(), question); ACyclesStmIR cycStm = new ACyclesStmIR(); cycStm.setCycles(cyclesCg); cycStm.setStm(stmCg); return cycStm; }
return node.getStatement().apply(VdmRuntime.getStatementEvaluator(), ctxt); } else Value rv = node.getStatement().apply(VdmRuntime.getStatementEvaluator(), ctxt); me.inOuterTimestep(false); me.duration(ctxt.threadState.CPU.getDuration(cycles), ctxt, node.getLocation());
@Override public PType caseACyclesStm(ACyclesStm node, TypeCheckInfo question) throws AnalysisException { PDefinition encl = question.env.getEnclosingDefinition(); if (encl != null && encl.getAccess().getPure()) { TypeCheckerErrors.report(3346, "Cannot use cycles in pure operations", node.getLocation(), node); } Environment newEnv = new FlatEnvironment(question.assistantFactory, question.env, true); TypeCheckInfo functional = question.newInfo(newEnv); PType argType = node.getCycles().apply(THIS, functional); if (!question.assistantFactory.getTypeComparator().compatible(AstFactory.newANatNumericBasicType(node.getLocation()), argType)) { TypeCheckerErrors.report(3282, "Arguments to cycles must be a nat", node.getLocation(), node); TypeCheckerErrors.detail("Actual", argType); } return node.getStatement().apply(THIS, question); }