悦耳白开水

文章
3
资源
1
加入时间
3年10月29天

flex和bison实例分析

创建test.l文件,编写词法分析规则%{ #include <stdio.h> #include "test_yacc.h" //因为使用了bison在test_yacc.h中自动生成的token枚举 extern int yylval; //yylval定义在bison库中%}number [0-9]%%{number}+ { yylval = atoi(yytext); printf("number: %d ...