Exemplo n.º 1
0
Repeat *Repeat::create(FiniteTimeAction *action, unsigned int times)
{
    Repeat *repeat = new(std::nothrow) Repeat();
    repeat->initWithAction(action, times);

    return repeat;
}
Exemplo n.º 2
0
Repeat* Repeat::create(FiniteTimeAction *pAction, unsigned int times)
{
    Repeat* pRepeat = new Repeat();
    pRepeat->initWithAction(pAction, times);
    pRepeat->autorelease();

    return pRepeat;
}
Exemplo n.º 3
0
// Piece ::= Atom [ Repeat ]
Instruction* ParsePiece(const char **ppc, ParseInfo &info)
{
  Instruction *i = ParseAtom(ppc, info);
  if (i)
  {
    bool failed = false;
    Repeat *r = ParseRepeat(ppc, failed, info);
    if (r)
    {
      r->setInstruction(i);
      i = r;
    }
    else if (failed)
    {
      delete i;
      return 0;
    }
  }
  return i;
}