lex : How to override YY_BUF_SIZE

这一生的挚爱 提交于 2019-12-10 21:27:18

问题


According to the manual YY_BUF_SIZE is 16K and we need to override it. However, the manual does not specify how to override it, nor could I find any command line option for this. Can someone please indicate how to change this. In the generated source YY_BUF_SIZE is defined as follows:

#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE 16384
#endif

so there may be a way to override it before this.


回答1:


In your own code, simply #define YY_BUF_SIZE to whatever value you want. As long as you compile your code so the compiler sees your definition first, the #ifndef guard will prevent the default value from being set.



来源:https://stackoverflow.com/questions/18607133/lex-how-to-override-yy-buf-size

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