<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def top_parent(self):
 """ Reference to top parent declaration. @type: declaration_t """

        parent = self.parent
        while parent is not None:
            if parent.parent is None:
                return parent
            else:
                parent = parent.parent
        return self