Hello all,

Ply 3.2 (with Python 2.5) reports duplicate rule functions even if they are in 
different classes.
Example:
---------------------------------
from ply import yacc, lex

t_A = 'a'

def t_error(t):
     print "Illegal character '%s'" % t.value[0]
     t.lexer.skip(1)

tokens = ('A',)

class Parser(object):
     tokens = ('A', )
     def p_rule(self, args):
         ' start : A'
         pass

     def p_error(self, args):
         print "Syntax error in input!"

class Dummy(object):
     def p_rule(self, args):
         ' hai all '
         pass

lex.lex()

parser = yacc.yacc(module=Parser)
---------------------------------
Execution of this code outputs


$ python2.5 x.py
WARNING: x.py:21: Function p_rule redefined. Previously defined on line 13
Generating LALR tables

even though class Dummy is not used for parsing.

--~--~---------~--~----~------------~-------~--~----~
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