【发布时间】:2018-06-21 12:21:24
【问题描述】:
这是我的parser.y
stmt : type var { insertVar($2); cout<< "inserted"<<endl;} LCURL other RCURL {
//other jobs
}
;
和lex.l
"{" { cout<<"after insertion"<<endl; return LCURL;}
当我使用 .c 文件运行这些时,输出如下:
after insertion
inserted
我的预期输出是:
inserted
after insertion
为什么会这样?
【问题讨论】:
标签: compiler-construction bison flex-lexer yacc bisonc++