| 103 | return '( ' + core_form + ' )' |
| 104 | |
| 105 | class AndNode(ASTNode): |
| 106 | def __init__(self, data_type, fields): |
| 107 | super().__init__('AND', 'AND', data_type, fields) |
| 108 | |
| 109 | def textual_form_core(self): |
| 110 | # the xxx that |
| 111 | if self.fields[0].depth == 0: |
| 112 | return ' '.join([self.fields[0].textual_form() ,'that', self.fields[1].textual_form()]) |
| 113 | # xxx and xxxx |
| 114 | else: |
| 115 | return ' '.join([self.fields[0].textual_form() ,'and', self.fields[1].textual_form()]) |
| 116 | |
| 117 | class RNode(ASTNode): |
| 118 | def __init__(self, data_type, fields): |