Tutorial - Writing Agent Script
Start:
''Table of Contents''
#contents
* Overview [#j92e773b]
An ''agent script'' is a script stored in a file named *....
The agent script system is under-construction; which will...
* Grammar [#i81f9e14]
In the following guide, a CAPITAL WORD denotes a paramete...
** Comment [#e3443b55]
Characters followed by "//" are parsed as a comment.
#codeh(cpp){{
// THIS IS A COMMENT
module MAVFTable avf_table // THIS IS A COMMENT
}}
** Modular Manipulation [#ja7d2616]
In order to instantiate a module, write as follows:
#codeh(cpp){{
module MODULE_TYPE INSTANCE_NAME
}}
- MODULE_TYPE : Name of module type.
- INSTANCE_NAME : Identifier of instance.
In order to connect two ports, write as follows:
#codeh(cpp){{
connect FROM_MODULE.FROM_PORT , TO_MODULE.TO_PORT
}}
- FROM_MODULE : Departing module.
- FROM_PORT : Departing port (a signal port or an in port).
- TO_MODULE : Destination module.
- TO_PORT : Destination port (a slot port or an out port).
A module can be removed as follows:
#codeh(cpp){{
remove INSTANCE_NAME
}}
- INSTANCE_NAME : Identifier of the module.
In order to disconnect the ports, write as follows:
#codeh(cpp){{
disconnect FROM_MODULE.FROM_PORT , TO_MODULE.TO_PORT
}}
- FROM_MODULE : Departing module.
- FROM_PORT : Departing port (a signal port or an in port).
- TO_MODULE : Destination module.
- TO_PORT : Destination port (a slot port or an out port).
** Parameter Manipulation [#Parameter_Manipulation]
In order to assign into parameters in a configuration box...
#codeh(cpp){{
MODULE_ID.config ={
ASSIGN_STATEMENTS
}
}}
- MODULE_ID : Identifier of the module.
- ASSIGN_STATEMENTS : Refer to [[#Assign_Sentence]].
Similarly, assign into a memory box by:
#codeh(cpp){{
MODULE_ID.memory ={
ASSIGN_STATEMENTS
}
}}
- MODULE_ID : Identifier of the module.
- ASSIGN_STATEMENTS : Refer to [[#Assign_Sentence]].
If we omit MODULE_ID., we can assign into parameters of t...
#codeh(cpp){{
config ={
ASSIGN_STATEMENTS
}
memory ={
ASSIGN_STATEMENTS
}
}}
** Composite Module [#a90c0a0c]
We can define a ''composite module'' as a new module type...
We refer to an included module as a ''sub-module''.
The composite module is defined as follows:
#codeh(cpp){{
composite CMODULE_NAME
{
STATEMENTS_IN_CMP
}
}}
- CMODULE_NAME : Identifier of the composite module.
- STATEMENTS_IN_CMP : module, remove, connect, disconnect...
Note that, a composite module can include the other compo...
In default, a new composite module has no ports, no confi...
#codeh(cpp){{
export MODULE_ID.config.PARAM_ID as_is
export MODULE_ID.config.PARAM_ID as EXPORT_NAME
export MODULE_ID.memory.PARAM_ID as_is
export MODULE_ID.memory.PARAM_ID as EXPORT_NAME
export MODULE_ID.PORT_ID as_is
export MODULE_ID.PORT_ID as EXPORT_NAME
}}
The export with .config or .memory exports the configurat...
- MODULE_ID : Identifier of the sub-module.
- PARAM_ID : Identifier of the parameter.
- PORT_ID : Identifier of the port.
- EXPORT_NAME : Exported with this name.
If a parameter of a sub-module is not exported, the only ...
#codeh(cpp){{
edit CMODULE_ID
{
STATEMENTS_IN_EDIT
}
}}
- CMODULE_ID : Identifier of the composite-module instance.
- STATEMENTS_IN_EDIT : include, include_once, dump1, dump...
A composite module can be inherited from the other compos...
#codeh(cpp){{
inherit CMODULE_NAME
inherit_prv CMODULE_NAME
}}
Using inherit keeps the export configuration of the paren...
- CMODULE_NAME : Name of the parent composite module (not...
** Function Definition [#r26a9e51]
A function can be defined as follows:
#codeh(cpp){{
def FUNCTION_NAME(PARAMETER_LIST)
{
STATEMENTS_IN_DEF
}
}}
- FUNCTION_NAME : Name of the function.
- PARAMETER_LIST : List of the parameters.
- STATEMENTS_IN_DEF : composite, linclude, return, and ST...
A function can return a value as follows:
#codeh(cpp){{
return EXPRESSION_BLOCK
}}
- EXPRESSION_BLOCK : Refer to [[#Assign_Sentence]].
** Function Call [#Function_Call]
Defined function can be called as:
#codeh(cpp){{
FUNCTION_NAME(ARGUMENT_LIST)
}}
FUNCTION_NAME : Name of the function.
ARGUMENT_LIST : List of arguments. Each argument is a EX...
** Control Statement [#Control_Statement]
In the current implementation, only the ''if'' statement ...
#codeh(cpp){{
if(EXPRESSION_BLOCK)
{
STATEMENTS_TRUE
}
else
{
STATEMENTS_FALSE
}
}}
- EXPRESSION_BLOCK : Condition; if true, STATEMENTS_TRUE ...
** System Operation [#o690664e]
statement_include
statement_include_once
statement_linclude
statement_dump1
statement_dump2
statement_print
statement_destroy
#codeh(cpp){{
}}
** Assign Sentence [#Assign_Sentence]
The following statements are available in ASSIGN_STATEMEN...
statement_print
statement_starting_with_identifier
statement_primitive_assign
statement_composite_assign
statement_elemental_assign
statement_elemental_primitive_assign
statement_elemental_composite_assign
statement_push
statement_push_primitive
statement_push_composite
statement_fill_all
statement_fill_all_primitive
statement_fill_all_composite
statement_function_call
statement_unexpected
#codeh(cpp){{
}}
EXPRESSION_BLOCK
End:
''Table of Contents''
#contents
* Overview [#j92e773b]
An ''agent script'' is a script stored in a file named *....
The agent script system is under-construction; which will...
* Grammar [#i81f9e14]
In the following guide, a CAPITAL WORD denotes a paramete...
** Comment [#e3443b55]
Characters followed by "//" are parsed as a comment.
#codeh(cpp){{
// THIS IS A COMMENT
module MAVFTable avf_table // THIS IS A COMMENT
}}
** Modular Manipulation [#ja7d2616]
In order to instantiate a module, write as follows:
#codeh(cpp){{
module MODULE_TYPE INSTANCE_NAME
}}
- MODULE_TYPE : Name of module type.
- INSTANCE_NAME : Identifier of instance.
In order to connect two ports, write as follows:
#codeh(cpp){{
connect FROM_MODULE.FROM_PORT , TO_MODULE.TO_PORT
}}
- FROM_MODULE : Departing module.
- FROM_PORT : Departing port (a signal port or an in port).
- TO_MODULE : Destination module.
- TO_PORT : Destination port (a slot port or an out port).
A module can be removed as follows:
#codeh(cpp){{
remove INSTANCE_NAME
}}
- INSTANCE_NAME : Identifier of the module.
In order to disconnect the ports, write as follows:
#codeh(cpp){{
disconnect FROM_MODULE.FROM_PORT , TO_MODULE.TO_PORT
}}
- FROM_MODULE : Departing module.
- FROM_PORT : Departing port (a signal port or an in port).
- TO_MODULE : Destination module.
- TO_PORT : Destination port (a slot port or an out port).
** Parameter Manipulation [#Parameter_Manipulation]
In order to assign into parameters in a configuration box...
#codeh(cpp){{
MODULE_ID.config ={
ASSIGN_STATEMENTS
}
}}
- MODULE_ID : Identifier of the module.
- ASSIGN_STATEMENTS : Refer to [[#Assign_Sentence]].
Similarly, assign into a memory box by:
#codeh(cpp){{
MODULE_ID.memory ={
ASSIGN_STATEMENTS
}
}}
- MODULE_ID : Identifier of the module.
- ASSIGN_STATEMENTS : Refer to [[#Assign_Sentence]].
If we omit MODULE_ID., we can assign into parameters of t...
#codeh(cpp){{
config ={
ASSIGN_STATEMENTS
}
memory ={
ASSIGN_STATEMENTS
}
}}
** Composite Module [#a90c0a0c]
We can define a ''composite module'' as a new module type...
We refer to an included module as a ''sub-module''.
The composite module is defined as follows:
#codeh(cpp){{
composite CMODULE_NAME
{
STATEMENTS_IN_CMP
}
}}
- CMODULE_NAME : Identifier of the composite module.
- STATEMENTS_IN_CMP : module, remove, connect, disconnect...
Note that, a composite module can include the other compo...
In default, a new composite module has no ports, no confi...
#codeh(cpp){{
export MODULE_ID.config.PARAM_ID as_is
export MODULE_ID.config.PARAM_ID as EXPORT_NAME
export MODULE_ID.memory.PARAM_ID as_is
export MODULE_ID.memory.PARAM_ID as EXPORT_NAME
export MODULE_ID.PORT_ID as_is
export MODULE_ID.PORT_ID as EXPORT_NAME
}}
The export with .config or .memory exports the configurat...
- MODULE_ID : Identifier of the sub-module.
- PARAM_ID : Identifier of the parameter.
- PORT_ID : Identifier of the port.
- EXPORT_NAME : Exported with this name.
If a parameter of a sub-module is not exported, the only ...
#codeh(cpp){{
edit CMODULE_ID
{
STATEMENTS_IN_EDIT
}
}}
- CMODULE_ID : Identifier of the composite-module instance.
- STATEMENTS_IN_EDIT : include, include_once, dump1, dump...
A composite module can be inherited from the other compos...
#codeh(cpp){{
inherit CMODULE_NAME
inherit_prv CMODULE_NAME
}}
Using inherit keeps the export configuration of the paren...
- CMODULE_NAME : Name of the parent composite module (not...
** Function Definition [#r26a9e51]
A function can be defined as follows:
#codeh(cpp){{
def FUNCTION_NAME(PARAMETER_LIST)
{
STATEMENTS_IN_DEF
}
}}
- FUNCTION_NAME : Name of the function.
- PARAMETER_LIST : List of the parameters.
- STATEMENTS_IN_DEF : composite, linclude, return, and ST...
A function can return a value as follows:
#codeh(cpp){{
return EXPRESSION_BLOCK
}}
- EXPRESSION_BLOCK : Refer to [[#Assign_Sentence]].
** Function Call [#Function_Call]
Defined function can be called as:
#codeh(cpp){{
FUNCTION_NAME(ARGUMENT_LIST)
}}
FUNCTION_NAME : Name of the function.
ARGUMENT_LIST : List of arguments. Each argument is a EX...
** Control Statement [#Control_Statement]
In the current implementation, only the ''if'' statement ...
#codeh(cpp){{
if(EXPRESSION_BLOCK)
{
STATEMENTS_TRUE
}
else
{
STATEMENTS_FALSE
}
}}
- EXPRESSION_BLOCK : Condition; if true, STATEMENTS_TRUE ...
** System Operation [#o690664e]
statement_include
statement_include_once
statement_linclude
statement_dump1
statement_dump2
statement_print
statement_destroy
#codeh(cpp){{
}}
** Assign Sentence [#Assign_Sentence]
The following statements are available in ASSIGN_STATEMEN...
statement_print
statement_starting_with_identifier
statement_primitive_assign
statement_composite_assign
statement_elemental_assign
statement_elemental_primitive_assign
statement_elemental_composite_assign
statement_push
statement_push_primitive
statement_push_composite
statement_fill_all
statement_fill_all_primitive
statement_fill_all_composite
statement_function_call
statement_unexpected
#codeh(cpp){{
}}
EXPRESSION_BLOCK
Page: