Ejemplo n.º 1
0
  @Override
  public SStmCG caseAAssignmentStm(AAssignmentStm node, IRInfo question) throws AnalysisException {
    PStateDesignator target = node.getTarget();
    PExp exp = node.getExp();

    SStateDesignatorCG targetCg = target.apply(question.getStateDesignatorVisitor(), question);
    SExpCG expCg = exp.apply(question.getExpVisitor(), question);

    AAssignmentStmCG assignment = new AAssignmentStmCG();
    assignment.setTarget(targetCg);
    assignment.setExp(expCg);

    return assignment;
  }
Ejemplo n.º 2
0
  @Override
  public SStmCG caseAAtomicStm(AAtomicStm node, IRInfo question) throws AnalysisException {
    AAtomicStmCG atomicBlock = new AAtomicStmCG();

    for (AAssignmentStm assignment : node.getAssignments()) {
      SStmCG stmCg = assignment.apply(question.getStmVisitor(), question);

      if (stmCg != null) {
        atomicBlock.getStatements().add(stmCg);
      } else {
        return null;
      }
    }

    return atomicBlock;
  }
Ejemplo n.º 3
0
  public AssignmentContext(AAssignmentStm node, IPogAssistantFactory af, IPOContextStack ctxt)
      throws AnalysisException {
    super(ctxt);
    String hash = node.getTarget().apply(af.getStateDesignatorNameGetter());

    t = null;

    for (ILexNameToken n : last_vars.keySet()) {
      if (n.getName().equals(hash)) {
        t = last_vars.get(n).getName().clone();
        break;
      }
    }
    if (t == null) {
      t = new LexNameToken("", hash, null);
    }
    subLast = new Substitution(new LexNameToken("", hash, null), node.getExp().clone());
    sub = new Substitution(t, node.getExp().clone());

    this.visitor = af.getVarSubVisitor();
  }