[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regexps and strings once again
From: |
Daniel Colascione |
Subject: |
Re: Regexps and strings once again |
Date: |
Sun, 14 Sep 2014 20:41:23 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 |
On 09/14/2014 07:14 PM, Stefan Monnier wrote:
>> On 09/14/2014 04:27 PM, Lars Magne Ingebrigtsen wrote:
>>> (dom-by-id dom (regexp "I \\(couldn't\\)?haz new syntax"))
>
> `regexp' could just as well take a new syntax. And it doesn't have to
> return a string with a funny text-property but can really return a new
> kind of object.
>
> I think it could be fairly elegant.
>
>>>>>> "Daniel" == Daniel Colascione <address@hidden> writes:
>> I've been working on an NFA combinator facility lately. The basic idea
>> is that you don't work in terms of regular expressions per se, but in
>> terms of state-matching machines (like the ones Ragel has) that you can
>> combine using the standard union, repeat, negative, and intersection
>> operators.
>
> Do you really mean NFA or are you actually manipulating DFAs?
> If NFAs, how do you implement intersection?
Actual NFAs --- the kinda-sorta working code is in the Jezebel repo;
I've been adding arbitrary predicate support. DFA construction just
produces an NFA object that happens not to contain any ambiguity, which
recognizer generators can treat specially. I haven't actually
implemented intersection yet, although I suspect the dumb union-negation
algorithm should be good enough after DFA construction and minimization.
If it isn't, I'll just see what Ragel does and do that.
signature.asc
Description: OpenPGP digital signature
Re: Regexps and strings once again, Lars Magne Ingebrigtsen, 2014/09/15
Re: Regexps and strings once again, Yuri Khan, 2014/09/14