def p_attributeref(p): '''attributeref : propertyref | PERIOD propertyref | objectref PERIOD propertyref ''' # eg "methanol.etymology", "etymology" ("it." implied), ".etym" n = len(p.slice) if n == 2: obj = abby.it # "it." is implied prop = p[1] elif n == 3: obj = abby.it # "it." is implied prop = p[2] else: obj = p[1] prop = p[3] attrib = Objects.Attribute(obj, prop) p[0] = attrib log.debug('p_attributeref: %s', p[0])