Flex 的常见困难++
注意:拥有超过 1500 个代表的人..请添加 flex++ 和 bison++ 作为标签:)。
似乎整个 Internet 上的人们都在使用 Flex++ 时遇到以下错误:
scanner.l:1: bad character: %
scanner.l:1: unknown error processing section 1
这种情况发生在我提供的 Flex++ 的任何示例中。我的版本来自这里,我已经尝试了确切的示例该页面我仍然收到这些错误。我已经在 Linux 和 Mac 上尝试过,但完全没有想法了!
看起来 Flex++ 也是一种旧病毒的名称,因此很难进行有用的讨论!
编辑:
这是一个产生上述错误的示例(取自上面链接的示例的前几行):
%name CalcScanner
%define IOSTREAM
%define LEX_PARAM YY_CalcParser_STYPE *val, YY_CalcParser_LTYPE *loc
%define MEMBERS public: int line, column;
%define CONSTRUCTOR_INIT : line(1), column(1)
%header{
#include<sstream>
#include "parser.h"
%}
任何帮助都会非常好。
编辑2:请人们不要通过放入“flex”标签来编辑这篇文章吗? Flex 将是我用来标记的东西,但 Flex 也是 Adobe 技术 - 它不是我正在使用的工具。 SO 上的 Flex 标签适用于 Adobe 产品(因此标签上有徽标)。谢谢 :)。
Note: Someone with over 1500 rep.. please add flex++ and bison++ as tags :).
Seems like people all over the Internet have been getting the following errors with Flex++:
scanner.l:1: bad character: %
scanner.l:1: unknown error processing section 1
This happens on any example I give Flex++. The version I have is from here and I have tried the exact examples on that page and I still get these errors. I've tried on Linux and Mac and have completely run out of ideas!
Seems like Flex++ is a name for an old virus out there too so it's particularly hard getting useful discussion!
EDIT:
Here's an example that produces the above error (first few lines from example taken from the link above):
%name CalcScanner
%define IOSTREAM
%define LEX_PARAM YY_CalcParser_STYPE *val, YY_CalcParser_LTYPE *loc
%define MEMBERS public: int line, column;
%define CONSTRUCTOR_INIT : line(1), column(1)
%header{
#include<sstream>
#include "parser.h"
%}
Any help would be more than fantastic.
EDIT 2: Please can people not edit this post by putting the 'flex' tag in? Flex would be what I would use to tag but Flex is also an Adobe technology - it's NOT the tool I am using. The flex tag on SO is for the Adobe product (hence the logo on the tag). Thank you :).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查你的行结尾吗? CR+LF 与 NL 在这里可能会有所不同。
Check your line-endings? CR+LF vs NL might make a difference here.