# make sure we have mapping instructions for the element
mappedName={
'SEQUENCE':'OnSequence',
'SET':'OnSet',
'CHOICE':'OnChoice',
'SEQUENCEOF':'OnSequenceOf',
'SETOF':'OnSetOf',
'ENUMERATED':'OnEnumerated'
}
ifmappedName[leafType]notindir(backend):
panic("ASN.1 grammar contains %s but no %s section found in the mapping grammar (%s)"%(nodeTypename,mappedName[leafType],backendFilename))# pragma: no cover
processor=backend.__dict__[mappedName[leafType]]
processor(nodeTypename,node,leafTypeDict)
# what type is it?
processor=backend.OnBasic
elifleafType=='SEQUENCE':
processor=backend.OnSequence
elifleafType=='SET':
processor=backend.OnSet# pragma: no cover
elifleafType=='CHOICE':
processor=backend.OnChoice
elifleafType=='SEQUENCEOF':
processor=backend.OnSequenceOf
elifleafType=='SETOF':
processor=backend.OnSetOf# pragma: no cover
elifleafType=='ENUMERATED':
processor=backend.OnEnumerated
else:# pragma: no cover
panic("Unexpected type of element: %s"%leafTypeDict[nodeTypename])# pragma: no cover
panic("Unexpected type of element: %s"%leafType)# pragma: no cover