@Override public PStm caseAThreadDefinition(AThreadDefinition def, Integer lineno) throws AnalysisException { return af.createPStmAssistant().findStatement(def.getStatement(), lineno); }
@Override public PExp caseAThreadDefinition(AThreadDefinition def, Integer lineno) throws AnalysisException { return af.createPStmAssistant().findExpression(def.getStatement(), lineno); }
public AExplicitOperationDefinition getThreadDefinition(AThreadDefinition d) { AOperationType type = AstFactory.newAOperationType(d.getLocation()); // () ==> () AExplicitOperationDefinition def = AstFactory.newAExplicitOperationDefinition(d.getOperationName(), type, new Vector<PPattern>(), null, null, d.getStatement().clone()); def.setAccess(d.getAccess().clone()); def.setClassDefinition(d.getClassDefinition()); return def; }
@Override public PType caseAThreadDefinition(AThreadDefinition node, TypeCheckInfo question) throws AnalysisException { question.scope = NameScope.NAMESANDSTATE; FlatEnvironment local = new FlatEnvironment(question.assistantFactory, question.assistantFactory.createPDefinitionAssistant().getSelfDefinition(node), question.env); PType rt = node.getStatement().apply(THIS, new TypeCheckInfo(question.assistantFactory, local, question.scope)); if (!(rt instanceof AVoidType) && !(rt instanceof AUnknownType)) { TypeCheckerErrors.report(3049, "Thread statement/operation must not return a value", node.getLocation(), node); } node.setType(rt); node.getOperationDef().setBody(node.getStatement().clone());// This // operation // is a // wrapper // for the // thread return rt; }
if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) node.getStatement().apply(this, question);
if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) node.getStatement().apply(this);
if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) node.getStatement().apply(this);
if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) mergeReturns(retVal,node.getStatement().apply(this));
if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) mergeReturns(retVal,node.getStatement().apply(this, question));