Language_5 - A Language of Expressions with Global First Class Functions

The packages {@link language5}, {@link treelanguage}, {@link tree}, and {@link tokenizer} define a language of arithmetic and boolean expressions, with if-expressions, while-loops, and global functions, that use a Lisp like prefix notation.

The grammar for this language is in the file Language_5.txt

The file {@link Language_5_Examples} shows many examples of expressions in this language.

The file {@link Language_5} defines an interpreter for this language.

To build the interpreter, run (double-click)

   build_all_classes.cmd
then run
   build_jar_file.cmd
which builds an executable jar file for the interpreter program.

To run the interpreter jar file, on the command-line run

> Language_5.cmd
which runs the interpreter as a REPL (read eval print loop).

The files

are "script files" written in this language. script-1 computes the gcd of two integers. script-2 determines if an integer is a prime number. And script-3 computes the prime factorization of an integer. These examples show that Language_5 is a real programming language.

To run a script file using the interpreter, on the command-line run

> Language_5.cmd  script-1.Lan5
> Language_5.cmd  script-2.Lan5
> Language_5.cmd  script-3.Lan5

You can use the Language_5.cmd shell script without having to open a command-line window. This makes it easy to run the interpreter's jar file. If you double click on Language_5.cmd (after having built the jar file), it will run the interpreter as a REPL. If you drag-and-drop one of the "language scripts" onto Language_5.cmd, the shell script will execute the language script file using the interpreter's jar file.