At this point Citrus is a parser combinator. It is able to take
language grammars and create parsers from them. These parsers are just
Ruby modules. You can combine these grammars together to create more
complex grammars. You can also add semantic information to these
grammars, so that when you encounter certain tokens in the input
string you can easily interpret their meaning.

So, you could say that Citrus is a general-purpose parsing library. It
is to be used whenever you would like to build a parser for a
non-trivial set of syntactic rules.

A simple example is included with the code in the examples directory.
It's called Calc. It's a grammar for arithmetic that is able to parse
and evaluate mathematical expressions while respecting operator
precedence and ignoring whitespace. This would be impossible to do
with a regular expression, simply because mathematical expressions may
be recursive. Even if mathematical expressions were not recursive,
they would still be very difficult to parse properly using a regular
expression, not to mention interpret!

You could use Citrus to parse any well-defined document. For example,
you could easily build a parser for something you find in an RFC. You
could even create your own mini computer language if you were
ambitious enough.

Currently I'm just developing the project for fun. I'm interested in
computer languages and syntax, and I wanted to use Ruby to create a
syntactical analysis tool. Turns out that Ruby was an excellent
choice, for so many reasons.

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Mon, May 17, 2010 at 1:34 AM, Kaspar Schiess <eule / space.ch> wrote:
> Hi Michael,
>
> Out of curiosity: What are you using citrus for? What is the
> typical/intended usage?
>
> greetings,
> kaspar
>
>
>