Skip to content

Commit dbbd30c

Browse files
committed
Prepare for release.
1 parent 8c21204 commit dbbd30c

File tree

6 files changed

+91
-28
lines changed

6 files changed

+91
-28
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See https://github.com/tcort/tcb/graphs/contributors

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See https://github.com/tcort/tcb/commits/master

Makefile.am

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ CLEANFILES = $(BUILT_SOURCES) \
7373
hello.out \
7474
remainder.out
7575

76-
EXTRA_DIST = $(man_MANS) $(top_srcdir)/test-runner.sh \
76+
EXTRA_DIST = \
77+
$(man_MANS) \
78+
test-runner.sh \
79+
README.md \
7780
abs.sh abs.bas abs.ex \
7881
fib.sh fib.bas fib.ex \
7982
hello.sh hello.bas hello.ex \

README.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,24 @@
11
# tcb
22

3-
tcb is a small BASIC Interpreter written in C.
3+
tcb is a small [BASIC](http://en.wikipedia.org/wiki/BASIC) Interpreter
4+
written in C.
45

56
## Current Status
67

7-
Under active development.
8-
9-
## Road to v1.0.0
10-
11-
The following components are complete:
12-
13-
* Scanner
14-
* Parser
15-
* Abstract Syntax Tree
16-
* Man page
17-
18-
The following components are in progress:
19-
20-
* Unit Tests
21-
22-
The following components remain:
23-
24-
* i18n/l10n
8+
The "basics" are done and working. The interpreter implements the
9+
[Tiny BASIC](http://en.wikipedia.org/wiki/Tiny_BASIC) dialect of BASIC.
10+
Development will continue with the goal of implementing successively more
11+
complete dialects of BASIC.
2512

2613
## Requirements
2714

2815
* [C compiler](http://www.gnu.org/software/gcc/) and standard build tools ([make](http://www.gnu.org/software/make/), [sh](http://www.gnu.org/software/bash/), ...).
2916
* [flex](http://www.gnu.org/software/flex/) - buildtime
3017
* [bison](http://www.gnu.org/software/bison/) - buildtime
3118
* [diff](http://www.gnu.org/software/diffutils/) - buildtime (running unit tests)
32-
* [sed](https://www.gnu.org/software/sed/) - buildtime (running unit tests)
19+
* [sed](http://www.gnu.org/software/sed/) - buildtime (running unit tests)
20+
* [autoconf](http://gnu.org/software/autoconf) - development time
21+
* [automake](http://gnu.org/software/makeconf) - development time
3322

3423
## Building
3524

@@ -38,6 +27,7 @@ Standard autotools build:
3827
$ autoreconf -i
3928
$ ./configure
4029
$ make
30+
$ make check
4131
# make install
4232

4333
## Using
@@ -50,6 +40,38 @@ Execute a program from a file in batch mode:
5040

5141
$ tcb sample.bas
5242

43+
## Example Program
44+
45+
The following program calculates
46+
[Fibonacci numbers](http://en.wikipedia.org/wiki/Fibonacci_number)
47+
and demonstrates all of the available statements. It's included
48+
in the sources as `sample.bas`:
49+
50+
10 PRINT "How many fibonacci numbers should I calculate?"
51+
20 INPUT X
52+
30 IF X <= 2 THEN GOTO 10
53+
40 PRINT "Calculating the first ",X," fibonacci numbers: "
54+
50 PRINT "fib[0] = 0"
55+
60 PRINT "fib[1] = 1"
56+
70 LET J = 1
57+
58+
100 LET J = J + 1
59+
110 LET A = 0
60+
120 LET B = 1
61+
130 LET I = 1
62+
140 GOSUB 1000
63+
150 PRINT "fib[",J,"] = ",C
64+
160 IF J < X-1 THEN GOTO 100
65+
170 END
66+
67+
1000 LET C = B + A
68+
1010 LET T = B
69+
1020 LET B = C
70+
1030 LET A = T
71+
1040 LET I = I + 1
72+
1050 IF I = J THEN RETURN
73+
1060 GOTO 1000
74+
5375
## Contributing
5476

5577
1. Fork it

TODO

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1-
* Unit Tests
2-
* i18n/l10n
1+
Implement additional commands:
2+
3+
* QUIT
4+
* SAVE filename
5+
* LOAD filename
6+
7+
Implement additional statements:
8+
9+
* FOR/NEXT
10+
11+
Implement language fundamentals:
12+
13+
* Strings
14+
* Floating point
15+
16+
Other changes:
17+
18+
* Better error handling / reporting.
19+
* Move away from flex and bison.

sample.bas

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
1-
10 LET A = 2
2-
20 LET B = 2
3-
30 LET C = A + B
4-
40 PRINT A, "+", B, "=", C
5-
50 END
1+
10 PRINT "How many fibonacci numbers should I calculate?"
2+
20 INPUT X
3+
30 IF X <= 2 THEN GOTO 10
4+
40 PRINT "Calculating the first ",X," fibonacci numbers: "
5+
50 PRINT "fib[0] = 0"
6+
60 PRINT "fib[1] = 1"
7+
70 LET J = 1
8+
9+
100 LET J = J + 1
10+
110 LET A = 0
11+
120 LET B = 1
12+
130 LET I = 1
13+
140 GOSUB 1000
14+
150 PRINT "fib[",J,"] = ",C
15+
160 IF J < X-1 THEN GOTO 100
16+
170 END
17+
18+
1000 LET C = B + A
19+
1010 LET T = B
20+
1020 LET B = C
21+
1030 LET A = T
22+
1040 LET I = I + 1
23+
1050 IF I = J THEN RETURN
24+
1060 GOTO 1000

0 commit comments

Comments
 (0)