Exemplo n.º 1
0
 /** {@inheritDoc} */
 @Override
 public KillGenAE visitWhileStatement(
     IStatement statement, IStatement condition, IStatement body, Context context) {
   condition.visit(this, context);
   body.visit(this, context);
   return context.result;
 }
Exemplo n.º 2
0
 /** {@inheritDoc} */
 @Override
 public KillGenAE visitStatementList(IStatement statement, IStatement root, Context context) {
   while (root != null) {
     root.visit(this, context);
     root = root.getNext();
   }
   return context.result;
 }
Exemplo n.º 3
0
 /** {@inheritDoc} */
 @Override
 public KillGenAE visitUnaryStatement(
     IStatement statement, UnaryOperator operator, IStatement value, Context context) {
   // Gen.
   for (IStatement a : statement.aexp()) {
     context.result.gen(statement.getLabel(), a);
   }
   return context.result;
 }
Exemplo n.º 4
0
 /** {@inheritDoc} */
 @Override
 public KillGenAE visitIfStatement(
     IStatement statement,
     IStatement condition,
     IStatement bodyTrue,
     IStatement bodyFalse,
     Context context) {
   condition.visit(this, context);
   bodyTrue.visit(this, context);
   if (bodyFalse != null) {
     bodyFalse.visit(this, context);
   }
   return context.result;
 }
Exemplo n.º 5
0
 /** {@inheritDoc} */
 @Override
 public KillGenAE visitBinaryStatement(
     IStatement statement,
     IStatement left,
     BinaryOperator operator,
     IStatement right,
     Context context) {
   // Gen.
   if (operator.isRelational()) {
     for (IStatement a : statement.aexp()) {
       context.result.gen(statement.getLabel(), a);
     }
   }
   return context.result;
 }
Exemplo n.º 6
0
 /** {@inheritDoc} */
 @Override
 public KillGenAE visitAssignStatement(
     IStatement statement, String variable, IStatement value, Context context) {
   // Kill.
   for (IStatement a : context.aexp) {
     if (a.fv().contains(variable)) {
       context.result.kill(statement.getLabel(), a);
     }
   }
   // Gen.
   for (IStatement a : value.aexp()) {
     if (!a.fv().contains(variable)) {
       context.result.gen(statement.getLabel(), a);
     }
   }
   return value.visit(this, context);
 }
Exemplo n.º 7
0
 /** {@inheritDoc} */
 @Override
 public KillGenAE visitBlockStatement(
     IStatement statement, IStatement root, boolean parentheses, Context context) {
   return root.visit(this, context);
 }