Skip to content

othieno/prolua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PROLUA

Prolua is a simple Lua 5.1 interpreter written in Prolog. Check out the documentation [PDF] for more details.

Requirements

Prolua requires SWI-Prolog. Additionally, Prolua requires a Lua interpreter (lua) and compiler (luac) that implement the 5.1 specification, a current version of which can be found here. The interpreter is used to run the lua2prolog.lua script which generates an abstract syntax, while the compiler is used solely to check for any syntax errors in a Lua script.

Prolua has not been tested with Lua programs that adhere to the 5.0 specification or less and as such, I cannot guarantee they will work in Prolua. Since Prolua currently implements the 5.1 specification, Lua scripts using features introduced in 5.2 and later will not work.

Execution

To run the interpreter, simply execute the prolua.sh script from a terminal. The script takes one or more arguments with the first being the name of the Lua program to interpret, and the rest being command line arguments passed to said program. An example of execution would be

./prolua.sh samples/assignment.lua

Prolua is developed under Debian GNU/Linux and the prolua.sh script is written to work with bash. This means that it won't work under Windows but should, theoretically, work under any Unix-like operating system (e.g. Mac OS), provided the stated requirements are met.

Hierarchy

The folders provided with this software are structured in the following manner:

  • samples contains sample Lua source code files used to test Prolua.
  • src contains the source code tree.

About

A simple Lua interpreter written in Prolog.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published