This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#define TOTAL 50 | |
int yyerror(char const *s); | |
typedef struct tnode{ | |
int flag; //indicate whether the node is a leaf(0: number; 1: variable) or internal node(2: operator) | |
// char *varname; //name of the variable | |
// int val; //value of the expression tree | |
struct variable *var; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct tnode{ | |
int flag; //indicate whether the node is a leaf(0: number; 1: variable) or internal node(2: operator) | |
char *varname; //name of the variable | |
int val; //value of the expression tree | |
char *op; //operator branch | |
struct tnode *left, *right; //left and right node | |
}tnode; |
NewerOlder