/* A Bison parser, made from parser-smi.y by GNU bison 1.35. */ #define YYBISON 1 /* Identify Bison output. */ #define yyparse smiparse #define yylex smilex #define yyerror smierror #define yylval smilval #define yychar smichar #define yydebug smidebug #define yynerrs sminerrs # define DOT_DOT 257 # define COLON_COLON_EQUAL 258 # define UPPERCASE_IDENTIFIER 259 # define LOWERCASE_IDENTIFIER 260 # define NUMBER 261 # define NEGATIVENUMBER 262 # define NUMBER64 263 # define NEGATIVENUMBER64 264 # define BIN_STRING 265 # define HEX_STRING 266 # define QUOTED_STRING 267 # define ACCESS 268 # define AGENT_CAPABILITIES 269 # define APPLICATION 270 # define AUGMENTS 271 # define BEGIN_ 272 # define BITS 273 # define CHOICE 274 # define CONTACT_INFO 275 # define CREATION_REQUIRES 276 # define COUNTER32 277 # define COUNTER64 278 # define DEFINITIONS 279 # define DEFVAL 280 # define DESCRIPTION 281 # define DISPLAY_HINT 282 # define END 283 # define ENTERPRISE 284 # define EXPORTS 285 # define EXTENDS 286 # define FROM 287 # define GROUP 288 # define GAUGE32 289 # define IDENTIFIER 290 # define IMPLICIT 291 # define IMPLIED 292 # define IMPORTS 293 # define INCLUDES 294 # define INDEX 295 # define INSTALL_ERRORS 296 # define INTEGER 297 # define INTEGER32 298 # define INTEGER64 299 # define IPADDRESS 300 # define LAST_UPDATED 301 # define MACRO 302 # define MANDATORY_GROUPS 303 # define MAX_ACCESS 304 # define MIN_ACCESS 305 # define MODULE 306 # define MODULE_COMPLIANCE 307 # define MODULE_IDENTITY 308 # define NOT_ACCESSIBLE 309 # define NOTIFICATIONS 310 # define NOTIFICATION_GROUP 311 # define NOTIFICATION_TYPE 312 # define OBJECT 313 # define OBJECT_GROUP 314 # define OBJECT_IDENTITY 315 # define OBJECT_TYPE 316 # define OBJECTS 317 # define OCTET 318 # define OF 319 # define ORGANIZATION 320 # define OPAQUE 321 # define PIB_ACCESS 322 # define PIB_DEFINITIONS 323 # define PIB_INDEX 324 # define PIB_MIN_ACCESS 325 # define PIB_REFERENCES 326 # define PIB_TAG 327 # define POLICY_ACCESS 328 # define PRODUCT_RELEASE 329 # define REFERENCE 330 # define REVISION 331 # define SEQUENCE 332 # define SIZE 333 # define STATUS 334 # define STRING 335 # define SUBJECT_CATEGORIES 336 # define SUPPORTS 337 # define SYNTAX 338 # define TEXTUAL_CONVENTION 339 # define TIMETICKS 340 # define TRAP_TYPE 341 # define UNIQUENESS 342 # define UNITS 343 # define UNIVERSAL 344 # define UNSIGNED32 345 # define UNSIGNED64 346 # define VALUE 347 # define VARIABLES 348 # define VARIATION 349 # define WRITE_SYNTAX 350 #line 14 "parser-smi.y" #include #ifdef BACKEND_SMI #include #include #include #include #include #include #include #if defined(_MSC_VER) #include #endif #include "smi.h" #include "error.h" #include "parser-smi.h" #include "scanner-smi.h" #include "data.h" #include "check.h" #include "util.h" #ifdef HAVE_DMALLOC_H #include #endif /* * These arguments are passed to yyparse() and yylex(). */ #define YYPARSE_PARAM parserPtr #define YYLEX_PARAM parserPtr #define thisParserPtr ((Parser *)parserPtr) #define thisModulePtr (((Parser *)parserPtr)->modulePtr) /* * NOTE: The argument lvalp is not really a void pointer. Unfortunately, * we don't know it better at this point. bison generated C code declares * YYSTYPE just a few lines below based on the `%union' declaration. */ extern int yylex(void *lvalp, Parser *parserPtr); static int impliedFlag; static SmiNodekind variationkind; static SmiBasetype defaultBasetype; static int indexFlag; /* * Values for the indexFlag variable */ #define INDEXFLAG_NONE 0 #define INDEXFLAG_PIBINDEX 1 #define INDEXFLAG_AUGMENTS 2 #define INDEXFLAG_EXTENDS 3 #define MAX_UNSIGNED32 4294967295 #define MIN_UNSIGNED32 0 #define MAX_INTEGER32 2147483647 #define MIN_INTEGER32 -2147483648 #define SMI_EPOCH 631152000 /* 01 Jan 1990 00:00:00 */ static char *convertImportv2[] = { "RFC1155-SMI", "internet", "SNMPv2-SMI", "internet", "RFC1155-SMI", "directory", "SNMPv2-SMI", "directory", "RFC1155-SMI", "mgmt", "SNMPv2-SMI", "mgmt", "RFC1155-SMI", "experimental", "SNMPv2-SMI", "experimental", "RFC1155-SMI", "private", "SNMPv2-SMI", "private", "RFC1155-SMI", "enterprises", "SNMPv2-SMI", "enterprises", "RFC1155-SMI", "IpAddress", "SNMPv2-SMI", "IpAddress", "RFC1155-SMI", "Counter", "SNMPv2-SMI", "Counter32", "RFC1155-SMI", "Gauge", "SNMPv2-SMI", "Gauge32", "RFC1155-SMI", "TimeTicks", "SNMPv2-SMI", "TimeTicks", "RFC1155-SMI", "Opaque", "SNMPv2-SMI", "Opaque", "RFC1065-SMI", "internet", "SNMPv2-SMI", "internet", "RFC1065-SMI", "directory", "SNMPv2-SMI", "directory", "RFC1065-SMI", "mgmt", "SNMPv2-SMI", "mgmt", "RFC1065-SMI", "experimental", "SNMPv2-SMI", "experimental", "RFC1065-SMI", "private", "SNMPv2-SMI", "private", "RFC1065-SMI", "enterprises", "SNMPv2-SMI", "enterprises", "RFC1065-SMI", "IpAddress", "SNMPv2-SMI", "IpAddress", "RFC1065-SMI", "Counter", "SNMPv2-SMI", "Counter32", "RFC1065-SMI", "Gauge", "SNMPv2-SMI", "Gauge32", "RFC1065-SMI", "TimeTicks", "SNMPv2-SMI", "TimeTicks", "RFC1065-SMI", "Opaque", "SNMPv2-SMI", "Opaque", "RFC1213-MIB", "mib-2", "SNMPv2-SMI", "mib-2", "RFC1213-MIB", "DisplayString", "SNMPv2-TC", "DisplayString", NULL, NULL, NULL, NULL }; static void checkDescr(Parser *parser, char *descr) { if (descr) { if (descr[0] == 0) { smiPrintError(parser, ERR_EMPTY_DESCRIPTION); } /* we might want to add more checks since I have recently seen things like DESCRIPTION "." to cirumvent warnings */ } } static void checkNameLen(Parser *parser, char *name, int error_32, int error_64) { int len = strlen(name); if (len > 64) { smiPrintError(parser, error_64, name); } else if (len > 32) { smiPrintError(parser, error_32, name); } } static void checkModuleName(Parser *parserPtr, Module *modulePtr) { static char *mib_ignore[] = { "SNMPv2-SMI", "SNMPv2-TC", "SNMPv2-CONF", NULL }; static char *pib_ignore[] = { "COPS-PR-SPPI", "COPS-PR-SPPI-TC", "SNMPv2-SMI", "SNMPv2-TC", "SNMPv2-CONF", NULL }; const char *name = thisModulePtr->export.name; const int len = strlen(name); int i; switch (modulePtr->export.language) { case SMI_LANGUAGE_SMIV1: case SMI_LANGUAGE_SMIV2: case SMI_LANGUAGE_SMING: for (i = 0; mib_ignore[i]; i++) { if (strcmp(mib_ignore[i], name) == 0) { return; } } if (len > 3 && (strcmp(name + len - 4, "-MIB") != 0)) { smiPrintError(parserPtr, ERR_MIB_MODULENAME_SUFFIX, name); return; } break; case SMI_LANGUAGE_SPPI: for (i = 0; pib_ignore[i]; i++) { if (strcmp(pib_ignore[i], name) == 0) { return; } } if (len > 3 && (strcmp(name + len - 4, "-PIB") != 0)) { smiPrintError(parserPtr, ERR_PIB_MODULENAME_SUFFIX, name); } break; case SMI_LANGUAGE_UNKNOWN: break; } } static void checkModuleIdentity(Parser *parserPtr, Module *modulePtr) { if ((modulePtr->export.language == SMI_LANGUAGE_SMIV2) && (modulePtr->numModuleIdentities < 1) && strcmp(modulePtr->export.name, "SNMPv2-SMI") && strcmp(modulePtr->export.name, "SNMPv2-CONF") && strcmp(modulePtr->export.name, "SNMPv2-TC") && strcmp(modulePtr->export.name, "COPS-PR-SPPI")) { smiPrintError(parserPtr, ERR_NO_MODULE_IDENTITY); } } static void checkObjects(Parser *parserPtr, Module *modulePtr) { Object *objectPtr; Node *nodePtr; int i; Type *counterTypePtr, *counter32TypePtr, *counter64TypePtr; counterTypePtr = findTypeByName("Counter"); counter32TypePtr = findTypeByModulenameAndName("SNMPv2-SMI", "Counter32"); counter64TypePtr = findTypeByModulenameAndName("SNMPv2-SMI", "Counter64"); for (objectPtr = modulePtr->firstObjectPtr; objectPtr; objectPtr = objectPtr->nextPtr) { Object *parentPtr; if ((objectPtr->export.decl != SMI_DECL_UNKNOWN) && objectPtr->nodePtr->parentPtr && objectPtr->nodePtr->parentPtr->lastObjectPtr) { parentPtr = objectPtr->nodePtr->parentPtr->lastObjectPtr; } else { parentPtr = NULL; } /* * Set nodekinds of all newly defined objects. */ if (objectPtr->export.decl == SMI_DECL_MODULEIDENTITY) { objectPtr->export.nodekind = SMI_NODEKIND_NODE; } else if ((objectPtr->export.decl == SMI_DECL_VALUEASSIGNMENT) || (objectPtr->export.decl == SMI_DECL_OBJECTIDENTITY)) { objectPtr->export.nodekind = SMI_NODEKIND_NODE; } else if ((objectPtr->export.decl == SMI_DECL_OBJECTTYPE) && (objectPtr->typePtr) && (objectPtr->typePtr->export.decl == SMI_DECL_IMPL_SEQUENCEOF)) { objectPtr->export.nodekind = SMI_NODEKIND_TABLE; } else if ((objectPtr->export.decl == SMI_DECL_OBJECTTYPE) && (objectPtr->export.indexkind != SMI_INDEX_UNKNOWN)) { objectPtr->export.nodekind = SMI_NODEKIND_ROW; } else if ((objectPtr->export.decl == SMI_DECL_NOTIFICATIONTYPE) || (objectPtr->export.decl == SMI_DECL_TRAPTYPE)) { objectPtr->export.nodekind = SMI_NODEKIND_NOTIFICATION; } else if ((objectPtr->export.decl == SMI_DECL_OBJECTGROUP) || (objectPtr->export.decl == SMI_DECL_NOTIFICATIONGROUP)) { objectPtr->export.nodekind = SMI_NODEKIND_GROUP; } else if (objectPtr->export.decl == SMI_DECL_MODULECOMPLIANCE) { objectPtr->export.nodekind = SMI_NODEKIND_COMPLIANCE; } else if (objectPtr->export.decl == SMI_DECL_AGENTCAPABILITIES) { objectPtr->export.nodekind = SMI_NODEKIND_CAPABILITIES; } else if ((objectPtr->export.decl == SMI_DECL_OBJECTTYPE) && (parentPtr) && (parentPtr->export.indexkind != SMI_INDEX_UNKNOWN)) { objectPtr->export.nodekind = SMI_NODEKIND_COLUMN; } else if ((objectPtr->export.decl == SMI_DECL_OBJECTTYPE) && (parentPtr) && (parentPtr->export.indexkind == SMI_INDEX_UNKNOWN)) { objectPtr->export.nodekind = SMI_NODEKIND_SCALAR; } } for (objectPtr = modulePtr->firstObjectPtr; objectPtr; objectPtr = objectPtr->nextPtr) { Object *parentPtr; if (objectPtr->nodePtr->parentPtr && objectPtr->nodePtr->parentPtr->lastObjectPtr) { parentPtr = objectPtr->nodePtr->parentPtr->lastObjectPtr; } else { parentPtr = NULL; } /* * Check whether the associated type resolves to a known base type. */ if (objectPtr->typePtr && (objectPtr->export.nodekind == SMI_NODEKIND_COLUMN || objectPtr->export.nodekind == SMI_NODEKIND_SCALAR) && objectPtr->typePtr->export.basetype == SMI_BASETYPE_UNKNOWN) { smiPrintErrorAtLine(parserPtr, ERR_BASETYPE_UNKNOWN, objectPtr->line, objectPtr->typePtr->export.name ? objectPtr->typePtr->export.name : "[unknown]", objectPtr->export.name); if (objectPtr->nodePtr->parentPtr->firstObjectPtr->export.nodekind == SMI_NODEKIND_TABLE) { /* the parent node is a table node, so assume this is * a row node. this adjusts missing INDEXs in RFC 1158. */ objectPtr->export.nodekind = SMI_NODEKIND_ROW; } } /* * Mark types that are referenced in this module. */ if (objectPtr->typePtr && (objectPtr->export.nodekind == SMI_NODEKIND_COLUMN || objectPtr->export.nodekind == SMI_NODEKIND_SCALAR) && (objectPtr->typePtr->export.decl == SMI_DECL_TYPEDEF || objectPtr->typePtr->export.decl == SMI_DECL_TEXTUALCONVENTION || objectPtr->typePtr->export.decl == SMI_DECL_IMPLICIT_TYPE)) { addTypeFlags(objectPtr->typePtr, FLAG_INSYNTAX); if (objectPtr->typePtr->export.decl == SMI_DECL_IMPLICIT_TYPE) { addTypeFlags(objectPtr->typePtr->parentPtr, FLAG_INSYNTAX); } } /* * Check whether the status of the associated type matches the * status of the object. */ if (objectPtr->typePtr && (objectPtr->export.nodekind == SMI_NODEKIND_COLUMN || objectPtr->export.nodekind == SMI_NODEKIND_SCALAR) && (objectPtr->export.status < objectPtr->typePtr->export.status)) { if (objectPtr->typePtr->export.status == SMI_STATUS_DEPRECATED) { smiPrintErrorAtLine(parserPtr, ERR_TYPE_STATUS_DEPRECATED, objectPtr->line, objectPtr->typePtr->export.name, objectPtr->export.name); } if (objectPtr->typePtr->export.status == SMI_STATUS_OBSOLETE) { smiPrintErrorAtLine(parserPtr, ERR_TYPE_STATUS_OBSOLETE, objectPtr->line, objectPtr->typePtr->export.name, objectPtr->export.name); } } /* * Check the nodekind of the parent node. */ if (parentPtr) { switch (objectPtr->export.nodekind) { case SMI_NODEKIND_COLUMN: if (parentPtr->export.nodekind != SMI_NODEKIND_ROW) { smiPrintErrorAtLine(parserPtr, ERR_COLUMN_PARENT_TYPE, objectPtr->line, objectPtr->export.name); } break; case SMI_NODEKIND_ROW: if (parentPtr->export.nodekind != SMI_NODEKIND_TABLE) { smiPrintErrorAtLine(parserPtr, ERR_ROW_PARENT_TYPE, objectPtr->line, objectPtr->export.name); } if (parentPtr->typePtr && parentPtr->typePtr->parentPtr && strcmp(parentPtr->typePtr->parentPtr->export.name, objectPtr->typePtr->export.name)) { smiPrintErrorAtLine(parserPtr, ERR_TABLE_ROW_TYPE_MISMATCH, objectPtr->line, objectPtr->export.name); } break; case SMI_NODEKIND_TABLE: if ((parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN) && (parentPtr->export.nodekind != SMI_NODEKIND_NODE)) { smiPrintErrorAtLine(parserPtr, ERR_TABLE_PARENT_TYPE, objectPtr->line, objectPtr->export.name); } break; case SMI_NODEKIND_SCALAR: if ((parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN) && (parentPtr->export.nodekind != SMI_NODEKIND_NODE)) { smiPrintErrorAtLine(parserPtr, ERR_SCALAR_PARENT_TYPE, objectPtr->line, objectPtr->export.name); } break; case SMI_NODEKIND_NOTIFICATION: if ((parentPtr->export.nodekind != SMI_NODEKIND_NODE) && (parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN)) { smiPrintErrorAtLine(parserPtr, ERR_NOTIFICATION_PARENT_TYPE, objectPtr->line, objectPtr->export.name); } if (parserPtr && parentPtr->nodePtr->parentPtr && parentPtr->nodePtr->parentPtr->lastObjectPtr) { Object *parent2Ptr = parentPtr->nodePtr->parentPtr->lastObjectPtr; if ((parent2Ptr->export.nodekind != SMI_NODEKIND_NODE) && (parent2Ptr->export.nodekind != SMI_NODEKIND_UNKNOWN)) { smiPrintErrorAtLine(parserPtr, ERR_NOTIFICATION_PARENT_TYPE, objectPtr->line, objectPtr->export.name); } } break; case SMI_NODEKIND_NODE: /* Node defined by OBJECT IDENTIFIER assignments can have arbitrary parent node. */ if ((parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN) && (parentPtr->export.nodekind != SMI_NODEKIND_NODE) && (objectPtr->export.decl != SMI_DECL_VALUEASSIGNMENT)) { smiPrintErrorAtLine(parserPtr, ERR_NODE_PARENT_TYPE, objectPtr->line, objectPtr->export.name); } break; case SMI_NODEKIND_GROUP: if ((parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN) && (parentPtr->export.nodekind != SMI_NODEKIND_NODE)) { smiPrintErrorAtLine(parserPtr, ERR_GROUP_PARENT_TYPE, objectPtr->line, objectPtr->export.name); } break; case SMI_NODEKIND_COMPLIANCE: if ((parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN) && (parentPtr->export.nodekind != SMI_NODEKIND_NODE)) { smiPrintErrorAtLine(parserPtr, ERR_COMPLIANCE_PARENT_TYPE, objectPtr->line, objectPtr->export.name); } break; case SMI_NODEKIND_CAPABILITIES: if ((parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN) && (parentPtr->export.nodekind != SMI_NODEKIND_NODE)) { smiPrintErrorAtLine(parserPtr, ERR_CAPABILITIES_PARENT_TYPE, objectPtr->line, objectPtr->export.name); } break; } } /* * Check whether groups only contain scalars, columns and * notifications. */ if (objectPtr->export.nodekind == SMI_NODEKIND_GROUP) { smiCheckGroupMembers(parserPtr, objectPtr); } /* * Check whether compliance statements contain out of date * groups or objects. */ if (objectPtr->export.nodekind == SMI_NODEKIND_COMPLIANCE) { smiCheckComplianceStatus(parserPtr, objectPtr); } /* * Check whether notification statements contain useful * objects. */ if (objectPtr->export.nodekind == SMI_NODEKIND_NOTIFICATION) { smiCheckNotificationOid(parserPtr, modulePtr, objectPtr); smiCheckNotificationMembers(parserPtr, objectPtr); } if (modulePtr->export.language != SMI_LANGUAGE_SPPI) { /* * Check whether tables and rows are not accessible * (RFC 2578 7.1.12). */ if (objectPtr->export.nodekind == SMI_NODEKIND_TABLE && objectPtr->export.access != SMI_ACCESS_NOT_ACCESSIBLE) { smiPrintErrorAtLine(parserPtr, ERR_TABLE_ACCESS, objectPtr->line, objectPtr->export.name); } if (objectPtr->export.nodekind == SMI_NODEKIND_ROW && objectPtr->export.access != SMI_ACCESS_NOT_ACCESSIBLE) { smiPrintErrorAtLine(parserPtr, ERR_ROW_ACCESS, objectPtr->line, objectPtr->export.name); } /* * Check whether counter objects are read-only or * accessible-for-notify (RFC 2578, 7.1.6). */ if (((objectPtr->export.nodekind == SMI_NODEKIND_SCALAR) || (objectPtr->export.nodekind == SMI_NODEKIND_COLUMN)) && (objectPtr->export.access != SMI_ACCESS_NOTIFY) && (objectPtr->export.access != SMI_ACCESS_READ_ONLY) && (smiTypeDerivedFrom(objectPtr->typePtr, counterTypePtr) || smiTypeDerivedFrom(objectPtr->typePtr, counter32TypePtr) || smiTypeDerivedFrom(objectPtr->typePtr, counter64TypePtr))) { smiPrintErrorAtLine(parserPtr, ERR_COUNTER_ACCESS, objectPtr->line, objectPtr->export.name); } } /* * Check whether a row's subid is 1, see RFC 2578 7.10 (1). */ if (objectPtr->export.nodekind == SMI_NODEKIND_ROW) { int len; if (objectPtr->nodePtr->subid != 1) { smiPrintErrorAtLine(parserPtr, ERR_ROW_SUBID_ONE, objectPtr->line, objectPtr->export.name); } len = strlen(objectPtr->export.name); if (len < 6 || strcmp(objectPtr->export.name+len-5, "Entry")) { smiPrintErrorAtLine(parserPtr, ERR_ROWNAME_ENTRY, objectPtr->line, objectPtr->export.name); } else { /* * This misreports some cases where the table name * does not have the "*Table" suffix. This is trying * to allow Entry names of either fooTableEntry or * fooEntry. */ if (parentPtr && !(((int)strlen(parentPtr->export.name) == len || (int)strlen(parentPtr->export.name) == len - 5) && !strncmp(objectPtr->export.name, parentPtr->export.name, len - 5))) { smiPrintErrorAtLine(parserPtr, ERR_ROWNAME_TABLENAME, objectPtr->line, objectPtr->export.name, parentPtr->export.name); } } } /* * Check whether a row's SEQUENCE contains exactly the list * of child nodes (columns). An unknown SEQUENCE type * is handled later. */ if (objectPtr->export.nodekind == SMI_NODEKIND_ROW && ((objectPtr->typePtr->flags & FLAG_INCOMPLETE) == 0)) { List *p; Node *seqNodePtr, *childNodePtr; Object *colPtr; int i; /* * Walk through the SEQUENCE elements and find those * that are misordered or have no matching columnar object. */ for (p = objectPtr->typePtr->listPtr, i = 1, childNodePtr = objectPtr->nodePtr->firstChildPtr; p && childNodePtr; p = p->nextPtr, childNodePtr = childNodePtr->nextPtr, i++) { seqNodePtr = ((Object *)p->ptr)->nodePtr; if (seqNodePtr->parentPtr != childNodePtr->parentPtr) { smiPrintErrorAtLine(parserPtr, ERR_SEQUENCE_NO_COLUMN, objectPtr->typePtr->line, i, ((Object *)p->ptr)->export.name, objectPtr->export.name); continue; } if (seqNodePtr != childNodePtr) { smiPrintErrorAtLine(parserPtr, ERR_SEQUENCE_ORDER, objectPtr->typePtr->line, i, ((Object *)p->ptr)->export.name, objectPtr->export.name); break; } } if ((p != NULL) && (childNodePtr == NULL)) { smiPrintErrorAtLine(parserPtr, ERR_SEQUENCE_NO_COLUMN, objectPtr->typePtr->line, i, ((Object *)p->ptr)->export.name, objectPtr->export.name); } /* * Walk through all child objects and find those * that were missing in the SEQUENCE. */ for (childNodePtr = objectPtr->nodePtr->firstChildPtr; childNodePtr; childNodePtr = childNodePtr->nextPtr) { colPtr = findObjectByModuleAndNode(modulePtr, childNodePtr); if (!colPtr) continue; for (p = objectPtr->typePtr->listPtr; p; p = p->nextPtr) { if (((Object *)p->ptr)->nodePtr == colPtr->nodePtr) break; } if (!p) { if (colPtr->export.name) { /* * Don't complain, if it's an implcitly defined * unnamed node (could happen for parent node of * TRAP-TYPE definitions). */ smiPrintErrorAtLine(parserPtr, ERR_SEQUENCE_MISSING_COLUMN, objectPtr->typePtr->line, objectPtr->typePtr->export.name, colPtr->export.name); } } } } if (objectPtr->export.nodekind == SMI_NODEKIND_TABLE) { int len; len = strlen(objectPtr->export.name); if (len < 6 || strcmp(objectPtr->export.name+len-5, "Table")) { smiPrintErrorAtLine(parserPtr, ERR_TABLENAME_TABLE, objectPtr->line, objectPtr->export.name); } } /* * TODO: check whether the row is the only node below the * table node */ /* * Check references to unknown identifiers. */ if ((objectPtr->flags & FLAG_INCOMPLETE) && (objectPtr->export.decl != SMI_DECL_IMPL_OBJECT)) { if (objectPtr->export.name) { smiPrintErrorAtLine(parserPtr, ERR_UNKNOWN_OIDLABEL, objectPtr->line, objectPtr->export.name); } else { smiPrintErrorAtLine(parserPtr, ERR_IMPLICIT_NODE, objectPtr->line); } } /* * Adjust the status of implicit type definitions. */ if (objectPtr->typePtr && (objectPtr->typePtr->export.decl == SMI_DECL_IMPLICIT_TYPE) && (objectPtr->typePtr->export.status == SMI_STATUS_UNKNOWN)) { objectPtr->typePtr->export.status = objectPtr->export.status; } /* * Link implicit type definition from refinements into * the type derivation tree. Adjust the status of implicit * type definitions in refinements. */ if (objectPtr->export.nodekind == SMI_NODEKIND_COMPLIANCE) { List *listPtr; for (listPtr = objectPtr->refinementlistPtr; listPtr; listPtr = listPtr->nextPtr) { Refinement *refinementPtr; Type *typePtr; refinementPtr = ((Refinement *)(listPtr->ptr)); typePtr = refinementPtr->typePtr; if (typePtr) { if (typePtr->export.status == SMI_STATUS_UNKNOWN) { typePtr->export.status = objectPtr->export.status; } } typePtr = refinementPtr->writetypePtr; if (typePtr) { if (typePtr->export.status == SMI_STATUS_UNKNOWN) { typePtr->export.status = objectPtr->export.status; } } } /* relocate the refinement type into the type tree */ /* relocate the write refinement type into the type tree */ } /* * Set the oidlen/oid values that are not yet correct. */ if (objectPtr->export.oidlen == 0) { if (objectPtr->nodePtr->oidlen == 0) { for (nodePtr = objectPtr->nodePtr, i = 1; nodePtr->parentPtr != thisParserPtr->pendingNodePtr && nodePtr->parentPtr != smiHandle->rootNodePtr && nodePtr != nodePtr->parentPtr && i <= 128; nodePtr = nodePtr->parentPtr, i++); if ((objectPtr->export.name) && ((i > 128) || (nodePtr == nodePtr->parentPtr))) { smiPrintErrorAtLine(parserPtr, ERR_OID_RECURSIVE, objectPtr->line, objectPtr->export.name); } objectPtr->nodePtr->oid = smiMalloc(i * sizeof(SmiSubid)); objectPtr->nodePtr->oidlen = i; for (nodePtr = objectPtr->nodePtr; i > 0; i--) { objectPtr->nodePtr->oid[i-1] = nodePtr->subid; nodePtr = nodePtr->parentPtr; } } objectPtr->export.oidlen = objectPtr->nodePtr->oidlen; objectPtr->export.oid = objectPtr->nodePtr->oid; } if ((objectPtr->export.decl != SMI_DECL_UNKNOWN) && (objectPtr->export.nodekind != SMI_NODEKIND_NODE) && objectPtr->export.name && objectPtr->export.oid[objectPtr->export.oidlen-1] == 0 && objectPtr->export.oidlen != 2 && objectPtr->export.oid[0] != 0) { smiPrintErrorAtLine(parserPtr, ERR_OID_ADMIN_ZERO, objectPtr->line, objectPtr->export.name); } /* * Check whether the module identity is registered in a well * known controlled location. */ if (objectPtr->export.decl == SMI_DECL_MODULEIDENTITY) { smiCheckModuleIdentityRegistration(parserPtr, objectPtr); } /* * Check table linkage constraints for row objects. */ if (objectPtr->export.nodekind == SMI_NODEKIND_ROW) { switch (objectPtr->export.indexkind) { case SMI_INDEX_INDEX: smiCheckIndex(parserPtr, objectPtr); break; case SMI_INDEX_AUGMENT: case SMI_INDEX_SPARSE: smiCheckAugment(parserPtr, objectPtr); break; default: break; } } /* * Determine the longest common OID prefix of all nodes. */ if (!modulePtr->prefixNodePtr) { modulePtr->prefixNodePtr = objectPtr->nodePtr; } else { if (objectPtr->nodePtr->oidlen < modulePtr->prefixNodePtr->oidlen) { Node *nodePtr = findNodeByOid(objectPtr->nodePtr->oidlen, modulePtr->prefixNodePtr->oid); if (nodePtr) modulePtr->prefixNodePtr = nodePtr; else smiPrintError(parserPtr, ERR_OTHER_ERROR, "Failed to create complete object tree - " "expect incorrect output"); } for (i = 0; i < modulePtr->prefixNodePtr->oidlen; i++) { if (modulePtr->prefixNodePtr->oid[i] != objectPtr->nodePtr->oid[i]) { modulePtr->prefixNodePtr = findNodeByOid(i, modulePtr->prefixNodePtr->oid); break; } } } } if (modulePtr->export.language == SMI_LANGUAGE_SMIV2) { for (objectPtr = modulePtr->firstObjectPtr; objectPtr; objectPtr = objectPtr->nextPtr) { /* * Check whether all objects and notifications are contained in at * least one conformance group (RFC 2580 3.3 and 4.1). */ smiCheckGroupMembership(parserPtr, objectPtr); } } if (modulePtr->export.language == SMI_LANGUAGE_SPPI) { Object *parentPtr; for (objectPtr = modulePtr->firstObjectPtr; objectPtr; objectPtr = objectPtr->nextPtr) { /* * All checks for SPPI constructs */ if (objectPtr->nodePtr->parentPtr) parentPtr = objectPtr->nodePtr->parentPtr->lastObjectPtr; else parentPtr = NULL; /* * Do all rows contain a PIB-INDEX/AUGMENTS/EXTENDS ? * See RFC 3159 7.5, 7.7, 7.8 */ if (parentPtr && (parentPtr->export.nodekind == SMI_NODEKIND_TABLE) && (objectPtr->export.indexkind != SMI_INDEX_INDEX) && (objectPtr->export.indexkind != SMI_INDEX_AUGMENT) && (objectPtr->export.indexkind != SMI_INDEX_SPARSE)) smiPrintErrorAtLine(parserPtr, ERR_ROW_LACKS_PIB_INDEX, objectPtr->line); /* * Does any non row contain a PIB-INDEX/AUGMENTS/EXTENDS ? * See RFC 3159 7.5, 7.7, 7.8 */ if ((objectPtr->export.nodekind != SMI_NODEKIND_ROW) && (objectPtr->export.indexkind != SMI_INDEX_UNKNOWN)) smiPrintErrorAtLine(parserPtr, ERR_PIB_INDEX_FOR_NON_ROW_TYPE, objectPtr->line); /* * Check the PIB-INDEX and other indices */ if ((objectPtr->export.nodekind == SMI_NODEKIND_ROW) && (objectPtr->export.indexkind == SMI_INDEX_INDEX)) { /* * Only the first element (PIB-INDEX) has to be an InstanceId. * See RFC 3159 7.5 */ if (objectPtr->listPtr && objectPtr->listPtr->ptr) { Object *pibindex = (Object *)objectPtr->listPtr->ptr; if (pibindex->typePtr && pibindex->typePtr->export.name && strcmp(pibindex->typePtr->export.name, "InstanceId")) smiPrintErrorAtLine(thisParserPtr, ERR_PIB_INDEX_NOT_INSTANCEID, pibindex->line, pibindex->export.name); } } /* * Do all tables contain a PIB-ACCESS clause? * See RFC 3159 7.3 */ if ((objectPtr->export.nodekind == SMI_NODEKIND_TABLE) && (objectPtr->export.access == SMI_ACCESS_UNKNOWN)) smiPrintErrorAtLine(parserPtr, ERR_TABLE_LACKS_PIB_ACCESS, objectPtr->line); /* * Does any non table types contain a PIB-ACCESS clause? * See RFC 3159 7.3 */ if (((objectPtr->export.nodekind == SMI_NODEKIND_NODE) || (objectPtr->export.nodekind == SMI_NODEKIND_ROW) || (objectPtr->export.nodekind == SMI_NODEKIND_SCALAR)) && (objectPtr->export.access != SMI_ACCESS_UNKNOWN)) smiPrintErrorAtLine(parserPtr, ERR_PIB_ACCESS_FOR_NON_TABLE, objectPtr->line); /* * Check the UNIQUENESS clause and its entries * See RFC 3159 7.9 */ if (objectPtr->uniquenessPtr) { if (objectPtr->export.nodekind != SMI_NODEKIND_ROW) smiPrintErrorAtLine(parserPtr, ERR_UNIQUENESS_FOR_NON_ROW, objectPtr->line); else smiCheckUniqueness(parserPtr, objectPtr); } /* * Does the PIB-REFERENCES object point to a PRC (table)? * See RFC 3159 7.10 */ if (objectPtr->typePtr && objectPtr->typePtr->export.name && !strcmp(objectPtr->typePtr->export.name, "ReferenceId") && objectPtr->relatedPtr && (objectPtr->relatedPtr->export.nodekind != SMI_NODEKIND_ROW)) smiPrintErrorAtLine(parserPtr, ERR_PIB_REFERENCES_NOT_ROW, objectPtr->line); /* * Do all PIB-TAGs point to objects with a SYNTAX of TagId? * See RFC 3159 7.12 */ if (objectPtr->typePtr && objectPtr->typePtr->export.name && !strcmp(objectPtr->typePtr->export.name, "TagReferenceId") && objectPtr->relatedPtr && objectPtr->relatedPtr->typePtr && objectPtr->relatedPtr->typePtr->export.name && strcmp(objectPtr->relatedPtr->typePtr->export.name, "TagId")) smiPrintErrorAtLine(parserPtr, ERR_PIB_TAG_TYPE, objectPtr->line); /* * Is the attribute member of at least one compliance group? * See RFC 3159 9.1 */ if (objectPtr->export.nodekind & SMI_NODEKIND_COLUMN) { Object *group; int found = 0; for (group = modulePtr->firstObjectPtr; group; group = group->nextPtr) { if ((group->export.nodekind == SMI_NODEKIND_GROUP) && group->listPtr) { List *l; for (l = group->listPtr; l; l = l->nextPtr) if (((Object *)l->ptr)->export.name && !strcmp(((Object *)l->ptr)->export.name, objectPtr->export.name)) { found = 1; break; } } if (found) break; } if (!found) smiPrintErrorAtLine(parserPtr, ERR_ATTRIBUTE_NOT_IN_GROUP, objectPtr->line, objectPtr->export.name); } } } } static void checkTypes(Parser *parserPtr, Module *modulePtr) { Type *typePtr; for (typePtr = modulePtr->firstTypePtr; typePtr; typePtr = typePtr->nextPtr) { /* * Check references to unknown types. */ if ((typePtr->flags & FLAG_INCOMPLETE) && typePtr->export.name && (typePtr->export.decl == SMI_DECL_UNKNOWN)) { smiPrintErrorAtLine(parserPtr, ERR_UNKNOWN_TYPE, typePtr->line, typePtr->export.name); } /* * Use TCs instead of type assignments in SMIv2. */ if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2 && typePtr->export.decl == SMI_DECL_TYPEASSIGNMENT && typePtr->export.basetype != SMI_BASETYPE_UNKNOWN && strcmp(thisModulePtr->export.name, "SNMPv2-SMI")) { smiPrintErrorAtLine(parserPtr, ERR_SMIV2_TYPE_ASSIGNEMENT, typePtr->line, typePtr->export.name); } /* * Check whether we have types that are not used in this * module. */ if ((typePtr->export.decl == SMI_DECL_TYPEDEF || typePtr->export.decl == SMI_DECL_TEXTUALCONVENTION) && ! (typePtr->flags & FLAG_INSYNTAX)) { static char *status[] = { "Unknown", "current", "deprecated", "mandatory", "optional", "obsolete" }; smiPrintErrorAtLine(parserPtr, ERR_TYPE_UNREF, typePtr->line, status[typePtr->export.status], typePtr->export.name); } /* * Complain about TCs derived from other TCs (RFC 2579 3.5). */ if (typePtr->parentPtr && typePtr->export.decl == SMI_DECL_TEXTUALCONVENTION && typePtr->export.decl == typePtr->parentPtr->export.decl) { smiPrintErrorAtLine(parserPtr, ERR_SMIV2_NESTED_TEXTUAL_CONVENTION, typePtr->line, typePtr->export.name, typePtr->parentPtr->export.name); if (typePtr->export.status < typePtr->parentPtr->export.status) { if (typePtr->parentPtr->export.status == SMI_STATUS_DEPRECATED) { smiPrintErrorAtLine(parserPtr, ERR_TYPE_STATUS_DEPRECATED, typePtr->line, typePtr->parentPtr->export.name, typePtr->export.name); } if (typePtr->parentPtr->export.status == SMI_STATUS_OBSOLETE) { smiPrintErrorAtLine(parserPtr, ERR_TYPE_STATUS_OBSOLETE, typePtr->line, typePtr->parentPtr->export.name, typePtr->export.name); } } } smiCheckTypeFormat(parserPtr, typePtr); smiCheckNamedNumberRedefinition(parserPtr, typePtr); smiCheckNamedNumberSubtyping(parserPtr, typePtr); } } static void adjustDefval(Parser *parserPtr, SmiValue *valuePtr, Type *typePtr, int line) { Object *object2Ptr; List *bitsListPtr, *valueListPtr, *p, *pp, *nextPtr, *listPtr; Import *importPtr; int nBits, bit; if (valuePtr->basetype == SMI_BASETYPE_UNKNOWN) return; if (valuePtr->basetype == SMI_BASETYPE_OBJECTIDENTIFIER) { /* a len of -1 indicates an unresolved label in ptr */ if (valuePtr->len == -1) { object2Ptr = findObjectByModuleAndName(parserPtr->modulePtr, (char *)valuePtr->value.ptr); if (!object2Ptr) { importPtr = findImportByName( (char *)valuePtr->value.ptr, parserPtr->modulePtr); if (importPtr) { /* imported object */ importPtr->use++; object2Ptr = findObjectByModulenameAndName( importPtr->export.module, importPtr->export.name); } } if (!object2Ptr) { smiPrintErrorAtLine(parserPtr, ERR_UNKNOWN_OIDLABEL, line, (char *)valuePtr->value.ptr); smiFree(valuePtr->value.ptr); valuePtr->value.ptr = NULL; valuePtr->basetype = SMI_BASETYPE_UNKNOWN; } else { smiFree(valuePtr->value.ptr); valuePtr->len = object2Ptr->export.oidlen; valuePtr->value.ptr = smiMalloc(object2Ptr->export.oidlen * sizeof(SmiSubid)); memcpy(valuePtr->value.ptr, object2Ptr->export.oid, object2Ptr->export.oidlen * sizeof(SmiSubid)); } } } else if (valuePtr->basetype == SMI_BASETYPE_BITS) { bitsListPtr = typePtr->listPtr; valueListPtr = (void *)valuePtr->value.ptr; for (nBits = 0, p = bitsListPtr; p; p = p->nextPtr) { if (nBits < 1+((NamedNumber *)(p->ptr))->export.value.value.integer32) { nBits = 1+((NamedNumber *)(p->ptr))->export.value.value.integer32; } } valuePtr->value.ptr = smiMalloc((nBits+7)/8); memset(valuePtr->value.ptr, 0, (nBits+7)/8); valuePtr->len = (nBits+7)/8; for (p = valueListPtr; p;) { for (pp = bitsListPtr; pp; pp = pp->nextPtr) { if (!strcmp(p->ptr, ((NamedNumber *)(pp->ptr))->export.name)) { bit = ((NamedNumber *)(pp->ptr))->export.value.value.integer32; valuePtr->value.ptr[bit/8] |= 1 << (7-(bit%8)); } } smiFree(p->ptr); nextPtr = p->nextPtr; smiFree(p); p = nextPtr; } } else if (valuePtr->basetype == SMI_BASETYPE_ENUM) { /* a len of -1 indicates an unresolved enum label in ptr */ if (valuePtr->len == -1) { for (listPtr = typePtr->listPtr; listPtr; listPtr = listPtr->nextPtr) { if (!strcmp(((NamedNumber *)(listPtr->ptr))->export.name, (char *)valuePtr->value.ptr)) { smiFree(valuePtr->value.ptr); valuePtr->value.integer32 = ((NamedNumber *)(listPtr->ptr))-> export.value.value.integer32; valuePtr->len = 1; break; } } } } } static void checkDefvals(Parser *parserPtr, Module *modulePtr) { Object *objectPtr; /* * Check unknown identifiers in OID DEFVALs. */ for(objectPtr = modulePtr->firstObjectPtr; objectPtr; objectPtr = objectPtr->nextPtr) { adjustDefval(parserPtr, &objectPtr->export.value, objectPtr->typePtr, objectPtr->line); if (objectPtr->export.value.len == -1) { smiPrintErrorAtLine(parserPtr, ERR_DEFVAL_SYNTAX, objectPtr->line); } smiCheckDefault(parserPtr, objectPtr); } } static void checkImportsUsage(Parser *parserPtr, Module *modulePtr) { Import *importPtr; /* * Check usage of all imported identifiers. */ if (strcmp(modulePtr->export.name, "SNMPv2-TC") && strcmp(modulePtr->export.name, "SNMPv2-CONF") && strcmp(modulePtr->export.name, "RFC-1212") && strcmp(modulePtr->export.name, "RFC-1215")) { for(importPtr = modulePtr->firstImportPtr; importPtr; importPtr = importPtr->nextPtr) { if (! strcmp(importPtr->export.module, "SNMPv2-SMI")) { if (! strcmp(importPtr->export.name, "ExtUTCTime") || !strcmp(importPtr->export.name, "ObjectName") || !strcmp(importPtr->export.name, "NotificationName")) { smiPrintErrorAtLine(parserPtr, ERR_ILLEGAL_IMPORT, importPtr->line, importPtr->export.name, importPtr->export.module); } } /* checkImports() handles KIND_NOTFOUND */ if (importPtr->use == 0 && importPtr->kind != KIND_NOTFOUND) { smiPrintErrorAtLine(parserPtr, ERR_UNUSED_IMPORT, importPtr->line, importPtr->export.name, importPtr->export.module); } if (modulePtr->export.language == SMI_LANGUAGE_SMIV2) { int j; for (j = 0; convertImportv2[j]; j += 4) { if ((strcmp(convertImportv2[j], importPtr->export.module) == 0) && (strcmp(convertImportv2[j+1], importPtr->export.name) == 0)) { smiPrintErrorAtLine(parserPtr, ERR_OBSOLETE_IMPORT, importPtr->line, importPtr->export.name, convertImportv2[j+2], importPtr->export.module); } } } } } } static time_t checkDate(Parser *parserPtr, char *date) { struct tm tm; time_t anytime; int i, len; char *p; memset(&tm, 0, sizeof(tm)); anytime = 0; len = strlen(date); if (len == 11 || len == 13) { for (i = 0; i < len; i++) { if ( (i < len-1 && ! isdigit((int) date[i])) || (i == len-1 && date[len-1] != 'Z')) { smiPrintError(parserPtr, ERR_DATE_CHARACTER, date); anytime = (time_t) -1; break; } } } else { smiPrintError(parserPtr, ERR_DATE_LENGTH, date); anytime = (time_t) -1; } if (anytime == 0) { for (i = 0, p = date, tm.tm_year = 0; i < ((len == 11) ? 2 : 4); i++, p++) { tm.tm_year = tm.tm_year * 10 + (*p - '0'); } if (len == 11) { tm.tm_year += 1900; if (tm.tm_year < 1990) smiPrintError(parserPtr, ERR_DATE_YEAR_2DIGITS, date, tm.tm_year); } tm.tm_mon = (p[0]-'0') * 10 + (p[1]-'0'); p += 2; tm.tm_mday = (p[0]-'0') * 10 + (p[1]-'0'); p += 2; tm.tm_hour = (p[0]-'0') * 10 + (p[1]-'0'); p += 2; tm.tm_min = (p[0]-'0') * 10 + (p[1]-'0'); if (tm.tm_mon < 1 || tm.tm_mon > 12) { smiPrintError(parserPtr, ERR_DATE_MONTH, date); } if (tm.tm_mday < 1 || tm.tm_mday > 31) { smiPrintError(parserPtr, ERR_DATE_DAY, date); } if (tm.tm_hour < 0 || tm.tm_hour > 23) { smiPrintError(parserPtr, ERR_DATE_HOUR, date); } if (tm.tm_min < 0 || tm.tm_min > 59) { smiPrintError(parserPtr, ERR_DATE_MINUTES, date); } tm.tm_year -= 1900; tm.tm_mon -= 1; tm.tm_isdst = 0; anytime = timegm(&tm); if (anytime == (time_t) -1) { smiPrintError(parserPtr, ERR_DATE_VALUE, date); } else { if (anytime < SMI_EPOCH) { smiPrintError(parserPtr, ERR_DATE_IN_PAST, date); } if (anytime > time(NULL)) { smiPrintError(parserPtr, ERR_DATE_IN_FUTURE, date); } } } return (anytime == (time_t) -1) ? 0 : anytime; } #line 1292 "parser-smi.y" #ifndef YYSTYPE typedef union { char *text; /* scanned quoted text */ char *id; /* identifier name */ int err; /* actually just a dummy */ time_t date; /* a date value */ Object *objectPtr; /* object identifier */ SmiStatus status; /* a STATUS value */ SmiAccess access; /* an ACCESS value */ Type *typePtr; List *listPtr; /* SEQUENCE and INDEX lists */ NamedNumber *namedNumberPtr; /* BITS or enum item */ Range *rangePtr; /* type restricting range */ SmiValue *valuePtr; SmiUnsigned32 unsigned32; /* */ SmiInteger32 integer32; /* */ SmiUnsigned64 unsigned64; /* */ SmiInteger64 integer64; /* */ struct Compl compl; struct Index index; Module *modulePtr; SubjectCategories *subjectCategoriesPtr; } yystype; # define YYSTYPE yystype # define YYSTYPE_IS_TRIVIAL 1 #endif #ifndef YYDEBUG # define YYDEBUG 1 #endif #define YYFINAL 712 #define YYFLAG -32768 #define YYNTBASE 107 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ #define YYTRANSLATE(x) ((unsigned)(x) <= 350 ? yytranslate[x] : 330) /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 101, 102, 2, 2, 100, 2, 105, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 99, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 103, 2, 104, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 97, 106, 98, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 }; #if YYDEBUG static const short yyprhs[] = { 0, 0, 2, 3, 5, 8, 9, 20, 24, 25, 27, 29, 31, 32, 36, 37, 38, 42, 44, 45, 47, 50, 54, 56, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 119, 121, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 151, 152, 153, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 180, 184, 186, 188, 189, 198, 199, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 237, 238, 250, 252, 256, 258, 263, 265, 269, 272, 274, 279, 281, 283, 286, 288, 292, 293, 299, 300, 301, 302, 317, 318, 319, 343, 344, 347, 348, 349, 361, 366, 367, 369, 373, 375, 378, 379, 381, 383, 384, 387, 389, 391, 392, 398, 399, 400, 406, 407, 408, 414, 415, 417, 418, 420, 424, 426, 427, 433, 434, 436, 440, 445, 446, 450, 451, 455, 456, 457, 458, 474, 475, 476, 477, 478, 479, 480, 481, 482, 507, 512, 513, 515, 517, 521, 523, 528, 530, 533, 535, 537, 539, 541, 547, 553, 555, 557, 559, 561, 562, 566, 567, 571, 573, 574, 578, 579, 583, 588, 591, 596, 599, 600, 605, 608, 613, 617, 619, 621, 623, 625, 627, 629, 631, 633, 637, 640, 643, 647, 651, 654, 657, 660, 662, 665, 667, 670, 673, 675, 678, 681, 684, 686, 689, 691, 694, 697, 700, 703, 706, 709, 711, 714, 716, 718, 720, 722, 724, 725, 729, 736, 738, 742, 744, 748, 750, 752, 754, 756, 758, 760, 764, 766, 770, 771, 777, 779, 781, 783, 785, 788, 789, 792, 793, 795, 796, 802, 807, 808, 814, 815, 816, 822, 823, 825, 829, 832, 834, 836, 838, 843, 844, 846, 850, 852, 853, 855, 859, 861, 863, 866, 867, 869, 870, 872, 875, 876, 882, 887, 888, 893, 895, 899, 901, 906, 908, 912, 914, 916, 918, 919, 922, 924, 927, 929, 933, 935, 940, 947, 949, 951, 954, 959, 961, 962, 963, 964, 980, 981, 982, 983, 999, 1000, 1001, 1002, 1018, 1020, 1022, 1025, 1026, 1032, 1035, 1037, 1038, 1043, 1044, 1046, 1050, 1052, 1054, 1055, 1057, 1060, 1062, 1064, 1065, 1071, 1072, 1081, 1084, 1085, 1088, 1089, 1091, 1094, 1097, 1098, 1099, 1100, 1101, 1119, 1121, 1122, 1124, 1127, 1128, 1137, 1139, 1143, 1145, 1148, 1150, 1152, 1153, 1155, 1158, 1159, 1160, 1161, 1162, 1163, 1178, 1181, 1182, 1184, 1189, 1190, 1192, 1196 }; static const short yyrhs[] = { 108, 0, 0, 109, 0, 108, 109, 0, 0, 125, 110, 111, 112, 4, 18, 115, 113, 126, 29, 0, 97, 268, 98, 0, 0, 25, 0, 69, 0, 114, 0, 0, 39, 117, 99, 0, 0, 0, 31, 116, 99, 0, 118, 0, 0, 119, 0, 118, 119, 0, 120, 33, 125, 0, 121, 0, 120, 100, 121, 0, 6, 0, 5, 0, 122, 0, 123, 0, 124, 0, 19, 0, 44, 0, 46, 0, 49, 0, 53, 0, 54, 0, 60, 0, 61, 0, 62, 0, 67, 0, 85, 0, 86, 0, 91, 0, 15, 0, 23, 0, 24, 0, 35, 0, 57, 0, 58, 0, 87, 0, 45, 0, 92, 0, 5, 0, 127, 0, 0, 128, 0, 127, 128, 0, 138, 0, 136, 0, 158, 0, 162, 0, 166, 0, 192, 0, 196, 0, 283, 0, 275, 0, 279, 0, 306, 0, 129, 0, 1, 98, 0, 0, 0, 132, 130, 48, 131, 29, 0, 54, 0, 62, 0, 87, 0, 58, 0, 61, 0, 85, 0, 60, 0, 57, 0, 53, 0, 15, 0, 0, 20, 134, 98, 0, 6, 0, 5, 0, 0, 135, 137, 59, 36, 4, 97, 268, 98, 0, 0, 140, 139, 4, 145, 0, 5, 0, 141, 0, 144, 0, 142, 0, 143, 0, 46, 0, 86, 0, 67, 0, 44, 0, 91, 0, 23, 0, 35, 0, 24, 0, 45, 0, 92, 0, 153, 0, 0, 0, 85, 146, 236, 80, 234, 27, 266, 147, 254, 84, 153, 0, 133, 0, 78, 65, 149, 0, 5, 0, 78, 97, 151, 98, 0, 152, 0, 151, 100, 152, 0, 6, 154, 0, 209, 0, 19, 97, 155, 98, 0, 211, 0, 19, 0, 5, 223, 0, 156, 0, 155, 100, 156, 0, 0, 6, 157, 101, 7, 102, 0, 0, 0, 0, 6, 159, 61, 160, 80, 234, 27, 266, 161, 254, 4, 97, 268, 98, 0, 0, 0, 6, 163, 62, 164, 84, 153, 237, 173, 176, 178, 80, 234, 165, 185, 254, 239, 242, 180, 248, 4, 97, 252, 98, 0, 0, 27, 266, 0, 0, 0, 135, 167, 87, 168, 30, 268, 169, 172, 254, 4, 7, 0, 94, 97, 170, 98, 0, 0, 171, 0, 170, 100, 171, 0, 252, 0, 27, 266, 0, 0, 189, 0, 174, 0, 0, 175, 238, 0, 74, 0, 68, 0, 0, 72, 177, 97, 247, 98, 0, 0, 0, 73, 179, 97, 252, 98, 0, 0, 0, 88, 181, 97, 182, 98, 0, 0, 183, 0, 0, 184, 0, 183, 100, 184, 0, 252, 0, 0, 42, 186, 97, 187, 98, 0, 0, 188, 0, 187, 100, 188, 0, 6, 101, 7, 102, 0, 0, 50, 190, 238, 0, 0, 14, 191, 238, 0, 0, 0, 0, 6, 193, 58, 194, 259, 80, 234, 27, 266, 195, 254, 4, 97, 253, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 197, 54, 198, 205, 199, 47, 267, 200, 66, 266, 201, 21, 266, 202, 27, 266, 203, 255, 204, 4, 97, 268, 98, 0, 82, 97, 206, 98, 0, 0, 207, 0, 208, 0, 207, 100, 208, 0, 6, 0, 6, 101, 7, 102, 0, 213, 0, 210, 213, 0, 148, 0, 149, 0, 150, 0, 221, 0, 103, 16, 7, 104, 37, 0, 103, 90, 7, 104, 37, 0, 220, 0, 222, 0, 219, 0, 43, 0, 0, 43, 214, 224, 0, 0, 43, 215, 229, 0, 44, 0, 0, 44, 216, 224, 0, 0, 5, 217, 229, 0, 125, 105, 5, 229, 0, 5, 224, 0, 125, 105, 5, 224, 0, 64, 81, 0, 0, 64, 81, 218, 225, 0, 5, 225, 0, 125, 105, 5, 225, 0, 59, 36, 223, 0, 7, 0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 6, 0, 13, 0, 97, 272, 98, 0, 43, 223, 0, 44, 223, 0, 64, 81, 223, 0, 59, 36, 223, 0, 46, 223, 0, 23, 223, 0, 23, 224, 0, 35, 0, 35, 224, 0, 91, 0, 91, 224, 0, 86, 223, 0, 67, 0, 67, 225, 0, 24, 223, 0, 24, 224, 0, 45, 0, 45, 224, 0, 92, 0, 92, 224, 0, 46, 223, 0, 23, 223, 0, 35, 223, 0, 91, 223, 0, 86, 223, 0, 67, 0, 24, 223, 0, 45, 0, 92, 0, 224, 0, 225, 0, 229, 0, 0, 101, 226, 102, 0, 101, 79, 101, 226, 102, 102, 0, 227, 0, 226, 106, 227, 0, 228, 0, 228, 3, 228, 0, 8, 0, 7, 0, 10, 0, 9, 0, 12, 0, 11, 0, 97, 230, 98, 0, 231, 0, 230, 100, 231, 0, 0, 6, 232, 101, 233, 102, 0, 7, 0, 8, 0, 6, 0, 6, 0, 28, 266, 0, 0, 89, 266, 0, 0, 6, 0, 0, 70, 240, 97, 247, 98, 0, 17, 97, 247, 98, 0, 0, 32, 241, 97, 247, 98, 0, 0, 0, 41, 243, 97, 244, 98, 0, 0, 245, 0, 244, 100, 245, 0, 38, 246, 0, 246, 0, 252, 0, 252, 0, 26, 97, 249, 98, 0, 0, 212, 0, 97, 250, 98, 0, 251, 0, 0, 6, 0, 251, 100, 6, 0, 268, 0, 268, 0, 76, 266, 0, 0, 256, 0, 0, 257, 0, 256, 257, 0, 0, 77, 267, 258, 27, 266, 0, 63, 97, 261, 98, 0, 0, 63, 97, 261, 98, 0, 262, 0, 261, 100, 262, 0, 252, 0, 56, 97, 264, 98, 0, 265, 0, 264, 100, 265, 0, 253, 0, 13, 0, 13, 0, 0, 269, 270, 0, 271, 0, 270, 271, 0, 135, 0, 125, 105, 6, 0, 7, 0, 6, 101, 7, 102, 0, 125, 105, 6, 101, 7, 102, 0, 273, 0, 274, 0, 273, 274, 0, 6, 101, 7, 102, 0, 7, 0, 0, 0, 0, 6, 276, 60, 277, 260, 80, 234, 27, 266, 278, 254, 4, 97, 268, 98, 0, 0, 0, 0, 6, 280, 57, 281, 263, 80, 234, 27, 266, 282, 254, 4, 97, 268, 98, 0, 0, 0, 0, 6, 284, 53, 285, 80, 234, 27, 266, 286, 254, 287, 4, 97, 268, 98, 0, 288, 0, 289, 0, 288, 289, 0, 0, 52, 291, 290, 292, 295, 0, 5, 268, 0, 5, 0, 0, 49, 97, 293, 98, 0, 0, 294, 0, 293, 100, 294, 0, 268, 0, 296, 0, 0, 297, 0, 296, 297, 0, 298, 0, 300, 0, 0, 34, 299, 268, 27, 266, 0, 0, 59, 301, 252, 302, 303, 305, 27, 266, 0, 84, 153, 0, 0, 96, 304, 0, 0, 153, 0, 51, 238, 0, 71, 238, 0, 0, 0, 0, 0, 6, 307, 15, 308, 75, 266, 80, 235, 27, 266, 309, 254, 310, 4, 97, 268, 98, 0, 311, 0, 0, 312, 0, 311, 312, 0, 0, 83, 316, 313, 40, 97, 314, 98, 317, 0, 315, 0, 314, 100, 315, 0, 268, 0, 5, 268, 0, 5, 0, 318, 0, 0, 319, 0, 318, 319, 0, 0, 0, 0, 0, 0, 95, 252, 320, 302, 321, 303, 322, 325, 327, 323, 248, 324, 27, 266, 0, 14, 326, 0, 0, 6, 0, 22, 97, 328, 98, 0, 0, 329, 0, 328, 100, 329, 0, 252, 0 }; #endif #if YYDEBUG /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const short yyrline[] = { 0, 1589, 1594, 1600, 1602, 1610, 1610, 1672, 1674, 1678, 1680, 1689, 1691, 1695, 1709, 1711, 1711, 1732, 1734, 1739, 1741, 1745, 1790, 1792, 1800, 1806, 1812, 1828, 1838, 1844, 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, 1855, 1856, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1868, 1869, 1872, 1884, 1886, 1891, 1893, 1897, 1902, 1907, 1912, 1917, 1922, 1927, 1932, 1937, 1942, 1947, 1952, 1957, 1971, 1971, 1971, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2029, 2029, 2059, 2063, 2079, 2079, 2119, 2119, 2285, 2289, 2313, 2327, 2328, 2337, 2338, 2339, 2340, 2341, 2344, 2345, 2346, 2349, 2350, 2353, 2369, 2369, 2369, 2437, 2445, 2459, 2504, 2512, 2518, 2538, 2621, 2627, 2648, 2653, 2658, 2691, 2697, 2710, 2710, 2745, 2745, 2745, 2745, 2808, 2808, 2808, 3114, 3124, 3131, 3131, 3131, 3214, 3218, 3224, 3234, 3256, 3262, 3267, 3271, 3275, 3283, 3287, 3291, 3295, 3299, 3299, 3306, 3310, 3310, 3317, 3322, 3322, 3329, 3333, 3335, 3339, 3345, 3359, 3363, 3363, 3370, 3374, 3380, 3394, 3415, 3415, 3426, 3426, 3439, 3439, 3439, 3439, 3500, 3500, 3500, 3500, 3500, 3500, 3500, 3500, 3500, 3608, 3614, 3622, 3629, 3635, 3650, 3671, 3694, 3698, 3718, 3723, 3728, 3733, 3750, 3752, 3760, 3765, 3782, 3791, 3804, 3804, 3823, 3823, 3838, 3864, 3864, 3895, 3895, 3949, 3996, 4051, 4101, 4106, 4106, 4118, 4164, 4205, 4212, 4219, 4225, 4232, 4239, 4265, 4288, 4308, 4325, 4358, 4362, 4387, 4391, 4397, 4425, 4451, 4488, 4514, 4547, 4571, 4598, 4626, 4664, 4710, 4736, 4773, 4799, 4836, 4862, 4905, 4933, 4959, 4985, 5009, 5037, 5077, 5103, 5128, 5155, 5172, 5189, 5207, 5215, 5225, 5237, 5243, 5257, 5264, 5274, 5280, 5286, 5292, 5298, 5321, 5348, 5354, 5360, 5373, 5373, 5395, 5410, 5419, 5478, 5494, 5503, 5509, 5518, 5524, 5590, 5590, 5608, 5618, 5618, 5631, 5637, 5637, 5670, 5676, 5682, 5696, 5701, 5707, 5717, 5723, 5725, 5730, 5732, 5740, 5742, 5746, 5752, 5765, 5771, 5777, 5786, 5790, 5792, 5796, 5798, 5802, 5802, 5833, 5837, 5843, 5849, 5855, 5868, 5880, 5886, 5892, 5905, 5916, 5927, 5933, 5933, 5947, 5952, 5959, 6055, 6159, 6183, 6242, 6311, 6315, 6317, 6321, 6323, 6327, 6327, 6327, 6327, 6387, 6387, 6387, 6387, 6451, 6451, 6451, 6451, 6544, 6550, 6554, 6589, 6589, 6618, 6627, 6635, 6642, 6646, 6652, 6658, 6671, 6694, 6700, 6708, 6712, 6779, 6785, 6793, 6793, 6826, 6826, 6873, 6881, 6887, 6898, 6904, 6910, 6916, 6924, 6930, 6930, 6930, 6930, 6998, 7000, 7004, 7006, 7010, 7010, 7037, 7047, 7064, 7070, 7079, 7089, 7091, 7095, 7097, 7101, 7101, 7101, 7101, 7101, 7101, 7155, 7157, 7161, 7226, 7228, 7232, 7234, 7238 }; #endif #if (YYDEBUG) || defined YYERROR_VERBOSE /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ static const char *const yytname[] = { "$", "error", "$undefined.", "DOT_DOT", "COLON_COLON_EQUAL", "UPPERCASE_IDENTIFIER", "LOWERCASE_IDENTIFIER", "NUMBER", "NEGATIVENUMBER", "NUMBER64", "NEGATIVENUMBER64", "BIN_STRING", "HEX_STRING", "QUOTED_STRING", "ACCESS", "AGENT_CAPABILITIES", "APPLICATION", "AUGMENTS", "BEGIN_", "BITS", "CHOICE", "CONTACT_INFO", "CREATION_REQUIRES", "COUNTER32", "COUNTER64", "DEFINITIONS", "DEFVAL", "DESCRIPTION", "DISPLAY_HINT", "END", "ENTERPRISE", "EXPORTS", "EXTENDS", "FROM", "GROUP", "GAUGE32", "IDENTIFIER", "IMPLICIT", "IMPLIED", "IMPORTS", "INCLUDES", "INDEX", "INSTALL_ERRORS", "INTEGER", "INTEGER32", "INTEGER64", "IPADDRESS", "LAST_UPDATED", "MACRO", "MANDATORY_GROUPS", "MAX_ACCESS", "MIN_ACCESS", "MODULE", "MODULE_COMPLIANCE", "MODULE_IDENTITY", "NOT_ACCESSIBLE", "NOTIFICATIONS", "NOTIFICATION_GROUP", "NOTIFICATION_TYPE", "OBJECT", "OBJECT_GROUP", "OBJECT_IDENTITY", "OBJECT_TYPE", "OBJECTS", "OCTET", "OF", "ORGANIZATION", "OPAQUE", "PIB_ACCESS", "PIB_DEFINITIONS", "PIB_INDEX", "PIB_MIN_ACCESS", "PIB_REFERENCES", "PIB_TAG", "POLICY_ACCESS", "PRODUCT_RELEASE", "REFERENCE", "REVISION", "SEQUENCE", "SIZE", "STATUS", "STRING", "SUBJECT_CATEGORIES", "SUPPORTS", "SYNTAX", "TEXTUAL_CONVENTION", "TIMETICKS", "TRAP_TYPE", "UNIQUENESS", "UNITS", "UNIVERSAL", "UNSIGNED32", "UNSIGNED64", "VALUE", "VARIABLES", "VARIATION", "WRITE_SYNTAX", "'{'", "'}'", "';'", "','", "'('", "')'", "'['", "']'", "'.'", "'|'", "mibFile", "modules", "module", "@1", "moduleOid", "definitions", "linkagePart", "linkageClause", "exportsClause", "@2", "importPart", "imports", "import", "importIdentifiers", "importIdentifier", "importedKeyword", "importedSMIKeyword", "importedSPPIKeyword", "moduleName", "declarationPart", "declarations", "declaration", "macroClause", "@3", "@4", "macroName", "choiceClause", "@5", "fuzzy_lowercase_identifier", "valueDeclaration", "@6", "typeDeclaration", "@7", "typeName", "typeSMI", "typeSMIandSPPI", "typeSMIonly", "typeSPPIonly", "typeDeclarationRHS", "@8", "@9", "conceptualTable", "row", "entryType", "sequenceItems", "sequenceItem", "Syntax", "sequenceSyntax", "NamedBits", "NamedBit", "@10", "objectIdentityClause", "@11", "@12", "@13", "objectTypeClause", "@14", "@15", "descriptionClause", "trapTypeClause", "@16", "@17", "VarPart", "VarTypes", "VarType", "DescrPart", "MaxOrPIBAccessPart", "PibAccessPart", "PibAccess", "SPPIPibReferencesPart", "@18", "SPPIPibTagPart", "@19", "SPPIUniquePart", "@20", "UniqueTypesPart", "UniqueTypes", "UniqueType", "SPPIErrorsPart", "@21", "Errors", "Error", "MaxAccessPart", "@22", "@23", "notificationTypeClause", "@24", "@25", "@26", "moduleIdentityClause", "@27", "@28", "@29", "@30", "@31", "@32", "@33", "@34", "SubjectCategoriesPart", "SubjectCategories", "CategoryIDs", "CategoryID", "ObjectSyntax", "typeTag", "sequenceObjectSyntax", "valueofObjectSyntax", "SimpleSyntax", "@35", "@36", "@37", "@38", "@39", "valueofSimpleSyntax", "sequenceSimpleSyntax", "ApplicationSyntax", "sequenceApplicationSyntax", "anySubType", "integerSubType", "octetStringSubType", "ranges", "range", "value", "enumSpec", "enumItems", "enumItem", "@40", "enumNumber", "Status", "Status_Capabilities", "DisplayPart", "UnitsPart", "Access", "IndexPart", "@41", "@42", "MibIndex", "@43", "IndexTypes", "IndexType", "Index", "Entry", "DefValPart", "Value", "BitsValue", "BitNames", "ObjectName", "NotificationName", "ReferPart", "RevisionPart", "Revisions", "Revision", "@44", "NotificationObjectsPart", "ObjectGroupObjectsPart", "Objects", "Object", "NotificationsPart", "Notifications", "Notification", "Text", "ExtUTCTime", "objectIdentifier", "@45", "subidentifiers", "subidentifier", "objectIdentifier_defval", "subidentifiers_defval", "subidentifier_defval", "objectGroupClause", "@46", "@47", "@48", "notificationGroupClause", "@49", "@50", "@51", "moduleComplianceClause", "@52", "@53", "@54", "ComplianceModulePart", "ComplianceModules", "ComplianceModule", "@55", "ComplianceModuleName", "MandatoryPart", "MandatoryGroups", "MandatoryGroup", "CompliancePart", "Compliances", "Compliance", "ComplianceGroup", "@56", "ComplianceObject", "@57", "SyntaxPart", "WriteSyntaxPart", "WriteSyntax", "AccessPart", "agentCapabilitiesClause", "@58", "@59", "@60", "ModulePart_Capabilities", "Modules_Capabilities", "Module_Capabilities", "@61", "CapabilitiesGroups", "CapabilitiesGroup", "ModuleName_Capabilities", "VariationPart", "Variations", "Variation", "@62", "@63", "@64", "@65", "@66", "VariationAccessPart", "VariationAccess", "CreationPart", "Cells", "Cell", 0 }; #endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const short yyr1[] = { 0, 107, 107, 108, 108, 110, 109, 111, 111, 112, 112, 113, 113, 114, 115, 116, 115, 117, 117, 118, 118, 119, 120, 120, 121, 121, 121, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 123, 123, 123, 123, 123, 123, 123, 124, 124, 125, 126, 126, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 130, 131, 129, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 134, 133, 135, 135, 137, 136, 139, 138, 140, 140, 140, 141, 141, 142, 142, 142, 142, 142, 143, 143, 143, 144, 144, 145, 146, 147, 145, 145, 148, 149, 150, 151, 151, 152, 153, 153, 154, 154, 154, 155, 155, 157, 156, 159, 160, 161, 158, 163, 164, 162, 165, 165, 167, 168, 166, 169, 169, 170, 170, 171, 172, 172, 173, 173, 173, 174, 175, 175, 177, 176, 176, 179, 178, 178, 181, 180, 180, 182, 182, 183, 183, 184, 186, 185, 185, 187, 187, 188, 190, 189, 191, 189, 193, 194, 195, 192, 197, 198, 199, 200, 201, 202, 203, 204, 196, 205, 205, 206, 207, 207, 208, 208, 209, 209, 209, 209, 209, 209, 210, 210, 211, 211, 212, 213, 214, 213, 215, 213, 213, 216, 213, 217, 213, 213, 213, 213, 213, 218, 213, 213, 213, 213, 219, 219, 219, 219, 219, 219, 219, 219, 219, 220, 220, 220, 220, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 222, 222, 222, 222, 222, 222, 222, 222, 222, 223, 223, 223, 223, 224, 225, 226, 226, 227, 227, 228, 228, 228, 228, 228, 228, 229, 230, 230, 232, 231, 233, 233, 234, 235, 236, 236, 237, 237, 238, 240, 239, 239, 241, 239, 239, 243, 242, 242, 244, 244, 245, 245, 246, 247, 248, 248, 249, 249, 250, 250, 251, 251, 252, 253, 254, 254, 255, 255, 256, 256, 258, 257, 259, 259, 260, 261, 261, 262, 263, 264, 264, 265, 266, 267, 269, 268, 270, 270, 271, 271, 271, 271, 271, 272, 273, 273, 274, 274, 276, 277, 278, 275, 280, 281, 282, 279, 284, 285, 286, 283, 287, 288, 288, 290, 289, 291, 291, 291, 292, 292, 293, 293, 294, 295, 295, 296, 296, 297, 297, 299, 298, 301, 300, 302, 302, 303, 303, 304, 305, 305, 305, 307, 308, 309, 306, 310, 310, 311, 311, 313, 312, 314, 314, 315, 316, 316, 317, 317, 318, 318, 320, 321, 322, 323, 324, 319, 325, 325, 326, 327, 327, 328, 328, 329 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const short yyr2[] = { 0, 1, 0, 1, 2, 0, 10, 3, 0, 1, 1, 1, 0, 3, 0, 0, 3, 1, 0, 1, 2, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 1, 1, 0, 8, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 11, 1, 3, 1, 4, 1, 3, 2, 1, 4, 1, 1, 2, 1, 3, 0, 5, 0, 0, 0, 14, 0, 0, 23, 0, 2, 0, 0, 11, 4, 0, 1, 3, 1, 2, 0, 1, 1, 0, 2, 1, 1, 0, 5, 0, 0, 5, 0, 0, 5, 0, 1, 0, 1, 3, 1, 0, 5, 0, 1, 3, 4, 0, 3, 0, 3, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 24, 4, 0, 1, 1, 3, 1, 4, 1, 2, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1, 0, 3, 0, 3, 1, 0, 3, 0, 3, 4, 2, 4, 2, 0, 4, 2, 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 2, 3, 3, 2, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 0, 3, 6, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 3, 0, 5, 1, 1, 1, 1, 2, 0, 2, 0, 1, 0, 5, 4, 0, 5, 0, 0, 5, 0, 1, 3, 2, 1, 1, 1, 4, 0, 1, 3, 1, 0, 1, 3, 1, 1, 2, 0, 1, 0, 1, 2, 0, 5, 4, 0, 4, 1, 3, 1, 4, 1, 3, 1, 1, 1, 0, 2, 1, 2, 1, 3, 1, 4, 6, 1, 1, 2, 4, 1, 0, 0, 0, 15, 0, 0, 0, 15, 0, 0, 0, 15, 1, 1, 2, 0, 5, 2, 1, 0, 4, 0, 1, 3, 1, 1, 0, 1, 2, 1, 1, 0, 5, 0, 8, 2, 0, 2, 0, 1, 2, 2, 0, 0, 0, 0, 17, 1, 0, 1, 2, 0, 8, 1, 3, 1, 2, 1, 1, 0, 1, 2, 0, 0, 0, 0, 0, 14, 2, 0, 1, 4, 0, 1, 3, 1 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const short yydefact[] = { 2, 51, 1, 3, 5, 4, 8, 337, 0, 0, 0, 9, 10, 0, 7, 85, 84, 343, 0, 341, 338, 339, 0, 0, 0, 340, 14, 0, 342, 15, 12, 344, 0, 0, 18, 0, 11, 0, 16, 25, 24, 42, 29, 43, 44, 45, 30, 49, 31, 32, 33, 34, 46, 47, 35, 36, 37, 38, 39, 40, 48, 41, 50, 0, 17, 19, 0, 22, 26, 27, 28, 0, 85, 84, 81, 100, 102, 101, 98, 103, 95, 80, 72, 79, 75, 78, 76, 73, 97, 77, 96, 74, 99, 104, 0, 0, 54, 67, 69, 86, 57, 56, 88, 91, 93, 94, 92, 58, 59, 60, 61, 62, 64, 65, 63, 66, 345, 13, 20, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 6, 55, 0, 0, 0, 0, 21, 23, 126, 130, 175, 179, 352, 356, 360, 395, 70, 0, 135, 0, 0, 0, 326, 188, 0, 0, 0, 0, 0, 0, 0, 111, 0, 82, 265, 265, 240, 205, 210, 249, 265, 0, 0, 245, 0, 106, 265, 242, 251, 0, 0, 109, 89, 196, 197, 198, 105, 116, 0, 194, 199, 0, 0, 0, 0, 0, 180, 0, 0, 0, 0, 0, 0, 71, 0, 337, 0, 0, 216, 221, 0, 0, 0, 238, 239, 263, 264, 247, 248, 0, 241, 0, 0, 0, 250, 237, 262, 265, 218, 0, 246, 0, 0, 288, 244, 243, 252, 0, 0, 0, 51, 195, 285, 0, 290, 337, 0, 0, 0, 337, 0, 337, 0, 0, 335, 0, 337, 138, 273, 272, 275, 274, 277, 276, 0, 0, 268, 270, 214, 123, 0, 121, 83, 281, 0, 279, 207, 209, 212, 223, 0, 111, 110, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 146, 330, 0, 328, 315, 0, 192, 0, 189, 190, 0, 0, 0, 334, 0, 332, 316, 0, 0, 0, 0, 0, 143, 0, 266, 0, 0, 0, 117, 0, 0, 278, 0, 220, 265, 119, 265, 265, 265, 265, 265, 260, 265, 0, 0, 258, 265, 265, 261, 115, 118, 202, 203, 112, 0, 287, 0, 0, 0, 217, 222, 215, 127, 289, 172, 170, 149, 148, 152, 145, 0, 144, 325, 337, 0, 0, 187, 0, 336, 181, 327, 0, 331, 337, 0, 361, 286, 0, 87, 337, 0, 318, 0, 269, 271, 0, 122, 0, 280, 120, 254, 259, 255, 233, 234, 253, 265, 265, 257, 256, 114, 0, 200, 201, 318, 0, 0, 150, 155, 291, 147, 329, 176, 0, 191, 0, 353, 333, 357, 318, 0, 0, 139, 141, 142, 0, 0, 0, 0, 283, 284, 0, 236, 235, 0, 0, 173, 171, 0, 153, 0, 318, 193, 0, 318, 318, 0, 396, 137, 337, 317, 0, 267, 124, 282, 107, 0, 337, 0, 0, 0, 182, 0, 0, 370, 0, 363, 364, 318, 140, 136, 318, 337, 0, 306, 337, 132, 0, 0, 0, 0, 369, 366, 0, 365, 399, 0, 0, 151, 0, 0, 166, 337, 0, 337, 337, 368, 372, 337, 0, 0, 398, 400, 0, 128, 154, 133, 164, 318, 0, 183, 0, 0, 0, 377, 0, 337, 402, 0, 401, 108, 0, 297, 177, 0, 354, 358, 337, 382, 384, 367, 376, 378, 380, 381, 362, 407, 0, 337, 0, 0, 295, 292, 300, 0, 375, 0, 373, 337, 337, 379, 0, 0, 0, 0, 167, 337, 0, 0, 298, 158, 184, 371, 337, 0, 387, 337, 397, 0, 165, 0, 0, 337, 337, 0, 156, 308, 320, 374, 0, 0, 389, 406, 0, 404, 0, 168, 294, 0, 0, 337, 0, 0, 0, 0, 185, 319, 321, 383, 386, 0, 393, 410, 337, 169, 296, 293, 337, 0, 301, 304, 305, 337, 0, 0, 323, 0, 322, 390, 388, 0, 0, 0, 337, 403, 409, 411, 405, 303, 299, 337, 0, 159, 161, 163, 230, 224, 225, 226, 227, 228, 229, 231, 312, 309, 204, 0, 337, 0, 0, 391, 392, 0, 413, 412, 302, 157, 337, 313, 350, 0, 311, 0, 346, 347, 307, 0, 0, 337, 385, 387, 162, 0, 310, 0, 232, 0, 348, 131, 324, 0, 414, 0, 314, 186, 389, 349, 415, 420, 0, 423, 421, 419, 0, 416, 337, 308, 426, 0, 424, 417, 422, 337, 0, 425, 0, 418, 0, 0, 0 }; static const short yydefgoto[] = { 710, 2, 3, 6, 8, 13, 35, 36, 30, 33, 63, 64, 65, 66, 67, 68, 69, 70, 180, 94, 95, 96, 97, 132, 158, 98, 181, 211, 19, 100, 133, 101, 135, 102, 103, 104, 105, 106, 182, 233, 474, 183, 184, 185, 284, 285, 186, 342, 270, 271, 320, 107, 122, 150, 407, 108, 123, 151, 494, 109, 134, 160, 315, 424, 425, 384, 361, 362, 363, 411, 441, 443, 461, 579, 594, 634, 635, 636, 511, 524, 557, 558, 364, 409, 408, 110, 124, 152, 444, 111, 125, 153, 248, 418, 481, 527, 580, 619, 196, 300, 301, 302, 187, 188, 343, 647, 189, 221, 222, 223, 207, 280, 648, 344, 190, 345, 213, 226, 215, 265, 266, 267, 216, 274, 275, 323, 434, 243, 380, 287, 293, 413, 546, 561, 560, 563, 577, 611, 612, 613, 476, 596, 649, 663, 664, 477, 306, 429, 598, 599, 600, 651, 194, 198, 295, 296, 200, 307, 308, 255, 372, 297, 10, 20, 21, 665, 666, 667, 112, 126, 154, 447, 113, 127, 155, 448, 114, 128, 156, 422, 468, 469, 470, 500, 485, 517, 549, 550, 533, 534, 535, 536, 551, 537, 552, 584, 604, 622, 625, 115, 129, 157, 471, 503, 504, 505, 540, 586, 587, 520, 627, 628, 629, 673, 688, 691, 699, 706, 693, 695, 697, 701, 702 }; static const short yypact[] = { 34,-32768, 34,-32768,-32768,-32768, -49,-32768, 13, -37, 127,-32768,-32768, 47,-32768, -26, -30,-32768, -20,-32768, 127,-32768, 78, 112, 121,-32768, 117, 28, 42,-32768, 114,-32768, 158, 70, 494, 266,-32768, 101,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768, 95, 494,-32768, -19,-32768,-32768,-32768, -32768, 106, 201, 197,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768, 177, 373,-32768,-32768,-32768, 122, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 34, 494,-32768, 156, 157, 160, 161, 163, 167, 176, 199, -32768,-32768, 182, 173, 133, 227,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768, 200,-32768, 202, 155, 149, 175, 170, 179, 183, 180, 168, 224, 252, 232, -47, 166,-32768, -65, -65, 169, -56, 174, 169, -65, 237, 187, 178, -45,-32768, -65, 169, 169, 0, 171,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 152,-32768, -32768, 268, 64, 181, 203, 185,-32768, 188, 204, 189, 211, 268, 264,-32768, 195,-32768, 65, 205,-32768,-32768, 290, 206, 291,-32768,-32768,-32768,-32768,-32768,-32768, 94, -32768, 169, 205, 169,-32768,-32768,-32768, -65, 208, 219, -32768, 295, 297, 278,-32768,-32768,-32768, 300, 306, 309, -34,-32768,-32768, 288, 228,-32768, 268, 312, 274,-32768, 268,-32768, 268, 298,-32768, 242,-32768, 235,-32768,-32768, -32768,-32768,-32768,-32768, 229, 18,-32768, 328,-32768,-32768, 37,-32768,-32768,-32768, 41,-32768,-32768,-32768,-32768,-32768, 178,-32768,-32768, 548, 51,-32768, 264, 254, 231, 233, -65, 264, 264, -4,-32768, 66,-32768,-32768, 305, 238, 240, 236,-32768, 327, 77, 314,-32768, 84,-32768,-32768, 315, 264, 337, 246, 248, 319, 94,-32768, 94, 94, 247,-32768, 290, 249,-32768, 291,-32768, -65,-32768, -65, -65, -65, -65, -65,-32768, -65, 311, 273,-32768, -65, -65,-32768,-32768,-32768,-32768,-32768,-32768, 297,-32768, 268, 318, 322,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768, 284,-32768, 354,-32768,-32768,-32768, 264, 355,-32768, 312,-32768,-32768,-32768, 264,-32768,-32768, 264,-32768,-32768, 334,-32768,-32768, 264, 287, 19,-32768,-32768, 357,-32768, 154,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -65, -65,-32768,-32768,-32768, 338,-32768,-32768, 287, 354, 354, -32768, 294,-32768,-32768,-32768,-32768, 271,-32768, 302,-32768, -32768,-32768, 287, 264, 85,-32768,-32768,-32768, 264, 366, 275, 279,-32768,-32768, 281,-32768,-32768, 264, 371,-32768, -32768, 283,-32768, 296, 287,-32768, 264, 287, 287, 332, -32768,-32768,-32768,-32768, 378,-32768,-32768,-32768,-32768, 289, -32768, 293, 268, 387,-32768, 388, 390, 393, 391, 332, -32768, 287,-32768,-32768, 287,-32768, 301,-32768,-32768, 374, 303, 382, 307, 308, 153,-32768, 310,-32768, 326, 330, 313,-32768, 317, 264, 368,-32768, 264,-32768,-32768,-32768, 363,-32768, 415, 417, 326,-32768, 64,-32768,-32768,-32768, -32768, 287, 324,-32768, 325, 331, 335, -3, 339, 384, -32768, 341,-32768,-32768, 342, 25,-32768, 401,-32768,-32768, -32768,-32768,-32768,-32768, -3,-32768,-32768,-32768,-32768,-32768, 396,-32768, 435, 345,-32768,-32768, 402, 264,-32768, 88, -32768,-32768,-32768,-32768, 347, 348, 344, 89,-32768,-32768, 350, 351,-32768, 361,-32768,-32768,-32768, 423, 367,-32768, -32768, 445,-32768, 435, 358,-32768,-32768, 356,-32768, 429, 380,-32768, 264, 64, 370,-32768, 92,-32768, 360,-32768, -32768, 365, 369, 431, 375, 376, 466, 327,-32768, 380, -32768,-32768,-32768, 64, -27, 379,-32768,-32768,-32768,-32768, -32768, 93,-32768,-32768,-32768, 377, 105, 381,-32768, 467, -32768,-32768,-32768, 354, 354, 449,-32768,-32768, 379,-32768, -32768,-32768,-32768, 431, 383, 385,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768, 172,-32768,-32768, 386, -32768, 452, 389,-32768,-32768, 264,-32768,-32768,-32768,-32768, -32768, 392,-32768, 394, 395, 398, 194,-32768,-32768, 399, 264,-32768,-32768, 367,-32768, 473,-32768, 476,-32768, 392, -32768,-32768,-32768, 400,-32768, 403,-32768,-32768, 370,-32768, -32768, 469, 481, 479,-32768,-32768, 405,-32768,-32768, 429, -32768, 99,-32768,-32768,-32768,-32768, 462,-32768, 264,-32768, 503, 504,-32768 }; static const short yypgoto[] = { -32768,-32768, 505,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768, 442,-32768, 404,-32768,-32768,-32768, 27,-32768, -32768, 413,-32768,-32768,-32768,-32768,-32768,-32768, -2,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768, 280,-32768,-32768, 184, -190,-32768,-32768, 192, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768, 58,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768, -145,-32768,-32768, -32768, -57,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768, 150,-32768,-32768,-32768,-32768, 333,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768, -159, -143, -154, 209, 210, 207, -192,-32768, 212,-32768,-32768, -197,-32768,-32768, -32768, -396,-32768,-32768,-32768,-32768,-32768,-32768, -114, -88, -516, -172,-32768,-32768,-32768, -244, 35, -382,-32768,-32768, -67,-32768,-32768,-32768, 286, 191,-32768,-32768, 165, -283, -64, -7,-32768,-32768, 516,-32768,-32768, -124,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768, 76,-32768,-32768,-32768,-32768, -17,-32768,-32768, 12,-32768,-32768,-32768,-32768, -123, -130,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768, 56,-32768,-32768, -43,-32768, -32768,-32768, -63,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768, -141 }; #define YYLAST 664 static const short yytable[] = { 9, 294, 244, 348, 253, 294, 217, 209, 355, 356, 357, 225, 439, 440, 119, 268, 237, 234, 208, 230, 231, 214, 218, 220, 623, 438, 224, 4, 378, 4, 277, 531, 212, 99, 235, 236, 206, 18, 11, 1, 449, -208, 543, 574, 624, -206, 358, 18, 7, 298, -213, 22, 232, 305, 206, 310, 532, 544, -51, 591, 592, 14, 463, -213, 359, 465, 466, 206, 279, 161, 360, 23, 258, 259, 260, 261, 262, 263, 276, -51, 278, 120, 12, 162, 415, 24, 209, 164, 165, 488, 238, 419, 489, 99, 421, 545, 26, 208, 354, 166, 427, 258, 259, 260, 261, 262, 263, 167, 168, 169, 170, 638, 639, 640, 641, 642, 643, 644, 645, 27, 317, 430, 294, 171, 318, 318, 326, 28, 172, 525, 31, 173, 15, 16, 17, 321, 353, 322, 426, 324, 450, 325, 174, 32, 264, 453, 136, 352, 29, 346, 176, 347, 404, 34, 458, 177, 178, 240, -337, -337, -337, 432, 433, 464, 365, 37, 366, 179, 392, 38, 393, 394, 395, 396, 397, 373, 398, 366, 661, 662, 401, 402, 375, 451, 376, 452, 565, 572, 566, 573, 605, 632, 606, 633, 117, 167, 168, 704, 257, 705, 679, 662, 646, 116, 121, -90, 130, 161, 426, -134, 509, 171, -394, 513, 145, 141, 172, 138, 140, 139, 148, 162, 163, 142, 143, 164, 165, 653, 654, 144, 146, 149, 147, 192, 492, 191, 159, 166, 193, 199, 435, 436, 197, 202, 309, 167, 168, 169, 170, 313, -359, -178, 195, 203, -355, -174, 204, -351, -125, -129, 201, 171, 205, 210, 564, 479, 172, 71, 228, 173, 219, 72, 73, 227, 242, -211, 239, 254, 245, 229, 174, 74, 247, 246, 250, 249, 251, 175, 176, 75, 76, 252, 256, 177, 178, -53, 269, 273, 264, 601, 281, 77, 212, 283, 272, 179, 286, 288, 568, -219, 78, 79, 80, 289, 290, 291, 523, 292, 299, 81, 82, 303, 312, 83, 84, 311, 85, 86, 87, 314, 316, 319, 367, 88, 349, 350, 370, 351, 369, 368, 371, 374, 377, 379, 381, 382, 383, 399, 388, 614, 390, 89, 90, 91, 400, 405, 410, 92, 93, 406, 412, 423, 416, 428, 431, 437, 614, 442, 446, 309, 454, 637, 672, 445, 71, 459, 462, 455, 72, 73, 460, 456, 656, 457, 467, 473, 475, 682, 74, 614, 478, 480, 482, 602, 483, 486, 75, 76, 484, 491, 495, 493, -52, 496, 497, 498, 669, 501, 77, 502, 510, 507, 516, 621, 506, 508, 637, 78, 79, 80, 519, 521, 526, 528, -408, 709, 81, 82, 547, 529, 83, 84, 530, 85, 86, 87, 554, 538, 541, 542, 88, 556, 559, 562, 569, 571, 570, 575, 576, 578, 582, 583, 588, 593, 700, 595, 590, 597, 89, 90, 91, 700, 607, 608, 92, 93, 603, 609, 490, 610, 617, 652, 615, 616, 626, -160, 655, 499, 650, 670, 685, 659, 686, 692, 668, 660, 671, 694, 309, 708, 514, 515, 676, 675, 518, 677, 678, 681, 687, 39, 40, 696, 698, 711, 712, 689, 118, 5, 131, 41, 472, 282, 539, 42, 389, 674, 589, 43, 44, 658, 417, 241, 631, 548, 137, 385, 387, 703, 386, 45, 512, 403, 620, 618, 555, 304, 25, 391, 46, 47, 48, 420, 680, 49, 567, 487, 553, 50, 51, 581, 684, 52, 53, 327, 54, 55, 56, 414, 690, 548, 522, 57, 585, 630, 707, 657, 0, 328, 0, 0, 0, 329, 330, 0, 0, 0, 0, 0, 0, 58, 59, 60, 0, 331, 0, 61, 62, 0, 0, 0, 0, 332, 333, 334, 335, 0, 0, 0, 0, 585, 0, 0, 0, 0, 0, 0, 0, 336, 0, 0, 0, 0, 337, 0, 0, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 339, 0, 0, 0, 0, 340, 341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 683 }; static const short yycheck[] = { 7, 245, 192, 286, 201, 249, 165, 161, 291, 292, 14, 170, 408, 409, 33, 207, 16, 176, 161, 173, 65, 164, 165, 166, 51, 407, 169, 0, 311, 2, 222, 34, 97, 35, 177, 178, 101, 10, 25, 5, 422, 97, 17, 559, 71, 101, 50, 20, 97, 246, 97, 4, 97, 250, 101, 252, 59, 32, 105, 575, 576, 98, 444, 97, 68, 447, 448, 101, 227, 5, 74, 101, 7, 8, 9, 10, 11, 12, 221, 105, 223, 100, 69, 19, 367, 105, 240, 23, 24, 471, 90, 374, 474, 95, 377, 70, 18, 240, 290, 35, 383, 7, 8, 9, 10, 11, 12, 43, 44, 45, 46, 6, 7, 8, 9, 10, 11, 12, 13, 7, 102, 102, 366, 59, 106, 106, 280, 6, 64, 511, 102, 67, 5, 6, 7, 98, 290, 100, 382, 98, 423, 100, 78, 101, 79, 428, 119, 290, 31, 98, 86, 100, 349, 39, 437, 91, 92, 5, 5, 6, 7, 7, 8, 446, 98, 7, 100, 103, 327, 99, 329, 330, 331, 332, 333, 98, 335, 100, 6, 7, 339, 340, 98, 98, 100, 100, 98, 98, 100, 100, 98, 98, 100, 100, 99, 43, 44, 98, 205, 100, 6, 7, 97, 102, 98, 4, 29, 5, 452, 87, 493, 59, 15, 496, 15, 54, 64, 61, 58, 62, 87, 19, 20, 60, 57, 23, 24, 623, 624, 53, 48, 4, 59, 84, 478, 80, 36, 35, 63, 56, 399, 400, 63, 75, 251, 43, 44, 45, 46, 256, 53, 54, 82, 29, 57, 58, 4, 60, 61, 62, 80, 59, 30, 97, 547, 462, 64, 1, 81, 67, 101, 5, 6, 36, 6, 101, 105, 13, 97, 101, 78, 15, 97, 80, 80, 97, 97, 85, 86, 23, 24, 80, 97, 91, 92, 29, 6, 6, 79, 582, 5, 35, 97, 6, 98, 103, 28, 7, 552, 101, 44, 45, 46, 7, 5, 27, 506, 89, 6, 53, 54, 47, 80, 57, 58, 27, 60, 61, 62, 94, 101, 3, 27, 67, 80, 104, 100, 104, 98, 101, 13, 27, 27, 6, 98, 97, 27, 36, 101, 593, 101, 85, 86, 87, 81, 37, 72, 91, 92, 37, 6, 27, 7, 76, 7, 27, 610, 73, 66, 376, 4, 615, 655, 102, 1, 4, 80, 102, 5, 6, 97, 102, 626, 102, 52, 7, 97, 670, 15, 633, 97, 4, 4, 583, 4, 4, 23, 24, 5, 98, 97, 27, 29, 21, 97, 97, 650, 97, 35, 83, 42, 98, 49, 603, 84, 98, 660, 44, 45, 46, 5, 4, 98, 98, 40, 708, 53, 54, 27, 98, 57, 58, 97, 60, 61, 62, 40, 98, 97, 97, 67, 6, 97, 41, 97, 101, 98, 97, 97, 88, 27, 84, 7, 97, 698, 26, 98, 77, 85, 86, 87, 705, 102, 98, 91, 92, 96, 98, 475, 38, 4, 4, 97, 97, 95, 98, 27, 484, 97, 27, 7, 98, 6, 14, 98, 100, 97, 6, 495, 27, 497, 498, 98, 101, 501, 100, 98, 98, 98, 5, 6, 22, 97, 0, 0, 102, 64, 2, 95, 15, 452, 231, 519, 19, 322, 660, 573, 23, 24, 633, 370, 188, 610, 530, 120, 316, 319, 699, 318, 35, 495, 347, 599, 597, 541, 249, 20, 325, 44, 45, 46, 376, 666, 49, 551, 469, 534, 53, 54, 566, 673, 57, 58, 5, 60, 61, 62, 366, 688, 566, 504, 67, 569, 606, 705, 628, -1, 19, -1, -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, 85, 86, 87, -1, 35, -1, 91, 92, -1, -1, -1, -1, 43, 44, 45, 46, -1, -1, -1, -1, 606, -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, -1, 64, -1, -1, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 86, -1, -1, -1, -1, 91, 92, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 671 }; #define YYPURE 1 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/local/share/bison/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) /* The parser invokes alloca or malloc; define the necessary symbols. */ # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # else # ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC malloc # define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; # if YYLSP_NEEDED YYLTYPE yyls; # endif }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # if YYLSP_NEEDED # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAX) # else # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAX) # endif /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up"); \ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). When YYLLOC_DEFAULT is run, CURRENT is set the location of the first token. By default, to implement support for ranges, extend its range to the last symbol. */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ #if YYPURE # if YYLSP_NEEDED # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) # else # define YYLEX yylex (&yylval, &yylloc) # endif # else /* !YYLSP_NEEDED */ # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) # else # define YYLEX yylex (&yylval) # endif # endif /* !YYLSP_NEEDED */ #else /* !YYPURE */ # define YYLEX yylex () #endif /* !YYPURE */ /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #ifdef YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif #line 315 "/usr/local/share/bison/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM # define YYPARSE_PARAM_DECL # else # define YYPARSE_PARAM_ARG YYPARSE_PARAM # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; # endif #else /* !YYPARSE_PARAM */ # define YYPARSE_PARAM_ARG # define YYPARSE_PARAM_DECL #endif /* !YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ # ifdef YYPARSE_PARAM int yyparse (void *); # else int yyparse (void); # endif #endif /* YY_DECL_VARIABLES -- depending whether we use a pure parser, variables are global, or local to YYPARSE. */ #define YY_DECL_NON_LSP_VARIABLES \ /* The lookahead symbol. */ \ int yychar; \ \ /* The semantic value of the lookahead symbol. */ \ YYSTYPE yylval; \ \ /* Number of parse errors so far. */ \ int yynerrs; #if YYLSP_NEEDED # define YY_DECL_VARIABLES \ YY_DECL_NON_LSP_VARIABLES \ \ /* Location data for the lookahead symbol. */ \ YYLTYPE yylloc; #else # define YY_DECL_VARIABLES \ YY_DECL_NON_LSP_VARIABLES #endif /* If nonreentrant, generate the variables here. */ #if !YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ int yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { /* If reentrant, generate the variables here. */ #if YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yychar1 = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #if YYLSP_NEEDED /* The location stack. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; #endif #if YYLSP_NEEDED # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else # define YYPOPSTACK (yyvsp--, yyssp--) #endif YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYLSP_NEEDED YYLTYPE yyloc; #endif /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; #if YYLSP_NEEDED yylsp = yyls; #endif goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. */ # if YYLSP_NEEDED YYLTYPE *yyls1 = yyls; /* This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); yyls = yyls1; # else yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); # endif yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) goto yyoverflowlab; yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # if YYLSP_NEEDED YYSTACK_RELOCATE (yyls); # endif # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; #if YYLSP_NEEDED yylsp = yyls + yysize - 1; #endif YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyssp >= yyss + yystacksize - 1) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yychar1 = YYTRANSLATE (yychar); #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { YYFPRINTF (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); /* Give the individual parser a way to print the precise meaning of a token, for further debugging info. */ # ifdef YYPRINT YYPRINT (stderr, yychar, yylval); # endif YYFPRINTF (stderr, ")\n"); } #endif } yyn += yychar1; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ if (yyn < 0) { if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to the semantic value of the lookahead token. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; #if YYLSP_NEEDED /* Similarly for the default location. Let the user run additional commands if for instance locations are ranges. */ yyloc = yylsp[1-yylen]; YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); #endif #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { int yyi; YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 1: #line 1591 "parser-smi.y" { yyval.err = 0; ; break;} case 2: #line 1595 "parser-smi.y" { yyval.err = 0; ; break;} case 3: #line 1601 "parser-smi.y" { yyval.err = 0; ; break;} case 4: #line 1603 "parser-smi.y" { yyval.err = 0; ; break;} case 5: #line 1611 "parser-smi.y" { thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_MODULE; thisParserPtr->modulePtr = findModuleByName(yyvsp[0].id); if (!thisParserPtr->modulePtr) { thisParserPtr->modulePtr = addModule(yyvsp[0].id, smiStrdup(thisParserPtr->path), 0, thisParserPtr); thisParserPtr->modulePtr-> numImportedIdentifiers = 0; thisParserPtr->modulePtr-> numStatements = 0; thisParserPtr->modulePtr-> numModuleIdentities = 0; if (!strcmp(yyvsp[0].id, "SNMPv2-SMI")) { /* * SNMPv2-SMI is an SMIv2 module * that cannot be identified by * importing from SNMPv2-SMI. */ thisModulePtr->export.language = SMI_LANGUAGE_SMIV2; } } else { smiPrintError(thisParserPtr, ERR_MODULE_ALREADY_LOADED, yyvsp[0].id); /* * this aborts parsing the whole file, * not only the current module. */ YYABORT; } ; break;} case 6: #line 1655 "parser-smi.y" { if (thisModulePtr->export.language == SMI_LANGUAGE_UNKNOWN) thisModulePtr->export.language = SMI_LANGUAGE_SMIV1; checkModuleName(thisParserPtr, thisModulePtr); checkModuleIdentity(thisParserPtr, thisModulePtr); checkObjects(thisParserPtr, thisModulePtr); checkTypes(thisParserPtr, thisModulePtr); checkDefvals(thisParserPtr, thisModulePtr); checkImportsUsage(thisParserPtr, thisModulePtr); smiCheckTypeUsage(thisParserPtr, thisModulePtr); thisParserPtr->capabilitiesModulePtr = NULL; yyval.err = 0; ; break;} case 7: #line 1673 "parser-smi.y" { yyval.err = 0; ; break;} case 8: #line 1675 "parser-smi.y" { yyval.err = 0; ; break;} case 9: #line 1679 "parser-smi.y" { ; break;} case 10: #line 1681 "parser-smi.y" { thisModulePtr->export.language = SMI_LANGUAGE_SPPI; ; break;} case 11: #line 1690 "parser-smi.y" { yyval.err = 0; ; break;} case 12: #line 1692 "parser-smi.y" { yyval.err = 0; ; break;} case 13: #line 1696 "parser-smi.y" { thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_MODULE; if ((thisModulePtr->export.language != SMI_LANGUAGE_SMIV2) && (thisModulePtr->export.language != SMI_LANGUAGE_SPPI)) thisModulePtr->export.language = SMI_LANGUAGE_SMIV1; yyval.err = 0; ; break;} case 14: #line 1710 "parser-smi.y" { yyval.err = 0; ; break;} case 15: #line 1712 "parser-smi.y" { if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "EXPORTS"); thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_MODULE; if (strcmp(thisParserPtr->modulePtr->export.name, "RFC1155-SMI") && strcmp(thisParserPtr->modulePtr->export.name, "RFC1065-SMI")) { smiPrintError(thisParserPtr, ERR_EXPORTS); } ; break;} case 16: #line 1729 "parser-smi.y" { yyval.err = 0; ; break;} case 17: #line 1733 "parser-smi.y" { yyval.err = 0; ; break;} case 18: #line 1735 "parser-smi.y" { yyval.err = 0; ; break;} case 19: #line 1740 "parser-smi.y" { yyval.err = 0; ; break;} case 20: #line 1742 "parser-smi.y" { yyval.err = 0; ; break;} case 21: #line 1748 "parser-smi.y" { Import *importPtr; Module *modulePtr; /* * Recursively call the parser to suffer * the IMPORTS, if the module is not yet * loaded. */ modulePtr = findModuleByName(yyvsp[0].id); if (!modulePtr) { modulePtr = loadModule(yyvsp[0].id, thisParserPtr); } checkImports(modulePtr, thisParserPtr); if (modulePtr && !strcmp(yyvsp[0].id, "SNMPv2-SMI")) { /* * A module that imports a macro or * type definition from SNMPv2-SMI * seems to be SMIv2 style - but only if * it is not SPPI yet. */ if (thisModulePtr->export.language != SMI_LANGUAGE_SPPI) { for (importPtr = thisModulePtr->firstImportPtr; importPtr; importPtr = importPtr->nextPtr) { if ((!strcmp(importPtr->export.module, yyvsp[0].id)) && ((importPtr->kind == KIND_MACRO) || (importPtr->kind == KIND_TYPE))) { thisModulePtr->export.language = SMI_LANGUAGE_SMIV2; } } } } smiFree(yyvsp[0].id); ; break;} case 22: #line 1791 "parser-smi.y" { yyval.err = 0; ; break;} case 23: #line 1794 "parser-smi.y" { yyval.err = 0; ; break;} case 24: #line 1801 "parser-smi.y" { addImport(yyvsp[0].id, thisParserPtr); thisParserPtr->modulePtr->numImportedIdentifiers++; yyval.id = 0; ; break;} case 25: #line 1807 "parser-smi.y" { addImport(yyvsp[0].id, thisParserPtr); thisParserPtr->modulePtr->numImportedIdentifiers++; yyval.id = 0; ; break;} case 26: #line 1813 "parser-smi.y" { addImport(smiStrdup(yyvsp[0].id), thisParserPtr); thisParserPtr->modulePtr->numImportedIdentifiers++; yyval.id = 0; ; break;} case 27: #line 1829 "parser-smi.y" { /* * There are PIBs that import e.g. Counter64 - so * don't complain here about SMI keywords. */ /* if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, $1);*/ yyval.id = yyvsp[0].id; ; break;} case 28: #line 1839 "parser-smi.y" { if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, yyvsp[0].id); yyval.id = yyvsp[0].id; ; break;} case 51: #line 1873 "parser-smi.y" { checkNameLen(thisParserPtr, yyvsp[0].id, ERR_MODULENAME_32, ERR_MODULENAME_64); yyval.id = yyvsp[0].id; ; break;} case 52: #line 1885 "parser-smi.y" { yyval.err = 0; ; break;} case 53: #line 1887 "parser-smi.y" { yyval.err = 0; ; break;} case 54: #line 1892 "parser-smi.y" { yyval.err = 0; ; break;} case 55: #line 1894 "parser-smi.y" { yyval.err = 0; ; break;} case 56: #line 1898 "parser-smi.y" { thisParserPtr->modulePtr->numStatements++; yyval.err = 0; ; break;} case 57: #line 1903 "parser-smi.y" { thisParserPtr->modulePtr->numStatements++; yyval.err = 0; ; break;} case 58: #line 1908 "parser-smi.y" { thisParserPtr->modulePtr->numStatements++; yyval.err = 0; ; break;} case 59: #line 1913 "parser-smi.y" { thisParserPtr->modulePtr->numStatements++; yyval.err = 0; ; break;} case 60: #line 1918 "parser-smi.y" { thisParserPtr->modulePtr->numStatements++; yyval.err = 0; ; break;} case 61: #line 1923 "parser-smi.y" { thisParserPtr->modulePtr->numStatements++; yyval.err = 0; ; break;} case 62: #line 1928 "parser-smi.y" { thisParserPtr->modulePtr->numStatements++; yyval.err = 0; ; break;} case 63: #line 1933 "parser-smi.y" { thisParserPtr->modulePtr->numStatements++; yyval.err = 0; ; break;} case 64: #line 1938 "parser-smi.y" { thisParserPtr->modulePtr->numStatements++; yyval.err = 0; ; break;} case 65: #line 1943 "parser-smi.y" { thisParserPtr->modulePtr->numStatements++; yyval.err = 0; ; break;} case 66: #line 1948 "parser-smi.y" { thisParserPtr->modulePtr->numStatements++; yyval.err = 0; ; break;} case 67: #line 1953 "parser-smi.y" { thisParserPtr->modulePtr->numStatements++; yyval.err = 0; ; break;} case 68: #line 1958 "parser-smi.y" { smiPrintError(thisParserPtr, ERR_FLUSH_DECLARATION); yyerrok; yyval.err = 1; ; break;} case 69: #line 1972 "parser-smi.y" { Macro *macroPtr; thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_MACRO; macroPtr = addMacro(smiStrdup(yyvsp[0].id), 0, thisParserPtr); setMacroLine(macroPtr, thisParserPtr->firstStatementLine, thisParserPtr); ; break;} case 70: #line 1984 "parser-smi.y" { /* * ASN.1 macros are known to be in these * modules. */ if (strcmp(thisParserPtr->modulePtr->export.name, "SNMPv2-SMI") && strcmp(thisParserPtr->modulePtr->export.name, "SNMPv2-TC") && strcmp(thisParserPtr->modulePtr->export.name, "SNMPv2-CONF") && strcmp(thisParserPtr->modulePtr->export.name, "RFC-1212") && strcmp(thisParserPtr->modulePtr->export.name, "RFC-1215") && strcmp(thisParserPtr->modulePtr->export.name, "RFC1065-SMI") && strcmp(thisParserPtr->modulePtr->export.name, "RFC1155-SMI") && strcmp(thisParserPtr->modulePtr->export.name, "COPS-PR-SPPI") && strcmp(thisParserPtr->modulePtr->export.name, "COPS-PR-SPPI-TC")) { smiPrintError(thisParserPtr, ERR_MACRO); } ; break;} case 71: #line 2012 "parser-smi.y" { yyval.err = 0; ; break;} case 72: #line 2017 "parser-smi.y" { yyval.id = yyvsp[0].id; ; break;} case 73: #line 2018 "parser-smi.y" { yyval.id = yyvsp[0].id; ; break;} case 74: #line 2019 "parser-smi.y" { yyval.id = yyvsp[0].id; ; break;} case 75: #line 2020 "parser-smi.y" { yyval.id = yyvsp[0].id; ; break;} case 76: #line 2021 "parser-smi.y" { yyval.id = yyvsp[0].id; ; break;} case 77: #line 2022 "parser-smi.y" { yyval.id = yyvsp[0].id; ; break;} case 78: #line 2023 "parser-smi.y" { yyval.id = yyvsp[0].id; ; break;} case 79: #line 2024 "parser-smi.y" { yyval.id = yyvsp[0].id; ; break;} case 80: #line 2025 "parser-smi.y" { yyval.id = yyvsp[0].id; ; break;} case 81: #line 2026 "parser-smi.y" { yyval.id = yyvsp[0].id; ; break;} case 82: #line 2030 "parser-smi.y" { if (strcmp(thisParserPtr->modulePtr->export.name, "SNMPv2-SMI") && strcmp(thisParserPtr->modulePtr->export.name, "SNMPv2-TC") && strcmp(thisParserPtr->modulePtr->export.name, "SNMPv2-CONF") && strcmp(thisParserPtr->modulePtr->export.name, "RFC-1212") && strcmp(thisParserPtr->modulePtr->export.name, "RFC1065-SMI") && strcmp(thisParserPtr->modulePtr->export.name, "RFC1155-SMI") && strcmp(thisParserPtr->modulePtr->export.name, "COPS-PR-SPPI")) { smiPrintError(thisParserPtr, ERR_CHOICE); } ; break;} case 83: #line 2050 "parser-smi.y" { yyval.typePtr = addType(NULL, SMI_BASETYPE_UNKNOWN, 0, thisParserPtr); ; break;} case 84: #line 2060 "parser-smi.y" { yyval.id = yyvsp[0].id; ; break;} case 85: #line 2065 "parser-smi.y" { smiPrintError (thisParserPtr, ERR_BAD_LOWER_IDENTIFIER_CASE, yyvsp[0].id); /* xxx if ((thisParserPtr->flags & SMI_FLAG_BE_LAX) == 0) { YYERROR; } */ yyval.id = yyvsp[0].id; ; break;} case 86: #line 2080 "parser-smi.y" { thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_VALUEASSIGNMENT; checkNameLen(thisParserPtr, yyvsp[0].id, ERR_OIDNAME_32, ERR_OIDNAME_64); smiCheckObjectName(thisParserPtr, thisModulePtr, yyvsp[0].id); if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { if (strchr(yyvsp[0].id, '-') && (strcmp(yyvsp[0].id, "mib-2") || strcmp(thisModulePtr->export.name, "SNMPv2-SMI"))) { smiPrintError(thisParserPtr, ERR_OIDNAME_INCLUDES_HYPHEN, yyvsp[0].id); } } ; break;} case 87: #line 2101 "parser-smi.y" { Object *objectPtr; objectPtr = yyvsp[-1].objectPtr; smiCheckObjectReuse(thisParserPtr, yyvsp[-7].id, &objectPtr); objectPtr = setObjectName(objectPtr, yyvsp[-7].id, thisParserPtr); deleteObjectFlags(objectPtr, FLAG_INCOMPLETE); setObjectLine(objectPtr, thisParserPtr->firstStatementLine, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_VALUEASSIGNMENT); yyval.err = 0; ; break;} case 88: #line 2120 "parser-smi.y" { thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_TYPEASSIGNMENT; checkNameLen(thisParserPtr, yyvsp[0].id, ERR_TYPENAME_32, ERR_TYPENAME_64); ; break;} case 89: #line 2128 "parser-smi.y" { Type *typePtr; if (strlen(yyvsp[-3].id)) { if (yyvsp[0].typePtr->export.basetype != SMI_BASETYPE_UNKNOWN) { smiCheckTypeName(thisParserPtr, thisModulePtr, yyvsp[-3].id, thisParserPtr->firstStatementLine); } setTypeLine(yyvsp[0].typePtr, thisParserPtr->firstStatementLine, thisParserPtr); setTypeName(yyvsp[0].typePtr, yyvsp[-3].id); yyval.err = 0; } else { yyval.err = 0; } /* * If we are in an SMI module, some type * definitions derived from ASN.1 `INTEGER' * must be modified to libsmi basetypes. */ if (thisModulePtr && (!strcmp(thisModulePtr->export.name, "SNMPv2-SMI"))) { if (!strcmp(yyvsp[-3].id, "Counter32")) { yyvsp[0].typePtr->export.basetype = SMI_BASETYPE_UNSIGNED32; setTypeParent(yyvsp[0].typePtr, smiHandle->typeUnsigned32Ptr); if (yyvsp[0].typePtr->listPtr) { ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.value.unsigned32 = 0; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U; } } else if (!strcmp(yyvsp[-3].id, "Gauge32")) { yyvsp[0].typePtr->export.basetype = SMI_BASETYPE_UNSIGNED32; setTypeParent(yyvsp[0].typePtr, smiHandle->typeUnsigned32Ptr); if (yyvsp[0].typePtr->listPtr) { ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.value.unsigned32 = 0; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U; } } else if (!strcmp(yyvsp[-3].id, "Unsigned32")) { yyvsp[0].typePtr->export.basetype = SMI_BASETYPE_UNSIGNED32; setTypeParent(yyvsp[0].typePtr, smiHandle->typeUnsigned32Ptr); if (yyvsp[0].typePtr->listPtr) { ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.value.unsigned32 = 0; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U; } } else if (!strcmp(yyvsp[-3].id, "TimeTicks")) { yyvsp[0].typePtr->export.basetype = SMI_BASETYPE_UNSIGNED32; setTypeParent(yyvsp[0].typePtr, smiHandle->typeUnsigned32Ptr); if (yyvsp[0].typePtr->listPtr) { ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.value.unsigned32 = 0; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U; } } else if (!strcmp(yyvsp[-3].id, "Counter64")) { yyvsp[0].typePtr->export.basetype = SMI_BASETYPE_UNSIGNED64; if (yyvsp[0].typePtr->listPtr) { ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED64; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.value.unsigned64 = 0; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED64; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.value.unsigned64 = LIBSMI_UINT64_MAX; } setTypeParent(yyvsp[0].typePtr, smiHandle->typeUnsigned64Ptr); } } if (thisModulePtr && (!strcmp(thisModulePtr->export.name, "RFC1155-SMI") || !strcmp(thisModulePtr->export.name, "RFC1065-SMI"))) { if (!strcmp(yyvsp[-3].id, "Counter")) { yyvsp[0].typePtr->export.basetype = SMI_BASETYPE_UNSIGNED32; setTypeParent(yyvsp[0].typePtr, smiHandle->typeUnsigned32Ptr); if (yyvsp[0].typePtr->listPtr) { ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.value.unsigned32 = 0; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U; } } else if (!strcmp(yyvsp[-3].id, "Gauge")) { yyvsp[0].typePtr->export.basetype = SMI_BASETYPE_UNSIGNED32; setTypeParent(yyvsp[0].typePtr, smiHandle->typeUnsigned32Ptr); if (yyvsp[0].typePtr->listPtr) { ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.value.unsigned32 = 0; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U; } } else if (!strcmp(yyvsp[-3].id, "TimeTicks")) { yyvsp[0].typePtr->export.basetype = SMI_BASETYPE_UNSIGNED32; setTypeParent(yyvsp[0].typePtr, smiHandle->typeUnsigned32Ptr); if (yyvsp[0].typePtr->listPtr) { ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.value.unsigned32 = 0; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U; } } else if (!strcmp(yyvsp[-3].id, "NetworkAddress")) { setTypeName(yyvsp[0].typePtr, smiStrdup("NetworkAddress")); yyvsp[0].typePtr->export.basetype = SMI_BASETYPE_OCTETSTRING; setTypeParent(yyvsp[0].typePtr, findTypeByModuleAndName( thisModulePtr, "IpAddress")); } else if (!strcmp(yyvsp[-3].id, "IpAddress")) { typePtr = findTypeByModuleAndName( thisModulePtr, "NetworkAddress"); if (typePtr) setTypeParent(typePtr, yyvsp[0].typePtr); } } if (thisModulePtr && (!strcmp(thisModulePtr->export.name, "COPS-PR-SPPI"))) { if (!strcmp(yyvsp[-3].id, "Unsigned32")) { yyvsp[0].typePtr->export.basetype = SMI_BASETYPE_UNSIGNED32; setTypeParent(yyvsp[0].typePtr, smiHandle->typeUnsigned32Ptr); if (yyvsp[0].typePtr->listPtr) { ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.value.unsigned32 = 0; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U; } } else if (!strcmp(yyvsp[-3].id, "TimeTicks")) { yyvsp[0].typePtr->export.basetype = SMI_BASETYPE_UNSIGNED32; setTypeParent(yyvsp[0].typePtr, smiHandle->typeUnsigned32Ptr); if (yyvsp[0].typePtr->listPtr) { ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.value.unsigned32 = 0; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U; } } else if (!strcmp(yyvsp[-3].id, "Unsigned64")) { yyvsp[0].typePtr->export.basetype = SMI_BASETYPE_UNSIGNED64; if (yyvsp[0].typePtr->listPtr) { ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED64; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.value.unsigned64 = 0; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED64; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.value.unsigned64 = LIBSMI_UINT64_MAX; } setTypeParent(yyvsp[0].typePtr, smiHandle->typeUnsigned64Ptr); } else if (!strcmp(yyvsp[-3].id, "Integer64")) { yyvsp[0].typePtr->export.basetype = SMI_BASETYPE_INTEGER64; if (yyvsp[0].typePtr->listPtr) { ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_INTEGER64; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.minValue.value.integer64 = LIBSMI_INT64_MIN; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_INTEGER64; ((Range *)yyvsp[0].typePtr->listPtr->ptr)->export.maxValue.value.integer64 = LIBSMI_INT64_MAX; } setTypeParent(yyvsp[0].typePtr, smiHandle->typeInteger64Ptr); } } ; break;} case 90: #line 2286 "parser-smi.y" { yyval.id = yyvsp[0].id; ; break;} case 91: #line 2290 "parser-smi.y" { yyval.id = smiStrdup(yyvsp[0].id); /* * well known types (keywords in this grammar) * are known to be defined in these modules. */ if (strcmp(thisParserPtr->modulePtr->export.name, "SNMPv2-SMI") && strcmp(thisParserPtr->modulePtr->export.name, "SNMPv2-TC") && strcmp(thisParserPtr->modulePtr->export.name, "SNMPv2-CONF") && strcmp(thisParserPtr->modulePtr->export.name, "RFC-1212") && strcmp(thisParserPtr->modulePtr->export.name, "RFC1065-SMI") && strcmp(thisParserPtr->modulePtr->export.name, "RFC1155-SMI") && strcmp(thisParserPtr->modulePtr->export.name, "COPS-PR-SPPI")) { smiPrintError(thisParserPtr, ERR_TYPE_SMI_OR_SPPI, yyvsp[0].id); } ; break;} case 92: #line 2314 "parser-smi.y" { yyval.id = smiStrdup(yyvsp[0].id); /* * well known types (keywords in this grammar) * are known to be defined in these modules. */ if ((strcmp(thisParserPtr->modulePtr->export.name, "COPS-PR-SPPI")) && (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI)) smiPrintError(thisParserPtr, ERR_TYPE_SPPI, yyvsp[0].id); ; break;} case 94: #line 2329 "parser-smi.y" { if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) && !findImportByName(yyvsp[0].id, thisParserPtr->modulePtr)) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, yyvsp[0].id); yyval.id = yyvsp[0].id; ; break;} case 105: #line 2354 "parser-smi.y" { if (yyvsp[0].typePtr->export.name) { /* * If we found an already defined type, * we have to inherit a new type structure. * (Otherwise the `Syntax' rule created * a new type for us.) */ yyval.typePtr = duplicateType(yyvsp[0].typePtr, 0, thisParserPtr); setTypeDecl(yyval.typePtr, SMI_DECL_TYPEASSIGNMENT); } else { yyval.typePtr = yyvsp[0].typePtr; setTypeDecl(yyval.typePtr, SMI_DECL_TYPEASSIGNMENT); } ; break;} case 106: #line 2370 "parser-smi.y" { Import *importPtr; thisParserPtr->currentDecl = SMI_DECL_TEXTUALCONVENTION; if (thisModulePtr->export.language == SMI_LANGUAGE_UNKNOWN) thisModulePtr->export.language = SMI_LANGUAGE_SMIV2; if (strcmp(thisModulePtr->export.name, "SNMPv2-TC")) { importPtr = findImportByName("TEXTUAL-CONVENTION", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "TEXTUAL-CONVENTION", "SNMPv2-TC"); else smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "TEXTUAL-CONVENTION", "COPS-PR-SPPI"); } } ; break;} case 107: #line 2401 "parser-smi.y" { checkDescr(thisParserPtr, yyvsp[0].text); ; break;} case 108: #line 2406 "parser-smi.y" { if ((yyvsp[0].typePtr) && !(yyvsp[0].typePtr->export.name)) { /* * If the Type we found has just been * defined, we don't have to allocate * a new one. */ yyval.typePtr = yyvsp[0].typePtr; } else { if (!(yyvsp[0].typePtr)) smiPrintError(thisParserPtr, ERR_INTERNAL); /* * Otherwise, we have to allocate a * new Type struct, inherited from $10. */ yyval.typePtr = duplicateType(yyvsp[0].typePtr, 0, thisParserPtr); } setTypeDescription(yyval.typePtr, yyvsp[-4].text, thisParserPtr); if (yyvsp[-2].text) { setTypeReference(yyval.typePtr, yyvsp[-2].text, thisParserPtr); } setTypeStatus(yyval.typePtr, yyvsp[-6].status); if (yyvsp[-8].text) { if (smiCheckFormat(thisParserPtr, yyval.typePtr->export.basetype, yyvsp[-8].text, thisParserPtr->firstStatementLine)) { setTypeFormat(yyval.typePtr, yyvsp[-8].text); } } setTypeDecl(yyval.typePtr, SMI_DECL_TEXTUALCONVENTION); ; break;} case 109: #line 2438 "parser-smi.y" { yyval.typePtr = yyvsp[0].typePtr; setTypeDecl(yyval.typePtr, SMI_DECL_TYPEASSIGNMENT); ; break;} case 110: #line 2446 "parser-smi.y" { if (yyvsp[0].typePtr) { yyval.typePtr = addType(NULL, SMI_BASETYPE_UNKNOWN, 0, thisParserPtr); setTypeDecl(yyval.typePtr, SMI_DECL_IMPL_SEQUENCEOF); setTypeParent(yyval.typePtr, yyvsp[0].typePtr); } else { yyval.typePtr = NULL; } ; break;} case 111: #line 2465 "parser-smi.y" { Type *typePtr; Import *importPtr; yyval.typePtr = findTypeByModulenameAndName( thisParserPtr->modulePtr->export.name, yyvsp[0].id); if (! yyval.typePtr) { importPtr = findImportByName(yyvsp[0].id, thisModulePtr); if (!importPtr || (importPtr->kind == KIND_NOTFOUND)) { /* * forward referenced type. create it, * marked with FLAG_INCOMPLETE. */ typePtr = addType(yyvsp[0].id, SMI_BASETYPE_UNKNOWN, FLAG_INCOMPLETE, thisParserPtr); yyval.typePtr = typePtr; } else { /* * imported type. * TODO: is this allowed in a SEQUENCE? */ importPtr->use++; yyval.typePtr = findTypeByModulenameAndName( importPtr->export.module, importPtr->export.name); smiFree(yyvsp[0].id); } } else { smiFree(yyvsp[0].id); } ; break;} case 112: #line 2505 "parser-smi.y" { yyval.typePtr = addType(NULL, SMI_BASETYPE_UNKNOWN, 0, thisParserPtr); setTypeList(yyval.typePtr, yyvsp[-1].listPtr); ; break;} case 113: #line 2513 "parser-smi.y" { yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].objectPtr; yyval.listPtr->nextPtr = NULL; ; break;} case 114: #line 2520 "parser-smi.y" { List *p, *pp; p = smiMalloc(sizeof(List)); p->ptr = (void *)yyvsp[0].objectPtr; p->nextPtr = NULL; for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; ; break;} case 115: #line 2539 "parser-smi.y" { Object *objectPtr; Import *importPtr; Type *typePtr; objectPtr = findObjectByModuleAndName(thisParserPtr->modulePtr, yyvsp[-1].id); if (!objectPtr) { importPtr = findImportByName(yyvsp[-1].id, thisModulePtr); if (!importPtr || (importPtr->kind == KIND_NOTFOUND)) { objectPtr = addObject(yyvsp[-1].id, thisParserPtr->pendingNodePtr, 0, FLAG_INCOMPLETE | FLAG_SEQTYPE, thisParserPtr); setObjectType(objectPtr, yyvsp[0].typePtr); } else { /* * imported object. */ importPtr->use++; objectPtr = findObjectByModulenameAndName( importPtr->export.module, yyvsp[-1].id); smiFree(yyvsp[-1].id); if (objectPtr->typePtr->export.name) { typePtr = objectPtr->typePtr; } else { typePtr = objectPtr->typePtr->parentPtr; } if ((yyvsp[0].typePtr != typePtr) && ((yyvsp[0].typePtr->export.basetype != SMI_BASETYPE_INTEGER32) || (typePtr->export.basetype != SMI_BASETYPE_ENUM)) && ((yyvsp[0].typePtr->export.basetype != SMI_BASETYPE_OCTETSTRING) || (typePtr->export.basetype != SMI_BASETYPE_BITS))) { smiPrintError(thisParserPtr, ERR_SEQUENCE_TYPE_MISMATCH, objectPtr->export.name); } } } else { smiFree(yyvsp[-1].id); if (objectPtr->typePtr) { if (objectPtr->typePtr->export.name) { typePtr = objectPtr->typePtr; } else { typePtr = objectPtr->typePtr->parentPtr; } if ((yyvsp[0].typePtr != typePtr) && ((yyvsp[0].typePtr->export.basetype != SMI_BASETYPE_INTEGER32) || (typePtr->export.basetype != SMI_BASETYPE_ENUM)) && ((yyvsp[0].typePtr->export.basetype != SMI_BASETYPE_OCTETSTRING) || (typePtr->export.basetype != SMI_BASETYPE_BITS))) { smiPrintError(thisParserPtr, ERR_SEQUENCE_TYPE_MISMATCH, objectPtr->export.name); } } else { setObjectType(objectPtr, yyvsp[0].typePtr); addObjectFlags(objectPtr, FLAG_SEQTYPE); } } yyval.objectPtr = objectPtr; ; break;} case 116: #line 2622 "parser-smi.y" { yyval.typePtr = yyvsp[0].typePtr; if (yyval.typePtr) defaultBasetype = yyval.typePtr->export.basetype; ; break;} case 117: #line 2630 "parser-smi.y" { Type *typePtr; List *p; defaultBasetype = SMI_BASETYPE_BITS; typePtr = addType(NULL, SMI_BASETYPE_BITS, FLAG_INCOMPLETE, thisParserPtr); setTypeDecl(typePtr, SMI_DECL_IMPLICIT_TYPE); setTypeParent(typePtr, smiHandle->typeBitsPtr); setTypeList(typePtr, yyvsp[-1].listPtr); for (p = yyvsp[-1].listPtr; p; p = p->nextPtr) ((NamedNumber *)p->ptr)->typePtr = typePtr; smiCheckNamedNumbersOrder(parserPtr, typePtr); yyval.typePtr = typePtr; ; break;} case 118: #line 2650 "parser-smi.y" { yyval.typePtr = yyvsp[0].typePtr; ; break;} case 119: #line 2654 "parser-smi.y" { /* TODO: */ yyval.typePtr = smiHandle->typeOctetStringPtr; ; break;} case 120: #line 2659 "parser-smi.y" { Type *typePtr; Import *importPtr; yyval.typePtr = findTypeByModulenameAndName( thisParserPtr->modulePtr->export.name, yyvsp[-1].id); if (! yyval.typePtr) { importPtr = findImportByName(yyvsp[-1].id, thisModulePtr); if (!importPtr || (importPtr->kind == KIND_NOTFOUND)) { /* * forward referenced type. create it, * marked with FLAG_INCOMPLETE. */ typePtr = addType(yyvsp[-1].id, SMI_BASETYPE_UNKNOWN, FLAG_INCOMPLETE, thisParserPtr); yyval.typePtr = typePtr; } else { importPtr->use++; yyval.typePtr = findTypeByModulenameAndName( importPtr->export.module, importPtr->export.name); smiFree(yyvsp[-1].id); } } else { smiFree(yyvsp[-1].id); } ; break;} case 121: #line 2692 "parser-smi.y" { yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].namedNumberPtr; yyval.listPtr->nextPtr = NULL; ; break;} case 122: #line 2698 "parser-smi.y" { List *p, *pp; p = smiMalloc(sizeof(List)); p->ptr = (void *)yyvsp[0].namedNumberPtr; p->nextPtr = NULL; for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; ; break;} case 123: #line 2711 "parser-smi.y" { checkNameLen(thisParserPtr, yyvsp[0].id, ERR_BITNAME_32, ERR_BITNAME_64); if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { if (strchr(yyvsp[0].id, '-')) { smiPrintError(thisParserPtr, ERR_NAMEDBIT_INCLUDES_HYPHEN, yyvsp[0].id); } } ; break;} case 124: #line 2724 "parser-smi.y" { yyval.namedNumberPtr = smiMalloc(sizeof(NamedNumber)); yyval.namedNumberPtr->export.name = yyvsp[-4].id; yyval.namedNumberPtr->export.value.basetype = SMI_BASETYPE_UNSIGNED32; yyval.namedNumberPtr->export.value.value.unsigned32 = yyvsp[-1].unsigned32; /* RFC 2578 7.1.4 */ if (yyvsp[-1].unsigned32 >= 65535*8) { smiPrintError(thisParserPtr, ERR_BITS_NUMBER_TOO_LARGE, yyvsp[-4].id, yyvsp[-1].unsigned32); } else { if (yyvsp[-1].unsigned32 >= 128) { smiPrintError(thisParserPtr, ERR_BITS_NUMBER_LARGE, yyvsp[-4].id, yyvsp[-1].unsigned32); } } ; break;} case 125: #line 2746 "parser-smi.y" { thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_OBJECTIDENTITY; checkNameLen(thisParserPtr, yyvsp[0].id, ERR_OIDNAME_32, ERR_OIDNAME_64); smiCheckObjectName(thisParserPtr, thisModulePtr, yyvsp[0].id); ; break;} case 126: #line 2756 "parser-smi.y" { Import *importPtr; if (strcmp(thisModulePtr->export.name, "SNMPv2-SMI") && strcmp(thisModulePtr->export.name, "COPS-PR-SPPI")) { importPtr = findImportByName("OBJECT-IDENTITY", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "OBJECT-IDENTITY", "SNMPv2-SMI"); else smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "OBJECT-IDENTITY", "COPS-PR-SPPI"); } } ; break;} case 127: #line 2781 "parser-smi.y" { checkDescr(thisParserPtr, yyvsp[0].text); ; break;} case 128: #line 2787 "parser-smi.y" { Object *objectPtr; objectPtr = yyvsp[-1].objectPtr; smiCheckObjectReuse(thisParserPtr, yyvsp[-13].id, &objectPtr); objectPtr = setObjectName(objectPtr, yyvsp[-13].id, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_OBJECTIDENTITY); setObjectLine(objectPtr, thisParserPtr->firstStatementLine, thisParserPtr); setObjectStatus(objectPtr, yyvsp[-8].status); setObjectDescription(objectPtr, yyvsp[-6].text, thisParserPtr); if (yyvsp[-4].text) { setObjectReference(objectPtr, yyvsp[-4].text, thisParserPtr); } addObjectFlags(objectPtr, FLAG_REGISTERED); deleteObjectFlags(objectPtr, FLAG_INCOMPLETE); yyval.err = 0; ; break;} case 129: #line 2809 "parser-smi.y" { thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_OBJECTTYPE; checkNameLen(thisParserPtr, yyvsp[0].id, ERR_OIDNAME_32, ERR_OIDNAME_64); smiCheckObjectName(thisParserPtr, thisModulePtr, yyvsp[0].id); ; break;} case 130: #line 2819 "parser-smi.y" { Import *importPtr; importPtr = findImportByName("OBJECT-TYPE", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "OBJECT-TYPE", "SNMPv2-SMI"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "OBJECT-TYPE", "COPS-PR-SPPI"); } else { smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "OBJECT-TYPE", "RFC-1212"); } } indexFlag = 0; ; break;} case 131: #line 2859 "parser-smi.y" { Object *objectPtr, *parentPtr; Type *typePtr = NULL; objectPtr = yyvsp[-1].objectPtr; smiCheckObjectReuse(thisParserPtr, yyvsp[-22].id, &objectPtr); objectPtr = setObjectName(objectPtr, yyvsp[-22].id, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_OBJECTTYPE); setObjectLine(objectPtr, thisParserPtr->firstStatementLine, thisParserPtr); if (checkObjectFlags(objectPtr, FLAG_SEQTYPE)) { deleteObjectFlags(objectPtr, FLAG_SEQTYPE); if (yyvsp[-17].typePtr) { if (yyvsp[-17].typePtr->export.name) { typePtr = yyvsp[-17].typePtr; /* * According to RFC 3159 7.1.3. Opaque must not be used * in a SYNTAX clause. */ if ((thisModulePtr->export.language == SMI_LANGUAGE_SPPI) && !strcmp(typePtr->export.name, "Opaque")) smiPrintError(thisParserPtr, ERR_OPAQUE_IN_SYNTAX); /* * According to RFC 3159 7.1.4. IpAddress must not be used * in a SYNTAX clause. */ if ((thisModulePtr->export.language == SMI_LANGUAGE_SPPI) && !strcmp(typePtr->export.name, "IpAddress")) smiPrintError(thisParserPtr, ERR_IPADDRESS_IN_SYNTAX); } else { typePtr = yyvsp[-17].typePtr->parentPtr; } if ((objectPtr->typePtr != typePtr) && ((objectPtr->typePtr->export.basetype != SMI_BASETYPE_INTEGER32) || (typePtr->export.basetype != SMI_BASETYPE_ENUM)) && ((objectPtr->typePtr->export.basetype != SMI_BASETYPE_OCTETSTRING) || (typePtr->export.basetype != SMI_BASETYPE_BITS))) { smiPrintError(thisParserPtr, ERR_SEQUENCE_TYPE_MISMATCH, objectPtr->export.name); } } } setObjectType(objectPtr, yyvsp[-17].typePtr); if (!(yyvsp[-17].typePtr->export.name)) { /* * An inlined type. */ #if 0 /* export implicitly defined types by the node's lowercase name */ setTypeName(yyvsp[-17].typePtr, yyvsp[-22].id); #endif } setObjectUnits(objectPtr, yyvsp[-16].text); setObjectAccess(objectPtr, yyvsp[-15].access); if (thisParserPtr->flags & FLAG_CREATABLE) { thisParserPtr->flags &= ~FLAG_CREATABLE; parentPtr = objectPtr->nodePtr->parentPtr->lastObjectPtr; if (parentPtr && parentPtr->export.indexkind != SMI_INDEX_UNKNOWN) { /* * add objectPtr to the parent object's * listPtr, which is the list of columns * needed for row creation. * * Note, that this would clash, if the * parent row object-type is not yet * defined. */ /* newlistPtr = smiMalloc(sizeof(List)); newlistPtr->nextPtr = NULL; newlistPtr->ptr = objectPtr; */ /* * Look up the parent object-type. */ /* if (parentPtr->listPtr) { for(listPtr = parentPtr->listPtr; listPtr->nextPtr; listPtr = listPtr->nextPtr); listPtr->nextPtr = newlistPtr; } else { parentPtr->listPtr = newlistPtr; } */ addObjectFlags(parentPtr, FLAG_CREATABLE); setObjectCreate(parentPtr, 1); } else { smiPrintError(thisParserPtr, ERR_SCALAR_READCREATE); } } setObjectStatus(objectPtr, yyvsp[-11].status); addObjectFlags(objectPtr, FLAG_REGISTERED); deleteObjectFlags(objectPtr, FLAG_INCOMPLETE); if (yyvsp[-10].text) { setObjectDescription(objectPtr, yyvsp[-10].text, thisParserPtr); } if (yyvsp[-8].text) { setObjectReference(objectPtr, yyvsp[-8].text, thisParserPtr); } if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) { /* * For SMI documents either $16 (IndexPart) or $17 (MibIndex) * are used, but not both. This is signalled via the indexFlag * which is 1 if IndexPart has been used. */ if (indexFlag == INDEXFLAG_AUGMENTS) { /* IndexPart was used */ if (yyvsp[-7].index.indexkind != SMI_INDEX_UNKNOWN) { setObjectList(objectPtr, yyvsp[-7].index.listPtr); setObjectImplied(objectPtr, yyvsp[-7].index.implied); setObjectIndexkind(objectPtr, yyvsp[-7].index.indexkind); setObjectRelated(objectPtr, yyvsp[-7].index.rowPtr); } } else { if (yyvsp[-6].index.indexkind != SMI_INDEX_UNKNOWN) { setObjectList(objectPtr, yyvsp[-6].index.listPtr); setObjectImplied(objectPtr, yyvsp[-6].index.implied); setObjectIndexkind(objectPtr, yyvsp[-6].index.indexkind); setObjectRelated(objectPtr, yyvsp[-6].index.rowPtr); } } } else { /* * PIBs contain either PIB-INDEX or AUGMENTS or EXTENDS - * but only with one Index entry. A PIB-INDEX may be * followed by a full INDEX. We get the indexkind * from the first. * Note that PIB-INDEX/AUGMENTS/EXTENS is always * the first element in objectPtr->listPtr. * If an optional INDEX exists then it is * appended to this list. */ if (yyvsp[-7].index.indexkind != SMI_INDEX_UNKNOWN) { setObjectList(objectPtr, yyvsp[-7].index.listPtr); setObjectIndexkind(objectPtr, yyvsp[-7].index.indexkind); setObjectRelated(objectPtr, yyvsp[-7].index.rowPtr); } if (yyvsp[-6].index.indexkind != SMI_INDEX_UNKNOWN) { if (objectPtr->listPtr) { List *p; for (p = objectPtr->listPtr; p->nextPtr; p = p->nextPtr); p->nextPtr = yyvsp[-6].index.listPtr; } setObjectImplied(objectPtr, yyvsp[-6].index.implied); } } if (yyvsp[-5].listPtr) { setObjectUniqueness(objectPtr, yyvsp[-5].listPtr); } if (yyvsp[-4].valuePtr) { if (objectPtr->typePtr && (((objectPtr->typePtr->export.basetype == SMI_BASETYPE_OCTETSTRING) && (yyvsp[-4].valuePtr->basetype != SMI_BASETYPE_OCTETSTRING)) || ((objectPtr->typePtr->export.basetype == SMI_BASETYPE_OBJECTIDENTIFIER) && (yyvsp[-4].valuePtr->basetype != SMI_BASETYPE_OBJECTIDENTIFIER)))) { smiPrintError(thisParserPtr, ERR_DEFVAL_SYNTAX); if (yyvsp[-4].valuePtr->basetype == SMI_BASETYPE_OBJECTIDENTIFIER) { smiFree(yyvsp[-4].valuePtr->value.oid); } if ((yyvsp[-4].valuePtr->basetype == SMI_BASETYPE_BITS) || (yyvsp[-4].valuePtr->basetype == SMI_BASETYPE_OCTETSTRING)) { smiFree(yyvsp[-4].valuePtr->value.ptr); } smiFree(yyvsp[-4].valuePtr); } else { setObjectValue(objectPtr, yyvsp[-4].valuePtr); } } if (yyvsp[-14].objectPtr) { if (objectPtr->relatedPtr) smiPrintError(thisParserPtr, ERR_OBJECTPTR_ELEMENT_IN_USE, "relatedPtr", "PIB-REFERENCES"); /* * PIB-REFERENCES clauses are only allowed for * objects with a SYNTAX of 'ReferenceId'. * See RFC 3159 7.10 */ if (objectPtr->typePtr && objectPtr->typePtr->export.name && strcmp(objectPtr->typePtr->export.name, "ReferenceId")) smiPrintErrorAtLine(parserPtr, ERR_PIB_REFERENCES_WRONG_TYPE, objectPtr->line); else setObjectRelated(objectPtr, yyvsp[-14].objectPtr); } else { /* * Does this object have a SYNTAX of 'ReferenceId' * and a PIB-REFERENCES clause? * See RFC 3159 7.10 */ if ((thisModulePtr->export.language == SMI_LANGUAGE_SPPI) && objectPtr->typePtr && objectPtr->typePtr->export.name && !strcmp(objectPtr->typePtr->export.name, "ReferenceId")) smiPrintErrorAtLine(parserPtr, ERR_LACKING_PIB_REFERENCES, objectPtr->line); } if (yyvsp[-13].objectPtr) { if (objectPtr->relatedPtr) smiPrintError(thisParserPtr, ERR_OBJECTPTR_ELEMENT_IN_USE, "relatedPtr", "PIB-TAG"); /* * PIB-TAG clauses are only allowed for * objects with a SYNTAX of 'TagReferenceId'. * See RFC 3159 7.11 */ if (objectPtr->typePtr && objectPtr->typePtr->export.name && strcmp(objectPtr->typePtr->export.name, "TagReferenceId")) smiPrintErrorAtLine(parserPtr, ERR_PIB_TAG_WRONG_TYPE, objectPtr->line); else setObjectRelated(objectPtr, yyvsp[-13].objectPtr); } else { /* * Does this object have a SYNTAX of 'TagReferenceId' * and a PIB-TAG clause? * See RFC 3159 7.11 */ if ((thisModulePtr->export.language == SMI_LANGUAGE_SPPI) && objectPtr->typePtr && objectPtr->typePtr->export.name && !strcmp(objectPtr->typePtr->export.name, "TagReferenceId")) smiPrintErrorAtLine(parserPtr, ERR_LACKING_PIB_TAG, objectPtr->line); } if (yyvsp[-9].listPtr) { if (objectPtr->listPtr) smiPrintError(thisParserPtr, ERR_OBJECTPTR_ELEMENT_IN_USE, "listPtr", "INSTALL-ERRORS"); /* * Are INSTALL-ERRORS only used with tables? * See RFC 3159 7.4 */ if (!((objectPtr->export.decl == SMI_DECL_OBJECTTYPE) && (objectPtr->typePtr) && (objectPtr->typePtr->export.decl == SMI_DECL_IMPL_SEQUENCEOF))) smiPrintErrorAtLine(parserPtr, ERR_INSTALL_ERRORS_FOR_NON_TABLE, objectPtr->line); else setObjectList(objectPtr, yyvsp[-9].listPtr); } yyval.err = 0; ; break;} case 132: #line 3115 "parser-smi.y" { if ((thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) || (thisModulePtr->export.language == SMI_LANGUAGE_SPPI)) { smiPrintError(thisParserPtr, ERR_MISSING_DESCRIPTION); } yyval.text = NULL; ; break;} case 133: #line 3125 "parser-smi.y" { yyval.text = yyvsp[0].text; checkDescr(thisParserPtr, yyvsp[0].text); ; break;} case 134: #line 3132 "parser-smi.y" { thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_TRAPTYPE; checkNameLen(thisParserPtr, yyvsp[0].id, ERR_OIDNAME_32, ERR_OIDNAME_64); smiCheckObjectName(thisParserPtr, thisModulePtr, yyvsp[0].id); ; break;} case 135: #line 3142 "parser-smi.y" { Import *importPtr; if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "TRAP-TYPE"); if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_TRAP_TYPE); } importPtr = findImportByName("TRAP-TYPE", thisModulePtr); if (importPtr) { importPtr->use++; } else { smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "TRAP-TYPE", "RFC-1215"); } ; break;} case 136: #line 3168 "parser-smi.y" { Object *objectPtr; Node *nodePtr; objectPtr = yyvsp[-5].objectPtr; nodePtr = findNodeByParentAndSubid( objectPtr->nodePtr, 0); if (nodePtr && nodePtr->lastObjectPtr && (nodePtr->lastObjectPtr->modulePtr == thisModulePtr)) { /* * hopefully, the last defined Object for * this Node is the one we expect. */ objectPtr = nodePtr->lastObjectPtr; } else { objectPtr = addObject(NULL, objectPtr->nodePtr, 0, FLAG_INCOMPLETE, thisParserPtr); } objectPtr = addObject(NULL, objectPtr->nodePtr, yyvsp[0].unsigned32, FLAG_INCOMPLETE, thisParserPtr); smiCheckObjectReuse(thisParserPtr, yyvsp[-10].id, &objectPtr); objectPtr = setObjectName(objectPtr, yyvsp[-10].id, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_TRAPTYPE); setObjectLine(objectPtr, thisParserPtr->firstStatementLine, thisParserPtr); addObjectFlags(objectPtr, FLAG_REGISTERED); deleteObjectFlags(objectPtr, FLAG_INCOMPLETE); setObjectList(objectPtr, yyvsp[-4].listPtr); setObjectStatus(objectPtr, SMI_STATUS_CURRENT); setObjectDescription(objectPtr, yyvsp[-3].text, thisParserPtr); if (yyvsp[-2].text) { setObjectReference(objectPtr, yyvsp[-2].text, thisParserPtr); } yyval.err = 0; ; break;} case 137: #line 3215 "parser-smi.y" { yyval.listPtr = yyvsp[-1].listPtr; ; break;} case 138: #line 3219 "parser-smi.y" { yyval.listPtr = NULL; ; break;} case 139: #line 3225 "parser-smi.y" { if (yyvsp[0].objectPtr) { yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].objectPtr; yyval.listPtr->nextPtr = NULL; } else { yyval.listPtr = NULL; } ; break;} case 140: #line 3235 "parser-smi.y" { List *p, *pp; if (yyvsp[0].objectPtr) { p = smiMalloc(sizeof(List)); p->ptr = yyvsp[0].objectPtr; p->nextPtr = NULL; if (yyvsp[-2].listPtr) { for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; } else { yyval.listPtr = p; } } else { yyval.listPtr = yyvsp[-2].listPtr; } ; break;} case 141: #line 3257 "parser-smi.y" { yyval.objectPtr = yyvsp[0].objectPtr; ; break;} case 142: #line 3263 "parser-smi.y" { yyval.text = yyvsp[0].text; checkDescr(thisParserPtr, yyvsp[0].text); ; break;} case 143: #line 3268 "parser-smi.y" { yyval.text = NULL; ; break;} case 144: #line 3272 "parser-smi.y" { yyval.access = yyvsp[0].access; ; break;} case 145: #line 3276 "parser-smi.y" { if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "MAX-ACCESS"); if (yyvsp[0].access == SMI_ACCESS_NOT_ACCESSIBLE) smiPrintError(thisParserPtr, ERR_NOT_ACCESSIBLE_IN_PIB_ACCESS); yyval.access = yyvsp[0].access; ; break;} case 146: #line 3284 "parser-smi.y" { yyval.access = 0; ; break;} case 147: #line 3288 "parser-smi.y" { yyval.access = yyvsp[0].access; ; break;} case 148: #line 3292 "parser-smi.y" { smiPrintError(thisParserPtr, ERR_POLICY_ACCESS_IN_PIB); ; break;} case 149: #line 3296 "parser-smi.y" { ; break;} case 150: #line 3300 "parser-smi.y" { if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "PIB-REFERENCES"); ; break;} case 151: #line 3305 "parser-smi.y" { yyval.objectPtr = yyvsp[-1].objectPtr; ; break;} case 152: #line 3307 "parser-smi.y" { yyval.objectPtr = 0; ; break;} case 153: #line 3311 "parser-smi.y" { if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "PIB-TAG"); ; break;} case 154: #line 3316 "parser-smi.y" { yyval.objectPtr = yyvsp[-1].objectPtr; ; break;} case 155: #line 3318 "parser-smi.y" { yyval.objectPtr = 0; ; break;} case 156: #line 3323 "parser-smi.y" { if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "UNIQUENESS"); ; break;} case 157: #line 3328 "parser-smi.y" { yyval.listPtr = yyvsp[-1].listPtr; ; break;} case 158: #line 3330 "parser-smi.y" { yyval.listPtr = NULL; ; break;} case 159: #line 3334 "parser-smi.y" { yyval.listPtr = yyvsp[0].listPtr; ; break;} case 160: #line 3336 "parser-smi.y" { yyval.listPtr = NULL; ; break;} case 161: #line 3340 "parser-smi.y" { yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].objectPtr; yyval.listPtr->nextPtr = NULL; ; break;} case 162: #line 3347 "parser-smi.y" { List *p, *pp; p = smiMalloc(sizeof(List)); p->ptr = yyvsp[0].objectPtr; p->nextPtr = NULL; for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; ; break;} case 163: #line 3360 "parser-smi.y" { yyval.objectPtr = yyvsp[0].objectPtr; ; break;} case 164: #line 3364 "parser-smi.y" { if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "INSTALL-ERRORS"); ; break;} case 165: #line 3369 "parser-smi.y" { yyval.listPtr = yyvsp[-1].listPtr; ; break;} case 166: #line 3371 "parser-smi.y" { yyval.listPtr = NULL; ; break;} case 167: #line 3375 "parser-smi.y" { yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].objectPtr; yyval.listPtr->nextPtr = NULL; ; break;} case 168: #line 3382 "parser-smi.y" { List *p, *pp; p = smiMalloc(sizeof(List)); p->ptr = yyvsp[0].objectPtr; p->nextPtr = NULL; for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; ; break;} case 169: #line 3395 "parser-smi.y" { Object *objectPtr; if ((yyvsp[-1].unsigned32 < 1) || (yyvsp[-1].unsigned32 > 65536)) smiPrintError(thisParserPtr, ERR_ERROR_NUMBER_RANGE, yyvsp[-1].unsigned32); /* * This is not a regular object that will be added vid * 'addObject' as error identifier have no other * meaning in PIBs. They are just used for * a direct mapping to the actual protocol fields. */ objectPtr = smiMalloc(sizeof(Object)); objectPtr->export.name = yyvsp[-3].id; objectPtr->export.oidlen = 1; objectPtr->export.oid = (void *)yyvsp[-1].unsigned32; yyval.objectPtr = objectPtr; ; break;} case 170: #line 3416 "parser-smi.y" { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV1) { smiPrintError(thisParserPtr, ERR_MAX_ACCESS_IN_SMIV1); } else if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "MAX-ACCESS"); ; break;} case 171: #line 3425 "parser-smi.y" { yyval.access = yyvsp[0].access; ; break;} case 172: #line 3427 "parser-smi.y" { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_ACCESS_IN_SMIV2); } else if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "ACCESS"); ; break;} case 173: #line 3436 "parser-smi.y" { yyval.access = yyvsp[0].access; ; break;} case 174: #line 3440 "parser-smi.y" { thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_NOTIFICATIONTYPE; checkNameLen(thisParserPtr, yyvsp[0].id, ERR_OIDNAME_32, ERR_OIDNAME_64); smiCheckObjectName(thisParserPtr, thisModulePtr, yyvsp[0].id); ; break;} case 175: #line 3450 "parser-smi.y" { Import *importPtr; if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "NOTIFICATION-TYPE"); importPtr = findImportByName("NOTIFICATION-TYPE", thisModulePtr); if (importPtr) { importPtr->use++; } else { smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "NOTIFICATION-TYPE", "SNMPv2-SMI"); } ; break;} case 176: #line 3470 "parser-smi.y" { checkDescr(thisParserPtr, yyvsp[0].text); ; break;} case 177: #line 3476 "parser-smi.y" { Object *objectPtr; objectPtr = yyvsp[-1].objectPtr; smiCheckObjectReuse(thisParserPtr, yyvsp[-14].id, &objectPtr); objectPtr = setObjectName(objectPtr, yyvsp[-14].id, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_NOTIFICATIONTYPE); setObjectLine(objectPtr, thisParserPtr->firstStatementLine, thisParserPtr); addObjectFlags(objectPtr, FLAG_REGISTERED); deleteObjectFlags(objectPtr, FLAG_INCOMPLETE); setObjectList(objectPtr, yyvsp[-10].listPtr); setObjectStatus(objectPtr, yyvsp[-8].status); setObjectDescription(objectPtr, yyvsp[-6].text, thisParserPtr); if (yyvsp[-4].text) { setObjectReference(objectPtr, yyvsp[-4].text, thisParserPtr); } yyval.err = 0; ; break;} case 178: #line 3501 "parser-smi.y" { thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_MODULEIDENTITY; checkNameLen(thisParserPtr, yyvsp[0].id, ERR_OIDNAME_32, ERR_OIDNAME_64); smiCheckObjectName(thisParserPtr, thisModulePtr, yyvsp[0].id); ; break;} case 179: #line 3511 "parser-smi.y" { Import *importPtr; importPtr = findImportByName("MODULE-IDENTITY", thisModulePtr); if (importPtr) { importPtr->use++; } else { smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "MODULE-IDENTITY", "SNMPv2-SMI"); } if (thisParserPtr->modulePtr->numModuleIdentities > 0) { smiPrintError(thisParserPtr, ERR_TOO_MANY_MODULE_IDENTITIES); } if (thisParserPtr->modulePtr->numStatements > 0) { smiPrintError(thisParserPtr, ERR_MODULE_IDENTITY_NOT_FIRST); } ; break;} case 180: #line 3536 "parser-smi.y" { /* do nothing at the moment */ ; break;} case 181: #line 3540 "parser-smi.y" { setModuleLastUpdated(thisParserPtr->modulePtr, yyvsp[0].date); ; break;} case 182: #line 3544 "parser-smi.y" { if (yyvsp[0].text && !strlen(yyvsp[0].text)) { smiPrintError(thisParserPtr, ERR_EMPTY_ORGANIZATION); } ; break;} case 183: #line 3551 "parser-smi.y" { if (yyvsp[0].text && !strlen(yyvsp[0].text)) { smiPrintError(thisParserPtr, ERR_EMPTY_CONTACT); } ; break;} case 184: #line 3558 "parser-smi.y" { checkDescr(thisParserPtr, yyvsp[0].text); ; break;} case 185: #line 3562 "parser-smi.y" { if ((!thisModulePtr->firstRevisionPtr) || (thisModulePtr->firstRevisionPtr->export.date != thisModulePtr->lastUpdated)) { smiPrintError(thisParserPtr, ERR_REVISION_MISSING); addRevision(thisModulePtr->lastUpdated, smiStrdup( "[Revision added by libsmi due to a LAST-UPDATED clause.]"), thisParserPtr); } ; break;} case 186: #line 3576 "parser-smi.y" { Object *objectPtr; objectPtr = yyvsp[-1].objectPtr; smiCheckObjectReuse(thisParserPtr, yyvsp[-23].id, &objectPtr); thisParserPtr->modulePtr->numModuleIdentities++; objectPtr = setObjectName(objectPtr, yyvsp[-23].id, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_MODULEIDENTITY); setObjectLine(objectPtr, thisParserPtr->firstStatementLine, thisParserPtr); setObjectStatus(objectPtr, SMI_STATUS_CURRENT); addObjectFlags(objectPtr, FLAG_REGISTERED); deleteObjectFlags(objectPtr, FLAG_INCOMPLETE); setModuleIdentityObject(thisParserPtr->modulePtr, objectPtr); setModuleOrganization(thisParserPtr->modulePtr, yyvsp[-13].text); setModuleContactInfo(thisParserPtr->modulePtr, yyvsp[-10].text); setModuleDescription(thisParserPtr->modulePtr, yyvsp[-7].text, thisParserPtr); if (yyvsp[-19].subjectCategoriesPtr != NULL) { setObjectList(objectPtr, yyvsp[-19].subjectCategoriesPtr->categories); smiFree(yyvsp[-19].subjectCategoriesPtr); } /* setObjectDescription(objectPtr, $15); */ yyval.err = 0; ; break;} case 187: #line 3609 "parser-smi.y" { if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "SUBJECT-CATEGORIES"); yyval.subjectCategoriesPtr = yyvsp[-1].subjectCategoriesPtr; ; break;} case 188: #line 3615 "parser-smi.y" { if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SUBJECT_CATEGORIES_MISSING); yyval.subjectCategoriesPtr = NULL; ; break;} case 189: #line 3623 "parser-smi.y" { yyval.subjectCategoriesPtr = smiMalloc(sizeof(SubjectCategories)); yyval.subjectCategoriesPtr->categories = yyvsp[0].listPtr; ; break;} case 190: #line 3630 "parser-smi.y" { yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].objectPtr; yyval.listPtr->nextPtr = NULL; ; break;} case 191: #line 3636 "parser-smi.y" { List *p, *pp; if (yyvsp[-2].listPtr->ptr == NULL) smiPrintError(thisParserPtr, ERR_SUBJECT_CATEGORIES_ALL); p = smiMalloc(sizeof(List)); p->ptr = (void *)yyvsp[0].objectPtr; p->nextPtr = NULL; for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; ; break;} case 192: #line 3651 "parser-smi.y" { Object *objectPtr; if (strcmp(yyvsp[0].id, "all")) smiPrintError(thisParserPtr, ERR_SUBJECT_CATEGORIES_MISSING_SUBID); else { /* * This is not a regular object that will be added via * 'addObject' as subject category dentifier have no * other meaning in PIBs. They are just used for * a direct mapping to the actual protocol fields. */ objectPtr = smiMalloc(sizeof(Object)); objectPtr->export.name = "all"; objectPtr->export.oidlen = 0; objectPtr->export.oid = 0; yyval.objectPtr = objectPtr; } smiFree(yyvsp[0].id); ; break;} case 193: #line 3672 "parser-smi.y" { Object *objectPtr; if (!strcmp(yyvsp[-3].id, "all")) { smiPrintError(thisParserPtr, ERR_SUBJECT_CATEGORIES_ALL_WITH_SUBID); yyval.objectPtr = NULL; } else { /* * This is not a regular object that will be added via * 'addObject' as subject category dentifier have no * other meaning in PIBs. They are just used for * a direct mapping to the actual protocol fields. */ objectPtr = smiMalloc(sizeof(Object)); objectPtr->export.name = yyvsp[-3].id; objectPtr->export.oidlen = 1; objectPtr->export.oid = (void *)yyvsp[-1].unsigned32; yyval.objectPtr = objectPtr; } ; break;} case 194: #line 3695 "parser-smi.y" { yyval.typePtr = yyvsp[0].typePtr; ; break;} case 195: #line 3699 "parser-smi.y" { if (strcmp(thisParserPtr->modulePtr->export.name, "SNMPv2-SMI") && strcmp(thisParserPtr->modulePtr->export.name, "SNMPv2-TC") && strcmp(thisParserPtr->modulePtr->export.name, "SNMPv2-CONF") && strcmp(thisParserPtr->modulePtr->export.name, "RFC-1212") && strcmp(thisParserPtr->modulePtr->export.name, "RFC1065-SMI") && strcmp(thisParserPtr->modulePtr->export.name, "RFC1155-SMI") && strcmp(thisParserPtr->modulePtr->export.name, "COPS-PR-SPPI")) { smiPrintError(thisParserPtr, ERR_TYPE_TAG, yyvsp[-1].err); } yyval.typePtr = yyvsp[0].typePtr; ; break;} case 196: #line 3719 "parser-smi.y" { /* TODO */ yyval.typePtr = yyvsp[0].typePtr; ; break;} case 197: #line 3724 "parser-smi.y" { /* TODO */ yyval.typePtr = yyvsp[0].typePtr; ; break;} case 198: #line 3729 "parser-smi.y" { /* TODO */ yyval.typePtr = yyvsp[0].typePtr; ; break;} case 199: #line 3734 "parser-smi.y" { Import *importPtr; if (yyvsp[0].typePtr && yyvsp[0].typePtr->export.name) { importPtr = findImportByName(yyvsp[0].typePtr->export.name, thisModulePtr); if (importPtr) { importPtr->use++; } } /* TODO */ yyval.typePtr = yyvsp[0].typePtr; ; break;} case 200: #line 3751 "parser-smi.y" { yyval.err = 0; /* TODO: check range */ ; break;} case 201: #line 3753 "parser-smi.y" { yyval.err = 0; /* TODO: check range */ ; break;} case 202: #line 3761 "parser-smi.y" { yyval.typePtr = yyvsp[0].typePtr; ; break;} case 203: #line 3766 "parser-smi.y" { Import *importPtr; if (yyvsp[0].typePtr && yyvsp[0].typePtr->export.name) { importPtr = findImportByName(yyvsp[0].typePtr->export.name, thisModulePtr); if (importPtr) { importPtr->use++; } } /* TODO */ yyval.typePtr = yyvsp[0].typePtr; ; break;} case 204: #line 3783 "parser-smi.y" { yyval.valuePtr = yyvsp[0].valuePtr; ; break;} case 205: #line 3792 "parser-smi.y" { if ((thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) && (strcmp(thisModulePtr->export.name, "SNMPv2-SMI") && strcmp(thisModulePtr->export.name, "SNMPv2-TC") && strcmp(thisModulePtr->export.name, "COPS-PR-SPPI"))) smiPrintError(thisParserPtr, ERR_INTEGER_IN_SMIV2); defaultBasetype = SMI_BASETYPE_INTEGER32; yyval.typePtr = smiHandle->typeInteger32Ptr; ; break;} case 206: #line 3805 "parser-smi.y" { defaultBasetype = SMI_BASETYPE_INTEGER32; ; break;} case 207: #line 3809 "parser-smi.y" { if ((thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) && (strcmp(thisModulePtr->export.name, "SNMPv2-SMI") && strcmp(thisModulePtr->export.name, "SNMPv2-TC") && strcmp(thisModulePtr->export.name, "COPS-PR-SPPI"))) smiPrintError(thisParserPtr, ERR_INTEGER_IN_SMIV2); yyval.typePtr = duplicateType(smiHandle->typeInteger32Ptr, 0, thisParserPtr); setTypeList(yyval.typePtr, yyvsp[0].listPtr); smiCheckTypeRanges(thisParserPtr, yyval.typePtr); ; break;} case 208: #line 3824 "parser-smi.y" { defaultBasetype = SMI_BASETYPE_ENUM; ; break;} case 209: #line 3828 "parser-smi.y" { List *p; yyval.typePtr = duplicateType(smiHandle->typeEnumPtr, 0, thisParserPtr); setTypeList(yyval.typePtr, yyvsp[0].listPtr); for (p = yyvsp[0].listPtr; p; p = p->nextPtr) ((NamedNumber *)p->ptr)->typePtr = yyval.typePtr; smiCheckNamedNumbersOrder(parserPtr, yyval.typePtr); ; break;} case 210: #line 3839 "parser-smi.y" { Import *importPtr; defaultBasetype = SMI_BASETYPE_INTEGER32; importPtr = findImportByName("Integer32", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Integer32"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Integer32"); } } /* TODO: any need to distinguish from INTEGER? */ yyval.typePtr = smiHandle->typeInteger32Ptr; ; break;} case 211: #line 3865 "parser-smi.y" { defaultBasetype = SMI_BASETYPE_INTEGER32; ; break;} case 212: #line 3869 "parser-smi.y" { Import *importPtr; importPtr = findImportByName("Integer32", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Integer32"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Integer32"); } } yyval.typePtr = duplicateType(smiHandle->typeInteger32Ptr, 0, thisParserPtr); setTypeList(yyval.typePtr, yyvsp[0].listPtr); smiCheckTypeRanges(thisParserPtr, yyval.typePtr); ; break;} case 213: #line 3896 "parser-smi.y" { defaultBasetype = SMI_BASETYPE_ENUM; ; break;} case 214: #line 3900 "parser-smi.y" { Type *parentPtr; Import *importPtr; List *p; parentPtr = findTypeByModuleAndName( thisParserPtr->modulePtr, yyvsp[-2].id); if (!parentPtr) { importPtr = findImportByName(yyvsp[-2].id, thisModulePtr); if (importPtr && importPtr->kind == KIND_TYPE) { importPtr->use++; parentPtr = findTypeByModulenameAndName( importPtr->export.module, yyvsp[-2].id); } } if (parentPtr) { if ((parentPtr->export.basetype != SMI_BASETYPE_ENUM) && (parentPtr->export.basetype != SMI_BASETYPE_BITS)) { smiPrintError(thisParserPtr, ERR_ILLEGAL_ENUM_FOR_PARENT_TYPE, yyvsp[-2].id); yyval.typePtr = duplicateType(smiHandle->typeEnumPtr, 0, thisParserPtr); } else { yyval.typePtr = duplicateType(parentPtr, 0, thisParserPtr); } smiFree(yyvsp[-2].id); } else { /* * forward referenced type. create it, * marked with FLAG_INCOMPLETE. */ parentPtr = addType(yyvsp[-2].id, SMI_BASETYPE_UNKNOWN, FLAG_INCOMPLETE, thisParserPtr); yyval.typePtr = duplicateType(parentPtr, 0, thisParserPtr); } setTypeList(yyval.typePtr, yyvsp[0].listPtr); for (p = yyvsp[0].listPtr; p; p = p->nextPtr) ((NamedNumber *)p->ptr)->typePtr = yyval.typePtr; smiCheckNamedNumbersOrder(parserPtr, yyval.typePtr); ; break;} case 215: #line 3951 "parser-smi.y" { Type *parentPtr; Import *importPtr; List *p; defaultBasetype = SMI_BASETYPE_ENUM; parentPtr = findTypeByModulenameAndName(yyvsp[-3].id, yyvsp[-1].id); if (!parentPtr) { importPtr = findImportByModulenameAndName(yyvsp[-3].id, yyvsp[-1].id, thisModulePtr); if (importPtr && importPtr->kind == KIND_TYPE) { importPtr->use++; parentPtr = findTypeByModulenameAndName(yyvsp[-3].id, yyvsp[-1].id); } } if (parentPtr) { if ((parentPtr->export.basetype != SMI_BASETYPE_ENUM) && (parentPtr->export.basetype != SMI_BASETYPE_BITS)) { smiPrintError(thisParserPtr, ERR_ILLEGAL_ENUM_FOR_PARENT_TYPE, yyvsp[-1].id); yyval.typePtr = duplicateType(smiHandle->typeEnumPtr, 0, thisParserPtr); } else { yyval.typePtr = duplicateType(parentPtr, 0, thisParserPtr); } } else { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, yyvsp[-1].id); yyval.typePtr = duplicateType(smiHandle->typeEnumPtr, 0, thisParserPtr); } setTypeList(yyval.typePtr, yyvsp[0].listPtr); for (p = yyvsp[0].listPtr; p; p = p->nextPtr) ((NamedNumber *)p->ptr)->typePtr = yyval.typePtr; smiCheckNamedNumbersOrder(parserPtr, yyval.typePtr); smiFree(yyvsp[-3].id); smiFree(yyvsp[-1].id); ; break;} case 216: #line 3997 "parser-smi.y" { Type *parentPtr; Import *importPtr; parentPtr = findTypeByModuleAndName( thisParserPtr->modulePtr, yyvsp[-1].id); if (!parentPtr) { importPtr = findImportByName(yyvsp[-1].id, thisModulePtr); if (importPtr && importPtr->kind == KIND_TYPE) { importPtr->use++; parentPtr = findTypeByModulenameAndName( importPtr->export.module, yyvsp[-1].id); } } if (parentPtr) { if ((parentPtr->export.basetype != SMI_BASETYPE_INTEGER32) && (parentPtr->export.basetype != SMI_BASETYPE_INTEGER64) && (parentPtr->export.basetype != SMI_BASETYPE_UNSIGNED32) && (parentPtr->export.basetype != SMI_BASETYPE_UNSIGNED64)) { smiPrintError(thisParserPtr, ERR_ILLEGAL_RANGE_FOR_PARENT_TYPE, yyvsp[-1].id); yyval.typePtr = duplicateType(smiHandle->typeInteger32Ptr, 0, thisParserPtr); defaultBasetype = SMI_BASETYPE_INTEGER32; } else { defaultBasetype = parentPtr->export.basetype; yyval.typePtr = duplicateType(parentPtr, 0, thisParserPtr); } smiFree(yyvsp[-1].id); } else { /* * forward referenced type. create it, * marked with FLAG_INCOMPLETE. */ parentPtr = addType(yyvsp[-1].id, SMI_BASETYPE_UNKNOWN, FLAG_INCOMPLETE, thisParserPtr); yyval.typePtr = duplicateType(parentPtr, 0, thisParserPtr); defaultBasetype = SMI_BASETYPE_INTEGER32; } setTypeList(yyval.typePtr, yyvsp[0].listPtr); smiCheckTypeRanges(thisParserPtr, yyval.typePtr); ; break;} case 217: #line 4053 "parser-smi.y" { Type *parentPtr; Import *importPtr; parentPtr = findTypeByModulenameAndName(yyvsp[-3].id, yyvsp[-1].id); if (!parentPtr) { importPtr = findImportByModulenameAndName(yyvsp[-3].id, yyvsp[-1].id, thisModulePtr); if (importPtr && importPtr->kind == KIND_TYPE) { importPtr->use++; parentPtr = findTypeByModulenameAndName( yyvsp[-3].id, yyvsp[-1].id); } } if (parentPtr) { if ((parentPtr->export.basetype != SMI_BASETYPE_INTEGER32) && (parentPtr->export.basetype != SMI_BASETYPE_INTEGER64) && (parentPtr->export.basetype != SMI_BASETYPE_UNSIGNED32) && (parentPtr->export.basetype != SMI_BASETYPE_UNSIGNED64)) { smiPrintError(thisParserPtr, ERR_ILLEGAL_RANGE_FOR_PARENT_TYPE, yyvsp[-1].id); yyval.typePtr = duplicateType(smiHandle->typeInteger32Ptr, 0, thisParserPtr); defaultBasetype = SMI_BASETYPE_INTEGER32; } else { defaultBasetype = parentPtr->export.basetype; yyval.typePtr = duplicateType(parentPtr, 0, thisParserPtr); } } else { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, yyvsp[-1].id); yyval.typePtr = duplicateType(smiHandle->typeInteger32Ptr, 0, thisParserPtr); defaultBasetype = SMI_BASETYPE_INTEGER32; } setTypeList(yyval.typePtr, yyvsp[0].listPtr); smiCheckTypeRanges(thisParserPtr, yyval.typePtr); smiFree(yyvsp[-3].id); smiFree(yyvsp[-1].id); ; break;} case 218: #line 4102 "parser-smi.y" { defaultBasetype = SMI_BASETYPE_OCTETSTRING; yyval.typePtr = smiHandle->typeOctetStringPtr; ; break;} case 219: #line 4107 "parser-smi.y" { defaultBasetype = SMI_BASETYPE_OCTETSTRING; ; break;} case 220: #line 4111 "parser-smi.y" { yyval.typePtr = duplicateType(smiHandle->typeOctetStringPtr, 0, thisParserPtr); setTypeList(yyval.typePtr, yyvsp[0].listPtr); smiCheckTypeRanges(thisParserPtr, yyval.typePtr); ; break;} case 221: #line 4119 "parser-smi.y" { Type *parentPtr; Import *importPtr; defaultBasetype = SMI_BASETYPE_OCTETSTRING; parentPtr = findTypeByModuleAndName( thisParserPtr->modulePtr, yyvsp[-1].id); if (!parentPtr) { importPtr = findImportByName(yyvsp[-1].id, thisModulePtr); if (importPtr && importPtr->kind == KIND_TYPE) { importPtr->use++; parentPtr = findTypeByModulenameAndName( importPtr->export.module, yyvsp[-1].id); } } if (parentPtr) { if (parentPtr->export.basetype != SMI_BASETYPE_OCTETSTRING) { smiPrintError(thisParserPtr, ERR_ILLEGAL_SIZE_FOR_PARENT_TYPE, yyvsp[-1].id); yyval.typePtr = duplicateType(smiHandle->typeOctetStringPtr, 0, thisParserPtr); } else { yyval.typePtr = duplicateType(parentPtr, 0, thisParserPtr); } smiFree(yyvsp[-1].id); } else { /* * forward referenced type. create it, * marked with FLAG_INCOMPLETE. */ parentPtr = addType(yyvsp[-1].id, SMI_BASETYPE_UNKNOWN, FLAG_INCOMPLETE, thisParserPtr); yyval.typePtr = duplicateType(parentPtr, 0, thisParserPtr); } setTypeList(yyval.typePtr, yyvsp[0].listPtr); smiCheckTypeRanges(thisParserPtr, yyval.typePtr); ; break;} case 222: #line 4166 "parser-smi.y" { Type *parentPtr; Import *importPtr; defaultBasetype = SMI_BASETYPE_OCTETSTRING; parentPtr = findTypeByModulenameAndName(yyvsp[-3].id, yyvsp[-1].id); if (!parentPtr) { importPtr = findImportByModulenameAndName(yyvsp[-3].id, yyvsp[-1].id, thisModulePtr); if (importPtr && importPtr->kind == KIND_TYPE) { importPtr->use++; parentPtr = findTypeByModulenameAndName( yyvsp[-3].id, yyvsp[-1].id); } } if (parentPtr) { if (parentPtr->export.basetype != SMI_BASETYPE_OCTETSTRING) { smiPrintError(thisParserPtr, ERR_ILLEGAL_SIZE_FOR_PARENT_TYPE, yyvsp[-1].id); yyval.typePtr = duplicateType(smiHandle->typeOctetStringPtr, 0, thisParserPtr); } else { yyval.typePtr = duplicateType(parentPtr, 0, thisParserPtr); } } else { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, yyvsp[-1].id); yyval.typePtr = duplicateType(smiHandle->typeOctetStringPtr, 0, thisParserPtr); } setTypeList(yyval.typePtr, yyvsp[0].listPtr); smiCheckTypeRanges(thisParserPtr, yyval.typePtr); smiFree(yyvsp[-3].id); smiFree(yyvsp[-1].id); ; break;} case 223: #line 4206 "parser-smi.y" { defaultBasetype = SMI_BASETYPE_OBJECTIDENTIFIER; yyval.typePtr = smiHandle->typeObjectIdentifierPtr; ; break;} case 224: #line 4214 "parser-smi.y" { yyval.valuePtr = smiMalloc(sizeof(SmiValue)); yyval.valuePtr->basetype = SMI_BASETYPE_UNSIGNED32; yyval.valuePtr->value.unsigned32 = yyvsp[0].unsigned32; ; break;} case 225: #line 4220 "parser-smi.y" { yyval.valuePtr = smiMalloc(sizeof(SmiValue)); yyval.valuePtr->basetype = SMI_BASETYPE_INTEGER32; yyval.valuePtr->value.integer32 = yyvsp[0].integer32; ; break;} case 226: #line 4226 "parser-smi.y" { /* The scanner already checks for the language */ yyval.valuePtr = smiMalloc(sizeof(SmiValue)); yyval.valuePtr->basetype = SMI_BASETYPE_UNSIGNED64; yyval.valuePtr->value.unsigned64 = yyvsp[0].unsigned64; ; break;} case 227: #line 4233 "parser-smi.y" { /* The scanner already checks for the language */ yyval.valuePtr = smiMalloc(sizeof(SmiValue)); yyval.valuePtr->basetype = SMI_BASETYPE_INTEGER64; yyval.valuePtr->value.integer64 = yyvsp[0].integer64; ; break;} case 228: #line 4240 "parser-smi.y" { char s[9]; int i, len, j; yyval.valuePtr = smiMalloc(sizeof(SmiValue)); if (defaultBasetype == SMI_BASETYPE_OCTETSTRING) { yyval.valuePtr->basetype = SMI_BASETYPE_OCTETSTRING; len = strlen(yyvsp[0].text); yyval.valuePtr->value.ptr = smiMalloc((len+7)/8+1); for (i = 0; i < len; i += 8) { strncpy(s, &yyvsp[0].text[i], 8); for (j = 1; j < 8; j++) { if (!s[j]) s[j] = '0'; } s[8] = 0; yyval.valuePtr->value.ptr[i/8] = (unsigned char)strtol(s, 0, 2); } yyval.valuePtr->len = (len+7)/8; } else { yyval.valuePtr->basetype = SMI_BASETYPE_UNSIGNED32; yyval.valuePtr->value.unsigned32 = strtoul(yyvsp[0].text, NULL, 2); } ; break;} case 229: #line 4266 "parser-smi.y" { char s[3]; int i, len; yyval.valuePtr = smiMalloc(sizeof(SmiValue)); if (defaultBasetype == SMI_BASETYPE_OCTETSTRING) { yyval.valuePtr->basetype = SMI_BASETYPE_OCTETSTRING; len = strlen(yyvsp[0].text); yyval.valuePtr->value.ptr = smiMalloc((len+1)/2+1); for (i = 0; i < len; i += 2) { strncpy(s, &yyvsp[0].text[i], 2); if (!s[1]) s[1] = '0'; s[2] = 0; yyval.valuePtr->value.ptr[i/2] = (unsigned char)strtol(s, 0, 16); } yyval.valuePtr->len = (len+1)/2; } else { yyval.valuePtr->basetype = SMI_BASETYPE_UNSIGNED32; yyval.valuePtr->value.unsigned32 = strtoul(yyvsp[0].text, NULL, 16); } ; break;} case 230: #line 4289 "parser-smi.y" { yyval.valuePtr = smiMalloc(sizeof(SmiValue)); if ((defaultBasetype != SMI_BASETYPE_ENUM) && (defaultBasetype != SMI_BASETYPE_OBJECTIDENTIFIER)) { smiPrintError(thisParserPtr, ERR_DEFVAL_SYNTAX); yyval.valuePtr->basetype = defaultBasetype; if (defaultBasetype == SMI_BASETYPE_ENUM) { yyval.valuePtr->len = 1; yyval.valuePtr->value.unsigned32 = 0; } else { yyval.valuePtr->len = 0; yyval.valuePtr->value.ptr = NULL; } } else { yyval.valuePtr->basetype = defaultBasetype; yyval.valuePtr->len = -1; /* indicates unresolved ptr */ yyval.valuePtr->value.ptr = (unsigned char *)yyvsp[0].id; /* JS: needs strdup? */ } ; break;} case 231: #line 4309 "parser-smi.y" { yyval.valuePtr = smiMalloc(sizeof(SmiValue)); yyval.valuePtr->basetype = SMI_BASETYPE_OCTETSTRING; yyval.valuePtr->value.ptr = (unsigned char *)smiStrdup(yyvsp[0].text); yyval.valuePtr->len = strlen(yyvsp[0].text); ; break;} case 232: #line 4332 "parser-smi.y" { /* * SMIv1 allows something like { 0 0 } ! * SMIv2 does not! */ /* TODO: make it work correctly for SMIv1 */ if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_OID_DEFVAL_TOO_LONG_SMIV2); } else { smiPrintError(thisParserPtr, ERR_OID_DEFVAL_TOO_LONG_SMIV1); } yyval.valuePtr = smiMalloc(sizeof(SmiValue)); yyval.valuePtr->basetype = SMI_BASETYPE_OBJECTIDENTIFIER; yyval.valuePtr->len = 2; yyval.valuePtr->value.oid = smiMalloc(2 * sizeof(SmiSubid)); yyval.valuePtr->value.oid[0] = 0; yyval.valuePtr->value.oid[1] = 0; ; break;} case 233: #line 4359 "parser-smi.y" { yyval.typePtr = smiHandle->typeInteger32Ptr; ; break;} case 234: #line 4363 "parser-smi.y" { Import *importPtr; /* TODO: any need to distinguish from INTEGER? */ yyval.typePtr = smiHandle->typeInteger32Ptr; importPtr = findImportByName("Integer32", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Integer32"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Integer32"); } } ; break;} case 235: #line 4388 "parser-smi.y" { yyval.typePtr = smiHandle->typeOctetStringPtr; ; break;} case 236: #line 4392 "parser-smi.y" { yyval.typePtr = smiHandle->typeObjectIdentifierPtr; ; break;} case 237: #line 4398 "parser-smi.y" { Import *importPtr; yyval.typePtr = findTypeByName("IpAddress"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "IpAddress"); } importPtr = findImportByName("IpAddress", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "IpAddress"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "IpAddress"); } } ; break;} case 238: #line 4426 "parser-smi.y" { Import *importPtr; if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) && !findImportByName("Counter32", thisParserPtr->modulePtr)) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "COUNTER32"); yyval.typePtr = findTypeByName("Counter32"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Counter32"); } importPtr = findImportByName("Counter32", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Counter32"); } } ; break;} case 239: #line 4452 "parser-smi.y" { Import *importPtr; List *listPtr, *nextListPtr; smiPrintError(thisParserPtr, ERR_ILLEGAL_RANGE_FOR_COUNTER, "Counter32"); for (listPtr = yyvsp[0].listPtr; listPtr; listPtr = nextListPtr) { nextListPtr = listPtr->nextPtr; smiFree((Range *)listPtr->ptr); smiFree(listPtr); } if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) && !findImportByName("Counter32", thisParserPtr->modulePtr)) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Counter32"); yyval.typePtr = findTypeByName("Counter32"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Counter32"); } importPtr = findImportByName("Counter32", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Counter32"); } } ; break;} case 240: #line 4489 "parser-smi.y" { Import *importPtr; if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) && !findImportByName("Gauge32", thisParserPtr->modulePtr)) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Gauge32"); yyval.typePtr = findTypeByName("Gauge32"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Gauge32"); } importPtr = findImportByName("Gauge32", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Gauge32"); } } ; break;} case 241: #line 4515 "parser-smi.y" { Type *parentPtr; Import *importPtr; if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) && !findImportByName("Gauge32", thisParserPtr->modulePtr)) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Gauge32"); parentPtr = findTypeByName("Gauge32"); if (! parentPtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Gauge32"); yyval.typePtr = NULL; } else { yyval.typePtr = duplicateType(parentPtr, 0, thisParserPtr); setTypeList(yyval.typePtr, yyvsp[0].listPtr); smiCheckTypeRanges(thisParserPtr, yyval.typePtr); } importPtr = findImportByName("Gauge32", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Gauge32"); } } ; break;} case 242: #line 4548 "parser-smi.y" { Import *importPtr; yyval.typePtr = smiHandle->typeUnsigned32Ptr; importPtr = findImportByName("Unsigned32", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Unsigned32"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Unsigned32"); } } ; break;} case 243: #line 4572 "parser-smi.y" { Import *importPtr; yyval.typePtr = duplicateType(smiHandle->typeUnsigned32Ptr, 0, thisParserPtr); setTypeList(yyval.typePtr, yyvsp[0].listPtr); smiCheckTypeRanges(thisParserPtr, yyval.typePtr); importPtr = findImportByName("Unsigned32", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Unsigned32"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Unsigned32"); } } ; break;} case 244: #line 4599 "parser-smi.y" { Import *importPtr; yyval.typePtr = findTypeByName("TimeTicks"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "TimeTicks"); } importPtr = findImportByName("TimeTicks", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "TimeTicks"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "TimeTicks"); } } ; break;} case 245: #line 4627 "parser-smi.y" { Import *importPtr; yyval.typePtr = findTypeByName("Opaque"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Opaque"); } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_OPAQUE_OBSOLETE); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_OPAQUE_OBSOLETE); } } importPtr = findImportByName("Opaque", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Opaque"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Opaque"); } } ; break;} case 246: #line 4665 "parser-smi.y" { Type *parentPtr; Import *importPtr; parentPtr = findTypeByName("Opaque"); if (! parentPtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Opaque"); yyval.typePtr = NULL; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_OPAQUE_OBSOLETE, "Opaque"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_OPAQUE_OBSOLETE, "Opaque"); } yyval.typePtr = duplicateType(parentPtr, 0, thisParserPtr); setTypeList(yyval.typePtr, yyvsp[0].listPtr); smiCheckTypeRanges(thisParserPtr, yyval.typePtr); } importPtr = findImportByName("Opaque", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Opaque"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Opaque"); } } ; break;} case 247: #line 4711 "parser-smi.y" { Import *importPtr; if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) && !findImportByName("Counter64", thisParserPtr->modulePtr)) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Counter64"); yyval.typePtr = findTypeByName("Counter64"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Counter64"); } importPtr = findImportByName("Counter64", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Counter64"); } } ; break;} case 248: #line 4737 "parser-smi.y" { Import *importPtr; List *listPtr, *nextListPtr; smiPrintError(thisParserPtr, ERR_ILLEGAL_RANGE_FOR_COUNTER, "Counter64"); for (listPtr = yyvsp[0].listPtr; listPtr; listPtr = nextListPtr) { nextListPtr = listPtr->nextPtr; smiFree((Range *)listPtr->ptr); smiFree(listPtr); } if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) && !findImportByName("Counter64", thisParserPtr->modulePtr)) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Counter64"); yyval.typePtr = findTypeByName("Counter64"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Counter64"); } importPtr = findImportByName("Counter64", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Counter64"); } } ; break;} case 249: #line 4774 "parser-smi.y" { Import *importPtr; yyval.typePtr = findTypeByModulenameAndName( thisParserPtr->modulePtr->export.name, "Integer64"); if (! yyval.typePtr) { importPtr = findImportByName("Integer64", thisModulePtr); if (!importPtr) { yyval.typePtr = findTypeByName("Integer64"); if ((thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)) { smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "Integer64"); } else { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Integer64"); } } else { importPtr->use++; yyval.typePtr = findTypeByModulenameAndName( importPtr->export.module, importPtr->export.name); } } ; break;} case 250: #line 4800 "parser-smi.y" { Type *parentPtr; Import *importPtr; parentPtr = findTypeByModulenameAndName( thisParserPtr->modulePtr->export.name, "Integer64"); if (! parentPtr) { importPtr = findImportByName("Integer64", thisModulePtr); if (!importPtr) { parentPtr = findTypeByName("Integer64"); if ((thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)) { smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "Integer64"); } else { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Integer64"); } } else { importPtr->use++; parentPtr = findTypeByModulenameAndName( importPtr->export.module, importPtr->export.name); } } if (! parentPtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Integer64"); yyval.typePtr = NULL; } else { yyval.typePtr = duplicateType(parentPtr, 0, thisParserPtr); setTypeList(yyval.typePtr, yyvsp[0].listPtr); smiCheckTypeRanges(thisParserPtr, yyval.typePtr); } ; break;} case 251: #line 4837 "parser-smi.y" { Import *importPtr; yyval.typePtr = findTypeByModulenameAndName( thisParserPtr->modulePtr->export.name, "Unsigned64"); if (! yyval.typePtr) { importPtr = findImportByName("Unsigned64", thisModulePtr); if (!importPtr) { yyval.typePtr = findTypeByName("Unsigned64"); if ((thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)) { smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "Unsigned64"); } else { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Unsigned64"); } } else { importPtr->use++; yyval.typePtr = findTypeByModulenameAndName( importPtr->export.module, importPtr->export.name); } } ; break;} case 252: #line 4863 "parser-smi.y" { Type *parentPtr; Import *importPtr; parentPtr = findTypeByModulenameAndName( thisParserPtr->modulePtr->export.name, "Unsigned64"); if (! parentPtr) { importPtr = findImportByName("Unsigned64", thisModulePtr); if (!importPtr) { parentPtr = findTypeByName("Unsigned64"); if ((thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)) { smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "Unsigned64"); } else { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Unsigned64"); } } else { importPtr->use++; parentPtr = findTypeByModulenameAndName( importPtr->export.module, importPtr->export.name); } } if (! parentPtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Unsigned64"); yyval.typePtr = NULL; } else { yyval.typePtr = duplicateType(parentPtr, 0, thisParserPtr); setTypeList(yyval.typePtr, yyvsp[0].listPtr); smiCheckTypeRanges(thisParserPtr, yyval.typePtr); } ; break;} case 253: #line 4906 "parser-smi.y" { Import *importPtr; yyval.typePtr = findTypeByName("IpAddress"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "IpAddress"); } importPtr = findImportByName("IpAddress", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "IpAddress"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "IpAddress"); } } ; break;} case 254: #line 4934 "parser-smi.y" { Import *importPtr; if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) && !findImportByName("Counter32", thisParserPtr->modulePtr)) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Counter32"); yyval.typePtr = findTypeByName("Counter32"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Counter32"); } importPtr = findImportByName("Counter32", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Counter32"); } } ; break;} case 255: #line 4960 "parser-smi.y" { Import *importPtr; if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) && !findImportByName("Gauge32", thisParserPtr->modulePtr)) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Gauge32"); yyval.typePtr = findTypeByName("Gauge32"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Gauge32"); } importPtr = findImportByName("Gauge32", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Gauge32"); } } ; break;} case 256: #line 4986 "parser-smi.y" { Import *importPtr; yyval.typePtr = smiHandle->typeUnsigned32Ptr; importPtr = findImportByName("Unsigned32", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Unsigned32"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Unsigned32"); } } ; break;} case 257: #line 5010 "parser-smi.y" { Import *importPtr; yyval.typePtr = findTypeByName("TimeTicks"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "TimeTicks"); } importPtr = findImportByName("TimeTicks", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "TimeTicks"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "TimeTicks"); } } ; break;} case 258: #line 5038 "parser-smi.y" { Import *importPtr; yyval.typePtr = findTypeByName("Opaque"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Opaque"); } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_OPAQUE_OBSOLETE, "Opaque"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_OPAQUE_OBSOLETE, "Opaque"); } } importPtr = findImportByName("Opaque", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Opaque"); } else if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Opaque"); } } ; break;} case 259: #line 5078 "parser-smi.y" { Import *importPtr; if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) && !findImportByName("Counter64", thisModulePtr)) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Counter64"); yyval.typePtr = findTypeByName("Counter64"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Counter64"); } importPtr = findImportByName("Counter64", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { smiPrintError(thisParserPtr, ERR_SMIV2_BASETYPE_NOT_IMPORTED, "Counter64"); } } ; break;} case 260: #line 5104 "parser-smi.y" { Import *importPtr; if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "Integer64"); yyval.typePtr = findTypeByName("Integer64"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Integer64"); } importPtr = findImportByName("Integer64", thisModulePtr); if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Integer64"); } } ; break;} case 261: #line 5129 "parser-smi.y" { Import *importPtr; importPtr = findImportByName("Unsigned64", thisModulePtr); if ((thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) && (!importPtr)) smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "Unsigned64"); yyval.typePtr = findTypeByName("Unsigned64"); if (! yyval.typePtr) { smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE, "Unsigned64"); } if (importPtr) { importPtr->use++; } else { if (thisModulePtr->export.language == SMI_LANGUAGE_SPPI) { smiPrintError(thisParserPtr, ERR_SPPI_BASETYPE_NOT_IMPORTED, "Unsigned64"); } } ; break;} case 262: #line 5156 "parser-smi.y" { List *listPtr, *nextListPtr; if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) smiPrintError(thisParserPtr, ERR_UNEXPECTED_TYPE_RESTRICTION); for (listPtr = yyvsp[0].listPtr; listPtr; listPtr = nextListPtr) { nextListPtr = listPtr->nextPtr; smiFree((Range *)(listPtr->ptr)); smiFree(listPtr); } yyval.listPtr = NULL; ; break;} case 263: #line 5173 "parser-smi.y" { List *listPtr, *nextListPtr; if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) smiPrintError(thisParserPtr, ERR_UNEXPECTED_TYPE_RESTRICTION); for (listPtr = yyvsp[0].listPtr; listPtr; listPtr = nextListPtr) { nextListPtr = listPtr->nextPtr; smiFree((Range *)(listPtr->ptr)); smiFree(listPtr); } yyval.listPtr = NULL; ; break;} case 264: #line 5190 "parser-smi.y" { List *listPtr, *nextListPtr; if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) smiPrintError(thisParserPtr, ERR_UNEXPECTED_TYPE_RESTRICTION); for (listPtr = yyvsp[0].listPtr; listPtr; listPtr = nextListPtr) { nextListPtr = listPtr->nextPtr; smiFree(((NamedNumber *)(listPtr->ptr))->export.name); smiFree((NamedNumber *)(listPtr->ptr)); smiFree(listPtr); } yyval.listPtr = NULL; ; break;} case 265: #line 5208 "parser-smi.y" { yyval.listPtr = NULL; ; break;} case 266: #line 5222 "parser-smi.y" { yyval.listPtr = yyvsp[-1].listPtr; ; break;} case 267: #line 5232 "parser-smi.y" { yyval.listPtr = yyvsp[-2].listPtr; ; break;} case 268: #line 5238 "parser-smi.y" { yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].rangePtr; yyval.listPtr->nextPtr = NULL; ; break;} case 269: #line 5244 "parser-smi.y" { List *p, *pp; p = smiMalloc(sizeof(List)); p->ptr = (void *)yyvsp[0].rangePtr; p->nextPtr = NULL; for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; ; break;} case 270: #line 5258 "parser-smi.y" { yyval.rangePtr = smiMalloc(sizeof(Range)); yyval.rangePtr->export.minValue = *yyvsp[0].valuePtr; yyval.rangePtr->export.maxValue = *yyvsp[0].valuePtr; smiFree(yyvsp[0].valuePtr); ; break;} case 271: #line 5265 "parser-smi.y" { yyval.rangePtr = smiMalloc(sizeof(Range)); yyval.rangePtr->export.minValue = *yyvsp[-2].valuePtr; yyval.rangePtr->export.maxValue = *yyvsp[0].valuePtr; smiFree(yyvsp[-2].valuePtr); smiFree(yyvsp[0].valuePtr); ; break;} case 272: #line 5275 "parser-smi.y" { yyval.valuePtr = smiMalloc(sizeof(SmiValue)); yyval.valuePtr->basetype = SMI_BASETYPE_INTEGER32; yyval.valuePtr->value.integer32 = yyvsp[0].integer32; ; break;} case 273: #line 5281 "parser-smi.y" { yyval.valuePtr = smiMalloc(sizeof(SmiValue)); yyval.valuePtr->basetype = SMI_BASETYPE_UNSIGNED32; yyval.valuePtr->value.unsigned32 = yyvsp[0].unsigned32; ; break;} case 274: #line 5287 "parser-smi.y" { yyval.valuePtr = smiMalloc(sizeof(SmiValue)); yyval.valuePtr->basetype = SMI_BASETYPE_INTEGER64; yyval.valuePtr->value.integer64 = yyvsp[0].integer64; ; break;} case 275: #line 5293 "parser-smi.y" { yyval.valuePtr = smiMalloc(sizeof(SmiValue)); yyval.valuePtr->basetype = SMI_BASETYPE_UNSIGNED64; yyval.valuePtr->value.unsigned64 = yyvsp[0].unsigned64; ; break;} case 276: #line 5299 "parser-smi.y" { char s[3]; int i, len; yyval.valuePtr = smiMalloc(sizeof(SmiValue)); if (defaultBasetype == SMI_BASETYPE_OCTETSTRING) { yyval.valuePtr->basetype = SMI_BASETYPE_OCTETSTRING; len = strlen(yyvsp[0].text); yyval.valuePtr->value.ptr = smiMalloc((len+1)/2+1); for (i = 0; i < len; i += 2) { strncpy(s, &yyvsp[0].text[i], 2); if (!s[1]) s[1] = '0'; s[2] = 0; yyval.valuePtr->value.ptr[i/2] = (unsigned char)strtol(s, 0, 16); } yyval.valuePtr->len = (len+1)/2; } else { yyval.valuePtr->basetype = SMI_BASETYPE_UNSIGNED32; yyval.valuePtr->value.unsigned32 = strtoul(yyvsp[0].text, NULL, 16); } ; break;} case 277: #line 5322 "parser-smi.y" { char s[9]; int i, len, j; yyval.valuePtr = smiMalloc(sizeof(SmiValue)); if (defaultBasetype == SMI_BASETYPE_OCTETSTRING) { yyval.valuePtr->basetype = SMI_BASETYPE_OCTETSTRING; len = strlen(yyvsp[0].text); yyval.valuePtr->value.ptr = smiMalloc((len+7)/8+1); for (i = 0; i < len; i += 8) { strncpy(s, &yyvsp[0].text[i], 8); for (j = 1; j < 8; j++) { if (!s[j]) s[j] = '0'; } s[8] = 0; yyval.valuePtr->value.ptr[i/8] = (unsigned char)strtol(s, 0, 2); } yyval.valuePtr->len = (len+7)/8; } else { yyval.valuePtr->basetype = SMI_BASETYPE_UNSIGNED32; yyval.valuePtr->value.unsigned32 = strtoul(yyvsp[0].text, NULL, 2); } ; break;} case 278: #line 5349 "parser-smi.y" { yyval.listPtr = yyvsp[-1].listPtr; ; break;} case 279: #line 5355 "parser-smi.y" { yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].namedNumberPtr; yyval.listPtr->nextPtr = NULL; ; break;} case 280: #line 5361 "parser-smi.y" { List *p, *pp; p = smiMalloc(sizeof(List)); p->ptr = (void *)yyvsp[0].namedNumberPtr; p->nextPtr = NULL; for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; ; break;} case 281: #line 5374 "parser-smi.y" { checkNameLen(thisParserPtr, yyvsp[0].id, ERR_ENUMNAME_32, ERR_ENUMNAME_64); if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { if (strchr(yyvsp[0].id, '-')) { smiPrintError(thisParserPtr, ERR_NAMEDNUMBER_INCLUDES_HYPHEN, yyvsp[0].id); } } ; break;} case 282: #line 5387 "parser-smi.y" { yyval.namedNumberPtr = smiMalloc(sizeof(NamedNumber)); yyval.namedNumberPtr->export.name = yyvsp[-4].id; yyval.namedNumberPtr->export.value = *yyvsp[-1].valuePtr; smiFree(yyvsp[-1].valuePtr); ; break;} case 283: #line 5396 "parser-smi.y" { if (yyvsp[0].unsigned32 > MAX_INTEGER32) { smiPrintError(thisParserPtr, ERR_INTEGER32_TOO_LARGE, yyvsp[0].unsigned32); } if ((thisModulePtr->export.language == SMI_LANGUAGE_SMIV1) && (yyvsp[0].unsigned32 == 0)) { smiPrintError(thisParserPtr, ERR_ENUM_ZERO); } yyval.valuePtr = smiMalloc(sizeof(SmiValue)); yyval.valuePtr->basetype = SMI_BASETYPE_INTEGER32; yyval.valuePtr->value.integer32 = yyvsp[0].unsigned32; ; break;} case 284: #line 5411 "parser-smi.y" { yyval.valuePtr = smiMalloc(sizeof(SmiValue)); yyval.valuePtr->basetype = SMI_BASETYPE_INTEGER32; yyval.valuePtr->value.integer32 = yyvsp[0].integer32; /* TODO: non-negative is suggested */ ; break;} case 285: #line 5420 "parser-smi.y" { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { if (!strcmp(yyvsp[0].id, "current")) { yyval.status = SMI_STATUS_CURRENT; } else if (!strcmp(yyvsp[0].id, "deprecated")) { yyval.status = SMI_STATUS_DEPRECATED; } else if (!strcmp(yyvsp[0].id, "obsolete")) { yyval.status = SMI_STATUS_OBSOLETE; } else { smiPrintError(thisParserPtr, ERR_INVALID_SMIV2_STATUS, yyvsp[0].id); if (!strcmp(yyvsp[0].id, "mandatory") || !strcmp(yyvsp[0].id, "optional")) { /* best guess */ yyval.status = SMI_STATUS_CURRENT; } else { yyval.status = SMI_STATUS_UNKNOWN; } } } else if (thisModulePtr->export.language != SMI_LANGUAGE_SPPI) { if (!strcmp(yyvsp[0].id, "mandatory")) { yyval.status = SMI_STATUS_MANDATORY; } else if (!strcmp(yyvsp[0].id, "optional")) { yyval.status = SMI_STATUS_OPTIONAL; } else if (!strcmp(yyvsp[0].id, "obsolete")) { yyval.status = SMI_STATUS_OBSOLETE; } else if (!strcmp(yyvsp[0].id, "deprecated")) { yyval.status = SMI_STATUS_OBSOLETE; } else { smiPrintError(thisParserPtr, ERR_INVALID_SMIV1_STATUS, yyvsp[0].id); if (!strcmp(yyvsp[0].id, "current")) { /* best guess */ yyval.status = SMI_STATUS_MANDATORY; } else { yyval.status = SMI_STATUS_UNKNOWN; } } } else { /* it is SPPI */ if (!strcmp(yyvsp[0].id, "current")) { yyval.status = SMI_STATUS_CURRENT; } else if (!strcmp(yyvsp[0].id, "obsolete")) { yyval.status = SMI_STATUS_OBSOLETE; } else if (!strcmp(yyvsp[0].id, "deprecated")) { yyval.status = SMI_STATUS_OBSOLETE; } else { smiPrintError(thisParserPtr, ERR_INVALID_SPPI_STATUS, yyvsp[0].id); yyval.status = SMI_STATUS_UNKNOWN; } } smiFree(yyvsp[0].id); ; break;} case 286: #line 5479 "parser-smi.y" { if (!strcmp(yyvsp[0].id, "current")) { yyval.status = SMI_STATUS_CURRENT; } else if (!strcmp(yyvsp[0].id, "obsolete")) { yyval.status = SMI_STATUS_OBSOLETE; } else { smiPrintError(thisParserPtr, ERR_INVALID_CAPABILITIES_STATUS, yyvsp[0].id); yyval.status = SMI_STATUS_UNKNOWN; } smiFree(yyvsp[0].id); ; break;} case 287: #line 5495 "parser-smi.y" { yyval.text = yyvsp[0].text; if (yyvsp[0].text && !strlen(yyvsp[0].text)) { smiPrintError(thisParserPtr, ERR_EMPTY_FORMAT); } ; break;} case 288: #line 5504 "parser-smi.y" { yyval.text = NULL; ; break;} case 289: #line 5510 "parser-smi.y" { yyval.text = yyvsp[0].text; if (yyvsp[0].text && !strlen(yyvsp[0].text)) { smiPrintError(thisParserPtr, ERR_EMPTY_UNITS); } ; break;} case 290: #line 5519 "parser-smi.y" { yyval.text = NULL; ; break;} case 291: #line 5525 "parser-smi.y" { if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) { if (!strcmp(yyvsp[0].id, "not-accessible")) { yyval.access = SMI_ACCESS_NOT_ACCESSIBLE; } else if (!strcmp(yyvsp[0].id, "accessible-for-notify")) { yyval.access = SMI_ACCESS_NOTIFY; } else if (!strcmp(yyvsp[0].id, "read-only")) { yyval.access = SMI_ACCESS_READ_ONLY; } else if (!strcmp(yyvsp[0].id, "read-write")) { yyval.access = SMI_ACCESS_READ_WRITE; } else if (!strcmp(yyvsp[0].id, "read-create")) { yyval.access = SMI_ACCESS_READ_WRITE; thisParserPtr->flags |= FLAG_CREATABLE; /* TODO:remember it's really read-create */ } else if (!strcmp(yyvsp[0].id, "write-only")) { smiPrintError(thisParserPtr, ERR_SMIV2_WRITE_ONLY); yyval.access = SMI_ACCESS_READ_WRITE; } else { smiPrintError(thisParserPtr, ERR_INVALID_SMIV2_ACCESS, yyvsp[0].id); yyval.access = SMI_ACCESS_UNKNOWN; } } else if (thisModulePtr->export.language != SMI_LANGUAGE_SPPI) { if (!strcmp(yyvsp[0].id, "not-accessible")) { yyval.access = SMI_ACCESS_NOT_ACCESSIBLE; } else if (!strcmp(yyvsp[0].id, "read-only")) { yyval.access = SMI_ACCESS_READ_ONLY; } else if (!strcmp(yyvsp[0].id, "read-write")) { yyval.access = SMI_ACCESS_READ_WRITE; } else if (!strcmp(yyvsp[0].id, "write-only")) { smiPrintError(thisParserPtr, ERR_SMIV1_WRITE_ONLY); yyval.access = SMI_ACCESS_READ_WRITE; } else { smiPrintError(thisParserPtr, ERR_INVALID_SMIV1_ACCESS, yyvsp[0].id); yyval.access = SMI_ACCESS_UNKNOWN; } } else { if (!strcmp(yyvsp[0].id, "install")) { yyval.access = SMI_ACCESS_INSTALL; } else if (!strcmp(yyvsp[0].id, "install-notify")) { yyval.access = SMI_ACCESS_INSTALL_NOTIFY; } else if (!strcmp(yyvsp[0].id, "notify")) { yyval.access = SMI_ACCESS_NOTIFY; } else if (!strcmp(yyvsp[0].id, "report-only")) { yyval.access = SMI_ACCESS_REPORT_ONLY; } else if (!strcmp(yyvsp[0].id, "not-accessible")) { yyval.access = SMI_ACCESS_NOT_ACCESSIBLE; } else { smiPrintError(thisParserPtr, ERR_INVALID_SPPI_ACCESS, yyvsp[0].id); yyval.access = SMI_ACCESS_UNKNOWN; } } smiFree(yyvsp[0].id); ; break;} case 292: #line 5591 "parser-smi.y" { if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "PIB-INDEX"); ; break;} case 293: #line 5596 "parser-smi.y" { List *p = smiMalloc(sizeof(List)); p->ptr = yyvsp[-1].objectPtr; p->nextPtr = NULL; yyval.index.indexkind = SMI_INDEX_INDEX; yyval.index.implied = impliedFlag; yyval.index.listPtr = p; yyval.index.rowPtr = NULL; indexFlag = INDEXFLAG_PIBINDEX; ; break;} case 294: #line 5611 "parser-smi.y" { yyval.index.indexkind = SMI_INDEX_AUGMENT; yyval.index.implied = 0; yyval.index.listPtr = NULL; yyval.index.rowPtr = yyvsp[-1].objectPtr; indexFlag = INDEXFLAG_AUGMENTS; ; break;} case 295: #line 5619 "parser-smi.y" { if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "EXTENDS"); ; break;} case 296: #line 5624 "parser-smi.y" { yyval.index.indexkind = SMI_INDEX_SPARSE; yyval.index.implied = 0; yyval.index.listPtr = NULL; yyval.index.rowPtr = yyvsp[-1].objectPtr; indexFlag = INDEXFLAG_EXTENDS; ; break;} case 297: #line 5632 "parser-smi.y" { yyval.index.indexkind = SMI_INDEX_UNKNOWN; ; break;} case 298: #line 5638 "parser-smi.y" { /* * To avoid ambiguity caused by merging * the SMI and SPPI parser we use a flag. */ if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) { /* * Only INDEX or AUGMENTS are allowed for SMI */ if (indexFlag != INDEXFLAG_NONE) smiPrintError(thisParserPtr, ERR_INDEX_AND_AUGMENTS_USED); } else { /* * INDEX may only be used if PIB_INDEX was used */ if (indexFlag != INDEXFLAG_PIBINDEX) smiPrintError(thisParserPtr, ERR_INDEX_WITHOUT_PIB_INDEX); } /* * Use a global variable to fetch and remember * whether we have seen an IMPLIED keyword. */ impliedFlag = 0; ; break;} case 299: #line 5664 "parser-smi.y" { yyval.index.indexkind = SMI_INDEX_INDEX; yyval.index.implied = impliedFlag; yyval.index.listPtr = yyvsp[-1].listPtr; yyval.index.rowPtr = NULL; ; break;} case 300: #line 5671 "parser-smi.y" { yyval.index.indexkind = SMI_INDEX_UNKNOWN; ; break;} case 301: #line 5677 "parser-smi.y" { yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].objectPtr; yyval.listPtr->nextPtr = NULL; ; break;} case 302: #line 5684 "parser-smi.y" { List *p, *pp; p = smiMalloc(sizeof(List)); p->ptr = yyvsp[0].objectPtr; p->nextPtr = NULL; for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; ; break;} case 303: #line 5697 "parser-smi.y" { impliedFlag = 1; yyval.objectPtr = yyvsp[0].objectPtr; ; break;} case 304: #line 5702 "parser-smi.y" { yyval.objectPtr = yyvsp[0].objectPtr; ; break;} case 305: #line 5712 "parser-smi.y" { yyval.objectPtr = yyvsp[0].objectPtr; ; break;} case 306: #line 5718 "parser-smi.y" { yyval.objectPtr = yyvsp[0].objectPtr; ; break;} case 307: #line 5724 "parser-smi.y" { yyval.valuePtr = yyvsp[-1].valuePtr; ; break;} case 308: #line 5726 "parser-smi.y" { yyval.valuePtr = NULL; ; break;} case 309: #line 5731 "parser-smi.y" { yyval.valuePtr = yyvsp[0].valuePtr; ; break;} case 310: #line 5733 "parser-smi.y" { yyval.valuePtr = smiMalloc(sizeof(SmiValue)); yyval.valuePtr->basetype = SMI_BASETYPE_BITS; yyval.valuePtr->value.ptr = (void *)yyvsp[-1].listPtr; ; break;} case 311: #line 5741 "parser-smi.y" { yyval.listPtr = yyvsp[0].listPtr; ; break;} case 312: #line 5743 "parser-smi.y" { yyval.listPtr = NULL; ; break;} case 313: #line 5747 "parser-smi.y" { yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].id; yyval.listPtr->nextPtr = NULL; ; break;} case 314: #line 5753 "parser-smi.y" { List *p, *pp; p = smiMalloc(sizeof(List)); p->ptr = yyvsp[0].id; p->nextPtr = NULL; for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; ; break;} case 315: #line 5766 "parser-smi.y" { yyval.objectPtr = yyvsp[0].objectPtr; ; break;} case 316: #line 5772 "parser-smi.y" { yyval.objectPtr = yyvsp[0].objectPtr; ; break;} case 317: #line 5778 "parser-smi.y" { yyval.text = yyvsp[0].text; if (yyvsp[0].text && !strlen(yyvsp[0].text)) { smiPrintError(thisParserPtr, ERR_EMPTY_REFERENCE); } ; break;} case 318: #line 5787 "parser-smi.y" { yyval.text = NULL; ; break;} case 319: #line 5791 "parser-smi.y" { yyval.err = 0; ; break;} case 320: #line 5793 "parser-smi.y" { yyval.err = 0; ; break;} case 321: #line 5797 "parser-smi.y" { yyval.err = 0; ; break;} case 322: #line 5799 "parser-smi.y" { yyval.err = 0; ; break;} case 323: #line 5803 "parser-smi.y" { thisParserPtr->firstRevisionLine = thisParserPtr->line; if (thisParserPtr->modulePtr->lastRevisionPtr && (yyvsp[0].date >= thisParserPtr->modulePtr->lastRevisionPtr->export.date)) { smiPrintError(thisParserPtr, ERR_REVISION_NOT_DESCENDING); } if (yyvsp[0].date > thisParserPtr->modulePtr->lastUpdated) { smiPrintError(thisParserPtr, ERR_REVISION_AFTER_LAST_UPDATE); } ; break;} case 324: #line 5818 "parser-smi.y" { Revision *revisionPtr; checkDescr(thisParserPtr, yyvsp[0].text); revisionPtr = addRevision(yyvsp[-3].date, yyvsp[0].text, thisParserPtr); if (revisionPtr) { setRevisionLine(revisionPtr, thisParserPtr->firstRevisionLine, thisParserPtr); } yyval.err = revisionPtr ? 0 : -1; ; break;} case 325: #line 5834 "parser-smi.y" { yyval.listPtr = yyvsp[-1].listPtr; ; break;} case 326: #line 5838 "parser-smi.y" { yyval.listPtr = NULL; ; break;} case 327: #line 5844 "parser-smi.y" { yyval.listPtr = yyvsp[-1].listPtr; ; break;} case 328: #line 5850 "parser-smi.y" { yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].objectPtr; yyval.listPtr->nextPtr = NULL; ; break;} case 329: #line 5856 "parser-smi.y" { List *p, *pp; p = smiMalloc(sizeof(List)); p->ptr = yyvsp[0].objectPtr; p->nextPtr = NULL; for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; ; break;} case 330: #line 5869 "parser-smi.y" { yyval.objectPtr = yyvsp[0].objectPtr; if ((thisParserPtr->currentDecl == SMI_DECL_OBJECTGROUP) && yyval.objectPtr->modulePtr != thisParserPtr->modulePtr) { smiPrintError(thisParserPtr, ERR_COMPLIANCE_MEMBER_NOT_LOCAL, yyval.objectPtr->export.name); } ; break;} case 331: #line 5881 "parser-smi.y" { yyval.listPtr = yyvsp[-1].listPtr; ; break;} case 332: #line 5887 "parser-smi.y" { yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].objectPtr; yyval.listPtr->nextPtr = NULL; ; break;} case 333: #line 5893 "parser-smi.y" { List *p, *pp; p = smiMalloc(sizeof(List)); p->ptr = yyvsp[0].objectPtr; p->nextPtr = NULL; for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; ; break;} case 334: #line 5906 "parser-smi.y" { yyval.objectPtr = yyvsp[0].objectPtr; if (yyval.objectPtr->modulePtr != thisParserPtr->modulePtr) { smiPrintError(thisParserPtr, ERR_COMPLIANCE_MEMBER_NOT_LOCAL, yyval.objectPtr->export.name); } ; break;} case 335: #line 5917 "parser-smi.y" { int len; yyval.text = smiStrdup(yyvsp[0].text); len = strlen(yyval.text); while (len > 0 && yyval.text[len-1] == '\n') { yyval.text[--len] = 0; } ; break;} case 336: #line 5928 "parser-smi.y" { yyval.date = checkDate(thisParserPtr, yyvsp[0].text); ; break;} case 337: #line 5933 "parser-smi.y" { thisParserPtr->parentNodePtr = smiHandle->rootNodePtr; ; break;} case 338: #line 5937 "parser-smi.y" { yyval.objectPtr = yyvsp[0].objectPtr; if (yyval.objectPtr) { thisParserPtr->parentNodePtr = yyvsp[0].objectPtr->nodePtr; } else { thisParserPtr->parentNodePtr = NULL; } ; break;} case 339: #line 5949 "parser-smi.y" { yyval.objectPtr = yyvsp[0].objectPtr; ; break;} case 340: #line 5954 "parser-smi.y" { yyval.objectPtr = yyvsp[0].objectPtr; ; break;} case 341: #line 5962 "parser-smi.y" { Object *objectPtr; Import *importPtr; if (thisParserPtr->parentNodePtr != smiHandle->rootNodePtr) { smiPrintError(thisParserPtr, ERR_OIDLABEL_NOT_FIRST, yyvsp[0].id); } objectPtr = findObjectByModuleAndName( thisParserPtr->modulePtr, yyvsp[0].id); if (objectPtr) { yyval.objectPtr = objectPtr; smiFree(yyvsp[0].id); } else { importPtr = findImportByName(yyvsp[0].id, thisModulePtr); if (!importPtr || (importPtr->kind == KIND_NOTFOUND)) { /* * If we are in a MODULE-COMPLIANCE * statement with a given MODULE... */ if (thisParserPtr->complianceModulePtr) { objectPtr = findObjectByModuleAndName( thisParserPtr->complianceModulePtr, yyvsp[0].id); if (objectPtr) { importPtr = addImport( yyvsp[0].id, thisParserPtr); setImportModulename(importPtr, thisParserPtr->complianceModulePtr->export.name); addImportFlags(importPtr, FLAG_INCOMPLIANCE); importPtr->use++; } else { objectPtr = addObject(yyvsp[0].id, thisParserPtr->pendingNodePtr, 0, FLAG_INCOMPLETE, thisParserPtr); smiPrintError(thisParserPtr, ERR_IDENTIFIER_NOT_IN_MODULE, yyvsp[0].id, thisParserPtr->complianceModulePtr->export.name); } } else if (thisParserPtr->capabilitiesModulePtr) { objectPtr = findObjectByModuleAndName( thisParserPtr->capabilitiesModulePtr, yyvsp[0].id); if (objectPtr) { importPtr = addImport( yyvsp[0].id, thisParserPtr); setImportModulename(importPtr, thisParserPtr->capabilitiesModulePtr-> export.name); addImportFlags(importPtr, FLAG_INCOMPLIANCE); importPtr->use++; } else { objectPtr = addObject(yyvsp[0].id, thisParserPtr->pendingNodePtr, 0, FLAG_INCOMPLETE, thisParserPtr); smiPrintError(thisParserPtr, ERR_IDENTIFIER_NOT_IN_MODULE, yyvsp[0].id, thisParserPtr->capabilitiesModulePtr->export.name); } } else { /* * forward referenced node. * create it, * marked with FLAG_INCOMPLETE. */ objectPtr = addObject(yyvsp[0].id, thisParserPtr->pendingNodePtr, 0, FLAG_INCOMPLETE, thisParserPtr); } yyval.objectPtr = objectPtr; } else { /* * imported object. */ importPtr->use++; yyval.objectPtr = findObjectByModulenameAndName( importPtr->export.module, yyvsp[0].id); smiFree(yyvsp[0].id); } } if (yyval.objectPtr) thisParserPtr->parentNodePtr = yyval.objectPtr->nodePtr; ; break;} case 342: #line 6056 "parser-smi.y" { Object *objectPtr; Import *importPtr; char *md; if (thisParserPtr->parentNodePtr != smiHandle->rootNodePtr) { md = smiMalloc(sizeof(char) * (strlen(yyvsp[-2].id) + strlen(yyvsp[0].id) + 2)); sprintf(md, "%s.%s", yyvsp[-2].id, yyvsp[0].id); smiPrintError(thisParserPtr, ERR_OIDLABEL_NOT_FIRST, md); smiFree(md); } else { objectPtr = findObjectByModulenameAndName( yyvsp[-2].id, yyvsp[0].id); if (objectPtr) { yyval.objectPtr = objectPtr; smiFree(yyvsp[-2].id); smiFree(yyvsp[0].id); } else { importPtr = findImportByModulenameAndName( yyvsp[-2].id, yyvsp[0].id, thisModulePtr); if (!importPtr || (importPtr->kind == KIND_NOTFOUND)) { /* TODO: check: $1 == thisModule ? */ /* * If we are in a MODULE-COMPLIANCE * statement with a given MODULE... */ if (thisParserPtr->complianceModulePtr) { objectPtr = findObjectByModuleAndName( thisParserPtr->complianceModulePtr, yyvsp[-2].id); if (objectPtr) { importPtr = addImport( yyvsp[-2].id, thisParserPtr); setImportModulename(importPtr, thisParserPtr->complianceModulePtr->export.name); addImportFlags(importPtr, FLAG_INCOMPLIANCE); importPtr->use++; } else { objectPtr = addObject(yyvsp[-2].id, thisParserPtr->pendingNodePtr, 0, FLAG_INCOMPLETE, thisParserPtr); smiPrintError(thisParserPtr, ERR_IDENTIFIER_NOT_IN_MODULE, yyvsp[-2].id, thisParserPtr->complianceModulePtr->export.name); } } else if (thisParserPtr->capabilitiesModulePtr) { objectPtr = findObjectByModuleAndName( thisParserPtr->capabilitiesModulePtr, yyvsp[-2].id); if (objectPtr) { importPtr = addImport( yyvsp[-2].id, thisParserPtr); setImportModulename(importPtr, thisParserPtr->capabilitiesModulePtr-> export.name); addImportFlags(importPtr, FLAG_INCOMPLIANCE); importPtr->use++; } else { objectPtr = addObject(yyvsp[-2].id, thisParserPtr->pendingNodePtr, 0, FLAG_INCOMPLETE, thisParserPtr); smiPrintError(thisParserPtr, ERR_IDENTIFIER_NOT_IN_MODULE, yyvsp[-2].id, thisParserPtr->capabilitiesModulePtr->export.name); } } else { /* * forward referenced node. * create it, * marked with FLAG_INCOMPLETE. */ objectPtr = addObject(yyvsp[0].id, thisParserPtr->pendingNodePtr, 0, FLAG_INCOMPLETE, thisParserPtr); smiFree(yyvsp[-2].id); } yyval.objectPtr = objectPtr; } else { /* * imported object. */ importPtr->use++; yyval.objectPtr = findObjectByModulenameAndName( importPtr->export.module, yyvsp[0].id); smiFree(yyvsp[-2].id); smiFree(yyvsp[0].id); } } if (yyval.objectPtr) thisParserPtr->parentNodePtr = yyval.objectPtr->nodePtr; } ; break;} case 343: #line 6160 "parser-smi.y" { Node *nodePtr; Object *objectPtr; nodePtr = findNodeByParentAndSubid(thisParserPtr->parentNodePtr, yyvsp[0].unsigned32); if (nodePtr && nodePtr->lastObjectPtr && (nodePtr->lastObjectPtr->modulePtr == thisModulePtr)) { /* * hopefully, the last defined Object for * this Node is the one we expect. */ yyval.objectPtr = nodePtr->lastObjectPtr; } else { objectPtr = addObject(NULL, thisParserPtr->parentNodePtr, yyvsp[0].unsigned32, FLAG_INCOMPLETE, thisParserPtr); yyval.objectPtr = objectPtr; } thisParserPtr->parentNodePtr = yyval.objectPtr->nodePtr; ; break;} case 344: #line 6184 "parser-smi.y" { Object *objectPtr = NULL; Object *oldObjectPtr = NULL; Node *oldNodePtr = NULL; /* TODO: search in local module and * in imported modules */ oldNodePtr = findNodeByParentAndSubid( thisParserPtr->parentNodePtr, yyvsp[-1].unsigned32); oldObjectPtr = findObjectByModuleAndName( thisParserPtr->modulePtr, yyvsp[-3].id); if (oldObjectPtr && ((oldObjectPtr->nodePtr->subid != yyvsp[-1].unsigned32) || (oldObjectPtr->nodePtr->parentPtr != thisParserPtr->parentNodePtr))) { smiPrintError(thisParserPtr, ERR_IDENTIFIER_OID_CHANGED, yyvsp[-3].id); smiPrintErrorAtLine(thisParserPtr, ERR_PREVIOUS_DEFINITION, oldObjectPtr->line, oldObjectPtr->export.name); objectPtr = addObject(yyvsp[-3].id, thisParserPtr->parentNodePtr, yyvsp[-1].unsigned32, 0, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_IMPL_OBJECT); yyval.objectPtr = objectPtr; thisParserPtr->parentNodePtr = yyval.objectPtr->nodePtr; } else if (oldNodePtr && oldNodePtr->lastObjectPtr && strcmp(oldNodePtr->lastObjectPtr->export.name, yyvsp[-3].id)) { smiPrintError(thisParserPtr, ERR_OIDLABEL_CHANGED, yyvsp[-3].id, oldNodePtr->lastObjectPtr->export.name); smiPrintErrorAtLine(thisParserPtr, ERR_PREVIOUS_DEFINITION, oldNodePtr->lastObjectPtr->line, oldNodePtr->lastObjectPtr->export.name); objectPtr = addObject(yyvsp[-3].id, thisParserPtr->parentNodePtr, yyvsp[-1].unsigned32, 0, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_IMPL_OBJECT); yyval.objectPtr = objectPtr; thisParserPtr->parentNodePtr = yyval.objectPtr->nodePtr; } else { objectPtr = addObject(yyvsp[-3].id, thisParserPtr->parentNodePtr, yyvsp[-1].unsigned32, 0, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_IMPL_OBJECT); yyval.objectPtr = objectPtr; thisParserPtr->parentNodePtr = yyval.objectPtr->nodePtr; } ; break;} case 345: #line 6243 "parser-smi.y" { Object *objectPtr = NULL; Object *oldObjectPtr = NULL; Node *oldNodePtr = NULL; char *md; md = smiMalloc(sizeof(char) * (strlen(yyvsp[-5].id) + strlen(yyvsp[-3].id) + 2)); sprintf(md, "%s.%s", yyvsp[-5].id, yyvsp[-3].id); oldNodePtr = findNodeByParentAndSubid( thisParserPtr->parentNodePtr, yyvsp[-1].unsigned32); oldObjectPtr = findObjectByModulenameAndName( yyvsp[-5].id, yyvsp[-3].id); if (oldObjectPtr && ((oldObjectPtr->nodePtr->subid != yyvsp[-1].unsigned32) || (oldObjectPtr->nodePtr->parentPtr != thisParserPtr->parentNodePtr))) { smiPrintError(thisParserPtr, ERR_ILLEGALLY_QUALIFIED, md); smiPrintError(thisParserPtr, ERR_IDENTIFIER_OID_CHANGED, yyvsp[-3].id); smiPrintErrorAtLine(thisParserPtr, ERR_PREVIOUS_DEFINITION, oldObjectPtr->line, oldObjectPtr->export.name); objectPtr = addObject(yyvsp[-3].id, thisParserPtr->parentNodePtr, yyvsp[-1].unsigned32, 0, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_IMPL_OBJECT); yyval.objectPtr = objectPtr; thisParserPtr->parentNodePtr = yyval.objectPtr->nodePtr; } else if (oldNodePtr && oldNodePtr->lastObjectPtr && strcmp(oldNodePtr->lastObjectPtr->export.name, yyvsp[-3].id)) { smiPrintError(thisParserPtr, ERR_ILLEGALLY_QUALIFIED, md); smiPrintError(thisParserPtr, ERR_OIDLABEL_CHANGED, yyvsp[-3].id, oldNodePtr->lastObjectPtr->export.name); smiPrintErrorAtLine(thisParserPtr, ERR_PREVIOUS_DEFINITION, oldNodePtr->lastObjectPtr->line, oldNodePtr->lastObjectPtr->export.name); objectPtr = addObject(yyvsp[-3].id, thisParserPtr->parentNodePtr, yyvsp[-1].unsigned32, 0, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_IMPL_OBJECT); yyval.objectPtr = objectPtr; thisParserPtr->parentNodePtr = yyval.objectPtr->nodePtr; } else { smiPrintError(thisParserPtr, ERR_ILLEGALLY_QUALIFIED, md); objectPtr = addObject(yyvsp[-3].id, thisParserPtr->parentNodePtr, yyvsp[-1].unsigned32, 0, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_IMPL_OBJECT); yyval.objectPtr = objectPtr; thisParserPtr->parentNodePtr = yyval.objectPtr->nodePtr; } smiFree(md); ; break;} case 346: #line 6312 "parser-smi.y" { yyval.text = NULL; ; break;} case 347: #line 6316 "parser-smi.y" { yyval.err = 0; ; break;} case 348: #line 6318 "parser-smi.y" { yyval.err = 0; ; break;} case 349: #line 6322 "parser-smi.y" { yyval.err = 0; ; break;} case 350: #line 6324 "parser-smi.y" { yyval.err = 0; ; break;} case 351: #line 6328 "parser-smi.y" { thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_OBJECTGROUP; checkNameLen(thisParserPtr, yyvsp[0].id, ERR_OIDNAME_32, ERR_OIDNAME_64); smiCheckObjectName(thisParserPtr, thisModulePtr, yyvsp[0].id); ; break;} case 352: #line 6338 "parser-smi.y" { Import *importPtr; if (thisModulePtr->export.language == SMI_LANGUAGE_UNKNOWN) thisModulePtr->export.language = SMI_LANGUAGE_SMIV2; importPtr = findImportByName("OBJECT-GROUP", thisModulePtr); if (importPtr) { importPtr->use++; } else { smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "OBJECT-GROUP", "SNMPv2-CONF"); } ; break;} case 353: #line 6357 "parser-smi.y" { checkDescr(thisParserPtr, yyvsp[0].text); ; break;} case 354: #line 6362 "parser-smi.y" { Object *objectPtr; objectPtr = yyvsp[-1].objectPtr; smiCheckObjectReuse(thisParserPtr, yyvsp[-14].id, &objectPtr); objectPtr = setObjectName(objectPtr, yyvsp[-14].id, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_OBJECTGROUP); setObjectLine(objectPtr, thisParserPtr->firstStatementLine, thisParserPtr); addObjectFlags(objectPtr, FLAG_REGISTERED); deleteObjectFlags(objectPtr, FLAG_INCOMPLETE); setObjectStatus(objectPtr, yyvsp[-8].status); setObjectDescription(objectPtr, yyvsp[-6].text, thisParserPtr); if (yyvsp[-4].text) { setObjectReference(objectPtr, yyvsp[-4].text, thisParserPtr); } setObjectAccess(objectPtr, SMI_ACCESS_NOT_ACCESSIBLE); setObjectList(objectPtr, yyvsp[-10].listPtr); yyval.err = 0; ; break;} case 355: #line 6388 "parser-smi.y" { thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_NOTIFICATIONGROUP; checkNameLen(thisParserPtr, yyvsp[0].id, ERR_OIDNAME_32, ERR_OIDNAME_64); smiCheckObjectName(thisParserPtr, thisModulePtr, yyvsp[0].id); ; break;} case 356: #line 6398 "parser-smi.y" { Import *importPtr; if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "NOTIFICATION-GROUP"); if (thisModulePtr->export.language == SMI_LANGUAGE_UNKNOWN) thisModulePtr->export.language = SMI_LANGUAGE_SMIV2; importPtr = findImportByName("NOTIFICATION-GROUP", thisModulePtr); if (importPtr) { importPtr->use++; } else { smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "NOTIFICATION-GROUP", "SNMPv2-CONF"); } ; break;} case 357: #line 6420 "parser-smi.y" { checkDescr(thisParserPtr, yyvsp[0].text); ; break;} case 358: #line 6425 "parser-smi.y" { Object *objectPtr; objectPtr = yyvsp[-1].objectPtr; smiCheckObjectReuse(thisParserPtr, yyvsp[-14].id, &objectPtr); objectPtr = setObjectName(objectPtr, yyvsp[-14].id, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_NOTIFICATIONGROUP); setObjectLine(objectPtr, thisParserPtr->firstStatementLine, thisParserPtr); addObjectFlags(objectPtr, FLAG_REGISTERED); deleteObjectFlags(objectPtr, FLAG_INCOMPLETE); setObjectStatus(objectPtr, yyvsp[-8].status); setObjectDescription(objectPtr, yyvsp[-6].text, thisParserPtr); if (yyvsp[-4].text) { setObjectReference(objectPtr, yyvsp[-4].text, thisParserPtr); } setObjectAccess(objectPtr, SMI_ACCESS_NOT_ACCESSIBLE); setObjectList(objectPtr, yyvsp[-10].listPtr); yyval.err = 0; ; break;} case 359: #line 6452 "parser-smi.y" { thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_MODULECOMPLIANCE; checkNameLen(thisParserPtr, yyvsp[0].id, ERR_OIDNAME_32, ERR_OIDNAME_64); smiCheckObjectName(thisParserPtr, thisModulePtr, yyvsp[0].id); ; break;} case 360: #line 6462 "parser-smi.y" { Import *importPtr; if (thisModulePtr->export.language == SMI_LANGUAGE_UNKNOWN) thisModulePtr->export.language = SMI_LANGUAGE_SMIV2; importPtr = findImportByName("MODULE-COMPLIANCE", thisModulePtr); if (importPtr) { importPtr->use++; } else { smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "MODULE-COMPLIANCE", "SNMPv2-CONF"); } ; break;} case 361: #line 6480 "parser-smi.y" { checkDescr(thisParserPtr, yyvsp[0].text); ; break;} case 362: #line 6486 "parser-smi.y" { Object *objectPtr; Option *optionPtr; Refinement *refinementPtr; List *listPtr; objectPtr = yyvsp[-1].objectPtr; smiCheckObjectReuse(thisParserPtr, yyvsp[-14].id, &objectPtr); setObjectName(objectPtr, yyvsp[-14].id, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_MODULECOMPLIANCE); setObjectLine(objectPtr, thisParserPtr->firstStatementLine, thisParserPtr); addObjectFlags(objectPtr, FLAG_REGISTERED); deleteObjectFlags(objectPtr, FLAG_INCOMPLETE); setObjectStatus(objectPtr, yyvsp[-9].status); setObjectDescription(objectPtr, yyvsp[-7].text, thisParserPtr); if (yyvsp[-5].text) { setObjectReference(objectPtr, yyvsp[-5].text, thisParserPtr); } setObjectAccess(objectPtr, SMI_ACCESS_NOT_ACCESSIBLE); setObjectList(objectPtr, yyvsp[-4].compl.mandatorylistPtr); objectPtr->optionlistPtr = yyvsp[-4].compl.optionlistPtr; objectPtr->refinementlistPtr = yyvsp[-4].compl.refinementlistPtr; if (yyvsp[-4].compl.optionlistPtr) { for (listPtr = yyvsp[-4].compl.optionlistPtr; listPtr; listPtr = listPtr->nextPtr) { optionPtr = ((Option *)(listPtr->ptr)); optionPtr->compliancePtr = objectPtr; } } /* * Dirty: Fake the types' names in the * refinement list: * ``++type'' * ``++writetype'' */ if (yyvsp[-4].compl.refinementlistPtr) { for (listPtr = yyvsp[-4].compl.refinementlistPtr; listPtr; listPtr = listPtr->nextPtr) { refinementPtr = ((Refinement *)(listPtr->ptr)); refinementPtr->compliancePtr = objectPtr; } } yyval.err = 0; ; break;} case 363: #line 6545 "parser-smi.y" { yyval.compl = yyvsp[0].compl; ; break;} case 364: #line 6551 "parser-smi.y" { yyval.compl = yyvsp[0].compl; ; break;} case 365: #line 6555 "parser-smi.y" { List *listPtr; /* concatenate lists in $1 and $2 */ if (yyvsp[-1].compl.mandatorylistPtr) { for (listPtr = yyvsp[-1].compl.mandatorylistPtr; listPtr->nextPtr; listPtr = listPtr->nextPtr); listPtr->nextPtr = yyvsp[0].compl.mandatorylistPtr; yyval.compl.mandatorylistPtr = yyvsp[-1].compl.mandatorylistPtr; } else { yyval.compl.mandatorylistPtr = yyvsp[0].compl.mandatorylistPtr; } if (yyvsp[-1].compl.optionlistPtr) { for (listPtr = yyvsp[-1].compl.optionlistPtr; listPtr->nextPtr; listPtr = listPtr->nextPtr); listPtr->nextPtr = yyvsp[0].compl.optionlistPtr; yyval.compl.optionlistPtr = yyvsp[-1].compl.optionlistPtr; } else { yyval.compl.optionlistPtr = yyvsp[0].compl.optionlistPtr; } if (yyvsp[-1].compl.refinementlistPtr) { for (listPtr = yyvsp[-1].compl.refinementlistPtr; listPtr->nextPtr; listPtr = listPtr->nextPtr); listPtr->nextPtr = yyvsp[0].compl.refinementlistPtr; yyval.compl.refinementlistPtr = yyvsp[-1].compl.refinementlistPtr; } else { yyval.compl.refinementlistPtr = yyvsp[0].compl.refinementlistPtr; } ; break;} case 366: #line 6590 "parser-smi.y" { /* * Remember the module. SMIv2 is broken by * design to allow subsequent clauses to * refer identifiers that are not * imported. Although, SMIv2 does not * require, we will fake it by inserting * appropriate imports. */ if (yyvsp[0].modulePtr == thisModulePtr) thisParserPtr->complianceModulePtr = NULL; else thisParserPtr->complianceModulePtr = yyvsp[0].modulePtr; ; break;} case 367: #line 6606 "parser-smi.y" { yyval.compl.mandatorylistPtr = yyvsp[-1].listPtr; yyval.compl.optionlistPtr = yyvsp[0].compl.optionlistPtr; yyval.compl.refinementlistPtr = yyvsp[0].compl.refinementlistPtr; if (thisParserPtr->complianceModulePtr) { checkImports(thisParserPtr->complianceModulePtr, thisParserPtr); thisParserPtr->complianceModulePtr = NULL; } ; break;} case 368: #line 6619 "parser-smi.y" { yyval.modulePtr = findModuleByName(yyvsp[-1].id); /* TODO: handle objectIdentifier */ if (!yyval.modulePtr) { yyval.modulePtr = loadModule(yyvsp[-1].id, thisParserPtr); } smiFree(yyvsp[-1].id); ; break;} case 369: #line 6628 "parser-smi.y" { yyval.modulePtr = findModuleByName(yyvsp[0].id); if (!yyval.modulePtr) { yyval.modulePtr = loadModule(yyvsp[0].id, thisParserPtr); } smiFree(yyvsp[0].id); ; break;} case 370: #line 6637 "parser-smi.y" { yyval.modulePtr = thisModulePtr; ; break;} case 371: #line 6643 "parser-smi.y" { yyval.listPtr = yyvsp[-1].listPtr; ; break;} case 372: #line 6647 "parser-smi.y" { yyval.listPtr = NULL; ; break;} case 373: #line 6653 "parser-smi.y" { yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].objectPtr; yyval.listPtr->nextPtr = NULL; ; break;} case 374: #line 6659 "parser-smi.y" { List *p, *pp; p = smiMalloc(sizeof(List)); p->ptr = yyvsp[0].objectPtr; p->nextPtr = NULL; for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; ; break;} case 375: #line 6672 "parser-smi.y" { /* TODO: check that objectIdentifier is found, is defined in thisParserPtr->complianceModulePtr, and is a group node. */ Import *importPtr; yyval.objectPtr = yyvsp[0].objectPtr; if (thisParserPtr->complianceModulePtr) { yyval.objectPtr = findObjectByModuleAndName( thisParserPtr->complianceModulePtr, yyvsp[0].objectPtr->export.name); } if (thisParserPtr->complianceModulePtr && yyvsp[0].objectPtr->export.name) { importPtr = findImportByModulenameAndName( thisParserPtr->complianceModulePtr->export.name, yyvsp[0].objectPtr->export.name, thisModulePtr); if (importPtr) importPtr->use++; } ; break;} case 376: #line 6695 "parser-smi.y" { yyval.compl.mandatorylistPtr = NULL; yyval.compl.optionlistPtr = yyvsp[0].compl.optionlistPtr; yyval.compl.refinementlistPtr = yyvsp[0].compl.refinementlistPtr; ; break;} case 377: #line 6701 "parser-smi.y" { yyval.compl.mandatorylistPtr = NULL; yyval.compl.optionlistPtr = NULL; yyval.compl.refinementlistPtr = NULL; ; break;} case 378: #line 6709 "parser-smi.y" { yyval.compl = yyvsp[0].compl; ; break;} case 379: #line 6713 "parser-smi.y" { List *listPtr; int stop; yyval.compl.mandatorylistPtr = NULL; /* check for duplicates in optionlist */ stop = 0; if (yyvsp[0].compl.optionlistPtr) { for (listPtr = yyvsp[-1].compl.optionlistPtr; listPtr; listPtr = listPtr->nextPtr) { if (((Option *)listPtr->ptr)->objectPtr == ((Option *)yyvsp[0].compl.optionlistPtr->ptr)->objectPtr) { smiPrintError(thisParserPtr, ERR_OPTIONALGROUP_ALREADY_EXISTS, ((Option *)yyvsp[0].compl.optionlistPtr->ptr)->objectPtr->export.name); stop = 1; yyval.compl.optionlistPtr = yyvsp[-1].compl.optionlistPtr; } } } /* concatenate optionlists */ if (yyvsp[-1].compl.optionlistPtr) { for (listPtr = yyvsp[-1].compl.optionlistPtr; listPtr->nextPtr; listPtr = listPtr->nextPtr); if (!stop) { listPtr->nextPtr = yyvsp[0].compl.optionlistPtr; } yyval.compl.optionlistPtr = yyvsp[-1].compl.optionlistPtr; } else { yyval.compl.optionlistPtr = yyvsp[0].compl.optionlistPtr; } /* check for duplicates in refinementlist */ stop = 0; if (yyvsp[0].compl.refinementlistPtr) { for (listPtr = yyvsp[-1].compl.refinementlistPtr; listPtr; listPtr = listPtr->nextPtr) { if (((Refinement *)listPtr->ptr)->objectPtr == ((Refinement *)yyvsp[0].compl.refinementlistPtr->ptr)->objectPtr) { smiPrintError(thisParserPtr, ERR_REFINEMENT_ALREADY_EXISTS, ((Refinement *)yyvsp[0].compl.refinementlistPtr->ptr)->objectPtr->export.name); stop = 1; yyval.compl.refinementlistPtr = yyvsp[-1].compl.refinementlistPtr; } } } /* concatenate refinementlists */ if (yyvsp[-1].compl.refinementlistPtr) { for (listPtr = yyvsp[-1].compl.refinementlistPtr; listPtr->nextPtr; listPtr = listPtr->nextPtr); if (!stop) { listPtr->nextPtr = yyvsp[0].compl.refinementlistPtr; } yyval.compl.refinementlistPtr = yyvsp[-1].compl.refinementlistPtr; } else { yyval.compl.refinementlistPtr = yyvsp[0].compl.refinementlistPtr; } ; break;} case 380: #line 6780 "parser-smi.y" { yyval.compl.mandatorylistPtr = NULL; yyval.compl.optionlistPtr = yyvsp[0].listPtr; yyval.compl.refinementlistPtr = NULL; ; break;} case 381: #line 6786 "parser-smi.y" { yyval.compl.mandatorylistPtr = NULL; yyval.compl.optionlistPtr = NULL; yyval.compl.refinementlistPtr = yyvsp[0].listPtr; ; break;} case 382: #line 6794 "parser-smi.y" { thisParserPtr->firstNestedStatementLine = thisParserPtr->line; ; break;} case 383: #line 6799 "parser-smi.y" { Import *importPtr; if (thisParserPtr->complianceModulePtr && yyvsp[-2].objectPtr->export.name) { importPtr = findImportByModulenameAndName( thisParserPtr->complianceModulePtr->export.name, yyvsp[-2].objectPtr->export.name, thisModulePtr); if (importPtr) importPtr->use++; } checkDescr(thisParserPtr, yyvsp[0].text); yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->nextPtr = NULL; yyval.listPtr->ptr = smiMalloc(sizeof(Option)); ((Option *)(yyval.listPtr->ptr))->line = thisParserPtr->firstNestedStatementLine; ((Option *)(yyval.listPtr->ptr))->objectPtr = yyvsp[-2].objectPtr; if (! (thisModulePtr->flags & SMI_FLAG_NODESCR)) { ((Option *)(yyval.listPtr->ptr))->export.description = yyvsp[0].text; } else { smiFree(yyvsp[0].text); } ; break;} case 384: #line 6827 "parser-smi.y" { thisParserPtr->firstNestedStatementLine = thisParserPtr->line; ; break;} case 385: #line 6835 "parser-smi.y" { Import *importPtr; if (thisParserPtr->complianceModulePtr && yyvsp[-5].objectPtr->export.name) { importPtr = findImportByModulenameAndName( thisParserPtr->complianceModulePtr->export.name, yyvsp[-5].objectPtr->export.name, thisModulePtr); if (importPtr) importPtr->use++; } checkDescr(thisParserPtr, yyvsp[0].text); thisParserPtr->flags &= ~FLAG_CREATABLE; yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->nextPtr = NULL; yyval.listPtr->ptr = smiMalloc(sizeof(Refinement)); ((Refinement *)(yyval.listPtr->ptr))->line = thisParserPtr->firstNestedStatementLine; ((Refinement *)(yyval.listPtr->ptr))->objectPtr = yyvsp[-5].objectPtr; ((Refinement *)(yyval.listPtr->ptr))->typePtr = yyvsp[-4].typePtr; if (yyvsp[-4].typePtr) { yyvsp[-4].typePtr->parentPtr = yyvsp[-5].objectPtr->typePtr; } ((Refinement *)(yyval.listPtr->ptr))->writetypePtr = yyvsp[-3].typePtr; if (yyvsp[-3].typePtr) { yyvsp[-3].typePtr->parentPtr = yyvsp[-5].objectPtr->typePtr; } ((Refinement *)(yyval.listPtr->ptr))->export.access = yyvsp[-2].access; if (! (thisParserPtr->flags & SMI_FLAG_NODESCR)) { ((Refinement *)(yyval.listPtr->ptr))->export.description = yyvsp[0].text; } else { smiFree(yyvsp[0].text); } ; break;} case 386: #line 6874 "parser-smi.y" { if (yyvsp[0].typePtr->export.name) { yyval.typePtr = duplicateType(yyvsp[0].typePtr, 0, thisParserPtr); } else { yyval.typePtr = yyvsp[0].typePtr; } ; break;} case 387: #line 6882 "parser-smi.y" { yyval.typePtr = NULL; ; break;} case 388: #line 6888 "parser-smi.y" { /* must not be present in PIBs */ if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "WRITE-SYNTAX"); if (yyvsp[0].typePtr->export.name) { yyval.typePtr = duplicateType(yyvsp[0].typePtr, 0, thisParserPtr); } else { yyval.typePtr = yyvsp[0].typePtr; } ; break;} case 389: #line 6899 "parser-smi.y" { yyval.typePtr = NULL; ; break;} case 390: #line 6905 "parser-smi.y" { yyval.typePtr = yyvsp[0].typePtr; ; break;} case 391: #line 6911 "parser-smi.y" { if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "MIN-ACCESS"); yyval.access = yyvsp[0].access; ; break;} case 392: #line 6917 "parser-smi.y" { if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "PIB-MIN-ACCESS"); if (yyvsp[0].access == SMI_ACCESS_REPORT_ONLY) smiPrintError(thisParserPtr, ERR_REPORT_ONLY_IN_PIB_MIN_ACCESS); yyval.access = yyvsp[0].access; ; break;} case 393: #line 6925 "parser-smi.y" { yyval.access = SMI_ACCESS_UNKNOWN; ; break;} case 394: #line 6931 "parser-smi.y" { thisParserPtr->firstStatementLine = thisParserPtr->line; thisParserPtr->currentDecl = SMI_DECL_AGENTCAPABILITIES; checkNameLen(thisParserPtr, yyvsp[0].id, ERR_OIDNAME_32, ERR_OIDNAME_64); smiCheckObjectName(thisParserPtr, thisModulePtr, yyvsp[0].id); ; break;} case 395: #line 6941 "parser-smi.y" { Import *importPtr; if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "AGENT-CAAPABILITIES"); if (thisModulePtr->export.language == SMI_LANGUAGE_UNKNOWN) thisModulePtr->export.language = SMI_LANGUAGE_SMIV2; importPtr = findImportByName("AGENT-CAPABILITIES", thisModulePtr); if (importPtr) { importPtr->use++; } else { smiPrintError(thisParserPtr, ERR_MACRO_NOT_IMPORTED, "AGENT-CAPABILITIES", "SNMPv2-CONF"); } ; break;} case 396: #line 6963 "parser-smi.y" { checkDescr(thisParserPtr, yyvsp[0].text); ; break;} case 397: #line 6969 "parser-smi.y" { Object *objectPtr; objectPtr = yyvsp[-1].objectPtr; smiCheckObjectReuse(thisParserPtr, yyvsp[-16].id, &objectPtr); setObjectName(objectPtr, yyvsp[-16].id, thisParserPtr); setObjectDecl(objectPtr, SMI_DECL_AGENTCAPABILITIES); setObjectLine(objectPtr, thisParserPtr->firstStatementLine, thisParserPtr); addObjectFlags(objectPtr, FLAG_REGISTERED); deleteObjectFlags(objectPtr, FLAG_INCOMPLETE); setObjectStatus(objectPtr, yyvsp[-9].status); setObjectDescription(objectPtr, yyvsp[-7].text, thisParserPtr); if (yyvsp[-5].text) { setObjectReference(objectPtr, yyvsp[-5].text, thisParserPtr); } setObjectAccess(objectPtr, SMI_ACCESS_NOT_ACCESSIBLE); /* * TODO: PRODUCT_RELEASE Text * TODO: ModulePart_Capabilities */ yyval.err = 0; ; break;} case 398: #line 6999 "parser-smi.y" { yyval.err = 0; ; break;} case 399: #line 7001 "parser-smi.y" { yyval.err = 0; ; break;} case 400: #line 7005 "parser-smi.y" { yyval.err = 0; ; break;} case 401: #line 7007 "parser-smi.y" { yyval.err = 0; ; break;} case 402: #line 7011 "parser-smi.y" { /* * Remember the module. SMIv2 is broken by * design to allow subsequent clauses to * refer identifiers that are not * imported. Although, SMIv2 does not * require, we will fake it by inserting * appropriate imports. */ if (yyvsp[0].modulePtr == thisModulePtr) thisParserPtr->capabilitiesModulePtr = NULL; else thisParserPtr->capabilitiesModulePtr = yyvsp[0].modulePtr; ; break;} case 403: #line 7027 "parser-smi.y" { if (thisParserPtr->capabilitiesModulePtr) { checkImports(thisParserPtr->capabilitiesModulePtr, thisParserPtr); thisParserPtr->capabilitiesModulePtr = NULL; } yyval.err = 0; ; break;} case 404: #line 7038 "parser-smi.y" { #if 0 yyval.listPtr = smiMalloc(sizeof(List)); yyval.listPtr->ptr = yyvsp[0].listPtr; yyval.listPtr->nextPtr = NULL; #else yyval.listPtr = NULL; #endif ; break;} case 405: #line 7048 "parser-smi.y" { #if 0 List *p, *pp; p = smiMalloc(sizeof(List)); p->ptr = yyvsp[0].listPtr; p->nextPtr = NULL; for (pp = yyvsp[-2].listPtr; pp->nextPtr; pp = pp->nextPtr); pp->nextPtr = p; yyval.listPtr = yyvsp[-2].listPtr; #else yyval.listPtr = NULL; #endif ; break;} case 406: #line 7065 "parser-smi.y" { yyval.listPtr = NULL; ; break;} case 407: #line 7071 "parser-smi.y" { yyval.modulePtr = findModuleByName(yyvsp[-1].id); /* TODO: handle objectIdentifier */ if (!yyval.modulePtr) { yyval.modulePtr = loadModule(yyvsp[-1].id, thisParserPtr); } smiFree(yyvsp[-1].id); ; break;} case 408: #line 7080 "parser-smi.y" { yyval.modulePtr = findModuleByName(yyvsp[0].id); if (!yyval.modulePtr) { yyval.modulePtr = loadModule(yyvsp[0].id, thisParserPtr); } smiFree(yyvsp[0].id); ; break;} case 409: #line 7090 "parser-smi.y" { yyval.err = 0; ; break;} case 410: #line 7092 "parser-smi.y" { yyval.err = 0; ; break;} case 411: #line 7096 "parser-smi.y" { yyval.err = 0; ; break;} case 412: #line 7098 "parser-smi.y" { yyval.err = 0; ; break;} case 413: #line 7102 "parser-smi.y" { if (yyvsp[0].objectPtr) { variationkind = yyvsp[0].objectPtr->export.nodekind; } else { variationkind = SMI_NODEKIND_UNKNOWN; } ; break;} case 414: #line 7110 "parser-smi.y" { if (variationkind == SMI_NODEKIND_NOTIFICATION) { smiPrintError(thisParserPtr, ERR_NOTIFICATION_VARIATION_SYNTAX); } ; break;} case 415: #line 7117 "parser-smi.y" { if (variationkind == SMI_NODEKIND_NOTIFICATION) { smiPrintError(thisParserPtr, ERR_NOTIFICATION_VARIATION_WRITESYNTAX); } ; break;} case 416: #line 7125 "parser-smi.y" { if (variationkind == SMI_NODEKIND_NOTIFICATION) { smiPrintError(thisParserPtr, ERR_NOTIFICATION_VARIATION_CREATION); } ; break;} case 417: #line 7132 "parser-smi.y" { if (variationkind == SMI_NODEKIND_NOTIFICATION) { smiPrintError(thisParserPtr, ERR_NOTIFICATION_VARIATION_DEFVAL); } else if (yyvsp[0].valuePtr) { adjustDefval(thisParserPtr, yyvsp[0].valuePtr, yyvsp[-9].objectPtr->typePtr, thisParserPtr->line); smiCheckValueType(thisParserPtr, yyvsp[0].valuePtr, yyvsp[-9].objectPtr->typePtr, thisParserPtr->line); } ; break;} case 418: #line 7146 "parser-smi.y" { thisParserPtr->flags &= ~FLAG_CREATABLE; yyval.err = 0; variationkind = SMI_NODEKIND_UNKNOWN; checkDescr(thisParserPtr, yyvsp[0].text); ; break;} case 419: #line 7156 "parser-smi.y" { yyval.access = yyvsp[0].access; ; break;} case 420: #line 7158 "parser-smi.y" { yyval.access = 0; ; break;} case 421: #line 7162 "parser-smi.y" { if (!strcmp(yyvsp[0].id, "not-implemented")) { yyval.access = SMI_ACCESS_NOT_IMPLEMENTED; } else if (!strcmp(yyvsp[0].id, "accessible-for-notify")) { if (variationkind == SMI_NODEKIND_NOTIFICATION) { smiPrintError(thisParserPtr, ERR_INVALID_NOTIFICATION_VARIATION_ACCESS, yyvsp[0].id); yyval.access = SMI_ACCESS_UNKNOWN; } else { yyval.access = SMI_ACCESS_NOTIFY; } } else if (!strcmp(yyvsp[0].id, "read-only")) { if (variationkind == SMI_NODEKIND_NOTIFICATION) { smiPrintError(thisParserPtr, ERR_INVALID_NOTIFICATION_VARIATION_ACCESS, yyvsp[0].id); yyval.access = SMI_ACCESS_UNKNOWN; } else { yyval.access = SMI_ACCESS_READ_ONLY; } } else if (!strcmp(yyvsp[0].id, "read-write")) { if (variationkind == SMI_NODEKIND_NOTIFICATION) { smiPrintError(thisParserPtr, ERR_INVALID_NOTIFICATION_VARIATION_ACCESS, yyvsp[0].id); yyval.access = SMI_ACCESS_UNKNOWN; } else { yyval.access = SMI_ACCESS_READ_WRITE; } } else if (!strcmp(yyvsp[0].id, "read-create")) { if (variationkind == SMI_NODEKIND_NOTIFICATION) { smiPrintError(thisParserPtr, ERR_INVALID_NOTIFICATION_VARIATION_ACCESS, yyvsp[0].id); yyval.access = SMI_ACCESS_UNKNOWN; } else { yyval.access = SMI_ACCESS_READ_WRITE; } } else if (!strcmp(yyvsp[0].id, "write-only")) { if (variationkind == SMI_NODEKIND_NOTIFICATION) { smiPrintError(thisParserPtr, ERR_INVALID_NOTIFICATION_VARIATION_ACCESS, yyvsp[0].id); yyval.access = SMI_ACCESS_UNKNOWN; } else { yyval.access = SMI_ACCESS_READ_WRITE; /* TODO */ smiPrintError(thisParserPtr, ERR_SMIV2_WRITE_ONLY); } } else { smiPrintError(thisParserPtr, ERR_INVALID_VARIATION_ACCESS, yyvsp[0].id); yyval.access = SMI_ACCESS_UNKNOWN; } ; break;} case 422: #line 7227 "parser-smi.y" { yyval.err = 0; ; break;} case 423: #line 7229 "parser-smi.y" { yyval.err = 0; ; break;} case 424: #line 7233 "parser-smi.y" { yyval.err = 0; ; break;} case 425: #line 7235 "parser-smi.y" { yyval.err = 0; ; break;} case 426: #line 7239 "parser-smi.y" { yyval.err = 0; ; break;} } #line 705 "/usr/local/share/bison/bison.simple" yyvsp -= yylen; yyssp -= yylen; #if YYLSP_NEEDED yylsp -= yylen; #endif #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif *++yyvsp = yyval; #if YYLSP_NEEDED *++yylsp = yyloc; #endif /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTBASE] + *yyssp; if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) { YYSIZE_T yysize = 0; char *yymsg; int yyx, yycount; yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("parse error, unexpected ") + 1; yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "parse error, unexpected "); yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); if (yycount < 5) { yycount = 0; for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); yyp = yystpcpy (yyp, yytname[yyx]); yycount++; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("parse error; also virtual memory exhausted"); } else #endif /* defined (YYERROR_VERBOSE) */ yyerror ("parse error"); } goto yyerrlab1; /*--------------------------------------------------. | yyerrlab1 -- error raised explicitly by an action | `--------------------------------------------------*/ yyerrlab1: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) YYABORT; YYDPRINTF ((stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1])); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; /*-------------------------------------------------------------------. | yyerrdefault -- current state does not do anything special for the | | error token. | `-------------------------------------------------------------------*/ yyerrdefault: #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ /* If its default is to accept any token, ok. Otherwise pop it. */ yyn = yydefact[yystate]; if (yyn) goto yydefault; #endif /*---------------------------------------------------------------. | yyerrpop -- pop the current state because it cannot handle the | | error token | `---------------------------------------------------------------*/ yyerrpop: if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp; #if YYLSP_NEEDED yylsp--; #endif #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "Error: state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif /*--------------. | yyerrhandle. | `--------------*/ yyerrhandle: yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; yyn += YYTERROR; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) goto yyerrdefault; yyn = yytable[yyn]; if (yyn < 0) { if (yyn == YYFLAG) goto yyerrpop; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; /*---------------------------------------------. | yyoverflowab -- parser overflow comes here. | `---------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 7242 "parser-smi.y" #endif