Mercurial > baum
annotate baum.1 @ 43:c7dca4a1dc37
added test programs; added another example program
author | meillo@marmaro.de |
---|---|
date | Sat, 01 Mar 2008 21:13:12 +0100 |
parents | 233ac9bea4f1 |
children | 0b82169d4129 |
rev | line source |
---|---|
37
29172b6e802a
switched to next version number, updated man page
meillo@marmaro.de
parents:
33
diff
changeset
|
1 .TH baum 1 "2008-03-01" "baum 0.3" |
18 | 2 .SH NAME |
3 baum \- an esoteric programming language | |
4 | |
5 | |
6 | |
7 .SH SYNOPSIS | |
8 .B baum | |
31
4e60d96265f0
removed -c option completely; updated man page; new error code 5
meillo@marmaro.de
parents:
18
diff
changeset
|
9 [\-v]\ <file> |
18 | 10 |
11 | |
12 | |
13 .SH DESCRIPTION | |
14 .B baum | |
15 is an interpreter for the baum programming language which is an experiment to create an esoteric programming language. | |
16 | |
17 Source code is a representation of a tree in which every node is a command or data. | |
18 | |
19 baum is only an experiment and the functionality is (currently) very restricted. | |
20 | |
21 | |
22 | |
23 | |
24 .SH OPTIONS | |
25 | |
26 .TP | |
27 .BI \-v | |
42
233ac9bea4f1
switched exit code 127 to 126 (because shell returns 127 if command not found)
meillo@marmaro.de
parents:
37
diff
changeset
|
28 Verbose output (All verbose output goes to stderr) |
18 | 29 |
30 .TP | |
31 .BI \-\-help | |
32 Print usage information | |
33 | |
34 .TP | |
35 .BI \-\-version | |
36 Print version information | |
37 | |
38 | |
39 | |
40 | |
41 | |
42 | |
43 .SH SOURCE CODE | |
44 | |
45 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. | |
46 | |
47 Empty lines and everything vom the hash symbol (`#') to the end of the line is ignored. | |
48 | |
37
29172b6e802a
switched to next version number, updated man page
meillo@marmaro.de
parents:
33
diff
changeset
|
49 .B An example that echoes (and returns) `42': |
18 | 50 |
51 .nf | |
52 # comment | |
53 print(0) | |
54 sum(0) #comment | |
55 number(40) | |
56 number(2) | |
57 .fi | |
58 | |
59 | |
60 | |
61 .SH CONCEPT | |
62 | |
63 baum programs are represented as nodes in a tree structure. Nodes are of specific kind and contain a value. | |
64 | |
65 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. | |
66 | |
37
29172b6e802a
switched to next version number, updated man page
meillo@marmaro.de
parents:
33
diff
changeset
|
67 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. |
18 | 68 |
69 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. | |
70 | |
71 Nodes can modify the tree, but should do this only on it's brothers or better only through it's rightmost brother. | |
72 | |
73 | |
74 .SH ERRORS | |
75 | |
43
c7dca4a1dc37
added test programs; added another example program
meillo@marmaro.de
parents:
42
diff
changeset
|
76 You have to keep in mind, that valid programs that run successful can return exit codes different from zero too! Each program returns the return value of the root node to the shell. If you don't want your program doing this, just set a `number(0)' node as root, and put everything else below. |
c7dca4a1dc37
added test programs; added another example program
meillo@marmaro.de
parents:
42
diff
changeset
|
77 |
18 | 78 .TP |
79 .BI 1 | |
80 common error | |
81 | |
82 .TP | |
83 .BI 3 | |
84 no or more than one source file given | |
85 | |
86 .TP | |
87 .BI 4 | |
88 invalid node | |
89 | |
90 .TP | |
31
4e60d96265f0
removed -c option completely; updated man page; new error code 5
meillo@marmaro.de
parents:
18
diff
changeset
|
91 .BI 5 |
4e60d96265f0
removed -c option completely; updated man page; new error code 5
meillo@marmaro.de
parents:
18
diff
changeset
|
92 indention over more than one level |
4e60d96265f0
removed -c option completely; updated man page; new error code 5
meillo@marmaro.de
parents:
18
diff
changeset
|
93 |
4e60d96265f0
removed -c option completely; updated man page; new error code 5
meillo@marmaro.de
parents:
18
diff
changeset
|
94 .TP |
33
2e564bf8599c
new error code 6; more readable printTree; cleanups
meillo@marmaro.de
parents:
31
diff
changeset
|
95 .BI 6 |
2e564bf8599c
new error code 6; more readable printTree; cleanups
meillo@marmaro.de
parents:
31
diff
changeset
|
96 node name too long, or no value given |
2e564bf8599c
new error code 6; more readable printTree; cleanups
meillo@marmaro.de
parents:
31
diff
changeset
|
97 |
2e564bf8599c
new error code 6; more readable printTree; cleanups
meillo@marmaro.de
parents:
31
diff
changeset
|
98 .TP |
42
233ac9bea4f1
switched exit code 127 to 126 (because shell returns 127 if command not found)
meillo@marmaro.de
parents:
37
diff
changeset
|
99 .BI 126 |
18 | 100 invalid command line options |
101 | |
102 | |
103 | |
104 .SH BUGS | |
105 Please report if you find some. | |
106 | |
107 | |
108 .SH CREDITS | |
109 Ju developed the idea of | |
110 .B baum | |
111 with me in a conversation. Actually it was his idea to use the tree as basic structure. | |
112 | |
113 | |
114 | |
115 .SH AUTHOR | |
116 markus schnalke <meillo@marmaro.de> and julian forster |