inAMutexSyncDefinition(node, question); if(node.getName() != null ) node.getName().apply(this, question); if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) node.getClassDefinition().apply(this, question); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) node.getAccess().apply(this, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this, question); List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getOperations()); for( ILexNameToken e : copy)
public PExp getExpression(AMutexSyncDefinition sync, ILexNameToken excluding) { LexNameList list = null; if (sync.getOperations().size() == 1) { list = new LexNameList(); list.addAll(sync.getOperations()); } else { list = new LexNameList(); list.addAll(sync.getOperations()); list.remove(excluding); } return AstFactory.newAEqualsBinaryExp(AstFactory.newAHistoryExp(sync.getLocation(), new LexToken(sync.getLocation(), VDMToken.ACTIVE), list), new LexKeywordToken(VDMToken.EQUALS, sync.getLocation()), AstFactory.newAIntLiteralExp(new LexIntegerToken(0, sync.getLocation()))); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof AMutexSyncDefinition) { return toString().equals(o.toString()); } return false; }
if (node.getOperations().isEmpty()) for (PDefinition def : node.getClassDefinition().apply(question.assistantFactory.getDefinitionCollector())) && !def.getName().getName().equals(classdef.getName().getName())) node.getOperations().add(def.getName()); for (ILexNameToken opname : node.getOperations()) for (ILexNameToken other : node.getOperations())
for (ILexNameToken opname : new LexNameList(sync.getOperations())) PExp exp = getExpression(sync.clone(), opname); ValueList overloads = members.getOverloads(opname);
@Override public SDeclIR caseAMutexSyncDefinition(AMutexSyncDefinition node, IRInfo question) throws AnalysisException { LinkedList<ILexNameToken> operations = node.getOperations(); AMutexSyncDeclIR mutexdef = new AMutexSyncDeclIR(); for (ILexNameToken opname : operations) { ATokenNameIR token = new ATokenNameIR(); token.setName(opname.getName()); mutexdef.getOpnames().add(token); } return mutexdef; }
@Override public PType caseAMutexSyncDefinition(AMutexSyncDefinition node) throws AnalysisException { return AstFactory.newAUnknownType(node.getLocation()); }
inAMutexSyncDefinition(node); if(node.getName() != null ) node.getName().apply(this); if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) node.getClassDefinition().apply(this); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) node.getAccess().apply(this); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this); List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getOperations()); for( ILexNameToken e : copy)
for (ILexNameToken mop : mdef.getOperations()) for (ILexNameToken op : mdef.getOperations()) PExp hexp = AstFactory.newAHistoryExp(mdef.getLocation(), new LexToken(new LexLocation(), VDMToken.ACTIVE), ops); LexNameToken name = new LexNameToken(octxt.self.type.getName().getModule(), hexp.toString(), mdef.getLocation()); vars.put(name, v); } catch (Throwable e)
@Override public Boolean caseAMutexSyncDefinition(AMutexSyncDefinition node, Object other) throws AnalysisException { if (other instanceof AMutexSyncDefinition) { return node.toString().equals(other.toString()); } return false; }
inAMutexSyncDefinition(node); if(node.getName() != null ) node.getName().apply(this); if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) node.getClassDefinition().apply(this); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) node.getAccess().apply(this); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this); List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getOperations()); for( ILexNameToken e : copy)
for (ILexNameToken mop : mdef.getOperations()) for (ILexNameToken op : mdef.getOperations()) PExp hexp = AstFactory.newAHistoryExp(mdef.getLocation(), new LexToken(null, VDMToken.ACTIVE), ops); LexNameToken name = new LexNameToken(octxt.self.type.getName().getModule(), hexp.toString(), mdef.getLocation()); vars.put(name, v); } catch (Throwable e)
mergeReturns(retVal,inAMutexSyncDefinition(node)); if(node.getName() != null ) mergeReturns(retVal,node.getName().apply(this)); if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) mergeReturns(retVal,node.getClassDefinition().apply(this)); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) mergeReturns(retVal,node.getAccess().apply(this)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) mergeReturns(retVal,node.getType().apply(this)); List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getOperations()); for( ILexNameToken e : copy)
mergeReturns(retVal,inAMutexSyncDefinition(node, question)); if(node.getName() != null ) mergeReturns(retVal,node.getName().apply(this, question)); if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) mergeReturns(retVal,node.getClassDefinition().apply(this, question)); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) mergeReturns(retVal,node.getAccess().apply(this, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) mergeReturns(retVal,node.getType().apply(this, question)); List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getOperations()); for( ILexNameToken e : copy)