Esempio n. 1
0
 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])
Esempio n. 2
0
 def p_object_nolabel(self, p):
     '''object_specifier : TABLET
                         | ENVELOPE
                         | PRISM
                         | BULLA
                         | SEALINGS'''
     p[0] = OraccObject(p[1])
Esempio n. 3
0
 def p_object_nolabel(self, p):
     '''object_specifier : TABLET
                         | ENVELOPE
                         | PRISM
                         | BULLA
                         | SEALINGS'''
     p[0] = OraccObject(p[1])
     objStructure.SetObjectType(str(p[0]))
Esempio n. 4
0
 def p_surface_nolabel(self, p):
     '''surface_specifier  : OBVERSE
                           | REVERSE
                           | LEFT
                           | RIGHT
                           | TOP
                           | BOTTOM'''
     p[0] = OraccObject(p[1])
Esempio n. 5
0
 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]))
Esempio n. 6
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])
Esempio n. 7
0
 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])