bison only reads one line [closed]

蹲街弑〆低调 提交于 2019-11-29 18:25:37

Your grammar's start non-terminal is called "linea", and for good reason: it defines exactly one line (una línea). Bison parsers recognize precisely the start non-terminal followed by an end-of-file, so if your input contains more than one line, the parser will report a syntax error when it encounters something other than an EOF after the first line.

If you want to recognize multiple lines, you need to write a grammar which matches multiple lines:

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