def get_symbol(self, name): try: symbols_for_name = self.symbols[name] assert len(symbols_for_name) == 1 return symbols_for_name[0] except KeyError: raise UndefinedSymbolError(name)
def get_symbol(self, name): try: return self.symbols[name] except KeyError: raise UndefinedSymbolError(name)
def __init__(self, name, env): GrammarSymbol.__init__(self) self.value = env.formula_manager.get_symbol(name) if self.value is None: raise UndefinedSymbolError(name)