
/*        
_____________________________________________________________

Generated File by the Rule Compiler Generator.
Written by Jun Li
based on GGCompiler.py by Eugene Syriani

File generated on Fri May 02 03:10:16 2008
_____________________________________________________________
*/

/* please add following code to FSM.run()    */    
do 
    Rule03(Input)
     /* Generel error handling */
    rescue (err : Exception)
        stdio.writeln(err.toString)
        stdio.writeln(err.message)
end

/* operation of FSM translated from graph grammar rule    */    
    operation Rule03(str : String) : String raises FSMException
        pre preRule03 is
            currentState != void 

    is do


            ownedState.each 
            { s |   // Matching LHS
                if(s == initialState) then 
                    do  // LHS->RHS changes
                
    	            s.outgoingTransition.each { t | 
    	                if (t.input.equals(Input)) then 
    	                    do	// Updating Code 
                
            					setOutput(t.output)	// 1. Produce output
    removeInput() 		// 2. consumed the input	
    
                                // Framework
                                applyCounter := applyCounter + 1
                                stdio.writeln("-- Rule03 is applied.")
                                stdio.writeln("Current state : " + currentState.name)
                                 // Generel error handling 
                                rescue (err : Exception)
                                    stdio.writeln(err.toString)
                                    stdio.writeln(err.message)
             end end } 
 end end } 
end