lex&yacc2

YACC:

每个归约后yacc 都执行默认动作,在运行任何明确的动作代码之前,将值$1 赋介$$.

下面是从这个语法中生成的 y.tab.h:
#define NAME 257
#define NUMBER 258
#define UMINUS 259
typedef union {
double dval;
int vblno;
}YYSTYPE;
extern YYSTYPE yylval;

$$ 's type

how can we know the action in yacc, $1... parameters of the function make the action consisty.

原文地址:https://www.cnblogs.com/orchid-sky/p/3638600.html