baum
diff baum.1 @ 48:f9fc4c4f9e3d
documented nodes in man page
author | meillo@marmaro.de |
---|---|
date | Sun, 02 Mar 2008 11:04:52 +0100 |
parents | 0b82169d4129 |
children | 7d7abe88e71b |
line diff
1.1 --- a/baum.1 Sun Mar 02 10:34:09 2008 +0100 1.2 +++ b/baum.1 Sun Mar 02 11:04:52 2008 +0100 1.3 @@ -40,6 +40,20 @@ 1.4 1.5 1.6 1.7 +.SH CONCEPT 1.8 + 1.9 +baum programs are represented as nodes in a tree structure. Nodes are of specific kind and contain a value. 1.10 + 1.11 +The tree is processed recursive starting at the root node. Every node controls it's sons and should only know them; while most nodes only use their leftmost son. 1.12 + 1.13 +Each node returns a value to it's parent. (The root node returns an exit code to the shell.) The internal value of the node could be used in any useful way, but only inside the node. 1.14 + 1.15 +All values in the language (return values, expected return values and in-node values) should be of the same type, so that every combination of nodes is possible. 1.16 + 1.17 +Nodes can modify the tree, but should do this only on it's brothers or better only through it's rightmost brother. 1.18 + 1.19 + 1.20 + 1.21 .SH SOURCE CODE 1.22 1.23 Source code are plain text files with one node per line representing the tree. The indention controls in which level in the tree the node is. Indention can be made with SPACE or with TAB characters. Every character means one level. 1.24 @@ -57,18 +71,31 @@ 1.25 .fi 1.26 1.27 1.28 +.SH NODES 1.29 1.30 -.SH CONCEPT 1.31 +.TP 1.32 +.B input 1.33 +Reads a number from standard input which is treated as ASCII value. It inserts a number node with this value as last brother. Returns 0 always. 1.34 1.35 -baum programs are represented as nodes in a tree structure. Nodes are of specific kind and contain a value. 1.36 +.TP 1.37 +.B number 1.38 +Executes it's leftmost son. Returns the internal value. 1.39 1.40 -The tree is processed recursive starting at the root node. Every node controls it's sons and should only know them; while most nodes only use their leftmost son. 1.41 +.TP 1.42 +.B print 1.43 +Prints the return value of it's leftmost son. Ether as char (if the internal value is 99), or as number otherwise. Returns the return value of the leftmost son (passes through). 1.44 1.45 -Each node returns a value to it's parent. (The root node returns an exit code to the shell.) The internal value of the node could be used in any useful way, but only inside the node. 1.46 +.TP 1.47 +.B sum 1.48 +Executes all of it's sons. Returns the sum of their return values. 1.49 1.50 -All values in the language (return values, expected return values and in-node values) should be of the same type, so that every combination of nodes is possible. 1.51 +.TP 1.52 +.B times 1.53 +Copies everything below the node and pastes it as last brother(s). Returns 0 always. 1.54 1.55 -Nodes can modify the tree, but should do this only on it's brothers or better only through it's rightmost brother. 1.56 + 1.57 + 1.58 + 1.59 1.60 1.61 .SH ERRORS