看板 b93902HW 關於我們 聯絡資訊
※ 引述《wens ( )》之銘言: : ※ 引述《sophialiege (with friends)》之銘言: : : The precise specification is already annouced and two more test cases : : are online now. : : -tsai- : 發現只要用 error, : yacc 一定會印 syntax error. : 有沒有辦法避免他印出來啊? 我想我知道為什麼你的會印"syntax error"了 因為error token出現會去call yyerror而你的yyerror大概是這樣寫 void yyerror(const char* str){ .... cout << str << endl; .... } 我的寫法是 void yyerror(const char* str){ /* do nothing, make compiler happy only */ } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.217.61