TreeNode Format


Simkin script can be stored within any convenient mechanism.

The distrubution includes classes that show how it can be stored within XML files, or within a format called "TreeNode".

The TreeNode format is hierarchical textual format which echoes that used in many applications.

The advantages of using the TreeNode format over XML are:

The TreeNode format is a recursive definition. Each TreeNode item is composed of:
  1. a label - this is alphanumeric, but may also include the following characters: This makes it possible to store path names without spaces as a label.

    Simkin methods use the label to store the method name.

  2. data - this is arbitrary text, including spaces and line endings, within the delimeters "[" and "]". You use "\[" and "\]" to quote these delimeters within the text. Whitespace in the text is preserved.

    Simkin methods are stored within the data for an item.

  3. children - this is a list of descendents of the item, which are themselves items. The list is delimeted by "{" and "}"
Each element is optional.

A TreeNode "file" is an item with no label or data, but a list of items.

Here are some examples:

A TreeNode file with a single item, with the label "field" but no data or children:

{
 field
}

A TreeNode file with a single item, with the label "field", data "value" and a single child with the label "child":

{
 field [value]
 {
  child
 }
}

A TreeNode file with a field "field" and a Simkin method "method":

{
 field [value]
 method [(){
 }]
}