public class SL_WhileNode extends ParseNode {
  // child 0: expr
  // child 1: block

  public int getType() { return G_WHILE; }
  public ParseNode interpret(SymbolTable st) 
    throws InterpretException, ReturnException {
      try { 
	SL_NumberNode v=null;
	while (true) {
	  v = (SL_NumberNode) getChild(0).interpret(st);
	  if (v.getValue().intValue()==0) break; // evaluate condition
	  getChild(1).interpret(st);    // execute body
	}
      }
      catch (BreakException b) {
	// this suffices to break out of the while loop.  
      }
      return new SL_NopNode(); 
  }
}
