"Andrew Dalke" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "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
> [EMAIL PROTECTED]
>


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to