Logo Search packages:      
Sourcecode: maria version File versions

void Transition::display ( const class Printer printer  )  const

Display the transition definition

Parameters:
printer the printer object

Definition at line 3328 of file Transition.C.

References slist< T >::begin(), Printer::delimiter(), Expression::display(), Marking::display(), slist< T >::empty(), slist< T >::end(), Printer::finish(), Arc::getExpr(), getName(), VariableDefinition::getName(), Type::getName(), Type::getSyntacticName(), VariableDefinition::getType(), Printer::linebreak(), myEnabledCond, myEnabledSet, myGates, myInputs, myKind, myName, myNumInputs, myOutputs, myPriority, myStronglyFairSet, myWeaklyFairSet, Printer::print(), and Printer::printRaw().

{
  printer.printRaw ("trans");
  printer.delimiter (' ');
  printer.print (myName);
  if (myPriority)
    printer.delimiter (' '), printer.print (myPriority);
  printer.finish ();
  if (myKind) {
    printer.printRaw (myKind == tFatal ? "gate fatal" : "gate undefined");
    printer.finish ();
  }

  if (myOutputVariables) {
    printer.delimiter ('{')++.linebreak ();

    for (QuantifierList::const_iterator i = myOutputVariables->begin ();
       i != myOutputVariables->end (); i++) {
      const class VariableDefinition& v = (*i)->getVariable ();
      if (const char* name = v.getType ().getName ())
      printer.print (name);
      else
      printer.print (v.getType ().getSyntacticName ());
      printer.delimiter (' ');
      printer.print (v.getName ());
      printer.delimiter ('!');
      if (const class Expression* cond = (*i)->getCondition ()) {
      printer.delimiter ('(')++;
      cond->display (printer);
      --printer.delimiter (')');
      }
      printer.delimiter (';');
      printer.linebreak ();
    }
    printer--;
    printer.linebreak ();
    printer.delimiter ('}').finish ();
  }
  unsigned i;
  if (myNumInputs) {
    printer.finish ();
    printer.printRaw ("in ");
    printer.delimiter ('{')++;
    for (i = 0; i < myNumInputs; i++) {
      printer.linebreak ();
      printer.printRaw ("place ");
      printer.print (myInputs[i]->getPlace ().getName ());
      printer.delimiter (':');
      myInputs[i]->getExpr ().display (printer);
      printer.delimiter (';');
    }
    printer--;
    printer.linebreak ();
    printer.delimiter ('}');
  }

  if (myNumOutputs) {
    printer.finish ();
    printer.printRaw ("out ");
    printer.delimiter ('{')++;
    for (i = 0; i < myNumOutputs; i++) {
      printer.linebreak ();
      printer.printRaw ("place ");
      printer.print (myOutputs[i]->getPlace ().getName ());
      printer.delimiter (':');
      myOutputs[i]->getExpr ().display (printer);
      printer.delimiter (';');
    }
    printer--;
    printer.linebreak ();
    printer.delimiter ('}');
  }

  if (!myGates.empty ()) {
    printer.finish ();
    printer.printRaw ("gate ");
    for (GateList::const_iterator g = myGates.begin ();; ) {
      (*g)->display (printer);
      if (++g == myGates.end ())
      break;
      printer.delimiter (',');
    }
  }

  if (myHide) {
    printer.finish ();
    printer.printRaw ("hide ");
    myHide->display (printer);
  }

  if (myNumWeaklyFair) {
    printer.finish ();
    printer.printRaw ("weakly_fair ");
    for (i = 0;;) {
      printer.printRaw ("/*");
      printer.print (myWeaklyFairSet[i]);
      printer.printRaw ("*/");
      myWeaklyFairCond[i]->display (printer);
      if (++i == myNumWeaklyFair)
      break;
      printer.delimiter (',');
    }
  }
  if (myNumStronglyFair) {
    printer.finish ();
    printer.printRaw ("strongly_fair ");
    for (i = 0;;) {
      printer.printRaw ("/*");
      printer.print (myStronglyFairSet[i]);
      printer.printRaw ("*/");
      myStronglyFairCond[i]->display (printer);
      if (++i == myNumStronglyFair)
      break;
      printer.delimiter (',');
    }
  }
  if (myNumEnabled) {
    printer.finish ();
    printer.printRaw ("enabled ");
    for (i = 0;;) {
      printer.printRaw ("/*");
      printer.print (myEnabledSet[i]);
      printer.printRaw ("*/");
      myEnabledCond[i]->display (printer);
      if (++i == myNumEnabled)
      break;
      printer.delimiter (',');
    }
  }

  printer.delimiter (';');
  printer.finish ();
}


Generated by  Doxygen 1.6.0   Back to index