ujf.verimag.bip.metamodelAPI
Class BipCreator

java.lang.Object
  extended by ujf.verimag.bip.metamodelAPI.BipCreator

public abstract class BipCreator
extends java.lang.Object

Helper class that contains only static methods for creating objects using the metamodel classes for the BIP language.


Field Summary
protected static ActionsFactory actionsFactory
           
protected static BehaviorsFactory behavFactory
           
protected static ExpressionsFactory expressionsFactory
           
protected static InteractionsFactory interFactory
           
protected static ModulesFactory modulesFactory
           
protected static PortExpressionsFactory portExpressionsFactory
           
protected static PrioritiesFactory prioritiesFactory
           
protected static TimeFactory timeFactory
           
 
Constructor Summary
BipCreator()
           
 
Method Summary
static void closeUnclosedTransition(Transition trans, State destination)
          Closes a transition without a destination
static BinaryOperator comparisonC2BIP(java.lang.String cCompOperator)
          Returns the BinaryOperator corresponding to the C comparision operator as a string
static AtomType copyAtomType(AtomType at, java.lang.String copyName, Module module)
          Create a copy of the given atomic type with the given name within a module
static CompoundType copyCompoundType(CompoundType comp, java.lang.String copyName, Module module)
           
static Connector copyConnector(Connector connector, CompoundType component, java.lang.String name)
          Create a copy of a connector
static PortDefinition copyPortDefinition(PortDefinition portDef, java.lang.String portName, AtomType inAtom)
          Creates a copy of a port definition
static AssignmentAction createAssignmentAction(DataReference lo, Expression ro)
          Creates an assignment
static AtomType createAtomType(Behavior behav, java.lang.String name, Module module)
          Create an atomic type with a name and a behavior within a module
static BinaryExpression createBinaryExpression(Expression leftoperand, Expression rightoperand, BinaryOperator operator)
          Creates a binary expression
static BinaryExpression createBinaryExpression(Expression leftoperand, Expression rightoperand, java.lang.String operator)
          Creates a binary expression
static Component createComponentInstance(java.lang.String name, CompoundType parent, ComponentType instanceType)
           
static CompositeAction createCompositeAction()
          Creates an empty composite action
static CompositeAction createCompositeAction(Action action)
          Creates a new composite action with a single action.
static CompoundType createCompoundType(java.lang.String name, Module module)
           
static Connector createConnector(ConnectorType connectorType, CompoundType component, java.lang.String name)
          Creates a connector instance
static Connector createConnector(ConnectorType connectorType, CompoundType component, java.lang.String name, ActualPortParameter[] actualPortParameters)
          Creates a connector instance
static ConnectorType createConnectorType(Module module, java.lang.String name)
          Creates a connector type
static ConnectorType createConnectorType(Module module, java.lang.String name, java.util.List<PortType> synchrons, java.util.List<PortType> triggers)
          Creates a connector type and use the given ports for building the port parameters
static DataParameter createDataParameter(java.lang.String name, DataType type)
          Creates a data parameter with a name and a type
static DataType createDataType(java.lang.String name, Module module)
          Creates a DataType object as an OpaqueElement.
static FieldNavigationExpression createFieldNavigationExpression(DataReference navExpr, java.lang.String fieldName)
          Create a Field navigation expression
