Rename plex to pilex, rename PLex object and prefix to AST
authorNick Downing <downing.nick@gmail.com>
Tue, 11 Sep 2018 05:17:21 +0000 (15:17 +1000)
committerNick Downing <downing.nick@gmail.com>
Tue, 11 Sep 2018 05:38:10 +0000 (15:38 +1000)
ast.py
generate_flex.py
generate_py.py
lex-yacc-examples/Makefile
pilex.py [moved from bootstrap_plex.py with 76% similarity]
tests/Makefile

diff --git a/ast.py b/ast.py
index 6ebcbc9..3e6f5b4 100644 (file)
--- a/ast.py
+++ b/ast.py
@@ -32,7 +32,7 @@ class Item(element.Element):
   # GENERATE END
   def post_process(
     self,
-    plex,
+    _ast,
     section,
     name_to_start_condition,
     all_start_conditions,
@@ -42,13 +42,13 @@ class Item(element.Element):
   ):
     raise NotImplementedError
 
-class PLex(element.Element):
+class AST(element.Element):
   # internal classes
   class StartCondition(element.Element):
     # GENERATE ELEMENT(str name, bool exclusive, list(ref) rules, list(ref) bol_rules, int eof_action) BEGIN
     def __init__(
       self,
-      tag = 'PLex_StartCondition',
+      tag = 'AST_StartCondition',
       attrib = {},
       text = '',
       children = [],
@@ -144,7 +144,7 @@ class PLex(element.Element):
     def __repr__(self):
       params = []
       self.repr_serialize(params)
-      return 'ast.PLex.StartCondition({0:s})'.format(', '.join(params))
+      return 'ast.AST.StartCondition({0:s})'.format(', '.join(params))
     # GENERATE END
 
   # syntax classes
@@ -152,7 +152,7 @@ class PLex(element.Element):
     # GENERATE ELEMENT() BEGIN
     def __init__(
       self,
-      tag = 'PLex_String',
+      tag = 'AST_String',
       attrib = {},
       text = '',
       children = []
@@ -173,14 +173,14 @@ class PLex(element.Element):
     def __repr__(self):
       params = []
       self.repr_serialize(params)
-      return 'ast.PLex.String({0:s})'.format(', '.join(params))
+      return 'ast.AST.String({0:s})'.format(', '.join(params))
     # GENERATE END
 
   class Text(element.Element):
     # GENERATE ELEMENT() BEGIN
     def __init__(
       self,
-      tag = 'PLex_Text',
+      tag = 'AST_Text',
       attrib = {},
       text = '',
       children = []
@@ -201,7 +201,7 @@ class PLex(element.Element):
     def __repr__(self):
       params = []
       self.repr_serialize(params)
-      return 'ast.PLex.Text({0:s})'.format(', '.join(params))
+      return 'ast.AST.Text({0:s})'.format(', '.join(params))
     # GENERATE END
     def get_text(self):
       return element.get_text(self, 0)
@@ -210,12 +210,12 @@ class PLex(element.Element):
     # GENERATE ELEMENT() BEGIN
     def __init__(
       self,
-      tag = 'PLex_Name',
+      tag = 'AST_Name',
       attrib = {},
       text = '',
       children = []
     ):
-      PLex.Text.__init__(
+      AST.Text.__init__(
         self,
         tag,
         attrib,
@@ -223,7 +223,7 @@ class PLex(element.Element):
         children
       )
     def copy(self, factory = None):
-      result = PLex.Text.copy(
+      result = AST.Text.copy(
         self,
         Name if factory is None else factory
       )
@@ -231,7 +231,7 @@ class PLex(element.Element):
     def __repr__(self):
       params = []
       self.repr_serialize(params)
-      return 'ast.PLex.Name({0:s})'.format(', '.join(params))
+      return 'ast.AST.Name({0:s})'.format(', '.join(params))
     # GENERATE END
 
   class Section1Or2(element.Element):
@@ -239,7 +239,7 @@ class PLex(element.Element):
       # GENERATE ELEMENT() BEGIN
       def __init__(
         self,
-        tag = 'PLex_Section1Or2_CodeBlock',
+        tag = 'AST_Section1Or2_CodeBlock',
         attrib = {},
         text = '',
         children = []
@@ -260,11 +260,11 @@ class PLex(element.Element):
       def __repr__(self):
         params = []
         self.repr_serialize(params)
-        return 'ast.PLex.Section1Or2.CodeBlock({0:s})'.format(', '.join(params))
+        return 'ast.AST.Section1Or2.CodeBlock({0:s})'.format(', '.join(params))
       # GENERATE END
       def post_process(
         self,
-        plex,
+        _ast,
         section,
         name_to_start_condition,
         all_start_conditions,
@@ -278,7 +278,7 @@ class PLex(element.Element):
     # GENERATE ELEMENT(list(ref) code_blocks_text) BEGIN
     def __init__(
       self,
-      tag = 'PLex_Section1Or2',
+      tag = 'AST_Section1Or2',
       attrib = {},
       text = '',
       children = [],
@@ -322,11 +322,11 @@ class PLex(element.Element):
     def __repr__(self):
       params = []
       self.repr_serialize(params)
-      return 'ast.PLex.Section1Or2({0:s})'.format(', '.join(params))
+      return 'ast.AST.Section1Or2({0:s})'.format(', '.join(params))
     # GENERATE END
     def post_process(
       self,
-      plex,
+      _ast,
       name_to_start_condition,
       all_start_conditions,
       inclusive_start_conditions
@@ -335,7 +335,7 @@ class PLex(element.Element):
       continued_action = False
       for i in self:
         continued_action = i.post_process(
-          plex,
+          _ast,
           self,
           name_to_start_condition,
           all_start_conditions,
@@ -351,7 +351,7 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Option',
+          tag = 'AST_Section1_Options_Option',
           attrib = {},
           text = '',
           children = []
@@ -372,7 +372,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Option({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Option({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           raise NotImplementedError
@@ -381,13 +381,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT(bool value) BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_BoolOption',
+          tag = 'AST_Section1_Options_BoolOption',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.Option.__init__(
+          AST.Section1.Options.Option.__init__(
             self,
             tag,
             attrib,
@@ -400,20 +400,20 @@ class PLex(element.Element):
             value
           )
         def serialize(self, ref_list):
-          PLex.Section1.Options.Option.serialize(self, ref_list)
+          AST.Section1.Options.Option.serialize(self, ref_list)
           self.set('value', element.serialize_bool(self.value))
         def deserialize(self, ref_list):
-          PLex.Section1.Options.Option.deserialize(self, ref_list)
+          AST.Section1.Options.Option.deserialize(self, ref_list)
           self.value = element.deserialize_bool(self.get('value', 'false'))
         def copy(self, factory = None):
-          result = PLex.Section1.Options.Option.copy(
+          result = AST.Section1.Options.Option.copy(
             self,
             BoolOption if factory is None else factory
           )
           result.value = self.value
           return result
         def repr_serialize(self, params):
-          PLex.Section1.Options.Option.repr_serialize(self, params)
+          AST.Section1.Options.Option.repr_serialize(self, params)
           if self.value != False:
             params.append(
               'value = {0:s}'.format(repr(self.value))
@@ -421,20 +421,20 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.BoolOption({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.BoolOption({0:s})'.format(', '.join(params))
         # GENERATE END
 
       class Align(BoolOption):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Align',
+          tag = 'AST_Section1_Options_Align',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -443,7 +443,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Align if factory is None else factory
           )
@@ -451,7 +451,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Align({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Align({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.align = self.value
@@ -460,13 +460,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_AlwaysInteractive',
+          tag = 'AST_Section1_Options_AlwaysInteractive',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -475,7 +475,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             AlwaysInteractive if factory is None else factory
           )
@@ -483,7 +483,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.AlwaysInteractive({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.AlwaysInteractive({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.always_interactive = self.value
@@ -492,13 +492,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Array',
+          tag = 'AST_Section1_Options_Array',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -507,7 +507,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Array if factory is None else factory
           )
@@ -515,7 +515,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Array({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Array({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.array = self.value
@@ -524,13 +524,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Backup',
+          tag = 'AST_Section1_Options_Backup',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -539,7 +539,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Backup if factory is None else factory
           )
@@ -547,7 +547,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Backup({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Backup({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.backup = self.value
@@ -556,13 +556,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_BisonBridge',
+          tag = 'AST_Section1_Options_BisonBridge',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -571,7 +571,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             BisonBridge if factory is None else factory
           )
@@ -579,7 +579,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.BisonBridge({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.BisonBridge({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.bison_bridge = self.value
@@ -588,13 +588,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_BisonLocations',
+          tag = 'AST_Section1_Options_BisonLocations',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -603,7 +603,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             BisonLocations if factory is None else factory
           )
@@ -611,7 +611,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.BisonLocations({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.BisonLocations({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.bison_locations = self.value
@@ -620,13 +620,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Caseless',
+          tag = 'AST_Section1_Options_Caseless',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -635,7 +635,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Caseless if factory is None else factory
           )
@@ -643,7 +643,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Caseless({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Caseless({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.caseless = self.value
@@ -652,13 +652,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_CPlusPlus',
+          tag = 'AST_Section1_Options_CPlusPlus',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -667,7 +667,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             CPlusPlus if factory is None else factory
           )
@@ -675,7 +675,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.CPlusPlus({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.CPlusPlus({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.c_plus_plus = self.value
@@ -684,13 +684,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Debug',
+          tag = 'AST_Section1_Options_Debug',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -699,7 +699,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Debug if factory is None else factory
           )
@@ -707,7 +707,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Debug({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Debug({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.debug = self.value
@@ -716,13 +716,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Default',
+          tag = 'AST_Section1_Options_Default',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -731,7 +731,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Default if factory is None else factory
           )
@@ -739,7 +739,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Default({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Default({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.default = self.value
@@ -748,13 +748,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_ECS',
+          tag = 'AST_Section1_Options_ECS',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -763,7 +763,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             ECS if factory is None else factory
           )
@@ -771,7 +771,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.ECS({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.ECS({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.ecs = self.value
@@ -780,13 +780,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_ExtraType',
+          tag = 'AST_Section1_Options_ExtraType',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -795,7 +795,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             ExtraType if factory is None else factory
           )
@@ -803,7 +803,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.ExtraType({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.ExtraType({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.extra_type = self[0][0].get_text()
@@ -812,13 +812,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Fast',
+          tag = 'AST_Section1_Options_Fast',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -827,7 +827,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Fast if factory is None else factory
           )
@@ -835,7 +835,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Fast({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Fast({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.fast = self.value
@@ -844,13 +844,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Full',
+          tag = 'AST_Section1_Options_Full',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -859,7 +859,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Full if factory is None else factory
           )
@@ -867,7 +867,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Full({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Full({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.full = self.value
@@ -876,13 +876,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_HeaderFile',
+          tag = 'AST_Section1_Options_HeaderFile',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -891,7 +891,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             HeaderFile if factory is None else factory
           )
@@ -899,7 +899,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.HeaderFile({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.HeaderFile({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.header_file = self[0][0].get_text()
@@ -908,13 +908,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Input',
+          tag = 'AST_Section1_Options_Input',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -923,7 +923,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Input if factory is None else factory
           )
@@ -931,7 +931,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Input({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Input({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.input = self.value
@@ -940,13 +940,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Interactive',
+          tag = 'AST_Section1_Options_Interactive',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -955,7 +955,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Interactive if factory is None else factory
           )
@@ -963,7 +963,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Interactive({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Interactive({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.interactive = self.value
@@ -972,13 +972,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_LexCompat',
+          tag = 'AST_Section1_Options_LexCompat',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -987,7 +987,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             LexCompat if factory is None else factory
           )
@@ -995,7 +995,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.LexCompat({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.LexCompat({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.lex_compat = self.value
@@ -1004,13 +1004,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Line',
+          tag = 'AST_Section1_Options_Line',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1019,7 +1019,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Line if factory is None else factory
           )
@@ -1027,7 +1027,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Line({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Line({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.line = self.value
@@ -1036,13 +1036,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Main',
+          tag = 'AST_Section1_Options_Main',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1051,7 +1051,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Main if factory is None else factory
           )
@@ -1059,7 +1059,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Main({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Main({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.main = self.value
@@ -1068,13 +1068,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_MetaECS',
+          tag = 'AST_Section1_Options_MetaECS',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1083,7 +1083,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             MetaECS if factory is None else factory
           )
@@ -1091,7 +1091,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.MetaECS({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.MetaECS({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.meta_ecs = self.value
@@ -1100,13 +1100,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_NeverInteractive',
+          tag = 'AST_Section1_Options_NeverInteractive',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1115,7 +1115,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             NeverInteractive if factory is None else factory
           )
@@ -1123,7 +1123,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.NeverInteractive({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.NeverInteractive({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.never_interactive = self.value
@@ -1132,13 +1132,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_OutFile',
+          tag = 'AST_Section1_Options_OutFile',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1147,7 +1147,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             OutFile if factory is None else factory
           )
@@ -1155,7 +1155,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.OutFile({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.OutFile({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.outfile = self[0][0].get_text()
@@ -1164,13 +1164,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_PerfReport',
+          tag = 'AST_Section1_Options_PerfReport',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1179,7 +1179,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             PerfReport if factory is None else factory
           )
@@ -1187,7 +1187,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.PerfReport({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.PerfReport({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.perf_report = self.value
@@ -1196,13 +1196,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_PosixCompat',
+          tag = 'AST_Section1_Options_PosixCompat',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1211,7 +1211,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             PosixCompat if factory is None else factory
           )
@@ -1219,7 +1219,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.PosixCompat({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.PosixCompat({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.posix_compat = self.value
@@ -1228,13 +1228,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Prefix',
+          tag = 'AST_Section1_Options_Prefix',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1243,7 +1243,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Prefix if factory is None else factory
           )
@@ -1251,7 +1251,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Prefix({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Prefix({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.prefix = self[0][0].get_text()
@@ -1260,13 +1260,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Read',
+          tag = 'AST_Section1_Options_Read',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1275,7 +1275,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Read if factory is None else factory
           )
@@ -1283,7 +1283,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Read({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Read({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.read = self.value
@@ -1292,13 +1292,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Reentrant',
+          tag = 'AST_Section1_Options_Reentrant',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1307,7 +1307,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Reentrant if factory is None else factory
           )
@@ -1315,7 +1315,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Reentrant({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Reentrant({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.reentrant = self.value
@@ -1324,13 +1324,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Reject',
+          tag = 'AST_Section1_Options_Reject',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1339,7 +1339,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Reject if factory is None else factory
           )
@@ -1347,7 +1347,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Reject({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Reject({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.reject = self.value
@@ -1356,13 +1356,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_SevenBit',
+          tag = 'AST_Section1_Options_SevenBit',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1371,7 +1371,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             SevenBit if factory is None else factory
           )
@@ -1379,7 +1379,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.SevenBit({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.SevenBit({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.seven_bit = self.value
@@ -1388,13 +1388,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Stack',
+          tag = 'AST_Section1_Options_Stack',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1403,7 +1403,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Stack if factory is None else factory
           )
@@ -1411,7 +1411,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Stack({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Stack({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.stack = self.value
@@ -1420,13 +1420,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_StdInit',
+          tag = 'AST_Section1_Options_StdInit',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1435,7 +1435,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             StdInit if factory is None else factory
           )
@@ -1443,7 +1443,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.StdInit({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.StdInit({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.stdinit = self.value
@@ -1452,13 +1452,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_StdOut',
+          tag = 'AST_Section1_Options_StdOut',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1467,7 +1467,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             StdOut if factory is None else factory
           )
@@ -1475,7 +1475,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.StdOut({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.StdOut({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.stdout = self.value
@@ -1484,13 +1484,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_TablesFile',
+          tag = 'AST_Section1_Options_TablesFile',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1499,7 +1499,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             TablesFile if factory is None else factory
           )
@@ -1507,7 +1507,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.TablesFile({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.TablesFile({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.tables_file = self[0][0].get_text()
@@ -1516,13 +1516,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_TablesVerify',
+          tag = 'AST_Section1_Options_TablesVerify',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1531,7 +1531,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             TablesVerify if factory is None else factory
           )
@@ -1539,7 +1539,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.TablesVerify({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.TablesVerify({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.tables_verify = self.value
@@ -1548,13 +1548,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_UniStd',
+          tag = 'AST_Section1_Options_UniStd',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1563,7 +1563,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             UniStd if factory is None else factory
           )
@@ -1571,7 +1571,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.UniStd({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.UniStd({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.unistd = self.value
@@ -1580,13 +1580,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Unput',
+          tag = 'AST_Section1_Options_Unput',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1595,7 +1595,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Unput if factory is None else factory
           )
@@ -1603,7 +1603,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Unput({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Unput({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.unput = self.value
@@ -1612,13 +1612,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Verbose',
+          tag = 'AST_Section1_Options_Verbose',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1627,7 +1627,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Verbose if factory is None else factory
           )
@@ -1635,7 +1635,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Verbose({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Verbose({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.verbose = self.value
@@ -1644,13 +1644,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_Warn',
+          tag = 'AST_Section1_Options_Warn',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1659,7 +1659,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             Warn if factory is None else factory
           )
@@ -1667,7 +1667,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.Warn({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.Warn({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.warn = self.value
@@ -1676,13 +1676,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYAlloc',
+          tag = 'AST_Section1_Options_YYAlloc',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1691,7 +1691,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYAlloc if factory is None else factory
           )
@@ -1699,7 +1699,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYAlloc({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYAlloc({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyalloc = self.value
@@ -1708,13 +1708,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYClass',
+          tag = 'AST_Section1_Options_YYClass',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1723,7 +1723,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYClass if factory is None else factory
           )
@@ -1731,7 +1731,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYClass({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYClass({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyclass = self[0][0].get_text()
@@ -1740,13 +1740,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYFree',
+          tag = 'AST_Section1_Options_YYFree',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1755,7 +1755,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYFree if factory is None else factory
           )
@@ -1763,7 +1763,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYFree({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYFree({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyfree = self.value
@@ -1772,13 +1772,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYGetDebug',
+          tag = 'AST_Section1_Options_YYGetDebug',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1787,7 +1787,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYGetDebug if factory is None else factory
           )
@@ -1795,7 +1795,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYGetDebug({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYGetDebug({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyget_debug = self.value
@@ -1804,13 +1804,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYGetExtra',
+          tag = 'AST_Section1_Options_YYGetExtra',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1819,7 +1819,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYGetExtra if factory is None else factory
           )
@@ -1827,7 +1827,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYGetExtra({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYGetExtra({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyget_extra = self.value
@@ -1836,13 +1836,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYGetIn',
+          tag = 'AST_Section1_Options_YYGetIn',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1851,7 +1851,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYGetIn if factory is None else factory
           )
@@ -1859,7 +1859,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYGetIn({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYGetIn({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyget_in = self.value
@@ -1868,13 +1868,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYGetLeng',
+          tag = 'AST_Section1_Options_YYGetLeng',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1883,7 +1883,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYGetLeng if factory is None else factory
           )
@@ -1891,7 +1891,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYGetLeng({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYGetLeng({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyget_leng = self.value
@@ -1900,13 +1900,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYGetLineNo',
+          tag = 'AST_Section1_Options_YYGetLineNo',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1915,7 +1915,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYGetLineNo if factory is None else factory
           )
@@ -1923,7 +1923,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYGetLineNo({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYGetLineNo({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyget_lineno = self.value
@@ -1932,13 +1932,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYGetLLoc',
+          tag = 'AST_Section1_Options_YYGetLLoc',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1947,7 +1947,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYGetLLoc if factory is None else factory
           )
@@ -1955,7 +1955,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYGetLLoc({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYGetLLoc({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyget_lloc = self.value
@@ -1964,13 +1964,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYGetLVal',
+          tag = 'AST_Section1_Options_YYGetLVal',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -1979,7 +1979,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYGetLVal if factory is None else factory
           )
@@ -1987,7 +1987,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYGetLVal({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYGetLVal({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyget_lval = self.value
@@ -1996,13 +1996,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYGetOut',
+          tag = 'AST_Section1_Options_YYGetOut',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2011,7 +2011,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYGetOut if factory is None else factory
           )
@@ -2019,7 +2019,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYGetOut({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYGetOut({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyget_out = self.value
@@ -2028,13 +2028,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYGetText',
+          tag = 'AST_Section1_Options_YYGetText',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2043,7 +2043,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYGetText if factory is None else factory
           )
@@ -2051,7 +2051,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYGetText({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYGetText({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyget_text = self.value
@@ -2060,13 +2060,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYLineNo',
+          tag = 'AST_Section1_Options_YYLineNo',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2075,7 +2075,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYLineNo if factory is None else factory
           )
@@ -2083,7 +2083,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYLineNo({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYLineNo({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yylineno = self.value
@@ -2092,13 +2092,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYMore',
+          tag = 'AST_Section1_Options_YYMore',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2107,7 +2107,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYMore if factory is None else factory
           )
@@ -2115,7 +2115,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYMore({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYMore({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yymore = self.value
@@ -2124,13 +2124,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYPopState',
+          tag = 'AST_Section1_Options_YYPopState',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2139,7 +2139,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYPopState if factory is None else factory
           )
@@ -2147,7 +2147,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYPopState({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYPopState({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yy_pop_state = self.value
@@ -2156,13 +2156,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYPushState',
+          tag = 'AST_Section1_Options_YYPushState',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2171,7 +2171,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYPushState if factory is None else factory
           )
@@ -2179,7 +2179,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYPushState({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYPushState({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yy_push_state = self.value
@@ -2188,13 +2188,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYRealloc',
+          tag = 'AST_Section1_Options_YYRealloc',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2203,7 +2203,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYRealloc if factory is None else factory
           )
@@ -2211,7 +2211,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYRealloc({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYRealloc({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyrealloc = self.value
@@ -2220,13 +2220,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYScanBuffer',
+          tag = 'AST_Section1_Options_YYScanBuffer',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2235,7 +2235,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYScanBuffer if factory is None else factory
           )
@@ -2243,7 +2243,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYScanBuffer({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYScanBuffer({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yy_scan_buffer = self.value
@@ -2252,13 +2252,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYScanBytes',
+          tag = 'AST_Section1_Options_YYScanBytes',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2267,7 +2267,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYScanBytes if factory is None else factory
           )
@@ -2275,7 +2275,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYScanBytes({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYScanBytes({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yy_scan_bytes = self.value
@@ -2284,13 +2284,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYScanString',
+          tag = 'AST_Section1_Options_YYScanString',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2299,7 +2299,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYScanString if factory is None else factory
           )
@@ -2307,7 +2307,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYScanString({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYScanString({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yy_scan_string = self.value
@@ -2316,13 +2316,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYSetDebug',
+          tag = 'AST_Section1_Options_YYSetDebug',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2331,7 +2331,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYSetDebug if factory is None else factory
           )
@@ -2339,7 +2339,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYSetDebug({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYSetDebug({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyset_debug = self.value
@@ -2348,13 +2348,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYSetExtra',
+          tag = 'AST_Section1_Options_YYSetExtra',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2363,7 +2363,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYSetExtra if factory is None else factory
           )
@@ -2371,7 +2371,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYSetExtra({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYSetExtra({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyset_extra = self.value
@@ -2380,13 +2380,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYSetIn',
+          tag = 'AST_Section1_Options_YYSetIn',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2395,7 +2395,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYSetIn if factory is None else factory
           )
@@ -2403,7 +2403,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYSetIn({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYSetIn({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyset_in = self.value
@@ -2412,13 +2412,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYSetLineNo',
+          tag = 'AST_Section1_Options_YYSetLineNo',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2427,7 +2427,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYSetLineNo if factory is None else factory
           )
@@ -2435,7 +2435,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYSetLineNo({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYSetLineNo({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyset_lineno = self.value
@@ -2444,13 +2444,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYSetLLoc',
+          tag = 'AST_Section1_Options_YYSetLLoc',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2459,7 +2459,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYSetLLoc if factory is None else factory
           )
@@ -2467,7 +2467,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYSetLLoc({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYSetLLoc({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyset_lloc = self.value
@@ -2476,13 +2476,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYSetLVal',
+          tag = 'AST_Section1_Options_YYSetLVal',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2491,7 +2491,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYSetLVal if factory is None else factory
           )
@@ -2499,7 +2499,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYSetLVal({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYSetLVal({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyset_lval = self.value
@@ -2508,13 +2508,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYSetOut',
+          tag = 'AST_Section1_Options_YYSetOut',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2523,7 +2523,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYSetOut if factory is None else factory
           )
@@ -2531,7 +2531,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYSetOut({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYSetOut({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yyset_out = self.value
@@ -2540,13 +2540,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYTopState',
+          tag = 'AST_Section1_Options_YYTopState',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2555,7 +2555,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYTopState if factory is None else factory
           )
@@ -2563,7 +2563,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYTopState({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYTopState({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yy_top_state = self.value
@@ -2572,13 +2572,13 @@ class PLex(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section1_Options_YYWrap',
+          tag = 'AST_Section1_Options_YYWrap',
           attrib = {},
           text = '',
           children = [],
           value = False
         ):
-          PLex.Section1.Options.BoolOption.__init__(
+          AST.Section1.Options.BoolOption.__init__(
             self,
             tag,
             attrib,
@@ -2587,7 +2587,7 @@ class PLex(element.Element):
             value
           )
         def copy(self, factory = None):
-          result = PLex.Section1.Options.BoolOption.copy(
+          result = AST.Section1.Options.BoolOption.copy(
             self,
             YYWrap if factory is None else factory
           )
@@ -2595,7 +2595,7 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section1.Options.YYWrap({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section1.Options.YYWrap({0:s})'.format(', '.join(params))
         # GENERATE END
         def post_process(self, section):
           section.yywrap = self.value
@@ -2603,7 +2603,7 @@ class PLex(element.Element):
       # GENERATE ELEMENT() BEGIN
       def __init__(
         self,
-        tag = 'PLex_Section1_Options',
+        tag = 'AST_Section1_Options',
         attrib = {},
         text = '',
         children = []
@@ -2624,11 +2624,11 @@ class PLex(element.Element):
       def __repr__(self):
         params = []
         self.repr_serialize(params)
-        return 'ast.PLex.Section1.Options({0:s})'.format(', '.join(params))
+        return 'ast.AST.Section1.Options({0:s})'.format(', '.join(params))
       # GENERATE END
       def post_process(
         self,
-        plex,
+        _ast,
         section,
         name_to_start_condition,
         all_start_conditions,
@@ -2644,7 +2644,7 @@ class PLex(element.Element):
       # GENERATE ELEMENT(bool exclusive) BEGIN
       def __init__(
         self,
-        tag = 'PLex_Section1_StartConditions',
+        tag = 'AST_Section1_StartConditions',
         attrib = {},
         text = '',
         children = [],
@@ -2684,11 +2684,11 @@ class PLex(element.Element):
       def __repr__(self):
         params = []
         self.repr_serialize(params)
-        return 'ast.PLex.Section1.StartConditions({0:s})'.format(', '.join(params))
+        return 'ast.AST.Section1.StartConditions({0:s})'.format(', '.join(params))
       # GENERATE END
       def post_process(
         self,
-        plex,
+        _ast,
         section,
         name_to_start_condition,
         all_start_conditions,
@@ -2699,12 +2699,12 @@ class PLex(element.Element):
         for i in self:
           name = i.get_text()
           assert name not in name_to_start_condition
-          name_to_start_condition[name] = len(plex.start_conditions)
-          all_start_conditions.add(len(plex.start_conditions))
+          name_to_start_condition[name] = len(_ast.start_conditions)
+          all_start_conditions.add(len(_ast.start_conditions))
           if not self.exclusive:
-            inclusive_start_conditions.add(len(plex.start_conditions))
-          plex.start_conditions.append(
-            PLex.StartCondition(
+            inclusive_start_conditions.add(len(_ast.start_conditions))
+          _ast.start_conditions.append(
+            AST.StartCondition(
               name = name,
               exclusive = self.exclusive,
               rules = [],
@@ -2717,7 +2717,7 @@ class PLex(element.Element):
     # GENERATE ELEMENT(bool align, bool always_interactive, bool array, bool backup, bool bison_bridge, bool bison_locations, bool caseless, bool c_plus_plus, bool debug, bool default, bool ecs, str extra_type, bool fast, bool full, str header_file, bool input, bool interactive, bool lex_compat, bool line, bool main, bool meta_ecs, bool never_interactive, str outfile, bool perf_report, bool posix_compat, str prefix, bool read, bool reentrant, bool reject, bool seven_bit, bool stack, bool stdinit, bool stdout, str tables_file, bool tables_verify, bool unistd, bool unput, bool verbose, bool warn, bool yyalloc, str yyclass, bool yyfree, bool yyget_debug, bool yyget_extra, bool yyget_in, bool yyget_leng, bool yyget_lineno, bool yyget_lloc, bool yyget_lval, bool yyget_out, bool yyget_text, bool yylineno, bool yymore, bool yy_pop_state, bool yy_push_state, bool yyrealloc, bool yy_scan_buffer, bool yy_scan_bytes, bool yy_scan_string, bool yyset_debug, bool yyset_extra, bool yyset_in, bool yyset_lineno, bool yyset_lloc, bool yyset_lval, bool yyset_out, bool yy_top_state, bool yywrap) BEGIN
     def __init__(
       self,
-      tag = 'PLex_Section1',
+      tag = 'AST_Section1',
       attrib = {},
       text = '',
       children = [],
@@ -2791,7 +2791,7 @@ class PLex(element.Element):
       yy_top_state = False,
       yywrap = False
     ):
-      PLex.Section1Or2.__init__(
+      AST.Section1Or2.__init__(
         self,
         tag,
         attrib,
@@ -3116,7 +3116,7 @@ class PLex(element.Element):
         yywrap
       )
     def serialize(self, ref_list):
-      PLex.Section1Or2.serialize(self, ref_list)
+      AST.Section1Or2.serialize(self, ref_list)
       self.set('align', element.serialize_bool(self.align))
       self.set('always_interactive', element.serialize_bool(self.always_interactive))
       self.set('array', element.serialize_bool(self.array))
@@ -3186,7 +3186,7 @@ class PLex(element.Element):
       self.set('yy_top_state', element.serialize_bool(self.yy_top_state))
       self.set('yywrap', element.serialize_bool(self.yywrap))
     def deserialize(self, ref_list):
-      PLex.Section1Or2.deserialize(self, ref_list)
+      AST.Section1Or2.deserialize(self, ref_list)
       self.align = element.deserialize_bool(self.get('align', 'false'))
       self.always_interactive = element.deserialize_bool(self.get('always_interactive', 'false'))
       self.array = element.deserialize_bool(self.get('array', 'false'))
@@ -3256,7 +3256,7 @@ class PLex(element.Element):
       self.yy_top_state = element.deserialize_bool(self.get('yy_top_state', 'false'))
       self.yywrap = element.deserialize_bool(self.get('yywrap', 'false'))
     def copy(self, factory = None):
-      result = PLex.Section1Or2.copy(
+      result = AST.Section1Or2.copy(
         self,
         Section1 if factory is None else factory
       )
@@ -3330,7 +3330,7 @@ class PLex(element.Element):
       result.yywrap = self.yywrap
       return result
     def repr_serialize(self, params):
-      PLex.Section1Or2.repr_serialize(self, params)
+      AST.Section1Or2.repr_serialize(self, params)
       if self.align != False:
         params.append(
           'align = {0:s}'.format(repr(self.align))
@@ -3606,11 +3606,11 @@ class PLex(element.Element):
     def __repr__(self):
       params = []
       self.repr_serialize(params)
-      return 'ast.PLex.Section1({0:s})'.format(', '.join(params))
+      return 'ast.AST.Section1({0:s})'.format(', '.join(params))
     # GENERATE END
     def post_process(
       self,
-      plex,
+      _ast,
       name_to_start_condition,
       all_start_conditions,
       inclusive_start_conditions
@@ -3683,9 +3683,9 @@ class PLex(element.Element):
       self.yyset_out = True
       self.yy_top_state = True
       self.yywrap = True
-      PLex.Section1Or2.post_process(
+      AST.Section1Or2.post_process(
         self,
-        plex,
+        _ast,
         name_to_start_condition,
         all_start_conditions,
         inclusive_start_conditions
@@ -3832,7 +3832,7 @@ class PLex(element.Element):
       # GENERATE ELEMENT() BEGIN
       def __init__(
         self,
-        tag = 'PLex_Section2_CompoundRule',
+        tag = 'AST_Section2_CompoundRule',
         attrib = {},
         text = '',
         children = []
@@ -3853,11 +3853,11 @@ class PLex(element.Element):
       def __repr__(self):
         params = []
         self.repr_serialize(params)
-        return 'ast.PLex.Section2.CompoundRule({0:s})'.format(', '.join(params))
+        return 'ast.AST.Section2.CompoundRule({0:s})'.format(', '.join(params))
       # GENERATE END
       def post_process(
         self,
-        plex,
+        _ast,
         section,
         name_to_start_condition,
         all_start_conditions,
@@ -3876,7 +3876,7 @@ class PLex(element.Element):
             )
         for i in self[1:]:
           continued_action = i.post_process(
-            plex,
+            _ast,
             section,
             name_to_start_condition,
             all_start_conditions,
@@ -3891,7 +3891,7 @@ class PLex(element.Element):
         # GENERATE ELEMENT(bool continued) BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section2_Rule_Action',
+          tag = 'AST_Section2_Rule_Action',
           attrib = {},
           text = '',
           children = [],
@@ -3931,14 +3931,14 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section2.Rule.Action({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section2.Rule.Action({0:s})'.format(', '.join(params))
         # GENERATE END
 
       class EOFRule(element.Element):
         # GENERATE ELEMENT() BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section2_Rule_EOFRule',
+          tag = 'AST_Section2_Rule_EOFRule',
           attrib = {},
           text = '',
           children = []
@@ -3959,14 +3959,14 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section2.Rule.EOFRule({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section2.Rule.EOFRule({0:s})'.format(', '.join(params))
         # GENERATE END
 
       class FLexRule(element.Element):
         # GENERATE ELEMENT(bool bol, int action) BEGIN
         def __init__(
           self,
-          tag = 'PLex_Section2_Rule_FLexRule',
+          tag = 'AST_Section2_Rule_FLexRule',
           attrib = {},
           text = '',
           children = [],
@@ -4019,13 +4019,13 @@ class PLex(element.Element):
         def __repr__(self):
           params = []
           self.repr_serialize(params)
-          return 'ast.PLex.Section2.Rule.FLexRule({0:s})'.format(', '.join(params))
+          return 'ast.AST.Section2.Rule.FLexRule({0:s})'.format(', '.join(params))
         # GENERATE END
  
       # GENERATE ELEMENT() BEGIN
       def __init__(
         self,
-        tag = 'PLex_Section2_Rule',
+        tag = 'AST_Section2_Rule',
         attrib = {},
         text = '',
         children = []
@@ -4046,11 +4046,11 @@ class PLex(element.Element):
       def __repr__(self):
         params = []
         self.repr_serialize(params)
-        return 'ast.PLex.Section2.Rule({0:s})'.format(', '.join(params))
+        return 'ast.AST.Section2.Rule({0:s})'.format(', '.join(params))
       # GENERATE END
       def post_process(
         self,
-        plex,
+        _ast,
         section,
         name_to_start_condition,
         all_start_conditions,
@@ -4066,42 +4066,42 @@ class PLex(element.Element):
             start_conditions.add(
               name_to_start_condition[i.get_text()]
             )
-        if isinstance(self[1], PLex.Section2.Rule.EOFRule):
+        if isinstance(self[1], AST.Section2.Rule.EOFRule):
           assert not continued_action
           if len(start_conditions) == 0:
             for i in all_start_conditions:
-              if plex.start_conditions[i].eof_action == 0:
-                plex.start_conditions[i].eof_action = (
-                  len(plex.eof_actions_text)
+              if _ast.start_conditions[i].eof_action == 0:
+                _ast.start_conditions[i].eof_action = (
+                  len(_ast.eof_actions_text)
                 )
           else:
             for i in start_conditions:
-              assert plex.start_conditions[i].eof_action == 0
-              plex.start_conditions[i].eof_action = (
-                len(plex.eof_actions_text)
+              assert _ast.start_conditions[i].eof_action == 0
+              _ast.start_conditions[i].eof_action = (
+                len(_ast.eof_actions_text)
               )
           assert not self[2].continued
-          plex.eof_actions_text.append(self[2][0])
-        elif isinstance(self[1], PLex.Section2.Rule.FLexRule):
+          _ast.eof_actions_text.append(self[2][0])
+        elif isinstance(self[1], AST.Section2.Rule.FLexRule):
           for i in (
             start_conditions
           if len(start_conditions) else
             inclusive_start_conditions
           ):
             if not self[1].bol:
-              plex.start_conditions[i].rules.append(self[1])
-            plex.start_conditions[i].bol_rules.append(self[1])
+              _ast.start_conditions[i].rules.append(self[1])
+            _ast.start_conditions[i].bol_rules.append(self[1])
           self[1][0].post_process(
-            caseless = plex[0].caseless
+            caseless = _ast[0].caseless
           ) # regex
           self[1][1].post_process(
-            caseless = plex[0].caseless
+            caseless = _ast[0].caseless
           ) # trailing context regex
-          self[1].action = len(plex.actions_text)
+          self[1].action = len(_ast.actions_text)
           if self[2].continued:
             continued_action = True
           else:
-            plex.actions_text.append(self[2][0])
+            _ast.actions_text.append(self[2][0])
             continued_action = False
             #def to_text(node):
             #  return ''.join(
@@ -4114,11 +4114,11 @@ class PLex(element.Element):
             #  )
             #text = '{0:s}/{1:s}'.format(to_text(self[1][0]), to_text(self[1][1]))
             #element.set_text(
-            #  plex.actions_text[-1],
+            #  _ast.actions_text[-1],
             #  0,
             #  'fprintf(stderr, "%d >>>%s<<< {0:s}\\n", yy_start, yytext);\n{1:s}'.format(
             #    text.replace('\\', '\\\\').replace('"', '\\"').replace('%', '%%'),
-            #    element.get_text(plex.actions_text[-1], 0)
+            #    element.get_text(_ast.actions_text[-1], 0)
             #  )
             #)
         else:
@@ -4129,7 +4129,7 @@ class PLex(element.Element):
       # GENERATE ELEMENT(bool wildcard) BEGIN
       def __init__(
         self,
-        tag = 'PLex_Section2_StartConditions',
+        tag = 'AST_Section2_StartConditions',
         attrib = {},
         text = '',
         children = [],
@@ -4169,19 +4169,19 @@ class PLex(element.Element):
       def __repr__(self):
         params = []
         self.repr_serialize(params)
-        return 'ast.PLex.Section2.StartConditions({0:s})'.format(', '.join(params))
+        return 'ast.AST.Section2.StartConditions({0:s})'.format(', '.join(params))
       # GENERATE END
 
     # GENERATE ELEMENT() BEGIN
     def __init__(
       self,
-      tag = 'PLex_Section2',
+      tag = 'AST_Section2',
       attrib = {},
       text = '',
       children = [],
       code_blocks_text = []
     ):
-      PLex.Section1Or2.__init__(
+      AST.Section1Or2.__init__(
         self,
         tag,
         attrib,
@@ -4190,7 +4190,7 @@ class PLex(element.Element):
         code_blocks_text
       )
     def copy(self, factory = None):
-      result = PLex.Section1Or2.copy(
+      result = AST.Section1Or2.copy(
         self,
         Section2 if factory is None else factory
       )
@@ -4198,19 +4198,19 @@ class PLex(element.Element):
     def __repr__(self):
       params = []
       self.repr_serialize(params)
-      return 'ast.PLex.Section2({0:s})'.format(', '.join(params))
+      return 'ast.AST.Section2({0:s})'.format(', '.join(params))
     # GENERATE END
 
   class Section3(Text):
     # GENERATE ELEMENT() BEGIN
     def __init__(
       self,
-      tag = 'PLex_Section3',
+      tag = 'AST_Section3',
       attrib = {},
       text = '',
       children = []
     ):
-      PLex.Text.__init__(
+      AST.Text.__init__(
         self,
         tag,
         attrib,
@@ -4218,7 +4218,7 @@ class PLex(element.Element):
         children
       )
     def copy(self, factory = None):
-      result = PLex.Text.copy(
+      result = AST.Text.copy(
         self,
         Section3 if factory is None else factory
       )
@@ -4226,13 +4226,13 @@ class PLex(element.Element):
     def __repr__(self):
       params = []
       self.repr_serialize(params)
-      return 'ast.PLex.Section3({0:s})'.format(', '.join(params))
+      return 'ast.AST.Section3({0:s})'.format(', '.join(params))
     # GENERATE END
 
   # GENERATE ELEMENT(list(ref) start_conditions, list(ref) actions_text, list(ref) eof_actions_text, int default_action) BEGIN
   def __init__(
     self,
-    tag = 'PLex',
+    tag = 'AST',
     attrib = {},
     text = '',
     children = [],
@@ -4289,7 +4289,7 @@ class PLex(element.Element):
   def copy(self, factory = None):
     result = element.Element.copy(
       self,
-      PLex if factory is None else factory
+      AST if factory is None else factory
     )
     result.start_conditions = self.start_conditions
     result.actions_text = self.actions_text
@@ -4323,13 +4323,13 @@ class PLex(element.Element):
   def __repr__(self):
     params = []
     self.repr_serialize(params)
-    return 'ast.PLex({0:s})'.format(', '.join(params))
+    return 'ast.AST({0:s})'.format(', '.join(params))
   # GENERATE END
 
   def post_process(self):
     # variables that will be serialized
     self.start_conditions = [
-      PLex.StartCondition(
+      AST.StartCondition(
         name = 'INITIAL',
         exclusive = False,
         rules = [],
@@ -4339,7 +4339,7 @@ class PLex(element.Element):
     ]
     self.actions_text = []
     self.eof_actions_text = [
-      PLex.Text(text = '\t\t\t\tyyterminate();\n')
+      AST.Text(text = '\t\t\t\tyyterminate();\n')
     ]
 
     # variables that won't be serialized
@@ -4362,7 +4362,7 @@ class PLex(element.Element):
     )
     self.default_action = len(self.actions_text)
     self.actions_text.append(
-      PLex.Text(
+      AST.Text(
         text = (
           'ECHO;\n'
         if self[0].default else
@@ -4428,94 +4428,94 @@ class PLex(element.Element):
 # GENERATE FACTORY(regex.factory) BEGIN
 tag_to_class = {
   'Item': Item,
-  'PLex': PLex,
-  'PLex_StartCondition': PLex.StartCondition,
-  'PLex_String': PLex.String,
-  'PLex_Text': PLex.Text,
-  'PLex_Name': PLex.Name,
-  'PLex_Section1Or2': PLex.Section1Or2,
-  'PLex_Section1Or2_CodeBlock': PLex.Section1Or2.CodeBlock,
-  'PLex_Section1': PLex.Section1,
-  'PLex_Section1_Options': PLex.Section1.Options,
-  'PLex_Section1_Options_Option': PLex.Section1.Options.Option,
-  'PLex_Section1_Options_BoolOption': PLex.Section1.Options.BoolOption,
-  'PLex_Section1_Options_Align': PLex.Section1.Options.Align,
-  'PLex_Section1_Options_AlwaysInteractive': PLex.Section1.Options.AlwaysInteractive,
-  'PLex_Section1_Options_Array': PLex.Section1.Options.Array,
-  'PLex_Section1_Options_Backup': PLex.Section1.Options.Backup,
-  'PLex_Section1_Options_BisonBridge': PLex.Section1.Options.BisonBridge,
-  'PLex_Section1_Options_BisonLocations': PLex.Section1.Options.BisonLocations,
-  'PLex_Section1_Options_Caseless': PLex.Section1.Options.Caseless,
-  'PLex_Section1_Options_CPlusPlus': PLex.Section1.Options.CPlusPlus,
-  'PLex_Section1_Options_Debug': PLex.Section1.Options.Debug,
-  'PLex_Section1_Options_Default': PLex.Section1.Options.Default,
-  'PLex_Section1_Options_ECS': PLex.Section1.Options.ECS,
-  'PLex_Section1_Options_ExtraType': PLex.Section1.Options.ExtraType,
-  'PLex_Section1_Options_Fast': PLex.Section1.Options.Fast,
-  'PLex_Section1_Options_Full': PLex.Section1.Options.Full,
-  'PLex_Section1_Options_HeaderFile': PLex.Section1.Options.HeaderFile,
-  'PLex_Section1_Options_Input': PLex.Section1.Options.Input,
-  'PLex_Section1_Options_Interactive': PLex.Section1.Options.Interactive,
-  'PLex_Section1_Options_LexCompat': PLex.Section1.Options.LexCompat,
-  'PLex_Section1_Options_Line': PLex.Section1.Options.Line,
-  'PLex_Section1_Options_Main': PLex.Section1.Options.Main,
-  'PLex_Section1_Options_MetaECS': PLex.Section1.Options.MetaECS,
-  'PLex_Section1_Options_NeverInteractive': PLex.Section1.Options.NeverInteractive,
-  'PLex_Section1_Options_OutFile': PLex.Section1.Options.OutFile,
-  'PLex_Section1_Options_PerfReport': PLex.Section1.Options.PerfReport,
-  'PLex_Section1_Options_PosixCompat': PLex.Section1.Options.PosixCompat,
-  'PLex_Section1_Options_Prefix': PLex.Section1.Options.Prefix,
-  'PLex_Section1_Options_Read': PLex.Section1.Options.Read,
-  'PLex_Section1_Options_Reentrant': PLex.Section1.Options.Reentrant,
-  'PLex_Section1_Options_Reject': PLex.Section1.Options.Reject,
-  'PLex_Section1_Options_SevenBit': PLex.Section1.Options.SevenBit,
-  'PLex_Section1_Options_Stack': PLex.Section1.Options.Stack,
-  'PLex_Section1_Options_StdInit': PLex.Section1.Options.StdInit,
-  'PLex_Section1_Options_StdOut': PLex.Section1.Options.StdOut,
-  'PLex_Section1_Options_TablesFile': PLex.Section1.Options.TablesFile,
-  'PLex_Section1_Options_TablesVerify': PLex.Section1.Options.TablesVerify,
-  'PLex_Section1_Options_UniStd': PLex.Section1.Options.UniStd,
-  'PLex_Section1_Options_Unput': PLex.Section1.Options.Unput,
-  'PLex_Section1_Options_Verbose': PLex.Section1.Options.Verbose,
-  'PLex_Section1_Options_Warn': PLex.Section1.Options.Warn,
-  'PLex_Section1_Options_YYAlloc': PLex.Section1.Options.YYAlloc,
-  'PLex_Section1_Options_YYClass': PLex.Section1.Options.YYClass,
-  'PLex_Section1_Options_YYFree': PLex.Section1.Options.YYFree,
-  'PLex_Section1_Options_YYGetDebug': PLex.Section1.Options.YYGetDebug,
-  'PLex_Section1_Options_YYGetExtra': PLex.Section1.Options.YYGetExtra,
-  'PLex_Section1_Options_YYGetIn': PLex.Section1.Options.YYGetIn,
-  'PLex_Section1_Options_YYGetLeng': PLex.Section1.Options.YYGetLeng,
-  'PLex_Section1_Options_YYGetLineNo': PLex.Section1.Options.YYGetLineNo,
-  'PLex_Section1_Options_YYGetLLoc': PLex.Section1.Options.YYGetLLoc,
-  'PLex_Section1_Options_YYGetLVal': PLex.Section1.Options.YYGetLVal,
-  'PLex_Section1_Options_YYGetOut': PLex.Section1.Options.YYGetOut,
-  'PLex_Section1_Options_YYGetText': PLex.Section1.Options.YYGetText,
-  'PLex_Section1_Options_YYLineNo': PLex.Section1.Options.YYLineNo,
-  'PLex_Section1_Options_YYMore': PLex.Section1.Options.YYMore,
-  'PLex_Section1_Options_YYPopState': PLex.Section1.Options.YYPopState,
-  'PLex_Section1_Options_YYPushState': PLex.Section1.Options.YYPushState,
-  'PLex_Section1_Options_YYRealloc': PLex.Section1.Options.YYRealloc,
-  'PLex_Section1_Options_YYScanBuffer': PLex.Section1.Options.YYScanBuffer,
-  'PLex_Section1_Options_YYScanBytes': PLex.Section1.Options.YYScanBytes,
-  'PLex_Section1_Options_YYScanString': PLex.Section1.Options.YYScanString,
-  'PLex_Section1_Options_YYSetDebug': PLex.Section1.Options.YYSetDebug,
-  'PLex_Section1_Options_YYSetExtra': PLex.Section1.Options.YYSetExtra,
-  'PLex_Section1_Options_YYSetIn': PLex.Section1.Options.YYSetIn,
-  'PLex_Section1_Options_YYSetLineNo': PLex.Section1.Options.YYSetLineNo,
-  'PLex_Section1_Options_YYSetLLoc': PLex.Section1.Options.YYSetLLoc,
-  'PLex_Section1_Options_YYSetLVal': PLex.Section1.Options.YYSetLVal,
-  'PLex_Section1_Options_YYSetOut': PLex.Section1.Options.YYSetOut,
-  'PLex_Section1_Options_YYTopState': PLex.Section1.Options.YYTopState,
-  'PLex_Section1_Options_YYWrap': PLex.Section1.Options.YYWrap,
-  'PLex_Section1_StartConditions': PLex.Section1.StartConditions,
-  'PLex_Section2': PLex.Section2,
-  'PLex_Section2_CompoundRule': PLex.Section2.CompoundRule,
-  'PLex_Section2_Rule': PLex.Section2.Rule,
-  'PLex_Section2_Rule_Action': PLex.Section2.Rule.Action,
-  'PLex_Section2_Rule_EOFRule': PLex.Section2.Rule.EOFRule,
-  'PLex_Section2_Rule_FLexRule': PLex.Section2.Rule.FLexRule,
-  'PLex_Section2_StartConditions': PLex.Section2.StartConditions,
-  'PLex_Section3': PLex.Section3
+  'AST': AST,
+  'AST_StartCondition': AST.StartCondition,
+  'AST_String': AST.String,
+  'AST_Text': AST.Text,
+  'AST_Name': AST.Name,
+  'AST_Section1Or2': AST.Section1Or2,
+  'AST_Section1Or2_CodeBlock': AST.Section1Or2.CodeBlock,
+  'AST_Section1': AST.Section1,
+  'AST_Section1_Options': AST.Section1.Options,
+  'AST_Section1_Options_Option': AST.Section1.Options.Option,
+  'AST_Section1_Options_BoolOption': AST.Section1.Options.BoolOption,
+  'AST_Section1_Options_Align': AST.Section1.Options.Align,
+  'AST_Section1_Options_AlwaysInteractive': AST.Section1.Options.AlwaysInteractive,
+  'AST_Section1_Options_Array': AST.Section1.Options.Array,
+  'AST_Section1_Options_Backup': AST.Section1.Options.Backup,
+  'AST_Section1_Options_BisonBridge': AST.Section1.Options.BisonBridge,
+  'AST_Section1_Options_BisonLocations': AST.Section1.Options.BisonLocations,
+  'AST_Section1_Options_Caseless': AST.Section1.Options.Caseless,
+  'AST_Section1_Options_CPlusPlus': AST.Section1.Options.CPlusPlus,
+  'AST_Section1_Options_Debug': AST.Section1.Options.Debug,
+  'AST_Section1_Options_Default': AST.Section1.Options.Default,
+  'AST_Section1_Options_ECS': AST.Section1.Options.ECS,
+  'AST_Section1_Options_ExtraType': AST.Section1.Options.ExtraType,
+  'AST_Section1_Options_Fast': AST.Section1.Options.Fast,
+  'AST_Section1_Options_Full': AST.Section1.Options.Full,
+  'AST_Section1_Options_HeaderFile': AST.Section1.Options.HeaderFile,
+  'AST_Section1_Options_Input': AST.Section1.Options.Input,
+  'AST_Section1_Options_Interactive': AST.Section1.Options.Interactive,
+  'AST_Section1_Options_LexCompat': AST.Section1.Options.LexCompat,
+  'AST_Section1_Options_Line': AST.Section1.Options.Line,
+  'AST_Section1_Options_Main': AST.Section1.Options.Main,
+  'AST_Section1_Options_MetaECS': AST.Section1.Options.MetaECS,
+  'AST_Section1_Options_NeverInteractive': AST.Section1.Options.NeverInteractive,
+  'AST_Section1_Options_OutFile': AST.Section1.Options.OutFile,
+  'AST_Section1_Options_PerfReport': AST.Section1.Options.PerfReport,
+  'AST_Section1_Options_PosixCompat': AST.Section1.Options.PosixCompat,
+  'AST_Section1_Options_Prefix': AST.Section1.Options.Prefix,
+  'AST_Section1_Options_Read': AST.Section1.Options.Read,
+  'AST_Section1_Options_Reentrant': AST.Section1.Options.Reentrant,
+  'AST_Section1_Options_Reject': AST.Section1.Options.Reject,
+  'AST_Section1_Options_SevenBit': AST.Section1.Options.SevenBit,
+  'AST_Section1_Options_Stack': AST.Section1.Options.Stack,
+  'AST_Section1_Options_StdInit': AST.Section1.Options.StdInit,
+  'AST_Section1_Options_StdOut': AST.Section1.Options.StdOut,
+  'AST_Section1_Options_TablesFile': AST.Section1.Options.TablesFile,
+  'AST_Section1_Options_TablesVerify': AST.Section1.Options.TablesVerify,
+  'AST_Section1_Options_UniStd': AST.Section1.Options.UniStd,
+  'AST_Section1_Options_Unput': AST.Section1.Options.Unput,
+  'AST_Section1_Options_Verbose': AST.Section1.Options.Verbose,
+  'AST_Section1_Options_Warn': AST.Section1.Options.Warn,
+  'AST_Section1_Options_YYAlloc': AST.Section1.Options.YYAlloc,
+  'AST_Section1_Options_YYClass': AST.Section1.Options.YYClass,
+  'AST_Section1_Options_YYFree': AST.Section1.Options.YYFree,
+  'AST_Section1_Options_YYGetDebug': AST.Section1.Options.YYGetDebug,
+  'AST_Section1_Options_YYGetExtra': AST.Section1.Options.YYGetExtra,
+  'AST_Section1_Options_YYGetIn': AST.Section1.Options.YYGetIn,
+  'AST_Section1_Options_YYGetLeng': AST.Section1.Options.YYGetLeng,
+  'AST_Section1_Options_YYGetLineNo': AST.Section1.Options.YYGetLineNo,
+  'AST_Section1_Options_YYGetLLoc': AST.Section1.Options.YYGetLLoc,
+  'AST_Section1_Options_YYGetLVal': AST.Section1.Options.YYGetLVal,
+  'AST_Section1_Options_YYGetOut': AST.Section1.Options.YYGetOut,
+  'AST_Section1_Options_YYGetText': AST.Section1.Options.YYGetText,
+  'AST_Section1_Options_YYLineNo': AST.Section1.Options.YYLineNo,
+  'AST_Section1_Options_YYMore': AST.Section1.Options.YYMore,
+  'AST_Section1_Options_YYPopState': AST.Section1.Options.YYPopState,
+  'AST_Section1_Options_YYPushState': AST.Section1.Options.YYPushState,
+  'AST_Section1_Options_YYRealloc': AST.Section1.Options.YYRealloc,
+  'AST_Section1_Options_YYScanBuffer': AST.Section1.Options.YYScanBuffer,
+  'AST_Section1_Options_YYScanBytes': AST.Section1.Options.YYScanBytes,
+  'AST_Section1_Options_YYScanString': AST.Section1.Options.YYScanString,
+  'AST_Section1_Options_YYSetDebug': AST.Section1.Options.YYSetDebug,
+  'AST_Section1_Options_YYSetExtra': AST.Section1.Options.YYSetExtra,
+  'AST_Section1_Options_YYSetIn': AST.Section1.Options.YYSetIn,
+  'AST_Section1_Options_YYSetLineNo': AST.Section1.Options.YYSetLineNo,
+  'AST_Section1_Options_YYSetLLoc': AST.Section1.Options.YYSetLLoc,
+  'AST_Section1_Options_YYSetLVal': AST.Section1.Options.YYSetLVal,
+  'AST_Section1_Options_YYSetOut': AST.Section1.Options.YYSetOut,
+  'AST_Section1_Options_YYTopState': AST.Section1.Options.YYTopState,
+  'AST_Section1_Options_YYWrap': AST.Section1.Options.YYWrap,
+  'AST_Section1_StartConditions': AST.Section1.StartConditions,
+  'AST_Section2': AST.Section2,
+  'AST_Section2_CompoundRule': AST.Section2.CompoundRule,
+  'AST_Section2_Rule': AST.Section2.Rule,
+  'AST_Section2_Rule_Action': AST.Section2.Rule.Action,
+  'AST_Section2_Rule_EOFRule': AST.Section2.Rule.EOFRule,
+  'AST_Section2_Rule_FLexRule': AST.Section2.Rule.FLexRule,
+  'AST_Section2_StartConditions': AST.Section2.StartConditions,
+  'AST_Section3': AST.Section3
 }
 def factory(tag, attrib = {}, *args, **kwargs):
   return tag_to_class.get(tag, regex.factory)(tag, attrib, *args, **kwargs)
index f2498e9..549225a 100644 (file)
@@ -1,12 +1,12 @@
 import os
 import regex
 
-def generate_flex(plex, home_dir, skel_file, out_file):
-  _nfa = plex.to_nfa()
+def generate_flex(_ast, home_dir, skel_file, out_file):
+  _nfa = _ast.to_nfa()
 
   # end of buffer expression (do it here because only necessary for flex)
   _regex = regex.RegexGroup(children = [regex.RegexEmpty()])
-  _regex.post_process(len(plex.actions_text))
+  _regex.post_process(len(_ast.actions_text))
   _regex.add_to_nfa(_nfa)
 
   _flex_dfa = _nfa.to_dfa().to_flex_dfa()
@@ -15,9 +15,9 @@ def generate_flex(plex, home_dir, skel_file, out_file):
     skel_file = os.path.join(home_dir, 'skel/skel_flex.c')
   if out_file is None:
     out_file = (
-      plex[0].outfile
-    if len(plex[0].outfile) else
-      'lex.{0:s}.c'.format(plex[0].prefix)
+      _ast[0].outfile
+    if len(_ast[0].outfile) else
+      'lex.{0:s}.c'.format(_ast[0].prefix)
     )
   with open(skel_file, 'r') as fin:
     with open(out_file, 'w+') as fout:
@@ -29,12 +29,12 @@ def generate_flex(plex, home_dir, skel_file, out_file):
 {0:s}/* GENERATE END */
 '''.format(
               ''
-            if plex[0].prefix == 'yy' else
+            if _ast[0].prefix == 'yy' else
               ''.join(
                 [
                   '#define yy{0:s} {1:s}{2:s}\n'.format(
                     i,
-                    plex[0].prefix,
+                    _ast[0].prefix,
                     i
                   )
                   for i in [
@@ -112,11 +112,11 @@ def generate_flex(plex, home_dir, skel_file, out_file):
 {0:s}/* GENERATE END */
 '''.format(
               ''
-            if plex[0].yywrap else
+            if _ast[0].yywrap else
               '''#define {0:s}wrap() (/*CONSTCOND*/1)
 #define YY_SKIP_YYWRAP
 '''.format(
-                plex[0].prefix
+                _ast[0].prefix
               )
             )
           )
@@ -138,7 +138,7 @@ static const flex_uint16_t yy_chk[] = {{{6:s}
 }};
 /* GENERATE END */
 '''.format(
-              len(plex.actions_text),
+              len(_ast.actions_text),
               ','.join(
                 [
                   '\n\t{0:s}'.format(
@@ -224,7 +224,7 @@ static const flex_uint16_t yy_chk[] = {{{6:s}
             '''/* GENERATE SECTION1 BEGIN */
 {0:s}/* GENERATE END */
 '''.format(
-              ''.join([i.get_text() for i in plex[0].code_blocks_text])
+              ''.join([i.get_text() for i in _ast[0].code_blocks_text])
             )
           )
         elif line == '/* GENERATE STARTCONDDECL */\n':
@@ -235,10 +235,10 @@ static const flex_uint16_t yy_chk[] = {{{6:s}
               ''.join(
                 [
                   '#define {0:s} {1:d}\n'.format(
-                    plex.start_conditions[i].name,
+                    _ast.start_conditions[i].name,
                     i
                   )
-                  for i in range(len(plex.start_conditions))
+                  for i in range(len(_ast.start_conditions))
                 ]
               )
             )
@@ -248,17 +248,17 @@ static const flex_uint16_t yy_chk[] = {{{6:s}
             '''/* GENERATE SECTION2INITIAL BEGIN */
 {0:s}/* GENERATE END */
 '''.format(
-              ''.join([i.get_text() for i in plex[1].code_blocks_text])
+              ''.join([i.get_text() for i in _ast[1].code_blocks_text])
             )
           )
         elif line == '/* GENERATE SECTION2 */\n':
           eof_action_to_start_conditions = [
             [
               j
-              for j in range(len(plex.start_conditions))
-              if plex.start_conditions[j].eof_action == i
+              for j in range(len(_ast.start_conditions))
+              if _ast.start_conditions[j].eof_action == i
             ]
-            for i in range(len(plex.eof_actions_text))
+            for i in range(len(_ast.eof_actions_text))
           ]
           #print('eof_action_to_start_conditions', eof_action_to_start_conditions)
           fout.write(
@@ -272,9 +272,9 @@ YY_RULE_SETUP
 {1:s}  YY_BREAK
 '''.format(
                     i,
-                    plex.actions_text[i].get_text()
+                    _ast.actions_text[i].get_text()
                   )
-                  for i in range(len(plex.actions_text))
+                  for i in range(len(_ast.actions_text))
                 ]
               ),
               ''.join(
@@ -283,14 +283,14 @@ YY_RULE_SETUP
                     ''.join(
                       [
                         '\t\t\tcase YY_STATE_EOF({0:s}):\n'.format(
-                          plex.start_conditions[j].name
+                          _ast.start_conditions[j].name
                         )
                         for j in eof_action_to_start_conditions[i]
                       ]
                     ),
-                    plex.eof_actions_text[i].get_text()
+                    _ast.eof_actions_text[i].get_text()
                   )
-                  for i in range(len(plex.eof_actions_text))
+                  for i in range(len(_ast.eof_actions_text))
                   if len(eof_action_to_start_conditions[i]) > 0
                 ]
               )
@@ -301,11 +301,11 @@ YY_RULE_SETUP
             '''/* GENERATE SECTION3 BEGIN */
 {0:s}/* GENERATE END */
 '''.format(
-              '' if len(plex) < 3 else plex[2].get_text()
+              '' if len(_ast) < 3 else _ast[2].get_text()
             )
           )
         else:
-          if plex[0].prefix != 'yy':
-            line = line.replace('yywrap', '{0:s}wrap'.format(plex[0].prefix))
+          if _ast[0].prefix != 'yy':
+            line = line.replace('yywrap', '{0:s}wrap'.format(_ast[0].prefix))
           fout.write(line)
         line = fin.readline()
index 38eb5d7..0d78c06 100644 (file)
@@ -1,8 +1,8 @@
 import os
 import wrap_repr
 
-def plex_text_to_python(plex_text, indent):
-  text = plex_text.get_text()
+def ast_text_to_python(_ast_text, indent):
+  text = _ast_text.get_text()
   text_strip = text.strip()
   if text_strip[:1] == '{' and text_strip[-1:] == '}':
     text = text_strip[1:-1]
@@ -30,16 +30,16 @@ def plex_text_to_python(plex_text, indent):
       lines[j] = '{0:s}{1:s}\n'.format(indent, lines[j][len(prefix):])
   return ''.join(lines)
 
-def generate_py(plex, home_dir, skel_file, out_file):
-  _dfa = plex.to_nfa().to_dfa()
+def generate_py(_ast, home_dir, skel_file, out_file):
+  _dfa = _ast.to_nfa().to_dfa()
 
   if skel_file is None:
     skel_file = os.path.join(home_dir, 'skel/skel_py.py')
   if out_file is None:
     out_file = (
-      plex[0].outfile
-    if len(plex[0].outfile) else
-      'lex_{0:s}.py'.format(plex[0].prefix)
+      _ast[0].outfile
+    if len(_ast[0].outfile) else
+      'lex_{0:s}.py'.format(_ast[0].prefix)
     )
   with open(skel_file, 'r') as fin:
     with open(out_file, 'w+') as fout:
@@ -52,8 +52,8 @@ def generate_py(plex, home_dir, skel_file, out_file):
 '''.format(
               ''.join(
                 [
-                  plex_text_to_python(i, '')
-                  for i in plex[0].code_blocks_text
+                  ast_text_to_python(i, '')
+                  for i in _ast[0].code_blocks_text
                 ]
               )
             )
@@ -66,10 +66,10 @@ def generate_py(plex, home_dir, skel_file, out_file):
               ''.join(
                 [
                   '{0:s} = {1:d}\n'.format(
-                    plex.start_conditions[i].name,
+                    _ast.start_conditions[i].name,
                     i
                   )
-                  for i in range(len(plex.start_conditions))
+                  for i in range(len(_ast.start_conditions))
                 ]
               )
             )
@@ -105,15 +105,15 @@ def generate_py(plex, home_dir, skel_file, out_file):
 {1:s}  raise YYContinue()
 '''.format(
                     i,
-                    plex_text_to_python(plex.actions_text[i], '  ')
+                    ast_text_to_python(_ast.actions_text[i], '  ')
                   )
-                  for i in range(len(plex.actions_text))
+                  for i in range(len(_ast.actions_text))
                 ]
               ),
               ','.join(
                 [
                   '\n  yy_action{0:d}'.format(i)
-                  for i in range(len(plex.actions_text))
+                  for i in range(len(_ast.actions_text))
                 ]
               ),
               ''.join(
@@ -122,15 +122,15 @@ def generate_py(plex, home_dir, skel_file, out_file):
 {1:s}  return 0
 '''.format(
                     i,
-                    plex_text_to_python(plex.eof_actions_text[i], '  ')
+                    ast_text_to_python(_ast.eof_actions_text[i], '  ')
                   )
-                  for i in range(len(plex.eof_actions_text))
+                  for i in range(len(_ast.eof_actions_text))
                 ]
               ),
               ','.join(
                 [
                   '\n  yy_eof_action{0:d}'.format(i.eof_action)
-                  for i in plex.start_conditions
+                  for i in _ast.start_conditions
                 ]
               )
             )
@@ -142,8 +142,8 @@ def generate_py(plex, home_dir, skel_file, out_file):
 '''.format(
               ''.join(
                 [
-                  plex_text_to_python(i, '  ')
-                  for i in plex[1].code_blocks_text
+                  ast_text_to_python(i, '  ')
+                  for i in _ast[1].code_blocks_text
                 ]
               )
             )
@@ -153,11 +153,11 @@ def generate_py(plex, home_dir, skel_file, out_file):
             '''# GENERATE SECTION3 BEGIN
 {0:s}# GENERATE END
 '''.format(
-              '' if len(plex) < 3 else plex_text_to_python(plex[2], '')
+              '' if len(_ast) < 3 else ast_text_to_python(_ast[2], '')
             )
           )
         else:
-          #if plex[0].prefix != 'yy':
-          #  line = line.replace('yywrap', '{0:s}wrap'.format(plex[0].prefix))
+          #if _ast[0].prefix != 'yy':
+          #  line = line.replace('yywrap', '{0:s}wrap'.format(_ast[0].prefix))
           fout.write(line)
         line = fin.readline()
index ee0a250..f22b02f 100644 (file)
@@ -15,7 +15,7 @@ example4.yy.o: example4.yy.c
 
 example4.yy.c: example4.l
        ../../bootstrap_flex.git/src/flex -o /dev/null $< 2>$<.xml
-       ../bootstrap_plex.py $<.xml
+       ../pilex.py $<.xml
        mv lex.yy.c $@
 
 # example7 program
@@ -33,7 +33,7 @@ example7.yy.o: example7.yy.c
 
 example7.yy.c: example7.l
        ../../bootstrap_flex.git/src/flex -o /dev/null $< 2>$<.xml
-       ../bootstrap_plex.py $<.xml
+       ../pilex.py $<.xml
        mv lex.yy.c $@
 
 # other
similarity index 76%
rename from bootstrap_plex.py
rename to pilex.py
index 5163739..b255bae 100755 (executable)
+++ b/pilex.py
@@ -41,14 +41,14 @@ if len(args) < 1:
 in_file = args[0]
 
 with open(in_file) as fin:
-  plex = element.deserialize(fin, ast.factory)
-#element.serialize(plex, 'a.xml', 'utf-8')
-#plex = element.deserialize('a.xml', ast.factory, 'utf-8')
-plex.post_process()
-#element.serialize(plex, 'b.xml', 'utf-8')
-#plex = element.deserialize('b.xml', ast.factory, 'utf-8')
+  _ast = element.deserialize(fin, ast.factory)
+#element.serialize(_ast, 'a.xml', 'utf-8')
+#_ast = element.deserialize('a.xml', ast.factory, 'utf-8')
+_ast.post_process()
+#element.serialize(_ast, 'b.xml', 'utf-8')
+#_ast = element.deserialize('b.xml', ast.factory, 'utf-8')
 (generate_py.generate_py if python else generate_flex.generate_flex)(
-  plex,
+  _ast,
   home_dir,
   skel_file,
   out_file
index 601e8e0..968fd23 100644 (file)
@@ -3,7 +3,7 @@ all: lex_yy.py cal flex0 flex1
 # Python scanner test
 lex_yy.py: cal_py.l
        ../../bootstrap_flex.git/src/flex -o /dev/null $< 2>$<.xml
-       ../bootstrap_plex.py --python $<.xml
+       ../pilex.py --python $<.xml
 
 # cal program
 cal: y.tab.o
@@ -16,7 +16,7 @@ y.tab.c: cal.y
 
 lex.yy.c: cal.l
        ../../bootstrap_flex.git/src/flex -o /dev/null $< 2>$<.xml
-       ../bootstrap_plex.py $<.xml
+       ../pilex.py $<.xml
        # add the patch for state machine diagnostic
        #cp $@ $@.orig
        #patch $@ <$@.patch
@@ -29,7 +29,7 @@ flex0.o: flex0.c
 
 flex0.c: flex0.l
        ../../bootstrap_flex.git/src/flex -o /dev/null $< 2>$<.xml
-       ../bootstrap_plex.py -o $@ $<.xml
+       ../pilex.py -o $@ $<.xml
 
 # flex1 program
 flex1: flex1.o
@@ -39,7 +39,7 @@ flex1.o: flex1.c
 
 flex1.c: flex1.l
        ../../bootstrap_flex.git/src/flex -o /dev/null $< 2>$<.xml
-       ../bootstrap_plex.py -o $@ $<.xml
+       ../pilex.py -o $@ $<.xml
 
 # other
 clean: