1// -*- tab-width: 4; -*- 2// 3// The contents of this file are subject to the Mozilla Public 4// License Version 1.1 (the "License"); you may not use this file 5// except in compliance with the License. You may obtain a copy of 6// the License at http://www.mozilla.org/MPL/ 7// 8// Software distributed under the License is distributed on an "AS 9// IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 10// implied. See the License for the specific language governing 11// rights and limitations under the License. 12// 13// The Original Code is State Machine Compiler (SMC). 14// 15// The Initial Developer of the Original Code is Charles W. Rapp. 16// Portions created by Charles W. Rapp are 17// Copyright (C) 2004. Charles W. Rapp. 18// All Rights Reserved. 19// 20// Contributor(s): 21// Eitan Suez contributed examples/Ant. 22// (Name withheld) contributed the C# code generation and 23// examples/C#. 24// 25// State Machine 26// This state machine is recognizes the regular expression 0*1*. 27// 28// RCS ID 29// $Id: AppClass.sm,v 1.1 2005/05/28 13:05:06 cwrapp Exp $ 30// 31// CHANGE LOG 32// $Log: AppClass.sm,v $ 33// Revision 1.1 2005/05/28 13:05:06 cwrapp 34// Added CSharp examples 1 - 3. 35// 36// Revision 1.0 2004/09/01 16:02:10 charlesr 37// Initial revision 38// 39 40%start Map1::Start 41%class AppClass 42 43%map Map1 44%% 45// State Transition End State Action(s) 46Start { 47 Zero Zeros {} 48 One Ones {} 49 Unknown Error {} 50 EOS OK { 51 Acceptable = true; 52 } 53} 54 55Zeros { 56 Zero Zeros {} 57 One Ones {} 58 Unknown Error {} 59 EOS OK { 60 Acceptable = true; 61 } 62} 63 64Ones { 65 Zero Error {} 66 One Ones {} 67 Unknown Error {} 68 EOS OK { 69 Acceptable=true; 70 AcceptableM(true); 71 } 72} 73 74OK {} 75 76Error 77Entry {SignalError();} 78{ 79 Zero nil {} 80 One nil {} 81 Unknown nil {} 82 EOS nil {Acceptable=false;}//Unacceptable();} 83} 84 85%% 86