code: def right_associative_infix_rule(operator, grammar_rule):
      
      def semantic_action(self, node, (result, remaining)):
          while remaining:
              op, rhs = remaining.pop(0)
              result = operator(Attr(result, Name(self.aliases[op])), [rhs], op)
          return result
      return g.rule(grammar_rule)(semantic_action)
docs: Semantic action for rules like 'A = B (C B)*'.