simple_type.setParseAction(annotate('SimpleType'))
choice_type.setParseAction(annotate('ChoiceType'))
sequence_type.setParseAction(annotate('SequenceType'))
+ set_type.setParseAction(annotate('SetType'))
value_list_type.setParseAction(annotate('ValueListType'))
bitstring_type.setParseAction(annotate('BitStringType'))
referenced_type.setParseAction(annotate('ReferencedType'))
self.decl_generators = {
ChoiceType: self.decl_constructed_type,
SequenceType: self.decl_constructed_type,
+ SetType: self.decl_constructed_type,
TaggedType: self.decl_tagged_type,
SimpleType: self.decl_simple_type,
UserDefinedType: self.decl_userdefined_type,
'OCTET STRING': 'univ.OctetString',
'CHOICE': 'univ.Choice',
'SEQUENCE': 'univ.Sequence',
+ 'SET': 'univ.Set',
'SEQUENCE OF': 'univ.SequenceOf',
'SET OF': 'univ.SetOf',
'UTF8String': 'char.UTF8String',
super(SequenceType, self).__init__(elements)
+class SetType(ConstructedType):
+ def __init__(self, elements):
+ super(SetType, self).__init__(elements)
+
+
class SequenceOfType(object):
def __init__(self, elements):
type_name, type_token = elements
return SequenceType(token.elements)
elif token.ty == 'ChoiceType':
return ChoiceType(token.elements)
+ elif token.ty == 'SetType':
+ return SetType(token.elements)
elif token.ty == 'SequenceOfType':
return SequenceOfType(token.elements)
elif token.ty == 'SetOfType':