Update README.md
[miniREPL.git] / README.md
blob2ad4370c31adb4896dae34faeda3bce982d3146b
1 # miniREPL [![Codacy Badge](https://app.codacy.com/project/badge/Grade/1ffc16cdfeca4a53b37e97a8a9a8957b)](https://www.codacy.com/manual/lemao.vrm07/minirepl?utm_source=github.com&utm_medium=referral&utm_content=vrmiguel/minirepl&utm_campaign=Badge_Grade)  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Semaphore Build](https://vrmiguel.semaphoreci.com/badges/minirepl/branches/master.svg?style=shields)](https://vrmiguel.semaphoreci.com/projects/minirepl/) 
3 An early work-in-progress arithmetic REPL written in pure C++11.
5 ## Usage
7 An example follows:
8 ```C
9 miniREPL -- github.com/vrmiguel/minirepl
10 >>> myVar = -2^3 - 4*5
11 -28
12 >>> myVar
13 -28
14 >>> 4*7^2
15 196
16 >>> 6*8 - 2*3
18 >>> a = 2
20 >>> b=a^a
22 >>> b^a + a^b
24 >>> a = 2*b
26 ```
28 The REPL currently only deals in integers and has no parenthesis support yet.
29 Variables can be created with any combination of upper and lower-case characters.
31 ## Building
33 ### With QMake
35 On the root folder, run ```qmake && make```. 
37 Start the REPL with `./minirepl`.
39 The QMake version used here is 3.1.
40 A compiler supporting at least C++11 is needed, with no extra dependencies
42 ### A lengthier way
44 On the root folder, run ```g++ -c -pipe -std=gnu++11 -Wall -W -fPIC -I. Sources/main.cpp Sources/interp.cpp Sources/_os.cpp Sources/token.cpp```, followed by ```g++ -Wl,-O1 -o minirepl main.o interp.o _os.o token.o```.
46 The `-std=gnu++11` flag can be freely switched to `-std=c++11` if so wished.