Hi all,
I am still learning how to write parser with PLY. I need to parse
following format data:
TSET 1 001 X 0 00;
001 X 0 00;
001 X 0 00;
TSET 7 001 X 0 00;
repeat 12 001 X 0 00;
The tokens are defined as:
t_TSET=r'TSET'
t_NUM=r'\d+'
t_MCODE=r'repeat'
t_VECTOR=r'0|1|H|L|X'
but it kept treating the first "1" at line 1 as VECTOR instead of NUM
and the "1" after "repeat" as VECTOR.
Is there a good way to fix this?
Thanks a lot!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ply-hack" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ply-hack?hl=en
-~----------~----~----~----~------~----~------~--~---