Hello,

I'm having lots of fun with PLY and lex - thanks for building it!

I have a problem with a specific section ('table') of the source text
which contains arbitrary data. This data should not be interpreted.
The lexer doesn't stand a chance of making any sense of it. The
beginning and end of the table are well marked, so I can trigger a
state for it.

What's the best method of dealing with such a situation using lex.py?
- just suppress the errors until the table has ended?
- inclusive? exclusive?
- define a new state and a token which matches everything? (lex
doesn't seem to like that, or I'm doing it wrong)

states =  (
        ('top',         'inclusive'),
        ('rest',        'inclusive'),
        ('anonymous',   'inclusive'),
)

# the following re is wrong. It is too specific
# I'd say it would have to be something like r".*' but that won't work
t_anonymous_ANONYMOUSDATA = r'a-zA-Z_0-9*.*'

Pardon the noobness of my post, much obliged for any help,
Erik
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to