com.evelopers.unimod.compilation
Class StateMachineCompiler

java.lang.Object
  extended bycom.evelopers.unimod.compilation.StateMachineCompiler

public class StateMachineCompiler
extends java.lang.Object


Compile given state machine. This process includes:

  • Check that every model element has name;
  • Check that ControlledObjectHandlers and EventProviderHandlers have implClass;
  • Check that every State has StateType
  • Translate to AST all guard conditions;
  • Translate all actions' identifiers to ControlledObjectHandler and actionName;

  • Constructor Summary
    StateMachineCompiler(OperationResolver operationResolver)
               
     
    Method Summary
     boolean addCompilationListener(CompilationListener listener)
               
    protected  boolean checkIdentifier(java.lang.String identifier)
               
     void compile(StateMachine sm)
              Compiles whole state machine WITHOUT included state machines
     void compile(StateMachine sm, ControlledObjectHandler co)
              Compiles given controlled object
     void compile(StateMachine sm, Event e)
              Compiles given event
     void compile(StateMachine sm, EventProviderHandler ep)
              Compiles given event provider object
     void compile(StateMachine sm, ModelElement owner, Action e)
               
     void compile(StateMachine sm, State s)
              Compiles given state with it's output actions
     void compile(StateMachine sm, Transition t)
              Compiles given transition with it's guard, event and output actions
     void compile(StateMachine sm, Transition t, Guard c)
              Compiles given guard
     void compileWithIncluded(StateMachine sm)
              Compiles whole state machine WITH included state machines
    static java.lang.String getActionName(java.lang.String identifier)
              Parses action name from identifier
    static java.lang.String getObjectName(java.lang.String identifier)
              Parses object name from identifier
     boolean removeCompilationListener(CompilationListener listener)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    StateMachineCompiler

    public StateMachineCompiler(OperationResolver operationResolver)
    Method Detail

    addCompilationListener

    public boolean addCompilationListener(CompilationListener listener)

    removeCompilationListener

    public boolean removeCompilationListener(CompilationListener listener)

    compile

    public void compile(StateMachine sm)
    Compiles whole state machine WITHOUT included state machines

    Parameters:
    sm -

    compileWithIncluded

    public void compileWithIncluded(StateMachine sm)
    Compiles whole state machine WITH included state machines

    Parameters:
    sm -

    compile

    public void compile(StateMachine sm,
                        ControlledObjectHandler co)
    Compiles given controlled object

    Parameters:
    sm -
    co -

    compile

    public void compile(StateMachine sm,
                        EventProviderHandler ep)
    Compiles given event provider object

    Parameters:
    sm -
    ep -

    compile

    public void compile(StateMachine sm,
                        State s)
    Compiles given state with it's output actions

    Parameters:
    sm -
    s -

    compile

    public void compile(StateMachine sm,
                        Transition t)
    Compiles given transition with it's guard, event and output actions

    Parameters:
    sm -
    t -

    compile

    public void compile(StateMachine sm,
                        Transition t,
                        Guard c)
    Compiles given guard

    Parameters:
    sm -
    c -

    compile

    public void compile(StateMachine sm,
                        ModelElement owner,
                        Action e)

    compile

    public void compile(StateMachine sm,
                        Event e)
    Compiles given event

    Parameters:
    sm -
    e -

    getObjectName

    public static java.lang.String getObjectName(java.lang.String identifier)
    Parses object name from identifier

    Parameters:
    identifier - action identifier line o1.z2
    Returns:
    object name (for o1.z2 will returns o1)

    getActionName

    public static java.lang.String getActionName(java.lang.String identifier)
    Parses action name from identifier

    Parameters:
    identifier - action identifier line o1.z2
    Returns:
    action name (for o1.z2 will return z2)

    checkIdentifier

    protected boolean checkIdentifier(java.lang.String identifier)