Re: StringBuilder Extension: IsQuotedBy

Barry Kelly <[email protected]> Fri, 15 Feb 2008 19:41:16 +0000
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <[email protected]>
Frans Bouma <[email protected]> wrote:

> > Peter Obiefuna <[email protected]> wrote:
> > > If it keeps hitting a
> > > matched state until the input buffer is finished, then, the string
> > > 'qualifies'. That, in my mind, is the difference between  a state engine
> and
> > > a collation engine like strcomp (never mind that you can illustrate FSM
> > > graphically by pointing to a final dot on paper). But I expect a Regex
> > > implementation to create a unique FSM from every input signature.
> >
> > I don't understand your last sentence. The FSM is constructed for the
> > regex, not for the sentence to be matched.
> >
> > Also, I don't see how this is relevant to why one wouldn't "still"
> > hand-write a DFA.
> 
>         I think it depends on your language.

Definitely. Peter was making a universal argument why one would never
hand-write, and I was making an existential argument as to why one
would. I qualified my assertions with reference to "well-defined
languages", by which I meant modern programming languages which don't
have the problems of e.g. Fortran.

[...]
>         So if you're writing a parser for a language where every
> non-whitespace is a token, you indeed need your own statemachine to tokenize
> the input.
> 
>         I think both have a point: regexp's already define NFA's interally for
> their expression, why not utilize those? Of course, if your language doesn't
> fit that setup, you need your own. (Aho Sethi Ullman to the rescue ;))

It would be nice to use them; it would be even nicer if the state
machine could be customized, either with special regex syntax or direct
manipulation of the final transition graph, possibly annotating with
actions.

-- Barry

-- 
http://barrkel.blogspot.com/

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com