This is a good question. I should post comparisons with comparable
projects sometime soon.
From a 50,000 foot view, the most major difference is that Gazelle
parses context-free languages, whereas Ragel only parses regular
languages [0]. If you're not familiar with the difference between
these, regular languages cannot handle any nexted constructs, for
example:
- arithmetic expressions are not regular, because they can be nested
in parentheses
- almost no programming languages are regular (brainfuck is an
exception)
So while Ragel could be the *lexer* for a programming language, it
would need a separate parser to finish the job. Gazelle will have a
superset (more or less) of Ragel's parsing capabilities. For example,
Ragel cannot parse its own input language.
Besides that, the major differences are:
- Ragel has you embed actions directly into the grammar file --
Gazelle does not, to increase reusability.
- Ragel compiles to the language that you want to parse from. e.g. if
you want to parse from C, Ragel compiles to C, if you want to parse
from Ruby, Ragel compiles to Ruby. Gazelle compiles to byte-code that
is loaded into a runtime/VM, which should increase the speed of
parsing dramatically for slow languages like Ruby.
Josh
[0] With custom code you can get Ragel to parse some nested constructs
by keeping your own data structures that track nesting level.
On Aug 21, 5:12 pm,
mr0...@mro.name wrote:
> fromhttp://
research.cs.queensu.ca/~thurston/ragel/?
>
> Just curious,
> M