static FunctionCallExpression createFunctionCallExpression(java.lang.String functionName, Expression[] data)
          Create a regular function call (not an invocation to an object's method)
static InnerPortReference createInnerPortReference(Port targetPort, Component targetComponent, Connector connector)
          Creates a reference to a port exported by a subcomponent
static InnerPortReference createInnerPortReferenceUnbounded(Port targetPort, Component targetComponent)
          Creates a reference to a port exported by a subcomponent.
static IntegerLiteral createIntegerLiteral(java.lang.Integer value)
          Creates a new integer literal object
static FunctionCallExpression createMethodCall(Variable v, java.lang.String methodName, boolean ref)
           
static OpaqueElement createOpaqueElementFromCCode(java.lang.String ccode)
          Creates an OpaqueElement and fill its body with C code
static OpaqueElement createOpaqueElementFromCCode(java.lang.String ccode, boolean isHeader)
          Creates an OpaqueElement and fill its body with C code
static Package createPackage(java.lang.String name)
          Creates a new package
static PetriNet createPetriNet()
          Creates an empty petrinet (behavior)
static PointerLiteral createPointerLiteral()
          Creates a new pointer literal object
static PortDefinition createPortDefinition(PortType pt, java.lang.String portName, AtomType inAtom)
          Create a port definition in an atom type
static PortDefinition createPortDefinition(PortType pt, java.lang.String portName, java.util.List<Variable> variables, AtomType inAtom)
          Create a port definition in an atom type and use given variable
static PortDefinition createPortDefinition(PortType pt, java.lang.String portName, Variable[] variables, AtomType inAtom)
          Create a port definition in an atom type and use given variable
static PortDefinition createPortDefinitionAndExport(PortType pt, java.lang.String portName, AtomType inAtom)
          Create a port definition in an atom type and export it
static PortDefinition createPortDefinitionAndExport(PortType pt, java.lang.String portName, java.util.List<Variable> variables, AtomType inAtom)
          Create and export a port definition in an atom type and use given variable
static PortDefinition createPortDefinitionAndExport(PortType pt, java.lang.String portName, Variable[] variables, AtomType inAtom)
          Create and export a port definition in an atom type and use given variable
static ACFusion createPortExpressionFusion(java.util.List<PortParameter> triggers, java.util.List<PortParameter> synchrons)
          Creates a Fusion port expression for a list of port parameters.
static PortExpression createPortExpressionFusion(PortParameter singleport)
          Creates a port expression based on a single port parameter.
static PortParameter createPortParameter(java.lang.String name, PortType portType, ConnectorType connectorType)
          Creates a port parameter for a given connector type
static PortType createPortType(java.lang.String name, Module module)
          Creates a simple port type (unparameterized)
static PortType createPortType(java.lang.String name, Module module, DataParameter[] parameters)
          Creates a parameterized port type
static PortType createPortType(java.lang.String name, Module module, java.util.List<DataParameter> parameters)
          Creates a parameterized port type
static PriorityRule createPriorityRule(java.lang.String name, Connector lowerC, Connector greaterC, CompoundType ct)
          Creates a priority rule between two connectors inside a compound type
static ConnectorType createRDVConnectorType(Module module, java.lang.String name, java.util.List<PortType> port_types)
          Creates a connector type and use the given ports for building the port parameters
static RealLiteral createRealLiteral(java.lang.String value)
          Creates a new real literal object
static Root createRoot(ComponentType type, java.lang.String name, System system)
          Creates a root object
static State createState(AtomType inAtom, java.lang.String name)
          create a state declaration
static State createState(PetriNet behav, java.lang.String name)
          create a state declaration
static State createState(PetriNet behav, java.lang.String name, java.lang.Boolean isInit)
          create a state declaration
static StringLiteral createStringLiteral(java.lang.String value)
          Creates a new string literal object
static System createSystem(java.lang.String name)
          Creates a new system
static System createSystem(java.lang.String name, Root root)
          Creates a new system
static Transition createTransition(PortDefinition trigger, Expression condition, java.util.List<State> sources, java.util.List<State> destinations, AtomType inAtom)
           
static Transition createTransition(PortDefinition trigger, Expression condition, State source, State destination, AtomType inAtom)
          Create a simple transition from one state to another with a simple port as trigger
static UnaryExpression createUnaryExpression(Expression operand, java.lang.String operator)
          Creates an unary expression
static UnaryExpression createUnaryExpression(Expression operand, UnaryOperator operator)
          Creates an unary expression
static Transition createUnclosedTransition(PortDefinition trigger, Expression condition, State source, AtomType inAtom)
          Create a simple transition from one state to an unknown state with a simple port as trigger The method closeUnterminatedTransition() must be used to finish this creation.
static Variable createVariable(DataType type, java.lang.String name, AtomType inAtom, boolean timed, boolean extern)
          Declare a variable in an atom
static VariableReference createVariableReference(Variable target)
          Creates a new variable reference targeting the variable given as parameter.
static Port exportInternalPort(ComponentType ct, Part p, Port internalPort, java.lang.String exportName)
          Create the exported port associated with an internal port
static InterfaceVariable exportInternalVariable(CompoundType ct, Part p, InterfaceVariable internalVariable, java.lang.String exportName)
          export an internal variable from an compound type
static Port exportPortDefinition(PortDefinition pd)
          Create the exported port associated with a port definition
static Port exportPortDefinition(PortDefinition pd, java.lang.String exportName)
          Create the exported port associated with a port definition
static InterfaceVariable exportVariable(AtomType inAtom, Variable v)
          export a variable from an atom
static Port getPort(ComponentType ct, java.lang.String portName)
          get the port with name portName in a component
static UnaryOperator unaryC2BIP(java.lang.String cUnaryOperator)
          Returns the UnaryOperator corresponding to the C operator as a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

behavFactory

protected static BehaviorsFactory behavFactory

interFactory

protected static InteractionsFactory interFactory

modulesFactory

protected static ModulesFactory modulesFactory

timeFactory

protected static TimeFactory timeFactory

expressionsFactory

protected static ExpressionsFactory expressionsFactory

actionsFactory

protected static ActionsFactory actionsFactory

portExpressionsFactory

protected static PortExpressionsFactory portExpressionsFactory

prioritiesFactory

protected static PrioritiesFactory prioritiesFactory
Constructor Detail

BipCreator

public BipCreator()
Method Detail

createConnectorType

public static ConnectorType createConnectorType(Module module,
                                                java.lang.String name)
Creates a connector type

Parameters:
module - the module for the connector type
name - the name of the connector type
Returns:
the connector type

createRDVConnectorType

public static ConnectorType createRDVConnectorType(Module module,
                                                   java.lang.String name,
                                                   java.util.List<PortType> port_types)
Creates a connector type and use the given ports for building the port parameters

Parameters:
module - the module for the connector type
name - the name of the connector type
port_types - the list of port types
Returns:
the connector type

createConnectorType

public static ConnectorType createConnectorType(Module module,
                                                java.lang.String name,
                                                java.util.List<PortType> synchrons,
                                                java.util.List<PortType> triggers)
Creates a connector type and use the given ports for building the port parameters

Parameters:
module - the module for the connector type
name - the name of the connector type
port_types - the list of port types
Returns:
the connector type

createConnector

public static Connector createConnector(ConnectorType connectorType,
                                        CompoundType component,
                                        java.lang.String name)
Creates a connector instance

Parameters:
connectorType - the type of the instance
component - the component in which the instance is living
name - the name of the instance
Returns:
the connector instance

createConnector

public static Connector createConnector(ConnectorType connectorType,
                                        CompoundType component,
                                        java.lang.String name,
                                        ActualPortParameter[] actualPortParameters)
Creates a connector instance

Parameters:
connectorType - the type of the instance
component - the component in which the instance is living
name - the name of the instance
actualPortParameters - the
Returns:
the connector instance

createInnerPortReference

public static InnerPortReference createInnerPortReference(Port targetPort,
                                                          Component targetComponent,
                                                          Connector connector)
Creates a reference to a port exported by a subcomponent

Parameters:
targetPort - the targeted port
targetComponent - the component instance exporting the port
connector - the connector to which this reference should be added
Returns:
the port reference

createInnerPortReferenceUnbounded

public static InnerPortReference createInnerPortReferenceUnbounded(Port targetPort,
                                                                   Component targetComponent)
Creates a reference to a port exported by a subcomponent. This reference is not added to any container (connector, priority, ...)

Parameters:
targetPort - the targeted port
targetComponent - the component instance exporting the port
Returns:
the port reference

copyConnector

public static Connector copyConnector(Connector connector,
                                      CompoundType component,
                                      java.lang.String name)
Create a copy of a connector

Parameters:
connector - the connector to copy
component - the component in which the instance is living
name - the name of the instance
Returns:
the connector instance

createOpaqueElementFromCCode

public static OpaqueElement createOpaqueElementFromCCode(java.lang.String ccode)
Creates an OpaqueElement and fill its body with C code

Parameters:
ccode - the C code to use within the OpaqueElement
Returns:
the newly created OpaqueElement

createOpaqueElementFromCCode

public static OpaqueElement createOpaqueElementFromCCode(java.lang.String ccode,
                                                         boolean isHeader)
Creates an OpaqueElement and fill its body with C code

Parameters:
ccode - the C code to use within the OpaqueElement
isHeader - if true, this opaque element is used as header
Returns:
the newly created OpaqueElement

createPortParameter

public static PortParameter createPortParameter(java.lang.String name,
                                                PortType portType,
                                                ConnectorType connectorType)
Creates a port parameter for a given connector type

Parameters:
name - the name of the parameter
portType - the type of the parameter
connectorType - the connector type to which this parameter is bound
Returns:
the port parameter

createPortExpressionFusion

public static PortExpression createPortExpressionFusion(PortParameter singleport)
Creates a port expression based on a single port parameter. Uses a Fusion underneath, may not be correct! FIXME !

Parameters:
singleport - the single port for the expression
Returns:
the port expression

createPortExpressionFusion

public static ACFusion createPortExpressionFusion(java.util.List<PortParameter> triggers,
                                                  java.util.List<PortParameter> synchrons)
Creates a Fusion port expression for a list of port parameters. The expression is 'flat' and can contain triggers and synchrons. At most, one of the two sets can be null/empty.

Parameters:
triggers - the list of port parameters that are triggers
synchrons - the list of port parameters that are synchrons
Returns:
the Fusion port expression

createAssignmentAction

public static AssignmentAction createAssignmentAction(DataReference lo,
                                                      Expression ro)
Creates an assignment

Parameters:
leftDr - the left operand
ro - the right operand
Returns:
the assignment object

createCompositeAction

public static CompositeAction createCompositeAction()
Creates an empty composite action

Returns:
a new composite action

createCompositeAction

public static CompositeAction createCompositeAction(Action action)
Creates a new composite action with a single action.

Parameters:
action - the single action to be added to the new composite action
Returns:
the new composite action

createVariableReference

public static VariableReference createVariableReference(Variable target)
Creates a new variable reference targeting the variable given as parameter.

Parameters:
target - the variable targeted by the newly created reference
Returns:
a new variable reference

createIntegerLiteral

public static IntegerLiteral createIntegerLiteral(java.lang.Integer value)
Creates a new integer literal object

Parameters:
value - the integer value
Returns:
the integer literal

createRealLiteral

public static RealLiteral createRealLiteral(java.lang.String value)
Creates a new real literal object

Parameters:
value - the real value
Returns:
the real literal

createStringLiteral

public static StringLiteral createStringLiteral(java.lang.String value)
Creates a new string literal object

Parameters:
value - the string value
Returns:
the string literal

createPointerLiteral

public static PointerLiteral createPointerLiteral()
Creates a new pointer literal object

Returns:
the pointer literal

createBinaryExpression

public static BinaryExpression createBinaryExpression(Expression leftoperand,
                                                      Expression rightoperand,
                                                      BinaryOperator operator)
Creates a binary expression

Parameters:
leftoperand - the expression for the left operand
rightoperand - the expression for the right operand
operator - the binary operator
Returns:
the binary expression

comparisonC2BIP

public static BinaryOperator comparisonC2BIP(java.lang.String cCompOperator)
Returns the BinaryOperator corresponding to the C comparision operator as a string

Parameters:
cCompOperator - the C comparison operator
Returns:
the BinaryOperator

unaryC2BIP

public static UnaryOperator unaryC2BIP(java.lang.String cUnaryOperator)
Returns the UnaryOperator corresponding to the C operator as a string

Parameters:
cUnaryOperator - the C operator
Returns:
the UnaryOperator

createBinaryExpression

public static BinaryExpression createBinaryExpression(Expression leftoperand,
                                                      Expression rightoperand,
                                                      java.lang.String operator)
Creates a binary expression

Parameters:
leftoperand - the expression for the left operand
rightoperand - the expression for the right operand
operator - the binary operator
Returns:
the binary expression

createUnaryExpression

public static UnaryExpression createUnaryExpression(Expression operand,
                                                    java.lang.String operator)
Creates an unary expression

Parameters:
operand - the operand
operator - the operator
Returns:
the unary expression

createUnaryExpression

public static UnaryExpression createUnaryExpression(Expression operand,
                                                    UnaryOperator operator)
Creates an unary expression

Parameters:
operand - the operand
operator - the operator
Returns:
the unary expression

createPortDefinition

public static PortDefinition createPortDefinition(PortType pt,
                                                  java.lang.String portName,
                                                  AtomType inAtom)
Create a port definition in an atom type

Parameters:
pt - type of port to create
portName - name of the port definition
inAtom - Atom type in which the port definition is created
Returns:
the created PortDefinition

createPortDefinitionAndExport

public static PortDefinition createPortDefinitionAndExport(PortType pt,
                                                           java.lang.String portName,
                                                           AtomType inAtom)
Create a port definition in an atom type and export it

Parameters:
pt - type of port to create
portName - name of the port definition
inAtom - Atom type in which the port definition is created
Returns:
the created PortDefinition

createPortDefinition

public static PortDefinition createPortDefinition(PortType pt,
                                                  java.lang.String portName,
                                                  java.util.List<Variable> variables,
                                                  AtomType inAtom)
Create a port definition in an atom type and use given variable

Parameters:
pt - type of port to create
portName - name of the port definition
variables - the list of variables
inAtom - Atom type in which the port definition is created
Returns:
the created PortDefinition

createPortDefinitionAndExport

public static PortDefinition createPortDefinitionAndExport(PortType pt,
                                                           java.lang.String portName,
                                                           java.util.List<Variable> variables,
                                                           AtomType inAtom)
Create and export a port definition in an atom type and use given variable

Parameters:
pt - type of port to create
portName - name of the port definition
variables - the list of variables
inAtom - Atom type in which the port definition is created
Returns:
the created PortDefinition

createPortDefinition

public static PortDefinition createPortDefinition(PortType pt,
                                                  java.lang.String portName,
                                                  Variable[] variables,
                                                  AtomType inAtom)
Create a port definition in an atom type and use given variable

Parameters:
pt - type of port to create
portName - name of the port definition
variables - the list of variables
inAtom - Atom type in which the port definition is created
Returns:
the created PortDefinition

createPortDefinitionAndExport

public static PortDefinition createPortDefinitionAndExport(PortType pt,
                                                           java.lang.String portName,
                                                           Variable[] variables,
                                                           AtomType inAtom)
Create and export a port definition in an atom type and use given variable

Parameters:
pt - type of port to create
portName - name of the port definition
variables - the list of variables
inAtom - Atom type in which the port definition is created
Returns:
the created PortDefinition

copyPortDefinition

public static PortDefinition copyPortDefinition(PortDefinition portDef,
                                                java.lang.String portName,
                                                AtomType inAtom)
Creates a copy of a port definition

Parameters:
portDef - the port definition to copy
portName - the name for the copy
inAtom - the atom that should contain the copy
Returns:
the copy

exportPortDefinition

public static Port exportPortDefinition(PortDefinition pd,
                                        java.lang.String exportName)
Create the exported port associated with a port definition

Parameters:
pd - The port definition to export
exportName - The export port name.
Returns:
the created Port

exportPortDefinition

public static Port exportPortDefinition(PortDefinition pd)
Create the exported port associated with a port definition

Parameters:
pd - The port definition to export
Returns:
the created Port

exportInternalPort

public static Port exportInternalPort(ComponentType ct,
                                      Part p,
                                      Port internalPort,
                                      java.lang.String exportName)
Create the exported port associated with an internal port

Parameters:
p - The component or connector of the internal port
internalPort - Port to export. If p is a connector, internalPort may be null only one port on the connector)
exportName - The export port name. If null, the internal port name will be used
Returns:
the created Port

