|
@ -2,11 +2,16 @@ |
|
|
|
|
|
|
|
|
## Requirements |
|
|
## Requirements |
|
|
|
|
|
|
|
|
Please install peg/leg manually or with Homebrew: |
|
|
|
|
|
|
|
|
Please install [peg/leg](https://www.piumarta.com/software/peg/) manually or with Homebrew: |
|
|
```bash |
|
|
```bash |
|
|
$ brew install peg |
|
|
$ brew install peg |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
Please install [the Boehm-Demers-Weiser conservative garbage collector](https://www.hboehm.info/gc/) manually or with Homebrew: |
|
|
|
|
|
```bash |
|
|
|
|
|
$ brew install bdw-gc |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
## Build |
|
|
## Build |
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
@ -16,11 +21,17 @@ $ make |
|
|
## Usage |
|
|
## Usage |
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
$ echo "2+3" | ./calc |
|
|
|
|
|
|
|
|
$ echo "a=2+3 a*2" | ./calc |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
## Test |
|
|
|
|
|
|
|
|
## Tests |
|
|
|
|
|
|
|
|
|
|
|
Simple tests: |
|
|
```bash |
|
|
```bash |
|
|
$ ./test.sh |
|
|
$ ./test.sh |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
Custom test: |
|
|
|
|
|
```bash |
|
|
|
|
|
$ ./calc < test.txt |
|
|
|
|
|
``` |