The same as for Ply's lex table file goes for the yacc table file. I would also like to see some kind of check for outdated table files.
For the implementation (if time staps are used): The scan and parse functions used could possibly be defined in multiple files. Therefore, we need to get the time stamps of all the files that contain t_* and/ or p_* functions. Also, other information, like the list of tokens, may be defined in yet another file. I'm actually unsure if you can get this to work in all cases. For instance, assume we define: tokens = some_imported_file.tokens Now if 'tokens' changes in the some_imported_file, the value of tokens changes. However, the file where tokens is defined (using the above line), hasn't changed (the imported file has changed). This kind of thing could be hard to detect. Another way to implement the outdated check is to create some kind of hash of all the important data. I'm not sure, by I can imagine this could be expensive. Dennis On 1 aug, 09:41, eliben <[EMAIL PROTECTED]> wrote: > Hello, > Are there any news on this subject ? > > Thanks > Eli > > On Jul 4, 5:04 pm, eliben <[EMAIL PROTECTED]> wrote: > > > Hello, > > > It appears that when running with optimize=1, PLY's Lex doesn't check > > that thetablefileis older than itself, and ends up using thetable > > anyway. So if I generate atable, change the lexer and run it again, > > it actually uses the old lexer from thetable. > > > This isn't documented and can be quite confusing :-) I think adding a > > timestamp check can work here without impeding performance too much. > > The lextab is an amazing feature (speeds up lexer creation 15X in my > > project), and it would make it more usable. > > > As an aside note about the documentation - I think that the optimize > > mode should be decoupled from the Python's -O mode in the > > documentation, because it's a great feature in itself that's very > > worthy to use for large grammars, and because Python's -O isn't very > > relevant these days. > > > Thanks > > Eli --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
