Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在C++中使用LEX或YACC中的移位、缩小、错误、接受和冲突关键字?_C++_Yacc_Lex - Fatal编程技术网

如何在C++中使用LEX或YACC中的移位、缩小、错误、接受和冲突关键字?

如何在C++中使用LEX或YACC中的移位、缩小、错误、接受和冲突关键字?,c++,yacc,lex,C++,Yacc,Lex,这些关键词的含义是什么: 转移、减少、错误、接受、冲突 请详细描述每一项 switch ( oAction) { case SSYaccAction::shift: oElement = shift( lookahead()); if ( !oElement) return SSTrue; oElement->oLexeme = lookahead(); oElement->oulState = state(); pu

这些关键词的含义是什么:

转移、减少、错误、接受、冲突

请详细描述每一项

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()

@克利比写道:


你读过雅克吗?这包含了对上述内容的清晰解释,以及许多其他信息,可以帮助您开始学习


你读过雅克吗?这包含了对以上内容的清晰解释,以及许多其他信息,可以帮助您开始。对不起,链接错误,我现在已经更新了!抱歉,没有链接…请单击我上面评论中的word文档:
reduce(production(), productionSize())