https://github.com/chamal1120/lox
My implementation of the Lox Language from the book "Crafting Interpreters" by Robert Nystorm (WIP)
https://github.com/chamal1120/lox
lexer-parser lox-language
Last synced: 7 months ago
JSON representation
My implementation of the Lox Language from the book "Crafting Interpreters" by Robert Nystorm (WIP)
- Host: GitHub
- URL: https://github.com/chamal1120/lox
- Owner: Chamal1120
- Created: 2025-05-08T20:20:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-10-05T09:52:10.000Z (7 months ago)
- Last Synced: 2025-10-05T11:39:04.945Z (7 months ago)
- Topics: lexer-parser, lox-language
- Language: Java
- Homepage: https://craftinginterpreters.com
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lox Programming Language
-- My implementations for Crafting Interpreteres by Bob Nystorm --
## TODO
- [x] main function that runs the REPL and Compiler
- [x] Data Structure for the lexemes (Token and TokenType enum)
- [x] scanner
- [ ] parser
- [ ] compiler
> [!NOTE]
> Things might change here coz I'm still following this book.
## How to run
1. Clone repo (Duh..!)
2. Create a `test.lox` file:
```
print "Hello, Lox!";
true; // Not false.
false; // Not *not* false.
1234; // An integer.
12.34; // A decimal number.
"I am a string";
""; // The empty string.
"123"; // This is a string, not a number.
a = 1;
b = 2;
c = a + b;
d = a / b;
print c;
print d;
```
3. Make sure you have [Apache Maven](https://maven.apache.org/install.html) available on your `PATH`.
4. Compile using the given script (wraps `mvn clean compile`):
```bash
./compile.sh
```
5. Run using the given script (re-compiles and launches the AST printer for now):
```bash
./run.sh
```