AST
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
mtardy 06d0204ad1 Add test-syntax.txt 4 år sedan
drafts Modify drafts and tests 4 år sedan
tests Add Objects with prototypes 4 år sedan
.dockerignore Add Dockerfile and instructions to build with Docker 4 år sedan
.gitignore Add Objects with prototypes 4 år sedan
Dockerfile Update README and Dockerfile 4 år sedan
LICENSE.txt Add MIT License 4 år sedan
Makefile Use implicit rules to build binary; add compiler/linker search locations for Darwin MacPorts 4 år sedan
README.md Update README and Dockerfile 4 år sedan
TODO.txt Add tests and update todo 4 år sedan
bench-fib.txt Add the usual two micro-bencharks (nfibs and prime sieve) 4 år sedan
bench-sieve.txt Add the usual two micro-bencharks (nfibs and prime sieve) 4 år sedan
bootstrap.txt add allKeys, allValues; add @@ syntax to unquote and splice an array into a list of arguments or parameters 4 år sedan
buffer.h Add printOn function and fix readEvalPrint with imports 4 år sedan
calc.leg Fix symbol table 4 år sedan
object.c Merge with master 4 år sedan
parse.leg Merge with master 4 år sedan
test-error.txt Fix relations to compare more than just integers, fix semicolons to end 4 år sedan
test-incdec.txt Add tests for incdec and object instanciation 4 år sedan
test-module.txt Add slice '[n:m]' for strings and array-like maps 4 år sedan
test-namespace.txt Fix relations to compare more than just integers, fix semicolons to end 4 år sedan
test-object.txt add allKeys, allValues; add @@ syntax to unquote and splice an array into a list of arguments or parameters 4 år sedan
test-proto.txt Add nice format for runtime errors (#12) 4 år sedan
test-require.txt Add slice '[n:m]' for strings and array-like maps 4 år sedan
test-runtime-error.txt Fix try catch mechanism and runtimeError with mrAST 4 år sedan
test-slice.txt Correctly add slice '[n:m]' for strings and array-like maps 4 år sedan
test-splice.txt add argument splicing (aka unpacking, aka splatting); add test-splice.txt to test argument splicing 4 år sedan
test-strings.txt Add '*' operator for string multiplication 4 år sedan
test-switch.txt Add test-switch.txt 4 år sedan
test-syntax.txt Add test-syntax.txt 4 år sedan
test-throw.txt Fix try catch mechanism and runtimeError with mrAST 4 år sedan
test-try-catch.txt Fix try catch mechanism and runtimeError with mrAST 4 år sedan
test.txt Update test files 4 år sedan
test1.txt Optimizing integers 4 år sedan
test2.txt Modify drafts and tests 4 år sedan

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 -