template based parser generator gets major speed boost

BCS BCS at pathlink.com
Tue Apr 1 10:50:35 PDT 2008


Frits van Bommel wrote:
> 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
> 

Given that I have no nested constructs, I !! doesn't "just work", it 
just fails to parse :(

>> 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 :).

Good argument. Thanks


More information about the Digitalmars-d-announce mailing list