Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tijn/coolj
an LL-parser builder for Ruby
https://github.com/tijn/coolj
Last synced: 6 days ago
JSON representation
an LL-parser builder for Ruby
- Host: GitHub
- URL: https://github.com/tijn/coolj
- Owner: tijn
- Created: 2010-10-17T21:16:05.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2010-10-25T22:22:04.000Z (about 14 years ago)
- Last Synced: 2024-04-21T03:59:45.007Z (7 months ago)
- Language: Ruby
- Homepage:
- Size: 97.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
coolj
=====a simple LL-parser builder
This library should eventually replace topdown (this other parser builder I once wrote). It should be simpler and faster.
Since I mainly intend to use this library to base specialised parsers upon for reading all sorts of data formats, and because writing a BNF-parser is not really complex I think it is a good idea to take some shortcuts (to keep things simple and fast):
- I am not defining an AST
- I don't have a separate lexer and parser, in a way the lexer could be said to exist in the first two or three case/when-blocks of the parser
- the amount of whitespace between tokens can be significant, just be sensible in writing your BNF and it won't bite you (really!)
- the idea is that your BNF is compiled (read: translated) to Ruby code. Small parser-methods are defined on your class (easy to override or hook into) that together form a parser for a complete grammar.
That's it for now, more later. Good luck, have fun, use the source and send me your patches! (please)