https://github.com/kupolak/simpler_lexer
Lexer created for learning purposes. A good start for writing your own programming language in Ruby.
https://github.com/kupolak/simpler_lexer
lexer lexer-generator lexer-parser programming-language-development ruby
Last synced: 9 months ago
JSON representation
Lexer created for learning purposes. A good start for writing your own programming language in Ruby.
- Host: GitHub
- URL: https://github.com/kupolak/simpler_lexer
- Owner: kupolak
- License: gpl-3.0
- Created: 2021-09-29T15:17:23.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-29T15:19:08.000Z (over 4 years ago)
- Last Synced: 2025-08-20T12:52:11.430Z (10 months ago)
- Topics: lexer, lexer-generator, lexer-parser, programming-language-development, ruby
- Language: Ruby
- Homepage:
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# SimplerLexer
Lexer created for learning purposes. A good start for writing your own programming language in Ruby.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'simpler_lexer'
```
And then execute:
$ bundle install
Or install it yourself as:
$ gem install simpler_lexer
## Usage
Just type:
```ruby
SimplerLexer.new("(3+3)/(5-2.5)*12")
# => [LPAREN, {"TT_INT"=>3}, PLUS, {"TT_INT"=>3}, RPAREN, DIV, LPAREN, {"TT_INT"=>5}, MINUS, {"FLOAT"=>2.5}, RPAREN, MUL, {"TT_INT"=>12}]
```