def parse_text(self, text):
text = text.strip()<EOL>lines = text.splitlines()<EOL>parsed_lines = []<EOL>encountered_date = False<EOL>for (lineno, line) in enumerate(lines, <NUM_LIT:1>):<EOL><INDENT>try:<EOL><INDENT>parsed_line = self.parse_line(line)<EOL>if isinstance(parsed_line, DateLine):<EOL><INDENT>encountered_date = True<EOL><DEDENT>elif isinstance(parsed_line, Entry) and not encountered_date:<EOL><INDENT>raise ParseError("<STR_LIT>")<EOL><DEDENT><DEDENT>except ParseError as e:<EOL><INDENT>e.line_number = lineno<EOL>e.line = line<EOL>raise<EOL><DEDENT>else:<EOL><INDENT>parsed_lines.append(parsed_line)<EOL><DEDENT><DEDENT>return parsed_lines<EOL>
Parse the given text and return a list of :class:`~taxi.timesheet.lines.DateLine`,
:class:`~taxi.timesheet.lines.Entry`, and :class:`~taxi.timesheet.lines.TextLine` objects. If there's an
error during parsing, a :exc:`taxi.exceptions.ParseError` will be raised.