Skip to content

Commit 0a52366

Browse files
authored
Update README.md
1 parent 5b936b9 commit 0a52366

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

README.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1-
Jut some simple lexical analysis and building an Abstract Syntax Tree to evaluate simple mathematical expresssions
1+
# Calculator
22

3-
Currently handles PEMDAS, functions, and understanding parentheses back to back as multiplication
3+
This was done for my CS 480 class.
4+
5+
This does simple lexical analysis and building an Abstract Syntax Tree to evaluate simple mathematical expresssions
6+
7+
It currently handles PEMDAS, functions, and understanding parentheses back to back as multiplication
8+
9+
## Requirements
10+
11+
This requires [NodeJS](https://nodejs.org/en/) and npm.
12+
13+
## Installing
14+
15+
Clone the repository.
16+
17+
```bash
18+
npm install
19+
```
20+
21+
## Building
22+
23+
```bash
24+
npm run build
25+
```
26+
27+
This will build the typescript code into executable NodeJS.
28+
29+
## Usage
30+
31+
Once built, you can run it with:
32+
33+
```bash
34+
./bin/calc <expression>
35+
```
36+
37+
The entire expression must be the first argument so if you want to add spaces, you must use quotes.
38+
39+
Parantheses and other special characters confuse the shell so you will need to escape them with `\` or use quotes.
40+
41+
## Tests
42+
43+
Test can be ran with:
44+
45+
```bash
46+
npm run test
47+
```

0 commit comments

Comments
 (0)