def grammar_ebnf_rhs(cls, opts): """ Determines the string to be used to describe this grammar when it occurs in the right-hand-side (RHS) of an EBNF definition. This can be overridden to customize how this grammar is represented by :func:`generate_ebnf`. Returns a tuple *(string, grammars)*, where *string* is the EBNF RHS string to use, and *grammars* is a list of other grammars on which this one depends (i.e. grammars whose names are referenced in *string*). """ if cls.grammar_terminal and not opts["expand_terminals"]: return None if cls.grammar_parse.__func__ is Grammar.grammar_parse.__func__: names, nts = util.get_ebnf_names(cls.grammar, opts) return (", ".join(names), nts) else: return (util.ebnf_specialseq(cls, opts), ())
def grammar_ebnf_lhs(cls, opts): return (util.ebnf_specialseq(cls, opts), ())