code: def datatype_from_token(self, token):
          
  
          if token.type == SystemRDLParser.ID:
              # Is an identifier for either an enum or struct type
  
              typ = self.compiler.namespace.lookup_type(get_ID_text(token))
              if typ is None:
                  self.msg.fatal(
                      "Type '%s' is not defined" % get_ID_text(token),
                      SourceRef.from_antlr(token)
                  )
  
              if rdltypes.is_user_enum(typ) or rdltypes.is_user_struct(typ):
                  return typ
              else:
                  self.msg.fatal(
                      "Type '%s' is not a struct or enum" % get_ID_text(token),
                      SourceRef.from_antlr(token)
                  )
  
          else:
              return self._DataType_Map[token.type]
docs: Given a SystemRDLParser token, lookup the type
          This only includes types under the "data_type" grammar rule