def parse(self, data, path=None):
assert not self.exhausted, '<STR_LIT>'<EOL>self.path = path<EOL>parsed_data = self.yacc.parse(data, lexer=self.lexer, debug=self.debug)<EOL>for err_msg, lineno in self.lexer.errors[::-<NUM_LIT:1>]:<EOL><INDENT>self.errors.insert(<NUM_LIT:0>, (err_msg, lineno, self.path))<EOL><DEDENT>parsed_data.extend(self.anony_defs)<EOL>self.exhausted = True<EOL>return parsed_data<EOL>
Args:
    data (str): Raw specification text.
    path (Optional[str]): Path to specification on filesystem. Only
        used to tag tokens with the file they originated from.