products/Sources/formale Sprachen/VDM/VDMPP/SmokingPP image not shown  

Quellcode-Bibliothek

© Kompilation durch diese Firma

[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]

Datei: ssrview.mli   Sprache: VDM

Original von: VDM©

class Agent

values
  thing_l = [<Tobacco>, <Paper>, <Match>]

instance variables
  timer : nat := 0;
  table : Table;

operations

public Agent: Table ==> Agent
Agent(tab) ==
  table := tab;

public GetTime: () ==> nat
GetTime() ==
  return timer;

public AddTobacco : () ==> bool
AddTobacco() == 
(
  if table.AddElement(thing_l(1)) then
  (
  World`graphics.tobaccoAdded();
 return true;
  );

  return false;
);

public AddPaper : () ==> bool
AddPaper() == 
(
  if table.AddElement(thing_l(2)) then
  (
  World`graphics.paperAdded();
 return true;
  );

  return false;
);

public AddMatch : () ==> bool
AddMatch() == 
(
  if table.AddElement(thing_l(3)) then
  (
  World`graphics.matchAdded();
 return true;
  );

  return false;
);

end Agent

¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet)  ¤





Download des
Quellennavigators
Download des
sprechenden Kalenders

in der Quellcodebibliothek suchen




Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.


Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.


Bot Zugriff