/**
  * Builds SQL statement from a node. 
  * 
  * The method uses node type to dispatche actual SQL generation to the 
  * node's proper handler - a method start with buildSql and appended 
  * with the node type. Examples: 
  * 
  * buildSqlAdd() handles all nodes with type EXP_N_EXPR_ADD, and 
  * buildSqlSelect() handles the EXP_N_EXPR_SELECT node.
  * 
  * @return string
  * @throws epExceptionQueryBuilder
  */
 protected function buildSql(epQueryNode &$node)
 {
     // get type without
     $type = str_replace(array('EPQ_N_EXPR_', 'EPQ_N_FUNC_', 'EPQ_N_'), '', $node->getType());
     // the build sql method for this type
     $method = 'buildSql' . ucfirst(strtolower($type));
     // call the method
     $sql = $this->{$method}($node);
     // debug info if in verbose mode
     if ($this->verbose) {
         echo "\n";
         echo "method: {$method}\n";
         echo "node:\n";
         echo $node;
         echo "\n";
         echo "result: " . print_r($sql, true) . "\n";
         echo "\n";
     }
     return $sql;
 }