I thought I might have commented on this earlier, but maybe not (things have been rather crazy around here). On quick glance, the summary presented here seems correct. I think the main thing to keep in mind is that if you're using PLY's optimized modes, all bets are off for any kind of error checking or validation. PLY will simply assume that any sort of pre-existing table file (lex or yacc) is correct and start using it. To keep these tables tied to your application, it would make sense to give them application specific names. However, that's about it.
I'll try to add a section in the docs about distributing PLY software in the next release. Cheer, Dave On Fri 14/11/08 1:50 AM , eliben [EMAIL PROTECTED] sent: > > On Nov 8, 10:03 am, eliben <[EMAIL PROTECTED] > .com> wrote:> Hello, > > > > I want to conclude these > > discussions:http://groups.google.com/group/ply-hack/browse_frm/thread/22685 > d1b7fb...http://groups.google.com/group/ply-hack/browse_frm/thread/a799e10f > 9c2...> > > With some insights gathered while attempting to > build a PLY based> grammar for distribution into some kind of a > FAQ.> > > If I understand correctly, this is the logic for > the optimize modes of> yacc and lex: > > > > yacc optimization: > > - If parsetab.py/pyc doesn't exist in the path, > the table will be> reconstructed anyway, regardless of the optimize > parameter> - If it doesn't exist: > > - If optimize=True, the table will be > loaded unconditionally> - If optimize=False, the table will be > loaded only if it's older> than the grammar > > > > lex optimization: > > - If optimize=False, the lexical table is > re-computed and is not saved> to a lextab file > > - If optimize=True: > > - If lextab.py/pyc exists in the path, it > will be loaded> unconditionally > > - If lextab.py/pyc doesn't exist, it will > be created and loaded> > > No comments ? > > I find this issue quite important for the distribution of effective > PLY parsers as self-contained modules that provide maximal performance > and don't trouble the user. It's hard to believe that no one has used > these features and explored the way they work (as the documentation is > very incomplete on this matter). > > > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google Groups > "ply-hack" group.To post to this group, send email to ply > [EMAIL PROTECTED] unsubscribe from this group, send email to ply-hack+ > [EMAIL PROTECTED] more options, visit this group at > http://groups.google.com/group/ply-hack?hl=en-~----------~----~----~----~----- -~----~------~--~--- > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
