The syntax descriptions on this page are intended as guidelines, not as strict machine-readable definitions. They are to be interpreted loosely as follows:
<> denote symbols. Some of them are defined elsewhere on the page, some are not because their meaning should be obvious."" appears literally in the text whose syntax is being defined (terminal symbols)."" is insignificant.// is a comment.| denotes alternatives and binds weaklier than concatenation.() are used for grouping.[] denote optional items ("zero or one of this item").{} denote repetition ("zero or more of this item").An event action is performed by passing it as the first argument to INCO.Services.Execute, along with the calling plugin's parent path, name, and main parent as arguments 2 to 4. Its syntax is therefore defined by <command with placeholders> below.
The Cmd.ProcessStream procedure of any plugin (CINIXPlugin::INCOProcessStream()) takes the file name of a stream file in the respective plugin's _Streams_ folder and executes the sequence of commands stored in that file.
Every line of a stream file may be, optionally surrounded by whitespace,
// or # (but not #{),A <command with placeholders> is what is processed by INCO.Services.Execute (SINCO::CINIXPluginSINCOCall::INCOExecute()). Before being interpreted according to section Commands, it is transformed into a <command> by performing placeholder expansion.
Placeholders are the following patterns that upon expansion are replaced by a specific value:
${...}#{...}%{...}Any occurrence of ${, #{, or %{ in the text can be prevented from being seen as the start of a placeholder by doubling the introducing character. Instead, this additional character will be removed, i.e. $${ is replaced by ${, ##{ by #{, %%{ by %{.
<redirection> = "${" <redirection content> "}"
<redirection content> = [<target path>] <extended inco item path>
| "{" <redirection content> "}"
Redirections with a single pair of braces expand to the string value of the INCO variable with the given path, which is, for string variables, the string itself, and for numerical variables, the number in decimal notation without any type suffix. With a double pair of braces, redirections expand to the string representation of the value as defined below under <value>. A triple pair of braces yields the string representation of the string representation of the value, and so on – each additional pair of braces applies another conversion to string representation.
${Prop.Greeting} --> Hello "World"
${{Prop.Greeting}} --> "Hello \"World\""
${{{Prop.Greeting}}} --> "\"Hello \\\"World\\\"\""
${Prop.Answer} --> 42
${{Prop.Answer}} --> 42:d
${{{Prop.Answer}}} --> "42:d"
Choosing the right number of braces requires a bit of care. For example, the command
.Cmd.SetTitle("Greeting: ${Prop.Greeting}", 42:d)
will sometimes work, but it breaks down easily: if the value of Prop.Greeting is the one from the example above, it expands to
.Cmd.SetTitle("Greeting: Hello "World"", 42:d)
which is not valid syntax. The proper solution is to use
.Cmd.SetTitle("Greeting: " ${{Prop.Greeting}}, 42:d)
which will work for any value of Prop.Greeting.
A rule of thumb for placeholders that expand to strings is:
Predefined constants that are always available are:
#{PLUGIN_NAME}
#{PARENT_PATH}
#{PLUGIN_PATH} -- the respective property of the calling plugin
#{PLUGIN_DIR}
#{MAIN_PARENT_PATH}
#{MAIN_PARENT_DIR}
#{SHIFT_KEY_STATE} -- 1 if the shift key is pressed, 0 otherwise
At specific places, additional constants may be available, such as (without claim to completeness):
#{VARIABLE} - the path of the variable in question (with or without target as entered in Prop.VarName)#{NEW_VALUE} - the value of the variable after the change, or the newly entered value (only for OnValueChange and OnDidEdit)#{OLD_VALUE} - the value before the change (only for OnValueChange and OnDidEdit)#{NAME} - the command name that was given to ExecuteProcess()#{ARGUMENTS} - the argument list#{STATUS} - exit status of the process in TerminationCallback (0 in StartedCallback)#{PID} - process ID#{UNIQUE_ID} - unique entity ID within the executor plugin (number of the Entities.Process_... folder)#{TEXT} - the message text as it was passed to the outwin plugin. Example: "Ini 0 33.601160ms [Startup] [Indel AG]"#{TEXT_FORMATTED} - the formated message text. The string in the format as passed to the output method (currently only HTML is available and thus this is the html formatted message text). Example: "<font color="#00000000">Ini#160;#160;#160;#160;0#160;33.601160ms#160;[Startup]#160;[Indel#160;AG]</font>"#{METADATA} - the metadata of the message. This string constant is used to add additional information to the outwin message. For example, "stdout", "stderr", ...#{ID} - the unique ID of the message. This a positive integer value.#{VISIBILITY} - the visibility of the message. Depending on the defined message rule(s), the visiblity of a message may be 1 (=visible) or 0 (=hidden)#{ITEM_PATH} - the index path of the menu item that triggered the eventAs for redirections, a constant with a single pair of braces expands to the respective string value, double braces make it expand to the string representation, etc. - see Redirections.
INCO item triggers (INCO item triggers documentation) also have some constants defined, see Constants provided by INCO item triggers. In contrast to the constants listed above, triggers are not aware of the "generally available" constants mentioned before (such as #{PLUGIN_NAME}).
Options are:
%{SYNCH} -- causes a <putvariable command> or <callprocedure command> to be executed synchronously
Options expand to the empty string, but their presence modifies the further processing of the command.
<command> = "Python> " <shell encoded list>
| "PythonSync " <shell encoded list>
| "Stream> " <filename>
| <putvariable command>
| <callprocedure command>
A <shell encoded list> is a string that is interpreted as a list of strings by splitting it at spaces (or runs of consecutive spaces), unless those spaces lie within a quoted string. Quoted strings start and end at ". Outside of quoted strings, \ suppresses the special behavior, if any, of the next character and is dropped (characters with special behavior are space, ", and \). Inside quoted strings, \ is only dropped (and suppresses special behavior) if it precedes " or \, all other occurrences of \ are preserved.
To decode a <shell encoded list>, use the ReadNextItemFromShellEncodedList() function. To build a <shell encoded list>, use CINCOValue::StringRep() or its variants to encode the individual items, then join them with spaces. (If you are certain that an item doesn't contain " or \\, you can get away with putting it between ". If you are certain that it doesn't contain space, ", or \, you can even include it as-is.)
Mary\ had "a \"li"ttle\" lamb "" \\p\i "\pi" "\\pi"is interpreted as
Mary had a "little" lamb \pi \pi \pi
A Python> or PythonSync> command is transformed into a <callprocedure command> that calls the Python.Services.Execute procedure (CINIXPython::INCOExecuteAction()), passing the first item in the given <shell encoded list> as the first argument (script name), the rest of the list as the second argument (script arguments), the load location [FIXME: what's that?] of the calling plugin as the third, and 0 for Python> or 1 for PythonSync> as the forth argument.
A Stream> command is transformed into a <callprocedure command> that calls the calling plugin's Cmd.ProcessStream procedure with the given file name.
<putvariable command> = [<target path>] <extended inco path> {whitespace} "=" <value>
<callprocedure command> = [<target path>] <extended inco path> {whitespace} "(" [<value> {"," <value>}] ")"
<target path> = [("//" | "\\") <server name or address> ("/" | "\")] {<target name> ("/" | "\")}
| "." //current process
| ".." //parent of current process
| "..." //current INCO server
<extended inco path> = <extended inco item path>
| <extended inco item path> "!" <property name>
| <extended inco item path> ":" <bit number>
| <extended inco item path> "[" <array index> "]"
<extended inco item path> = "."
| ["."] <extended inco path component> {"." <extended inco path component>}
Paths starting with . are relative to the caller's plugin, those not starting with . are absolute. Exception: < at the start of a path is an abbreviation for .<, i.e. those paths are relative too.
<extended inco path component> = <inco item name>
| "<" //up one level
<inco item name> = <nonempty sequence of alphanumeric characters, spaces, underscores (_), hyphen-minuses (-), and backslash-escaped periods (\.)>
Periods in INCO item names are only allowed if they are preceded by a backslash. Backslashes are only allowed if they are followed by a period. Unescaped periods are always considered as path separators, and non-period-escaping backslashes as target separators.
<value> = {whitespace} <trimmed value> {whitespace}
<trimmed value> = <number> { {whitespace} ("+"|"-") {whitespace} <number> }
| <string literal> { {whitespace} <string literal> }
<number> = ("0x"|"0X") <hexadecimal integer> ":" ("l"|"f"|"d"|"L"|"F"|"D")
| <decimal integer> [":" ("l"|"L")]
| <decimal real number> [":" ("f"|"d"|"F"|"D")]
<string literal> = """ <string contents with " and \ escaped as \" and \\, optionally LF as \n> """
<value>s are interpreted and written by the CINCOValue class or by the incostringrep Python module.
Decimal numbers without a type suffix are accepted and interpreted as float values for backwards compatibility, but should be avoided in new applications.
Multiple adjacent string literals are concatenated into one string (this is mainly useful if some of the literals are the result of placeholder expansion).
Joining multiple numbers with "+" or "-" computes the respective sum or difference (this too is mainly useful if some of the numbers are the result of placeholder expansion). The type of the result is determined as follows: If any summand is a double, the result is a double. Else, if any summand is a float, the result is a float. Else, if any summand is a signed integer, the result is a signed integer. Else (i.e. if all summands are unsigned integers), the result is an unsigned integer.
IGD files are text files that store the value of a single INCO variable. After removing whitespace from the beginning and end of each line, removing comment lines that start with //, #, or ;, and concatenating all remaining lines, the contents of an IGD file are interpreted as a <value> as defined above.
The syntax accepted by the CallProcedure() function in libinco_32 is defined by <callprocedure command> above, with the exception that only absolute INCO paths, and no "<" (up one level) path components, are allowed.
1.8.8