我定義我的結構工會內部對野牛錯誤:之前預計符限定符列表「TR」
我做了一個結構的問題
typedef enum {Binary_Op,Uni_Op,Variable, Const} Tag_Type;
typedef struct tree
{
Tag_Type Tag;
union
{
struct
{
char op;
struct tree *left, *right;
}bin_op;
struct
{
char op;
struct tree *arg; /* negative or positive */
}uni_op;
char var;
int const_val;
}u;
}TREE_REC, *TR;
%}
%union
{
int y_int;
TR y_tree;
}
%type <y_tree> expr term factor assign
%token <y_int> CONST
%token <y_int> VAR
%%
但工會裏面TR有錯誤。我不明白爲什麼!任何幫助?
您能提供錯誤信息嗎? – 2011-03-11 21:27:29
錯誤:'TR'前的預期說明符 - 限定符列表 – Kevin 2011-03-11 21:31:12