Boost logo

Boost Docs :

From: Kai Brüning (kai_at_[hidden])
Date: 2007-08-13 13:12:50


>Hello,
>
>2007/8/9, Joel de Guzman <joel_at_[hidden]>:
>> What I'd really want is to Regex-ify the syntax highlighter and
>> have them reconfigurable as user-supplied regex strings from
>> configuration files. This would simplify our life a lot. There'll
>> be only one syntax highlighter grammar and code that can accept
>> various lexer files. Our job then is just to churn out various
>> lexer files for different languages.
>
>Do you already have ideas how this should look like?
>
>The first thing i thought about would look like that:
>[sourcemode languagename
>[rule name [regex] markup]
>[rule name [regex]]
>[rule [regex]]
>[rule [regex] markup]
>]
>
>Where name regex and markup are only placeholders. name should be
>unique within the block. The names should allow refering to other rules
>within regular expressions. Quickbook should combine all rules in the
>order given to a big alternative, and add a catch all parser at the
>end.

I am currently implementing QuickBook syntax highlighting for Trac using Pygments (http://pygments.org), a Python library. It sports among others a regex-based lexer, so it may be worth a look for getting ideas. Plus, there are already regex-based implementations available for all interesting languages but the boost specific ones. And the later shortcoming I am currently fixing.

Regards
Kai


Boost-Docs list run by mbergal at meta-comm.com