bcd537e5e1feebdc5b5b008311b4498e00e005ba
[c_to_python.git] / ast.py
1 import element
2 #import xml.etree.ElementTree
3
4 class Context:
5   def __init__(
6     self,
7     indent = '',
8     lines = [],
9     top_level = True,
10     enclosing_loop = None,
11     translate_identifier = {
12       'NULL': 'None',
13       'false': 'False',
14       'strlen': 'len',
15       'true': 'True'
16     }
17   ):
18     self.indent = indent
19     self.lines = lines
20     self.top_level = top_level
21     self.enclosing_loop = enclosing_loop
22     self.translate_identifier = translate_identifier
23
24 class AST(element.Element):
25   # internal classes
26   class Text(element.Element):
27     # GENERATE ELEMENT() BEGIN
28     def __init__(
29       self,
30       tag = 'AST_Text',
31       attrib = {},
32       text = '',
33       children = []
34     ):
35       element.Element.__init__(
36         self,
37         tag,
38         attrib,
39         text,
40         children
41       )
42     def copy(self, factory = None):
43       result = element.Element.copy(
44         self,
45         Text if factory is None else factory
46       )
47       return result
48     def __repr__(self):
49       params = []
50       self.repr_serialize(params)
51       return 'ast.AST.Text({0:s})'.format(', '.join(params))
52     # GENERATE END
53
54   class DeclarationOrStatement(element.Element):
55     # GENERATE ELEMENT() BEGIN
56     def __init__(
57       self,
58       tag = 'AST_DeclarationOrStatement',
59       attrib = {},
60       text = '',
61       children = []
62     ):
63       element.Element.__init__(
64         self,
65         tag,
66         attrib,
67         text,
68         children
69       )
70     def copy(self, factory = None):
71       result = element.Element.copy(
72         self,
73         DeclarationOrStatement if factory is None else factory
74       )
75       return result
76     def __repr__(self):
77       params = []
78       self.repr_serialize(params)
79       return 'ast.AST.DeclarationOrStatement({0:s})'.format(', '.join(params))
80     # GENERATE END
81     def translate_declaration_or_statement(self, context):
82       #text = element.to_text(self).strip()
83       #assert text[-1] == ';'
84       #context.lines.append(
85       #  '{0:s}{1:s}\n'.format(context.indent, text[:-1])
86       #)
87       print(self)
88       raise NotImplementedError
89
90   class Statement(DeclarationOrStatement):
91     # GENERATE ELEMENT() BEGIN
92     def __init__(
93       self,
94       tag = 'AST_Statement',
95       attrib = {},
96       text = '',
97       children = []
98     ):
99       AST.DeclarationOrStatement.__init__(
100         self,
101         tag,
102         attrib,
103         text,
104         children
105       )
106     def copy(self, factory = None):
107       result = AST.DeclarationOrStatement.copy(
108         self,
109         Statement if factory is None else factory
110       )
111       return result
112     def __repr__(self):
113       params = []
114       self.repr_serialize(params)
115       return 'ast.AST.Statement({0:s})'.format(', '.join(params))
116     # GENERATE END
117
118   class Declarator(element.Element):
119     # GENERATE ELEMENT() BEGIN
120     def __init__(
121       self,
122       tag = 'AST_Declarator',
123       attrib = {},
124       text = '',
125       children = []
126     ):
127       element.Element.__init__(
128         self,
129         tag,
130         attrib,
131         text,
132         children
133       )
134     def copy(self, factory = None):
135       result = element.Element.copy(
136         self,
137         Declarator if factory is None else factory
138       )
139       return result
140     def __repr__(self):
141       params = []
142       self.repr_serialize(params)
143       return 'ast.AST.Declarator({0:s})'.format(', '.join(params))
144     # GENERATE END
145     def get_type_and_name(self, base_type):
146       print(self)
147       raise NotImplementedError
148
149   class Expression(element.Element):
150     # GENERATE ELEMENT() BEGIN
151     def __init__(
152       self,
153       tag = 'AST_Expression',
154       attrib = {},
155       text = '',
156       children = []
157     ):
158       element.Element.__init__(
159         self,
160         tag,
161         attrib,
162         text,
163         children
164       )
165     def copy(self, factory = None):
166       result = element.Element.copy(
167         self,
168         Expression if factory is None else factory
169       )
170       return result
171     def __repr__(self):
172       params = []
173       self.repr_serialize(params)
174       return 'ast.AST.Expression({0:s})'.format(', '.join(params))
175     # GENERATE END
176     def translate_expression(self, context, precedence):
177       #return element.to_text(self).strip()
178       print(self)
179       raise NotImplementedError
180     def translate_statement_expression(self, context):
181       return self.translate_expression(context, 0)
182
183   class ExpressionUnary(Expression):
184     # GENERATE ELEMENT(str unary_operator, bool postfix) BEGIN
185     def __init__(
186       self,
187       tag = 'AST_ExpressionUnary',
188       attrib = {},
189       text = '',
190       children = [],
191       unary_operator = '',
192       postfix = False
193     ):
194       AST.Expression.__init__(
195         self,
196         tag,
197         attrib,
198         text,
199         children
200       )
201       self.unary_operator = unary_operator
202       self.postfix = (
203         element.deserialize_bool(postfix)
204       if isinstance(postfix, str) else
205         postfix
206       )
207     def serialize(self, ref_list):
208       AST.Expression.serialize(self, ref_list)
209       self.set('unary_operator', element.serialize_str(self.unary_operator))
210       self.set('postfix', element.serialize_bool(self.postfix))
211     def deserialize(self, ref_list):
212       AST.Expression.deserialize(self, ref_list)
213       self.unary_operator = element.deserialize_str(self.get('unary_operator', ''))
214       self.postfix = element.deserialize_bool(self.get('postfix', 'false'))
215     def copy(self, factory = None):
216       result = AST.Expression.copy(
217         self,
218         ExpressionUnary if factory is None else factory
219       )
220       result.unary_operator = self.unary_operator
221       result.postfix = self.postfix
222       return result
223     def repr_serialize(self, params):
224       AST.Expression.repr_serialize(self, params)
225       if self.unary_operator != '':
226         params.append(
227           'unary_operator = {0:s}'.format(repr(self.unary_operator))
228         )
229       if self.postfix != False:
230         params.append(
231           'postfix = {0:s}'.format(repr(self.postfix))
232         )
233     def __repr__(self):
234       params = []
235       self.repr_serialize(params)
236       return 'ast.AST.ExpressionUnary({0:s})'.format(', '.join(params))
237     # GENERATE END
238     def translate_expression(self, context, precedence):
239       if self.postfix:
240         text = '{0:s}{1:s}'.format(
241           self[0].translate_expression(context, 14),
242           self.unary_operator
243         )
244         if 14 < precedence:
245           text = '({0:s})'.format(text)
246       else:
247         text = '{0:s}{1:s}'.format(
248           self.unary_operator,
249           self[0].translate_expression(context, 13)
250         )
251         if 13 < precedence:
252           text = '({0:s})'.format(text)
253       return text
254
255   class ExpressionBinary(Expression):
256     # GENERATE ELEMENT(str binary_operator, int precedence, bool right_to_left) BEGIN
257     def __init__(
258       self,
259       tag = 'AST_ExpressionBinary',
260       attrib = {},
261       text = '',
262       children = [],
263       binary_operator = '',
264       precedence = -1,
265       right_to_left = False
266     ):
267       AST.Expression.__init__(
268         self,
269         tag,
270         attrib,
271         text,
272         children
273       )
274       self.binary_operator = binary_operator
275       self.precedence = (
276         element.deserialize_int(precedence)
277       if isinstance(precedence, str) else
278         precedence
279       )
280       self.right_to_left = (
281         element.deserialize_bool(right_to_left)
282       if isinstance(right_to_left, str) else
283         right_to_left
284       )
285     def serialize(self, ref_list):
286       AST.Expression.serialize(self, ref_list)
287       self.set('binary_operator', element.serialize_str(self.binary_operator))
288       self.set('precedence', element.serialize_int(self.precedence))
289       self.set('right_to_left', element.serialize_bool(self.right_to_left))
290     def deserialize(self, ref_list):
291       AST.Expression.deserialize(self, ref_list)
292       self.binary_operator = element.deserialize_str(self.get('binary_operator', ''))
293       self.precedence = element.deserialize_int(self.get('precedence', '-1'))
294       self.right_to_left = element.deserialize_bool(self.get('right_to_left', 'false'))
295     def copy(self, factory = None):
296       result = AST.Expression.copy(
297         self,
298         ExpressionBinary if factory is None else factory
299       )
300       result.binary_operator = self.binary_operator
301       result.precedence = self.precedence
302       result.right_to_left = self.right_to_left
303       return result
304     def repr_serialize(self, params):
305       AST.Expression.repr_serialize(self, params)
306       if self.binary_operator != '':
307         params.append(
308           'binary_operator = {0:s}'.format(repr(self.binary_operator))
309         )
310       if self.precedence != -1:
311         params.append(
312           'precedence = {0:s}'.format(repr(self.precedence))
313         )
314       if self.right_to_left != False:
315         params.append(
316           'right_to_left = {0:s}'.format(repr(self.right_to_left))
317         )
318     def __repr__(self):
319       params = []
320       self.repr_serialize(params)
321       return 'ast.AST.ExpressionBinary({0:s})'.format(', '.join(params))
322     # GENERATE END
323     def translate_expression(self, context, precedence):
324       text = '{0:s}{1:s}{2:s}'.format(
325         self[0].translate_expression(
326           context,
327           self.precedence + int(self.right_to_left)
328         ),
329         self.binary_operator,
330         self[1].translate_expression(
331           context,
332           self.precedence + int(not self.right_to_left)
333         )
334       )
335       if self.precedence < precedence:
336         text = '({0:s})'.format(text)
337       return text
338
339   # type analysis
340   class Type(element.Element):
341     # GENERATE ELEMENT() BEGIN
342     def __init__(
343       self,
344       tag = 'AST_Type',
345       attrib = {},
346       text = '',
347       children = []
348     ):
349       element.Element.__init__(
350         self,
351         tag,
352         attrib,
353         text,
354         children
355       )
356     def copy(self, factory = None):
357       result = element.Element.copy(
358         self,
359         Type if factory is None else factory
360       )
361       return result
362     def __repr__(self):
363       params = []
364       self.repr_serialize(params)
365       return 'ast.AST.Type({0:s})'.format(', '.join(params))
366     # GENERATE END
367     def translate_size(self, context):
368       print(self)
369       raise NotImplementedError
370     def translate_type(self, context):
371       print(self)
372       raise NotImplementedError
373     def translate_zero(self, context):
374       print(self)
375       raise NotImplementedError
376
377   class TypeVoid(Type):
378     # GENERATE ELEMENT() BEGIN
379     def __init__(
380       self,
381       tag = 'AST_TypeVoid',
382       attrib = {},
383       text = '',
384       children = []
385     ):
386       AST.Type.__init__(
387         self,
388         tag,
389         attrib,
390         text,
391         children
392       )
393     def copy(self, factory = None):
394       result = AST.Type.copy(
395         self,
396         TypeVoid if factory is None else factory
397       )
398       return result
399     def __repr__(self):
400       params = []
401       self.repr_serialize(params)
402       return 'ast.AST.TypeVoid({0:s})'.format(', '.join(params))
403     # GENERATE END
404     def __str__(self):
405       return 'void'
406
407   class TypeInt(Type):
408     # GENERATE ELEMENT(bool signed, int bits) BEGIN
409     def __init__(
410       self,
411       tag = 'AST_TypeInt',
412       attrib = {},
413       text = '',
414       children = [],
415       signed = False,
416       bits = -1
417     ):
418       AST.Type.__init__(
419         self,
420         tag,
421         attrib,
422         text,
423         children
424       )
425       self.signed = (
426         element.deserialize_bool(signed)
427       if isinstance(signed, str) else
428         signed
429       )
430       self.bits = (
431         element.deserialize_int(bits)
432       if isinstance(bits, str) else
433         bits
434       )
435     def serialize(self, ref_list):
436       AST.Type.serialize(self, ref_list)
437       self.set('signed', element.serialize_bool(self.signed))
438       self.set('bits', element.serialize_int(self.bits))
439     def deserialize(self, ref_list):
440       AST.Type.deserialize(self, ref_list)
441       self.signed = element.deserialize_bool(self.get('signed', 'false'))
442       self.bits = element.deserialize_int(self.get('bits', '-1'))
443     def copy(self, factory = None):
444       result = AST.Type.copy(
445         self,
446         TypeInt if factory is None else factory
447       )
448       result.signed = self.signed
449       result.bits = self.bits
450       return result
451     def repr_serialize(self, params):
452       AST.Type.repr_serialize(self, params)
453       if self.signed != False:
454         params.append(
455           'signed = {0:s}'.format(repr(self.signed))
456         )
457       if self.bits != -1:
458         params.append(
459           'bits = {0:s}'.format(repr(self.bits))
460         )
461     def __repr__(self):
462       params = []
463       self.repr_serialize(params)
464       return 'ast.AST.TypeInt({0:s})'.format(', '.join(params))
465     # GENERATE END
466     def __str__(self):
467       return '{0:s}int{1:d}'.format(['u', ''][int(self.signed)], self.bits)
468     def translate_size(self, context):
469       return (self.bits + 7) // 8
470     def translate_type(self, context):
471       return 'int'
472     def translate_zero(self, context):
473       return '0' if context.top_level else 'None'
474
475   class TypeFloat(Type):
476     # GENERATE ELEMENT(int complex, int bits) BEGIN
477     def __init__(
478       self,
479       tag = 'AST_TypeFloat',
480       attrib = {},
481       text = '',
482       children = [],
483       complex = -1,
484       bits = -1
485     ):
486       AST.Type.__init__(
487         self,
488         tag,
489         attrib,
490         text,
491         children
492       )
493       self.complex = (
494         element.deserialize_int(complex)
495       if isinstance(complex, str) else
496         complex
497       )
498       self.bits = (
499         element.deserialize_int(bits)
500       if isinstance(bits, str) else
501         bits
502       )
503     def serialize(self, ref_list):
504       AST.Type.serialize(self, ref_list)
505       self.set('complex', element.serialize_int(self.complex))
506       self.set('bits', element.serialize_int(self.bits))
507     def deserialize(self, ref_list):
508       AST.Type.deserialize(self, ref_list)
509       self.complex = element.deserialize_int(self.get('complex', '-1'))
510       self.bits = element.deserialize_int(self.get('bits', '-1'))
511     def copy(self, factory = None):
512       result = AST.Type.copy(
513         self,
514         TypeFloat if factory is None else factory
515       )
516       result.complex = self.complex
517       result.bits = self.bits
518       return result
519     def repr_serialize(self, params):
520       AST.Type.repr_serialize(self, params)
521       if self.complex != -1:
522         params.append(
523           'complex = {0:s}'.format(repr(self.complex))
524         )
525       if self.bits != -1:
526         params.append(
527           'bits = {0:s}'.format(repr(self.bits))
528         )
529     def __repr__(self):
530       params = []
531       self.repr_serialize(params)
532       return 'ast.AST.TypeFloat({0:s})'.format(', '.join(params))
533     # GENERATE END
534     def __str__(self):
535       return '{0:s}float{0:d}'.format(
536         ['', 'i', 'c'][int(self.complex)],
537         self.bits
538       )
539     def translate_size(self, context):
540       return (self.bits + 7) // 8
541     def translate_type(self, context):
542       return 'float'
543     def translate_zero(self, context):
544       return '0.' if context.top_level else 'None'
545
546   class TypeBool(Type):
547     # GENERATE ELEMENT() BEGIN
548     def __init__(
549       self,
550       tag = 'AST_TypeBool',
551       attrib = {},
552       text = '',
553       children = []
554     ):
555       AST.Type.__init__(
556         self,
557         tag,
558         attrib,
559         text,
560         children
561       )
562     def copy(self, factory = None):
563       result = AST.Type.copy(
564         self,
565         TypeBool if factory is None else factory
566       )
567       return result
568     def __repr__(self):
569       params = []
570       self.repr_serialize(params)
571       return 'ast.AST.TypeBool({0:s})'.format(', '.join(params))
572     # GENERATE END
573     def __str__(self):
574       return 'bool'
575     def translate_size(self, context):
576       return 1
577     def translate_type(self, context):
578       return 'bool'
579     def translate_zero(self, context):
580       return 'False' if context.top_level else 'None'
581
582   class TypePointer(Type):
583     # GENERATE ELEMENT(ref target_type) BEGIN
584     def __init__(
585       self,
586       tag = 'AST_TypePointer',
587       attrib = {},
588       text = '',
589       children = [],
590       target_type = None
591     ):
592       AST.Type.__init__(
593         self,
594         tag,
595         attrib,
596         text,
597         children
598       )
599       self.target_type = target_type
600     def serialize(self, ref_list):
601       AST.Type.serialize(self, ref_list)
602       self.set('target_type', element.serialize_ref(self.target_type, ref_list))
603     def deserialize(self, ref_list):
604       AST.Type.deserialize(self, ref_list)
605       self.target_type = element.deserialize_ref(self.get('target_type', '-1'), ref_list)
606     def copy(self, factory = None):
607       result = AST.Type.copy(
608         self,
609         TypePointer if factory is None else factory
610       )
611       result.target_type = self.target_type
612       return result
613     def repr_serialize(self, params):
614       AST.Type.repr_serialize(self, params)
615       if self.target_type != None:
616         params.append(
617           'target_type = {0:s}'.format(repr(self.target_type))
618         )
619     def __repr__(self):
620       params = []
621       self.repr_serialize(params)
622       return 'ast.AST.TypePointer({0:s})'.format(', '.join(params))
623     # GENERATE END
624     def __str__(self):
625       return 'pointer<{0:s}>'.format(str(self.target_type))
626     def translate_size(self, context):
627       return 4
628     def translate_type(self, context):
629       assert (
630         isinstance(self.target_type, AST.TypeInt) and
631         self.target_type.bits == 8
632       )
633       return 'str'
634     def translate_zero(self, context):
635       assert (
636         isinstance(self.target_type, AST.TypeInt) and
637         self.target_type.bits == 8
638       )
639       return '\'\'' if context.top_level else 'None'
640
641   class TypeArray(Type):
642     # GENERATE ELEMENT(ref element_type, int element_count) BEGIN
643     def __init__(
644       self,
645       tag = 'AST_TypeArray',
646       attrib = {},
647       text = '',
648       children = [],
649       element_type = None,
650       element_count = -1
651     ):
652       AST.Type.__init__(
653         self,
654         tag,
655         attrib,
656         text,
657         children
658       )
659       self.element_type = element_type
660       self.element_count = (
661         element.deserialize_int(element_count)
662       if isinstance(element_count, str) else
663         element_count
664       )
665     def serialize(self, ref_list):
666       AST.Type.serialize(self, ref_list)
667       self.set('element_type', element.serialize_ref(self.element_type, ref_list))
668       self.set('element_count', element.serialize_int(self.element_count))
669     def deserialize(self, ref_list):
670       AST.Type.deserialize(self, ref_list)
671       self.element_type = element.deserialize_ref(self.get('element_type', '-1'), ref_list)
672       self.element_count = element.deserialize_int(self.get('element_count', '-1'))
673     def copy(self, factory = None):
674       result = AST.Type.copy(
675         self,
676         TypeArray if factory is None else factory
677       )
678       result.element_type = self.element_type
679       result.element_count = self.element_count
680       return result
681     def repr_serialize(self, params):
682       AST.Type.repr_serialize(self, params)
683       if self.element_type != None:
684         params.append(
685           'element_type = {0:s}'.format(repr(self.element_type))
686         )
687       if self.element_count != -1:
688         params.append(
689           'element_count = {0:s}'.format(repr(self.element_count))
690         )
691     def __repr__(self):
692       params = []
693       self.repr_serialize(params)
694       return 'ast.AST.TypeArray({0:s})'.format(', '.join(params))
695     # GENERATE END
696     def __str__(self):
697       return 'array<{0:s}: {1:s}>'.format(
698         str(self.element_type),
699         (
700           'UNSPECIFIED'
701         if self.element_count == -1 else
702           'C99_FLEXIBLE'
703         if self.element_count == -2 else
704           str(self.element_count)
705         )
706       )
707     def translate_size(self, context):
708       return self.element_type.translate_type(context) * self.element_count 
709     def translate_zero(self, context):
710       return '[{0:s}]'.format(
711         ', '.join(
712           [self.element_type.translate_zero(context)] * self.element_count
713         )
714       )
715
716   class TypeFunction(Type):
717     class Argument(element.Element):
718       # GENERATE ELEMENT(ref type, str name) BEGIN
719       def __init__(
720         self,
721         tag = 'AST_TypeFunction_Argument',
722         attrib = {},
723         text = '',
724         children = [],
725         type = None,
726         name = ''
727       ):
728         element.Element.__init__(
729           self,
730           tag,
731           attrib,
732           text,
733           children
734         )
735         self.type = type
736         self.name = name
737       def serialize(self, ref_list):
738         element.Element.serialize(self, ref_list)
739         self.set('type', element.serialize_ref(self.type, ref_list))
740         self.set('name', element.serialize_str(self.name))
741       def deserialize(self, ref_list):
742         element.Element.deserialize(self, ref_list)
743         self.type = element.deserialize_ref(self.get('type', '-1'), ref_list)
744         self.name = element.deserialize_str(self.get('name', ''))
745       def copy(self, factory = None):
746         result = element.Element.copy(
747           self,
748           Argument if factory is None else factory
749         )
750         result.type = self.type
751         result.name = self.name
752         return result
753       def repr_serialize(self, params):
754         element.Element.repr_serialize(self, params)
755         if self.type != None:
756           params.append(
757             'type = {0:s}'.format(repr(self.type))
758           )
759         if self.name != '':
760           params.append(
761             'name = {0:s}'.format(repr(self.name))
762           )
763       def __repr__(self):
764         params = []
765         self.repr_serialize(params)
766         return 'ast.AST.TypeFunction.Argument({0:s})'.format(', '.join(params))
767       # GENERATE END
768       def __str__(self):
769         return '{0:s} {1:s}'.format(
770           str(self.type),
771           'ABSTRACT' if self.name == '' else self.name
772         )
773
774     # GENERATE ELEMENT(ref return_type, bool varargs) BEGIN
775     def __init__(
776       self,
777       tag = 'AST_TypeFunction',
778       attrib = {},
779       text = '',
780       children = [],
781       return_type = None,
782       varargs = False
783     ):
784       AST.Type.__init__(
785         self,
786         tag,
787         attrib,
788         text,
789         children
790       )
791       self.return_type = return_type
792       self.varargs = (
793         element.deserialize_bool(varargs)
794       if isinstance(varargs, str) else
795         varargs
796       )
797     def serialize(self, ref_list):
798       AST.Type.serialize(self, ref_list)
799       self.set('return_type', element.serialize_ref(self.return_type, ref_list))
800       self.set('varargs', element.serialize_bool(self.varargs))
801     def deserialize(self, ref_list):
802       AST.Type.deserialize(self, ref_list)
803       self.return_type = element.deserialize_ref(self.get('return_type', '-1'), ref_list)
804       self.varargs = element.deserialize_bool(self.get('varargs', 'false'))
805     def copy(self, factory = None):
806       result = AST.Type.copy(
807         self,
808         TypeFunction if factory is None else factory
809       )
810       result.return_type = self.return_type
811       result.varargs = self.varargs
812       return result
813     def repr_serialize(self, params):
814       AST.Type.repr_serialize(self, params)
815       if self.return_type != None:
816         params.append(
817           'return_type = {0:s}'.format(repr(self.return_type))
818         )
819       if self.varargs != False:
820         params.append(
821           'varargs = {0:s}'.format(repr(self.varargs))
822         )
823     def __repr__(self):
824       params = []
825       self.repr_serialize(params)
826       return 'ast.AST.TypeFunction({0:s})'.format(', '.join(params))
827     # GENERATE END
828     def __str__(self):
829       return 'function<{0:s} -> {1:s}>'.format(
830         (
831           'void'
832         if len(self) == 0 else
833           ', '.join(
834             [str(i) for i in self] + (['...'] if self.varargs else [])
835           )
836         ),
837         str(self.return_type)
838       )
839
840   # syntax classes
841   class AlignAsExpression(element.Element):
842     # GENERATE ELEMENT() BEGIN
843     def __init__(
844       self,
845       tag = 'AST_AlignAsExpression',
846       attrib = {},
847       text = '',
848       children = []
849     ):
850       element.Element.__init__(
851         self,
852         tag,
853         attrib,
854         text,
855         children
856       )
857     def copy(self, factory = None):
858       result = element.Element.copy(
859         self,
860         AlignAsExpression if factory is None else factory
861       )
862       return result
863     def __repr__(self):
864       params = []
865       self.repr_serialize(params)
866       return 'ast.AST.AlignAsExpression({0:s})'.format(', '.join(params))
867     # GENERATE END
868
869   class AlignAsType(element.Element):
870     # GENERATE ELEMENT() BEGIN
871     def __init__(
872       self,
873       tag = 'AST_AlignAsType',
874       attrib = {},
875       text = '',
876       children = []
877     ):
878       element.Element.__init__(
879         self,
880         tag,
881         attrib,
882         text,
883         children
884       )
885     def copy(self, factory = None):
886       result = element.Element.copy(
887         self,
888         AlignAsType if factory is None else factory
889       )
890       return result
891     def __repr__(self):
892       params = []
893       self.repr_serialize(params)
894       return 'ast.AST.AlignAsType({0:s})'.format(', '.join(params))
895     # GENERATE END
896
897   class ArgumentExpressionList(element.Element):
898     # GENERATE ELEMENT() BEGIN
899     def __init__(
900       self,
901       tag = 'AST_ArgumentExpressionList',
902       attrib = {},
903       text = '',
904       children = []
905     ):
906       element.Element.__init__(
907         self,
908         tag,
909         attrib,
910         text,
911         children
912       )
913     def copy(self, factory = None):
914       result = element.Element.copy(
915         self,
916         ArgumentExpressionList if factory is None else factory
917       )
918       return result
919     def __repr__(self):
920       params = []
921       self.repr_serialize(params)
922       return 'ast.AST.ArgumentExpressionList({0:s})'.format(', '.join(params))
923     # GENERATE END
924
925   class BlockItemList(element.Element):
926     # GENERATE ELEMENT() BEGIN
927     def __init__(
928       self,
929       tag = 'AST_BlockItemList',
930       attrib = {},
931       text = '',
932       children = []
933     ):
934       element.Element.__init__(
935         self,
936         tag,
937         attrib,
938         text,
939         children
940       )
941     def copy(self, factory = None):
942       result = element.Element.copy(
943         self,
944         BlockItemList if factory is None else factory
945       )
946       return result
947     def __repr__(self):
948       params = []
949       self.repr_serialize(params)
950       return 'ast.AST.BlockItemList({0:s})'.format(', '.join(params))
951     # GENERATE END
952     def translate_block_item_list(self, context):
953       for i in self:
954         i.translate_declaration_or_statement(context)
955
956   class Declaration(DeclarationOrStatement):
957     # GENERATE ELEMENT() BEGIN
958     def __init__(
959       self,
960       tag = 'AST_Declaration',
961       attrib = {},
962       text = '',
963       children = []
964     ):
965       AST.DeclarationOrStatement.__init__(
966         self,
967         tag,
968         attrib,
969         text,
970         children
971       )
972     def copy(self, factory = None):
973       result = AST.DeclarationOrStatement.copy(
974         self,
975         Declaration if factory is None else factory
976       )
977       return result
978     def __repr__(self):
979       params = []
980       self.repr_serialize(params)
981       return 'ast.AST.Declaration({0:s})'.format(', '.join(params))
982     # GENERATE END
983     def translate_declaration_or_statement(self, context):
984       base_type = self[0].get_type()
985       for i in self[1]:
986         type, name = i[0].get_type_and_name(base_type)
987         if not isinstance(type, AST.TypeFunction):
988           context.lines.append(
989             '{0:s}{1:s} = {2:s}\n'.format(
990               context.indent,
991               name,
992               (
993                 type.translate_zero(context)
994               if isinstance(i[1], AST.EqualsInitializerEmpty) else
995                 i[1].translate_expression(context, 0)
996               )
997             )
998           )
999
1000   class DeclarationList(element.Element):
1001     # GENERATE ELEMENT() BEGIN
1002     def __init__(
1003       self,
1004       tag = 'AST_DeclarationList',
1005       attrib = {},
1006       text = '',
1007       children = []
1008     ):
1009       element.Element.__init__(
1010         self,
1011         tag,
1012         attrib,
1013         text,
1014         children
1015       )
1016     def copy(self, factory = None):
1017       result = element.Element.copy(
1018         self,
1019         DeclarationList if factory is None else factory
1020       )
1021       return result
1022     def __repr__(self):
1023       params = []
1024       self.repr_serialize(params)
1025       return 'ast.AST.DeclarationList({0:s})'.format(', '.join(params))
1026     # GENERATE END
1027
1028   class DeclarationSpecifierList(element.Element):
1029     # GENERATE ELEMENT() BEGIN
1030     def __init__(
1031       self,
1032       tag = 'AST_DeclarationSpecifierList',
1033       attrib = {},
1034       text = '',
1035       children = []
1036     ):
1037       element.Element.__init__(
1038         self,
1039         tag,
1040         attrib,
1041         text,
1042         children
1043       )
1044     def copy(self, factory = None):
1045       result = element.Element.copy(
1046         self,
1047         DeclarationSpecifierList if factory is None else factory
1048       )
1049       return result
1050     def __repr__(self):
1051       params = []
1052       self.repr_serialize(params)
1053       return 'ast.AST.DeclarationSpecifierList({0:s})'.format(', '.join(params))
1054     # GENERATE END
1055     def get_type(self):
1056       type_specifiers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
1057       for i in self:
1058         if isinstance(i, AST.TypeSpecifier):
1059           type_specifiers[i.n] += 1
1060       return type_specifiers_to_type[tuple(type_specifiers)]
1061
1062   class DeclaratorAbstract(Declarator):
1063     # GENERATE ELEMENT() BEGIN
1064     def __init__(
1065       self,
1066       tag = 'AST_DeclaratorAbstract',
1067       attrib = {},
1068       text = '',
1069       children = []
1070     ):
1071       AST.Declarator.__init__(
1072         self,
1073         tag,
1074         attrib,
1075         text,
1076         children
1077       )
1078     def copy(self, factory = None):
1079       result = AST.Declarator.copy(
1080         self,
1081         DeclaratorAbstract if factory is None else factory
1082       )
1083       return result
1084     def __repr__(self):
1085       params = []
1086       self.repr_serialize(params)
1087       return 'ast.AST.DeclaratorAbstract({0:s})'.format(', '.join(params))
1088     # GENERATE END
1089     def get_type_and_name(self, base_type):
1090       return base_type, ''
1091
1092   class DeclaratorArray(Declarator):
1093     # GENERATE ELEMENT() BEGIN
1094     def __init__(
1095       self,
1096       tag = 'AST_DeclaratorArray',
1097       attrib = {},
1098       text = '',
1099       children = []
1100     ):
1101       AST.Declarator.__init__(
1102         self,
1103         tag,
1104         attrib,
1105         text,
1106         children
1107       )
1108     def copy(self, factory = None):
1109       result = AST.Declarator.copy(
1110         self,
1111         DeclaratorArray if factory is None else factory
1112       )
1113       return result
1114     def __repr__(self):
1115       params = []
1116       self.repr_serialize(params)
1117       return 'ast.AST.DeclaratorArray({0:s})'.format(', '.join(params))
1118     # GENERATE END
1119     def get_type_and_name(self, base_type):
1120       return self[0].get_type_and_name(
1121         AST.TypeArray(
1122           element_type = base_type,
1123           element_count = int(
1124             element.get_text(self[2], 0),
1125             8 if element.get_text(self[2], 0)[:2] in octal_prefix else 0
1126           )
1127         )
1128       )
1129
1130   class DeclaratorEmpty(Declarator):
1131     # GENERATE ELEMENT() BEGIN
1132     def __init__(
1133       self,
1134       tag = 'AST_DeclaratorEmpty',
1135       attrib = {},
1136       text = '',
1137       children = []
1138     ):
1139       AST.Declarator.__init__(
1140         self,
1141         tag,
1142         attrib,
1143         text,
1144         children
1145       )
1146     def copy(self, factory = None):
1147       result = AST.Declarator.copy(
1148         self,
1149         DeclaratorEmpty if factory is None else factory
1150       )
1151       return result
1152     def __repr__(self):
1153       params = []
1154       self.repr_serialize(params)
1155       return 'ast.AST.DeclaratorEmpty({0:s})'.format(', '.join(params))
1156     # GENERATE END
1157
1158   class DeclaratorFunction(Declarator):
1159     # GENERATE ELEMENT(bool varargs) BEGIN
1160     def __init__(
1161       self,
1162       tag = 'AST_DeclaratorFunction',
1163       attrib = {},
1164       text = '',
1165       children = [],
1166       varargs = False
1167     ):
1168       AST.Declarator.__init__(
1169         self,
1170         tag,
1171         attrib,
1172         text,
1173         children
1174       )
1175       self.varargs = (
1176         element.deserialize_bool(varargs)
1177       if isinstance(varargs, str) else
1178         varargs
1179       )
1180     def serialize(self, ref_list):
1181       AST.Declarator.serialize(self, ref_list)
1182       self.set('varargs', element.serialize_bool(self.varargs))
1183     def deserialize(self, ref_list):
1184       AST.Declarator.deserialize(self, ref_list)
1185       self.varargs = element.deserialize_bool(self.get('varargs', 'false'))
1186     def copy(self, factory = None):
1187       result = AST.Declarator.copy(
1188         self,
1189         DeclaratorFunction if factory is None else factory
1190       )
1191       result.varargs = self.varargs
1192       return result
1193     def repr_serialize(self, params):
1194       AST.Declarator.repr_serialize(self, params)
1195       if self.varargs != False:
1196         params.append(
1197           'varargs = {0:s}'.format(repr(self.varargs))
1198         )
1199     def __repr__(self):
1200       params = []
1201       self.repr_serialize(params)
1202       return 'ast.AST.DeclaratorFunction({0:s})'.format(', '.join(params))
1203     # GENERATE END
1204     def get_type_and_name(self, base_type):
1205       children = []
1206       for i in self[1]:
1207         type, name = i[1].get_type_and_name(i[0].get_type())
1208         children.append(AST.TypeFunction.Argument(type = type, name = name))
1209       return self[0].get_type_and_name(
1210         AST.TypeFunction(
1211           children = children,
1212           return_type = base_type,
1213           varargs = self.varargs,
1214         )
1215       )
1216
1217   class DeclaratorFunctionOldStyle(Declarator):
1218     # GENERATE ELEMENT() BEGIN
1219     def __init__(
1220       self,
1221       tag = 'AST_DeclaratorFunctionOldStyle',
1222       attrib = {},
1223       text = '',
1224       children = []
1225     ):
1226       AST.Declarator.__init__(
1227         self,
1228         tag,
1229         attrib,
1230         text,
1231         children
1232       )
1233     def copy(self, factory = None):
1234       result = AST.Declarator.copy(
1235         self,
1236         DeclaratorFunctionOldStyle if factory is None else factory
1237       )
1238       return result
1239     def __repr__(self):
1240       params = []
1241       self.repr_serialize(params)
1242       return 'ast.AST.DeclaratorFunctionOldStyle({0:s})'.format(', '.join(params))
1243     # GENERATE END
1244
1245   class DeclaratorIdentifier(Declarator):
1246     # GENERATE ELEMENT() BEGIN
1247     def __init__(
1248       self,
1249       tag = 'AST_DeclaratorIdentifier',
1250       attrib = {},
1251       text = '',
1252       children = []
1253     ):
1254       AST.Declarator.__init__(
1255         self,
1256         tag,
1257         attrib,
1258         text,
1259         children
1260       )
1261     def copy(self, factory = None):
1262       result = AST.Declarator.copy(
1263         self,
1264         DeclaratorIdentifier if factory is None else factory
1265       )
1266       return result
1267     def __repr__(self):
1268       params = []
1269       self.repr_serialize(params)
1270       return 'ast.AST.DeclaratorIdentifier({0:s})'.format(', '.join(params))
1271     # GENERATE END
1272     def get_type_and_name(self, base_type):
1273       return base_type, element.get_text(self[0], 0)
1274
1275   class DeclaratorPointer(Declarator):
1276     # GENERATE ELEMENT() BEGIN
1277     def __init__(
1278       self,
1279       tag = 'AST_DeclaratorPointer',
1280       attrib = {},
1281       text = '',
1282       children = []
1283     ):
1284       AST.Declarator.__init__(
1285         self,
1286         tag,
1287         attrib,
1288         text,
1289         children
1290       )
1291     def copy(self, factory = None):
1292       result = AST.Declarator.copy(
1293         self,
1294         DeclaratorPointer if factory is None else factory
1295       )
1296       return result
1297     def __repr__(self):
1298       params = []
1299       self.repr_serialize(params)
1300       return 'ast.AST.DeclaratorPointer({0:s})'.format(', '.join(params))
1301     # GENERATE END
1302     def get_type_and_name(self, base_type):
1303       return self[1].get_type_and_name(
1304         AST.TypePointer(target_type = base_type)
1305       )
1306
1307   class DefaultTypeName(element.Element):
1308     # GENERATE ELEMENT() BEGIN
1309     def __init__(
1310       self,
1311       tag = 'AST_DefaultTypeName',
1312       attrib = {},
1313       text = '',
1314       children = []
1315     ):
1316       element.Element.__init__(
1317         self,
1318         tag,
1319         attrib,
1320         text,
1321         children
1322       )
1323     def copy(self, factory = None):
1324       result = element.Element.copy(
1325         self,
1326         DefaultTypeName if factory is None else factory
1327       )
1328       return result
1329     def __repr__(self):
1330       params = []
1331       self.repr_serialize(params)
1332       return 'ast.AST.DefaultTypeName({0:s})'.format(', '.join(params))
1333     # GENERATE END
1334
1335   class DesignatorField(element.Element):
1336     # GENERATE ELEMENT() BEGIN
1337     def __init__(
1338       self,
1339       tag = 'AST_DesignatorField',
1340       attrib = {},
1341       text = '',
1342       children = []
1343     ):
1344       element.Element.__init__(
1345         self,
1346         tag,
1347         attrib,
1348         text,
1349         children
1350       )
1351     def copy(self, factory = None):
1352       result = element.Element.copy(
1353         self,
1354         DesignatorField if factory is None else factory
1355       )
1356       return result
1357     def __repr__(self):
1358       params = []
1359       self.repr_serialize(params)
1360       return 'ast.AST.DesignatorField({0:s})'.format(', '.join(params))
1361     # GENERATE END
1362
1363   class DesignatorIndex(element.Element):
1364     # GENERATE ELEMENT() BEGIN
1365     def __init__(
1366       self,
1367       tag = 'AST_DesignatorIndex',
1368       attrib = {},
1369       text = '',
1370       children = []
1371     ):
1372       element.Element.__init__(
1373         self,
1374         tag,
1375         attrib,
1376         text,
1377         children
1378       )
1379     def copy(self, factory = None):
1380       result = element.Element.copy(
1381         self,
1382         DesignatorIndex if factory is None else factory
1383       )
1384       return result
1385     def __repr__(self):
1386       params = []
1387       self.repr_serialize(params)
1388       return 'ast.AST.DesignatorIndex({0:s})'.format(', '.join(params))
1389     # GENERATE END
1390
1391   class DesignatorInitializer(element.Element):
1392     # GENERATE ELEMENT() BEGIN
1393     def __init__(
1394       self,
1395       tag = 'AST_DesignatorInitializer',
1396       attrib = {},
1397       text = '',
1398       children = []
1399     ):
1400       element.Element.__init__(
1401         self,
1402         tag,
1403         attrib,
1404         text,
1405         children
1406       )
1407     def copy(self, factory = None):
1408       result = element.Element.copy(
1409         self,
1410         DesignatorInitializer if factory is None else factory
1411       )
1412       return result
1413     def __repr__(self):
1414       params = []
1415       self.repr_serialize(params)
1416       return 'ast.AST.DesignatorInitializer({0:s})'.format(', '.join(params))
1417     # GENERATE END
1418
1419   class DesignatorInitializerList(element.Element):
1420     # GENERATE ELEMENT() BEGIN
1421     def __init__(
1422       self,
1423       tag = 'AST_DesignatorInitializerList',
1424       attrib = {},
1425       text = '',
1426       children = []
1427     ):
1428       element.Element.__init__(
1429         self,
1430         tag,
1431         attrib,
1432         text,
1433         children
1434       )
1435     def copy(self, factory = None):
1436       result = element.Element.copy(
1437         self,
1438         DesignatorInitializerList if factory is None else factory
1439       )
1440       return result
1441     def __repr__(self):
1442       params = []
1443       self.repr_serialize(params)
1444       return 'ast.AST.DesignatorInitializerList({0:s})'.format(', '.join(params))
1445     # GENERATE END
1446
1447   class DesignatorList(element.Element):
1448     # GENERATE ELEMENT() BEGIN
1449     def __init__(
1450       self,
1451       tag = 'AST_DesignatorList',
1452       attrib = {},
1453       text = '',
1454       children = []
1455     ):
1456       element.Element.__init__(
1457         self,
1458         tag,
1459         attrib,
1460         text,
1461         children
1462       )
1463     def copy(self, factory = None):
1464       result = element.Element.copy(
1465         self,
1466         DesignatorList if factory is None else factory
1467       )
1468       return result
1469     def __repr__(self):
1470       params = []
1471       self.repr_serialize(params)
1472       return 'ast.AST.DesignatorList({0:s})'.format(', '.join(params))
1473     # GENERATE END
1474
1475   class EnumSpecifier(element.Element):
1476     # GENERATE ELEMENT() BEGIN
1477     def __init__(
1478       self,
1479       tag = 'AST_EnumSpecifier',
1480       attrib = {},
1481       text = '',
1482       children = []
1483     ):
1484       element.Element.__init__(
1485         self,
1486         tag,
1487         attrib,
1488         text,
1489         children
1490       )
1491     def copy(self, factory = None):
1492       result = element.Element.copy(
1493         self,
1494         EnumSpecifier if factory is None else factory
1495       )
1496       return result
1497     def __repr__(self):
1498       params = []
1499       self.repr_serialize(params)
1500       return 'ast.AST.EnumSpecifier({0:s})'.format(', '.join(params))
1501     # GENERATE END
1502
1503   class Enumerator(element.Element):
1504     # GENERATE ELEMENT() BEGIN
1505     def __init__(
1506       self,
1507       tag = 'AST_Enumerator',
1508       attrib = {},
1509       text = '',
1510       children = []
1511     ):
1512       element.Element.__init__(
1513         self,
1514         tag,
1515         attrib,
1516         text,
1517         children
1518       )
1519     def copy(self, factory = None):
1520       result = element.Element.copy(
1521         self,
1522         Enumerator if factory is None else factory
1523       )
1524       return result
1525     def __repr__(self):
1526       params = []
1527       self.repr_serialize(params)
1528       return 'ast.AST.Enumerator({0:s})'.format(', '.join(params))
1529     # GENERATE END
1530
1531   class EnumeratorList(element.Element):
1532     # GENERATE ELEMENT() BEGIN
1533     def __init__(
1534       self,
1535       tag = 'AST_EnumeratorList',
1536       attrib = {},
1537       text = '',
1538       children = []
1539     ):
1540       element.Element.__init__(
1541         self,
1542         tag,
1543         attrib,
1544         text,
1545         children
1546       )
1547     def copy(self, factory = None):
1548       result = element.Element.copy(
1549         self,
1550         EnumeratorList if factory is None else factory
1551       )
1552       return result
1553     def __repr__(self):
1554       params = []
1555       self.repr_serialize(params)
1556       return 'ast.AST.EnumeratorList({0:s})'.format(', '.join(params))
1557     # GENERATE END
1558
1559   class EqualsInitializerEmpty(element.Element):
1560     # GENERATE ELEMENT() BEGIN
1561     def __init__(
1562       self,
1563       tag = 'AST_EqualsInitializerEmpty',
1564       attrib = {},
1565       text = '',
1566       children = []
1567     ):
1568       element.Element.__init__(
1569         self,
1570         tag,
1571         attrib,
1572         text,
1573         children
1574       )
1575     def copy(self, factory = None):
1576       result = element.Element.copy(
1577         self,
1578         EqualsInitializerEmpty if factory is None else factory
1579       )
1580       return result
1581     def __repr__(self):
1582       params = []
1583       self.repr_serialize(params)
1584       return 'ast.AST.EqualsInitializerEmpty({0:s})'.format(', '.join(params))
1585     # GENERATE END
1586
1587   class ExpressionAdd(ExpressionBinary):
1588     # GENERATE ELEMENT() BEGIN
1589     def __init__(
1590       self,
1591       tag = 'AST_ExpressionAdd',
1592       attrib = {},
1593       text = '',
1594       children = [],
1595       binary_operator = '',
1596       precedence = -1,
1597       right_to_left = False
1598     ):
1599       AST.ExpressionBinary.__init__(
1600         self,
1601         tag,
1602         attrib,
1603         text,
1604         children,
1605         binary_operator,
1606         precedence,
1607         right_to_left
1608       )
1609     def copy(self, factory = None):
1610       result = AST.ExpressionBinary.copy(
1611         self,
1612         ExpressionAdd if factory is None else factory
1613       )
1614       return result
1615     def __repr__(self):
1616       params = []
1617       self.repr_serialize(params)
1618       return 'ast.AST.ExpressionAdd({0:s})'.format(', '.join(params))
1619     # GENERATE END
1620
1621   class ExpressionAddAssignment(ExpressionBinary):
1622     # GENERATE ELEMENT() BEGIN
1623     def __init__(
1624       self,
1625       tag = 'AST_ExpressionAddAssignment',
1626       attrib = {},
1627       text = '',
1628       children = [],
1629       binary_operator = '',
1630       precedence = -1,
1631       right_to_left = False
1632     ):
1633       AST.ExpressionBinary.__init__(
1634         self,
1635         tag,
1636         attrib,
1637         text,
1638         children,
1639         binary_operator,
1640         precedence,
1641         right_to_left
1642       )
1643     def copy(self, factory = None):
1644       result = AST.ExpressionBinary.copy(
1645         self,
1646         ExpressionAddAssignment if factory is None else factory
1647       )
1648       return result
1649     def __repr__(self):
1650       params = []
1651       self.repr_serialize(params)
1652       return 'ast.AST.ExpressionAddAssignment({0:s})'.format(', '.join(params))
1653     # GENERATE END
1654
1655   class ExpressionAddressOf(ExpressionUnary):
1656     # GENERATE ELEMENT() BEGIN
1657     def __init__(
1658       self,
1659       tag = 'AST_ExpressionAddressOf',
1660       attrib = {},
1661       text = '',
1662       children = [],
1663       unary_operator = '',
1664       postfix = False
1665     ):
1666       AST.ExpressionUnary.__init__(
1667         self,
1668         tag,
1669         attrib,
1670         text,
1671         children,
1672         unary_operator,
1673         postfix
1674       )
1675     def copy(self, factory = None):
1676       result = AST.ExpressionUnary.copy(
1677         self,
1678         ExpressionAddressOf if factory is None else factory
1679       )
1680       return result
1681     def __repr__(self):
1682       params = []
1683       self.repr_serialize(params)
1684       return 'ast.AST.ExpressionAddressOf({0:s})'.format(', '.join(params))
1685     # GENERATE END
1686
1687   class ExpressionAlignOfType(ExpressionUnary):
1688     # GENERATE ELEMENT() BEGIN
1689     def __init__(
1690       self,
1691       tag = 'AST_ExpressionAlignOfType',
1692       attrib = {},
1693       text = '',
1694       children = [],
1695       unary_operator = '',
1696       postfix = False
1697     ):
1698       AST.ExpressionUnary.__init__(
1699         self,
1700         tag,
1701         attrib,
1702         text,
1703         children,
1704         unary_operator,
1705         postfix
1706       )
1707     def copy(self, factory = None):
1708       result = AST.ExpressionUnary.copy(
1709         self,
1710         ExpressionAlignOfType if factory is None else factory
1711       )
1712       return result
1713     def __repr__(self):
1714       params = []
1715       self.repr_serialize(params)
1716       return 'ast.AST.ExpressionAlignOfType({0:s})'.format(', '.join(params))
1717     # GENERATE END
1718
1719   class ExpressionArray(Expression):
1720     # GENERATE ELEMENT() BEGIN
1721     def __init__(
1722       self,
1723       tag = 'AST_ExpressionArray',
1724       attrib = {},
1725       text = '',
1726       children = []
1727     ):
1728       AST.Expression.__init__(
1729         self,
1730         tag,
1731         attrib,
1732         text,
1733         children
1734       )
1735     def copy(self, factory = None):
1736       result = AST.Expression.copy(
1737         self,
1738         ExpressionArray if factory is None else factory
1739       )
1740       return result
1741     def __repr__(self):
1742       params = []
1743       self.repr_serialize(params)
1744       return 'ast.AST.ExpressionArray({0:s})'.format(', '.join(params))
1745     # GENERATE END
1746
1747   class ExpressionAssignment(ExpressionBinary):
1748     # GENERATE ELEMENT() BEGIN
1749     def __init__(
1750       self,
1751       tag = 'AST_ExpressionAssignment',
1752       attrib = {},
1753       text = '',
1754       children = [],
1755       binary_operator = '',
1756       precedence = -1,
1757       right_to_left = False
1758     ):
1759       AST.ExpressionBinary.__init__(
1760         self,
1761         tag,
1762         attrib,
1763         text,
1764         children,
1765         binary_operator,
1766         precedence,
1767         right_to_left
1768       )
1769     def copy(self, factory = None):
1770       result = AST.ExpressionBinary.copy(
1771         self,
1772         ExpressionAssignment if factory is None else factory
1773       )
1774       return result
1775     def __repr__(self):
1776       params = []
1777       self.repr_serialize(params)
1778       return 'ast.AST.ExpressionAssignment({0:s})'.format(', '.join(params))
1779     # GENERATE END
1780
1781   class ExpressionAsterisk(Expression):
1782     # GENERATE ELEMENT() BEGIN
1783     def __init__(
1784       self,
1785       tag = 'AST_ExpressionAsterisk',
1786       attrib = {},
1787       text = '',
1788       children = []
1789     ):
1790       AST.Expression.__init__(
1791         self,
1792         tag,
1793         attrib,
1794         text,
1795         children
1796       )
1797     def copy(self, factory = None):
1798       result = AST.Expression.copy(
1799         self,
1800         ExpressionAsterisk if factory is None else factory
1801       )
1802       return result
1803     def __repr__(self):
1804       params = []
1805       self.repr_serialize(params)
1806       return 'ast.AST.ExpressionAsterisk({0:s})'.format(', '.join(params))
1807     # GENERATE END
1808
1809   class ExpressionBitwiseAnd(ExpressionBinary):
1810     # GENERATE ELEMENT() BEGIN
1811     def __init__(
1812       self,
1813       tag = 'AST_ExpressionBitwiseAnd',
1814       attrib = {},
1815       text = '',
1816       children = [],
1817       binary_operator = '',
1818       precedence = -1,
1819       right_to_left = False
1820     ):
1821       AST.ExpressionBinary.__init__(
1822         self,
1823         tag,
1824         attrib,
1825         text,
1826         children,
1827         binary_operator,
1828         precedence,
1829         right_to_left
1830       )
1831     def copy(self, factory = None):
1832       result = AST.ExpressionBinary.copy(
1833         self,
1834         ExpressionBitwiseAnd if factory is None else factory
1835       )
1836       return result
1837     def __repr__(self):
1838       params = []
1839       self.repr_serialize(params)
1840       return 'ast.AST.ExpressionBitwiseAnd({0:s})'.format(', '.join(params))
1841     # GENERATE END
1842
1843   class ExpressionBitwiseAndAssignment(ExpressionBinary):
1844     # GENERATE ELEMENT() BEGIN
1845     def __init__(
1846       self,
1847       tag = 'AST_ExpressionBitwiseAndAssignment',
1848       attrib = {},
1849       text = '',
1850       children = [],
1851       binary_operator = '',
1852       precedence = -1,
1853       right_to_left = False
1854     ):
1855       AST.ExpressionBinary.__init__(
1856         self,
1857         tag,
1858         attrib,
1859         text,
1860         children,
1861         binary_operator,
1862         precedence,
1863         right_to_left
1864       )
1865     def copy(self, factory = None):
1866       result = AST.ExpressionBinary.copy(
1867         self,
1868         ExpressionBitwiseAndAssignment if factory is None else factory
1869       )
1870       return result
1871     def __repr__(self):
1872       params = []
1873       self.repr_serialize(params)
1874       return 'ast.AST.ExpressionBitwiseAndAssignment({0:s})'.format(', '.join(params))
1875     # GENERATE END
1876
1877   class ExpressionBitwiseNot(ExpressionUnary):
1878     # GENERATE ELEMENT() BEGIN
1879     def __init__(
1880       self,
1881       tag = 'AST_ExpressionBitwiseNot',
1882       attrib = {},
1883       text = '',
1884       children = [],
1885       unary_operator = '',
1886       postfix = False
1887     ):
1888       AST.ExpressionUnary.__init__(
1889         self,
1890         tag,
1891         attrib,
1892         text,
1893         children,
1894         unary_operator,
1895         postfix
1896       )
1897     def copy(self, factory = None):
1898       result = AST.ExpressionUnary.copy(
1899         self,
1900         ExpressionBitwiseNot if factory is None else factory
1901       )
1902       return result
1903     def __repr__(self):
1904       params = []
1905       self.repr_serialize(params)
1906       return 'ast.AST.ExpressionBitwiseNot({0:s})'.format(', '.join(params))
1907     # GENERATE END
1908
1909   class ExpressionBitwiseOr(ExpressionBinary):
1910     # GENERATE ELEMENT() BEGIN
1911     def __init__(
1912       self,
1913       tag = 'AST_ExpressionBitwiseOr',
1914       attrib = {},
1915       text = '',
1916       children = [],
1917       binary_operator = '',
1918       precedence = -1,
1919       right_to_left = False
1920     ):
1921       AST.ExpressionBinary.__init__(
1922         self,
1923         tag,
1924         attrib,
1925         text,
1926         children,
1927         binary_operator,
1928         precedence,
1929         right_to_left
1930       )
1931     def copy(self, factory = None):
1932       result = AST.ExpressionBinary.copy(
1933         self,
1934         ExpressionBitwiseOr if factory is None else factory
1935       )
1936       return result
1937     def __repr__(self):
1938       params = []
1939       self.repr_serialize(params)
1940       return 'ast.AST.ExpressionBitwiseOr({0:s})'.format(', '.join(params))
1941     # GENERATE END
1942
1943   class ExpressionBitwiseOrAssignment(ExpressionBinary):
1944     # GENERATE ELEMENT() BEGIN
1945     def __init__(
1946       self,
1947       tag = 'AST_ExpressionBitwiseOrAssignment',
1948       attrib = {},
1949       text = '',
1950       children = [],
1951       binary_operator = '',
1952       precedence = -1,
1953       right_to_left = False
1954     ):
1955       AST.ExpressionBinary.__init__(
1956         self,
1957         tag,
1958         attrib,
1959         text,
1960         children,
1961         binary_operator,
1962         precedence,
1963         right_to_left
1964       )
1965     def copy(self, factory = None):
1966       result = AST.ExpressionBinary.copy(
1967         self,
1968         ExpressionBitwiseOrAssignment if factory is None else factory
1969       )
1970       return result
1971     def __repr__(self):
1972       params = []
1973       self.repr_serialize(params)
1974       return 'ast.AST.ExpressionBitwiseOrAssignment({0:s})'.format(', '.join(params))
1975     # GENERATE END
1976
1977   class ExpressionCall(Expression):
1978     # GENERATE ELEMENT() BEGIN
1979     def __init__(
1980       self,
1981       tag = 'AST_ExpressionCall',
1982       attrib = {},
1983       text = '',
1984       children = []
1985     ):
1986       AST.Expression.__init__(
1987         self,
1988         tag,
1989         attrib,
1990         text,
1991         children
1992       )
1993     def copy(self, factory = None):
1994       result = AST.Expression.copy(
1995         self,
1996         ExpressionCall if factory is None else factory
1997       )
1998       return result
1999     def __repr__(self):
2000       params = []
2001       self.repr_serialize(params)
2002       return 'ast.AST.ExpressionCall({0:s})'.format(', '.join(params))
2003     # GENERATE END
2004     def translate_expression(self, context, precedence):
2005       text = '{0:s}({1:s})'.format(
2006         self[0].translate_expression(context, 14),
2007         ', '.join([i.translate_expression(context, 1) for i in self[1]])
2008       )
2009       if 14 < precedence:
2010         text = '({0:s})'.format(text)
2011       return text
2012
2013   class ExpressionCast(Expression):
2014     # GENERATE ELEMENT() BEGIN
2015     def __init__(
2016       self,
2017       tag = 'AST_ExpressionCast',
2018       attrib = {},
2019       text = '',
2020       children = []
2021     ):
2022       AST.Expression.__init__(
2023         self,
2024         tag,
2025         attrib,
2026         text,
2027         children
2028       )
2029     def copy(self, factory = None):
2030       result = AST.Expression.copy(
2031         self,
2032         ExpressionCast if factory is None else factory
2033       )
2034       return result
2035     def __repr__(self):
2036       params = []
2037       self.repr_serialize(params)
2038       return 'ast.AST.ExpressionCast({0:s})'.format(', '.join(params))
2039     # GENERATE END
2040     def translate_expression(self, context, precedence):
2041       type, _ = self[0][1].get_type_and_name(self[0][0].get_type())
2042       text = '{0:s}({1:s})'.format(
2043         type.translate_type(context),
2044         self[1].translate_expression(context, 0)
2045       )
2046       if 14 < precedence:
2047         text = '({0:s})'.format(text)
2048       return text
2049
2050   class ExpressionCharConstant(Expression):
2051     # GENERATE ELEMENT() BEGIN
2052     def __init__(
2053       self,
2054       tag = 'AST_ExpressionCharConstant',
2055       attrib = {},
2056       text = '',
2057       children = []
2058     ):
2059       AST.Expression.__init__(
2060         self,
2061         tag,
2062         attrib,
2063         text,
2064         children
2065       )
2066     def copy(self, factory = None):
2067       result = AST.Expression.copy(
2068         self,
2069         ExpressionCharConstant if factory is None else factory
2070       )
2071       return result
2072     def __repr__(self):
2073       params = []
2074       self.repr_serialize(params)
2075       return 'ast.AST.ExpressionCharConstant({0:s})'.format(', '.join(params))
2076     # GENERATE END
2077     def translate_expression(self, context, precedence):
2078       return 'ord(\'{0:s}\')'.format(element.get_text(self[0], 0))
2079
2080   class ExpressionComma(ExpressionBinary):
2081     # GENERATE ELEMENT() BEGIN
2082     def __init__(
2083       self,
2084       tag = 'AST_ExpressionComma',
2085       attrib = {},
2086       text = '',
2087       children = [],
2088       binary_operator = '',
2089       precedence = -1,
2090       right_to_left = False
2091     ):
2092       AST.ExpressionBinary.__init__(
2093         self,
2094         tag,
2095         attrib,
2096         text,
2097         children,
2098         binary_operator,
2099         precedence,
2100         right_to_left
2101       )
2102     def copy(self, factory = None):
2103       result = AST.ExpressionBinary.copy(
2104         self,
2105         ExpressionComma if factory is None else factory
2106       )
2107       return result
2108     def __repr__(self):
2109       params = []
2110       self.repr_serialize(params)
2111       return 'ast.AST.ExpressionComma({0:s})'.format(', '.join(params))
2112     # GENERATE END
2113
2114   class ExpressionConditional(Expression):
2115     # GENERATE ELEMENT() BEGIN
2116     def __init__(
2117       self,
2118       tag = 'AST_ExpressionConditional',
2119       attrib = {},
2120       text = '',
2121       children = []
2122     ):
2123       AST.Expression.__init__(
2124         self,
2125         tag,
2126         attrib,
2127         text,
2128         children
2129       )
2130     def copy(self, factory = None):
2131       result = AST.Expression.copy(
2132         self,
2133         ExpressionConditional if factory is None else factory
2134       )
2135       return result
2136     def __repr__(self):
2137       params = []
2138       self.repr_serialize(params)
2139       return 'ast.AST.ExpressionConditional({0:s})'.format(', '.join(params))
2140     # GENERATE END
2141     def translate_expression(self, context, precedence):
2142       text = '{0:s} if {1:s} else {2:s}'.format(
2143         self[1].translate_expression(context, 3),
2144         self[0].translate_expression(context, 0),
2145         self[2].translate_expression(context, 2)
2146       )
2147       if 2 < precedence:
2148         text = '({0:s})'.format(text)
2149       return text
2150
2151   class ExpressionDereference(ExpressionUnary):
2152     # GENERATE ELEMENT() BEGIN
2153     def __init__(
2154       self,
2155       tag = 'AST_ExpressionDereference',
2156       attrib = {},
2157       text = '',
2158       children = [],
2159       unary_operator = '',
2160       postfix = False
2161     ):
2162       AST.ExpressionUnary.__init__(
2163         self,
2164         tag,
2165         attrib,
2166         text,
2167         children,
2168         unary_operator,
2169         postfix
2170       )
2171     def copy(self, factory = None):
2172       result = AST.ExpressionUnary.copy(
2173         self,
2174         ExpressionDereference if factory is None else factory
2175       )
2176       return result
2177     def __repr__(self):
2178       params = []
2179       self.repr_serialize(params)
2180       return 'ast.AST.ExpressionDereference({0:s})'.format(', '.join(params))
2181     # GENERATE END
2182
2183   class ExpressionDivide(ExpressionBinary):
2184     # GENERATE ELEMENT() BEGIN
2185     def __init__(
2186       self,
2187       tag = 'AST_ExpressionDivide',
2188       attrib = {},
2189       text = '',
2190       children = [],
2191       binary_operator = '',
2192       precedence = -1,
2193       right_to_left = False
2194     ):
2195       AST.ExpressionBinary.__init__(
2196         self,
2197         tag,
2198         attrib,
2199         text,
2200         children,
2201         binary_operator,
2202         precedence,
2203         right_to_left
2204       )
2205     def copy(self, factory = None):
2206       result = AST.ExpressionBinary.copy(
2207         self,
2208         ExpressionDivide if factory is None else factory
2209       )
2210       return result
2211     def __repr__(self):
2212       params = []
2213       self.repr_serialize(params)
2214       return 'ast.AST.ExpressionDivide({0:s})'.format(', '.join(params))
2215     # GENERATE END
2216
2217   class ExpressionDivideAssignment(ExpressionBinary):
2218     # GENERATE ELEMENT() BEGIN
2219     def __init__(
2220       self,
2221       tag = 'AST_ExpressionDivideAssignment',
2222       attrib = {},
2223       text = '',
2224       children = [],
2225       binary_operator = '',
2226       precedence = -1,
2227       right_to_left = False
2228     ):
2229       AST.ExpressionBinary.__init__(
2230         self,
2231         tag,
2232         attrib,
2233         text,
2234         children,
2235         binary_operator,
2236         precedence,
2237         right_to_left
2238       )
2239     def copy(self, factory = None):
2240       result = AST.ExpressionBinary.copy(
2241         self,
2242         ExpressionDivideAssignment if factory is None else factory
2243       )
2244       return result
2245     def __repr__(self):
2246       params = []
2247       self.repr_serialize(params)
2248       return 'ast.AST.ExpressionDivideAssignment({0:s})'.format(', '.join(params))
2249     # GENERATE END
2250
2251   class ExpressionEmpty(Expression):
2252     # GENERATE ELEMENT() BEGIN
2253     def __init__(
2254       self,
2255       tag = 'AST_ExpressionEmpty',
2256       attrib = {},
2257       text = '',
2258       children = []
2259     ):
2260       AST.Expression.__init__(
2261         self,
2262         tag,
2263         attrib,
2264         text,
2265         children
2266       )
2267     def copy(self, factory = None):
2268       result = AST.Expression.copy(
2269         self,
2270         ExpressionEmpty if factory is None else factory
2271       )
2272       return result
2273     def __repr__(self):
2274       params = []
2275       self.repr_serialize(params)
2276       return 'ast.AST.ExpressionEmpty({0:s})'.format(', '.join(params))
2277     # GENERATE END
2278     def translate_expression(self, context, precedence):
2279       return 'True'
2280     def translate_statement_expression(self, context):
2281       return 'pass'
2282
2283   class ExpressionEqual(ExpressionBinary):
2284     # GENERATE ELEMENT() BEGIN
2285     def __init__(
2286       self,
2287       tag = 'AST_ExpressionEqual',
2288       attrib = {},
2289       text = '',
2290       children = [],
2291       binary_operator = '',
2292       precedence = -1,
2293       right_to_left = False
2294     ):
2295       AST.ExpressionBinary.__init__(
2296         self,
2297         tag,
2298         attrib,
2299         text,
2300         children,
2301         binary_operator,
2302         precedence,
2303         right_to_left
2304       )
2305     def copy(self, factory = None):
2306       result = AST.ExpressionBinary.copy(
2307         self,
2308         ExpressionEqual if factory is None else factory
2309       )
2310       return result
2311     def __repr__(self):
2312       params = []
2313       self.repr_serialize(params)
2314       return 'ast.AST.ExpressionEqual({0:s})'.format(', '.join(params))
2315     # GENERATE END
2316
2317   class ExpressionExclusiveOr(ExpressionBinary):
2318     # GENERATE ELEMENT() BEGIN
2319     def __init__(
2320       self,
2321       tag = 'AST_ExpressionExclusiveOr',
2322       attrib = {},
2323       text = '',
2324       children = [],
2325       binary_operator = '',
2326       precedence = -1,
2327       right_to_left = False
2328     ):
2329       AST.ExpressionBinary.__init__(
2330         self,
2331         tag,
2332         attrib,
2333         text,
2334         children,
2335         binary_operator,
2336         precedence,
2337         right_to_left
2338       )
2339     def copy(self, factory = None):
2340       result = AST.ExpressionBinary.copy(
2341         self,
2342         ExpressionExclusiveOr if factory is None else factory
2343       )
2344       return result
2345     def __repr__(self):
2346       params = []
2347       self.repr_serialize(params)
2348       return 'ast.AST.ExpressionExclusiveOr({0:s})'.format(', '.join(params))
2349     # GENERATE END
2350
2351   class ExpressionExclusiveOrAssignment(ExpressionBinary):
2352     # GENERATE ELEMENT() BEGIN
2353     def __init__(
2354       self,
2355       tag = 'AST_ExpressionExclusiveOrAssignment',
2356       attrib = {},
2357       text = '',
2358       children = [],
2359       binary_operator = '',
2360       precedence = -1,
2361       right_to_left = False
2362     ):
2363       AST.ExpressionBinary.__init__(
2364         self,
2365         tag,
2366         attrib,
2367         text,
2368         children,
2369         binary_operator,
2370         precedence,
2371         right_to_left
2372       )
2373     def copy(self, factory = None):
2374       result = AST.ExpressionBinary.copy(
2375         self,
2376         ExpressionExclusiveOrAssignment if factory is None else factory
2377       )
2378       return result
2379     def __repr__(self):
2380       params = []
2381       self.repr_serialize(params)
2382       return 'ast.AST.ExpressionExclusiveOrAssignment({0:s})'.format(', '.join(params))
2383     # GENERATE END
2384
2385   class ExpressionField(Expression):
2386     # GENERATE ELEMENT() BEGIN
2387     def __init__(
2388       self,
2389       tag = 'AST_ExpressionField',
2390       attrib = {},
2391       text = '',
2392       children = []
2393     ):
2394       AST.Expression.__init__(
2395         self,
2396         tag,
2397         attrib,
2398         text,
2399         children
2400       )
2401     def copy(self, factory = None):
2402       result = AST.Expression.copy(
2403         self,
2404         ExpressionField if factory is None else factory
2405       )
2406       return result
2407     def __repr__(self):
2408       params = []
2409       self.repr_serialize(params)
2410       return 'ast.AST.ExpressionField({0:s})'.format(', '.join(params))
2411     # GENERATE END
2412     def translate_expression(self, context, precedence):
2413       text = '{0:s}.{1:s}'.format(
2414         self[0].translate_expression(context, 14),
2415         self[1].translate_identifier(context)
2416       )
2417       if 14 < precedence:
2418         text = '({0:s})'.format(text)
2419       return text
2420
2421   class ExpressionFieldDereference(Expression):
2422     # GENERATE ELEMENT() BEGIN
2423     def __init__(
2424       self,
2425       tag = 'AST_ExpressionFieldDereference',
2426       attrib = {},
2427       text = '',
2428       children = []
2429     ):
2430       AST.Expression.__init__(
2431         self,
2432         tag,
2433         attrib,
2434         text,
2435         children
2436       )
2437     def copy(self, factory = None):
2438       result = AST.Expression.copy(
2439         self,
2440         ExpressionFieldDereference if factory is None else factory
2441       )
2442       return result
2443     def __repr__(self):
2444       params = []
2445       self.repr_serialize(params)
2446       return 'ast.AST.ExpressionFieldDereference({0:s})'.format(', '.join(params))
2447     # GENERATE END
2448     def translate_expression(self, context, precedence):
2449       text = '{0:s}->{1:s}'.format(
2450         self[0].translate_expression(context, 14),
2451         self[1].translate_identifier(context)
2452       )
2453       if 14 < precedence:
2454         text = '({0:s})'.format(text)
2455       return text
2456
2457   class ExpressionFloatLiteral(Expression):
2458     # GENERATE ELEMENT() BEGIN
2459     def __init__(
2460       self,
2461       tag = 'AST_ExpressionFloatLiteral',
2462       attrib = {},
2463       text = '',
2464       children = []
2465     ):
2466       AST.Expression.__init__(
2467         self,
2468         tag,
2469         attrib,
2470         text,
2471         children
2472       )
2473     def copy(self, factory = None):
2474       result = AST.Expression.copy(
2475         self,
2476         ExpressionFloatLiteral if factory is None else factory
2477       )
2478       return result
2479     def __repr__(self):
2480       params = []
2481       self.repr_serialize(params)
2482       return 'ast.AST.ExpressionFloatLiteral({0:s})'.format(', '.join(params))
2483     # GENERATE END
2484
2485   class ExpressionFunctionName(Expression):
2486     # GENERATE ELEMENT() BEGIN
2487     def __init__(
2488       self,
2489       tag = 'AST_ExpressionFunctionName',
2490       attrib = {},
2491       text = '',
2492       children = []
2493     ):
2494       AST.Expression.__init__(
2495         self,
2496         tag,
2497         attrib,
2498         text,
2499         children
2500       )
2501     def copy(self, factory = None):
2502       result = AST.Expression.copy(
2503         self,
2504         ExpressionFunctionName if factory is None else factory
2505       )
2506       return result
2507     def __repr__(self):
2508       params = []
2509       self.repr_serialize(params)
2510       return 'ast.AST.ExpressionFunctionName({0:s})'.format(', '.join(params))
2511     # GENERATE END
2512
2513   class ExpressionGreaterThan(ExpressionBinary):
2514     # GENERATE ELEMENT() BEGIN
2515     def __init__(
2516       self,
2517       tag = 'AST_ExpressionGreaterThan',
2518       attrib = {},
2519       text = '',
2520       children = [],
2521       binary_operator = '',
2522       precedence = -1,
2523       right_to_left = False
2524     ):
2525       AST.ExpressionBinary.__init__(
2526         self,
2527         tag,
2528         attrib,
2529         text,
2530         children,
2531         binary_operator,
2532         precedence,
2533         right_to_left
2534       )
2535     def copy(self, factory = None):
2536       result = AST.ExpressionBinary.copy(
2537         self,
2538         ExpressionGreaterThan if factory is None else factory
2539       )
2540       return result
2541     def __repr__(self):
2542       params = []
2543       self.repr_serialize(params)
2544       return 'ast.AST.ExpressionGreaterThan({0:s})'.format(', '.join(params))
2545     # GENERATE END
2546
2547   class ExpressionGreaterThanOrEqual(ExpressionBinary):
2548     # GENERATE ELEMENT() BEGIN
2549     def __init__(
2550       self,
2551       tag = 'AST_ExpressionGreaterThanOrEqual',
2552       attrib = {},
2553       text = '',
2554       children = [],
2555       binary_operator = '',
2556       precedence = -1,
2557       right_to_left = False
2558     ):
2559       AST.ExpressionBinary.__init__(
2560         self,
2561         tag,
2562         attrib,
2563         text,
2564         children,
2565         binary_operator,
2566         precedence,
2567         right_to_left
2568       )
2569     def copy(self, factory = None):
2570       result = AST.ExpressionBinary.copy(
2571         self,
2572         ExpressionGreaterThanOrEqual if factory is None else factory
2573       )
2574       return result
2575     def __repr__(self):
2576       params = []
2577       self.repr_serialize(params)
2578       return 'ast.AST.ExpressionGreaterThanOrEqual({0:s})'.format(', '.join(params))
2579     # GENERATE END
2580
2581   class ExpressionIdentifier(Expression):
2582     # GENERATE ELEMENT() BEGIN
2583     def __init__(
2584       self,
2585       tag = 'AST_ExpressionIdentifier',
2586       attrib = {},
2587       text = '',
2588       children = []
2589     ):
2590       AST.Expression.__init__(
2591         self,
2592         tag,
2593         attrib,
2594         text,
2595         children
2596       )
2597     def copy(self, factory = None):
2598       result = AST.Expression.copy(
2599         self,
2600         ExpressionIdentifier if factory is None else factory
2601       )
2602       return result
2603     def __repr__(self):
2604       params = []
2605       self.repr_serialize(params)
2606       return 'ast.AST.ExpressionIdentifier({0:s})'.format(', '.join(params))
2607     # GENERATE END
2608     def translate_expression(self, context, precedence):
2609       return self[0].translate_identifier(context)
2610
2611   class ExpressionIndex(Expression):
2612     # GENERATE ELEMENT() BEGIN
2613     def __init__(
2614       self,
2615       tag = 'AST_ExpressionIndex',
2616       attrib = {},
2617       text = '',
2618       children = []
2619     ):
2620       AST.Expression.__init__(
2621         self,
2622         tag,
2623         attrib,
2624         text,
2625         children
2626       )
2627     def copy(self, factory = None):
2628       result = AST.Expression.copy(
2629         self,
2630         ExpressionIndex if factory is None else factory
2631       )
2632       return result
2633     def __repr__(self):
2634       params = []
2635       self.repr_serialize(params)
2636       return 'ast.AST.ExpressionIndex({0:s})'.format(', '.join(params))
2637     # GENERATE END
2638     def translate_expression(self, context, precedence):
2639       text = '{0:s}[{1:s}]'.format(
2640         self[0].translate_expression(context, 14),
2641         self[1].translate_expression(context, 0)
2642       )
2643       if 14 < precedence:
2644         text = '({0:s})'.format(text)
2645       return text
2646
2647   class ExpressionIntLiteral(Expression):
2648     # GENERATE ELEMENT() BEGIN
2649     def __init__(
2650       self,
2651       tag = 'AST_ExpressionIntLiteral',
2652       attrib = {},
2653       text = '',
2654       children = []
2655     ):
2656       AST.Expression.__init__(
2657         self,
2658         tag,
2659         attrib,
2660         text,
2661         children
2662       )
2663     def copy(self, factory = None):
2664       result = AST.Expression.copy(
2665         self,
2666         ExpressionIntLiteral if factory is None else factory
2667       )
2668       return result
2669     def __repr__(self):
2670       params = []
2671       self.repr_serialize(params)
2672       return 'ast.AST.ExpressionIntLiteral({0:s})'.format(', '.join(params))
2673     # GENERATE END
2674     def translate_expression(self, context, precedence):
2675       text = element.get_text(self, 0)
2676       if text[:2] in octal_prefix:
2677         text = '0o' + text[1:]
2678       return text
2679
2680   class Identifier(element.Element):
2681     # GENERATE ELEMENT() BEGIN
2682     def __init__(
2683       self,
2684       tag = 'AST_Identifier',
2685       attrib = {},
2686       text = '',
2687       children = []
2688     ):
2689       element.Element.__init__(
2690         self,
2691         tag,
2692         attrib,
2693         text,
2694         children
2695       )
2696     def copy(self, factory = None):
2697       result = element.Element.copy(
2698         self,
2699         Identifier if factory is None else factory
2700       )
2701       return result
2702     def __repr__(self):
2703       params = []
2704       self.repr_serialize(params)
2705       return 'ast.AST.Identifier({0:s})'.format(', '.join(params))
2706     # GENERATE END
2707     def translate_identifier(self, context):
2708       text = element.get_text(self, 0)
2709       return context.translate_identifier.get(text, text)
2710
2711   class ExpressionLeftShiftAssignment(ExpressionBinary):
2712     # GENERATE ELEMENT() BEGIN
2713     def __init__(
2714       self,
2715       tag = 'AST_ExpressionLeftShiftAssignment',
2716       attrib = {},
2717       text = '',
2718       children = [],
2719       binary_operator = '',
2720       precedence = -1,
2721       right_to_left = False
2722     ):
2723       AST.ExpressionBinary.__init__(
2724         self,
2725         tag,
2726         attrib,
2727         text,
2728         children,
2729         binary_operator,
2730         precedence,
2731         right_to_left
2732       )
2733     def copy(self, factory = None):
2734       result = AST.ExpressionBinary.copy(
2735         self,
2736         ExpressionLeftShiftAssignment if factory is None else factory
2737       )
2738       return result
2739     def __repr__(self):
2740       params = []
2741       self.repr_serialize(params)
2742       return 'ast.AST.ExpressionLeftShiftAssignment({0:s})'.format(', '.join(params))
2743     # GENERATE END
2744
2745   class ExpressionLessThan(ExpressionBinary):
2746     # GENERATE ELEMENT() BEGIN
2747     def __init__(
2748       self,
2749       tag = 'AST_ExpressionLessThan',
2750       attrib = {},
2751       text = '',
2752       children = [],
2753       binary_operator = '',
2754       precedence = -1,
2755       right_to_left = False
2756     ):
2757       AST.ExpressionBinary.__init__(
2758         self,
2759         tag,
2760         attrib,
2761         text,
2762         children,
2763         binary_operator,
2764         precedence,
2765         right_to_left
2766       )
2767     def copy(self, factory = None):
2768       result = AST.ExpressionBinary.copy(
2769         self,
2770         ExpressionLessThan if factory is None else factory
2771       )
2772       return result
2773     def __repr__(self):
2774       params = []
2775       self.repr_serialize(params)
2776       return 'ast.AST.ExpressionLessThan({0:s})'.format(', '.join(params))
2777     # GENERATE END
2778
2779   class ExpressionLessThanOrEqual(ExpressionBinary):
2780     # GENERATE ELEMENT() BEGIN
2781     def __init__(
2782       self,
2783       tag = 'AST_ExpressionLessThanOrEqual',
2784       attrib = {},
2785       text = '',
2786       children = [],
2787       binary_operator = '',
2788       precedence = -1,
2789       right_to_left = False
2790     ):
2791       AST.ExpressionBinary.__init__(
2792         self,
2793         tag,
2794         attrib,
2795         text,
2796         children,
2797         binary_operator,
2798         precedence,
2799         right_to_left
2800       )
2801     def copy(self, factory = None):
2802       result = AST.ExpressionBinary.copy(
2803         self,
2804         ExpressionLessThanOrEqual if factory is None else factory
2805       )
2806       return result
2807     def __repr__(self):
2808       params = []
2809       self.repr_serialize(params)
2810       return 'ast.AST.ExpressionLessThanOrEqual({0:s})'.format(', '.join(params))
2811     # GENERATE END
2812
2813   class ExpressionLogicalAnd(ExpressionBinary):
2814     # GENERATE ELEMENT() BEGIN
2815     def __init__(
2816       self,
2817       tag = 'AST_ExpressionLogicalAnd',
2818       attrib = {},
2819       text = '',
2820       children = [],
2821       binary_operator = '',
2822       precedence = -1,
2823       right_to_left = False
2824     ):
2825       AST.ExpressionBinary.__init__(
2826         self,
2827         tag,
2828         attrib,
2829         text,
2830         children,
2831         binary_operator,
2832         precedence,
2833         right_to_left
2834       )
2835     def copy(self, factory = None):
2836       result = AST.ExpressionBinary.copy(
2837         self,
2838         ExpressionLogicalAnd if factory is None else factory
2839       )
2840       return result
2841     def __repr__(self):
2842       params = []
2843       self.repr_serialize(params)
2844       return 'ast.AST.ExpressionLogicalAnd({0:s})'.format(', '.join(params))
2845     # GENERATE END
2846
2847   class ExpressionLogicalNot(ExpressionUnary):
2848     # GENERATE ELEMENT() BEGIN
2849     def __init__(
2850       self,
2851       tag = 'AST_ExpressionLogicalNot',
2852       attrib = {},
2853       text = '',
2854       children = [],
2855       unary_operator = '',
2856       postfix = False
2857     ):
2858       AST.ExpressionUnary.__init__(
2859         self,
2860         tag,
2861         attrib,
2862         text,
2863         children,
2864         unary_operator,
2865         postfix
2866       )
2867     def copy(self, factory = None):
2868       result = AST.ExpressionUnary.copy(
2869         self,
2870         ExpressionLogicalNot if factory is None else factory
2871       )
2872       return result
2873     def __repr__(self):
2874       params = []
2875       self.repr_serialize(params)
2876       return 'ast.AST.ExpressionLogicalNot({0:s})'.format(', '.join(params))
2877     # GENERATE END
2878
2879   class ExpressionLogicalOr(ExpressionBinary):
2880     # GENERATE ELEMENT() BEGIN
2881     def __init__(
2882       self,
2883       tag = 'AST_ExpressionLogicalOr',
2884       attrib = {},
2885       text = '',
2886       children = [],
2887       binary_operator = '',
2888       precedence = -1,
2889       right_to_left = False
2890     ):
2891       AST.ExpressionBinary.__init__(
2892         self,
2893         tag,
2894         attrib,
2895         text,
2896         children,
2897         binary_operator,
2898         precedence,
2899         right_to_left
2900       )
2901     def copy(self, factory = None):
2902       result = AST.ExpressionBinary.copy(
2903         self,
2904         ExpressionLogicalOr if factory is None else factory
2905       )
2906       return result
2907     def __repr__(self):
2908       params = []
2909       self.repr_serialize(params)
2910       return 'ast.AST.ExpressionLogicalOr({0:s})'.format(', '.join(params))
2911     # GENERATE END
2912
2913   class ExpressionMinus(ExpressionUnary):
2914     # GENERATE ELEMENT() BEGIN
2915     def __init__(
2916       self,
2917       tag = 'AST_ExpressionMinus',
2918       attrib = {},
2919       text = '',
2920       children = [],
2921       unary_operator = '',
2922       postfix = False
2923     ):
2924       AST.ExpressionUnary.__init__(
2925         self,
2926         tag,
2927         attrib,
2928         text,
2929         children,
2930         unary_operator,
2931         postfix
2932       )
2933     def copy(self, factory = None):
2934       result = AST.ExpressionUnary.copy(
2935         self,
2936         ExpressionMinus if factory is None else factory
2937       )
2938       return result
2939     def __repr__(self):
2940       params = []
2941       self.repr_serialize(params)
2942       return 'ast.AST.ExpressionMinus({0:s})'.format(', '.join(params))
2943     # GENERATE END
2944
2945   class ExpressionModulo(ExpressionBinary):
2946     # GENERATE ELEMENT() BEGIN
2947     def __init__(
2948       self,
2949       tag = 'AST_ExpressionModulo',
2950       attrib = {},
2951       text = '',
2952       children = [],
2953       binary_operator = '',
2954       precedence = -1,
2955       right_to_left = False
2956     ):
2957       AST.ExpressionBinary.__init__(
2958         self,
2959         tag,
2960         attrib,
2961         text,
2962         children,
2963         binary_operator,
2964         precedence,
2965         right_to_left
2966       )
2967     def copy(self, factory = None):
2968       result = AST.ExpressionBinary.copy(
2969         self,
2970         ExpressionModulo if factory is None else factory
2971       )
2972       return result
2973     def __repr__(self):
2974       params = []
2975       self.repr_serialize(params)
2976       return 'ast.AST.ExpressionModulo({0:s})'.format(', '.join(params))
2977     # GENERATE END
2978
2979   class ExpressionModuloAssignment(ExpressionBinary):
2980     # GENERATE ELEMENT() BEGIN
2981     def __init__(
2982       self,
2983       tag = 'AST_ExpressionModuloAssignment',
2984       attrib = {},
2985       text = '',
2986       children = [],
2987       binary_operator = '',
2988       precedence = -1,
2989       right_to_left = False
2990     ):
2991       AST.ExpressionBinary.__init__(
2992         self,
2993         tag,
2994         attrib,
2995         text,
2996         children,
2997         binary_operator,
2998         precedence,
2999         right_to_left
3000       )
3001     def copy(self, factory = None):
3002       result = AST.ExpressionBinary.copy(
3003         self,
3004         ExpressionModuloAssignment if factory is None else factory
3005       )
3006       return result
3007     def __repr__(self):
3008       params = []
3009       self.repr_serialize(params)
3010       return 'ast.AST.ExpressionModuloAssignment({0:s})'.format(', '.join(params))
3011     # GENERATE END
3012
3013   class ExpressionMultiply(ExpressionBinary):
3014     # GENERATE ELEMENT() BEGIN
3015     def __init__(
3016       self,
3017       tag = 'AST_ExpressionMultiply',
3018       attrib = {},
3019       text = '',
3020       children = [],
3021       binary_operator = '',
3022       precedence = -1,
3023       right_to_left = False
3024     ):
3025       AST.ExpressionBinary.__init__(
3026         self,
3027         tag,
3028         attrib,
3029         text,
3030         children,
3031         binary_operator,
3032         precedence,
3033         right_to_left
3034       )
3035     def copy(self, factory = None):
3036       result = AST.ExpressionBinary.copy(
3037         self,
3038         ExpressionMultiply if factory is None else factory
3039       )
3040       return result
3041     def __repr__(self):
3042       params = []
3043       self.repr_serialize(params)
3044       return 'ast.AST.ExpressionMultiply({0:s})'.format(', '.join(params))
3045     # GENERATE END
3046
3047   class ExpressionMultiplyAssignment(ExpressionBinary):
3048     # GENERATE ELEMENT() BEGIN
3049     def __init__(
3050       self,
3051       tag = 'AST_ExpressionMultiplyAssignment',
3052       attrib = {},
3053       text = '',
3054       children = [],
3055       binary_operator = '',
3056       precedence = -1,
3057       right_to_left = False
3058     ):
3059       AST.ExpressionBinary.__init__(
3060         self,
3061         tag,
3062         attrib,
3063         text,
3064         children,
3065         binary_operator,
3066         precedence,
3067         right_to_left
3068       )
3069     def copy(self, factory = None):
3070       result = AST.ExpressionBinary.copy(
3071         self,
3072         ExpressionMultiplyAssignment if factory is None else factory
3073       )
3074       return result
3075     def __repr__(self):
3076       params = []
3077       self.repr_serialize(params)
3078       return 'ast.AST.ExpressionMultiplyAssignment({0:s})'.format(', '.join(params))
3079     # GENERATE END
3080
3081   class ExpressionNotEqual(ExpressionBinary):
3082     # GENERATE ELEMENT() BEGIN
3083     def __init__(
3084       self,
3085       tag = 'AST_ExpressionNotEqual',
3086       attrib = {},
3087       text = '',
3088       children = [],
3089       binary_operator = '',
3090       precedence = -1,
3091       right_to_left = False
3092     ):
3093       AST.ExpressionBinary.__init__(
3094         self,
3095         tag,
3096         attrib,
3097         text,
3098         children,
3099         binary_operator,
3100         precedence,
3101         right_to_left
3102       )
3103     def copy(self, factory = None):
3104       result = AST.ExpressionBinary.copy(
3105         self,
3106         ExpressionNotEqual if factory is None else factory
3107       )
3108       return result
3109     def __repr__(self):
3110       params = []
3111       self.repr_serialize(params)
3112       return 'ast.AST.ExpressionNotEqual({0:s})'.format(', '.join(params))
3113     # GENERATE END
3114
3115   class ExpressionPlus(ExpressionUnary):
3116     # GENERATE ELEMENT() BEGIN
3117     def __init__(
3118       self,
3119       tag = 'AST_ExpressionPlus',
3120       attrib = {},
3121       text = '',
3122       children = [],
3123       unary_operator = '',
3124       postfix = False
3125     ):
3126       AST.ExpressionUnary.__init__(
3127         self,
3128         tag,
3129         attrib,
3130         text,
3131         children,
3132         unary_operator,
3133         postfix
3134       )
3135     def copy(self, factory = None):
3136       result = AST.ExpressionUnary.copy(
3137         self,
3138         ExpressionPlus if factory is None else factory
3139       )
3140       return result
3141     def __repr__(self):
3142       params = []
3143       self.repr_serialize(params)
3144       return 'ast.AST.ExpressionPlus({0:s})'.format(', '.join(params))
3145     # GENERATE END
3146
3147   class ExpressionPostDecrement(ExpressionUnary):
3148     # GENERATE ELEMENT() BEGIN
3149     def __init__(
3150       self,
3151       tag = 'AST_ExpressionPostDecrement',
3152       attrib = {},
3153       text = '',
3154       children = [],
3155       unary_operator = '',
3156       postfix = False
3157     ):
3158       AST.ExpressionUnary.__init__(
3159         self,
3160         tag,
3161         attrib,
3162         text,
3163         children,
3164         unary_operator,
3165         postfix
3166       )
3167     def copy(self, factory = None):
3168       result = AST.ExpressionUnary.copy(
3169         self,
3170         ExpressionPostDecrement if factory is None else factory
3171       )
3172       return result
3173     def __repr__(self):
3174       params = []
3175       self.repr_serialize(params)
3176       return 'ast.AST.ExpressionPostDecrement({0:s})'.format(', '.join(params))
3177     # GENERATE END
3178     def translate_statement_expression(self, context):
3179       return '{0:s} -= 1'.format(self[0].translate_expression(context, 0))
3180
3181   class ExpressionPostIncrement(ExpressionUnary):
3182     # GENERATE ELEMENT() BEGIN
3183     def __init__(
3184       self,
3185       tag = 'AST_ExpressionPostIncrement',
3186       attrib = {},
3187       text = '',
3188       children = [],
3189       unary_operator = '',
3190       postfix = False
3191     ):
3192       AST.ExpressionUnary.__init__(
3193         self,
3194         tag,
3195         attrib,
3196         text,
3197         children,
3198         unary_operator,
3199         postfix
3200       )
3201     def copy(self, factory = None):
3202       result = AST.ExpressionUnary.copy(
3203         self,
3204         ExpressionPostIncrement if factory is None else factory
3205       )
3206       return result
3207     def __repr__(self):
3208       params = []
3209       self.repr_serialize(params)
3210       return 'ast.AST.ExpressionPostIncrement({0:s})'.format(', '.join(params))
3211     # GENERATE END
3212     def translate_statement_expression(self, context):
3213       return '{0:s} += 1'.format(self[0].translate_expression(context, 0))
3214
3215   class ExpressionPreDecrement(ExpressionUnary):
3216     # GENERATE ELEMENT() BEGIN
3217     def __init__(
3218       self,
3219       tag = 'AST_ExpressionPreDecrement',
3220       attrib = {},
3221       text = '',
3222       children = [],
3223       unary_operator = '',
3224       postfix = False
3225     ):
3226       AST.ExpressionUnary.__init__(
3227         self,
3228         tag,
3229         attrib,
3230         text,
3231         children,
3232         unary_operator,
3233         postfix
3234       )
3235     def copy(self, factory = None):
3236       result = AST.ExpressionUnary.copy(
3237         self,
3238         ExpressionPreDecrement if factory is None else factory
3239       )
3240       return result
3241     def __repr__(self):
3242       params = []
3243       self.repr_serialize(params)
3244       return 'ast.AST.ExpressionPreDecrement({0:s})'.format(', '.join(params))
3245     # GENERATE END
3246     def translate_statement_expression(self, context):
3247       return '{0:s} -= 1'.format(self[0].translate_expression(context, 0))
3248
3249   class ExpressionPreIncrement(ExpressionUnary):
3250     # GENERATE ELEMENT() BEGIN
3251     def __init__(
3252       self,
3253       tag = 'AST_ExpressionPreIncrement',
3254       attrib = {},
3255       text = '',
3256       children = [],
3257       unary_operator = '',
3258       postfix = False
3259     ):
3260       AST.ExpressionUnary.__init__(
3261         self,
3262         tag,
3263         attrib,
3264         text,
3265         children,
3266         unary_operator,
3267         postfix
3268       )
3269     def copy(self, factory = None):
3270       result = AST.ExpressionUnary.copy(
3271         self,
3272         ExpressionPreIncrement if factory is None else factory
3273       )
3274       return result
3275     def __repr__(self):
3276       params = []
3277       self.repr_serialize(params)
3278       return 'ast.AST.ExpressionPreIncrement({0:s})'.format(', '.join(params))
3279     # GENERATE END
3280     def translate_statement_expression(self, context):
3281       return '{0:s} += 1'.format(self[0].translate_expression(context, 0))
3282
3283   class ExpressionRightShiftAssignment(ExpressionBinary):
3284     # GENERATE ELEMENT() BEGIN
3285     def __init__(
3286       self,
3287       tag = 'AST_ExpressionRightShiftAssignment',
3288       attrib = {},
3289       text = '',
3290       children = [],
3291       binary_operator = '',
3292       precedence = -1,
3293       right_to_left = False
3294     ):
3295       AST.ExpressionBinary.__init__(
3296         self,
3297         tag,
3298         attrib,
3299         text,
3300         children,
3301         binary_operator,
3302         precedence,
3303         right_to_left
3304       )
3305     def copy(self, factory = None):
3306       result = AST.ExpressionBinary.copy(
3307         self,
3308         ExpressionRightShiftAssignment if factory is None else factory
3309       )
3310       return result
3311     def __repr__(self):
3312       params = []
3313       self.repr_serialize(params)
3314       return 'ast.AST.ExpressionRightShiftAssignment({0:s})'.format(', '.join(params))
3315     # GENERATE END
3316
3317   class ExpressionShiftLeft(ExpressionBinary):
3318     # GENERATE ELEMENT() BEGIN
3319     def __init__(
3320       self,
3321       tag = 'AST_ExpressionShiftLeft',
3322       attrib = {},
3323       text = '',
3324       children = [],
3325       binary_operator = '',
3326       precedence = -1,
3327       right_to_left = False
3328     ):
3329       AST.ExpressionBinary.__init__(
3330         self,
3331         tag,
3332         attrib,
3333         text,
3334         children,
3335         binary_operator,
3336         precedence,
3337         right_to_left
3338       )
3339     def copy(self, factory = None):
3340       result = AST.ExpressionBinary.copy(
3341         self,
3342         ExpressionShiftLeft if factory is None else factory
3343       )
3344       return result
3345     def __repr__(self):
3346       params = []
3347       self.repr_serialize(params)
3348       return 'ast.AST.ExpressionShiftLeft({0:s})'.format(', '.join(params))
3349     # GENERATE END
3350
3351   class ExpressionShiftRight(ExpressionBinary):
3352     # GENERATE ELEMENT() BEGIN
3353     def __init__(
3354       self,
3355       tag = 'AST_ExpressionShiftRight',
3356       attrib = {},
3357       text = '',
3358       children = [],
3359       binary_operator = '',
3360       precedence = -1,
3361       right_to_left = False
3362     ):
3363       AST.ExpressionBinary.__init__(
3364         self,
3365         tag,
3366         attrib,
3367         text,
3368         children,
3369         binary_operator,
3370         precedence,
3371         right_to_left
3372       )
3373     def copy(self, factory = None):
3374       result = AST.ExpressionBinary.copy(
3375         self,
3376         ExpressionShiftRight if factory is None else factory
3377       )
3378       return result
3379     def __repr__(self):
3380       params = []
3381       self.repr_serialize(params)
3382       return 'ast.AST.ExpressionShiftRight({0:s})'.format(', '.join(params))
3383     # GENERATE END
3384
3385   class ExpressionSizeOfExpression(ExpressionUnary):
3386     # GENERATE ELEMENT() BEGIN
3387     def __init__(
3388       self,
3389       tag = 'AST_ExpressionSizeOfExpression',
3390       attrib = {},
3391       text = '',
3392       children = [],
3393       unary_operator = '',
3394       postfix = False
3395     ):
3396       AST.ExpressionUnary.__init__(
3397         self,
3398         tag,
3399         attrib,
3400         text,
3401         children,
3402         unary_operator,
3403         postfix
3404       )
3405     def copy(self, factory = None):
3406       result = AST.ExpressionUnary.copy(
3407         self,
3408         ExpressionSizeOfExpression if factory is None else factory
3409       )
3410       return result
3411     def __repr__(self):
3412       params = []
3413       self.repr_serialize(params)
3414       return 'ast.AST.ExpressionSizeOfExpression({0:s})'.format(', '.join(params))
3415     # GENERATE END
3416
3417   class ExpressionSizeOfType(ExpressionUnary):
3418     # GENERATE ELEMENT() BEGIN
3419     def __init__(
3420       self,
3421       tag = 'AST_ExpressionSizeOfType',
3422       attrib = {},
3423       text = '',
3424       children = [],
3425       unary_operator = '',
3426       postfix = False
3427     ):
3428       AST.ExpressionUnary.__init__(
3429         self,
3430         tag,
3431         attrib,
3432         text,
3433         children,
3434         unary_operator,
3435         postfix
3436       )
3437     def copy(self, factory = None):
3438       result = AST.ExpressionUnary.copy(
3439         self,
3440         ExpressionSizeOfType if factory is None else factory
3441       )
3442       return result
3443     def __repr__(self):
3444       params = []
3445       self.repr_serialize(params)
3446       return 'ast.AST.ExpressionSizeOfType({0:s})'.format(', '.join(params))
3447     # GENERATE END
3448     def translate_expression(self, context, precedence):
3449       type, _ = self[0][1].get_type_and_name(self[0][0].get_type())
3450       return str(type.translate_size(context))
3451
3452   class ExpressionStringLiteral(Expression):
3453     # GENERATE ELEMENT() BEGIN
3454     def __init__(
3455       self,
3456       tag = 'AST_ExpressionStringLiteral',
3457       attrib = {},
3458       text = '',
3459       children = []
3460     ):
3461       AST.Expression.__init__(
3462         self,
3463         tag,
3464         attrib,
3465         text,
3466         children
3467       )
3468     def copy(self, factory = None):
3469       result = AST.Expression.copy(
3470         self,
3471         ExpressionStringLiteral if factory is None else factory
3472       )
3473       return result
3474     def __repr__(self):
3475       params = []
3476       self.repr_serialize(params)
3477       return 'ast.AST.ExpressionStringLiteral({0:s})'.format(', '.join(params))
3478     # GENERATE END
3479     def translate_expression(self, context, precedence):
3480       return ' '.join(
3481         [
3482           '\'{0:s}\''.format(
3483             element.get_text(i, 0).
3484             replace('\\"', '"').
3485             replace('\'', '\\\'')
3486           )
3487           for i in self
3488         ]
3489       )
3490
3491   class ExpressionSubtract(ExpressionBinary):
3492     # GENERATE ELEMENT() BEGIN
3493     def __init__(
3494       self,
3495       tag = 'AST_ExpressionSubtract',
3496       attrib = {},
3497       text = '',
3498       children = [],
3499       binary_operator = '',
3500       precedence = -1,
3501       right_to_left = False
3502     ):
3503       AST.ExpressionBinary.__init__(
3504         self,
3505         tag,
3506         attrib,
3507         text,
3508         children,
3509         binary_operator,
3510         precedence,
3511         right_to_left
3512       )
3513     def copy(self, factory = None):
3514       result = AST.ExpressionBinary.copy(
3515         self,
3516         ExpressionSubtract if factory is None else factory
3517       )
3518       return result
3519     def __repr__(self):
3520       params = []
3521       self.repr_serialize(params)
3522       return 'ast.AST.ExpressionSubtract({0:s})'.format(', '.join(params))
3523     # GENERATE END
3524
3525   class ExpressionSubtractAssignment(ExpressionBinary):
3526     # GENERATE ELEMENT() BEGIN
3527     def __init__(
3528       self,
3529       tag = 'AST_ExpressionSubtractAssignment',
3530       attrib = {},
3531       text = '',
3532       children = [],
3533       binary_operator = '',
3534       precedence = -1,
3535       right_to_left = False
3536     ):
3537       AST.ExpressionBinary.__init__(
3538         self,
3539         tag,
3540         attrib,
3541         text,
3542         children,
3543         binary_operator,
3544         precedence,
3545         right_to_left
3546       )
3547     def copy(self, factory = None):
3548       result = AST.ExpressionBinary.copy(
3549         self,
3550         ExpressionSubtractAssignment if factory is None else factory
3551       )
3552       return result
3553     def __repr__(self):
3554       params = []
3555       self.repr_serialize(params)
3556       return 'ast.AST.ExpressionSubtractAssignment({0:s})'.format(', '.join(params))
3557     # GENERATE END
3558
3559   class FunctionDefinition(DeclarationOrStatement):
3560     # GENERATE ELEMENT() BEGIN
3561     def __init__(
3562       self,
3563       tag = 'AST_FunctionDefinition',
3564       attrib = {},
3565       text = '',
3566       children = []
3567     ):
3568       AST.DeclarationOrStatement.__init__(
3569         self,
3570         tag,
3571         attrib,
3572         text,
3573         children
3574       )
3575     def copy(self, factory = None):
3576       result = AST.DeclarationOrStatement.copy(
3577         self,
3578         FunctionDefinition if factory is None else factory
3579       )
3580       return result
3581     def __repr__(self):
3582       params = []
3583       self.repr_serialize(params)
3584       return 'ast.AST.FunctionDefinition({0:s})'.format(', '.join(params))
3585     # GENERATE END
3586     def translate_declaration_or_statement(self, context):
3587       type, name = self[1].get_type_and_name(self[0].get_type())
3588       assert isinstance(type, AST.TypeFunction)
3589       context.lines.append(
3590         '\n{0:s}def {1:s}({2:s}):\n'.format(
3591           context.indent,
3592           name,
3593           ', '.join([i.name for i in type])
3594         )
3595       )
3596       indent_save = context.indent
3597       context.indent += '  '
3598       assert context.top_level
3599       context.top_level = False
3600       self[3].translate_block_item_list(context)
3601       context.top_level = True
3602       context.indent = indent_save
3603
3604   class FunctionSpecifier(element.Element):
3605     # GENERATE ELEMENT(int n) BEGIN
3606     def __init__(
3607       self,
3608       tag = 'AST_FunctionSpecifier',
3609       attrib = {},
3610       text = '',
3611       children = [],
3612       n = -1
3613     ):
3614       element.Element.__init__(
3615         self,
3616         tag,
3617         attrib,
3618         text,
3619         children
3620       )
3621       self.n = (
3622         element.deserialize_int(n)
3623       if isinstance(n, str) else
3624         n
3625       )
3626     def serialize(self, ref_list):
3627       element.Element.serialize(self, ref_list)
3628       self.set('n', element.serialize_int(self.n))
3629     def deserialize(self, ref_list):
3630       element.Element.deserialize(self, ref_list)
3631       self.n = element.deserialize_int(self.get('n', '-1'))
3632     def copy(self, factory = None):
3633       result = element.Element.copy(
3634         self,
3635         FunctionSpecifier if factory is None else factory
3636       )
3637       result.n = self.n
3638       return result
3639     def repr_serialize(self, params):
3640       element.Element.repr_serialize(self, params)
3641       if self.n != -1:
3642         params.append(
3643           'n = {0:s}'.format(repr(self.n))
3644         )
3645     def __repr__(self):
3646       params = []
3647       self.repr_serialize(params)
3648       return 'ast.AST.FunctionSpecifier({0:s})'.format(', '.join(params))
3649     # GENERATE END
3650
3651   class GenericAssociation(element.Element):
3652     # GENERATE ELEMENT() BEGIN
3653     def __init__(
3654       self,
3655       tag = 'AST_GenericAssociation',
3656       attrib = {},
3657       text = '',
3658       children = []
3659     ):
3660       element.Element.__init__(
3661         self,
3662         tag,
3663         attrib,
3664         text,
3665         children
3666       )
3667     def copy(self, factory = None):
3668       result = element.Element.copy(
3669         self,
3670         GenericAssociation if factory is None else factory
3671       )
3672       return result
3673     def __repr__(self):
3674       params = []
3675       self.repr_serialize(params)
3676       return 'ast.AST.GenericAssociation({0:s})'.format(', '.join(params))
3677     # GENERATE END
3678
3679   class GenericAssociationList(element.Element):
3680     # GENERATE ELEMENT() BEGIN
3681     def __init__(
3682       self,
3683       tag = 'AST_GenericAssociationList',
3684       attrib = {},
3685       text = '',
3686       children = []
3687     ):
3688       element.Element.__init__(
3689         self,
3690         tag,
3691         attrib,
3692         text,
3693         children
3694       )
3695     def copy(self, factory = None):
3696       result = element.Element.copy(
3697         self,
3698         GenericAssociationList if factory is None else factory
3699       )
3700       return result
3701     def __repr__(self):
3702       params = []
3703       self.repr_serialize(params)
3704       return 'ast.AST.GenericAssociationList({0:s})'.format(', '.join(params))
3705     # GENERATE END
3706
3707   class GenericSelection(element.Element):
3708     # GENERATE ELEMENT() BEGIN
3709     def __init__(
3710       self,
3711       tag = 'AST_GenericSelection',
3712       attrib = {},
3713       text = '',
3714       children = []
3715     ):
3716       element.Element.__init__(
3717         self,
3718         tag,
3719         attrib,
3720         text,
3721         children
3722       )
3723     def copy(self, factory = None):
3724       result = element.Element.copy(
3725         self,
3726         GenericSelection if factory is None else factory
3727       )
3728       return result
3729     def __repr__(self):
3730       params = []
3731       self.repr_serialize(params)
3732       return 'ast.AST.GenericSelection({0:s})'.format(', '.join(params))
3733     # GENERATE END
3734
3735   class IdentifierEmpty(element.Element):
3736     # GENERATE ELEMENT() BEGIN
3737     def __init__(
3738       self,
3739       tag = 'AST_IdentifierEmpty',
3740       attrib = {},
3741       text = '',
3742       children = []
3743     ):
3744       element.Element.__init__(
3745         self,
3746         tag,
3747         attrib,
3748         text,
3749         children
3750       )
3751     def copy(self, factory = None):
3752       result = element.Element.copy(
3753         self,
3754         IdentifierEmpty if factory is None else factory
3755       )
3756       return result
3757     def __repr__(self):
3758       params = []
3759       self.repr_serialize(params)
3760       return 'ast.AST.IdentifierEmpty({0:s})'.format(', '.join(params))
3761     # GENERATE END
3762
3763   class IdentifierList(element.Element):
3764     # GENERATE ELEMENT() BEGIN
3765     def __init__(
3766       self,
3767       tag = 'AST_IdentifierList',
3768       attrib = {},
3769       text = '',
3770       children = []
3771     ):
3772       element.Element.__init__(
3773         self,
3774         tag,
3775         attrib,
3776         text,
3777         children
3778       )
3779     def copy(self, factory = None):
3780       result = element.Element.copy(
3781         self,
3782         IdentifierList if factory is None else factory
3783       )
3784       return result
3785     def __repr__(self):
3786       params = []
3787       self.repr_serialize(params)
3788       return 'ast.AST.IdentifierList({0:s})'.format(', '.join(params))
3789     # GENERATE END
3790
3791   class InitDeclarator(element.Element):
3792     # GENERATE ELEMENT() BEGIN
3793     def __init__(
3794       self,
3795       tag = 'AST_InitDeclarator',
3796       attrib = {},
3797       text = '',
3798       children = []
3799     ):
3800       element.Element.__init__(
3801         self,
3802         tag,
3803         attrib,
3804         text,
3805         children
3806       )
3807     def copy(self, factory = None):
3808       result = element.Element.copy(
3809         self,
3810         InitDeclarator if factory is None else factory
3811       )
3812       return result
3813     def __repr__(self):
3814       params = []
3815       self.repr_serialize(params)
3816       return 'ast.AST.InitDeclarator({0:s})'.format(', '.join(params))
3817     # GENERATE END
3818
3819   class InitDeclaratorList(element.Element):
3820     # GENERATE ELEMENT() BEGIN
3821     def __init__(
3822       self,
3823       tag = 'AST_InitDeclaratorList',
3824       attrib = {},
3825       text = '',
3826       children = []
3827     ):
3828       element.Element.__init__(
3829         self,
3830         tag,
3831         attrib,
3832         text,
3833         children
3834       )
3835     def copy(self, factory = None):
3836       result = element.Element.copy(
3837         self,
3838         InitDeclaratorList if factory is None else factory
3839       )
3840       return result
3841     def __repr__(self):
3842       params = []
3843       self.repr_serialize(params)
3844       return 'ast.AST.InitDeclaratorList({0:s})'.format(', '.join(params))
3845     # GENERATE END
3846
3847   class ParameterDeclaration(element.Element):
3848     # GENERATE ELEMENT() BEGIN
3849     def __init__(
3850       self,
3851       tag = 'AST_ParameterDeclaration',
3852       attrib = {},
3853       text = '',
3854       children = []
3855     ):
3856       element.Element.__init__(
3857         self,
3858         tag,
3859         attrib,
3860         text,
3861         children
3862       )
3863     def copy(self, factory = None):
3864       result = element.Element.copy(
3865         self,
3866         ParameterDeclaration if factory is None else factory
3867       )
3868       return result
3869     def __repr__(self):
3870       params = []
3871       self.repr_serialize(params)
3872       return 'ast.AST.ParameterDeclaration({0:s})'.format(', '.join(params))
3873     # GENERATE END
3874
3875   class ParameterDeclarationList(element.Element):
3876     # GENERATE ELEMENT() BEGIN
3877     def __init__(
3878       self,
3879       tag = 'AST_ParameterDeclarationList',
3880       attrib = {},
3881       text = '',
3882       children = []
3883     ):
3884       element.Element.__init__(
3885         self,
3886         tag,
3887         attrib,
3888         text,
3889         children
3890       )
3891     def copy(self, factory = None):
3892       result = element.Element.copy(
3893         self,
3894         ParameterDeclarationList if factory is None else factory
3895       )
3896       return result
3897     def __repr__(self):
3898       params = []
3899       self.repr_serialize(params)
3900       return 'ast.AST.ParameterDeclarationList({0:s})'.format(', '.join(params))
3901     # GENERATE END
3902
3903   class SpecifierQualifierList(element.Element):
3904     # GENERATE ELEMENT() BEGIN
3905     def __init__(
3906       self,
3907       tag = 'AST_SpecifierQualifierList',
3908       attrib = {},
3909       text = '',
3910       children = []
3911     ):
3912       element.Element.__init__(
3913         self,
3914         tag,
3915         attrib,
3916         text,
3917         children
3918       )
3919     def copy(self, factory = None):
3920       result = element.Element.copy(
3921         self,
3922         SpecifierQualifierList if factory is None else factory
3923       )
3924       return result
3925     def __repr__(self):
3926       params = []
3927       self.repr_serialize(params)
3928       return 'ast.AST.SpecifierQualifierList({0:s})'.format(', '.join(params))
3929     # GENERATE END
3930     def get_type(self):
3931       type_specifiers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
3932       for i in self:
3933         if isinstance(i, AST.TypeSpecifier):
3934           type_specifiers[i.n] += 1
3935       return type_specifiers_to_type[tuple(type_specifiers)]
3936
3937   class StatementBlock(Statement):
3938     # GENERATE ELEMENT() BEGIN
3939     def __init__(
3940       self,
3941       tag = 'AST_StatementBlock',
3942       attrib = {},
3943       text = '',
3944       children = []
3945     ):
3946       AST.Statement.__init__(
3947         self,
3948         tag,
3949         attrib,
3950         text,
3951         children
3952       )
3953     def copy(self, factory = None):
3954       result = AST.Statement.copy(
3955         self,
3956         StatementBlock if factory is None else factory
3957       )
3958       return result
3959     def __repr__(self):
3960       params = []
3961       self.repr_serialize(params)
3962       return 'ast.AST.StatementBlock({0:s})'.format(', '.join(params))
3963     # GENERATE END
3964     def translate_declaration_or_statement(self, context):
3965       if len(self[0]):
3966         self[0].translate_block_item_list(context)
3967       else:
3968         context.lines.append('{0:s}pass\n'.format(context.indent))
3969
3970   class StatementBreak(Statement):
3971     # GENERATE ELEMENT() BEGIN
3972     def __init__(
3973       self,
3974       tag = 'AST_StatementBreak',
3975       attrib = {},
3976       text = '',
3977       children = []
3978     ):
3979       AST.Statement.__init__(
3980         self,
3981         tag,
3982         attrib,
3983         text,
3984         children
3985       )
3986     def copy(self, factory = None):
3987       result = AST.Statement.copy(
3988         self,
3989         StatementBreak if factory is None else factory
3990       )
3991       return result
3992     def __repr__(self):
3993       params = []
3994       self.repr_serialize(params)
3995       return 'ast.AST.StatementBreak({0:s})'.format(', '.join(params))
3996     # GENERATE END
3997     def translate_declaration_or_statement(self, context):
3998       context.lines.append('{0:s}break\n'.format(context.indent))
3999  
4000   class StatementCase(Statement):
4001     # GENERATE ELEMENT() BEGIN
4002     def __init__(
4003       self,
4004       tag = 'AST_StatementCase',
4005       attrib = {},
4006       text = '',
4007       children = []
4008     ):
4009       AST.Statement.__init__(
4010         self,
4011         tag,
4012         attrib,
4013         text,
4014         children
4015       )
4016     def copy(self, factory = None):
4017       result = AST.Statement.copy(
4018         self,
4019         StatementCase if factory is None else factory
4020       )
4021       return result
4022     def __repr__(self):
4023       params = []
4024       self.repr_serialize(params)
4025       return 'ast.AST.StatementCase({0:s})'.format(', '.join(params))
4026     # GENERATE END
4027
4028   class StatementContinue(Statement):
4029     # GENERATE ELEMENT() BEGIN
4030     def __init__(
4031       self,
4032       tag = 'AST_StatementContinue',
4033       attrib = {},
4034       text = '',
4035       children = []
4036     ):
4037       AST.Statement.__init__(
4038         self,
4039         tag,
4040         attrib,
4041         text,
4042         children
4043       )
4044     def copy(self, factory = None):
4045       result = AST.Statement.copy(
4046         self,
4047         StatementContinue if factory is None else factory
4048       )
4049       return result
4050     def __repr__(self):
4051       params = []
4052       self.repr_serialize(params)
4053       return 'ast.AST.StatementContinue({0:s})'.format(', '.join(params))
4054     # GENERATE END
4055     def translate_declaration_or_statement(self, context):
4056       enclosing_loop_save = context.enclosing_loop
4057       context.enclosing_loop = None
4058       if isinstance(enclosing_loop_save, AST.StatementDoWhile):
4059         AST.StatementIfElse(
4060           children = [
4061             enclosing_loop_save[1],
4062             AST.StatementContinue(),
4063             AST.StatementBreak()
4064           ]
4065         ).translate_declaration_or_statement(context)
4066       elif isinstance(enclosing_loop_save, AST.StatementFor):
4067         context.lines.append(
4068           '{0:s}{1:s}\n{2:s}continue\n'.format(
4069             context.indent,
4070             enclosing_loop_save[2].translate_statement_expression(context),
4071             context.indent
4072           )
4073         )
4074       else:
4075         context.lines.append('{0:s}continue\n'.format(context.indent))
4076       context.enclosing_loop = enclosing_loop_save
4077
4078   class StatementDefault(Statement):
4079     # GENERATE ELEMENT() BEGIN
4080     def __init__(
4081       self,
4082       tag = 'AST_StatementDefault',
4083       attrib = {},
4084       text = '',
4085       children = []
4086     ):
4087       AST.Statement.__init__(
4088         self,
4089         tag,
4090         attrib,
4091         text,
4092         children
4093       )
4094     def copy(self, factory = None):
4095       result = AST.Statement.copy(
4096         self,
4097         StatementDefault if factory is None else factory
4098       )
4099       return result
4100     def __repr__(self):
4101       params = []
4102       self.repr_serialize(params)
4103       return 'ast.AST.StatementDefault({0:s})'.format(', '.join(params))
4104     # GENERATE END
4105
4106   class StatementDoWhile(Statement):
4107     # GENERATE ELEMENT() BEGIN
4108     def __init__(
4109       self,
4110       tag = 'AST_StatementDoWhile',
4111       attrib = {},
4112       text = '',
4113       children = []
4114     ):
4115       AST.Statement.__init__(
4116         self,
4117         tag,
4118         attrib,
4119         text,
4120         children
4121       )
4122     def copy(self, factory = None):
4123       result = AST.Statement.copy(
4124         self,
4125         StatementDoWhile if factory is None else factory
4126       )
4127       return result
4128     def __repr__(self):
4129       params = []
4130       self.repr_serialize(params)
4131       return 'ast.AST.StatementDoWhile({0:s})'.format(', '.join(params))
4132     # GENERATE END
4133     def translate_declaration_or_statement(self, context):
4134       if (
4135         isinstance(self[1], AST.ExpressionIntLiteral) and
4136         element.get_text(self[1], 0) == '0'
4137       ):
4138         self[0].translate_declaration_or_statement(context)
4139         return
4140       context.lines.append('{0:s}while True:\n'.format(context.indent))
4141       indent_save = context.indent
4142       context.indent += '  '
4143       enclosing_loop_save = context.enclosing_loop
4144       context.enclosing_loop = self
4145       self[0].translate_declaration_or_statement(context)
4146       context.enclosing_loop = enclosing_loop_save
4147       AST.StatementIf(
4148         children = [
4149           AST.ExpressionLogicalNot(
4150             children = [
4151               self[1]
4152             ],
4153             unary_operator = 'not '
4154           ),
4155           AST.StatementBreak()
4156         ]
4157       ).translate_declaration_or_statement(context)
4158       context.indent = indent_save
4159
4160   class StatementExpression(Statement):
4161     # GENERATE ELEMENT() BEGIN
4162     def __init__(
4163       self,
4164       tag = 'AST_StatementExpression',
4165       attrib = {},
4166       text = '',
4167       children = []
4168     ):
4169       AST.Statement.__init__(
4170         self,
4171         tag,
4172         attrib,
4173         text,
4174         children
4175       )
4176     def copy(self, factory = None):
4177       result = AST.Statement.copy(
4178         self,
4179         StatementExpression if factory is None else factory
4180       )
4181       return result
4182     def __repr__(self):
4183       params = []
4184       self.repr_serialize(params)
4185       return 'ast.AST.StatementExpression({0:s})'.format(', '.join(params))
4186     # GENERATE END
4187     def translate_declaration_or_statement(self, context):
4188       context.lines.append(
4189         '{0:s}{1:s}\n'.format(
4190           context.indent,
4191           self[0].translate_statement_expression(context)
4192         )
4193       )
4194
4195   class StatementFor(Statement):
4196     # GENERATE ELEMENT() BEGIN
4197     def __init__(
4198       self,
4199       tag = 'AST_StatementFor',
4200       attrib = {},
4201       text = '',
4202       children = []
4203     ):
4204       AST.Statement.__init__(
4205         self,
4206         tag,
4207         attrib,
4208         text,
4209         children
4210       )
4211     def copy(self, factory = None):
4212       result = AST.Statement.copy(
4213         self,
4214         StatementFor if factory is None else factory
4215       )
4216       return result
4217     def __repr__(self):
4218       params = []
4219       self.repr_serialize(params)
4220       return 'ast.AST.StatementFor({0:s})'.format(', '.join(params))
4221     # GENERATE END
4222     def translate_declaration_or_statement(self, context):
4223       self[0].translate_declaration_or_statement(context)
4224       context.lines.append(
4225         '{0:s}while {1:s}:\n'.format(
4226           context.indent,
4227           self[1].translate_expression(context, 0)
4228         )
4229       )
4230       indent_save = context.indent
4231       context.indent += '  '
4232       enclosing_loop_save = context.enclosing_loop
4233       context.enclosing_loop = self
4234       self[3].translate_declaration_or_statement(context)
4235       context.enclosing_loop = enclosing_loop_save
4236       context.lines.append(
4237         '{0:s}{1:s}\n'.format(
4238           context.indent,
4239           self[2].translate_statement_expression(context)
4240         )
4241       )
4242       context.indent = indent_save
4243
4244   class StatementGoto(Statement):
4245     # GENERATE ELEMENT() BEGIN
4246     def __init__(
4247       self,
4248       tag = 'AST_StatementGoto',
4249       attrib = {},
4250       text = '',
4251       children = []
4252     ):
4253       AST.Statement.__init__(
4254         self,
4255         tag,
4256         attrib,
4257         text,
4258         children
4259       )
4260     def copy(self, factory = None):
4261       result = AST.Statement.copy(
4262         self,
4263         StatementGoto if factory is None else factory
4264       )
4265       return result
4266     def __repr__(self):
4267       params = []
4268       self.repr_serialize(params)
4269       return 'ast.AST.StatementGoto({0:s})'.format(', '.join(params))
4270     # GENERATE END
4271
4272   class StatementIf(Statement):
4273     # GENERATE ELEMENT() BEGIN
4274     def __init__(
4275       self,
4276       tag = 'AST_StatementIf',
4277       attrib = {},
4278       text = '',
4279       children = []
4280     ):
4281       AST.Statement.__init__(
4282         self,
4283         tag,
4284         attrib,
4285         text,
4286         children
4287       )
4288     def copy(self, factory = None):
4289       result = AST.Statement.copy(
4290         self,
4291         StatementIf if factory is None else factory
4292       )
4293       return result
4294     def __repr__(self):
4295       params = []
4296       self.repr_serialize(params)
4297       return 'ast.AST.StatementIf({0:s})'.format(', '.join(params))
4298     # GENERATE END
4299     def translate_declaration_or_statement(self, context):
4300       context.lines.append(
4301         '{0:s}if {1:s}:\n'.format(
4302           context.indent,
4303           self[0].translate_expression(context, 0)
4304         )
4305       )
4306       indent_save = context.indent
4307       context.indent += '  '
4308       self[1].translate_declaration_or_statement(context)
4309       context.indent = indent_save
4310
4311   class StatementIfElse(Statement):
4312     # GENERATE ELEMENT() BEGIN
4313     def __init__(
4314       self,
4315       tag = 'AST_StatementIfElse',
4316       attrib = {},
4317       text = '',
4318       children = []
4319     ):
4320       AST.Statement.__init__(
4321         self,
4322         tag,
4323         attrib,
4324         text,
4325         children
4326       )
4327     def copy(self, factory = None):
4328       result = AST.Statement.copy(
4329         self,
4330         StatementIfElse if factory is None else factory
4331       )
4332       return result
4333     def __repr__(self):
4334       params = []
4335       self.repr_serialize(params)
4336       return 'ast.AST.StatementIfElse({0:s})'.format(', '.join(params))
4337     # GENERATE END
4338     def translate_declaration_or_statement(self, context):
4339       context.lines.append(
4340         '{0:s}if {1:s}:\n'.format(
4341           context.indent,
4342           self[0].translate_expression(context, 0)
4343         )
4344       )
4345       indent_save = context.indent
4346       context.indent += '  '
4347       self[1].translate_declaration_or_statement(context)
4348       context.lines.append('{0:s}else:\n'.format(indent_save))
4349       self[2].translate_declaration_or_statement(context)
4350       context.indent = indent_save
4351
4352   class StatementLabel(Statement):
4353     # GENERATE ELEMENT() BEGIN
4354     def __init__(
4355       self,
4356       tag = 'AST_StatementLabel',
4357       attrib = {},
4358       text = '',
4359       children = []
4360     ):
4361       AST.Statement.__init__(
4362         self,
4363         tag,
4364         attrib,
4365         text,
4366         children
4367       )
4368     def copy(self, factory = None):
4369       result = AST.Statement.copy(
4370         self,
4371         StatementLabel if factory is None else factory
4372       )
4373       return result
4374     def __repr__(self):
4375       params = []
4376       self.repr_serialize(params)
4377       return 'ast.AST.StatementLabel({0:s})'.format(', '.join(params))
4378     # GENERATE END
4379
4380   class StatementReturn(Statement):
4381     # GENERATE ELEMENT() BEGIN
4382     def __init__(
4383       self,
4384       tag = 'AST_StatementReturn',
4385       attrib = {},
4386       text = '',
4387       children = []
4388     ):
4389       AST.Statement.__init__(
4390         self,
4391         tag,
4392         attrib,
4393         text,
4394         children
4395       )
4396     def copy(self, factory = None):
4397       result = AST.Statement.copy(
4398         self,
4399         StatementReturn if factory is None else factory
4400       )
4401       return result
4402     def __repr__(self):
4403       params = []
4404       self.repr_serialize(params)
4405       return 'ast.AST.StatementReturn({0:s})'.format(', '.join(params))
4406     # GENERATE END
4407     def translate_declaration_or_statement(self, context):
4408       context.lines.append(
4409         '{0:s}return {1:s}\n'.format(
4410           context.indent,
4411           self[0].translate_expression(context, 0)
4412         )
4413       )
4414  
4415   class StatementSwitch(Statement):
4416     # GENERATE ELEMENT() BEGIN
4417     def __init__(
4418       self,
4419       tag = 'AST_StatementSwitch',
4420       attrib = {},
4421       text = '',
4422       children = []
4423     ):
4424       AST.Statement.__init__(
4425         self,
4426         tag,
4427         attrib,
4428         text,
4429         children
4430       )
4431     def copy(self, factory = None):
4432       result = AST.Statement.copy(
4433         self,
4434         StatementSwitch if factory is None else factory
4435       )
4436       return result
4437     def __repr__(self):
4438       params = []
4439       self.repr_serialize(params)
4440       return 'ast.AST.StatementSwitch({0:s})'.format(', '.join(params))
4441     # GENERATE END
4442
4443   class StatementWhile(Statement):
4444     # GENERATE ELEMENT() BEGIN
4445     def __init__(
4446       self,
4447       tag = 'AST_StatementWhile',
4448       attrib = {},
4449       text = '',
4450       children = []
4451     ):
4452       AST.Statement.__init__(
4453         self,
4454         tag,
4455         attrib,
4456         text,
4457         children
4458       )
4459     def copy(self, factory = None):
4460       result = AST.Statement.copy(
4461         self,
4462         StatementWhile if factory is None else factory
4463       )
4464       return result
4465     def __repr__(self):
4466       params = []
4467       self.repr_serialize(params)
4468       return 'ast.AST.StatementWhile({0:s})'.format(', '.join(params))
4469     # GENERATE END
4470     def translate_declaration_or_statement(self, context):
4471       context.lines.append(
4472         '{0:s}while {1:s}:\n'.format(
4473           context.indent,
4474           self[0].translate_expression(context, 0)
4475         )
4476       )
4477       indent_save = context.indent
4478       context.indent += '  '
4479       enclosing_loop_save = context.enclosing_loop
4480       context.enclosing_loop = self
4481       self[1].translate_declaration_or_statement(context)
4482       context.enclosing_loop = enclosing_loop_save
4483       context.indent = indent_save
4484
4485   class StaticAssertDeclaration(element.Element):
4486     # GENERATE ELEMENT() BEGIN
4487     def __init__(
4488       self,
4489       tag = 'AST_StaticAssertDeclaration',
4490       attrib = {},
4491       text = '',
4492       children = []
4493     ):
4494       element.Element.__init__(
4495         self,
4496         tag,
4497         attrib,
4498         text,
4499         children
4500       )
4501     def copy(self, factory = None):
4502       result = element.Element.copy(
4503         self,
4504         StaticAssertDeclaration if factory is None else factory
4505       )
4506       return result
4507     def __repr__(self):
4508       params = []
4509       self.repr_serialize(params)
4510       return 'ast.AST.StaticAssertDeclaration({0:s})'.format(', '.join(params))
4511     # GENERATE END
4512
4513   class StorageClassSpecifier(element.Element):
4514     # GENERATE ELEMENT(int n) BEGIN
4515     def __init__(
4516       self,
4517       tag = 'AST_StorageClassSpecifier',
4518       attrib = {},
4519       text = '',
4520       children = [],
4521       n = -1
4522     ):
4523       element.Element.__init__(
4524         self,
4525         tag,
4526         attrib,
4527         text,
4528         children
4529       )
4530       self.n = (
4531         element.deserialize_int(n)
4532       if isinstance(n, str) else
4533         n
4534       )
4535     def serialize(self, ref_list):
4536       element.Element.serialize(self, ref_list)
4537       self.set('n', element.serialize_int(self.n))
4538     def deserialize(self, ref_list):
4539       element.Element.deserialize(self, ref_list)
4540       self.n = element.deserialize_int(self.get('n', '-1'))
4541     def copy(self, factory = None):
4542       result = element.Element.copy(
4543         self,
4544         StorageClassSpecifier if factory is None else factory
4545       )
4546       result.n = self.n
4547       return result
4548     def repr_serialize(self, params):
4549       element.Element.repr_serialize(self, params)
4550       if self.n != -1:
4551         params.append(
4552           'n = {0:s}'.format(repr(self.n))
4553         )
4554     def __repr__(self):
4555       params = []
4556       self.repr_serialize(params)
4557       return 'ast.AST.StorageClassSpecifier({0:s})'.format(', '.join(params))
4558     # GENERATE END
4559
4560   class StructDeclaration(element.Element):
4561     # GENERATE ELEMENT() BEGIN
4562     def __init__(
4563       self,
4564       tag = 'AST_StructDeclaration',
4565       attrib = {},
4566       text = '',
4567       children = []
4568     ):
4569       element.Element.__init__(
4570         self,
4571         tag,
4572         attrib,
4573         text,
4574         children
4575       )
4576     def copy(self, factory = None):
4577       result = element.Element.copy(
4578         self,
4579         StructDeclaration if factory is None else factory
4580       )
4581       return result
4582     def __repr__(self):
4583       params = []
4584       self.repr_serialize(params)
4585       return 'ast.AST.StructDeclaration({0:s})'.format(', '.join(params))
4586     # GENERATE END
4587
4588   class StructDeclarationList(element.Element):
4589     # GENERATE ELEMENT() BEGIN
4590     def __init__(
4591       self,
4592       tag = 'AST_StructDeclarationList',
4593       attrib = {},
4594       text = '',
4595       children = []
4596     ):
4597       element.Element.__init__(
4598         self,
4599         tag,
4600         attrib,
4601         text,
4602         children
4603       )
4604     def copy(self, factory = None):
4605       result = element.Element.copy(
4606         self,
4607         StructDeclarationList if factory is None else factory
4608       )
4609       return result
4610     def __repr__(self):
4611       params = []
4612       self.repr_serialize(params)
4613       return 'ast.AST.StructDeclarationList({0:s})'.format(', '.join(params))
4614     # GENERATE END
4615
4616   class StructDeclarator(element.Element):
4617     # GENERATE ELEMENT() BEGIN
4618     def __init__(
4619       self,
4620       tag = 'AST_StructDeclarator',
4621       attrib = {},
4622       text = '',
4623       children = []
4624     ):
4625       element.Element.__init__(
4626         self,
4627         tag,
4628         attrib,
4629         text,
4630         children
4631       )
4632     def copy(self, factory = None):
4633       result = element.Element.copy(
4634         self,
4635         StructDeclarator if factory is None else factory
4636       )
4637       return result
4638     def __repr__(self):
4639       params = []
4640       self.repr_serialize(params)
4641       return 'ast.AST.StructDeclarator({0:s})'.format(', '.join(params))
4642     # GENERATE END
4643
4644   class StructDeclaratorList(element.Element):
4645     # GENERATE ELEMENT() BEGIN
4646     def __init__(
4647       self,
4648       tag = 'AST_StructDeclaratorList',
4649       attrib = {},
4650       text = '',
4651       children = []
4652     ):
4653       element.Element.__init__(
4654         self,
4655         tag,
4656         attrib,
4657         text,
4658         children
4659       )
4660     def copy(self, factory = None):
4661       result = element.Element.copy(
4662         self,
4663         StructDeclaratorList if factory is None else factory
4664       )
4665       return result
4666     def __repr__(self):
4667       params = []
4668       self.repr_serialize(params)
4669       return 'ast.AST.StructDeclaratorList({0:s})'.format(', '.join(params))
4670     # GENERATE END
4671
4672   class StructSpecifier(element.Element):
4673     # GENERATE ELEMENT() BEGIN
4674     def __init__(
4675       self,
4676       tag = 'AST_StructSpecifier',
4677       attrib = {},
4678       text = '',
4679       children = []
4680     ):
4681       element.Element.__init__(
4682         self,
4683         tag,
4684         attrib,
4685         text,
4686         children
4687       )
4688     def copy(self, factory = None):
4689       result = element.Element.copy(
4690         self,
4691         StructSpecifier if factory is None else factory
4692       )
4693       return result
4694     def __repr__(self):
4695       params = []
4696       self.repr_serialize(params)
4697       return 'ast.AST.StructSpecifier({0:s})'.format(', '.join(params))
4698     # GENERATE END
4699
4700   class TypeName(element.Element):
4701     # GENERATE ELEMENT() BEGIN
4702     def __init__(
4703       self,
4704       tag = 'AST_TypeName',
4705       attrib = {},
4706       text = '',
4707       children = []
4708     ):
4709       element.Element.__init__(
4710         self,
4711         tag,
4712         attrib,
4713         text,
4714         children
4715       )
4716     def copy(self, factory = None):
4717       result = element.Element.copy(
4718         self,
4719         TypeName if factory is None else factory
4720       )
4721       return result
4722     def __repr__(self):
4723       params = []
4724       self.repr_serialize(params)
4725       return 'ast.AST.TypeName({0:s})'.format(', '.join(params))
4726     # GENERATE END
4727
4728   class TypeQualifier(element.Element):
4729     # GENERATE ELEMENT(int n) BEGIN
4730     def __init__(
4731       self,
4732       tag = 'AST_TypeQualifier',
4733       attrib = {},
4734       text = '',
4735       children = [],
4736       n = -1
4737     ):
4738       element.Element.__init__(
4739         self,
4740         tag,
4741         attrib,
4742         text,
4743         children
4744       )
4745       self.n = (
4746         element.deserialize_int(n)
4747       if isinstance(n, str) else
4748         n
4749       )
4750     def serialize(self, ref_list):
4751       element.Element.serialize(self, ref_list)
4752       self.set('n', element.serialize_int(self.n))
4753     def deserialize(self, ref_list):
4754       element.Element.deserialize(self, ref_list)
4755       self.n = element.deserialize_int(self.get('n', '-1'))
4756     def copy(self, factory = None):
4757       result = element.Element.copy(
4758         self,
4759         TypeQualifier if factory is None else factory
4760       )
4761       result.n = self.n
4762       return result
4763     def repr_serialize(self, params):
4764       element.Element.repr_serialize(self, params)
4765       if self.n != -1:
4766         params.append(
4767           'n = {0:s}'.format(repr(self.n))
4768         )
4769     def __repr__(self):
4770       params = []
4771       self.repr_serialize(params)
4772       return 'ast.AST.TypeQualifier({0:s})'.format(', '.join(params))
4773     # GENERATE END
4774
4775   class TypeQualifierList(element.Element):
4776     # GENERATE ELEMENT() BEGIN
4777     def __init__(
4778       self,
4779       tag = 'AST_TypeQualifierList',
4780       attrib = {},
4781       text = '',
4782       children = []
4783     ):
4784       element.Element.__init__(
4785         self,
4786         tag,
4787         attrib,
4788         text,
4789         children
4790       )
4791     def copy(self, factory = None):
4792       result = element.Element.copy(
4793         self,
4794         TypeQualifierList if factory is None else factory
4795       )
4796       return result
4797     def __repr__(self):
4798       params = []
4799       self.repr_serialize(params)
4800       return 'ast.AST.TypeQualifierList({0:s})'.format(', '.join(params))
4801     # GENERATE END
4802
4803   class TypeQualifierOrStaticList(element.Element):
4804     # GENERATE ELEMENT() BEGIN
4805     def __init__(
4806       self,
4807       tag = 'AST_TypeQualifierOrStaticList',
4808       attrib = {},
4809       text = '',
4810       children = []
4811     ):
4812       element.Element.__init__(
4813         self,
4814         tag,
4815         attrib,
4816         text,
4817         children
4818       )
4819     def copy(self, factory = None):
4820       result = element.Element.copy(
4821         self,
4822         TypeQualifierOrStaticList if factory is None else factory
4823       )
4824       return result
4825     def __repr__(self):
4826       params = []
4827       self.repr_serialize(params)
4828       return 'ast.AST.TypeQualifierOrStaticList({0:s})'.format(', '.join(params))
4829     # GENERATE END
4830
4831   class TypeSpecifier(element.Element):
4832     # GENERATE ELEMENT(int n) BEGIN
4833     def __init__(
4834       self,
4835       tag = 'AST_TypeSpecifier',
4836       attrib = {},
4837       text = '',
4838       children = [],
4839       n = -1
4840     ):
4841       element.Element.__init__(
4842         self,
4843         tag,
4844         attrib,
4845         text,
4846         children
4847       )
4848       self.n = (
4849         element.deserialize_int(n)
4850       if isinstance(n, str) else
4851         n
4852       )
4853     def serialize(self, ref_list):
4854       element.Element.serialize(self, ref_list)
4855       self.set('n', element.serialize_int(self.n))
4856     def deserialize(self, ref_list):
4857       element.Element.deserialize(self, ref_list)
4858       self.n = element.deserialize_int(self.get('n', '-1'))
4859     def copy(self, factory = None):
4860       result = element.Element.copy(
4861         self,
4862         TypeSpecifier if factory is None else factory
4863       )
4864       result.n = self.n
4865       return result
4866     def repr_serialize(self, params):
4867       element.Element.repr_serialize(self, params)
4868       if self.n != -1:
4869         params.append(
4870           'n = {0:s}'.format(repr(self.n))
4871         )
4872     def __repr__(self):
4873       params = []
4874       self.repr_serialize(params)
4875       return 'ast.AST.TypeSpecifier({0:s})'.format(', '.join(params))
4876     # GENERATE END
4877
4878   class UnionSpecifier(element.Element):
4879     # GENERATE ELEMENT() BEGIN
4880     def __init__(
4881       self,
4882       tag = 'AST_UnionSpecifier',
4883       attrib = {},
4884       text = '',
4885       children = []
4886     ):
4887       element.Element.__init__(
4888         self,
4889         tag,
4890         attrib,
4891         text,
4892         children
4893       )
4894     def copy(self, factory = None):
4895       result = element.Element.copy(
4896         self,
4897         UnionSpecifier if factory is None else factory
4898       )
4899       return result
4900     def __repr__(self):
4901       params = []
4902       self.repr_serialize(params)
4903       return 'ast.AST.UnionSpecifier({0:s})'.format(', '.join(params))
4904     # GENERATE END
4905
4906   class TranslationUnit(element.Element):
4907     # GENERATE ELEMENT() BEGIN
4908     def __init__(
4909       self,
4910       tag = 'AST_TranslationUnit',
4911       attrib = {},
4912       text = '',
4913       children = []
4914     ):
4915       element.Element.__init__(
4916         self,
4917         tag,
4918         attrib,
4919         text,
4920         children
4921       )
4922     def copy(self, factory = None):
4923       result = element.Element.copy(
4924         self,
4925         TranslationUnit if factory is None else factory
4926       )
4927       return result
4928     def __repr__(self):
4929       params = []
4930       self.repr_serialize(params)
4931       return 'ast.AST.TranslationUnit({0:s})'.format(', '.join(params))
4932     # GENERATE END
4933     def translate_translation_unit(self, context):
4934       for i in self:
4935         i.translate_declaration_or_statement(context)
4936
4937   # GENERATE ELEMENT() BEGIN
4938   def __init__(
4939     self,
4940     tag = 'AST',
4941     attrib = {},
4942     text = '',
4943     children = []
4944   ):
4945     element.Element.__init__(
4946       self,
4947       tag,
4948       attrib,
4949       text,
4950       children
4951     )
4952   def copy(self, factory = None):
4953     result = element.Element.copy(
4954       self,
4955       AST if factory is None else factory
4956     )
4957     return result
4958   def __repr__(self):
4959     params = []
4960     self.repr_serialize(params)
4961     return 'ast.AST({0:s})'.format(', '.join(params))
4962   # GENERATE END
4963
4964 type_specifiers_to_type = {
4965   (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0): AST.TypeVoid(),
4966   (0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0): AST.TypeInt(signed = True, bits = 8),
4967   (0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0): AST.TypeInt(signed = True, bits = 8),
4968   (0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0): AST.TypeInt(signed = False, bits = 8),
4969   (0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0): AST.TypeInt(signed = True, bits = 16),
4970   (0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0): AST.TypeInt(signed = True, bits = 16),
4971   (0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0): AST.TypeInt(signed = False, bits = 16),
4972   (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0): AST.TypeInt(signed = True, bits = 32),
4973   (0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0): AST.TypeInt(signed = True, bits = 32),
4974   (0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0): AST.TypeInt(signed = True, bits = 32),
4975   (0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0): AST.TypeInt(signed = False, bits = 32),
4976   (0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0): AST.TypeInt(signed = True, bits = 32),
4977   (0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0): AST.TypeInt(signed = True, bits = 32),
4978   (0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0): AST.TypeInt(signed = True, bits = 32),
4979   (0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0): AST.TypeInt(signed = False, bits = 32),
4980   (0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0): AST.TypeInt(signed = False, bits = 32),
4981   (0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0): AST.TypeInt(signed = True, bits = 64),
4982   (0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0): AST.TypeInt(signed = True, bits = 64),
4983   (0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0): AST.TypeInt(signed = False, bits = 64),
4984   (0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0): AST.TypeFloat(complex = 0, bits = 32),
4985   (0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0): AST.TypeFloat(complex = 2, bits = 32),
4986   (0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1): AST.TypeFloat(complex = 1, bits = 32),
4987   (0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0): AST.TypeFloat(complex = 0, bits = 64),
4988   (0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0): AST.TypeFloat(complex = 1, bits = 64),
4989   (0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1): AST.TypeFloat(complex = 2, bits = 64),
4990   (0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0): AST.TypeBool()
4991
4992 octal_prefix = set(
4993   ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09']
4994 )
4995
4996 # GENERATE FACTORY(element.Element) BEGIN
4997 tag_to_class = {
4998   'AST': AST,
4999   'AST_Text': AST.Text,
5000   'AST_DeclarationOrStatement': AST.DeclarationOrStatement,
5001   'AST_Statement': AST.Statement,
5002   'AST_Declarator': AST.Declarator,
5003   'AST_Expression': AST.Expression,
5004   'AST_ExpressionUnary': AST.ExpressionUnary,
5005   'AST_ExpressionBinary': AST.ExpressionBinary,
5006   'AST_Type': AST.Type,
5007   'AST_TypeVoid': AST.TypeVoid,
5008   'AST_TypeInt': AST.TypeInt,
5009   'AST_TypeFloat': AST.TypeFloat,
5010   'AST_TypeBool': AST.TypeBool,
5011   'AST_TypePointer': AST.TypePointer,
5012   'AST_TypeArray': AST.TypeArray,
5013   'AST_TypeFunction': AST.TypeFunction,
5014   'AST_TypeFunction_Argument': AST.TypeFunction.Argument,
5015   'AST_AlignAsExpression': AST.AlignAsExpression,
5016   'AST_AlignAsType': AST.AlignAsType,
5017   'AST_ArgumentExpressionList': AST.ArgumentExpressionList,
5018   'AST_BlockItemList': AST.BlockItemList,
5019   'AST_Declaration': AST.Declaration,
5020   'AST_DeclarationList': AST.DeclarationList,
5021   'AST_DeclarationSpecifierList': AST.DeclarationSpecifierList,
5022   'AST_DeclaratorAbstract': AST.DeclaratorAbstract,
5023   'AST_DeclaratorArray': AST.DeclaratorArray,
5024   'AST_DeclaratorEmpty': AST.DeclaratorEmpty,
5025   'AST_DeclaratorFunction': AST.DeclaratorFunction,
5026   'AST_DeclaratorFunctionOldStyle': AST.DeclaratorFunctionOldStyle,
5027   'AST_DeclaratorIdentifier': AST.DeclaratorIdentifier,
5028   'AST_DeclaratorPointer': AST.DeclaratorPointer,
5029   'AST_DefaultTypeName': AST.DefaultTypeName,
5030   'AST_DesignatorField': AST.DesignatorField,
5031   'AST_DesignatorIndex': AST.DesignatorIndex,
5032   'AST_DesignatorInitializer': AST.DesignatorInitializer,
5033   'AST_DesignatorInitializerList': AST.DesignatorInitializerList,
5034   'AST_DesignatorList': AST.DesignatorList,
5035   'AST_EnumSpecifier': AST.EnumSpecifier,
5036   'AST_Enumerator': AST.Enumerator,
5037   'AST_EnumeratorList': AST.EnumeratorList,
5038   'AST_EqualsInitializerEmpty': AST.EqualsInitializerEmpty,
5039   'AST_ExpressionAdd': AST.ExpressionAdd,
5040   'AST_ExpressionAddAssignment': AST.ExpressionAddAssignment,
5041   'AST_ExpressionAddressOf': AST.ExpressionAddressOf,
5042   'AST_ExpressionAlignOfType': AST.ExpressionAlignOfType,
5043   'AST_ExpressionArray': AST.ExpressionArray,
5044   'AST_ExpressionAssignment': AST.ExpressionAssignment,
5045   'AST_ExpressionAsterisk': AST.ExpressionAsterisk,
5046   'AST_ExpressionBitwiseAnd': AST.ExpressionBitwiseAnd,
5047   'AST_ExpressionBitwiseAndAssignment': AST.ExpressionBitwiseAndAssignment,
5048   'AST_ExpressionBitwiseNot': AST.ExpressionBitwiseNot,
5049   'AST_ExpressionBitwiseOr': AST.ExpressionBitwiseOr,
5050   'AST_ExpressionBitwiseOrAssignment': AST.ExpressionBitwiseOrAssignment,
5051   'AST_ExpressionCall': AST.ExpressionCall,
5052   'AST_ExpressionCast': AST.ExpressionCast,
5053   'AST_ExpressionCharConstant': AST.ExpressionCharConstant,
5054   'AST_ExpressionComma': AST.ExpressionComma,
5055   'AST_ExpressionConditional': AST.ExpressionConditional,
5056   'AST_ExpressionDereference': AST.ExpressionDereference,
5057   'AST_ExpressionDivide': AST.ExpressionDivide,
5058   'AST_ExpressionDivideAssignment': AST.ExpressionDivideAssignment,
5059   'AST_ExpressionEmpty': AST.ExpressionEmpty,
5060   'AST_ExpressionEqual': AST.ExpressionEqual,
5061   'AST_ExpressionExclusiveOr': AST.ExpressionExclusiveOr,
5062   'AST_ExpressionExclusiveOrAssignment': AST.ExpressionExclusiveOrAssignment,
5063   'AST_ExpressionField': AST.ExpressionField,
5064   'AST_ExpressionFieldDereference': AST.ExpressionFieldDereference,
5065   'AST_ExpressionFloatLiteral': AST.ExpressionFloatLiteral,
5066   'AST_ExpressionFunctionName': AST.ExpressionFunctionName,
5067   'AST_ExpressionGreaterThan': AST.ExpressionGreaterThan,
5068   'AST_ExpressionGreaterThanOrEqual': AST.ExpressionGreaterThanOrEqual,
5069   'AST_ExpressionIdentifier': AST.ExpressionIdentifier,
5070   'AST_ExpressionIndex': AST.ExpressionIndex,
5071   'AST_ExpressionIntLiteral': AST.ExpressionIntLiteral,
5072   'AST_Identifier': AST.Identifier,
5073   'AST_ExpressionLeftShiftAssignment': AST.ExpressionLeftShiftAssignment,
5074   'AST_ExpressionLessThan': AST.ExpressionLessThan,
5075   'AST_ExpressionLessThanOrEqual': AST.ExpressionLessThanOrEqual,
5076   'AST_ExpressionLogicalAnd': AST.ExpressionLogicalAnd,
5077   'AST_ExpressionLogicalNot': AST.ExpressionLogicalNot,
5078   'AST_ExpressionLogicalOr': AST.ExpressionLogicalOr,
5079   'AST_ExpressionMinus': AST.ExpressionMinus,
5080   'AST_ExpressionModulo': AST.ExpressionModulo,
5081   'AST_ExpressionModuloAssignment': AST.ExpressionModuloAssignment,
5082   'AST_ExpressionMultiply': AST.ExpressionMultiply,
5083   'AST_ExpressionMultiplyAssignment': AST.ExpressionMultiplyAssignment,
5084   'AST_ExpressionNotEqual': AST.ExpressionNotEqual,
5085   'AST_ExpressionPlus': AST.ExpressionPlus,
5086   'AST_ExpressionPostDecrement': AST.ExpressionPostDecrement,
5087   'AST_ExpressionPostIncrement': AST.ExpressionPostIncrement,
5088   'AST_ExpressionPreDecrement': AST.ExpressionPreDecrement,
5089   'AST_ExpressionPreIncrement': AST.ExpressionPreIncrement,
5090   'AST_ExpressionRightShiftAssignment': AST.ExpressionRightShiftAssignment,
5091   'AST_ExpressionShiftLeft': AST.ExpressionShiftLeft,
5092   'AST_ExpressionShiftRight': AST.ExpressionShiftRight,
5093   'AST_ExpressionSizeOfExpression': AST.ExpressionSizeOfExpression,
5094   'AST_ExpressionSizeOfType': AST.ExpressionSizeOfType,
5095   'AST_ExpressionStringLiteral': AST.ExpressionStringLiteral,
5096   'AST_ExpressionSubtract': AST.ExpressionSubtract,
5097   'AST_ExpressionSubtractAssignment': AST.ExpressionSubtractAssignment,
5098   'AST_FunctionDefinition': AST.FunctionDefinition,
5099   'AST_FunctionSpecifier': AST.FunctionSpecifier,
5100   'AST_GenericAssociation': AST.GenericAssociation,
5101   'AST_GenericAssociationList': AST.GenericAssociationList,
5102   'AST_GenericSelection': AST.GenericSelection,
5103   'AST_IdentifierEmpty': AST.IdentifierEmpty,
5104   'AST_IdentifierList': AST.IdentifierList,
5105   'AST_InitDeclarator': AST.InitDeclarator,
5106   'AST_InitDeclaratorList': AST.InitDeclaratorList,
5107   'AST_ParameterDeclaration': AST.ParameterDeclaration,
5108   'AST_ParameterDeclarationList': AST.ParameterDeclarationList,
5109   'AST_SpecifierQualifierList': AST.SpecifierQualifierList,
5110   'AST_StatementBlock': AST.StatementBlock,
5111   'AST_StatementBreak': AST.StatementBreak,
5112   'AST_StatementCase': AST.StatementCase,
5113   'AST_StatementContinue': AST.StatementContinue,
5114   'AST_StatementDefault': AST.StatementDefault,
5115   'AST_StatementDoWhile': AST.StatementDoWhile,
5116   'AST_StatementExpression': AST.StatementExpression,
5117   'AST_StatementFor': AST.StatementFor,
5118   'AST_StatementGoto': AST.StatementGoto,
5119   'AST_StatementIf': AST.StatementIf,
5120   'AST_StatementIfElse': AST.StatementIfElse,
5121   'AST_StatementLabel': AST.StatementLabel,
5122   'AST_StatementReturn': AST.StatementReturn,
5123   'AST_StatementSwitch': AST.StatementSwitch,
5124   'AST_StatementWhile': AST.StatementWhile,
5125   'AST_StaticAssertDeclaration': AST.StaticAssertDeclaration,
5126   'AST_StorageClassSpecifier': AST.StorageClassSpecifier,
5127   'AST_StructDeclaration': AST.StructDeclaration,
5128   'AST_StructDeclarationList': AST.StructDeclarationList,
5129   'AST_StructDeclarator': AST.StructDeclarator,
5130   'AST_StructDeclaratorList': AST.StructDeclaratorList,
5131   'AST_StructSpecifier': AST.StructSpecifier,
5132   'AST_TypeName': AST.TypeName,
5133   'AST_TypeQualifier': AST.TypeQualifier,
5134   'AST_TypeQualifierList': AST.TypeQualifierList,
5135   'AST_TypeQualifierOrStaticList': AST.TypeQualifierOrStaticList,
5136   'AST_TypeSpecifier': AST.TypeSpecifier,
5137   'AST_UnionSpecifier': AST.UnionSpecifier,
5138   'AST_TranslationUnit': AST.TranslationUnit
5139 }
5140 def factory(tag, attrib = {}, *args, **kwargs):
5141   return tag_to_class.get(tag, element.Element)(tag, attrib, *args, **kwargs)
5142 # GENERATE END