示例#1
0
class AbstractNode(ISTNode):
    """
    Abstract node for more complex nodes
    """
    _fields = ISTNode._fields + [
        Field('id'),
        Field('input_type')
    ]
示例#2
0
class Array(AbstractNode):
    """
    Class representing Array structure
    """
    __type__ = 'Array'
    __name_field__ = ''
    __value_field__ = 'range'

    _fields = AbstractNode._fields + [
        Field('range', NumberRange(False)),
        Field('subtype', Reference())
    ]
示例#3
0
class Bool(AbstractNode):
    """
    Class representing boolean
    """
    __type__ = 'Bool'
    __name_field__ = ''
    __value_field__ = ''

    _fields = AbstractNode._fields + [
        Field('name'),
        Field('full_name')
    ]
示例#4
0
class String(AbstractNode):
    """
    Class representing string
    """
    __type__ = 'String'
    __name_field__ = ''
    __value_field__ = 'name'

    _fields = AbstractNode._fields + [
        Field('name'),
        Field('full_name')
    ]
示例#5
0
class RecordKeyDefault(AbstractNode):
    """
    Class representing default value in record key
    """
    __type__ = 'Defaults'
    __name_field__ = ''
    __value_field__ = 'value'

    _fields = AbstractNode._fields + [
        Field('type'),
        Field('value')
    ]
示例#6
0
class Attribute(AbstractNode):
    """
    Class representing attribute node
    """
    __type__ = 'Attribute'
    __name_field__ = 'name'
    __value_field__ = 'value'

    _fields = AbstractNode._fields + [
        Field('name'),
        Field('value')
    ]
示例#7
0
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')
    ]
示例#8
0
class Integer(AbstractNode):
    """
    Class representing int
    """
    __type__ = 'Integer'
    __name_field__ = ''
    __value_field__ = 'range'

    _fields = AbstractNode._fields + [
        Field('name'),
        Field('full_name'),
        Field('range', NumberRange())
    ]
示例#9
0
class Double(AbstractNode):
    """
    Class representing double
    """
    __type__ = 'Double'
    __name_field__ = ''
    __value_field__ = 'range'

    _fields = AbstractNode._fields + [
        Field('name'),
        Field('full_name'),
        Field('range', DoubleRange())
    ]
示例#10
0
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')
    ]
示例#11
0
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
示例#12
0
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
示例#13
0
class DescriptionNode(AbstractNode):
    """
    Class representing node with description
    """
    _fields = AbstractNode._fields + [
        Field('description')
    ]
示例#14
0
class ComplexNode(DescriptionNode):
    """
    Class representing the most complex nodes (records and similar)
with description and supporting attributes
    """
    _fields = DescriptionNode._fields + [
        Field('attributes', AttributeDict(Attribute))
    ]
示例#15
0
class SelectionValue(DescriptionNode):
    """
    Class representing selection node
    """
    __type__ = 'Selection value'
    __name_field__ = 'name'
    __value_field__ = 'name'

    _fields = DescriptionNode._fields + [
        Field('name')
    ]
示例#16
0
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')
    ]