def p_text_surface_element(self, p): """text : text surface_element %prec OBJECT""" p[0] = p[1] if not p[0].objects(): p[0].children.append(OraccObject("tablet")) # Default to obverse of a tablet p[0].objects()[-1].children.append(OraccObject("obverse")) p[0].objects()[-1].children[0].children.append(p[2])
def p_object_nolabel(self, p): '''object_specifier : TABLET | ENVELOPE | PRISM | BULLA | SEALINGS''' p[0] = OraccObject(p[1])
def p_object_nolabel(self, p): '''object_specifier : TABLET | ENVELOPE | PRISM | BULLA | SEALINGS''' p[0] = OraccObject(p[1]) objStructure.SetObjectType(str(p[0]))
def p_surface_nolabel(self, p): '''surface_specifier : OBVERSE | REVERSE | LEFT | RIGHT | TOP | BOTTOM''' p[0] = OraccObject(p[1])
def p_surface_nolabel(self, p): '''surface_specifier : OBVERSE | REVERSE | LEFT | RIGHT | TOP | BOTTOM | EDGE''' p[0] = OraccObject(p[1]) objStructure.SetSurface(str(p[0]))
def p_text_surface(self, p): """text : text surface %prec OBJECT | text translation %prec TRANSLATIONEND""" p[0] = p[1] # Find the last object in the text # If there is none, append a tablet and use that # Default to a tablet # Has a default already been added? if not p[0].objects(): p[0].children.append(OraccObject("tablet")) p[0].objects()[-1].children.append(p[2])
def p_object_surface_element(self, p): """object : object surface_element %prec SURFACE""" p[0] = p[1] # Default surface is obverse p[0].children.append(OraccObject("obverse")) p[0].children[0].children.append(p[2])