simplell
Version, currently master branch1 version
- master branchlatestNov 20, 2019
github.com/firejox/simplell
simple LL(1) parser generator
1 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
simplell:
github: firejox/simplell
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.31.1- License
- MIT
- Author
- Firejox
Dependencies
This version declares no dependencies.
README
simplell 
Simple LL(1) parser generator
Installation
-
Add the dependency to your
shard.yml:dependencies: simplell: github: firejox/simplell -
Run
shards install
Usage
require "simplell"
include Simplell::ParserTool
new_parser(MyParser) do
new_top_symbol(E) do
add_rule(t: T, e1: E1) do
end
end
new_symbol(E1) do
add_rule(plus: '+', t: T, e1: E1) do
end
add_rule(e: Eplison) do
end
end
new_symbol(T) do
add_rule(f: F, t1: T1) do
end
end
new_symbol(T1) do
add_rule(star: '*', f: F, t1: T1) do
end
add_rule(e: Eplison) do
end
end
new_symbol(F) do
add_rule(lpar: '(', e: E, rpar: ')') do
end
add_rule(a: 'i', b: 'd') do
end
end
end
class MyLexer
@reader : Char::Reader
def initialize(str : String)
@reader = Char::Reader.new str
ignore_spaces
end
def peek
if (ch = @reader.current_char) != '\0'
ch
else
Simplell::EndMarker.new
end
end
def shift
if @reader.has_next?
@reader.next_char
ignore_spaces
end
end
def ignore_spaces
while @reader.current_char == ' '
@reader.next_char
end
end
end
MyParser.parse(MyLexer.new("id + id"))
Contributing
- Fork it (https://github.com/firejox/simplell/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Firejox - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Nov 20, 2019
- Crystal
0.31.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/firejox/simplell
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1