AST
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 1a82135eab Fix try catch mechanism and runtimeError with mrAST преди 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 години
calc.leg Fix symbol table преди 4 години
object.c Fix try catch mechanism and runtimeError with mrAST преди 4 години
parse.leg Fix try catch mechanism and runtimeError with mrAST преди 4 години
test-incdec.txt Add tests for incdec and object instanciation преди 4 години
test-object.txt Update tests преди 4 години
test-proto.txt Add nice format for runtime errors (#12) преди 4 години
test-runtime-error.txt Fix try catch mechanism and runtimeError with mrAST преди 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 -