<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def handle_annotation_pattern(self, line: str, position: int, tokens: ParseResults) -> ParseResults: """Handle statements like ``DEFINE ANNOTATION X AS PATTERN "Y"``. :raises: RedefinedAnnotationError """

        annotation = tokens['name']
        self.raise_for_redefined_annotation(line, position, annotation)
        self.annotation_to_pattern[annotation] = re.compile(tokens['value'])
        return tokens