pyrser/dsl.py
def get_rules(self) -> parsing.Node:
        """
        Parse the DSL and provide a dictionnaries of all resulting rules.
        Call by the MetaGrammar class.

        TODO: could be done in the rules property of parsing.BasicParser???
        """
        res = None
        try:
            res = self.eval_rule('bnf_dsl')
            if not res:
                # we fail to parse, but error is not set
                self.diagnostic.notify(
                    error.Severity.ERROR,
                    "Parse error in '%s' in EBNF bnf" % self._lastRule,
                    error.LocationInfo.from_maxstream(self._stream)
                )
                raise self.diagnostic
        except error.Diagnostic as d:
            d.notify(
                error.Severity.ERROR,
                "Parse error in '%s' in EBNF bnf" % self._lastRule
            )
            raise d
        return res
def get_rules(self) -> parsing.Node:
        res = None
        try:
            res = self.eval_rule('bnf_dsl')
            if not res:
                # we fail to parse, but error is not set
                self.diagnostic.notify(
                    error.Severity.ERROR,
                    "Parse error in '%s' in EBNF bnf" % self._lastRule,
                    error.LocationInfo.from_maxstream(self._stream)
                )
                raise self.diagnostic
        except error.Diagnostic as d:
            d.notify(
                error.Severity.ERROR,
                "Parse error in '%s' in EBNF bnf" % self._lastRule
            )
            raise d
        return res
def get_rules ( self ) -> parsing . Node : res = None try : res = self . eval_rule ( 'bnf_dsl' ) if not res : # we fail to parse, but error is not set self . diagnostic . notify ( error . Severity . ERROR , "Parse error in '%s' in EBNF bnf" % self . _lastRule , error . LocationInfo . from_maxstream ( self . _stream ) ) raise self . diagnostic except error . Diagnostic as d : d . notify ( error . Severity . ERROR , "Parse error in '%s' in EBNF bnf" % self . _lastRule ) raise d return res
Parse the DSL and provide a dictionnaries of all resulting rules.
        Call by the MetaGrammar class.

        TODO: could be done in the rules property of parsing.BasicParser???
Parse the DSL and provide a dictionnaries of all resulting rules . Call by the MetaGrammar class .