|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ujf.verimag.bip.metamodelAPI.BipCreator
public abstract class BipCreator
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 |
---|
protected static BehaviorsFactory behavFactory
protected static InteractionsFactory interFactory
protected static ModulesFactory modulesFactory
protected static TimeFactory timeFactory
protected static ExpressionsFactory expressionsFactory
protected static ActionsFactory actionsFactory
protected static PortExpressionsFactory portExpressionsFactory
protected static PrioritiesFactory prioritiesFactory
Constructor Detail |
---|
public BipCreator()
Method Detail |
---|
public static ConnectorType createConnectorType(Module module, java.lang.String name)
module
- the module for the connector typename
- the name of the connector type
public static ConnectorType createRDVConnectorType(Module module, java.lang.String name, java.util.List<PortType> port_types)
module
- the module for the connector typename
- the name of the connector typeport_types
- the list of port types
public static ConnectorType createConnectorType(Module module, java.lang.String name, java.util.List<PortType> synchrons, java.util.List<PortType> triggers)
module
- the module for the connector typename
- the name of the connector typeport_types
- the list of port types
public static Connector createConnector(ConnectorType connectorType, CompoundType component, java.lang.String name)
connectorType
- the type of the instancecomponent
- the component in which the instance is livingname
- the name of the instance
public static Connector createConnector(ConnectorType connectorType, CompoundType component, java.lang.String name, ActualPortParameter[] actualPortParameters)
connectorType
- the type of the instancecomponent
- the component in which the instance is livingname
- the name of the instanceactualPortParameters
- the
public static InnerPortReference createInnerPortReference(Port targetPort, Component targetComponent, Connector connector)
targetPort
- the targeted porttargetComponent
- the component instance exporting the portconnector
- the connector to which this reference should be added
public static InnerPortReference createInnerPortReferenceUnbounded(Port targetPort, Component targetComponent)
targetPort
- the targeted porttargetComponent
- the component instance exporting the port
public static Connector copyConnector(Connector connector, CompoundType component, java.lang.String name)
connector
- the connector to copycomponent
- the component in which the instance is livingname
- the name of the instance
public static OpaqueElement createOpaqueElementFromCCode(java.lang.String ccode)
ccode
- the C code to use within the OpaqueElement
public static OpaqueElement createOpaqueElementFromCCode(java.lang.String ccode, boolean isHeader)
ccode
- the C code to use within the OpaqueElementisHeader
- if true, this opaque element is used as header
public static PortParameter createPortParameter(java.lang.String name, PortType portType, ConnectorType connectorType)
name
- the name of the parameterportType
- the type of the parameterconnectorType
- the connector type to which this parameter is bound
public static PortExpression createPortExpressionFusion(PortParameter singleport)
singleport
- the single port for the expression
public static ACFusion createPortExpressionFusion(java.util.List<PortParameter> triggers, java.util.List<PortParameter> synchrons)
triggers
- the list of port parameters that are triggerssynchrons
- the list of port parameters that are synchrons
public static AssignmentAction createAssignmentAction(DataReference lo, Expression ro)
leftDr
- the left operandro
- the right operand
public static CompositeAction createCompositeAction()
public static CompositeAction createCompositeAction(Action action)
action
- the single action to be added to the new composite action
public static VariableReference createVariableReference(Variable target)
target
- the variable targeted by the newly created reference
public static IntegerLiteral createIntegerLiteral(java.lang.Integer value)
value
- the integer value
public static RealLiteral createRealLiteral(java.lang.String value)
value
- the real value
public static StringLiteral createStringLiteral(java.lang.String value)
value
- the string value
public static PointerLiteral createPointerLiteral()
public static BinaryExpression createBinaryExpression(Expression leftoperand, Expression rightoperand, BinaryOperator operator)
leftoperand
- the expression for the left operandrightoperand
- the expression for the right operandoperator
- the binary operator
public static BinaryOperator comparisonC2BIP(java.lang.String cCompOperator)
cCompOperator
- the C comparison operator
public static UnaryOperator unaryC2BIP(java.lang.String cUnaryOperator)
cUnaryOperator
- the C operator
public static BinaryExpression createBinaryExpression(Expression leftoperand, Expression rightoperand, java.lang.String operator)
leftoperand
- the expression for the left operandrightoperand
- the expression for the right operandoperator
- the binary operator
public static UnaryExpression createUnaryExpression(Expression operand, java.lang.String operator)
operand
- the operandoperator
- the operator
public static UnaryExpression createUnaryExpression(Expression operand, UnaryOperator operator)
operand
- the operandoperator
- the operator
public static PortDefinition createPortDefinition(PortType pt, java.lang.String portName, AtomType inAtom)
pt
- type of port to createportName
- name of the port definitioninAtom
- Atom type in which the port definition is created
public static PortDefinition createPortDefinitionAndExport(PortType pt, java.lang.String portName, AtomType inAtom)
pt
- type of port to createportName
- name of the port definitioninAtom
- Atom type in which the port definition is created
public static PortDefinition createPortDefinition(PortType pt, java.lang.String portName, java.util.List<Variable> variables, AtomType inAtom)
pt
- type of port to createportName
- name of the port definitionvariables
- the list of variablesinAtom
- Atom type in which the port definition is created
public static PortDefinition createPortDefinitionAndExport(PortType pt, java.lang.String portName, java.util.List<Variable> variables, AtomType inAtom)
pt
- type of port to createportName
- name of the port definitionvariables
- the list of variablesinAtom
- Atom type in which the port definition is created
public static PortDefinition createPortDefinition(PortType pt, java.lang.String portName, Variable[] variables, AtomType inAtom)
pt
- type of port to createportName
- name of the port definitionvariables
- the list of variablesinAtom
- Atom type in which the port definition is created
public static PortDefinition createPortDefinitionAndExport(PortType pt, java.lang.String portName, Variable[] variables, AtomType inAtom)
pt
- type of port to createportName
- name of the port definitionvariables
- the list of variablesinAtom
- Atom type in which the port definition is created
public static PortDefinition copyPortDefinition(PortDefinition portDef, java.lang.String portName, AtomType inAtom)
portDef
- the port definition to copyportName
- the name for the copyinAtom
- the atom that should contain the copy
public static Port exportPortDefinition(PortDefinition pd, java.lang.String exportName)
pd
- The port definition to exportexportName
- The export port name.
public static Port exportPortDefinition(PortDefinition pd)
pd
- The port definition to export
public static Port exportInternalPort(ComponentType ct, Part p, Port internalPort, java.lang.String exportName)
p
- The component or connector of the internal portinternalPort
- 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
public static Port getPort(ComponentType ct, java.lang.String portName)
ct
- portName
-
public static Transition createUnclosedTransition(PortDefinition trigger, Expression condition, State source, AtomType inAtom)
trigger
- The port which triggers the transitioncondition
- The transition condition (may be null)source
- The origin StateinAtom
- The atom in which create the transition. Remark: the port must believe to this atom
public static void closeUnclosedTransition(Transition trans, State destination)
trans
- the transition to closedestination
- the destination state for the transitionpublic static Transition createTransition(PortDefinition trigger, Expression condition, State source, State destination, AtomType inAtom)
trigger
- The port which triggers the transitioncondition
- The transition condition (may be null)source
- The origin Statedestination
- The destination stateinAtom
- The atom in which create the transition. Remark: the port must believe to this atom
public static Transition createTransition(PortDefinition trigger, Expression condition, java.util.List<State> sources, java.util.List<State> destinations, AtomType inAtom)
public static Variable createVariable(DataType type, java.lang.String name, AtomType inAtom, boolean timed, boolean extern)
type
- Variable typename
- variable nameinAtom
- atom in which declare the variabletimed
- true if the variable to declare is timedexported
- true if the variable to declare is exportedextern
- true if the variable to declare is external
public static InterfaceVariable exportVariable(AtomType inAtom, Variable v)
inAtom
- the atom which exports the variablev
- the variable to export
public static InterfaceVariable exportInternalVariable(CompoundType ct, Part p, InterfaceVariable internalVariable, java.lang.String exportName)
ct
- the compound type which exports the variablep
- the sub-element on which is the internal variableinternalVariable
- the interface variable on the sub-elementexportName
- the name of the exported variable if different from the variable name
public static State createState(PetriNet behav, java.lang.String name)
behav
- the behavior in which create the statename
- name of the new state
public static State createState(PetriNet behav, java.lang.String name, java.lang.Boolean isInit)
behav
- the behavior in which create the statename
- name of the new stateisInit
- the state is added to the initial states if true.
public static State createState(AtomType inAtom, java.lang.String name)
inAtom
- atom type in which create the statename
- name of the new state
public static FunctionCallExpression createFunctionCallExpression(java.lang.String functionName, Expression[] data)
functionName
- the function name to calldata
- an array of parameter
public static FunctionCallExpression createMethodCall(Variable v, java.lang.String methodName, boolean ref)
public static FieldNavigationExpression createFieldNavigationExpression(DataReference navExpr, java.lang.String fieldName)
navExpr
- the navigated expression partfieldName
- the filed
public static System createSystem(java.lang.String name, Root root)
name
- name of the systemroot
- root of the system
public static System createSystem(java.lang.String name)
name
- name of the system
public static Package createPackage(java.lang.String name)
name
- name of the package
public static Root createRoot(ComponentType type, java.lang.String name, System system)
type
- the type for this new rootname
- the root namesystem
- the system for which the new root is to be attached
public static AtomType createAtomType(Behavior behav, java.lang.String name, Module module)
behav
- the behaviorname
- the type namemodule
- the module
public static AtomType copyAtomType(AtomType at, java.lang.String copyName, Module module)
at
- the atomic type that is copiedcopyName
- the name of the new typemodule
- the module
public static CompoundType createCompoundType(java.lang.String name, Module module)
public static CompoundType copyCompoundType(CompoundType comp, java.lang.String copyName, Module module)
public static Component createComponentInstance(java.lang.String name, CompoundType parent, ComponentType instanceType)
public static PetriNet createPetriNet()
public static DataType createDataType(java.lang.String name, Module module)
typename
- the type namemodule
- the enclosing module
public static DataParameter createDataParameter(java.lang.String name, DataType type)
name
- the parameter nametype
- the parameter type
public static PortType createPortType(java.lang.String name, Module module, java.util.List<DataParameter> parameters)
name
- the name of the portmodule
- the enclosing moduleparameters
- the port parameters
public static PortType createPortType(java.lang.String name, Module module, DataParameter[] parameters)
name
- the name of the portmodule
- the enclosing moduleparameters
- the port parameters
public static PortType createPortType(java.lang.String name, Module module)
name
- the name of the portmodule
- the enclosing module
public static PriorityRule createPriorityRule(java.lang.String name, Connector lowerC, Connector greaterC, CompoundType ct)
name
- the name of the prioritylowerC
- the connector with the lowest prioritygreaterC
- the connector with the greatest priorityct
- the compound type which the priority is instantiated in
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |