class AbstractNode(ISTNode): """ Abstract node for more complex nodes """ _fields = ISTNode._fields + [ Field('id'), Field('input_type') ]
class Array(AbstractNode): """ Class representing Array structure """ __type__ = 'Array' __name_field__ = '' __value_field__ = 'range' _fields = AbstractNode._fields + [ Field('range', NumberRange(False)), Field('subtype', Reference()) ]
class Bool(AbstractNode): """ Class representing boolean """ __type__ = 'Bool' __name_field__ = '' __value_field__ = '' _fields = AbstractNode._fields + [ Field('name'), Field('full_name') ]
class String(AbstractNode): """ Class representing string """ __type__ = 'String' __name_field__ = '' __value_field__ = 'name' _fields = AbstractNode._fields + [ Field('name'), Field('full_name') ]
class RecordKeyDefault(AbstractNode): """ Class representing default value in record key """ __type__ = 'Defaults' __name_field__ = '' __value_field__ = 'value' _fields = AbstractNode._fields + [ Field('type'), Field('value') ]
class Attribute(AbstractNode): """ Class representing attribute node """ __type__ = 'Attribute' __name_field__ = 'name' __value_field__ = 'value' _fields = AbstractNode._fields + [ Field('name'), Field('value') ]
class FileName(AbstractNode): """ Class representing filename type """ __type__ = 'FileName' __name_field__ = '' __value_field__ = 'file_mode' _fields = AbstractNode._fields + [ Field('name'), Field('full_name'), Field('file_mode') ]
class Integer(AbstractNode): """ Class representing int """ __type__ = 'Integer' __name_field__ = '' __value_field__ = 'range' _fields = AbstractNode._fields + [ Field('name'), Field('full_name'), Field('range', NumberRange()) ]
class Double(AbstractNode): """ Class representing double """ __type__ = 'Double' __name_field__ = '' __value_field__ = 'range' _fields = AbstractNode._fields + [ Field('name'), Field('full_name'), Field('range', DoubleRange()) ]
class AbstractRecord(ComplexNode): """ Class representing AbstractRecord node in IST """ __type__ = 'AbstractRecord' __name_field__ = 'name' __value_field__ = 'name' _fields = Record._fields + [ Field('implementations', TypedList(Reference)), Field('default_descendant', Reference()), Field('full_name'), Field('name') ]
class Selection(ComplexNode): """ Class representing Selection node in IST """ __type__ = 'Selection' __name_field__ = 'name' __value_field__ = 'name' _fields = ComplexNode._fields + [ Field('values', TypedList(SelectionValue)), Field('name'), Field('full_name') ] def include_in_format(self): return self.name.find('TYPE') == -1
class RecordKey(DescriptionNode): """ Class representing one record key """ __type__ = 'Record key' __name_field__ = 'key' __value_field__ = 'default' _fields = DescriptionNode._fields + [ Field('key'), Field('type', Reference()), Field('default', RecordKeyDefault()) ] def include_in_format(self): return self.key.find('TYPE') == -1
class DescriptionNode(AbstractNode): """ Class representing node with description """ _fields = AbstractNode._fields + [ Field('description') ]
class ComplexNode(DescriptionNode): """ Class representing the most complex nodes (records and similar) with description and supporting attributes """ _fields = DescriptionNode._fields + [ Field('attributes', AttributeDict(Attribute)) ]
class SelectionValue(DescriptionNode): """ Class representing selection node """ __type__ = 'Selection value' __name_field__ = 'name' __value_field__ = 'name' _fields = DescriptionNode._fields + [ Field('name') ]
class Record(ComplexNode): """ Class representing record node in IST """ __type__ = 'Record' __name_field__ = 'type_name' __value_field__ = 'type_name' _fields = ComplexNode._fields + [ Field('type_name'), Field('input_type'), Field('type_full_name'), Field('keys', TypedList(RecordKey)), Field('implements', TypedList(Reference)), Field('reducible_to_key') ]