CS143-Lab/assignments/PA3/tree.cc
2023-03-16 15:55:37 +00:00

50 lines
1.1 KiB
C++

//
// See copyright.h for copyright notice and limitation of liability
// and disclaimer of warranty provisions.
//
#include "copyright.h"
///////////////////////////////////////////////////////////////////////////
//
// file: tree.cc
//
// This file defines the basic class of tree node
//
///////////////////////////////////////////////////////////////////////////
#include "tree.h"
/* line number to assign to the current node being constructed */
int node_lineno = 1;
///////////////////////////////////////////////////////////////////////////
//
// tree_node::tree_node
//
// constructor of tree node
//
///////////////////////////////////////////////////////////////////////////
tree_node::tree_node()
{
line_number = node_lineno;
}
///////////////////////////////////////////////////////////////////////////
//
// tree_node::get_line_number
//
///////////////////////////////////////////////////////////////////////////
int tree_node::get_line_number()
{
return line_number;
}
//
// Set up common area from existing node
//
tree_node *tree_node::set(tree_node *t) {
line_number = t->line_number;
return this;
}