This is a continuation of Part VI. This time, we will be adding the FOR-NEXT
loop and unary negation.
Continue reading
BASIC Interpreter, Part VI
This is a continuation of Part V. In the previous section, we added support for the GOTO
statement. Since we don’t yet have any control logic, that is not very useful, but it does lay the infrastructure for one of the features we will add this time: IF-THEN
. We will also add the READ
and DATA
statements.
Continue reading
BASIC Interpreter, Part V
This is a continuation of Part IV. In Part V we will add support for parentheses in mathematical expressions, add the GOTO
and END
statements, and implement the remaining program storage statements: CATALOG
, SCRATCH
, and RENAME
.
Continue reading
BASIC Interpreter, Part IV
This is a continuation of Part III. This time we will add some mathematical operators, the ability to save and load programs, and support numerical variables.
Continue reading
BASIC Interpeter, Part III
This is a continuation of Part II. In this part, we will add support for numerical as well as string expressions, support multiple expression in a PRINT statement, and add functionality for deleting program lines.
Continue reading
BASIC Interpreter, Part II
This is a continuation of Part I. In Part II, we will add functionality to store and run BASIC programs, although still limited to the PRINT statement. We will also be adding a LIST statement to print out the currently stored program.
Continue reading
BASIC Interpreter, Part I
This is the first of a multi-post tutorial on using flex and Bison to write a programming language interpreter, in this case, BASIC. We’ll be using the 1964 BASIC manual from Dartmouth as the starting point language reference. All code is available at this GitHub repository: https://github.com/VisceralLogic/basic. The interpreter will be written in C++. Continue reading
Smultron Code Editor
In developing software, the choice of tools used can affect the ease of the job significantly. While the choice of a language may dictate the compiler to be used, there are generally a number of options for the code editor. For most C, Objective-C, and Java applications, I use Apple’s XCode IDE for the simplicity of having the editor, compiler, and executable all in one interface. For projects in which I won’t be using XCode, however, I now generally use Smultron as the code editor.
Continue reading
Desktop Screensaver Background
The screensaver module in OS X has a command-line option that allows it to be run in the
background of your screen, as a replacement for the desktop picture. I found this in the
application bgscreensaver, which
contains an AppleScript to launch the screensaver module in the background, using a shell
command found by Michael Coyle at ResExcellence.
While this is pretty cool in and of itself, I wanted something that would let me run one
screensaver as the background, and have another one for my actual screensaver.
Continue reading
Compiling with gfortran
I compiled XFoil earlier today for my Mac. XFoil is an open-source airfoil analysis tool. There are various compiled binaries available for Windows systems, but for Unix computers, including Mac OS X, it must be built from the source code. This requires the use of a Fortran compiler. To build it on my Intel-based Mac (10.4.8), I made use of the GCC’s gfortran compiler, available here along with several other Mac Fortran compilers and other interesting stuff. Continue reading