[DGD] Reasonable Tick Counts?

Shentino shentino at gmail.com
Mon Jul 9 18:43:15 CEST 2007


Is there some common syntax that defines all your "escapes"?

If there is a way to unambiguously separate regular 'fragments" from
special "fragments" I suggest something like the following grammar:

special = /(regexes for your escapable stuff)/
...
normal = nomatch

message: ? build_empty_message
message: message piece ? concatenate

piece: normal
piece: special ? convert

And in the LPC object doing the parsing:

string *build_empty_message(string *input)
{
    return ({ "" });
}

string *concatenate(string *input)
{
   return ({ input[0] + input[1] });
}

string *convert(string *input)
{
   return ({ frobnicate(input[0]);
}

For frobnicate, just do whatever translation you want to.

Unfortunately the grammar above will only work if your regular stuff
and your special stuff can be cleanly broken apart.  It won't handle
fancy nested stuff.



More information about the DGD mailing list