next up previous
Next: Initialization and Execution Up: Interpret the Program Previous: Print statements

   
Rules without computation

VisitOpExp didn't do any computation of its own, but simply sequenced the computations of its children. Both VisitCompoundStm and VisitEseqExp also have this property:

Interpret VisitCompoundStm and VisitEseqExp rules[21] :

void Interpreter::VisitCompoundStm(CompoundStm* node)
{ (node->Child1())->Accept(this);
  (node->Child2())->Accept(this);
}

void Interpreter::VisitEseqExp(EseqExp* node)
{ (node->Child1())->Accept(this);
  (node->Child2())->Accept(this);
}
This macro is invoked in definition 28.

Although these nodes seem uninteresting, they are vital as implementations of the left-to-right evaluation semantics of the language.



William Waite
1998-08-30