Hi
I'm a little confused about how to specify my grammar member's type. I want to declare prog and decls as ASTNode. I'm gonna use these members for adding to a list or etc. But yacc can't recognize them as an ASTNode and I get type errors.
Here my tIdent,tCharConst,tIntConstant have some types but, how to give ASTNode type to my members.
%union{
int ival;
char cval;
char *sval;
struct ASTNode *nval;
}
%token <sval> tIdent
%token <cval> tCharConst
%token <ival> tIntConst
prog : decls ;
decls : /* empty */
| decls decl
;