import element
import regex
-class Name(element.Element):
+class PLexSpecification(element.Element):
# GENERATE ELEMENT() BEGIN
def __init__(
self,
- tag = 'Name',
+ tag = 'PLexSpecification',
attrib = {},
text = '',
children = []
def copy(self, factory = None):
result = element.Element.copy(
self,
- Name if factory is None else factory
+ PLexSpecification if factory is None else factory
)
return result
def __repr__(self):
params = []
self.repr_serialize(params)
- return 'ast.Name({0:s})'.format(', '.join(params))
+ return 'ast.PLexSpecification({0:s})'.format(', '.join(params))
# GENERATE END
+ def post_process(self):
+ for i in self:
+ i.post_process(self)
-class Section1(element.Element):
+class Section(element.Element):
# GENERATE ELEMENT() BEGIN
def __init__(
self,
- tag = 'Section1',
+ tag = 'Section',
attrib = {},
text = '',
children = []
def copy(self, factory = None):
result = element.Element.copy(
self,
- Section1 if factory is None else factory
+ Section if factory is None else factory
)
return result
def __repr__(self):
params = []
self.repr_serialize(params)
- return 'ast.Section1({0:s})'.format(', '.join(params))
+ return 'ast.Section({0:s})'.format(', '.join(params))
# GENERATE END
+ def post_process(self, plex_specification):
+ for i in self:
+ #print('item', i.tag)
+ i.post_process(plex_specification, self)
-class CodeBlock(element.Element):
+class Item(element.Element):
# GENERATE ELEMENT() BEGIN
def __init__(
self,
- tag = 'CodeBlock',
+ tag = 'Item',
attrib = {},
text = '',
children = []
)
def copy(self, factory = None):
result = element.Element.copy(
+ self,
+ Item if factory is None else factory
+ )
+ return result
+ def __repr__(self):
+ params = []
+ self.repr_serialize(params)
+ return 'ast.Item({0:s})'.format(', '.join(params))
+ # GENERATE END
+ def post_process(self, plex_specification, section):
+ raise NotImplementedException
+
+class Name(element.Element):
+ # GENERATE ELEMENT() BEGIN
+ def __init__(
+ self,
+ tag = 'Name',
+ attrib = {},
+ text = '',
+ children = []
+ ):
+ element.Element.__init__(
+ self,
+ tag,
+ attrib,
+ text,
+ children
+ )
+ def copy(self, factory = None):
+ result = element.Element.copy(
+ self,
+ Name if factory is None else factory
+ )
+ return result
+ def __repr__(self):
+ params = []
+ self.repr_serialize(params)
+ return 'ast.Name({0:s})'.format(', '.join(params))
+ # GENERATE END
+
+class SectionCodeBlocks(Section):
+ # GENERATE ELEMENT(list(ref) code_blocks) BEGIN
+ def __init__(
+ self,
+ tag = 'SectionCodeBlocks',
+ attrib = {},
+ text = '',
+ children = [],
+ code_blocks = []
+ ):
+ Section.__init__(
+ self,
+ tag,
+ attrib,
+ text,
+ children
+ )
+ self.code_blocks = code_blocks
+ def serialize(self, ref_list, indent = 0):
+ Section.serialize(self, ref_list, indent)
+ self.set(
+ 'code_blocks',
+ ' '.join([element.serialize_ref(i, ref_list) for i in self.code_blocks])
+ )
+ def deserialize(self, ref_list):
+ Section.deserialize(self, ref_list)
+ self.code_blocks = [
+ element.deserialize_ref(i, ref_list)
+ for i in self.get('code_blocks', '').split()
+ ]
+ def copy(self, factory = None):
+ result = Section.copy(
+ self,
+ SectionCodeBlocks if factory is None else factory
+ )
+ result.code_blocks = self.code_blocks
+ return result
+ def repr_serialize(self, params):
+ Section.repr_serialize(self, params)
+ if len(self.code_blocks):
+ params.append(
+ 'code_blocks = [{0:s}]'.format(
+ ', '.join([repr(i) for i in self.code_blocks])
+ )
+ )
+ def __repr__(self):
+ params = []
+ self.repr_serialize(params)
+ return 'ast.SectionCodeBlocks({0:s})'.format(', '.join(params))
+ # GENERATE END
+
+class CodeBlock(Item):
+ # GENERATE ELEMENT() BEGIN
+ def __init__(
+ self,
+ tag = 'CodeBlock',
+ attrib = {},
+ text = '',
+ children = []
+ ):
+ Item.__init__(
+ self,
+ tag,
+ attrib,
+ text,
+ children
+ )
+ def copy(self, factory = None):
+ result = Item.copy(
self,
CodeBlock if factory is None else factory
)
self.repr_serialize(params)
return 'ast.CodeBlock({0:s})'.format(', '.join(params))
# GENERATE END
+ def post_process(self, plex_specification, section):
+ section.code_blocks.append(self)
class Option(element.Element):
# GENERATE ELEMENT() BEGIN
self.repr_serialize(params)
return 'ast.Option({0:s})'.format(', '.join(params))
# GENERATE END
- def process(self, options):
+ def post_process(self, section):
raise NotImplementedException
-class BoolOption(element.Element):
+class BoolOption(Option):
# GENERATE ELEMENT(bool value) BEGIN
def __init__(
self,
children = [],
value = False
):
- element.Element.__init__(
+ Option.__init__(
self,
tag,
attrib,
value
)
def serialize(self, ref_list, indent = 0):
- element.Element.serialize(self, ref_list, indent)
+ Option.serialize(self, ref_list, indent)
self.set('value', element.serialize_bool(self.value))
def deserialize(self, ref_list):
- element.Element.deserialize(self, ref_list)
+ Option.deserialize(self, ref_list)
self.value = element.deserialize_bool(self.get('value', 'false'))
def copy(self, factory = None):
- result = element.Element.copy(
+ result = Option.copy(
self,
BoolOption if factory is None else factory
)
result.value = self.value
return result
def repr_serialize(self, params):
- element.Element.repr_serialize(self, params)
+ Option.repr_serialize(self, params)
if self.value != False:
params.append(
'value = {0:s}'.format(repr(self.value))
return 'ast.BoolOption({0:s})'.format(', '.join(params))
# GENERATE END
-class Options(Option):
- class ECS(BoolOption):
+class Section1(SectionCodeBlocks):
+ class Options(Item):
+ class ECS(BoolOption):
+ # GENERATE ELEMENT() BEGIN
+ def __init__(
+ self,
+ tag = 'Section1_Options_ECS',
+ attrib = {},
+ text = '',
+ children = [],
+ value = False
+ ):
+ BoolOption.__init__(
+ self,
+ tag,
+ attrib,
+ text,
+ children,
+ value
+ )
+ def copy(self, factory = None):
+ result = BoolOption.copy(
+ self,
+ ECS if factory is None else factory
+ )
+ return result
+ def __repr__(self):
+ params = []
+ self.repr_serialize(params)
+ return 'ast.Section1.Options.ECS({0:s})'.format(', '.join(params))
+ # GENERATE END
+ def post_process(self, section):
+ section.ecs = self.value
+
+ class MetaECS(BoolOption):
+ # GENERATE ELEMENT() BEGIN
+ def __init__(
+ self,
+ tag = 'Section1_Options_MetaECS',
+ attrib = {},
+ text = '',
+ children = [],
+ value = False
+ ):
+ BoolOption.__init__(
+ self,
+ tag,
+ attrib,
+ text,
+ children,
+ value
+ )
+ def copy(self, factory = None):
+ result = BoolOption.copy(
+ self,
+ MetaECS if factory is None else factory
+ )
+ return result
+ def __repr__(self):
+ params = []
+ self.repr_serialize(params)
+ return 'ast.Section1.Options.MetaECS({0:s})'.format(', '.join(params))
+ # GENERATE END
+ def post_process(self, section):
+ section.meta_ecs = self.value
+
+ class Reject(BoolOption):
+ # GENERATE ELEMENT() BEGIN
+ def __init__(
+ self,
+ tag = 'Section1_Options_Reject',
+ attrib = {},
+ text = '',
+ children = [],
+ value = False
+ ):
+ BoolOption.__init__(
+ self,
+ tag,
+ attrib,
+ text,
+ children,
+ value
+ )
+ def copy(self, factory = None):
+ result = BoolOption.copy(
+ self,
+ Reject if factory is None else factory
+ )
+ return result
+ def __repr__(self):
+ params = []
+ self.repr_serialize(params)
+ return 'ast.Section1.Options.Reject({0:s})'.format(', '.join(params))
+ # GENERATE END
+ def post_process(self, section):
+ section.reject = self.value
+
+ class YYMore(BoolOption):
+ # GENERATE ELEMENT() BEGIN
+ def __init__(
+ self,
+ tag = 'Section1_Options_YYMore',
+ attrib = {},
+ text = '',
+ children = [],
+ value = False
+ ):
+ BoolOption.__init__(
+ self,
+ tag,
+ attrib,
+ text,
+ children,
+ value
+ )
+ def copy(self, factory = None):
+ result = BoolOption.copy(
+ self,
+ YYMore if factory is None else factory
+ )
+ return result
+ def __repr__(self):
+ params = []
+ self.repr_serialize(params)
+ return 'ast.Section1.Options.YYMore({0:s})'.format(', '.join(params))
+ # GENERATE END
+ def post_process(self, section):
+ section.yymore = self.value
+
+ class YYWrap(BoolOption):
+ # GENERATE ELEMENT() BEGIN
+ def __init__(
+ self,
+ tag = 'Section1_Options_YYWrap',
+ attrib = {},
+ text = '',
+ children = [],
+ value = False
+ ):
+ BoolOption.__init__(
+ self,
+ tag,
+ attrib,
+ text,
+ children,
+ value
+ )
+ def copy(self, factory = None):
+ result = BoolOption.copy(
+ self,
+ YYWrap if factory is None else factory
+ )
+ return result
+ def __repr__(self):
+ params = []
+ self.repr_serialize(params)
+ return 'ast.Section1.Options.YYWrap({0:s})'.format(', '.join(params))
+ # GENERATE END
+ def post_process(self, section):
+ section.yywrap = self.value
+
# GENERATE ELEMENT() BEGIN
def __init__(
self,
- tag = 'Options_ECS',
+ tag = 'Section1_Options',
attrib = {},
text = '',
- children = [],
- value = False
+ children = []
):
- BoolOption.__init__(
+ Item.__init__(
self,
tag,
attrib,
text,
- children,
- value
+ children
)
def copy(self, factory = None):
- result = BoolOption.copy(
+ result = Item.copy(
self,
- ECS if factory is None else factory
+ Options if factory is None else factory
)
return result
def __repr__(self):
params = []
self.repr_serialize(params)
- return 'ast.Options.ECS({0:s})'.format(', '.join(params))
+ return 'ast.Section1.Options({0:s})'.format(', '.join(params))
# GENERATE END
- def process(self, options):
- options.ecs = self.value
+ def post_process(self, plex_specification, section):
+ for i in self:
+ #print('option', i.tag)
+ i.post_process(section)
- class MetaECS(BoolOption):
- # GENERATE ELEMENT() BEGIN
+ class StartConditions(Item):
+ # GENERATE ELEMENT(bool exclusive) BEGIN
def __init__(
self,
- tag = 'Options_MetaECS',
+ tag = 'Section1_StartConditions',
attrib = {},
text = '',
children = [],
- value = False
+ exclusive = False
):
- BoolOption.__init__(
+ Item.__init__(
self,
tag,
attrib,
text,
- children,
- value
+ children
)
+ self.exclusive = (
+ element.deserialize_bool(exclusive)
+ if isinstance(exclusive, str) else
+ exclusive
+ )
+ def serialize(self, ref_list, indent = 0):
+ Item.serialize(self, ref_list, indent)
+ self.set('exclusive', element.serialize_bool(self.exclusive))
+ def deserialize(self, ref_list):
+ Item.deserialize(self, ref_list)
+ self.exclusive = element.deserialize_bool(self.get('exclusive', 'false'))
def copy(self, factory = None):
- result = BoolOption.copy(
+ result = Item.copy(
self,
- MetaECS if factory is None else factory
+ StartConditions if factory is None else factory
)
+ result.exclusive = self.exclusive
return result
+ def repr_serialize(self, params):
+ Item.repr_serialize(self, params)
+ if self.exclusive != False:
+ params.append(
+ 'exclusive = {0:s}'.format(repr(self.exclusive))
+ )
def __repr__(self):
params = []
self.repr_serialize(params)
- return 'ast.Options.MetaECS({0:s})'.format(', '.join(params))
+ return 'ast.Section1.StartConditions({0:s})'.format(', '.join(params))
# GENERATE END
- def process(self, options):
- options.meta_ecs = self.value
+ def post_process(self, plex_specification, section):
+ pass # do something here eventually
- class Reject(BoolOption):
- # GENERATE ELEMENT() BEGIN
- def __init__(
+ # GENERATE ELEMENT(bool ecs, bool meta_ecs, bool reject, bool yymore, bool yywrap) BEGIN
+ def __init__(
+ self,
+ tag = 'Section1',
+ attrib = {},
+ text = '',
+ children = [],
+ code_blocks = [],
+ ecs = False,
+ meta_ecs = False,
+ reject = False,
+ yymore = False,
+ yywrap = False
+ ):
+ SectionCodeBlocks.__init__(
self,
- tag = 'Options_Reject',
- attrib = {},
- text = '',
- children = [],
- value = False
- ):
- BoolOption.__init__(
- self,
- tag,
- attrib,
- text,
- children,
- value
+ tag,
+ attrib,
+ text,
+ children,
+ code_blocks
+ )
+ self.ecs = (
+ element.deserialize_bool(ecs)
+ if isinstance(ecs, str) else
+ ecs
+ )
+ self.meta_ecs = (
+ element.deserialize_bool(meta_ecs)
+ if isinstance(meta_ecs, str) else
+ meta_ecs
+ )
+ self.reject = (
+ element.deserialize_bool(reject)
+ if isinstance(reject, str) else
+ reject
+ )
+ self.yymore = (
+ element.deserialize_bool(yymore)
+ if isinstance(yymore, str) else
+ yymore
+ )
+ self.yywrap = (
+ element.deserialize_bool(yywrap)
+ if isinstance(yywrap, str) else
+ yywrap
+ )
+ def serialize(self, ref_list, indent = 0):
+ SectionCodeBlocks.serialize(self, ref_list, indent)
+ self.set('ecs', element.serialize_bool(self.ecs))
+ self.set('meta_ecs', element.serialize_bool(self.meta_ecs))
+ self.set('reject', element.serialize_bool(self.reject))
+ self.set('yymore', element.serialize_bool(self.yymore))
+ self.set('yywrap', element.serialize_bool(self.yywrap))
+ def deserialize(self, ref_list):
+ SectionCodeBlocks.deserialize(self, ref_list)
+ self.ecs = element.deserialize_bool(self.get('ecs', 'false'))
+ self.meta_ecs = element.deserialize_bool(self.get('meta_ecs', 'false'))
+ self.reject = element.deserialize_bool(self.get('reject', 'false'))
+ self.yymore = element.deserialize_bool(self.get('yymore', 'false'))
+ self.yywrap = element.deserialize_bool(self.get('yywrap', 'false'))
+ def copy(self, factory = None):
+ result = SectionCodeBlocks.copy(
+ self,
+ Section1 if factory is None else factory
+ )
+ result.ecs = self.ecs
+ result.meta_ecs = self.meta_ecs
+ result.reject = self.reject
+ result.yymore = self.yymore
+ result.yywrap = self.yywrap
+ return result
+ def repr_serialize(self, params):
+ SectionCodeBlocks.repr_serialize(self, params)
+ if self.ecs != False:
+ params.append(
+ 'ecs = {0:s}'.format(repr(self.ecs))
)
- def copy(self, factory = None):
- result = BoolOption.copy(
- self,
- Reject if factory is None else factory
+ if self.meta_ecs != False:
+ params.append(
+ 'meta_ecs = {0:s}'.format(repr(self.meta_ecs))
)
- return result
- def __repr__(self):
- params = []
- self.repr_serialize(params)
- return 'ast.Options.Reject({0:s})'.format(', '.join(params))
- # GENERATE END
- def process(self, options):
- options.reject = self.value
+ if self.reject != False:
+ params.append(
+ 'reject = {0:s}'.format(repr(self.reject))
+ )
+ if self.yymore != False:
+ params.append(
+ 'yymore = {0:s}'.format(repr(self.yymore))
+ )
+ if self.yywrap != False:
+ params.append(
+ 'yywrap = {0:s}'.format(repr(self.yywrap))
+ )
+ def __repr__(self):
+ params = []
+ self.repr_serialize(params)
+ return 'ast.Section1({0:s})'.format(', '.join(params))
+ # GENERATE END
+ def post_process(self, plex_specification):
+ self.ecs = False
+ self.meta_ecs = False
+ self.reject = True
+ self.yymore = True
+ self.yywrap = True
+ Section.post_process(self, plex_specification)
- class YYMore(BoolOption):
- # GENERATE ELEMENT() BEGIN
+class Section2(SectionCodeBlocks):
+ class StartConditions(element.Element):
+ # GENERATE ELEMENT(bool wildcard) BEGIN
def __init__(
self,
- tag = 'Options_YYMore',
+ tag = 'Section2_StartConditions',
attrib = {},
text = '',
children = [],
- value = False
+ wildcard = False
):
- BoolOption.__init__(
+ element.Element.__init__(
self,
tag,
attrib,
text,
- children,
- value
+ children
+ )
+ self.wildcard = (
+ element.deserialize_bool(wildcard)
+ if isinstance(wildcard, str) else
+ wildcard
)
+ def serialize(self, ref_list, indent = 0):
+ element.Element.serialize(self, ref_list, indent)
+ self.set('wildcard', element.serialize_bool(self.wildcard))
+ def deserialize(self, ref_list):
+ element.Element.deserialize(self, ref_list)
+ self.wildcard = element.deserialize_bool(self.get('wildcard', 'false'))
def copy(self, factory = None):
- result = BoolOption.copy(
+ result = element.Element.copy(
self,
- YYMore if factory is None else factory
+ StartConditions if factory is None else factory
)
+ result.wildcard = self.wildcard
return result
+ def repr_serialize(self, params):
+ element.Element.repr_serialize(self, params)
+ if self.wildcard != False:
+ params.append(
+ 'wildcard = {0:s}'.format(repr(self.wildcard))
+ )
def __repr__(self):
params = []
self.repr_serialize(params)
- return 'ast.Options.YYMore({0:s})'.format(', '.join(params))
+ return 'ast.Section2.StartConditions({0:s})'.format(', '.join(params))
# GENERATE END
- def process(self, options):
- options.yymore = self.value
- class YYWrap(BoolOption):
+ class Rule(Item):
+ class BOLRule(element.Element):
+ # GENERATE ELEMENT() BEGIN
+ def __init__(
+ self,
+ tag = 'Section2_Rule_BOLRule',
+ attrib = {},
+ text = '',
+ children = []
+ ):
+ element.Element.__init__(
+ self,
+ tag,
+ attrib,
+ text,
+ children
+ )
+ def copy(self, factory = None):
+ result = element.Element.copy(
+ self,
+ BOLRule if factory is None else factory
+ )
+ return result
+ def __repr__(self):
+ params = []
+ self.repr_serialize(params)
+ return 'ast.Section2.Rule.BOLRule({0:s})'.format(', '.join(params))
+ # GENERATE END
+
+ class EOFRule(element.Element):
+ # GENERATE ELEMENT() BEGIN
+ def __init__(
+ self,
+ tag = 'Section2_Rule_EOFRule',
+ attrib = {},
+ text = '',
+ children = []
+ ):
+ element.Element.__init__(
+ self,
+ tag,
+ attrib,
+ text,
+ children
+ )
+ def copy(self, factory = None):
+ result = element.Element.copy(
+ self,
+ EOFRule if factory is None else factory
+ )
+ return result
+ def __repr__(self):
+ params = []
+ self.repr_serialize(params)
+ return 'ast.Section2.Rule.EOFRule({0:s})'.format(', '.join(params))
+ # GENERATE END
+
+ class Action(element.Element):
+ # GENERATE ELEMENT() BEGIN
+ def __init__(
+ self,
+ tag = 'Section2_Rule_Action',
+ attrib = {},
+ text = '',
+ children = []
+ ):
+ element.Element.__init__(
+ self,
+ tag,
+ attrib,
+ text,
+ children
+ )
+ def copy(self, factory = None):
+ result = element.Element.copy(
+ self,
+ Action if factory is None else factory
+ )
+ return result
+ def __repr__(self):
+ params = []
+ self.repr_serialize(params)
+ return 'ast.Section2.Rule.Action({0:s})'.format(', '.join(params))
+ # GENERATE END
+
# GENERATE ELEMENT() BEGIN
def __init__(
self,
- tag = 'Options_YYWrap',
+ tag = 'Section2_Rule',
attrib = {},
text = '',
- children = [],
- value = False
+ children = []
):
- BoolOption.__init__(
+ Item.__init__(
self,
tag,
attrib,
text,
- children,
- value
+ children
)
def copy(self, factory = None):
- result = BoolOption.copy(
+ result = Item.copy(
self,
- YYWrap if factory is None else factory
+ Rule if factory is None else factory
)
return result
def __repr__(self):
params = []
self.repr_serialize(params)
- return 'ast.Options.YYWrap({0:s})'.format(', '.join(params))
+ return 'ast.Section2.Rule({0:s})'.format(', '.join(params))
# GENERATE END
- def process(self, options):
- options.yywrap = self.value
+ def post_process(self, plex_specification, section):
+ pass # do something here eventually
- # GENERATE ELEMENT() BEGIN
- def __init__(
- self,
- tag = 'Options',
- attrib = {},
- text = '',
- children = []
- ):
- Option.__init__(
- self,
- tag,
- attrib,
- text,
- children
- )
- def copy(self, factory = None):
- result = Option.copy(
- self,
- Options if factory is None else factory
- )
- return result
- def __repr__(self):
- params = []
- self.repr_serialize(params)
- return 'ast.Options({0:s})'.format(', '.join(params))
- # GENERATE END
- def process(self, options):
- for i in self:
- i.process(options)
-
-class StartConditionDecl(element.Element):
- # GENERATE ELEMENT(bool exclusive) BEGIN
- def __init__(
- self,
- tag = 'StartConditionDecl',
- attrib = {},
- text = '',
- children = [],
- exclusive = False
- ):
- element.Element.__init__(
- self,
- tag,
- attrib,
- text,
- children
- )
- self.exclusive = (
- element.deserialize_bool(exclusive)
- if isinstance(exclusive, str) else
- exclusive
- )
- def serialize(self, ref_list, indent = 0):
- element.Element.serialize(self, ref_list, indent)
- self.set('exclusive', element.serialize_bool(self.exclusive))
- def deserialize(self, ref_list):
- element.Element.deserialize(self, ref_list)
- self.exclusive = element.deserialize_bool(self.get('exclusive', 'false'))
- def copy(self, factory = None):
- result = element.Element.copy(
- self,
- StartConditionDecl if factory is None else factory
- )
- result.exclusive = self.exclusive
- return result
- def repr_serialize(self, params):
- element.Element.repr_serialize(self, params)
- if self.exclusive != False:
- params.append(
- 'exclusive = {0:s}'.format(repr(self.exclusive))
- )
- def __repr__(self):
- params = []
- self.repr_serialize(params)
- return 'ast.StartConditionDecl({0:s})'.format(', '.join(params))
- # GENERATE END
-
-class Section2(element.Element):
# GENERATE ELEMENT() BEGIN
def __init__(
self,
tag = 'Section2',
attrib = {},
text = '',
- children = []
+ children = [],
+ code_blocks = []
):
- element.Element.__init__(
+ SectionCodeBlocks.__init__(
self,
tag,
attrib,
text,
- children
+ children,
+ code_blocks
)
def copy(self, factory = None):
- result = element.Element.copy(
+ result = SectionCodeBlocks.copy(
self,
Section2 if factory is None else factory
)
return 'ast.Section2({0:s})'.format(', '.join(params))
# GENERATE END
-class StartConditionList(element.Element):
- # GENERATE ELEMENT(bool wildcard) BEGIN
- def __init__(
- self,
- tag = 'StartConditionList',
- attrib = {},
- text = '',
- children = [],
- wildcard = False
- ):
- element.Element.__init__(
- self,
- tag,
- attrib,
- text,
- children
- )
- self.wildcard = (
- element.deserialize_bool(wildcard)
- if isinstance(wildcard, str) else
- wildcard
- )
- def serialize(self, ref_list, indent = 0):
- element.Element.serialize(self, ref_list, indent)
- self.set('wildcard', element.serialize_bool(self.wildcard))
- def deserialize(self, ref_list):
- element.Element.deserialize(self, ref_list)
- self.wildcard = element.deserialize_bool(self.get('wildcard', 'false'))
- def copy(self, factory = None):
- result = element.Element.copy(
- self,
- StartConditionList if factory is None else factory
- )
- result.wildcard = self.wildcard
- return result
- def repr_serialize(self, params):
- element.Element.repr_serialize(self, params)
- if self.wildcard != False:
- params.append(
- 'wildcard = {0:s}'.format(repr(self.wildcard))
- )
- def __repr__(self):
- params = []
- self.repr_serialize(params)
- return 'ast.StartConditionList({0:s})'.format(', '.join(params))
- # GENERATE END
-
-class BOLRule(element.Element):
- # GENERATE ELEMENT() BEGIN
- def __init__(
- self,
- tag = 'BOLRule',
- attrib = {},
- text = '',
- children = []
- ):
- element.Element.__init__(
- self,
- tag,
- attrib,
- text,
- children
- )
- def copy(self, factory = None):
- result = element.Element.copy(
- self,
- BOLRule if factory is None else factory
- )
- return result
- def __repr__(self):
- params = []
- self.repr_serialize(params)
- return 'ast.BOLRule({0:s})'.format(', '.join(params))
- # GENERATE END
-
-class EOFRule(element.Element):
- # GENERATE ELEMENT() BEGIN
- def __init__(
- self,
- tag = 'EOFRule',
- attrib = {},
- text = '',
- children = []
- ):
- element.Element.__init__(
- self,
- tag,
- attrib,
- text,
- children
- )
- def copy(self, factory = None):
- result = element.Element.copy(
- self,
- EOFRule if factory is None else factory
- )
- return result
- def __repr__(self):
- params = []
- self.repr_serialize(params)
- return 'ast.EOFRule({0:s})'.format(', '.join(params))
- # GENERATE END
-
-class Rule(element.Element):
- # GENERATE ELEMENT() BEGIN
- def __init__(
- self,
- tag = 'Rule',
- attrib = {},
- text = '',
- children = []
- ):
- element.Element.__init__(
- self,
- tag,
- attrib,
- text,
- children
- )
- def copy(self, factory = None):
- result = element.Element.copy(
- self,
- Rule if factory is None else factory
- )
- return result
- def __repr__(self):
- params = []
- self.repr_serialize(params)
- return 'ast.Rule({0:s})'.format(', '.join(params))
- # GENERATE END
-
-class Action(element.Element):
- # GENERATE ELEMENT() BEGIN
- def __init__(
- self,
- tag = 'Action',
- attrib = {},
- text = '',
- children = []
- ):
- element.Element.__init__(
- self,
- tag,
- attrib,
- text,
- children
- )
- def copy(self, factory = None):
- result = element.Element.copy(
- self,
- Action if factory is None else factory
- )
- return result
- def __repr__(self):
- params = []
- self.repr_serialize(params)
- return 'ast.Action({0:s})'.format(', '.join(params))
- # GENERATE END
-
-class Section3(element.Element):
+class Section3(Section):
# GENERATE ELEMENT() BEGIN
def __init__(
self,
text = '',
children = []
):
- element.Element.__init__(
+ Section.__init__(
self,
tag,
attrib,
children
)
def copy(self, factory = None):
- result = element.Element.copy(
+ result = Section.copy(
self,
Section3 if factory is None else factory
)
# GENERATE FACTORY(regex.factory) BEGIN
tag_to_class = {
+ 'PLexSpecification': PLexSpecification,
+ 'Section': Section,
+ 'Item': Item,
'Name': Name,
- 'Section1': Section1,
+ 'SectionCodeBlocks': SectionCodeBlocks,
'CodeBlock': CodeBlock,
'Option': Option,
'BoolOption': BoolOption,
- 'Options': Options,
- 'Options_ECS': Options.ECS,
- 'Options_MetaECS': Options.MetaECS,
- 'Options_Reject': Options.Reject,
- 'Options_YYMore': Options.YYMore,
- 'Options_YYWrap': Options.YYWrap,
- 'StartConditionDecl': StartConditionDecl,
+ 'Section1': Section1,
+ 'Section1_Options': Section1.Options,
+ 'Section1_Options_ECS': Section1.Options.ECS,
+ 'Section1_Options_MetaECS': Section1.Options.MetaECS,
+ 'Section1_Options_Reject': Section1.Options.Reject,
+ 'Section1_Options_YYMore': Section1.Options.YYMore,
+ 'Section1_Options_YYWrap': Section1.Options.YYWrap,
+ 'Section1_StartConditions': Section1.StartConditions,
'Section2': Section2,
- 'StartConditionList': StartConditionList,
- 'BOLRule': BOLRule,
- 'EOFRule': EOFRule,
- 'Rule': Rule,
- 'Action': Action,
+ 'Section2_StartConditions': Section2.StartConditions,
+ 'Section2_Rule': Section2.Rule,
+ 'Section2_Rule_BOLRule': Section2.Rule.BOLRule,
+ 'Section2_Rule_EOFRule': Section2.Rule.EOFRule,
+ 'Section2_Rule_Action': Section2.Rule.Action,
'Section3': Section3
}
def factory(tag, attrib = {}, *args, **kwargs):