是否有关于 re2c + 柠檬的良好工作教程?

Is there a good working tutorial on re2c + lemon?

我试过几个。在 Google 中只有几个关于 re2c+lemon 的教程。
目前,对于所有示例,我都会遇到类似的一堆错误,例如:

In file included from main.cpp:2:0:
parser.y:44:5: error: ‘yygotominor’ was not declared in this scope
     A.int_value = B.int_value * C.int_value;
     ^
In file included from main.cpp:2:0:
parser.c:770:16: error: ‘YY_MAX_SHIFTREDUCE’ was not declared in this scope
   if( yyact <= YY_MAX_SHIFTREDUCE ){
                ^
parser.c:771:15: error: ‘YY_MAX_SHIFT’ was not declared in this scope
     if( yyact>YY_MAX_SHIFT ) yyact += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
               ^

在哪里声明的?

PS:不要post 10 年的旧文章(即使没有代码或者代码现在无法编译)。如果可以 - 在这里写一个例子。如果不是 - 不要 post 来自 Google 的链接。

本教程适合我:

  1. 获取 re2c(有关详细信息,请参阅 re2c 安装页面 http://re2c.org/install/install.html)。

  2. 获取 lemon:下载 tarball wget http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz,解压缩并构建(我不得不将 #include <stdlib.h> 添加到 malloc 的许多示例中)。

  3. 克隆 github 回购 https://github.com/tokuhirom/re2c-lemon-tutorial : git clone https://github.com/tokuhirom/re2c-lemon-tutorial.git

  4. 补丁 re2c-lemon-tutorial/Makefile 以查找 lemon 和 re2c(如果需要)。

  5. make./mycalc 并享受(点击 Ctrl+D 停止并发出结果)。

re2c 网站上的更多 re2c 示例:http://re2c.org,柠檬压缩包中的更多柠檬示例。