Flex 的常见困难++

发布于 2024-11-19 09:45:37 字数 1000 浏览 8 评论 0原文

注意:拥有超过 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 也是 Adob​​e 技术 - 它不是我正在使用的工具。 SO 上的 Flex 标签适用于 Adob​​e 产品(因此标签上有徽标)。谢谢 :)。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

筑梦 2024-11-26 09:45:37

检查你的行结尾吗? CR+LF 与 NL 在这里可能会有所不同。

Check your line-endings? CR+LF vs NL might make a difference here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文