public class SL_FunctionNode extends ParseNode {
  // child 0: name
  // child 1...numChildren()-2: args
  // child numChildren()-1: body
  
  public int getType() { return G_FUNCTION; }
  public int numArgs() { return numChildren()-2; }

  public String getArgument(int i) { 
    return ((SL_IdentNode) children.elementAt(1+i)).getName();
  }
  
  public ParseNode getBody() { 
    return (ParseNode) children.elementAt(numChildren()-1); 
  }

  public ParseNode interpret(SymbolTable st) throws InterpretException {
    // to 'interpret' a function simply means to bind the
    // name to the body in the symbol table 

    // write me 
    return null;
  }
  
  private String getName() { 
    return ((SL_IdentNode) children.elementAt(0)).getName();
  }
}