getPort

public static Port getPort(ComponentType ct,
                           java.lang.String portName)
get the port with name portName in a component

Parameters:
ct -
portName -
Returns:

createUnclosedTransition

public static Transition createUnclosedTransition(PortDefinition trigger,
                                                  Expression condition,
                                                  State source,
                                                  AtomType inAtom)
Create a simple transition from one state to an unknown state with a simple port as trigger The method closeUnterminatedTransition() must be used to finish this creation.

Parameters:
trigger - The port which triggers the transition
condition - The transition condition (may be null)
source - The origin State
inAtom - The atom in which create the transition. Remark: the port must believe to this atom
Returns:
the created transition

closeUnclosedTransition

public static void closeUnclosedTransition(Transition trans,
                                           State destination)
Closes a transition without a destination

Parameters:
trans - the transition to close
destination - the destination state for the transition

createTransition

public static Transition createTransition(PortDefinition trigger,
                                          Expression condition,
                                          State source,
                                          State destination,
                                          AtomType inAtom)
Create a simple transition from one state to another with a simple port as trigger

Parameters:
trigger - The port which triggers the transition
condition - The transition condition (may be null)
source - The origin State
destination - The destination state
inAtom - The atom in which create the transition. Remark: the port must believe to this atom
Returns:
the created transition

