Skip to content

Commit acff31f

Browse files
committed
Ready for Release 1.01
1 parent 408c9b4 commit acff31f

6 files changed

Lines changed: 1517 additions & 1489 deletions

File tree

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ A Lox interpreter from Part II of the book "Crafting Interpreters" by Bob Nystro
44

55
## Usage
66

7-
Under Windows run: `loxcpp [-i|-b] [a] [filename]`, under Linux run `./loxcpp [-i|-b] [a] [filename]`. The flags are:
7+
Under Windows run: `loxcpp [/?|/h|/v] [/i [/a]|/b] [filename]`, under Linux run `./loxcpp [-?|-h|-v] [-i [-a]|-b] [filename]`. The flags are:
88

9-
* `-i` run an interactive interpreter, executing each statement when entered
10-
* `-b` run in batch mode, use Ctrl-Z (Windows) or Ctrl-D (Linux) to end input
11-
* `-a` print the AST for expressions entered in interactive mode
9+
* `/b`, `-b` run in batch mode (this is the default), use Ctrl-Z (Windows) or Ctrl-D (Linux) to end input
10+
* `/i`, `-i` run an interactive interpreter, executing each statement when entered
11+
* `/a`, `-a` print the AST for expressions entered in interactive mode
1212
* `[filename]` read from file instead of standard input
13+
* `/v`, `-v` print version string and exit
14+
* `/?`, `/h`, `-?`, `-h` print usage info and exit
1315

1416
Error handling and reporting is very basic, the parser only outputs "syntax error" and the interpreter can throw exceptions.
1517

@@ -54,8 +56,10 @@ Heavy use of `std::make_shared` and `std::dynamic_pointer_cast` is made, particu
5456

5557
## Future work and status
5658

57-
Don't be fooled by the 1.00+ version number—this is alpha-development quality software, in particular `this` and `super` do not work and fixing these is a priority. The project does contain a large chunk of working code which may be of interest to others wanting to use `flexc++` and `bisonc++` to create an interpreter, or who have worked through the book and want to gain greater knowledge of Modern C++. It is assumed that a lot of the existing code and be reused/adapted to create a JIT version in the style of `clox`.
59+
Don't be fooled by the 1.00+ version number—this is alpha-development quality software. The project does contain a large chunk of working code which may be of interest to others wanting to use `flexc++` and `bisonc++` to create an interpreter, or who have worked through the book and want to gain greater knowledge of Modern C++. It is assumed that much of the existing code can be reused/adapted to create a JIT version, in the style of `clox`, as a future improvement.
5860

5961
## Releases
6062

6163
* *2023/08/27*: **1.00** First upload to GitHub with Windows executable. Many bugs, features and defects: please raise issues and submit pull requests.
64+
65+
* *2023/08/30*: **1.01** Second upload to GitHub with Windows executable. Believed to be complete and correct coverage of all of the material in Part II.

lexer/Loxerbase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated by Flexc++ V2.14.00 on Sun, 27 Aug 2023 09:11:20 +0100
1+
// Generated by Flexc++ V2.14.00 on Wed, 30 Aug 2023 16:28:00 +0100
22

33
#ifndef LoxerBASE_H_INCLUDED
44
#define LoxerBASE_H_INCLUDED

lexer/loxer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated by Flexc++ V2.14.00 on Sun, 27 Aug 2023 09:11:20 +0100
1+
// Generated by Flexc++ V2.14.00 on Wed, 30 Aug 2023 16:28:00 +0100
22

33
#include <iostream>
44
#include <fstream>

parser/Loxgram.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Loxgram: public LoxgramBase
1414
Loxer& scanner;
1515
std::function<void(std::shared_ptr<Stmt>)> *action_stmt;
1616
public:
17-
Loxgram() = default;
17+
Loxgram() = delete;
1818
Loxgram(Loxer& scanner, decltype(action_stmt) action_stmt = nullptr)
1919
: scanner{ scanner }, action_stmt{ action_stmt } {}
2020
int parse();

parser/Loxgrambase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated by Bisonc++ V6.05.00 on Sun, 27 Aug 2023 09:11:20 +0100
1+
// Generated by Bisonc++ V6.05.00 on Wed, 30 Aug 2023 16:28:04 +0100
22

33
// hdr/includes
44
#ifndef LoxgramBase_h_included

0 commit comments

Comments
 (0)