Within the <symbolDefinitions> tag, you can define a basic symbol using the <symbol> tag. For a basic symbol, define an expression that can be evaluated using other symbols.
<symbol>
<name>$doubles1</name>
<eval>$s1*2</eval>
<type>int</type>
</symbol>
This symbol returns double the value of another symbol, $s1.
In this tag, use the <type> tag to specify the types of arguments. Specify this value as a fully qualified Java class name, or a Java primitive. You can specify any amount of <type> tags; each of these tags defines an argument.
$symbol(argument1,argument2...)
The
number of arguments must be the same as the number of argument type
definitions.Within the symbol definition, refer to the first argument as $p0, the second argument as $p1, and so on.
A symbol with arguments works like a Java method. It takes input arguments, and returns a value that depends on the values of the arguments.
<symbol>
<name>$double</name>
<eval>$p0*2</eval>
<type>int</type>
<args>
<type>int</type>
</args>
</symbol>
This symbol returns double the value of the
argument. To evaluate it, supply a numeric argument: $double(2), $double($s1).