本文整理汇总了C++中Automate::PopSymbole方法的典型用法代码示例。如果您正苦于以下问题:C++ Automate::PopSymbole方法的具体用法?C++ Automate::PopSymbole怎么用?C++ Automate::PopSymbole使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Automate
的用法示例。
在下文中一共展示了Automate::PopSymbole方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
bool E10::Transition ( Automate & automate, Symbole * s )
{
switch(*s)
{
case VAR:
case CONST:
case LIRE:
case ECRIRE:
case ID:
case FIN:
{
//Symbole * point_virgule =
delete automate.PopSymbole();
ListeDeclaration * d = (ListeDeclaration *) automate.PopSymbole();
PartieDeclarative * pd = (PartieDeclarative *) automate.PopSymbole();
if( ! pd->AjouterDeclarations(d) )
{
// nettoyer les Declaration
for(Declaration * decl : d->GetListeDeclarations())
{
delete decl;
}
delete d;
for(auto & decl : pd->GetDeclarations())
{
delete decl.second;
}
delete pd;
throw DOUBLE_DECLARATION;
}
else
{
delete d;
automate.Reduction(pd, 3);
return true;
}
}
}
return false;
}
示例2: switch
bool E2::Transition ( Automate & automate, Symbole * s )
{
switch(*s)
{
case LIRE:
{
automate.Decalage(s, new E7);
return true;
}
case ECRIRE:
{
automate.Decalage(s, new E8);
return true;
}
case ID:
{
automate.Decalage(s, new E9);
return true;
}
case FIN:
{
PartieInstructions * pi = (PartieInstructions *) automate.PopSymbole();
PartieDeclarative * pd = (PartieDeclarative *) automate.PopSymbole();
Programme * prog = new Programme(pd->GetDeclarations(), pi->GetInstructions());
delete pi;
delete pd;
//réduire R0
automate.Reduction(prog, 2);
return true;
}
case I:
{
automate.Decalage(s, new E6);
return true;
}
}
return false;
}
示例3: switch
bool E13::Transition ( Automate & automate, Symbole * s )
{
switch(*s)
{
case VIRGULE:
{
automate.Decalage(s, new E25);
return true;
}
case POINT_VIRGULE:
{
ListeIdentifiantsValeurs * lidv = (ListeIdentifiantsValeurs *) automate.PopSymbole();
lidv->SetIdent(D);
//Symbole * constante =
delete automate.PopSymbole();
//réduire R4
automate.Reduction(lidv, 2);
return true;
}
}
return false;
}