template based parser generator gets major speed boost
Frits van Bommel
fvbommel at REMwOVExCAPSs.nl
Tue Apr 1 10:45:48 PDT 2008
BCS wrote:
> Frits van Bommel wrote:
>> BCS wrote:
>>
>>> I'm planing on adding "!" as a "not" suffix in dparse (if "Blah" can
>>> be parsed, fail, else continue from the same place) and I'm wondering
>>> if anyone would find the reverse useful (try to parse a "Foo", if it
>>> works, drop it, back up to where we started and continue, else fail).
>>> Also is there any suggestions as to what suffix to use?
>>
>>
>> Wouldn't that be equivalent to '!!'?
>> At least, from what I understand "Foo!!" would mean: if "Foo!" can be
>> parsed then fail, otherwise succeed (matching the empty string).
>> The first should happen if "Foo" can't be parsed, the second one
>> happens if it can.
>>
>> It's not the most intuitive operator, of course ;).
>
> I was kidna hoping for a single char as it make the parsing of the BNF
> simpler.
Well, this would make (the implmentation of) the parsing simpler; just
implement '!' and you get the other one for free! :P
> Thinking about it, the only reasonable chars I have left are:
> ~#$%^&_-=\<>,.
Hmmm... I could see '&'; it's the bash command-postfix for starting a
process in the background. Also, both the operand _&_ the rest of the
expression must match :).
More information about the Digitalmars-d-announce
mailing list