createTransition

public static Transition createTransition(PortDefinition trigger,
                                          Expression condition,
                                          java.util.List<State> sources,
                                          java.util.List<State> destinations,
                                          AtomType inAtom)

createVariable

public static Variable createVariable(DataType type,
                                      java.lang.String name,
                                      AtomType inAtom,
                                      boolean timed,
                                      boolean extern)
Declare a variable in an atom

Parameters:
type - Variable type
name - variable name
inAtom - atom in which declare the variable
timed - true if the variable to declare is timed
exported - true if the variable to declare is exported
extern - true if the variable to declare is external
Returns:
the declared variable

exportVariable

public static InterfaceVariable exportVariable(AtomType inAtom,
                                               Variable v)
export a variable from an atom

Parameters:
inAtom - the atom which exports the variable
v - the variable to export
Returns:
the interface variable exported

exportInternalVariable

public static InterfaceVariable exportInternalVariable(CompoundType ct,
                                                       Part p,
                                                       InterfaceVariable internalVariable,
                                                       java.lang.String exportName)
export an internal variable from an compound type

Parameters:
ct - the compound type which exports the variable
p - the sub-element on which is the internal variable
internalVariable - the interface variable on the sub-element
exportName - the name of the exported variable if different from the variable name
Returns:
the interface variable exported

