Example #1
0
 def p_lhs_always_and_only_occurs(self, p):
     'lhs : lhs_pair ALWAYS_AND_ONLY_OCCURS'
     l1 = p[1]
     l2 = copy.deepcopy(l1)
     add_obligatory_lhs(l1, self.ast)
     add_optional_lhs(l2, self.ast)
     p[0] = l1 + l2
     self.ast.operator = p[2]
     self.ast.lhs = p[0]
Example #2
0
 def p_lhs_always_occurs(self, p):
     'lhs : lhs_pair ALWAYS_OCCURS'
     add_obligatory_lhs(p[1], self.ast)
     p[0] = p[1]
     self.ast.operator = p[2]
     self.ast.lhs = p[0]