'Parses the web2py request object'

def __parse(self):

    self.id = None
    self.component_name = None
    self.component_id = None
    self.method = None
    tablename = ('%s_%s' % (self.prefix, self.name))
    f = []
    append = f.append
    args = self.args
    if (len(args) > 4):
        args = args[:4]
    method = self.name
    for arg in args:
        if ('.' in arg):
            (arg, representation) = arg.rsplit('.', 1)
        if (method is None):
            method = arg
        elif arg.isdigit():
            append((method, arg))
            method = None
        else:
            append((method, None))
            method = arg
    if method:
        append((method, None))
    self.id = f[0][1]
    l = len(f)
    if (l > 1):
        m = f[1][0].lower()
        i = f[1][1]
        components = current.s3db.get_components(tablename, names=[m])
        if (components and (m in components)):
            self.component_name = m
            self.component_id = i
        else:
            self.method = m
            if (not self.id):
                self.id = i
    if (self.component_name and (l > 2)):
        self.method = f[2][0].lower()
        if (not self.component_id):
            self.component_id = f[2][1]
    representation = s3_get_extension(self)
    if representation:
        self.representation = representation
    else:
        self.representation = self.DEFAULT_REPRESENTATION
    if ((self.http == 'POST') and ('$search' in self.get_vars)):
        self.__search()
