2
SableCC 및 문법 정의에 처음 경험했습니다. 나는 (그 일부) 다음과 같은 문법을 가지고SableCC와의 시프트/줄이기
query =
{atop} attroperator |
{query_par} l_par query r_par |
{query_and} [q1]:query logic_and [q2]:query |
{query_or} [q1]:query logic_or [q2]:query |
{query_not} logic_not query ;
I가 다음과 같은 오류 :
shift/reduce conflict in state [stack: PCommand TLogicNot PQuery *] on
TRPar in {
[ PQuery = PQuery * TRPar ] (shift),
[ PQuery = TLogicNot PQuery * ] followed by TRPar (reduce)
}
shift/reduce conflict in state [stack: PCommand TLogicNot PQuery *] on
TLogicAnd in {
[ PQuery = PQuery * TLogicAnd PQuery ] (shift),
[ PQuery = TLogicNot PQuery * ] followed by TLogicAnd (reduce)
}
shift/reduce conflict in state [stack: PCommand TLogicNot PQuery *] on
TLogicOr in {
[ PQuery = PQuery * TLogicOr PQuery ] (shift),
[ PQuery = TLogicNot PQuery * ] followed by TLogicOr (reduce)
}
내가 l_par를 추가하여 해결하고 모든 대안에 r_par 방법으로하는, 가독성을 높여야하지만 우아한 방식으로이를 수행 할 수있는 방법이 있습니까?
감사합니다.