Exemple #1
0
 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)
Exemple #2
0
 def p_tagged_func_leaf(self, p):
     """atom : FUNCTION_TAG IDENTIFIER
             | FUNCTION_TAG ESCAPED_SYMBOL
     """
     p[0] = Tree(Identifier.promote(p[2], kind='function'))
Exemple #3
0
 def p_tagged_leaf(self, p):
     """atom : TAG IDENTIFIER
             | TAG ESCAPED_SYMBOL
     """
     p[0] = Tree(Identifier.promote(p[2], kind=p[1]))