Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adrianmarino/calculator
antlr calculator on jruby
https://github.com/adrianmarino/calculator
antlr4 jruby
Last synced: 1 day ago
JSON representation
antlr calculator on jruby
- Host: GitHub
- URL: https://github.com/adrianmarino/calculator
- Owner: adrianmarino
- Created: 2016-01-18T23:07:46.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-11T01:38:42.000Z (almost 9 years ago)
- Last Synced: 2023-02-27T13:46:42.121Z (almost 2 years ago)
- Topics: antlr4, jruby
- Language: Ruby
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Calculator
antlr calculator### Requisites
* JRuby
```bash
rvm install jruby
rvm use jruby
```* Antlr4 (On Arch linux)
```bash
yaourt -S antlr4
alias grun='java -cp .:/usr/share/java/antlr-complete.jar org.antlr.v4.runtime.misc.TestRig "$@"'
```### Test
```bash
rake tree[tests/test2.calc]
``````bash
rake execute[tests/test2.calc]
``````bash
rake console
> require 'calculator'
> Calculator.eval('tests/test2.calc')
=> [4.0, 0.25, 4.25, 14.0, 14.0, -4.0, -6.0, 12.0, 17.150000000000002, 2.0]
```## License
Calculator is released under the [MIT License](http://www.opensource.org/licenses/MIT).