Joel de Guzman <joel <at> boost-consulting.com> writes: > > HI Thomas! > > Thomas Guest wrote: > > Thomas Guest <thomas.guest <at> gmail.com> writes: > > > I've been making (slow) progress with this and thought I should report back > > before proceeding any further. The proposal is to replace the hardcoded > > syntax_highlight.hpp with a dynamically loaded syntax highlight scheme. > > > > This scheme is based around boost::regex's capabilities. A first draft > >of the C++ syntax highlight scheme is appended to this email. > > > > Pros: > > As Eric says, users can create highlight schemes for other languages without > > having to write a new parser. > > > > Cons: > > An extra build dependency (on boost regex) > > That's ok. I see no problem with that.
Good. Me neither. > > Creating the regexes is no easier than defining a new parser > > Ahh regexes! That's the price for dynamic loading. A long time > ago, in a galaxy far away, Spirit grammars and rules used to be > defined from strings. Maybe someday, I'll resurrect that capability. > Hmmm, I should do that with Spirit 2. This is my main problem with the proposed extension: when I wanted to extend QuickBook to cope with a new source mode, I chose to add a Spirit parser and recompile. If I wanted to add yet another source mode, I'd probably find it easier to create a new Spirit grammar for that mode than to get the regexes going. > > Need to work out where to put the built-in highlight scheme > > Details please? I just meant that the quickbook executable needs to locate (on start up) the built in syntax highlight scheme file. The user could extend this scheme by supplying their own scheme via the command line, or indeed by editing the default one. It's not really a problem... > > Any comments or thoughts? > > I like it. A bit pythonish, but it's ok I'll keep working on this, then. I already have a standalone dynamically configurable syntax highlighter based on Spirit, Boost Regex and the scheme I posted. I just need to integrate it into QuickBook -- I think those QuickBook macros might give me trouble again! Thomas ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Boost-docs mailing list [email protected] Unsubscribe and other administrative requests: https://lists.sourceforge.net/lists/listinfo/boost-docs
