0
%{
#ifdef abc
.
.
. // C declarations
.
%}
.
. // Yacc Declaration
.
%%
.
. //expected inputs and corresponding actins
.
%%
#endif
尽管此代码编译为我连话,我强烈地感受到#ifdef abc
放置不正确。这种类型的代码是否适用于Yacc。这种类型的yacc代码是否有效?
我在YACC很少有经验。
由于
我怀疑这是有效的,而不是试图欺骗YACC本身,把条件宏放在你的代码。 – 2012-07-13 06:11:33
@ H2CO3我知道,但奇怪的是,这段代码编译并按预期工作 – 2012-07-13 06:15:52