Other display types

This commit is contained in:
Dane Johnson 2021-12-08 15:12:41 -06:00
parent 148abaf5ab
commit ea8df64acd

View File

@ -19,7 +19,7 @@ NumNode::NumNode(float num) {
} }
void NumNode::display() { void NumNode::display() {
cout << num;
} }
StringNode::StringNode(string* stringVal) { StringNode::StringNode(string* stringVal) {
@ -27,7 +27,7 @@ StringNode::StringNode(string* stringVal) {
} }
void StringNode::display() { void StringNode::display() {
cout << *stringVal;
} }
OpNode::OpNode(int op, Node *first, Node *second) { OpNode::OpNode(int op, Node *first, Node *second) {
@ -37,7 +37,9 @@ OpNode::OpNode(int op, Node *first, Node *second) {
} }
void OpNode::display() { void OpNode::display() {
first->display();
cout << " " << (char)op << " ";
second->display();
} }
void print_expression_list(NodeList *list) { void print_expression_list(NodeList *list) {