Kiara is a simple language created for Building a Programming Language course.
- Lua 5.3
- Luarocks
- LPeg
luarocks install lpeg
- kiara\interpreter.lua: The start point of the language. By default it will print the AST and the code for the program that you pass. If you want to not display those info you need to edit
run(params, true)
torun(params, false)
- kiara\parser.lua: Responsible to parser the output of the
kiara\grammar.lua
- kiara\debug.lua: A helper function to help us to debug the
kiara\grammar.lua
- kiara\grammar.lua: The LPeg grammar for KiaraLang.
- kiara\compiler.lua: Generate the bytecode for the stack machine.
- kiara\build.lua: The language stack machine.
First read the Report to understand the language.
To run a .kiara program you need to run the following command:
lua kiara/interpreter.lua example.kiara
where example.kiara
is the file that we want to run.
Exists a test for every functionally of the language in the file test.lua You can run the tests using the following commands:
lua test.lua
or make tests
- Fix multidimensional arrays
- Implement support for strings