这些关键字的含义是什么:
shift
,reduce
,error
,accept
,conflict
?
请详细说明每一项。
switch ( oAction)
{
case SSYaccAction::shift:
oElement = shift( lookahead());
if ( !oElement) return SSTrue;
oElement->oLexeme = lookahead();
oElement->oulState = state();
push();
if ( getLexeme()) return SSTrue;
oulError++;
break;
case SSYaccAction::reduce:
oElement = reduce( production(), productionSize());
if ( !oElement) return SSTrue;
pop( productionSize());
if ( goTo( leftside())) return SSTrue;
break;
case SSYaccAction::error:
oError = SSTrue;
if ( error( state(), lookahead()))
return SSTrue;
oulError = 0;
break;
case SSYaccAction::accept:
return accept();
default:
throwException( SSExceptionYaccParse, SSYaccMsgParse);
return SSTrue;
在上面的代码中,
的含义是什么lookahead()
和
reduce(production(), productionSize())
答案 0 :(得分:0)