# Path: hgvs/exceptions.py
# class HGVSParseError(HGVSError):
#     pass


import logging
import copy
import re
import bioutils.sequences
import ometa.runtime
import parsley
import hgvs.enums
import hgvs.edit
import hgvs.hgvsposition
import hgvs.location
import hgvs.posedit
import hgvs.sequencevariant
from pkg_resources import resource_filename
from hgvs.exceptions import HGVSParseError
        self._logger = logging.getLogger(__name__)
        self._expose_rule_functions(expose_all_rules)

    def parse(self, v):
        """parse HGVS variant `v`, returning a SequenceVariant

        :param str v: an HGVS-formatted variant as a string
        :rtype: SequenceVariant

        """
        return self.parse_hgvs_variant(v)

    def _expose_rule_functions(self, expose_all_rules=False):
        """add parse functions for public grammar rules

        Defines a function for each public grammar rule, based on
        introspecting the grammar. For example, the `c_interval` rule
        is exposed as a method `parse_c_interval` and used like this::

          Parser.parse_c_interval('26+2_57-3') -> Interval(...)

        """

        def make_parse_rule_function(rule_name):
            "builds a wrapper function that parses a string with the specified rule"

            def rule_fxn(s):
                try:
                    return self._grammar(s).__getattr__(rule_name)()
                except ometa.runtime.ParseError as exc:

# Path: hgvs/exceptions.py
# class HGVSParseError(HGVSError):
#     pass


# Path: hgvs/parser.py
import logging
import copy
import re
import bioutils.sequences
import ometa.runtime
import parsley
import hgvs.enums
import hgvs.edit
import hgvs.hgvsposition
import hgvs.location
import hgvs.posedit
import hgvs.sequencevariant
from pkg_resources import resource_filename
from hgvs.exceptions import HGVSParseError

        self._logger = logging.getLogger(__name__)
        self._expose_rule_functions(expose_all_rules)

    def parse(self, v):
        """parse HGVS variant `v`, returning a SequenceVariant

        :param str v: an HGVS-formatted variant as a string
        :rtype: SequenceVariant

        """
        return self.parse_hgvs_variant(v)

    def _expose_rule_functions(self, expose_all_rules=False):
        """add parse functions for public grammar rules

        Defines a function for each public grammar rule, based on
        introspecting the grammar. For example, the `c_interval` rule
        is exposed as a method `parse_c_interval` and used like this::

          Parser.parse_c_interval('26+2_57-3') -> Interval(...)

        """

        def make_parse_rule_function(rule_name):
            "builds a wrapper function that parses a string with the specified rule"

            def rule_fxn(s):
                try:
                    return self._grammar(s).__getattr__(rule_name)()
                except ometa.runtime.ParseError as exc:

                    raise HGVSParseError("{s}: char {exc.position}: {reason}".format(