0
我使用JFLEX,byacc,JAVA解析声明它看起来像YACC /野牛鉴定结果在行动
where expr,expr having expr
和语法看起来像
%token WHERE HAVING COMMA
%%
stmt : whereclause havingclause
whereclause : WHERE conditionlist { move tmpList to whereClause};
havingclause : HAVING conditionlist { move tmpList to havingClause};
conditionlist : condition | condition COMMA conditionlist;
condition : expr { tmpList.add($1);
/How do I know this is being executed for whereclause or havingclause /};
expr : ....
我不能够区分如果条件是where条款或having条款的一部分,那么我将条件存储在临时列表中,然后移至正确的条款。 这样做的正确方法是什么?