![]() | Description |
---|---|
An ASM rule definition is the building block of an ASM program. When invoked, its formal parameters are substituted with actual parameters, and its body is called. |
![]() | Syntax |
---|---|
AsmRuleDefAST ::= OptAnnotationsAST rule TypeNameAST DirectedFormalParameterDefAST = AsmRuleInvocAST DirectedFormalParameterDefAST ::= ( FormalParamsAST ) | ( ) An ASM rule definition is identified by a name, it has a list of directed formal parameters, and an ASM rule invocation as body. |
![]() | Semantics |
---|---|
An ASM rule definition can be invoked by a call rule. When invoked, the formal parameters are substituted by the actual parameters of the call, and the body of the ASM rule is called. The entry point of an ASM program is a special user-defined rule called main. Two rules may have identical names as long as their arity (the number of parameters) is different. |
Remark. If the mainrule of a machine has an input parameter then this parameter can set by the user when the transformation starts execution. The actual values of the input parameters should be defined in the pop-up window separated by spaces (' '). Currently, each input parameter is considered to be a string. Most frequently, the body of an ASM rule definition is a sequential rule, but it can be arbitrary ASM rule invocations.
Defined In: machine