(oops, replied to Dave instead of the group) Hello,
> 2. The cryptic warning... In Python 2.3.4: >>> 0xffffffff <stdin>:1: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up -1 >>> 0xffffffffL 4294967295L In Python 2.6: >>> 0xffffffff 4294967295L >>> 0xffffffffL 4294967295L So, if think that if you add the 'L' after it, the warning will be gone and it will behave the same for Python <2.4 and >=2.4. (see also http://www.python.org/dev/peps/pep-0237/) Dennis David Beazley wrote: >All of the output in PLY-3.0 is generated using the API of the >logging module. To filter it, you can pass in logging objects >with appropriate filtering levels or filter objects (note: this is >something I need to document before the main release). > >I'll check on the result output. It might make sense to truncate >that at a fixed number of characters. > >Cheers, >Dave > > >Hello, > >Sometimes I supply parameter debug=2 to the parse(...) method. I use to get >something like this: > > . LexToken(MODEL,'model',1,0) shift state 3 > MODEL . LexToken(IDENTIFIER,'TankControllerCIF',1,6) shift state 8 > MODEL IDENTIFIER . LexToken(EQ,'=',1,24) shift state 14 > MODEL IDENTIFIER EQ . LexToken(LCSCOPE,'|[',2,26) shift state 21 > MODEL IDENTIFIER EQ LCSCOPE . LexToken(EXTERN,'extern',2,29) shift state 30 > MODEL IDENTIFIER EQ LCSCOPE EXTERN . LexToken(VAR,'var',2,36) shift state > 72 > MODEL IDENTIFIER EQ LCSCOPE EXTERN VAR . LexToken(IDENTIFIER,'V',2,40) > shift state 18 > MODEL IDENTIFIER EQ LCSCOPE EXTERN VAR IDENTIFIER . > LexToken(COLON,':',2,41) reduce 12 > >This has now become: > > State : 0 > Stack : . LexToken(MODEL,'model',1,0) > Action : Shift and goto state 3 > > State : 3 > Stack : MODEL . LexToken(IDENTIFIER,'TankControllerCIF',1,6) > Action : Shift and goto state 8 > > State : 8 > Stack : MODEL IDENTIFIER . LexToken(EQ,'=',1,24) > Action : Shift and goto state 14 > > State : 14 > Stack : MODEL IDENTIFIER EQ . LexToken(LCSCOPE,'|[',2,26) > Action : Shift and goto state 21 > > State : 21 > Stack : MODEL IDENTIFIER EQ LCSCOPE . LexToken(EXTERN,'extern',2,29) > Action : Shift and goto state 30 > > State : 30 > Stack : MODEL IDENTIFIER EQ LCSCOPE EXTERN . LexToken(VAR,'var',2,36) > Action : Shift and goto state 72 > > State : 72 > Stack : MODEL IDENTIFIER EQ LCSCOPE EXTERN VAR . > LexToken(IDENTIFIER,'V',2,40) > Action : Shift and goto state 18 > > State : 18 > Stack : MODEL IDENTIFIER EQ LCSCOPE EXTERN VAR IDENTIFIER . > LexToken(COLON,':',2,41) > Action : Reduce rule [identifiers -> IDENTIFIER] with ['V'] and goto state > 12 > Result : [<Identifier: > .idName = 'V' > >] > >This is not really a problem, except for the 'Result : ...' part, which >can become large (as in several 'pages' of console output) for large objects >returned from >parsing rules. Is there any way to hide just the 'Result : ...' lines? > >Dennis > > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
