1

http://linuxgazette.net/106/chirico.html 在示例 1 中,结果打印在 example1.y 中,但我想在 main.c 中处理该结果。我怎样才能做到这一点?

4

1 回答 1

1

结果被打印,因为输入说program ::= ... { std::cout << ... }. 即解析结果由顶级规则处理。

您可能想使用%extra_argument { MyClass *pThis }. Lemon 然后将添加第 4 个参数,Parse该参数在操作规则中可用,如pThis.

于 2013-12-30T13:17:53.673 回答