#--------------------------------------------------------------------- # SVM (Statechart Virtual Machine) # -- an interpreter for an extended statechart formalism #--------------------------------------------------------------------- # # Copyright (C) 2003 Thomas Huining Feng # #--------------------------------------------------------------------- # Address: MSDL, SOCS, McGill Univ., Montreal, Canada # HomePage: http://msdl.cs.mcgill.ca/people/tfeng/ # SVM HomePage: http://msdl.cs.mcgill.ca/people/tfeng/?research=svm # Download: http://savannah.nongnu.org/files/?group=svm # CVS: :pserver:anoncvs@subversions.gnu.org:/cvsroot/svm # (projects "svm" and "jsvm") # Email: hfeng2@cs.mcgill.ca #--------------------------------------------------------------------- # # This file is part of SVM. # #--------------------------------------------------------------------- # SVM is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your # option) any later version. # # SVM is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public # License for more details. # # You should have received a copy of the GNU General Public License # along with SVM; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #--------------------------------------------------------------------- MACRO: INIT = true STATECHART: initiate [DS] true false TRANSITION: S:initiate T:0 N:[INIT] TRANSITION: S:true E:chg N:false TRANSITION: S:false E:chg N:true TRANSITION: S:true E:get N:true O:[EVENT('true')] TRANSITION: S:false E:get N:false O:[EVENT('false')] ENTER: N:true O:[DUMP('Current value is true.')] ENTER: N:false O:[DUMP('Current value is false.')]