<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

  <link rel="icon"          href="/favicon.ico" type="image/x-icon">
  <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
  <link rel="stylesheet"    href="../../../../../../default.css"  type="text/css">

  <TITLE>A Quick, Dirty and Ugly BASIC implemented in Common Lisp</TITLE>

  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  <META HTTP-EQUIV="Description"
        NAME="description" CONTENT="BASIC in Common Lisp">
  <META NAME="author"      CONTENT="Pascal J. Bourguignon">

  <META NAME="keywords"    CONTENT="BASIC, Common Lisp, Lisp">

<H2>A Quick, Dirty and Ugly Basic interpreter</H2>
<p>This is a silly BASIC interpreter.
<p>The lines are tokenized and stored
   as-is in an array indexed by the line number.  When interpreting the
   program, the instructions are parsed directly from there ; the
   expressions are parsed into trees which are then evaluated.</p>

<p> The variables are stored into a hash table indexed by their
   identifier (symbol). Undefined variables are taken as 0 or "".</p>

<p> We distinguish number and string variables depending on the presence
   of a '$' character in the last position of the variable identifier.
<p> Variables are reset by the command RUN. (A program can be restarted
   without losing the variable using the GOTO or GOSUB statements).
   Commands are not distinguished from statements and may occur in a
   program. In particular, LOAD could be used to load a subprogram
   overlay, and takes a line number where to jump to. </p>
<p> Programs are loaded and saved in source form.</P>

<LI><A HREF="basic.lisp">basic.lisp</A></LI>
<LI><A HREF="test1.basic">test1.basic</A></LI>
<LI><A HREF="test2.basic">test2.basic</A></LI>