Parsing a search string

It's me itsme at yahoo.com
Fri Dec 31 15:20:08 EST 2004


"Andrew Dalke" <dalke at dalkescientific.com> wrote in message
news:pan.2004.12.31.19.00.06.838441 at dalkescientific.com...
> "It's me" wrote:
> > Here's a NDFA for your text:
> >
> >        b  0 1-9 a-Z ,  . +  -   '   " \n
> > S0: S0 E   E  S1  E E E S3 E S2  E
> > S1: T1 E   E  S1  E E E  E  E  E T1
> > S2: S2 E   E  S2  E E E  E  E T2  E
> > S3: T3 E   E  S3  E E E  E  E  E T3
>
> Now if I only had an NDFA for parsing that syntax...
>

Just finished one (don't ask me to show it - very clumpsy Python code -
still in learning mode).   :)

Here's one for parsing integer:

#       b 0 1-9 , . + - ' " a-Z \n
# S0: S0 S0 S1 T0 E S2 S2 E E E   T0
# S1: S3 S1 S1 T1 E E E E E E   T1
# S2: E S2 S1 E E E E E E E   E
# S3: S3 T2 T2 T1 T2 T2 T2 T2 T2 T2  T1

T0: you got a null token
T1: you got a good token, separator was ","
T2: you got a good token b, separator was " "
E: bad token


>   :)
> Andrew
> dalke at dalkescientific.com
>





More information about the Python-list mailing list