Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (34 sloc) 1.33 KB
A Tree Notation object is a sequence of bits/bytes/characters(hereafter abbreviated
as chars). Tree Notation requires the definition of at least 2 special chars which turn
an otherwise unstructured linear sequence of chars into a structured recursive tree object.
Those 2 special chars are referred to as XI and YI. YI delimits nodes and XI is used
to indicate the parent/child relationship between nodes.
By convention those special characters are:
YI
newline character
Keyboard: Enter Key
Binary: 00001010
Hex: 0A
Decimal: 10
As string: "\n"
(Note: On Windows, "\r" is treated the same as any other non-special char)
XI
space character
Keyboard: Space Key
Binary: 00100000
Hex: 20
Decimal: 32
As string: " "
Often it is beneficial to define a third delimiter, ZI, which is used to
separate words/cells on a line. By convention ZI is also a space. Although
in theory ZI and XI can conflict, in practice, given a higher level Tree Language
grammar, that does not happen.
The basic structure of a Tree Notation object is as follows:
interface TreeNode {
parent: &TreeNode
children: TreeNode[]
line: string
}
From those building blocks one can build higher level languages. The "Grammar Language"
and code should be referenced to learn how to define and implement cells and higher level Tree Languages.
This is currently the full spec of Tree Notation.
You can’t perform that action at this time.