Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't know about sound theory, but pulling something out of bullshit:

Firstly, the nice part about DFAs is that they're really simple to implement - in terms of capture groups bare in mind that the generation mechanism means that the nodes are probably super-positions, and the extracts across aspects of your language can intersect if you're not careful.

You can get into messy places really quickly - so I'd suggest not fucking with the machine directly.

However, there's one thing that you can do without compromising machine generation: add a processing mode that returns the trace of machine states for the matching string.

And then process that state trace.

Now bare in mind that some of the states that you went through might have been super-positions, so you don't quite know what they are.

But (now that you have a match) you can run the reverse of the match through the reverse of the network and intersect the reverse of its trace.

(I haven't actually done that, but it will clean up some trace ambiguity - where earlier branches were only later found not to have been taken.)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: