def parse ( self , data , lexer = None , * args , * * kwargs ) : if lexer is None : lexer = self . lexer return self . parser . parse ( data , lexer = lexer , * args , * * kwargs )
python parse ply grammar
Parse the input JSON data string into a python data structure . Args : data : An input data string lexer : An optional ply . lex instance that overrides the default lexer . Returns : A python dict or list representing the input JSON data .
def parse(self, data, lexer=None, *args, **kwargs):
        """Parse the input JSON data string into a python data structure.
        Args:
          data: An input data string
          lexer:  An optional ply.lex instance that overrides the default lexer.
        Returns:
          A python dict or list representing the input JSON data.
        """
        if lexer is None:
            lexer = self.lexer
        return self.parser.parse(data, lexer=lexer, *args, **kwargs)