text: #include "ast.h"
  
  using namespace AST;
  
  /* Print methods */
  void Integer::printTree(){
      std::cout << value;
      return;
  }
  
  void Identifier::printTree(){
    std::cout << name << " = " << value;
    if(nextIdent != nullptr){
      std::cout << ", ";
      nextIdent->printTree();
    }
    return;
  }
  
  void BinOp::printTree(){
      left->printTree();
      switch(op){
          case plus: std::cout << " + "; break;
          case multiply: std::cout << " * "; break;
      }
      right->printTree();
      return;
  }
  
  void Block::printTree(){
      for (Node* line: lines) {
          line->printTree();
          std::cout << std::endl;
      }
  }
  
  /* Compute methods */
  int Integer::computeTree(){
      return value;
  }
  
  int Identifier::computeTree(){
    return value;
  }
  
  int BinOp::computeTree(){
      int value, lvalue, rvalue;
      lvalue = left->computeTree();
      rvalue = right->computeTree();
      switch(op){
           case plus: value = lvalue + rvalue; break;
           case multiply: value = lvalue * rvalue; break;
      }
      return value;
  }
  
  int Block::computeTree(){
      int value;
      for (Node* line: lines) {
          value = line->computeTree();
          std::cout << "Computed " << value << std::endl;
      }
      return 0;
  }
  