class_docstr: A DataShape parser object.
class_docstr_tok: ["A","DataShape","parser","object","."]
docstr: dtype : typevar
        | type
        | type_constr
        | struct_type
        | funcproto_or_tuple_type
  typevar : NAME_UPPER
  ellipsis_typevar : NAME_UPPER ELLIPSIS
  type : NAME_LOWER
  type_constr : NAME_LOWER LBRACKET type_arg_list RBRACKET
  struct_type : LBRACE ...
  funcproto_or_tuple_type : LPAREN ...
  
  Returns a the dtype object, or None.
docstr_tok: ["dtype",":","typevar","|","type","|","type_constr","|","struct_type","|","funcproto_or_tuple_type","typevar",":","NAME_UPPER","ellipsis_typevar",":","NAME_UPPER","ELLIPSIS","type",":","NAME_LOWER","type_constr",":","NAME_LOWER","LBRACKET","type_arg_list","RBRACKET","struct_type",":","LBRACE","...","funcproto_or_tuple_type",":","LPAREN","...","Returns","a","the","dtype","object",",","or","None","."]
code: def parse_dtype(self):
      """
      dtype : typevar
            | type
            | type_constr
            | struct_type
            | funcproto_or_tuple_type
      typevar : NAME_UPPER
      ellipsis_typevar : NAME_UPPER ELLIPSIS
      type : NAME_LOWER
      type_constr : NAME_LOWER LBRACKET type_arg_list RBRACKET
      struct_type : LBRACE ...
      funcproto_or_tuple_type : LPAREN ...
  
      Returns a the dtype object, or None.
      """
      saved_pos = self.pos
      tok = self.tok
      if tok.id == lexer.NAME_UPPER:
          val = tok.val
          self.advance_tok()
          # TypeVars are treated as the "typevar" dtype
          tconstr = self.syntactic_sugar(
              self.sym.dtype_constr,
              "typevar",
              "TypeVar dtype constructor",
              saved_pos,
          )
          return tconstr(val)
      elif tok.id == lexer.NAME_LOWER:
          name = tok.val
          self.advance_tok()
          if self.tok.id == lexer.LBRACKET:
              dtype_constr = self.sym.dtype_constr.get(name)
              if dtype_constr is None:
                  self.pos = saved_pos
                  return None
              self.advance_tok()
              args, kwargs = self.parse_type_arg_list()
              if self.tok.id == lexer.RBRACKET:
                  if len(args) == 0 and len(kwargs) == 0:
                      self.raise_error(
                          "Expected at least one type "
                          + "constructor argument"
                      )
                  self.advance_tok()
                  return dtype_constr(*args, **kwargs)
              else:
                  self.raise_error("Invalid type constructor argument")
          else:
              dtype = self.sym.dtype.get(name)
              if dtype is not None:
                  return dtype
              else:
                  self.pos = saved_pos
                  return None
      elif tok.id == lexer.LBRACE:
          return self.parse_struct_type()
      elif tok.id == lexer.LPAREN:
          return self.parse_funcproto_or_tuple_type()
      else:
          return None
  
imports: from __future__ import absolute_import, division, print_function
  from .None import lexer, error
  from .None import coretypes
label_desc: Use image node_id 10 for calling the DataShapeParser obj's underlying member method code with example usage: obj.parse_dtype() and returns: tconstr, self, None, dtype_constr, dtype, None, self, None