[DGD] parse_string() help
bart at wotf.org
bart at wotf.org
Wed Feb 10 11:32:59 CET 2010
Hi Joseph,
On Wed, 10 Feb 2010 0:45:48 -0500, aishiteru wrote
> Greetings,
>
> I am a newbie to DGD in general and am completely out of my element
> in terms of regexp and parse_string(); however, I need help with a
> command I am making to colorize an lpc file. For starters, I have a
> simple workroom.c file as follows:
<snip>
Looks like you are running Gurbalib?
> What I am trying to do is parse any of the lpc files on our mud into
> a colorized output for easier viewing. For instance, in this
> command, I'd have the following defines:
<snip>
Doing this based on (a modified version of) the grammar you posted should be
possible, but formatting will be lost on the way, and it won't deal with
incomplete fragments of code. Also, it regards preprocessor statements as
whitespace.
Beyond that, using an LPC grammar seems overkill, since you are interested in
marking tokens, not in actual syntax.
> Any ideas on where I can go from here? Any help would be greatly
> appreciated by me and the admins of my mud. Thanks in advance and I
> apologize for my inexperience.
Well, my first suggestion would be to try some smaller things with
parse_string. It is a very powerful tool, but has somewhat of a steep learning
curve, and trying to use it with a big grammar is probably not the easiest way
to get upto speed with it.
Bart
--
Created with Open WebMail at http://www.bartsplace.net/
Read my weblog at http://soapbox.bartsplace.net/
More information about the DGD
mailing list