createState

public static State createState(PetriNet behav,
                                java.lang.String name)
create a state declaration

Parameters:
behav - the behavior in which create the state
name - name of the new state
Returns:
the created state

createState

public static State createState(PetriNet behav,
                                java.lang.String name,
                                java.lang.Boolean isInit)
create a state declaration

Parameters:
behav - the behavior in which create the state
name - name of the new state
isInit - the state is added to the initial states if true.
Returns:
the created state

createState

public static State createState(AtomType inAtom,
                                java.lang.String name)
create a state declaration

Parameters:
inAtom - atom type in which create the state
name - name of the new state
Returns:
the created state

createFunctionCallExpression

public static FunctionCallExpression createFunctionCallExpression(java.lang.String functionName,
                                                                  Expression[] data)
Create a regular function call (not an invocation to an object's method)

Parameters:
functionName - the function name to call
data - an array of parameter
Returns:
the function call expression

createMethodCall

public static FunctionCallExpression createMethodCall(Variable v,
                                                      java.lang.String methodName,
                                                      boolean ref)

createFieldNavigationExpression

public static FieldNavigationExpression createFieldNavigationExpression(DataReference navExpr,
                                                                        java.lang.String fieldName)
Create a Field navigation expression

Parameters:
navExpr - the navigated expression part
fieldName - the filed
Returns:
the created navigation expression

createSystem

public static System createSystem(java.lang.String name,
                                  Root root)
Creates a new system

Parameters:
name - name of the system
root - root of the system
Returns:
the new system

createSystem

public static System createSystem(java.lang.String name)
Creates a new system

Parameters:
name - name of the system
Returns:
the new system

createPackage

public static Package createPackage(java.lang.String name)
Creates a new package

Parameters:
name - name of the package
Returns:
the new package

createRoot

public static Root createRoot(ComponentType type,
                              java.lang.String name,
                              System system)
Creates a root object

Parameters:
type - the type for this new root
name - the root name
system - the system for which the new root is to be attached
Returns:
the new root

createAtomType

public static AtomType createAtomType(Behavior behav,
                                      java.lang.String name,
                                      Module module)
Create an atomic type with a name and a behavior within a module

Parameters:
behav - the behavior
name - the type name
module - the module
Returns:
the atomic type

copyAtomType

public static AtomType copyAtomType(AtomType at,
                                    java.lang.String copyName,
                                    Module module)
Create a copy of the given atomic type with the given name within a module

Parameters:
at - the atomic type that is copied
copyName - the name of the new type
module - the module
Returns:
the atomic type

createCompoundType

public static CompoundType createCompoundType(java.lang.String name,
                                              Module module)

copyCompoundType

public static CompoundType copyCompoundType(CompoundType comp,
                                            java.lang.String copyName,
                                            Module module)

createComponentInstance

public static Component createComponentInstance(java.lang.String name,
                                                CompoundType parent,
                                                ComponentType instanceType)

createPetriNet

public static PetriNet createPetriNet()
Creates an empty petrinet (behavior)

Returns:
the petrinet

createDataType

public static DataType createDataType(java.lang.String name,
                                      Module module)
Creates a DataType object as an OpaqueElement. Beware that this method is based on the code found in the 'parser' package. The handling of DataType by OpaqueElement looks strange and error prone.

Parameters:
typename - the type name
module - the enclosing module
Returns:
the newly created DataType object

createDataParameter

public static DataParameter createDataParameter(java.lang.String name,
                                                DataType type)
Creates a data parameter with a name and a type

Parameters:
name - the parameter name
type - the parameter type
Returns:
the data parameter

createPortType

public static PortType createPortType(java.lang.String name,
                                      Module module,
                                      java.util.List<DataParameter> parameters)
Creates a parameterized port type

Parameters:
name - the name of the port
module - the enclosing module
parameters - the port parameters
Returns:
the port type

createPortType

public static PortType createPortType(java.lang.String name,
                                      Module module,
                                      DataParameter[] parameters)
Creates a parameterized port type

Parameters:
name - the name of the port
module - the enclosing module
parameters - the port parameters
Returns:
the port type

createPortType

public static PortType createPortType(java.lang.String name,
                                      Module module)
Creates a simple port type (unparameterized)

Parameters:
name - the name of the port
module - the enclosing module
Returns:
the port type

createPriorityRule

public static PriorityRule createPriorityRule(java.lang.String name,
                                              Connector lowerC,
                                              Connector greaterC,
                                              CompoundType ct)
Creates a priority rule between two connectors inside a compound type

Parameters:
name - the name of the priority
lowerC - the connector with the lowest priority
greaterC - the connector with the greatest priority
ct - the compound type which the priority is instantiated in
Returns:
the PriorityRule