( self, name )
return self
Define name for this expression, makes debugging and exception messages clearer.
        
        Example::
            Word(nums).parseString("ABC")  # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1)
            Word(nums).setName("integer").parseString("ABC")  # -> Exception: Expected integer (at char 0), (line:1, col:1)
Define name for this expression, makes debugging and exception messages clearer.
        
        Example::
            Word(nums).parseString("ABC")  # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1)
            Word(nums).setName("integer").parseString("ABC")  # -> Exception: Expected integer (at char 0), (line:1, col:1)
Define name for this expression makes debugging and exception messages clearer . Example :: Word ( nums ) . parseString ( ABC ) # - > Exception : Expected W : ( 0123 ... ) ( at char 0 ) ( line : 1 col : 1 ) Word ( nums ) . setName ( integer ) . parseString ( ABC ) # - > Exception : Expected integer ( at char 0 ) ( line : 1 col : 1 )
def setName( self, name ):
        """
        Define name for this expression, makes debugging and exception messages clearer.
        
        Example::
            Word(nums).parseString("ABC")  # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1)
            Word(nums).setName("integer").parseString("ABC")  # -> Exception: Expected integer (at char 0), (line:1, col:1)
        """
        self.name = name
        self.errmsg = "Expected " + self.name
        if hasattr(self,"exception"):
            self.exception.msg = self.errmsg
        return self
def setName ( self , name ) : self . name = name self . errmsg = "Expected " + self . name if hasattr ( self , "exception" ) : self . exception . msg = self . errmsg return self