<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse(self):
 """Parse input."""

        self.__next__()
        while self.sym['type'] != 'EOF':
            if self.sym['type'] == 'LABEL':
                self.__label__()
            elif self.sym['type'] == 'MNEMONIC':
                self.__instruction__()
            elif self.sym['type'] == 'NAME' or self.sym['type'] == 'ASSEMBLER':
                self.__assembler__()
            else:
                self.parseerror('Unexpected input {}/{}'.format(
                                  self.sym['type'], repr(self.sym['txt'])))
        # patch skip targets if required
        for i in self.pl:
            if i['cmd'][0] == 'SKP':
                if i['target'] is not None:
                    if i['target'] in self.jmptbl:
                        iloc = i['addr']
                        dest = self.jmptbl[i['target']]
                        if dest > iloc:
                            oft = dest - iloc - 1
                            if oft > M6:
                                self.parseerror('Offset from SKP to ' 
                                                + repr(i['target'])
                                                + ' (' + hex(oft) 
                                                + ') too large',
                                                i['line'])
                            else:
                                i['cmd'][2] = oft
                        else:
                            self.parseerror('Target '
                                            + repr(i['target'])
                                            +' does not follow SKP',
                                            i['line'])
                    else:
                        self.parseerror('Undefined target for SKP ' 
                                        + repr(i['target']),
                                        i['line'])
                else:
                    pass	# assume offset is immediate
        self.__mkopcodes__()