You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
mtardy cfb4f164ed
Merge pull request #16 from mtardy/fixes3
пре 4 година
drafts Modify drafts and tests пре 4 година
tests Add Objects with prototypes пре 4 година
.dockerignore Add Dockerfile and instructions to build with Docker пре 4 година
.gitignore Add Objects with prototypes пре 4 година
Dockerfile Update README and Dockerfile пре 4 година
Makefile Clean Makefile пре 4 година
README.md Update README and Dockerfile пре 4 година
TODO.txt Add tests and update todo пре 4 година
bootstrap.txt Fix circular printing, comparison and pass scope to primitives пре 4 година
buffer.h Add printOn function and fix readEvalPrint with imports пре 4 година
calc.leg Fix symbol table пре 4 година
object.c Fix relations to compare more than just integers, fix semicolons to end пре 4 година
parse.leg Fix relations to compare more than just integers, fix semicolons to end пре 4 година
test-error.txt Fix relations to compare more than just integers, fix semicolons to end пре 4 година
test-incdec.txt Add tests for incdec and object instanciation пре 4 година
test-module.txt Add slice '[n:m]' for strings and array-like maps пре 4 година
test-namespace.txt Fix relations to compare more than just integers, fix semicolons to end пре 4 година
test-object.txt Fix relations to compare more than just integers, fix semicolons to end пре 4 година
test-proto.txt Add nice format for runtime errors (#12) пре 4 година
test-require.txt Add slice '[n:m]' for strings and array-like maps пре 4 година
test-runtime-error.txt Fix try catch mechanism and runtimeError with mrAST пре 4 година
test-slice.txt Add slice '[n:m]' for strings and array-like maps пре 4 година
test-strings.txt Add '*' operator for string multiplication пре 4 година
test-throw.txt Fix try catch mechanism and runtimeError with mrAST пре 4 година
test-try-catch.txt Fix try catch mechanism and runtimeError with mrAST пре 4 година
test.txt Update test files пре 4 година
test1.txt Optimizing integers пре 4 година
test2.txt Modify drafts and tests пре 4 година

README.md

Sandbox

Build the project

Requirements

Please install peg/leg manually or with a package manager, for example with Homebrew:

$ brew install peg

Please install the Boehm-Demers-Weiser conservative garbage collector manually or with a package manager, for example with Homebrew:

$ brew install bdw-gc

Build

$ make

Build with Docker

The Docker image provides a ready to go environment to experiment with the project. Just build the image locally and run an interactive shell inside the container:

$ docker build . --tag mtardy/sandbox
$ docker run -it mtardy/sandbox

Usage

Single input

You can pass your program:

  • via the standard input
$ echo "a=2+3 a*2" | ./parse
$ ./parse < file
  • via a file
$ ./parse file

Multiple inputs

You can also pass multiple files and use - in any order as the standard input when mixing files and standard input, for example:

$ ./parse file1 - file2 < file3
$ echo "a=2+3 a*2" | ./parse file1 file2 -