git @ Cat's Eye Technologies yucca / 879b2fd
Minor aesthetic changes for release of version 1.0. catseye 12 years ago
2 changed file(s) with 10 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
00 yucca
11 =====
2
3 _Version 1.0, June 10 2012_
24
35 IT SO HAPPENS in the course of human events that one may find oneself
46 cross-developing an 8-bit BASIC program from a modern development
911 cross-developed code is correct.
1012
1113 IT IS FOR THIS PURPOSE that _yucca_ was developed. It is a small Python
12 program which can perform static analysis on 8-bit BASIC programs.
14 program which can perform static analysis on 8-bit BASIC programs.
1315 Specifically, it can, at present, check that every line number which is
1416 a target of a jump is actually present in the program. If it is not, an
1517 error message describing the inconsistency is given.
2224 recognize (and thus will not check) computed `GOTO`s or any
2325 dialect-specific command that involves line numbers.
2426
25 THE BASIC PROGRAM to be analyzed must be present in a textual form.
27 THE BASIC PROGRAM to be analyzed must be present in a textual form.
2628 Some emulators allow such text to be pasted in, to simulate entering it
2729 at the 8-bit computer's keyboard; other tools are available to convert a
2830 tokenized BASIC program to a textual form and back. `yucca` handles
4951 Python's `fileinput` module is used, so the BASIC source can also be piped
5052 into `yucca`, and so forth.
5153
52 By default, the program is checked that the target of each jump is an
54 By default, `yucca` checks that the target of each jump in the program is an
5355 existing line number. This includes any jumps that may occur in immediate
5456 mode commands (i.e. commands with no line number) given in the text
5557 file. If this check fails, further transformations may not be performed on
8688
8789 * Show errors in the order they occur in the program.
8890 * Handle duplicate and deleted lines (line number then nothing.)
91 * Support `GO TO` form of `GOTO` found in some BASICs.
8992
9093 Plans
9194 -----
9295
9396 `yucca` could be easily extended to warn about "code smells" such as a
94 redundant `GOTO` to the next line, a line conaining another `GOTO`, and
97 redundant `GOTO` to the next line, a line containing another `GOTO`, and
9598 so forth.
9699
97100 `yucca` can dump the input program with (as far as I can tell) total
00 #!/usr/bin/env python
1
2 # yucca -- dialect-agnostic static analyzer for 8-bit BASIC programs
3 # Version 1.0, June 10 2012
14
25 # Copyright (c)2012 Chris Pressey, Cat's Eye Technologies
36 #