parameters: (self)
return_statement: return obj
docstring: Yields a list of objects: keywords, literals, strings, 
      numbers, arrays and dictionaries. Arrays and dictionaries
      are represented as Python sequence and dictionaries.
docstring_summary: Yields a list of objects: keywords, literals, strings, 
      numbers, arrays and dictionaries. Arrays and dictionaries
      are represented as Python sequence and dictionaries.
docstring_tokens: Yields a list of objects : keywords literals strings numbers arrays and dictionaries . Arrays and dictionaries are represented as Python sequence and dictionaries .
function: def nextobject(self):
      '''
      Yields a list of objects: keywords, literals, strings, 
      numbers, arrays and dictionaries. Arrays and dictionaries
      are represented as Python sequence and dictionaries.
      '''
      while not self.results:
        (pos, token) = self.nexttoken()
        #print (pos,token), (self.curtype, self.curstack)
        if (isinstance(token, int) or
            isinstance(token, float) or
            isinstance(token, bool) or
            isinstance(token, str) or
            isinstance(token, PSLiteral)):
          # normal token
          self.push((pos, token))
        elif token == KEYWORD_ARRAY_BEGIN:
          # begin array
          self.start_type(pos, 'a')
        elif token == KEYWORD_ARRAY_END:
          # end array
          try:
            self.push(self.end_type('a'))
          except PSTypeError:
            if STRICT: raise
        elif token == KEYWORD_DICT_BEGIN:
          # begin dictionary
          self.start_type(pos, 'd')
        elif token == KEYWORD_DICT_END:
          # end dictionary
          try:
            (pos, objs) = self.end_type('d')
            if len(objs) % 2 != 0:
              raise PSSyntaxError('Invalid dictionary construct: %r' % objs)
            d = dict( (literal_name(k), v) for (k,v) in choplist(2, objs))
            self.push((pos, d))
          except PSTypeError:
            if STRICT: raise
        else:
          if 2 <= self.debug:
            print >>stderr, 'do_keyword: pos=%r, token=%r, stack=%r' % \
                  (pos, token, self.curstack)
          self.do_keyword(pos, token)
        if self.context:
          continue
        else:
          self.flush()
      obj = self.results.pop(0)
      if 2 <= self.debug:
        print >>stderr, 'nextobject: %r' % (obj,)
      return obj
function_tokens: def nextobject ( self ) : while not self . results : ( pos , token ) = self . nexttoken ( ) #print (pos,token), (self.curtype, self.curstack) if ( isinstance ( token , int ) or isinstance ( token , float ) or isinstance ( token , bool ) or isinstance ( token , str ) or isinstance ( token , PSLiteral ) ) : # normal token self . push ( ( pos , token ) ) elif token == KEYWORD_ARRAY_BEGIN : # begin array self . start_type ( pos , 'a' ) elif token == KEYWORD_ARRAY_END : # end array try : self . push ( self . end_type ( 'a' ) ) except PSTypeError : if STRICT : raise elif token == KEYWORD_DICT_BEGIN : # begin dictionary self . start_type ( pos , 'd' ) elif token == KEYWORD_DICT_END : # end dictionary try : ( pos , objs ) = self . end_type ( 'd' ) if len ( objs ) % 2 != 0 : raise PSSyntaxError ( 'Invalid dictionary construct: %r' % objs ) d = dict ( ( literal_name ( k ) , v ) for ( k , v ) in choplist ( 2 , objs ) ) self . push ( ( pos , d ) ) except PSTypeError : if STRICT : raise else : if 2 <= self . debug : print >> stderr , 'do_keyword: pos=%r, token=%r, stack=%r' % ( pos , token , self . curstack ) self . do_keyword ( pos , token ) if self . context : continue else : self . flush ( ) obj = self . results . pop ( 0 ) if 2 <= self . debug : print >> stderr , 'nextobject: %r' % ( obj , ) return obj