How to parse my own custom "programming language"?

Hi all

I'm brain storming on ways how to optimize the act of writing good
CSS... My plan is to create some sort of Meta-CSS-Language that is
parsed by a translation-processor which outputs the "normal" CSS code
(packed into a Ruby On Rails plugin).

I want to be able to write sort of the following quasi-CSS-code (the
$-sign is sort of a placeholder for the surrounding context, see

maybe erb would be of some help, to parse the file and replace stuff
with ruby code

this would reduce your work to providing helpers and making rails run
the css through erb (as all the html and rjs anyway)

Or you could look into Sass.