Ignoring errors in yacc/lex

梦想与她 提交于 2019-12-02 09:04:04

just add a rule that looks like

. {
  // do nothing
}

at the bottom of all of your rules, and it will just ignore everything it comes across that doesn't fit any of the previous rules.

Edit: if you have multiple states, then a catch-all that works in any state would then look like:

<*>. {

}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!