def lookup(self, literal): for sig in self.signatures: for symbol in sig.itersymbols(): if symbol == literal or \ isinstance(symbol, Identifier) and \ symbol.mnemonic == literal: return symbol else: return Identifier.promote(literal)
def p_tagged_func_leaf(self, p): """atom : FUNCTION_TAG IDENTIFIER | FUNCTION_TAG ESCAPED_SYMBOL """ p[0] = Tree(Identifier.promote(p[2], kind='function'))
def p_tagged_leaf(self, p): """atom : TAG IDENTIFIER | TAG ESCAPED_SYMBOL """ p[0] = Tree(Identifier.promote(p[2], kind=p[1]))