def __init__(self, grammar): self.grammar = grammar self.repository = grammar.get(u'repository', {}) self.grammar_includes = set() self.repo_includes = dict([(k, set()) for k in self.repository])
def in_grammar(self, grammar): self.in_tree(grammar.get(u'patterns', []), u'/patterns') for (name, r_item) in grammar.get(u'repository', {}).iteritems(): self.in_tree(r_item, u'/repository/' + name)