-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
142 lines (114 loc) · 6.25 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
Interactive BASIC Compiler Project - README
The goal of this project is to create a new unique interactive BASIC
compiler more technically, an incremental BASIC compiler that is
interactive. An incremental compiler has benefits interpreter
(interactivity) and a full compiler (speed). Incremental in the fact
the each program line is compiled individually when entered.
Interactive in that the program can be run at any time without delay
since all the program lines are already compiled.
This project is currently in the design and development stage. This
project is being developed in the C++ language. The software is being
maintained by 'git' distributed revision control system. This project
is built using the GNU Compiler Collection (GCC) suite, with a make file
generated by 'cmake' cross-platform, open-source make system. This
project is currently being developed on Linux (Ubuntu based Mint 13) but
is also be tested on 32-bit Windows XP and 64-bit Windows 7. On the
Windows system, the MinGW Minimal GNU for Windows is used for building.
The Qt toolkit is being used for development of the GUI.
Information for this project can be found at the project's blog located
at http://interactivebasiccompilerproject.blogspot.com, which contains
complete instructions on the required software and how to install it, as
well as how the build and run the project programs. Project files can
be downloaded from https://sourceforge.net/projects/ibcp/files. The git
repository is hosted on GitHub at https://github.com/thunder422/ibcp.
Project Status
--------------
Currently, the BASIC language parser is operational. The parser
converts text input into BASIC language tokens.
The translator is currently being developed with a new scheme that will
make translation of commands simple to implement. The LET, PRINT and
INPUT commands have been implemented so far. The old translator
routines have been left in place until the new routines fully support
the same features, which include the translation of BASIC expressions
along a few BASIC commands (LET, PRINT, INPUT and REM) into a reverse
polish notation format that will be used for fast execution of the BASIC
program.
A basic GUI has been implemented including file, edit and help menus
with basic operation menu items, the tool bar with several file and edit
operations, an edit box for editing the program and a status bar. The
program model implementation has been started for holding the internal
code of the program entered into the edit box. For now the translator
has been integrated with the program model where lines entered from the
edit box are translated and stored in the program model.
There is a temporary program view dock widget used for monitoring the
internal program during development that is currently showing the
translated program lines as RPN lists. Error messages with column and
length values are show for lines with errors. This information is used
to highlight the errors in the edit box. When the cursor is on the line
with an error, the error message is shown on the status bar (which also
now includes the current line number and column). There are actions
(via menu, tool bar and key shortcuts) for moving the cursor to the next
or previous error.
Building The Program
--------------------
Instructions for building the program using GUI tools can be found on
the project's blog. The procedure below assumes all the required tools
have been installed (see the blog for requirements and tool installation
instructions). After either cloning the ibcp git repository to a
directory (default ibcp) or downloading the source and uncompressing the
zip or tar file, the project is build with a few short commands:
cd ibcp
mkdir build
cd build
cmake .. (Linux)
cmake -G "MSYS Makefiles" .. (Windows)
make
Note: The naming convention of tags in the repository has been changed
as of version 0.3.5, which may prevent older tagged versions from
building (cmake will return an error indicating the versions do not
match). Versions prior to the 0.2 series are unaffected.
For versions 0.2.0 to 0.3.4, the commit with the corrections can be
applied using the command "git cherry-pick fa89" where fa89 is the
commit ID with the changes. For versions 0.2-1 to 0.2-6, cmake will not
complain, however, the version string will not be output correctly. The
corrections would need to be applied manually.
Running Regression Tests
------------------------
To run the included regression tests, run the regtest script that was
copied into the ibcp/build directory. The test will report whether the
tests pass or fail. The memtest script (Linux only) will run all the
tests but also look for memory leaks (requires the valgrind program).
Command Line Options
--------------------
The -v option will output the version string and exit. The -h or -?
option will output the usage message and exit. No options or a single
lone file path will start the GUI.
Running Interactively
---------------------
The ibcp program can be run interactive to run either the parser or the
translator (for expressions only or full BASIC commands). The output
from the parser are the resulting tokens. The output from the
translator are the resulting reverse polish notation format of the
tokens. The program is run interactively with this command:
ibcp -tp|-te|-tt|-ne|-nt
The first 't' character represents 'test' mode and the second stands for
parser, expression and translator. The 'n' character activates the new
translator.
Running In Batch
----------------
The ibcp program can run in batch by taking a text input file and
process it through the parser, expression translator, or command
translator. The program is run in batch with this command:
ibcp -t|-n <file>
The beginning of the name of the file (parser, expression, or
translator) determines how the file will be processed. The 'n' option
uses the new translator routines (only expression files are currently
supported).
Test Programs
-------------
There are several test programs contained in the test sub-directory.
These programs are built with the this command (after running cmake as
described above in the build directory):
make tests
This commands take no command line options. There are expected results
for these test programs in the test sub-directory.