クラス遷移(オブジェクト):デフ__init __(自己、開始、終了):self.start =開始self.end =終了def get_label(自己):戻り値なしdef has_label(自己):戻り値false def collect_decorations(self、decorations):デコレーションを返すdef internal_equality(self、my_decorations、other):return(self.start == other.start and self.end == other.end and my_decorations = other.collect_decorations())def __eq __(self、other): self.internal_equality(self.collect_decorations({})、その他)を返します ラベルLabeled(オブジェクト):def __init __(self、label、base):self.base = base self.label =ラベルdef has_label(self):戻り値true def get_label(self):戻り値self.label def collect_decorations(self、decorations) ): 'label'をデコレーションに含まれていないと宣言する['label'] = self.label self.base.collect_decorations(decorations)を返すdef __getattr __(self、attribute):self.baseを返す。__getattr(attribute)