Joseph Coffland
jcofflan@users.sourceforge.net
April 5, 2006
Copyright ©2004 University of Amsterdam. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included with this documentation, GNU Free Documentation License.
<property name="init" value="1,arch,#[port1,port2,port3],<channel>"/>
An init string is a comma separated list of arguments which are passed to the YMLPearl class at creation time. This coincides with the variables listed in the .ps specification file. The order in the init string must match the order in the .ps file.
The arguments of in the init string are either an integer, a port type, regular expression matching port names in the YML file or an array of the first three argument types.
An integer is simply a whole number and may be positive, negative or zero.
A port type argument has the form '<type>' optionally preceded by a # symbol. YMLPearl creates an array of peers of the specified type by iterating through all the peers connected to output ports of the current object. A peer is added to the array if its class is the same as or is a subtype of the type specified. If the argument is preceded by a # symbol it represents two arguments, the size of the resulting array of matching peers followed by the array itself. # is not allowed when this argument is with in an array argument.
Regular expressions can be used to match port names. The resulting argument will be the peer id of the pearl object connected to the matching port. If this argument is not with in an array argument it must match one and only one port with only one peer connected to it. See the Unix man page about POSIX regular expressions for information on how to create regular expressions.
array arguments are used to pass a fixed or variable length array of values to a pearl object. An array argument has the form '[arg1,. . .,argN]' and is optionally preceded by a # symbol in which case it is actually two arguments, an integer representing the array length and the array itself. Within the square brackets is a comma separate list of the first three argument types. There are no sub-arrays. The resulting peer ids of port type and regular expression arguments are merely added to the array in order.