Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

565 lines
31 KiB

  1. #ifndef _ASN1_PARSER_
  2. #define _ASN1_PARSER_
  3. /* Copyright (C) Boris Nikolaus, Germany, 1996-1997. All rights reserved. */
  4. typedef char *XString;
  5. typedef char32_t *XString32;
  6. typedef intx_t XNumber;
  7. typedef ASN1bool_t XBoolean;
  8. typedef Type_t *XType;
  9. typedef TagType_e XTagType;
  10. typedef TagClass_e XTagClass;
  11. typedef Tag_t *XTags;
  12. typedef ExtensionType_e XExtensionType;
  13. typedef NamedType_t *XNamedType;
  14. typedef ComponentList_t XComponents;
  15. typedef Constraint_t *XConstraints;
  16. typedef ElementSetSpec_t *XElementSetSpec;
  17. typedef SubtypeElement_t *XSubtypeElement;
  18. typedef ObjectSetElement_t *XObjectSetElement;
  19. typedef DirectiveList_t XDirectives;
  20. typedef NamedConstraintList_t XNamedConstraints;
  21. typedef Presence_e XPresence;
  22. typedef NamedNumberList_t XNamedNumbers;
  23. typedef Value_t *XValue;
  24. typedef ValueSet_t *XValueSet;
  25. typedef EndPoint_t XEndPoint;
  26. typedef Tuple_t XTuple;
  27. typedef Quadruple_t XQuadruple;
  28. typedef NamedValueList_t XNamedValues;
  29. typedef ModuleIdentifier_t *XModuleIdentifier;
  30. typedef NamedObjIdValueList_t XNamedObjIdValue;
  31. typedef ObjectClass_t *XObjectClass;
  32. typedef ObjectSet_t *XObjectSet;
  33. typedef Object_t *XObject;
  34. typedef SyntaxSpecList_t XSyntaxSpecs;
  35. typedef FieldSpecList_t XFieldSpecs;
  36. typedef Optionality_t *XOptionality;
  37. typedef SettingList_t XSettings;
  38. typedef StringList_t XStrings;
  39. typedef StringModuleList_t XStringModules;
  40. typedef Macro_t *XMacro;
  41. typedef MacroProduction_t *XMacroProduction;
  42. typedef NamedMacroProductionList_t XMacroProductions;
  43. typedef MacroLocalAssignmentList_t XMacroLocalAssignments;
  44. typedef PrivateDirectives_t *XPrivateDirectives;
  45. typedef struct LLPOS {
  46. int line;
  47. int column;
  48. char *file;
  49. } LLPOS;
  50. typedef struct LLSTATE {
  51. LLPOS pos;
  52. AssignmentList_t Assignments;
  53. AssignedObjIdList_t AssignedObjIds;
  54. UndefinedSymbolList_t Undefined;
  55. UndefinedSymbolList_t BadlyDefined;
  56. ModuleIdentifier_t *Module;
  57. ModuleIdentifier_t *MainModule;
  58. StringModuleList_t Imported;
  59. TagType_e TagDefault;
  60. ExtensionType_e ExtensionDefault;
  61. } LLSTATE;
  62. int ll_Main(LLSTATE *llin, LLSTATE *llout);
  63. int ll_ModuleDefinition_ESeq(LLSTATE *llin, LLSTATE *llout);
  64. int ll_ModuleDefinition(LLSTATE *llin, LLSTATE *llout);
  65. int ll_ModuleIdentifier(XModuleIdentifier *llret, LLSTATE *llin, LLSTATE *llout);
  66. int ll_DefinitiveIdentifier(XValue *llret, LLSTATE *llin, LLSTATE *llout);
  67. int ll_DefinitiveObjIdComponentList(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout);
  68. int ll_DefinitiveObjIdComponent(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout);
  69. int ll_DefinitiveNumberForm(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout);
  70. int ll_DefinitiveNameAndNumberForm(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout);
  71. int ll_TagDefault(XTagType *llret, LLSTATE *llin, LLSTATE *llout);
  72. int ll_ExtensionDefault(XExtensionType *llret, LLSTATE *llin, LLSTATE *llout);
  73. int ll_ModuleBody(LLSTATE *llin, LLSTATE *llout);
  74. int ll_Exports(XStrings *llret, LLSTATE *llin, LLSTATE *llout);
  75. int ll_SymbolsExported(XStrings *llret, LLSTATE *llin, LLSTATE *llout);
  76. int ll_Imports(XStringModules *llret, LLSTATE *llin, LLSTATE *llout);
  77. int ll_SymbolsImported(XStringModules *llret, LLSTATE *llin, LLSTATE *llout);
  78. int ll_SymbolsFromModule_ESeq(XStringModules *llret, LLSTATE *llin, LLSTATE *llout);
  79. int ll_SymbolsFromModule(XStringModules *llret, LLSTATE *llin, LLSTATE *llout);
  80. int ll_GlobalModuleReference(XModuleIdentifier *llret, LLSTATE *llin, LLSTATE *llout);
  81. int ll_AssignedIdentifier(XValue *llret, LLSTATE *llin, LLSTATE *llout);
  82. int ll_SymbolList(XStrings *llret, LLSTATE *llin, LLSTATE *llout);
  83. int ll_Symbol(XString *llret, LLSTATE *llin, LLSTATE *llout);
  84. int ll_Reference(XString *llret, LLSTATE *llin, LLSTATE *llout);
  85. int ll_AssignmentList(LLSTATE *llin, LLSTATE *llout);
  86. int ll_Assignment_ESeq(LLSTATE *llin, LLSTATE *llout);
  87. int ll_Assignment(LLSTATE *llin, LLSTATE *llout);
  88. int ll_typereference(XType *llret, LLSTATE *llin, LLSTATE *llout);
  89. int ll_Externaltypereference(XType *llret, LLSTATE *llin, LLSTATE *llout);
  90. int ll_valuereference(XValue *llret, LLSTATE *llin, LLSTATE *llout);
  91. int ll_Externalvaluereference(XValue *llret, LLSTATE *llin, LLSTATE *llout);
  92. int ll_objectclassreference(XObjectClass *llret, LLSTATE *llin, LLSTATE *llout);
  93. int ll_ExternalObjectClassReference(XObjectClass *llret, LLSTATE *llin, LLSTATE *llout);
  94. int ll_objectreference(XObject *llret, LLSTATE *llin, LLSTATE *llout);
  95. int ll_ExternalObjectReference(XObject *llret, LLSTATE *llin, LLSTATE *llout);
  96. int ll_objectsetreference(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout);
  97. int ll_ExternalObjectSetReference(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout);
  98. int ll_macroreference(XMacro *llret, LLSTATE *llin, LLSTATE *llout);
  99. int ll_Externalmacroreference(XMacro *llret, LLSTATE *llin, LLSTATE *llout);
  100. int ll_localtypereference(XString *llret, LLSTATE *llin, LLSTATE *llout);
  101. int ll_localvaluereference(XString *llret, LLSTATE *llin, LLSTATE *llout);
  102. int ll_productionreference(XString *llret, LLSTATE *llin, LLSTATE *llout);
  103. int ll_modulereference(XModuleIdentifier *llret, LLSTATE *llin, LLSTATE *llout);
  104. int ll_typefieldreference(XString *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  105. int ll_valuefieldreference(XString *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  106. int ll_valuesetfieldreference(XString *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  107. int ll_objectfieldreference(XString *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  108. int ll_objectsetfieldreference(XString *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  109. int ll_word(XString *llret, LLSTATE *llin, LLSTATE *llout);
  110. int ll_identifier(XString *llret, LLSTATE *llin, LLSTATE *llout);
  111. int ll_ucsymbol(XString *llret, LLSTATE *llin, LLSTATE *llout);
  112. int ll_ocsymbol(XString *llret, LLSTATE *llin, LLSTATE *llout);
  113. int ll_astring(XString *llret, LLSTATE *llin, LLSTATE *llout);
  114. int ll_DefinedType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  115. int ll_TypeAssignment(LLSTATE *llin, LLSTATE *llout);
  116. int ll_ValueSetTypeAssignment(LLSTATE *llin, LLSTATE *llout);
  117. int ll_ValueSet(XValueSet *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  118. int ll_Type(XType *llret, LLSTATE *llin, LLSTATE *llout);
  119. int ll_UndirectivedType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  120. int ll_UntaggedType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  121. int ll_ConstrainableType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  122. int ll_Constraint_ESeq(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  123. int ll_BuiltinType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  124. int ll_ReferencedType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  125. int ll_NamedType(XNamedType *llret, LLSTATE *llin, LLSTATE *llout);
  126. int ll_BooleanType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  127. int ll_IntegerType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  128. int ll_NamedNumberList(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout);
  129. int ll_NamedNumber(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout);
  130. int ll_EnumeratedType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  131. int ll_Enumerations(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout);
  132. int ll_EnumerationExtension(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout);
  133. int ll_Enumeration(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout);
  134. int ll_EnumerationItem(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout);
  135. int ll_RealType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  136. int ll_BitStringType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  137. int ll_NamedBitList(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout);
  138. int ll_NamedBit(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout);
  139. int ll_OctetStringType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  140. int ll_UTF8StringType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  141. int ll_NullType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  142. int ll_SequenceType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  143. int ll_ExtensionAndException(XComponents *llret, LLSTATE *llin, LLSTATE *llout);
  144. int ll_ExtendedComponentTypeList(XComponents *llret, LLSTATE *llin, LLSTATE *llout);
  145. int ll_ComponentTypeListExtension(XComponents *llret, LLSTATE *llin, LLSTATE *llout);
  146. int ll_AdditionalComponentTypeList(XComponents *llret, LLSTATE *llin, LLSTATE *llout);
  147. int ll_ComponentTypeList(XComponents *llret, LLSTATE *llin, LLSTATE *llout);
  148. int ll_ComponentType(XComponents *llret, LLSTATE *llin, LLSTATE *llout);
  149. int ll_ComponentTypePostfix(XComponents *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  150. int ll_SequenceOfType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  151. int ll_SetType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  152. int ll_SetOfType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  153. int ll_ChoiceType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  154. int ll_ExtendedAlternativeTypeList(XComponents *llret, LLSTATE *llin, LLSTATE *llout);
  155. int ll_AlternativeTypeListExtension(XComponents *llret, LLSTATE *llin, LLSTATE *llout);
  156. int ll_AdditionalAlternativeTypeList(XComponents *llret, LLSTATE *llin, LLSTATE *llout);
  157. int ll_AlternativeTypeList(XComponents *llret, LLSTATE *llin, LLSTATE *llout);
  158. int ll_AnyType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  159. int ll_SelectionType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  160. int ll_TaggedType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  161. int ll_TagType(XTagType *llret, LLSTATE *llin, LLSTATE *llout);
  162. int ll_Tag(XTags *llret, LLSTATE *llin, LLSTATE *llout);
  163. int ll_ClassNumber(XValue *llret, LLSTATE *llin, LLSTATE *llout);
  164. int ll_Class(XTagClass *llret, LLSTATE *llin, LLSTATE *llout);
  165. int ll_ObjectIdentifierType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  166. int ll_EmbeddedPDVType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  167. int ll_ExternalType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  168. int ll_CharacterStringType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  169. int ll_RestrictedCharacterStringType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  170. int ll_UnrestrictedCharacterStringType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  171. int ll_UsefulType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  172. int ll_TypeWithConstraint(XType *llret, LLSTATE *llin, LLSTATE *llout);
  173. int ll_DefinedValue(XValue *llret, LLSTATE *llin, LLSTATE *llout);
  174. int ll_ValueAssignment(LLSTATE *llin, LLSTATE *llout);
  175. int ll_Value(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  176. int ll_BuiltinValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  177. int ll_ReferencedValue(XValue *llret, LLSTATE *llin, LLSTATE *llout);
  178. int ll_NamedValue(XNamedValues *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components);
  179. int ll_BooleanValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  180. int ll_SignedNumber(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  181. int ll_IntegerValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  182. int ll_EnumeratedValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  183. int ll_RealValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  184. int ll_NumericRealValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  185. int ll_SpecialRealValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  186. int ll_BitStringValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  187. int ll_IdentifierList(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  188. int ll_Identifier_EList(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  189. int ll_IdentifierList_Elem(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  190. int ll_OctetStringValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  191. int ll_NullValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  192. int ll_GeneralizedTimeValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  193. int ll_UTCTimeValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  194. int ll_ObjectDescriptorValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  195. int ll_SequenceValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  196. int ll_ComponentValueList(XNamedValues *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components);
  197. int ll_ComponentValueCList(XNamedValues *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components);
  198. int ll_SequenceOfValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  199. int ll_ValueList(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  200. int ll_ValueCList(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  201. int ll_SetValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  202. int ll_SetOfValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  203. int ll_ChoiceValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  204. int ll_ObjectIdentifierValue(XValue *llret, LLSTATE *llin, LLSTATE *llout);
  205. int ll_ObjIdComponentList(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout);
  206. int ll_ObjIdComponent_ESeq(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout);
  207. int ll_ObjIdComponent(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout);
  208. int ll_NameForm(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout);
  209. int ll_NumberForm(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout);
  210. int ll_NameAndNumberForm(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout);
  211. int ll_EmbeddedPDVValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  212. int ll_ExternalValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  213. int ll_CharacterStringValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  214. int ll_RestrictedCharacterStringValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  215. int ll_UnrestrictedCharacterStringValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  216. int ll_CharacterStringList(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  217. int ll_CharSyms(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  218. int ll_CharDefn(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  219. int ll_Quadruple(XQuadruple *llret, LLSTATE *llin, LLSTATE *llout);
  220. int ll_Tuple(XTuple *llret, LLSTATE *llin, LLSTATE *llout);
  221. int ll_AnyValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  222. int ll_Constraint(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha);
  223. int ll_ConstraintSpec(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha);
  224. int ll_SubtypeConstraint(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha);
  225. int ll_ExceptionSpec(LLSTATE *llin, LLSTATE *llout);
  226. int ll_ExceptionIdentification(LLSTATE *llin, LLSTATE *llout);
  227. int ll_ElementSetSpecs(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha);
  228. int ll_ElementSetSpecExtension(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha);
  229. int ll_AdditionalElementSetSpec(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha);
  230. int ll_ElementSetSpec(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha);
  231. int ll_Unions(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha);
  232. int ll_UnionList(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha);
  233. int ll_Intersections(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha);
  234. int ll_IntersectionList(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha);
  235. int ll_IntersectionElements(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha);
  236. int ll_Exclusions_Opt(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha);
  237. int ll_Exclusions(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha);
  238. int ll_UnionMark(LLSTATE *llin, LLSTATE *llout);
  239. int ll_IntersectionMark(LLSTATE *llin, LLSTATE *llout);
  240. int ll_Elements(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha);
  241. int ll_SubtypeElements(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha);
  242. int ll_SingleValue(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  243. int ll_ContainedSubtype(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  244. int ll_Includes(XBoolean *llret, LLSTATE *llin, LLSTATE *llout);
  245. int ll_ValueRange(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  246. int ll_LowerEndpoint(XEndPoint *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  247. int ll_UpperEndpoint(XEndPoint *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  248. int ll_LowerEndValue(XEndPoint *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  249. int ll_UpperEndValue(XEndPoint *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  250. int ll_SizeConstraint(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout);
  251. int ll_TypeConstraint(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout);
  252. int ll_PermittedAlphabet(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  253. int ll_InnerTypeConstraints(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  254. int ll_SingleTypeConstraint(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  255. int ll_MultipleTypeConstraints(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components);
  256. int ll_FullSpecification(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components);
  257. int ll_PartialSpecification(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components);
  258. int ll_TypeConstraints(XNamedConstraints *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components);
  259. int ll_NamedConstraint(XNamedConstraints *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components);
  260. int ll_ComponentConstraint(XNamedConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  261. int ll_ValueConstraint(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  262. int ll_PresenceConstraint(XPresence *llret, LLSTATE *llin, LLSTATE *llout);
  263. int ll_GeneralConstraint(LLSTATE *llin, LLSTATE *llout);
  264. int ll_LocalTypeDirectiveSeq(XDirectives *llret, LLSTATE *llin, LLSTATE *llout);
  265. int ll_LocalTypeDirectiveESeq(XDirectives *llret, LLSTATE *llin, LLSTATE *llout);
  266. int ll_LocalTypeDirective(XDirectives *llret, LLSTATE *llin, LLSTATE *llout);
  267. int ll_LocalSizeDirectiveSeq(XDirectives *llret, LLSTATE *llin, LLSTATE *llout);
  268. int ll_LocalSizeDirectiveESeq(XDirectives *llret, LLSTATE *llin, LLSTATE *llout);
  269. int ll_LocalSizeDirective(XDirectives *llret, LLSTATE *llin, LLSTATE *llout);
  270. int ll_PrivateDir_Type(XString *llret, LLSTATE *llin, LLSTATE *llout);
  271. int ll_PrivateDir_Field(XString *llret, LLSTATE *llin, LLSTATE *llout);
  272. int ll_PrivateDir_Value(XString *llret, LLSTATE *llin, LLSTATE *llout);
  273. int ll_PrivateDir_Public(int *llret, LLSTATE *llin, LLSTATE *llout);
  274. int ll_PrivateDir_Intx(int *llret, LLSTATE *llin, LLSTATE *llout);
  275. int ll_PrivateDir_LenPtr(int *llret, LLSTATE *llin, LLSTATE *llout);
  276. int ll_PrivateDir_Pointer(int *llret, LLSTATE *llin, LLSTATE *llout);
  277. int ll_PrivateDir_Array(int *llret, LLSTATE *llin, LLSTATE *llout);
  278. int ll_PrivateDir_NoCode(int *llret, LLSTATE *llin, LLSTATE *llout);
  279. int ll_PrivateDir_NoMemCopy(int *llret, LLSTATE *llin, LLSTATE *llout);
  280. int ll_PrivateDir_OidPacked(int *llret, LLSTATE *llin, LLSTATE *llout);
  281. int ll_PrivateDir_OidArray(int *llret, LLSTATE *llin, LLSTATE *llout);
  282. int ll_PrivateDir_SLinked(int *llret, LLSTATE *llin, LLSTATE *llout);
  283. int ll_PrivateDir_DLinked(int *llret, LLSTATE *llin, LLSTATE *llout);
  284. int ll_PrivateDirectives(XPrivateDirectives *llret, LLSTATE *llin, LLSTATE *llout);
  285. int ll_DefinedObjectClass(XObjectClass *llret, LLSTATE *llin, LLSTATE *llout);
  286. int ll_DefinedObject(XObject *llret, LLSTATE *llin, LLSTATE *llout);
  287. int ll_DefinedObjectSet(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout);
  288. int ll_Usefulobjectclassreference(XObjectClass *llret, LLSTATE *llin, LLSTATE *llout);
  289. int ll_ObjectClassAssignment(LLSTATE *llin, LLSTATE *llout);
  290. int ll_ObjectClass(XObjectClass *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  291. int ll_ObjectClassDefn(XObjectClass *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  292. int ll_FieldSpec_List(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  293. int ll_FieldSpec_EList(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  294. int ll_WithSyntaxSpec_opt(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  295. int ll_FieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  296. int ll_TypeFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  297. int ll_TypeOptionalitySpec_opt(XOptionality *llret, LLSTATE *llin, LLSTATE *llout);
  298. int ll_FixedTypeValueFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  299. int ll_UNIQUE_opt(XBoolean *llret, LLSTATE *llin, LLSTATE *llout);
  300. int ll_ValueOptionalitySpec_opt(XOptionality *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  301. int ll_VariableTypeValueFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  302. int ll_FixedTypeValueSetFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  303. int ll_ValueSetOptionalitySpec_opt(XOptionality *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  304. int ll_VariableTypeValueSetFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  305. int ll_ObjectFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  306. int ll_ObjectOptionalitySpec_opt(XOptionality *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  307. int ll_ObjectSetFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  308. int ll_ObjectSetOptionalitySpec_opt(XOptionality *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  309. int ll_PrimitiveFieldName(XString *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  310. int ll_FieldName(XStrings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  311. int ll_SyntaxList(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  312. int ll_TokenOrGroupSpec_Seq(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  313. int ll_TokenOrGroupSpec_ESeq(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  314. int ll_TokenOrGroupSpec(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  315. int ll_OptionalGroup(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  316. int ll_RequiredToken(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  317. int ll_Literal(XString *llret, LLSTATE *llin, LLSTATE *llout);
  318. int ll_ObjectAssignment(LLSTATE *llin, LLSTATE *llout);
  319. int ll_Object(XObject *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  320. int ll_ObjectDefn(XObject *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  321. int ll_DefaultSyntax(XObject *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  322. int ll_FieldSetting_EList(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se);
  323. int ll_FieldSetting_EListC(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se);
  324. int ll_FieldSetting(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se);
  325. int ll_DefinedSyntax(XObject *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  326. int ll_DefinedSyntaxToken_ESeq(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se, XSyntaxSpecs llarg_sy);
  327. int ll_DefinedSyntaxToken(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se, XSyntaxSpecs llarg_sy);
  328. int ll_DefinedSyntaxToken_Elem(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se, XSyntaxSpecs llarg_sy);
  329. int ll_Setting(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se, XString llarg_f);
  330. int ll_ObjectSetAssignment(LLSTATE *llin, LLSTATE *llout);
  331. int ll_ObjectSet(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  332. int ll_ObjectSetSpec(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  333. int ll_ObjectSetElements(XObjectSetElement *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc);
  334. int ll_ObjectClassFieldType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  335. int ll_ObjectClassFieldValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  336. int ll_OpenTypeFieldVal(XValue *llret, LLSTATE *llin, LLSTATE *llout);
  337. int ll_FixedTypeFieldVal(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  338. int ll_ValueFromObject(XValue *llret, LLSTATE *llin, LLSTATE *llout);
  339. int ll_ValueSetFromObjects(XValueSet *llret, LLSTATE *llin, LLSTATE *llout);
  340. int ll_TypeFromObject(XType *llret, LLSTATE *llin, LLSTATE *llout);
  341. int ll_ObjectFromObject(XObject *llret, LLSTATE *llin, LLSTATE *llout);
  342. int ll_ObjectSetFromObjects(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout);
  343. int ll_ReferencedObjects(XObject *llret, LLSTATE *llin, LLSTATE *llout);
  344. int ll_ReferencedObjectSets(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout);
  345. int ll_InstanceOfType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  346. int ll_InstanceOfValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  347. int ll_MacroDefinition(LLSTATE *llin, LLSTATE *llout);
  348. int ll_MacroDefinedType(XType *llret, LLSTATE *llin, LLSTATE *llout);
  349. int ll_MacroDefinedValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type);
  350. int ll_ParameterizedValueSetType(LLSTATE *llin, LLSTATE *llout);
  351. int ll_ParameterizedReference(LLSTATE *llin, LLSTATE *llout);
  352. int ll_ParameterizedType(LLSTATE *llin, LLSTATE *llout);
  353. int ll_ParameterizedValue(LLSTATE *llin, LLSTATE *llout);
  354. int ll_ParameterizedAssignment(LLSTATE *llin, LLSTATE *llout);
  355. int ll_ParameterizedObjectClass(LLSTATE *llin, LLSTATE *llout);
  356. int ll_ParameterizedObject(LLSTATE *llin, LLSTATE *llout);
  357. int ll_ParameterizedObjectSet(LLSTATE *llin, LLSTATE *llout);
  358. typedef union LLSTYPE{
  359. XNumber _XNumber;
  360. XString _XString;
  361. XString32 _XString32;
  362. XModuleIdentifier _XModuleIdentifier;
  363. XValue _XValue;
  364. XNamedObjIdValue _XNamedObjIdValue;
  365. XTagType _XTagType;
  366. XExtensionType _XExtensionType;
  367. XStrings _XStrings;
  368. XStringModules _XStringModules;
  369. XType _XType;
  370. XObjectClass _XObjectClass;
  371. XObject _XObject;
  372. XObjectSet _XObjectSet;
  373. XMacro _XMacro;
  374. XValueSet _XValueSet;
  375. XConstraints _XConstraints;
  376. XNamedType _XNamedType;
  377. XNamedNumbers _XNamedNumbers;
  378. XComponents _XComponents;
  379. XTags _XTags;
  380. XTagClass _XTagClass;
  381. XNamedValues _XNamedValues;
  382. XQuadruple _XQuadruple;
  383. XTuple _XTuple;
  384. XBoolean _XBoolean;
  385. XElementSetSpec _XElementSetSpec;
  386. XSubtypeElement _XSubtypeElement;
  387. XEndPoint _XEndPoint;
  388. XNamedConstraints _XNamedConstraints;
  389. XPresence _XPresence;
  390. XDirectives _XDirectives;
  391. int _int;
  392. XPrivateDirectives _XPrivateDirectives;
  393. XFieldSpecs _XFieldSpecs;
  394. XSyntaxSpecs _XSyntaxSpecs;
  395. XOptionality _XOptionality;
  396. XSettings _XSettings;
  397. XObjectSetElement _XObjectSetElement;
  398. } LLSTYPE;
  399. typedef struct LLTERM {
  400. int token;
  401. LLSTYPE lval;
  402. LLPOS pos;
  403. } LLTERM;
  404. void llscanner(LLTERM **tokens, unsigned *ntokens);
  405. int llparser(LLTERM *tokens, unsigned ntokens, LLSTATE *llin, LLSTATE *llout);
  406. void llprinterror(FILE *f);
  407. void llverror(FILE *f, LLPOS *pos, char *fmt, va_list args);
  408. void llerror(FILE *f, LLPOS *pos, char *fmt, ...);
  409. int llgettoken(int *token, LLSTYPE *lval, LLPOS *pos);
  410. #if LLDEBUG > 0
  411. void lldebug_init();
  412. #endif
  413. #define T_DEF 257
  414. #define T_DDOT 258
  415. #define T_TDOT 259
  416. #define T_TYPE_IDENTIFIER 260
  417. #define T_ABSTRACT_SYNTAX 261
  418. #define T_ZERO_TERMINATED 262
  419. #define T_POINTER 263
  420. #define T_NO_POINTER 264
  421. #define T_FIXED_ARRAY 265
  422. #define T_SINGLY_LINKED_LIST 266
  423. #define T_DOUBLY_LINKED_LIST 267
  424. #define T_LENGTH_POINTER 268
  425. #define T_Number 269
  426. #define T_number 270
  427. #define T_bstring 271
  428. #define T_hstring 272
  429. #define T_cstring 273
  430. #define T_only_uppercase_symbol 274
  431. #define T_only_uppercase_digits_symbol 275
  432. #define T_uppercase_symbol 276
  433. #define T_lcsymbol 277
  434. #define T_ampucsymbol 278
  435. #define T_amplcsymbol 279
  436. #define T_CON_XXX1 280
  437. #define T_CON_XXX2 281
  438. #define T_OBJ_XXX1 282
  439. #define T_OBJ_XXX2 283
  440. #define T_OBJ_XXX3 284
  441. #define T_OBJ_XXX4 285
  442. #define T_OBJ_XXX5 286
  443. #define T_OBJ_XXX6 287
  444. #define T_OBJ_XXX7 288
  445. #define T_DUM_XXX1 289
  446. #define T_DUM_XXX2 290
  447. #define T_DUM_XXX3 291
  448. #define T_DUM_XXX4 292
  449. #define T_DUM_XXX5 293
  450. #define T_DUM_XXX6 294
  451. #define T_DUM_XXX7 295
  452. #define T_DUM_XXX8 296
  453. #define T_DUM_XXX9 297
  454. #define T_DUM_XXX10 298
  455. #define T_DUM_XXX11 299
  456. #define T_DUM_XXX12 300
  457. #define T_DUM_XXX13 301
  458. #define T_DUM_XXX14 302
  459. #define T_DUM_XXX15 303
  460. #define T_DUM_XXX16 304
  461. #define T_DUM_XXX17 305
  462. #define T_DUM_XXX18 306
  463. #define T_DUM_XXX19 307
  464. #define T_DUM_XXX20 308
  465. #define T_DEFINITIONS 309
  466. #define T_BEGIN 310
  467. #define T_END 311
  468. #define T_EXPLICIT 312
  469. #define T_TAGS 313
  470. #define T_IMPLICIT 314
  471. #define T_AUTOMATIC 315
  472. #define T_EXTENSIBILITY 316
  473. #define T_IMPLIED 317
  474. #define T_EXPORTS 318
  475. #define T_IMPORTS 319
  476. #define T_FROM 320
  477. #define T_ABSENT 321
  478. #define T_ALL 322
  479. #define T_ANY 323
  480. #define T_APPLICATION 324
  481. #define T_BMPString 325
  482. #define T_BY 326
  483. #define T_CLASS 327
  484. #define T_COMPONENT 328
  485. #define T_COMPONENTS 329
  486. #define T_CONSTRAINED 330
  487. #define T_DEFAULT 331
  488. #define T_DEFINED 332
  489. #define T_empty 333
  490. #define T_EXCEPT 334
  491. #define T_GeneralizedTime 335
  492. #define T_GeneralString 336
  493. #define T_GraphicString 337
  494. #define T_IA5String 338
  495. #define T_IDENTIFIER 339
  496. #define T_identifier 340
  497. #define T_INCLUDES 341
  498. #define T_ISO646String 342
  499. #define T_MACRO 343
  500. #define T_MAX 344
  501. #define T_MIN 345
  502. #define T_NOTATION 346
  503. #define T_NumericString 347
  504. #define T_ObjectDescriptor 348
  505. #define T_OF 349
  506. #define T_OPTIONAL 350
  507. #define T_PDV 351
  508. #define T_PRESENT 352
  509. #define T_PrintableString 353
  510. #define T_PRIVATE 354
  511. #define T_SIZE 355
  512. #define T_STRING 356
  513. #define T_string 357
  514. #define T_SYNTAX 358
  515. #define T_T61String 359
  516. #define T_TeletexString 360
  517. #define T_TYPE 361
  518. #define T_type 362
  519. #define T_UNIQUE 363
  520. #define T_UNIVERSAL 364
  521. #define T_UniversalString 365
  522. #define T_UTCTime 366
  523. #define T_UTF8String 367
  524. #define T_VALUE 368
  525. #define T_value 369
  526. #define T_VideotexString 370
  527. #define T_VisibleString 371
  528. #define T_WITH 372
  529. #define T_BOOLEAN 373
  530. #define T_INTEGER 374
  531. #define T_ENUMERATED 375
  532. #define T_REAL 376
  533. #define T_BIT 377
  534. #define T_OCTET 378
  535. #define T_NULL 379
  536. #define T_SEQUENCE 380
  537. #define T_SET 381
  538. #define T_CHOICE 382
  539. #define T_OBJECT 383
  540. #define T_EMBEDDED 384
  541. #define T_EXTERNAL 385
  542. #define T_CHARACTER 386
  543. #define T_TRUE 387
  544. #define T_FALSE 388
  545. #define T_PLUS_INFINITY 389
  546. #define T_MINUS_INFINITY 390
  547. #define T_UNION 391
  548. #define T_INTERSECTION 392
  549. #define T_PrivateDir_TypeName 393
  550. #define T_PrivateDir_FieldName 394
  551. #define T_PrivateDir_ValueName 395
  552. #define T_PrivateDir_Public 396
  553. #define T_PrivateDir_Intx 397
  554. #define T_PrivateDir_LenPtr 398
  555. #define T_PrivateDir_Pointer 399
  556. #define T_PrivateDir_Array 400
  557. #define T_PrivateDir_NoCode 401
  558. #define T_PrivateDir_NoMemCopy 402
  559. #define T_PrivateDir_OidPacked 403
  560. #define T_PrivateDir_OidArray 404
  561. #define T_PrivateDir_SLinked 405
  562. #define T_PrivateDir_DLinked 406
  563. #define T_INSTANCE 407
  564. #endif // _ASN1_PARSER_