1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
61 /* Substitute the variable and function names. */
62 #define yyparse smiparse
64 #define yyerror smierror
65 #define yylval smilval
66 #define yychar smichar
67 #define yydebug smidebug
68 #define yynerrs sminerrs
74 /* Put the tokens into the symbol table, so that GDB and other debuggers
78 COLON_COLON_EQUAL = 259,
79 UPPERCASE_IDENTIFIER = 260,
80 LOWERCASE_IDENTIFIER = 261,
84 NEGATIVENUMBER64 = 265,
89 AGENT_CAPABILITIES = 270,
96 CREATION_REQUIRES = 277,
116 INSTALL_ERRORS = 297,
123 MANDATORY_GROUPS = 304,
127 MODULE_COMPLIANCE = 308,
128 MODULE_IDENTITY = 309,
129 NOT_ACCESSIBLE = 310,
131 NOTIFICATION_GROUP = 312,
132 NOTIFICATION_TYPE = 313,
135 OBJECT_IDENTITY = 316,
143 PIB_DEFINITIONS = 324,
145 PIB_MIN_ACCESS = 326,
146 PIB_REFERENCES = 327,
149 PRODUCT_RELEASE = 330,
156 SUBJECT_CATEGORIES = 337,
159 TEXTUAL_CONVENTION = 340,
175 #define COLON_COLON_EQUAL 259
176 #define UPPERCASE_IDENTIFIER 260
177 #define LOWERCASE_IDENTIFIER 261
179 #define NEGATIVENUMBER 263
181 #define NEGATIVENUMBER64 265
182 #define BIN_STRING 266
183 #define HEX_STRING 267
184 #define QUOTED_STRING 268
186 #define AGENT_CAPABILITIES 270
187 #define APPLICATION 271
192 #define CONTACT_INFO 276
193 #define CREATION_REQUIRES 277
194 #define COUNTER32 278
195 #define COUNTER64 279
196 #define DEFINITIONS 280
198 #define DESCRIPTION 282
199 #define DISPLAY_HINT 283
201 #define ENTERPRISE 285
207 #define IDENTIFIER 291
213 #define INSTALL_ERRORS 297
215 #define INTEGER32 299
216 #define INTEGER64 300
217 #define IPADDRESS 301
218 #define LAST_UPDATED 302
220 #define MANDATORY_GROUPS 304
221 #define MAX_ACCESS 305
222 #define MIN_ACCESS 306
224 #define MODULE_COMPLIANCE 308
225 #define MODULE_IDENTITY 309
226 #define NOT_ACCESSIBLE 310
227 #define NOTIFICATIONS 311
228 #define NOTIFICATION_GROUP 312
229 #define NOTIFICATION_TYPE 313
231 #define OBJECT_GROUP 315
232 #define OBJECT_IDENTITY 316
233 #define OBJECT_TYPE 317
237 #define ORGANIZATION 321
239 #define PIB_ACCESS 323
240 #define PIB_DEFINITIONS 324
241 #define PIB_INDEX 325
242 #define PIB_MIN_ACCESS 326
243 #define PIB_REFERENCES 327
245 #define POLICY_ACCESS 329
246 #define PRODUCT_RELEASE 330
247 #define REFERENCE 331
253 #define SUBJECT_CATEGORIES 337
256 #define TEXTUAL_CONVENTION 340
257 #define TIMETICKS 341
258 #define TRAP_TYPE 342
259 #define UNIQUENESS 343
261 #define UNIVERSAL 345
262 #define UNSIGNED32 346
263 #define UNSIGNED64 347
265 #define VARIABLES 349
266 #define VARIATION 350
267 #define WRITE_SYNTAX 351
272 /* Copy the first part of user declarations. */
273 #line 14 "parser-smi.y"
288 #if defined(_MSC_VER)
294 #include "parser-smi.h"
295 #include "scanner-smi.h"
300 #ifdef HAVE_DMALLOC_H
307 * These arguments are passed to yyparse() and yylex().
309 #define YYPARSE_PARAM parserPtr
310 #define YYLEX_PARAM parserPtr
314 #define thisParserPtr ((Parser *)parserPtr)
315 #define thisModulePtr (((Parser *)parserPtr)->modulePtr)
320 * NOTE: The argument lvalp is not really a void pointer. Unfortunately,
321 * we don't know it better at this point. bison generated C code declares
322 * YYSTYPE just a few lines below based on the `%union' declaration.
324 extern int yylex(void *lvalp, Parser *parserPtr);
328 static int impliedFlag;
329 static SmiNodekind variationkind;
330 static SmiBasetype defaultBasetype;
331 static int indexFlag;
334 * Values for the indexFlag variable
336 #define INDEXFLAG_NONE 0
337 #define INDEXFLAG_PIBINDEX 1
338 #define INDEXFLAG_AUGMENTS 2
339 #define INDEXFLAG_EXTENDS 3
342 #define SMI_EPOCH 631152000 /* 01 Jan 1990 00:00:00 */
346 static char *convertImportv2[] = {
347 "RFC1155-SMI", "internet", "SNMPv2-SMI", "internet",
348 "RFC1155-SMI", "directory", "SNMPv2-SMI", "directory",
349 "RFC1155-SMI", "mgmt", "SNMPv2-SMI", "mgmt",
350 "RFC1155-SMI", "experimental", "SNMPv2-SMI", "experimental",
351 "RFC1155-SMI", "private", "SNMPv2-SMI", "private",
352 "RFC1155-SMI", "enterprises", "SNMPv2-SMI", "enterprises",
353 "RFC1155-SMI", "IpAddress", "SNMPv2-SMI", "IpAddress",
354 "RFC1155-SMI", "Counter", "SNMPv2-SMI", "Counter32",
355 "RFC1155-SMI", "Gauge", "SNMPv2-SMI", "Gauge32",
356 "RFC1155-SMI", "TimeTicks", "SNMPv2-SMI", "TimeTicks",
357 "RFC1155-SMI", "Opaque", "SNMPv2-SMI", "Opaque",
358 "RFC1065-SMI", "internet", "SNMPv2-SMI", "internet",
359 "RFC1065-SMI", "directory", "SNMPv2-SMI", "directory",
360 "RFC1065-SMI", "mgmt", "SNMPv2-SMI", "mgmt",
361 "RFC1065-SMI", "experimental", "SNMPv2-SMI", "experimental",
362 "RFC1065-SMI", "private", "SNMPv2-SMI", "private",
363 "RFC1065-SMI", "enterprises", "SNMPv2-SMI", "enterprises",
364 "RFC1065-SMI", "IpAddress", "SNMPv2-SMI", "IpAddress",
365 "RFC1065-SMI", "Counter", "SNMPv2-SMI", "Counter32",
366 "RFC1065-SMI", "Gauge", "SNMPv2-SMI", "Gauge32",
367 "RFC1065-SMI", "TimeTicks", "SNMPv2-SMI", "TimeTicks",
368 "RFC1065-SMI", "Opaque", "SNMPv2-SMI", "Opaque",
369 "RFC1213-MIB", "mib-2", "SNMPv2-SMI", "mib-2",
370 "RFC1213-MIB", "DisplayString", "SNMPv2-TC", "DisplayString",
371 NULL, NULL, NULL, NULL
377 checkDescr(Parser *parser, char *descr)
381 smiPrintError(parser, ERR_EMPTY_DESCRIPTION);
383 /* we might want to add more checks since I have recently
384 seen things like DESCRIPTION "." to cirumvent warnings */
391 checkNameLen(Parser *parser, char *name, int error_32, int error_64)
393 int len = strlen(name);
396 smiPrintError(parser, error_64, name);
397 } else if (len > 32) {
398 smiPrintError(parser, error_32, name);
405 checkModuleName(Parser *parserPtr, Module *modulePtr)
407 static char *mib_ignore[] = {
408 "SNMPv2-SMI", "SNMPv2-TC", "SNMPv2-CONF", NULL
411 static char *pib_ignore[] = {
412 "COPS-PR-SPPI", "COPS-PR-SPPI-TC",
413 "SNMPv2-SMI", "SNMPv2-TC", "SNMPv2-CONF", NULL
416 const char *name = thisModulePtr->export.name;
417 const int len = strlen(name);
420 switch (modulePtr->export.language) {
421 case SMI_LANGUAGE_SMIV1:
422 case SMI_LANGUAGE_SMIV2:
423 case SMI_LANGUAGE_SMING:
424 for (i = 0; mib_ignore[i]; i++) {
425 if (strcmp(mib_ignore[i], name) == 0) {
429 if (len > 3 && (strcmp(name + len - 4, "-MIB") != 0)) {
430 smiPrintError(parserPtr, ERR_MIB_MODULENAME_SUFFIX, name);
434 case SMI_LANGUAGE_SPPI:
435 for (i = 0; pib_ignore[i]; i++) {
436 if (strcmp(pib_ignore[i], name) == 0) {
440 if (len > 3 && (strcmp(name + len - 4, "-PIB") != 0)) {
441 smiPrintError(parserPtr, ERR_PIB_MODULENAME_SUFFIX, name);
444 case SMI_LANGUAGE_UNKNOWN:
452 checkModuleIdentity(Parser *parserPtr, Module *modulePtr)
454 if ((modulePtr->export.language == SMI_LANGUAGE_SMIV2)
455 && (modulePtr->numModuleIdentities < 1)
456 && strcmp(modulePtr->export.name, "SNMPv2-SMI")
457 && strcmp(modulePtr->export.name, "SNMPv2-CONF")
458 && strcmp(modulePtr->export.name, "SNMPv2-TC")
459 && strcmp(modulePtr->export.name, "COPS-PR-SPPI")) {
460 smiPrintError(parserPtr, ERR_NO_MODULE_IDENTITY);
467 checkObjects(Parser *parserPtr, Module *modulePtr)
472 Type *counterTypePtr, *counter32TypePtr, *counter64TypePtr;
474 counterTypePtr = findTypeByName("Counter");
475 counter32TypePtr = findTypeByModulenameAndName("SNMPv2-SMI", "Counter32");
476 counter64TypePtr = findTypeByModulenameAndName("SNMPv2-SMI", "Counter64");
478 for (objectPtr = modulePtr->firstObjectPtr;
479 objectPtr; objectPtr = objectPtr->nextPtr) {
483 if ((objectPtr->export.decl != SMI_DECL_UNKNOWN) &&
484 objectPtr->nodePtr->parentPtr &&
485 objectPtr->nodePtr->parentPtr->lastObjectPtr) {
486 parentPtr = objectPtr->nodePtr->parentPtr->lastObjectPtr;
492 * Set nodekinds of all newly defined objects.
495 if (objectPtr->export.decl == SMI_DECL_MODULEIDENTITY) {
496 objectPtr->export.nodekind = SMI_NODEKIND_NODE;
497 } else if ((objectPtr->export.decl == SMI_DECL_VALUEASSIGNMENT) ||
498 (objectPtr->export.decl == SMI_DECL_OBJECTIDENTITY)) {
499 objectPtr->export.nodekind = SMI_NODEKIND_NODE;
500 } else if ((objectPtr->export.decl == SMI_DECL_OBJECTTYPE) &&
501 (objectPtr->typePtr) &&
502 (objectPtr->typePtr->export.decl == SMI_DECL_IMPL_SEQUENCEOF)) {
503 objectPtr->export.nodekind = SMI_NODEKIND_TABLE;
504 } else if ((objectPtr->export.decl == SMI_DECL_OBJECTTYPE) &&
505 (objectPtr->export.indexkind != SMI_INDEX_UNKNOWN)) {
506 objectPtr->export.nodekind = SMI_NODEKIND_ROW;
507 } else if ((objectPtr->export.decl == SMI_DECL_NOTIFICATIONTYPE) ||
508 (objectPtr->export.decl == SMI_DECL_TRAPTYPE)) {
509 objectPtr->export.nodekind = SMI_NODEKIND_NOTIFICATION;
510 } else if ((objectPtr->export.decl == SMI_DECL_OBJECTGROUP) ||
511 (objectPtr->export.decl == SMI_DECL_NOTIFICATIONGROUP)) {
512 objectPtr->export.nodekind = SMI_NODEKIND_GROUP;
513 } else if (objectPtr->export.decl == SMI_DECL_MODULECOMPLIANCE) {
514 objectPtr->export.nodekind = SMI_NODEKIND_COMPLIANCE;
515 } else if (objectPtr->export.decl == SMI_DECL_AGENTCAPABILITIES) {
516 objectPtr->export.nodekind = SMI_NODEKIND_CAPABILITIES;
517 } else if ((objectPtr->export.decl == SMI_DECL_OBJECTTYPE) &&
519 (parentPtr->export.indexkind != SMI_INDEX_UNKNOWN)) {
520 objectPtr->export.nodekind = SMI_NODEKIND_COLUMN;
521 } else if ((objectPtr->export.decl == SMI_DECL_OBJECTTYPE) &&
523 (parentPtr->export.indexkind == SMI_INDEX_UNKNOWN)) {
524 objectPtr->export.nodekind = SMI_NODEKIND_SCALAR;
528 for (objectPtr = modulePtr->firstObjectPtr;
529 objectPtr; objectPtr = objectPtr->nextPtr) {
533 if (objectPtr->nodePtr->parentPtr &&
534 objectPtr->nodePtr->parentPtr->lastObjectPtr) {
535 parentPtr = objectPtr->nodePtr->parentPtr->lastObjectPtr;
541 * Check whether the associated type resolves to a known base type.
544 if (objectPtr->typePtr
545 && (objectPtr->export.nodekind == SMI_NODEKIND_COLUMN
546 || objectPtr->export.nodekind == SMI_NODEKIND_SCALAR)
547 && objectPtr->typePtr->export.basetype == SMI_BASETYPE_UNKNOWN) {
548 smiPrintErrorAtLine(parserPtr, ERR_BASETYPE_UNKNOWN,
550 objectPtr->typePtr->export.name ?
551 objectPtr->typePtr->export.name : "[unknown]",
552 objectPtr->export.name);
553 if (objectPtr->nodePtr->parentPtr->firstObjectPtr->export.nodekind
554 == SMI_NODEKIND_TABLE) {
555 /* the parent node is a table node, so assume this is
556 * a row node. this adjusts missing INDEXs in RFC 1158.
558 objectPtr->export.nodekind = SMI_NODEKIND_ROW;
563 * Mark types that are referenced in this module.
566 if (objectPtr->typePtr
567 && (objectPtr->export.nodekind == SMI_NODEKIND_COLUMN
568 || objectPtr->export.nodekind == SMI_NODEKIND_SCALAR)
569 && (objectPtr->typePtr->export.decl == SMI_DECL_TYPEDEF
570 || objectPtr->typePtr->export.decl == SMI_DECL_TEXTUALCONVENTION
571 || objectPtr->typePtr->export.decl == SMI_DECL_IMPLICIT_TYPE)) {
572 addTypeFlags(objectPtr->typePtr, FLAG_INSYNTAX);
573 if (objectPtr->typePtr->export.decl == SMI_DECL_IMPLICIT_TYPE) {
574 addTypeFlags(objectPtr->typePtr->parentPtr, FLAG_INSYNTAX);
579 * Check whether the status of the associated type matches the
580 * status of the object.
583 if (objectPtr->typePtr
584 && (objectPtr->export.nodekind == SMI_NODEKIND_COLUMN
585 || objectPtr->export.nodekind == SMI_NODEKIND_SCALAR)
586 && (objectPtr->export.status < objectPtr->typePtr->export.status)) {
587 if (objectPtr->typePtr->export.status == SMI_STATUS_DEPRECATED) {
588 smiPrintErrorAtLine(parserPtr, ERR_TYPE_STATUS_DEPRECATED,
590 objectPtr->typePtr->export.name,
591 objectPtr->export.name);
593 if (objectPtr->typePtr->export.status == SMI_STATUS_OBSOLETE) {
594 smiPrintErrorAtLine(parserPtr, ERR_TYPE_STATUS_OBSOLETE,
596 objectPtr->typePtr->export.name,
597 objectPtr->export.name);
602 * Check the nodekind of the parent node.
606 switch (objectPtr->export.nodekind) {
607 case SMI_NODEKIND_COLUMN:
608 if (parentPtr->export.nodekind != SMI_NODEKIND_ROW) {
609 smiPrintErrorAtLine(parserPtr, ERR_COLUMN_PARENT_TYPE,
610 objectPtr->line, objectPtr->export.name);
613 case SMI_NODEKIND_ROW:
614 if (parentPtr->export.nodekind != SMI_NODEKIND_TABLE) {
615 smiPrintErrorAtLine(parserPtr, ERR_ROW_PARENT_TYPE,
616 objectPtr->line, objectPtr->export.name);
618 if (parentPtr->typePtr && parentPtr->typePtr->parentPtr &&
619 strcmp(parentPtr->typePtr->parentPtr->export.name,
620 objectPtr->typePtr->export.name)) {
621 smiPrintErrorAtLine(parserPtr, ERR_TABLE_ROW_TYPE_MISMATCH,
623 objectPtr->export.name);
626 case SMI_NODEKIND_TABLE:
627 if ((parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN) &&
628 (parentPtr->export.nodekind != SMI_NODEKIND_NODE)) {
629 smiPrintErrorAtLine(parserPtr, ERR_TABLE_PARENT_TYPE,
630 objectPtr->line, objectPtr->export.name);
633 case SMI_NODEKIND_SCALAR:
634 if ((parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN) &&
635 (parentPtr->export.nodekind != SMI_NODEKIND_NODE)) {
636 smiPrintErrorAtLine(parserPtr, ERR_SCALAR_PARENT_TYPE,
637 objectPtr->line, objectPtr->export.name);
640 case SMI_NODEKIND_NOTIFICATION:
641 if ((parentPtr->export.nodekind != SMI_NODEKIND_NODE) &&
642 (parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN)) {
643 smiPrintErrorAtLine(parserPtr, ERR_NOTIFICATION_PARENT_TYPE,
644 objectPtr->line, objectPtr->export.name);
646 if (parserPtr && parentPtr->nodePtr->parentPtr &&
647 parentPtr->nodePtr->parentPtr->lastObjectPtr) {
648 Object *parent2Ptr = parentPtr->nodePtr->parentPtr->lastObjectPtr;
649 if ((parent2Ptr->export.nodekind != SMI_NODEKIND_NODE) &&
650 (parent2Ptr->export.nodekind != SMI_NODEKIND_UNKNOWN)) {
651 smiPrintErrorAtLine(parserPtr,
652 ERR_NOTIFICATION_PARENT_TYPE,
654 objectPtr->export.name);
658 case SMI_NODEKIND_NODE:
659 /* Node defined by OBJECT IDENTIFIER assignments can have
660 arbitrary parent node. */
661 if ((parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN) &&
662 (parentPtr->export.nodekind != SMI_NODEKIND_NODE) &&
663 (objectPtr->export.decl != SMI_DECL_VALUEASSIGNMENT)) {
664 smiPrintErrorAtLine(parserPtr, ERR_NODE_PARENT_TYPE,
665 objectPtr->line, objectPtr->export.name);
668 case SMI_NODEKIND_GROUP:
669 if ((parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN) &&
670 (parentPtr->export.nodekind != SMI_NODEKIND_NODE)) {
671 smiPrintErrorAtLine(parserPtr, ERR_GROUP_PARENT_TYPE,
672 objectPtr->line, objectPtr->export.name);
675 case SMI_NODEKIND_COMPLIANCE:
676 if ((parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN) &&
677 (parentPtr->export.nodekind != SMI_NODEKIND_NODE)) {
678 smiPrintErrorAtLine(parserPtr, ERR_COMPLIANCE_PARENT_TYPE,
679 objectPtr->line, objectPtr->export.name);
682 case SMI_NODEKIND_CAPABILITIES:
683 if ((parentPtr->export.nodekind != SMI_NODEKIND_UNKNOWN) &&
684 (parentPtr->export.nodekind != SMI_NODEKIND_NODE)) {
685 smiPrintErrorAtLine(parserPtr, ERR_CAPABILITIES_PARENT_TYPE,
686 objectPtr->line, objectPtr->export.name);
693 * Check whether groups only contain scalars, columns and
697 if (objectPtr->export.nodekind == SMI_NODEKIND_GROUP) {
698 smiCheckGroupMembers(parserPtr, objectPtr);
702 * Check whether compliance statements contain out of date
706 if (objectPtr->export.nodekind == SMI_NODEKIND_COMPLIANCE) {
707 smiCheckComplianceStatus(parserPtr, objectPtr);
711 * Check whether notification statements contain useful
715 if (objectPtr->export.nodekind == SMI_NODEKIND_NOTIFICATION) {
716 smiCheckNotificationOid(parserPtr, modulePtr, objectPtr);
717 smiCheckNotificationMembers(parserPtr, objectPtr);
720 if (modulePtr->export.language != SMI_LANGUAGE_SPPI) {
722 * Check whether tables and rows are not accessible
726 if (objectPtr->export.nodekind == SMI_NODEKIND_TABLE
727 && objectPtr->export.access != SMI_ACCESS_NOT_ACCESSIBLE) {
728 smiPrintErrorAtLine(parserPtr, ERR_TABLE_ACCESS,
729 objectPtr->line, objectPtr->export.name);
732 if (objectPtr->export.nodekind == SMI_NODEKIND_ROW
733 && objectPtr->export.access != SMI_ACCESS_NOT_ACCESSIBLE) {
734 smiPrintErrorAtLine(parserPtr, ERR_ROW_ACCESS,
735 objectPtr->line, objectPtr->export.name);
739 * Check whether counter objects are read-only or
740 * accessible-for-notify (RFC 2578, 7.1.6).
742 if (((objectPtr->export.nodekind == SMI_NODEKIND_SCALAR) ||
743 (objectPtr->export.nodekind == SMI_NODEKIND_COLUMN)) &&
744 (objectPtr->export.access != SMI_ACCESS_NOTIFY) &&
745 (objectPtr->export.access != SMI_ACCESS_READ_ONLY) &&
746 (smiTypeDerivedFrom(objectPtr->typePtr, counterTypePtr) ||
747 smiTypeDerivedFrom(objectPtr->typePtr, counter32TypePtr) ||
748 smiTypeDerivedFrom(objectPtr->typePtr, counter64TypePtr))) {
749 smiPrintErrorAtLine(parserPtr, ERR_COUNTER_ACCESS,
750 objectPtr->line, objectPtr->export.name);
755 * Check whether a row's subid is 1, see RFC 2578 7.10 (1).
758 if (objectPtr->export.nodekind == SMI_NODEKIND_ROW) {
761 if (objectPtr->nodePtr->subid != 1) {
762 smiPrintErrorAtLine(parserPtr, ERR_ROW_SUBID_ONE,
763 objectPtr->line, objectPtr->export.name);
766 len = strlen(objectPtr->export.name);
767 if (len < 6 || strcmp(objectPtr->export.name+len-5, "Entry")) {
768 smiPrintErrorAtLine(parserPtr, ERR_ROWNAME_ENTRY,
769 objectPtr->line, objectPtr->export.name);
773 * This misreports some cases where the table name
774 * does not have the "*Table" suffix. This is trying
775 * to allow Entry names of either fooTableEntry or
779 !(((int)strlen(parentPtr->export.name) == len ||
780 (int)strlen(parentPtr->export.name) == len - 5) &&
781 !strncmp(objectPtr->export.name, parentPtr->export.name,
783 smiPrintErrorAtLine(parserPtr, ERR_ROWNAME_TABLENAME,
785 objectPtr->export.name,
786 parentPtr->export.name);
792 * Check whether a row's SEQUENCE contains exactly the list
793 * of child nodes (columns). An unknown SEQUENCE type
797 if (objectPtr->export.nodekind == SMI_NODEKIND_ROW &&
798 ((objectPtr->typePtr->flags & FLAG_INCOMPLETE) == 0)) {
800 Node *seqNodePtr, *childNodePtr;
805 * Walk through the SEQUENCE elements and find those
806 * that are misordered or have no matching columnar object.
808 for (p = objectPtr->typePtr->listPtr, i = 1,
809 childNodePtr = objectPtr->nodePtr->firstChildPtr;
811 p = p->nextPtr, childNodePtr = childNodePtr->nextPtr, i++) {
812 seqNodePtr = ((Object *)p->ptr)->nodePtr;
814 if (seqNodePtr->parentPtr != childNodePtr->parentPtr) {
815 smiPrintErrorAtLine(parserPtr, ERR_SEQUENCE_NO_COLUMN,
816 objectPtr->typePtr->line,
818 ((Object *)p->ptr)->export.name,
819 objectPtr->export.name);
823 if (seqNodePtr != childNodePtr) {
824 smiPrintErrorAtLine(parserPtr, ERR_SEQUENCE_ORDER,
825 objectPtr->typePtr->line,
827 ((Object *)p->ptr)->export.name,
828 objectPtr->export.name);
832 if ((p != NULL) && (childNodePtr == NULL)) {
833 smiPrintErrorAtLine(parserPtr, ERR_SEQUENCE_NO_COLUMN,
834 objectPtr->typePtr->line,
836 ((Object *)p->ptr)->export.name,
837 objectPtr->export.name);
841 * Walk through all child objects and find those
842 * that were missing in the SEQUENCE.
844 for (childNodePtr = objectPtr->nodePtr->firstChildPtr;
845 childNodePtr; childNodePtr = childNodePtr->nextPtr) {
846 colPtr = findObjectByModuleAndNode(modulePtr, childNodePtr);
847 if (!colPtr) continue;
848 for (p = objectPtr->typePtr->listPtr; p; p = p->nextPtr) {
849 if (((Object *)p->ptr)->nodePtr == colPtr->nodePtr)
853 if (colPtr->export.name) {
855 * Don't complain, if it's an implcitly defined
856 * unnamed node (could happen for parent node of
857 * TRAP-TYPE definitions).
859 smiPrintErrorAtLine(parserPtr,
860 ERR_SEQUENCE_MISSING_COLUMN,
861 objectPtr->typePtr->line,
862 objectPtr->typePtr->export.name,
863 colPtr->export.name);
870 if (objectPtr->export.nodekind == SMI_NODEKIND_TABLE) {
873 len = strlen(objectPtr->export.name);
874 if (len < 6 || strcmp(objectPtr->export.name+len-5, "Table")) {
875 smiPrintErrorAtLine(parserPtr, ERR_TABLENAME_TABLE,
876 objectPtr->line, objectPtr->export.name);
881 * TODO: check whether the row is the only node below the
886 * Check references to unknown identifiers.
889 if ((objectPtr->flags & FLAG_INCOMPLETE) &&
890 (objectPtr->export.decl != SMI_DECL_IMPL_OBJECT)) {
891 if (objectPtr->export.name) {
892 smiPrintErrorAtLine(parserPtr, ERR_UNKNOWN_OIDLABEL,
893 objectPtr->line, objectPtr->export.name);
895 smiPrintErrorAtLine(parserPtr, ERR_IMPLICIT_NODE,
901 * Adjust the status of implicit type definitions.
904 if (objectPtr->typePtr
905 && (objectPtr->typePtr->export.decl == SMI_DECL_IMPLICIT_TYPE)
906 && (objectPtr->typePtr->export.status == SMI_STATUS_UNKNOWN)) {
907 objectPtr->typePtr->export.status = objectPtr->export.status;
911 * Link implicit type definition from refinements into
912 * the type derivation tree. Adjust the status of implicit
913 * type definitions in refinements.
916 if (objectPtr->export.nodekind == SMI_NODEKIND_COMPLIANCE) {
920 for (listPtr = objectPtr->refinementlistPtr;
922 listPtr = listPtr->nextPtr) {
924 Refinement *refinementPtr;
927 refinementPtr = ((Refinement *)(listPtr->ptr));
928 typePtr = refinementPtr->typePtr;
930 if (typePtr->export.status == SMI_STATUS_UNKNOWN) {
931 typePtr->export.status = objectPtr->export.status;
935 typePtr = refinementPtr->writetypePtr;
937 if (typePtr->export.status == SMI_STATUS_UNKNOWN) {
938 typePtr->export.status = objectPtr->export.status;
943 /* relocate the refinement type into the type tree */
944 /* relocate the write refinement type into the type tree */
948 * Set the oidlen/oid values that are not yet correct.
951 if (objectPtr->export.oidlen == 0) {
952 if (objectPtr->nodePtr->oidlen == 0) {
953 for (nodePtr = objectPtr->nodePtr, i = 1;
954 nodePtr->parentPtr != thisParserPtr->pendingNodePtr &&
955 nodePtr->parentPtr != smiHandle->rootNodePtr &&
956 nodePtr != nodePtr->parentPtr &&
958 nodePtr = nodePtr->parentPtr, i++);
959 if ((objectPtr->export.name) &&
960 ((i > 128) || (nodePtr == nodePtr->parentPtr))) {
961 smiPrintErrorAtLine(parserPtr, ERR_OID_RECURSIVE,
963 objectPtr->export.name);
965 objectPtr->nodePtr->oid = smiMalloc(i * sizeof(SmiSubid));
966 objectPtr->nodePtr->oidlen = i;
967 for (nodePtr = objectPtr->nodePtr; i > 0; i--) {
968 objectPtr->nodePtr->oid[i-1] = nodePtr->subid;
969 nodePtr = nodePtr->parentPtr;
972 objectPtr->export.oidlen = objectPtr->nodePtr->oidlen;
973 objectPtr->export.oid = objectPtr->nodePtr->oid;
976 if ((objectPtr->export.decl != SMI_DECL_UNKNOWN)
977 && (objectPtr->export.nodekind != SMI_NODEKIND_NODE)
978 && objectPtr->export.name
979 && objectPtr->export.oid[objectPtr->export.oidlen-1] == 0
980 && objectPtr->export.oidlen != 2 && objectPtr->export.oid[0] != 0) {
981 smiPrintErrorAtLine(parserPtr, ERR_OID_ADMIN_ZERO,
983 objectPtr->export.name);
987 * Check whether the module identity is registered in a well
988 * known controlled location.
991 if (objectPtr->export.decl == SMI_DECL_MODULEIDENTITY) {
992 smiCheckModuleIdentityRegistration(parserPtr, objectPtr);
996 * Check table linkage constraints for row objects.
999 if (objectPtr->export.nodekind == SMI_NODEKIND_ROW) {
1000 switch (objectPtr->export.indexkind) {
1001 case SMI_INDEX_INDEX:
1002 smiCheckIndex(parserPtr, objectPtr);
1004 case SMI_INDEX_AUGMENT:
1005 case SMI_INDEX_SPARSE:
1006 smiCheckAugment(parserPtr, objectPtr);
1014 * Determine the longest common OID prefix of all nodes.
1017 if (!modulePtr->prefixNodePtr) {
1018 modulePtr->prefixNodePtr = objectPtr->nodePtr;
1020 if (objectPtr->nodePtr->oidlen < modulePtr->prefixNodePtr->oidlen) {
1021 Node *nodePtr = findNodeByOid(objectPtr->nodePtr->oidlen,
1022 modulePtr->prefixNodePtr->oid);
1024 modulePtr->prefixNodePtr = nodePtr;
1026 smiPrintError(parserPtr, ERR_OTHER_ERROR,
1027 "Failed to create complete object tree - "
1028 "expect incorrect output");
1030 for (i = 0; i < modulePtr->prefixNodePtr->oidlen; i++) {
1031 if (modulePtr->prefixNodePtr->oid[i] !=
1032 objectPtr->nodePtr->oid[i]) {
1033 modulePtr->prefixNodePtr =
1034 findNodeByOid(i, modulePtr->prefixNodePtr->oid);
1041 if (modulePtr->export.language == SMI_LANGUAGE_SMIV2) {
1042 for (objectPtr = modulePtr->firstObjectPtr;
1043 objectPtr; objectPtr = objectPtr->nextPtr) {
1046 * Check whether all objects and notifications are contained in at
1047 * least one conformance group (RFC 2580 3.3 and 4.1).
1050 smiCheckGroupMembership(parserPtr, objectPtr);
1054 if (modulePtr->export.language == SMI_LANGUAGE_SPPI) {
1057 for (objectPtr = modulePtr->firstObjectPtr;
1058 objectPtr; objectPtr = objectPtr->nextPtr) {
1060 * All checks for SPPI constructs
1062 if (objectPtr->nodePtr->parentPtr)
1063 parentPtr = objectPtr->nodePtr->parentPtr->lastObjectPtr;
1068 * Do all rows contain a PIB-INDEX/AUGMENTS/EXTENDS ?
1069 * See RFC 3159 7.5, 7.7, 7.8
1072 (parentPtr->export.nodekind == SMI_NODEKIND_TABLE) &&
1073 (objectPtr->export.indexkind != SMI_INDEX_INDEX) &&
1074 (objectPtr->export.indexkind != SMI_INDEX_AUGMENT) &&
1075 (objectPtr->export.indexkind != SMI_INDEX_SPARSE))
1076 smiPrintErrorAtLine(parserPtr, ERR_ROW_LACKS_PIB_INDEX,
1080 * Does any non row contain a PIB-INDEX/AUGMENTS/EXTENDS ?
1081 * See RFC 3159 7.5, 7.7, 7.8
1083 if ((objectPtr->export.nodekind != SMI_NODEKIND_ROW) &&
1084 (objectPtr->export.indexkind != SMI_INDEX_UNKNOWN))
1085 smiPrintErrorAtLine(parserPtr, ERR_PIB_INDEX_FOR_NON_ROW_TYPE,
1089 * Check the PIB-INDEX and other indices
1091 if ((objectPtr->export.nodekind == SMI_NODEKIND_ROW) &&
1092 (objectPtr->export.indexkind == SMI_INDEX_INDEX)) {
1095 * Only the first element (PIB-INDEX) has to be an InstanceId.
1098 if (objectPtr->listPtr && objectPtr->listPtr->ptr) {
1099 Object *pibindex = (Object *)objectPtr->listPtr->ptr;
1100 if (pibindex->typePtr && pibindex->typePtr->export.name &&
1101 strcmp(pibindex->typePtr->export.name, "InstanceId"))
1102 smiPrintErrorAtLine(thisParserPtr, ERR_PIB_INDEX_NOT_INSTANCEID,
1103 pibindex->line, pibindex->export.name);
1108 * Do all tables contain a PIB-ACCESS clause?
1111 if ((objectPtr->export.nodekind == SMI_NODEKIND_TABLE) &&
1112 (objectPtr->export.access == SMI_ACCESS_UNKNOWN))
1113 smiPrintErrorAtLine(parserPtr, ERR_TABLE_LACKS_PIB_ACCESS,
1117 * Does any non table types contain a PIB-ACCESS clause?
1120 if (((objectPtr->export.nodekind == SMI_NODEKIND_NODE) ||
1121 (objectPtr->export.nodekind == SMI_NODEKIND_ROW) ||
1122 (objectPtr->export.nodekind == SMI_NODEKIND_SCALAR)) &&
1123 (objectPtr->export.access != SMI_ACCESS_UNKNOWN))
1124 smiPrintErrorAtLine(parserPtr, ERR_PIB_ACCESS_FOR_NON_TABLE,
1128 * Check the UNIQUENESS clause and its entries
1131 if (objectPtr->uniquenessPtr) {
1132 if (objectPtr->export.nodekind != SMI_NODEKIND_ROW)
1133 smiPrintErrorAtLine(parserPtr, ERR_UNIQUENESS_FOR_NON_ROW,
1136 smiCheckUniqueness(parserPtr, objectPtr);
1140 * Does the PIB-REFERENCES object point to a PRC (table)?
1143 if (objectPtr->typePtr && objectPtr->typePtr->export.name &&
1144 !strcmp(objectPtr->typePtr->export.name, "ReferenceId") &&
1145 objectPtr->relatedPtr &&
1146 (objectPtr->relatedPtr->export.nodekind != SMI_NODEKIND_ROW))
1147 smiPrintErrorAtLine(parserPtr, ERR_PIB_REFERENCES_NOT_ROW,
1151 * Do all PIB-TAGs point to objects with a SYNTAX of TagId?
1154 if (objectPtr->typePtr && objectPtr->typePtr->export.name &&
1155 !strcmp(objectPtr->typePtr->export.name, "TagReferenceId") &&
1156 objectPtr->relatedPtr && objectPtr->relatedPtr->typePtr &&
1157 objectPtr->relatedPtr->typePtr->export.name &&
1158 strcmp(objectPtr->relatedPtr->typePtr->export.name, "TagId"))
1159 smiPrintErrorAtLine(parserPtr, ERR_PIB_TAG_TYPE, objectPtr->line);
1162 * Is the attribute member of at least one compliance group?
1165 if (objectPtr->export.nodekind & SMI_NODEKIND_COLUMN) {
1169 for (group = modulePtr->firstObjectPtr; group;
1170 group = group->nextPtr) {
1171 if ((group->export.nodekind == SMI_NODEKIND_GROUP) &&
1175 for (l = group->listPtr; l; l = l->nextPtr)
1176 if (((Object *)l->ptr)->export.name &&
1177 !strcmp(((Object *)l->ptr)->export.name,
1178 objectPtr->export.name)) {
1187 smiPrintErrorAtLine(parserPtr, ERR_ATTRIBUTE_NOT_IN_GROUP,
1188 objectPtr->line, objectPtr->export.name);
1197 checkTypes(Parser *parserPtr, Module *modulePtr)
1201 for (typePtr = modulePtr->firstTypePtr;
1202 typePtr; typePtr = typePtr->nextPtr) {
1205 * Check references to unknown types.
1208 if ((typePtr->flags & FLAG_INCOMPLETE)
1209 && typePtr->export.name
1210 && (typePtr->export.decl == SMI_DECL_UNKNOWN)) {
1211 smiPrintErrorAtLine(parserPtr, ERR_UNKNOWN_TYPE,
1212 typePtr->line, typePtr->export.name);
1216 * Use TCs instead of type assignments in SMIv2.
1219 if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2
1220 && typePtr->export.decl == SMI_DECL_TYPEASSIGNMENT
1221 && typePtr->export.basetype != SMI_BASETYPE_UNKNOWN
1222 && strcmp(thisModulePtr->export.name, "SNMPv2-SMI")) {
1223 smiPrintErrorAtLine(parserPtr, ERR_SMIV2_TYPE_ASSIGNEMENT,
1224 typePtr->line, typePtr->export.name);
1228 * Check whether we have types that are not used in this
1232 if ((typePtr->export.decl == SMI_DECL_TYPEDEF
1233 || typePtr->export.decl == SMI_DECL_TEXTUALCONVENTION)
1234 && ! (typePtr->flags & FLAG_INSYNTAX)) {
1235 static char *status[] = { "Unknown", "current", "deprecated",
1236 "mandatory", "optional", "obsolete" };
1237 smiPrintErrorAtLine(parserPtr, ERR_TYPE_UNREF,
1239 status[typePtr->export.status],
1240 typePtr->export.name);
1244 * Complain about TCs derived from other TCs (RFC 2579 3.5).
1247 if (typePtr->parentPtr
1248 && typePtr->export.decl == SMI_DECL_TEXTUALCONVENTION
1249 && typePtr->export.decl == typePtr->parentPtr->export.decl) {
1250 smiPrintErrorAtLine(parserPtr, ERR_SMIV2_NESTED_TEXTUAL_CONVENTION,
1252 typePtr->export.name,
1253 typePtr->parentPtr->export.name);
1255 if (typePtr->export.status < typePtr->parentPtr->export.status) {
1256 if (typePtr->parentPtr->export.status == SMI_STATUS_DEPRECATED) {
1257 smiPrintErrorAtLine(parserPtr, ERR_TYPE_STATUS_DEPRECATED,
1259 typePtr->parentPtr->export.name,
1260 typePtr->export.name);
1262 if (typePtr->parentPtr->export.status == SMI_STATUS_OBSOLETE) {
1263 smiPrintErrorAtLine(parserPtr, ERR_TYPE_STATUS_OBSOLETE,
1265 typePtr->parentPtr->export.name,
1266 typePtr->export.name);
1271 smiCheckTypeFormat(parserPtr, typePtr);
1272 smiCheckNamedNumberRedefinition(parserPtr, typePtr);
1273 smiCheckNamedNumberSubtyping(parserPtr, typePtr);
1280 adjustDefval(Parser *parserPtr, SmiValue *valuePtr, Type *typePtr, int line)
1283 List *bitsListPtr, *valueListPtr, *p, *pp, *nextPtr, *listPtr;
1287 if (valuePtr->basetype == SMI_BASETYPE_UNKNOWN)
1290 if (valuePtr->basetype == SMI_BASETYPE_OBJECTIDENTIFIER) {
1291 /* a len of -1 indicates an unresolved label in ptr */
1292 if (valuePtr->len == -1) {
1293 object2Ptr = findObjectByModuleAndName(parserPtr->modulePtr,
1294 (char *)valuePtr->value.ptr);
1296 importPtr = findImportByName(
1297 (char *)valuePtr->value.ptr, parserPtr->modulePtr);
1298 if (importPtr) { /* imported object */
1300 object2Ptr = findObjectByModulenameAndName(
1301 importPtr->export.module,
1302 importPtr->export.name);
1306 smiPrintErrorAtLine(parserPtr, ERR_UNKNOWN_OIDLABEL,
1308 (char *)valuePtr->value.ptr);
1309 smiFree(valuePtr->value.ptr);
1310 valuePtr->value.ptr = NULL;
1311 valuePtr->basetype = SMI_BASETYPE_UNKNOWN;
1313 smiFree(valuePtr->value.ptr);
1314 valuePtr->len = object2Ptr->export.oidlen;
1315 valuePtr->value.ptr = smiMalloc(object2Ptr->export.oidlen *
1317 memcpy(valuePtr->value.ptr,
1318 object2Ptr->export.oid,
1319 object2Ptr->export.oidlen * sizeof(SmiSubid));
1322 } else if (valuePtr->basetype == SMI_BASETYPE_BITS) {
1323 bitsListPtr = typePtr->listPtr;
1324 valueListPtr = (void *)valuePtr->value.ptr;
1325 for (nBits = 0, p = bitsListPtr; p; p = p->nextPtr) {
1326 if (nBits < 1+((NamedNumber *)(p->ptr))->export.value.value.integer32) {
1327 nBits = 1+((NamedNumber *)(p->ptr))->export.value.value.integer32;
1330 valuePtr->value.ptr = smiMalloc((nBits+7)/8);
1331 memset(valuePtr->value.ptr, 0, (nBits+7)/8);
1332 valuePtr->len = (nBits+7)/8;
1333 for (p = valueListPtr; p;) {
1334 for (pp = bitsListPtr; pp; pp = pp->nextPtr) {
1336 ((NamedNumber *)(pp->ptr))->export.name)) {
1337 bit = ((NamedNumber *)(pp->ptr))->export.value.value.integer32;
1338 valuePtr->value.ptr[bit/8] |=
1343 nextPtr = p->nextPtr;
1347 } else if (valuePtr->basetype == SMI_BASETYPE_ENUM) {
1348 /* a len of -1 indicates an unresolved enum label in ptr */
1349 if (valuePtr->len == -1) {
1350 for (listPtr = typePtr->listPtr; listPtr;
1351 listPtr = listPtr->nextPtr) {
1352 if (!strcmp(((NamedNumber *)(listPtr->ptr))->export.name,
1353 (char *)valuePtr->value.ptr)) {
1354 smiFree(valuePtr->value.ptr);
1355 valuePtr->value.integer32 =
1356 ((NamedNumber *)(listPtr->ptr))->
1357 export.value.value.integer32;
1369 checkDefvals(Parser *parserPtr, Module *modulePtr)
1374 * Check unknown identifiers in OID DEFVALs.
1377 for(objectPtr = modulePtr->firstObjectPtr;
1378 objectPtr; objectPtr = objectPtr->nextPtr) {
1380 adjustDefval(parserPtr, &objectPtr->export.value,
1381 objectPtr->typePtr, objectPtr->line);
1383 if (objectPtr->export.value.len == -1) {
1384 smiPrintErrorAtLine(parserPtr,
1385 ERR_DEFVAL_SYNTAX, objectPtr->line);
1388 smiCheckDefault(parserPtr, objectPtr);
1395 checkImportsUsage(Parser *parserPtr, Module *modulePtr)
1400 * Check usage of all imported identifiers.
1403 if (strcmp(modulePtr->export.name, "SNMPv2-TC") &&
1404 strcmp(modulePtr->export.name, "SNMPv2-CONF") &&
1405 strcmp(modulePtr->export.name, "RFC-1212") &&
1406 strcmp(modulePtr->export.name, "RFC-1215")) {
1407 for(importPtr = modulePtr->firstImportPtr;
1408 importPtr; importPtr = importPtr->nextPtr) {
1409 if (! strcmp(importPtr->export.module, "SNMPv2-SMI")) {
1410 if (! strcmp(importPtr->export.name, "ExtUTCTime")
1411 || !strcmp(importPtr->export.name, "ObjectName")
1412 || !strcmp(importPtr->export.name, "NotificationName")) {
1413 smiPrintErrorAtLine(parserPtr, ERR_ILLEGAL_IMPORT,
1415 importPtr->export.name,
1416 importPtr->export.module);
1419 /* checkImports() handles KIND_NOTFOUND */
1420 if (importPtr->use == 0 && importPtr->kind != KIND_NOTFOUND) {
1421 smiPrintErrorAtLine(parserPtr, ERR_UNUSED_IMPORT,
1423 importPtr->export.name,
1424 importPtr->export.module);
1427 if (modulePtr->export.language == SMI_LANGUAGE_SMIV2) {
1429 for (j = 0; convertImportv2[j]; j += 4) {
1430 if ((strcmp(convertImportv2[j],
1431 importPtr->export.module) == 0)
1432 && (strcmp(convertImportv2[j+1],
1433 importPtr->export.name) == 0)) {
1434 smiPrintErrorAtLine(parserPtr,
1435 ERR_OBSOLETE_IMPORT,
1437 importPtr->export.name,
1438 convertImportv2[j+2],
1439 importPtr->export.module);
1450 checkDate(Parser *parserPtr, char *date)
1457 memset(&tm, 0, sizeof(tm));
1461 if (len == 11 || len == 13) {
1462 for (i = 0; i < len; i++) {
1463 if ( (i < len-1 && ! isdigit((int) date[i]))
1464 || (i == len-1 && date[len-1] != 'Z')) {
1465 smiPrintError(parserPtr, ERR_DATE_CHARACTER, date);
1466 anytime = (time_t) -1;
1471 smiPrintError(parserPtr, ERR_DATE_LENGTH, date);
1472 anytime = (time_t) -1;
1476 for (i = 0, p = date, tm.tm_year = 0;
1477 i < ((len == 11) ? 2 : 4); i++, p++) {
1478 tm.tm_year = tm.tm_year * 10 + (*p - '0');
1482 if (tm.tm_year < 1990)
1483 smiPrintError(parserPtr, ERR_DATE_YEAR_2DIGITS,
1486 tm.tm_mon = (p[0]-'0') * 10 + (p[1]-'0');
1488 tm.tm_mday = (p[0]-'0') * 10 + (p[1]-'0');
1490 tm.tm_hour = (p[0]-'0') * 10 + (p[1]-'0');
1492 tm.tm_min = (p[0]-'0') * 10 + (p[1]-'0');
1494 if (tm.tm_mon < 1 || tm.tm_mon > 12) {
1495 smiPrintError(parserPtr, ERR_DATE_MONTH, date);
1497 if (tm.tm_mday < 1 || tm.tm_mday > 31) {
1498 smiPrintError(parserPtr, ERR_DATE_DAY, date);
1500 if (tm.tm_hour < 0 || tm.tm_hour > 23) {
1501 smiPrintError(parserPtr, ERR_DATE_HOUR, date);
1503 if (tm.tm_min < 0 || tm.tm_min > 59) {
1504 smiPrintError(parserPtr, ERR_DATE_MINUTES, date);
1511 anytime = timegm(&tm);
1513 if (anytime == (time_t) -1) {
1514 smiPrintError(parserPtr, ERR_DATE_VALUE, date);
1516 if (anytime < SMI_EPOCH) {
1517 smiPrintError(parserPtr, ERR_DATE_IN_PAST, date);
1519 if (anytime > time(NULL)) {
1520 smiPrintError(parserPtr, ERR_DATE_IN_FUTURE, date);
1525 return (anytime == (time_t) -1) ? 0 : anytime;
1530 /* Enabling traces. */
1535 /* Enabling verbose error messages. */
1536 #ifdef YYERROR_VERBOSE
1537 # undef YYERROR_VERBOSE
1538 # define YYERROR_VERBOSE 1
1540 # define YYERROR_VERBOSE 0
1543 /* Enabling the token table. */
1544 #ifndef YYTOKEN_TABLE
1545 # define YYTOKEN_TABLE 0
1548 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1549 typedef union YYSTYPE
1550 #line 1288 "parser-smi.y"
1552 char *text; /* scanned quoted text */
1553 char *id; /* identifier name */
1554 int err; /* actually just a dummy */
1555 time_t date; /* a date value */
1556 Object *objectPtr; /* object identifier */
1557 SmiStatus status; /* a STATUS value */
1558 SmiAccess access; /* an ACCESS value */
1560 List *listPtr; /* SEQUENCE and INDEX lists */
1561 NamedNumber *namedNumberPtr; /* BITS or enum item */
1562 Range *rangePtr; /* type restricting range */
1564 SmiUnsigned32 unsigned32; /* */
1565 SmiInteger32 integer32; /* */
1566 SmiUnsigned64 unsigned64; /* */
1567 SmiInteger64 integer64; /* */
1571 SubjectCategories *subjectCategoriesPtr;
1573 /* Line 187 of yacc.c. */
1574 #line 1575 "parser-smi.c"
1576 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1577 # define YYSTYPE_IS_DECLARED 1
1578 # define YYSTYPE_IS_TRIVIAL 1
1583 /* Copy the second part of user declarations. */
1586 /* Line 216 of yacc.c. */
1587 #line 1588 "parser-smi.c"
1594 typedef YYTYPE_UINT8 yytype_uint8;
1596 typedef unsigned char yytype_uint8;
1600 typedef YYTYPE_INT8 yytype_int8;
1601 #elif (defined __STDC__ || defined __C99__FUNC__ \
1602 || defined __cplusplus || defined _MSC_VER)
1603 typedef signed char yytype_int8;
1605 typedef short int yytype_int8;
1608 #ifdef YYTYPE_UINT16
1609 typedef YYTYPE_UINT16 yytype_uint16;
1611 typedef unsigned short int yytype_uint16;
1615 typedef YYTYPE_INT16 yytype_int16;
1617 typedef short int yytype_int16;
1621 # ifdef __SIZE_TYPE__
1622 # define YYSIZE_T __SIZE_TYPE__
1623 # elif defined size_t
1624 # define YYSIZE_T size_t
1625 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1626 || defined __cplusplus || defined _MSC_VER)
1627 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1628 # define YYSIZE_T size_t
1630 # define YYSIZE_T unsigned int
1634 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1639 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1640 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1644 # define YY_(msgid) msgid
1648 /* Suppress unused-variable warnings by "using" E. */
1649 #if ! defined lint || defined __GNUC__
1650 # define YYUSE(e) ((void) (e))
1652 # define YYUSE(e) /* empty */
1655 /* Identity function, used to suppress warnings about constant conditions. */
1657 # define YYID(n) (n)
1659 #if (defined __STDC__ || defined __C99__FUNC__ \
1660 || defined __cplusplus || defined _MSC_VER)
1673 #if ! defined yyoverflow || YYERROR_VERBOSE
1675 /* The parser invokes alloca or malloc; define the necessary symbols. */
1677 # ifdef YYSTACK_USE_ALLOCA
1678 # if YYSTACK_USE_ALLOCA
1680 # define YYSTACK_ALLOC __builtin_alloca
1681 # elif defined __BUILTIN_VA_ARG_INCR
1682 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1684 # define YYSTACK_ALLOC __alloca
1685 # elif defined _MSC_VER
1686 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1687 # define alloca _alloca
1689 # define YYSTACK_ALLOC alloca
1690 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1691 || defined __cplusplus || defined _MSC_VER)
1692 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1694 # define _STDLIB_H 1
1701 # ifdef YYSTACK_ALLOC
1702 /* Pacify GCC's `empty if-body' warning. */
1703 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1704 # ifndef YYSTACK_ALLOC_MAXIMUM
1705 /* The OS might guarantee only one guard page at the bottom of the stack,
1706 and a page size can be as small as 4096 bytes. So we cannot safely
1707 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1708 to allow for a few compiler-allocated temporary stack slots. */
1709 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1712 # define YYSTACK_ALLOC YYMALLOC
1713 # define YYSTACK_FREE YYFREE
1714 # ifndef YYSTACK_ALLOC_MAXIMUM
1715 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1717 # if (defined __cplusplus && ! defined _STDLIB_H \
1718 && ! ((defined YYMALLOC || defined malloc) \
1719 && (defined YYFREE || defined free)))
1720 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1722 # define _STDLIB_H 1
1726 # define YYMALLOC malloc
1727 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1728 || defined __cplusplus || defined _MSC_VER)
1729 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1733 # define YYFREE free
1734 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1735 || defined __cplusplus || defined _MSC_VER)
1736 void free (void *); /* INFRINGES ON USER NAME SPACE */
1740 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1743 #if (! defined yyoverflow \
1744 && (! defined __cplusplus \
1745 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1747 /* A type that is properly aligned for any stack member. */
1754 /* The size of the maximum gap between one aligned stack and the next. */
1755 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1757 /* The size of an array large to enough to hold all stacks, each with
1759 # define YYSTACK_BYTES(N) \
1760 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1761 + YYSTACK_GAP_MAXIMUM)
1763 /* Copy COUNT objects from FROM to TO. The source and destination do
1766 # if defined __GNUC__ && 1 < __GNUC__
1767 # define YYCOPY(To, From, Count) \
1768 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1770 # define YYCOPY(To, From, Count) \
1774 for (yyi = 0; yyi < (Count); yyi++) \
1775 (To)[yyi] = (From)[yyi]; \
1781 /* Relocate STACK from its old location to the new one. The
1782 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1783 elements in the stack, and YYPTR gives the new location of the
1784 stack. Advance YYPTR to a properly aligned location for the next
1786 # define YYSTACK_RELOCATE(Stack) \
1789 YYSIZE_T yynewbytes; \
1790 YYCOPY (&yyptr->Stack, Stack, yysize); \
1791 Stack = &yyptr->Stack; \
1792 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1793 yyptr += yynewbytes / sizeof (*yyptr); \
1799 /* YYFINAL -- State number of the termination state. */
1801 /* YYLAST -- Last index in YYTABLE. */
1804 /* YYNTOKENS -- Number of terminals. */
1805 #define YYNTOKENS 107
1806 /* YYNNTS -- Number of nonterminals. */
1808 /* YYNRULES -- Number of rules. */
1809 #define YYNRULES 427
1810 /* YYNRULES -- Number of states. */
1811 #define YYNSTATES 712
1813 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1814 #define YYUNDEFTOK 2
1815 #define YYMAXUTOK 351
1817 #define YYTRANSLATE(YYX) \
1818 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1820 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1821 static const yytype_uint8 yytranslate[] =
1823 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1824 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1825 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1826 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1827 101, 102, 2, 2, 100, 2, 105, 2, 2, 2,
1828 2, 2, 2, 2, 2, 2, 2, 2, 2, 99,
1829 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1830 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1831 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1832 2, 103, 2, 104, 2, 2, 2, 2, 2, 2,
1833 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1834 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1835 2, 2, 2, 97, 106, 98, 2, 2, 2, 2,
1836 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1837 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1838 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1839 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1840 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1841 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1842 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1843 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1844 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1845 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1846 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1847 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1848 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1849 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1850 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1851 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1852 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1853 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1854 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1855 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1856 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1857 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1862 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1864 static const yytype_uint16 yyprhs[] =
1866 0, 0, 3, 5, 6, 8, 11, 12, 23, 27,
1867 28, 30, 32, 34, 35, 39, 40, 41, 45, 47,
1868 48, 50, 53, 57, 59, 63, 65, 67, 69, 71,
1869 73, 75, 77, 79, 81, 83, 85, 87, 89, 91,
1870 93, 95, 97, 99, 101, 103, 105, 107, 109, 111,
1871 113, 115, 117, 119, 121, 122, 124, 127, 129, 131,
1872 133, 135, 137, 139, 141, 143, 145, 147, 149, 151,
1873 154, 155, 156, 162, 164, 166, 168, 170, 172, 174,
1874 176, 178, 180, 182, 183, 187, 189, 191, 192, 201,
1875 202, 207, 209, 211, 213, 215, 217, 219, 221, 223,
1876 225, 227, 229, 231, 233, 235, 237, 239, 240, 241,
1877 253, 255, 259, 261, 266, 268, 272, 275, 277, 282,
1878 284, 286, 289, 291, 295, 296, 302, 303, 304, 305,
1879 320, 321, 322, 346, 347, 350, 351, 352, 364, 369,
1880 370, 372, 376, 378, 381, 382, 384, 386, 387, 390,
1881 392, 394, 395, 401, 402, 403, 409, 410, 411, 417,
1882 418, 420, 421, 423, 427, 429, 430, 436, 437, 439,
1883 443, 448, 449, 453, 454, 458, 459, 460, 461, 477,
1884 478, 479, 480, 481, 482, 483, 484, 485, 510, 515,
1885 516, 518, 520, 524, 526, 531, 533, 536, 538, 540,
1886 542, 544, 550, 556, 558, 560, 562, 564, 565, 569,
1887 570, 574, 576, 577, 581, 582, 586, 591, 594, 599,
1888 602, 603, 608, 611, 616, 620, 622, 624, 626, 628,
1889 630, 632, 634, 636, 640, 643, 646, 650, 654, 657,
1890 660, 663, 665, 668, 670, 673, 676, 678, 681, 684,
1891 687, 689, 692, 694, 697, 700, 703, 706, 709, 712,
1892 714, 717, 719, 721, 723, 725, 727, 728, 732, 739,
1893 741, 745, 747, 751, 753, 755, 757, 759, 761, 763,
1894 767, 769, 773, 774, 780, 782, 784, 786, 788, 791,
1895 792, 795, 796, 798, 799, 805, 810, 811, 817, 818,
1896 819, 825, 826, 828, 832, 835, 837, 839, 841, 846,
1897 847, 849, 853, 855, 856, 858, 862, 864, 866, 869,
1898 870, 872, 873, 875, 878, 879, 885, 890, 891, 896,
1899 898, 902, 904, 909, 911, 915, 917, 919, 921, 922,
1900 925, 927, 930, 932, 936, 938, 943, 950, 952, 954,
1901 957, 962, 964, 965, 966, 967, 983, 984, 985, 986,
1902 1002, 1003, 1004, 1005, 1021, 1023, 1025, 1028, 1029, 1035,
1903 1038, 1040, 1041, 1046, 1047, 1049, 1053, 1055, 1057, 1058,
1904 1060, 1063, 1065, 1067, 1068, 1074, 1075, 1084, 1087, 1088,
1905 1091, 1092, 1094, 1097, 1100, 1101, 1102, 1103, 1104, 1122,
1906 1124, 1125, 1127, 1130, 1131, 1140, 1142, 1146, 1148, 1151,
1907 1153, 1155, 1156, 1158, 1161, 1162, 1163, 1164, 1165, 1166,
1908 1181, 1184, 1185, 1187, 1192, 1193, 1195, 1199
1911 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1912 static const yytype_int16 yyrhs[] =
1914 108, 0, -1, 109, -1, -1, 110, -1, 109, 110,
1915 -1, -1, 126, 111, 112, 113, 4, 18, 116, 114,
1916 127, 29, -1, 97, 269, 98, -1, -1, 25, -1,
1917 69, -1, 115, -1, -1, 39, 118, 99, -1, -1,
1918 -1, 31, 117, 99, -1, 119, -1, -1, 120, -1,
1919 119, 120, -1, 121, 33, 126, -1, 122, -1, 121,
1920 100, 122, -1, 6, -1, 5, -1, 123, -1, 124,
1921 -1, 125, -1, 19, -1, 44, -1, 46, -1, 49,
1922 -1, 53, -1, 54, -1, 60, -1, 61, -1, 62,
1923 -1, 67, -1, 85, -1, 86, -1, 91, -1, 15,
1924 -1, 23, -1, 24, -1, 35, -1, 57, -1, 58,
1925 -1, 87, -1, 45, -1, 92, -1, 5, -1, 128,
1926 -1, -1, 129, -1, 128, 129, -1, 139, -1, 137,
1927 -1, 159, -1, 163, -1, 167, -1, 193, -1, 197,
1928 -1, 284, -1, 276, -1, 280, -1, 307, -1, 130,
1929 -1, 1, 98, -1, -1, -1, 133, 131, 48, 132,
1930 29, -1, 54, -1, 62, -1, 87, -1, 58, -1,
1931 61, -1, 85, -1, 60, -1, 57, -1, 53, -1,
1932 15, -1, -1, 20, 135, 98, -1, 6, -1, 5,
1933 -1, -1, 136, 138, 59, 36, 4, 97, 269, 98,
1934 -1, -1, 141, 140, 4, 146, -1, 5, -1, 142,
1935 -1, 145, -1, 143, -1, 144, -1, 46, -1, 86,
1936 -1, 67, -1, 44, -1, 91, -1, 23, -1, 35,
1937 -1, 24, -1, 45, -1, 92, -1, 154, -1, -1,
1938 -1, 85, 147, 237, 80, 235, 27, 267, 148, 255,
1939 84, 154, -1, 134, -1, 78, 65, 150, -1, 5,
1940 -1, 78, 97, 152, 98, -1, 153, -1, 152, 100,
1941 153, -1, 6, 155, -1, 210, -1, 19, 97, 156,
1942 98, -1, 212, -1, 19, -1, 5, 224, -1, 157,
1943 -1, 156, 100, 157, -1, -1, 6, 158, 101, 7,
1944 102, -1, -1, -1, -1, 6, 160, 61, 161, 80,
1945 235, 27, 267, 162, 255, 4, 97, 269, 98, -1,
1946 -1, -1, 6, 164, 62, 165, 84, 154, 238, 174,
1947 177, 179, 80, 235, 166, 186, 255, 240, 243, 181,
1948 249, 4, 97, 253, 98, -1, -1, 27, 267, -1,
1949 -1, -1, 136, 168, 87, 169, 30, 269, 170, 173,
1950 255, 4, 7, -1, 94, 97, 171, 98, -1, -1,
1951 172, -1, 171, 100, 172, -1, 253, -1, 27, 267,
1952 -1, -1, 190, -1, 175, -1, -1, 176, 239, -1,
1953 74, -1, 68, -1, -1, 72, 178, 97, 248, 98,
1954 -1, -1, -1, 73, 180, 97, 253, 98, -1, -1,
1955 -1, 88, 182, 97, 183, 98, -1, -1, 184, -1,
1956 -1, 185, -1, 184, 100, 185, -1, 253, -1, -1,
1957 42, 187, 97, 188, 98, -1, -1, 189, -1, 188,
1958 100, 189, -1, 6, 101, 7, 102, -1, -1, 50,
1959 191, 239, -1, -1, 14, 192, 239, -1, -1, -1,
1960 -1, 6, 194, 58, 195, 260, 80, 235, 27, 267,
1961 196, 255, 4, 97, 254, 98, -1, -1, -1, -1,
1962 -1, -1, -1, -1, -1, 6, 198, 54, 199, 206,
1963 200, 47, 268, 201, 66, 267, 202, 21, 267, 203,
1964 27, 267, 204, 256, 205, 4, 97, 269, 98, -1,
1965 82, 97, 207, 98, -1, -1, 208, -1, 209, -1,
1966 208, 100, 209, -1, 6, -1, 6, 101, 7, 102,
1967 -1, 214, -1, 211, 214, -1, 149, -1, 150, -1,
1968 151, -1, 222, -1, 103, 16, 7, 104, 37, -1,
1969 103, 90, 7, 104, 37, -1, 221, -1, 223, -1,
1970 220, -1, 43, -1, -1, 43, 215, 225, -1, -1,
1971 43, 216, 230, -1, 44, -1, -1, 44, 217, 225,
1972 -1, -1, 5, 218, 230, -1, 126, 105, 5, 230,
1973 -1, 5, 225, -1, 126, 105, 5, 225, -1, 64,
1974 81, -1, -1, 64, 81, 219, 226, -1, 5, 226,
1975 -1, 126, 105, 5, 226, -1, 59, 36, 224, -1,
1976 7, -1, 8, -1, 9, -1, 10, -1, 11, -1,
1977 12, -1, 6, -1, 13, -1, 97, 273, 98, -1,
1978 43, 224, -1, 44, 224, -1, 64, 81, 224, -1,
1979 59, 36, 224, -1, 46, 224, -1, 23, 224, -1,
1980 23, 225, -1, 35, -1, 35, 225, -1, 91, -1,
1981 91, 225, -1, 86, 224, -1, 67, -1, 67, 226,
1982 -1, 24, 224, -1, 24, 225, -1, 45, -1, 45,
1983 225, -1, 92, -1, 92, 225, -1, 46, 224, -1,
1984 23, 224, -1, 35, 224, -1, 91, 224, -1, 86,
1985 224, -1, 67, -1, 24, 224, -1, 45, -1, 92,
1986 -1, 225, -1, 226, -1, 230, -1, -1, 101, 227,
1987 102, -1, 101, 79, 101, 227, 102, 102, -1, 228,
1988 -1, 227, 106, 228, -1, 229, -1, 229, 3, 229,
1989 -1, 8, -1, 7, -1, 10, -1, 9, -1, 12,
1990 -1, 11, -1, 97, 231, 98, -1, 232, -1, 231,
1991 100, 232, -1, -1, 6, 233, 101, 234, 102, -1,
1992 7, -1, 8, -1, 6, -1, 6, -1, 28, 267,
1993 -1, -1, 89, 267, -1, -1, 6, -1, -1, 70,
1994 241, 97, 248, 98, -1, 17, 97, 248, 98, -1,
1995 -1, 32, 242, 97, 248, 98, -1, -1, -1, 41,
1996 244, 97, 245, 98, -1, -1, 246, -1, 245, 100,
1997 246, -1, 38, 247, -1, 247, -1, 253, -1, 253,
1998 -1, 26, 97, 250, 98, -1, -1, 213, -1, 97,
1999 251, 98, -1, 252, -1, -1, 6, -1, 252, 100,
2000 6, -1, 269, -1, 269, -1, 76, 267, -1, -1,
2001 257, -1, -1, 258, -1, 257, 258, -1, -1, 77,
2002 268, 259, 27, 267, -1, 63, 97, 262, 98, -1,
2003 -1, 63, 97, 262, 98, -1, 263, -1, 262, 100,
2004 263, -1, 253, -1, 56, 97, 265, 98, -1, 266,
2005 -1, 265, 100, 266, -1, 254, -1, 13, -1, 13,
2006 -1, -1, 270, 271, -1, 272, -1, 271, 272, -1,
2007 136, -1, 126, 105, 6, -1, 7, -1, 6, 101,
2008 7, 102, -1, 126, 105, 6, 101, 7, 102, -1,
2009 274, -1, 275, -1, 274, 275, -1, 6, 101, 7,
2010 102, -1, 7, -1, -1, -1, -1, 6, 277, 60,
2011 278, 261, 80, 235, 27, 267, 279, 255, 4, 97,
2012 269, 98, -1, -1, -1, -1, 6, 281, 57, 282,
2013 264, 80, 235, 27, 267, 283, 255, 4, 97, 269,
2014 98, -1, -1, -1, -1, 6, 285, 53, 286, 80,
2015 235, 27, 267, 287, 255, 288, 4, 97, 269, 98,
2016 -1, 289, -1, 290, -1, 289, 290, -1, -1, 52,
2017 292, 291, 293, 296, -1, 5, 269, -1, 5, -1,
2018 -1, 49, 97, 294, 98, -1, -1, 295, -1, 294,
2019 100, 295, -1, 269, -1, 297, -1, -1, 298, -1,
2020 297, 298, -1, 299, -1, 301, -1, -1, 34, 300,
2021 269, 27, 267, -1, -1, 59, 302, 253, 303, 304,
2022 306, 27, 267, -1, 84, 154, -1, -1, 96, 305,
2023 -1, -1, 154, -1, 51, 239, -1, 71, 239, -1,
2024 -1, -1, -1, -1, 6, 308, 15, 309, 75, 267,
2025 80, 236, 27, 267, 310, 255, 311, 4, 97, 269,
2026 98, -1, 312, -1, -1, 313, -1, 312, 313, -1,
2027 -1, 83, 317, 314, 40, 97, 315, 98, 318, -1,
2028 316, -1, 315, 100, 316, -1, 269, -1, 5, 269,
2029 -1, 5, -1, 319, -1, -1, 320, -1, 319, 320,
2030 -1, -1, -1, -1, -1, -1, 95, 253, 321, 303,
2031 322, 304, 323, 326, 328, 324, 249, 325, 27, 267,
2032 -1, 14, 327, -1, -1, 6, -1, 22, 97, 329,
2033 98, -1, -1, 330, -1, 329, 100, 330, -1, 253,
2037 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2038 static const yytype_uint16 yyrline[] =
2040 0, 1586, 1586, 1591, 1596, 1598, 1607, 1606, 1668, 1671,
2041 1674, 1676, 1685, 1688, 1691, 1706, 1708, 1707, 1728, 1731,
2042 1735, 1737, 1741, 1786, 1788, 1796, 1802, 1808, 1824, 1834,
2043 1840, 1841, 1842, 1843, 1844, 1845, 1846, 1847, 1848, 1849,
2044 1850, 1851, 1852, 1855, 1856, 1857, 1858, 1859, 1860, 1861,
2045 1864, 1865, 1868, 1880, 1883, 1887, 1889, 1893, 1898, 1903,
2046 1908, 1913, 1918, 1923, 1928, 1933, 1938, 1943, 1948, 1953,
2047 1968, 1980, 1967, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
2048 2020, 2021, 2022, 2026, 2025, 2055, 2060, 2076, 2075, 2116,
2049 2115, 2281, 2285, 2309, 2323, 2324, 2333, 2334, 2335, 2336,
2050 2337, 2340, 2341, 2342, 2345, 2346, 2349, 2366, 2397, 2365,
2051 2433, 2441, 2455, 2500, 2508, 2514, 2534, 2617, 2623, 2645,
2052 2649, 2654, 2687, 2693, 2707, 2706, 2742, 2752, 2777, 2741,
2053 2805, 2815, 2804, 3111, 3120, 3128, 3138, 3127, 3210, 3215,
2054 3220, 3230, 3252, 3258, 3264, 3267, 3271, 3280, 3283, 3287,
2055 3291, 3296, 3295, 3303, 3307, 3306, 3314, 3319, 3318, 3326,
2056 3329, 3332, 3335, 3341, 3355, 3360, 3359, 3367, 3370, 3376,
2057 3390, 3412, 3411, 3423, 3422, 3436, 3446, 3466, 3435, 3497,
2058 3507, 3532, 3536, 3540, 3547, 3554, 3558, 3496, 3604, 3611,
2059 3618, 3625, 3631, 3646, 3667, 3690, 3694, 3714, 3719, 3724,
2060 3729, 3746, 3748, 3756, 3761, 3778, 3787, 3801, 3800, 3820,
2061 3819, 3834, 3861, 3860, 3892, 3891, 3945, 3992, 4047, 4097,
2062 4103, 4102, 4114, 4160, 4201, 4208, 4215, 4221, 4228, 4235,
2063 4261, 4284, 4304, 4321, 4354, 4358, 4383, 4387, 4393, 4421,
2064 4447, 4484, 4510, 4543, 4567, 4594, 4622, 4660, 4706, 4732,
2065 4769, 4795, 4832, 4858, 4901, 4929, 4955, 4981, 5005, 5033,
2066 5073, 5099, 5124, 5151, 5168, 5185, 5204, 5211, 5221, 5233,
2067 5239, 5253, 5260, 5270, 5276, 5282, 5288, 5294, 5317, 5344,
2068 5350, 5356, 5370, 5369, 5391, 5406, 5415, 5474, 5490, 5500,
2069 5505, 5515, 5520, 5587, 5586, 5604, 5615, 5614, 5628, 5634,
2070 5633, 5667, 5672, 5678, 5692, 5697, 5703, 5713, 5719, 5734,
2071 5738, 5740, 5748, 5751, 5754, 5760, 5773, 5779, 5785, 5795,
2072 5798, 5801, 5804, 5806, 5811, 5810, 5841, 5846, 5851, 5857,
2073 5863, 5876, 5888, 5894, 5900, 5913, 5924, 5935, 5941, 5941,
2074 5956, 5960, 5969, 6063, 6167, 6191, 6251, 6320, 6324, 6326,
2075 6330, 6332, 6337, 6347, 6366, 6336, 6397, 6407, 6429, 6396,
2076 6461, 6471, 6489, 6460, 6553, 6559, 6563, 6599, 6598, 6627,
2077 6636, 6646, 6651, 6656, 6661, 6667, 6680, 6703, 6710, 6717,
2078 6721, 6788, 6794, 6803, 6802, 6836, 6835, 6882, 6891, 6896,
2079 6908, 6913, 6919, 6925, 6934, 6940, 6950, 6972, 6939, 7007,
2080 7010, 7013, 7015, 7020, 7019, 7046, 7056, 7073, 7079, 7088,
2081 7098, 7101, 7104, 7106, 7111, 7119, 7126, 7134, 7141, 7110,
2082 7164, 7167, 7170, 7235, 7238, 7241, 7243, 7247
2086 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2087 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2088 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2089 static const char *const yytname[] =
2091 "$end", "error", "$undefined", "DOT_DOT", "COLON_COLON_EQUAL",
2092 "UPPERCASE_IDENTIFIER", "LOWERCASE_IDENTIFIER", "NUMBER",
2093 "NEGATIVENUMBER", "NUMBER64", "NEGATIVENUMBER64", "BIN_STRING",
2094 "HEX_STRING", "QUOTED_STRING", "ACCESS", "AGENT_CAPABILITIES",
2095 "APPLICATION", "AUGMENTS", "BEGIN_", "BITS", "CHOICE", "CONTACT_INFO",
2096 "CREATION_REQUIRES", "COUNTER32", "COUNTER64", "DEFINITIONS", "DEFVAL",
2097 "DESCRIPTION", "DISPLAY_HINT", "END", "ENTERPRISE", "EXPORTS", "EXTENDS",
2098 "FROM", "GROUP", "GAUGE32", "IDENTIFIER", "IMPLICIT", "IMPLIED",
2099 "IMPORTS", "INCLUDES", "INDEX", "INSTALL_ERRORS", "INTEGER", "INTEGER32",
2100 "INTEGER64", "IPADDRESS", "LAST_UPDATED", "MACRO", "MANDATORY_GROUPS",
2101 "MAX_ACCESS", "MIN_ACCESS", "MODULE", "MODULE_COMPLIANCE",
2102 "MODULE_IDENTITY", "NOT_ACCESSIBLE", "NOTIFICATIONS",
2103 "NOTIFICATION_GROUP", "NOTIFICATION_TYPE", "OBJECT", "OBJECT_GROUP",
2104 "OBJECT_IDENTITY", "OBJECT_TYPE", "OBJECTS", "OCTET", "OF",
2105 "ORGANIZATION", "OPAQUE", "PIB_ACCESS", "PIB_DEFINITIONS", "PIB_INDEX",
2106 "PIB_MIN_ACCESS", "PIB_REFERENCES", "PIB_TAG", "POLICY_ACCESS",
2107 "PRODUCT_RELEASE", "REFERENCE", "REVISION", "SEQUENCE", "SIZE", "STATUS",
2108 "STRING", "SUBJECT_CATEGORIES", "SUPPORTS", "SYNTAX",
2109 "TEXTUAL_CONVENTION", "TIMETICKS", "TRAP_TYPE", "UNIQUENESS", "UNITS",
2110 "UNIVERSAL", "UNSIGNED32", "UNSIGNED64", "VALUE", "VARIABLES",
2111 "VARIATION", "WRITE_SYNTAX", "'{'", "'}'", "';'", "','", "'('", "')'",
2112 "'['", "']'", "'.'", "'|'", "$accept", "mibFile", "modules", "module",
2113 "@1", "moduleOid", "definitions", "linkagePart", "linkageClause",
2114 "exportsClause", "@2", "importPart", "imports", "import",
2115 "importIdentifiers", "importIdentifier", "importedKeyword",
2116 "importedSMIKeyword", "importedSPPIKeyword", "moduleName",
2117 "declarationPart", "declarations", "declaration", "macroClause", "@3",
2118 "@4", "macroName", "choiceClause", "@5", "fuzzy_lowercase_identifier",
2119 "valueDeclaration", "@6", "typeDeclaration", "@7", "typeName", "typeSMI",
2120 "typeSMIandSPPI", "typeSMIonly", "typeSPPIonly", "typeDeclarationRHS",
2121 "@8", "@9", "conceptualTable", "row", "entryType", "sequenceItems",
2122 "sequenceItem", "Syntax", "sequenceSyntax", "NamedBits", "NamedBit",
2123 "@10", "objectIdentityClause", "@11", "@12", "@13", "objectTypeClause",
2124 "@14", "@15", "descriptionClause", "trapTypeClause", "@16", "@17",
2125 "VarPart", "VarTypes", "VarType", "DescrPart", "MaxOrPIBAccessPart",
2126 "PibAccessPart", "PibAccess", "SPPIPibReferencesPart", "@18",
2127 "SPPIPibTagPart", "@19", "SPPIUniquePart", "@20", "UniqueTypesPart",
2128 "UniqueTypes", "UniqueType", "SPPIErrorsPart", "@21", "Errors", "Error",
2129 "MaxAccessPart", "@22", "@23", "notificationTypeClause", "@24", "@25",
2130 "@26", "moduleIdentityClause", "@27", "@28", "@29", "@30", "@31", "@32",
2131 "@33", "@34", "SubjectCategoriesPart", "SubjectCategories",
2132 "CategoryIDs", "CategoryID", "ObjectSyntax", "typeTag",
2133 "sequenceObjectSyntax", "valueofObjectSyntax", "SimpleSyntax", "@35",
2134 "@36", "@37", "@38", "@39", "valueofSimpleSyntax",
2135 "sequenceSimpleSyntax", "ApplicationSyntax", "sequenceApplicationSyntax",
2136 "anySubType", "integerSubType", "octetStringSubType", "ranges", "range",
2137 "value", "enumSpec", "enumItems", "enumItem", "@40", "enumNumber",
2138 "Status", "Status_Capabilities", "DisplayPart", "UnitsPart", "Access",
2139 "IndexPart", "@41", "@42", "MibIndex", "@43", "IndexTypes", "IndexType",
2140 "Index", "Entry", "DefValPart", "Value", "BitsValue", "BitNames",
2141 "ObjectName", "NotificationName", "ReferPart", "RevisionPart",
2142 "Revisions", "Revision", "@44", "NotificationObjectsPart",
2143 "ObjectGroupObjectsPart", "Objects", "Object", "NotificationsPart",
2144 "Notifications", "Notification", "Text", "ExtUTCTime",
2145 "objectIdentifier", "@45", "subidentifiers", "subidentifier",
2146 "objectIdentifier_defval", "subidentifiers_defval",
2147 "subidentifier_defval", "objectGroupClause", "@46", "@47", "@48",
2148 "notificationGroupClause", "@49", "@50", "@51", "moduleComplianceClause",
2149 "@52", "@53", "@54", "ComplianceModulePart", "ComplianceModules",
2150 "ComplianceModule", "@55", "ComplianceModuleName", "MandatoryPart",
2151 "MandatoryGroups", "MandatoryGroup", "CompliancePart", "Compliances",
2152 "Compliance", "ComplianceGroup", "@56", "ComplianceObject", "@57",
2153 "SyntaxPart", "WriteSyntaxPart", "WriteSyntax", "AccessPart",
2154 "agentCapabilitiesClause", "@58", "@59", "@60",
2155 "ModulePart_Capabilities", "Modules_Capabilities", "Module_Capabilities",
2156 "@61", "CapabilitiesGroups", "CapabilitiesGroup",
2157 "ModuleName_Capabilities", "VariationPart", "Variations", "Variation",
2158 "@62", "@63", "@64", "@65", "@66", "VariationAccessPart",
2159 "VariationAccess", "CreationPart", "Cells", "Cell", 0
2164 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2166 static const yytype_uint16 yytoknum[] =
2168 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2169 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2170 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2171 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2172 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2173 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2174 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2175 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2176 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2177 345, 346, 347, 348, 349, 350, 351, 123, 125, 59,
2178 44, 40, 41, 91, 93, 46, 124
2182 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2183 static const yytype_uint16 yyr1[] =
2185 0, 107, 108, 108, 109, 109, 111, 110, 112, 112,
2186 113, 113, 114, 114, 115, 116, 117, 116, 118, 118,
2187 119, 119, 120, 121, 121, 122, 122, 122, 123, 123,
2188 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
2189 123, 123, 123, 124, 124, 124, 124, 124, 124, 124,
2190 125, 125, 126, 127, 127, 128, 128, 129, 129, 129,
2191 129, 129, 129, 129, 129, 129, 129, 129, 129, 129,
2192 131, 132, 130, 133, 133, 133, 133, 133, 133, 133,
2193 133, 133, 133, 135, 134, 136, 136, 138, 137, 140,
2194 139, 141, 141, 141, 142, 142, 143, 143, 143, 143,
2195 143, 144, 144, 144, 145, 145, 146, 147, 148, 146,
2196 146, 149, 150, 151, 152, 152, 153, 154, 154, 155,
2197 155, 155, 156, 156, 158, 157, 160, 161, 162, 159,
2198 164, 165, 163, 166, 166, 168, 169, 167, 170, 170,
2199 171, 171, 172, 173, 173, 174, 174, 174, 175, 176,
2200 176, 178, 177, 177, 180, 179, 179, 182, 181, 181,
2201 183, 183, 184, 184, 185, 187, 186, 186, 188, 188,
2202 189, 191, 190, 192, 190, 194, 195, 196, 193, 198,
2203 199, 200, 201, 202, 203, 204, 205, 197, 206, 206,
2204 207, 208, 208, 209, 209, 210, 210, 210, 210, 210,
2205 210, 211, 211, 212, 212, 213, 214, 215, 214, 216,
2206 214, 214, 217, 214, 218, 214, 214, 214, 214, 214,
2207 219, 214, 214, 214, 214, 220, 220, 220, 220, 220,
2208 220, 220, 220, 220, 221, 221, 221, 221, 222, 222,
2209 222, 222, 222, 222, 222, 222, 222, 222, 222, 222,
2210 222, 222, 222, 222, 223, 223, 223, 223, 223, 223,
2211 223, 223, 223, 224, 224, 224, 224, 225, 226, 227,
2212 227, 228, 228, 229, 229, 229, 229, 229, 229, 230,
2213 231, 231, 233, 232, 234, 234, 235, 236, 237, 237,
2214 238, 238, 239, 241, 240, 240, 242, 240, 240, 244,
2215 243, 243, 245, 245, 246, 246, 247, 248, 249, 249,
2216 250, 250, 251, 251, 252, 252, 253, 254, 255, 255,
2217 256, 256, 257, 257, 259, 258, 260, 260, 261, 262,
2218 262, 263, 264, 265, 265, 266, 267, 268, 270, 269,
2219 271, 271, 272, 272, 272, 272, 272, 273, 274, 274,
2220 275, 275, 277, 278, 279, 276, 281, 282, 283, 280,
2221 285, 286, 287, 284, 288, 289, 289, 291, 290, 292,
2222 292, 292, 293, 293, 294, 294, 295, 296, 296, 297,
2223 297, 298, 298, 300, 299, 302, 301, 303, 303, 304,
2224 304, 305, 306, 306, 306, 308, 309, 310, 307, 311,
2225 311, 312, 312, 314, 313, 315, 315, 316, 317, 317,
2226 318, 318, 319, 319, 321, 322, 323, 324, 325, 320,
2227 326, 326, 327, 328, 328, 329, 329, 330
2230 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2231 static const yytype_uint8 yyr2[] =
2233 0, 2, 1, 0, 1, 2, 0, 10, 3, 0,
2234 1, 1, 1, 0, 3, 0, 0, 3, 1, 0,
2235 1, 2, 3, 1, 3, 1, 1, 1, 1, 1,
2236 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2237 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2238 1, 1, 1, 1, 0, 1, 2, 1, 1, 1,
2239 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
2240 0, 0, 5, 1, 1, 1, 1, 1, 1, 1,
2241 1, 1, 1, 0, 3, 1, 1, 0, 8, 0,
2242 4, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2243 1, 1, 1, 1, 1, 1, 1, 0, 0, 11,
2244 1, 3, 1, 4, 1, 3, 2, 1, 4, 1,
2245 1, 2, 1, 3, 0, 5, 0, 0, 0, 14,
2246 0, 0, 23, 0, 2, 0, 0, 11, 4, 0,
2247 1, 3, 1, 2, 0, 1, 1, 0, 2, 1,
2248 1, 0, 5, 0, 0, 5, 0, 0, 5, 0,
2249 1, 0, 1, 3, 1, 0, 5, 0, 1, 3,
2250 4, 0, 3, 0, 3, 0, 0, 0, 15, 0,
2251 0, 0, 0, 0, 0, 0, 0, 24, 4, 0,
2252 1, 1, 3, 1, 4, 1, 2, 1, 1, 1,
2253 1, 5, 5, 1, 1, 1, 1, 0, 3, 0,
2254 3, 1, 0, 3, 0, 3, 4, 2, 4, 2,
2255 0, 4, 2, 4, 3, 1, 1, 1, 1, 1,
2256 1, 1, 1, 3, 2, 2, 3, 3, 2, 2,
2257 2, 1, 2, 1, 2, 2, 1, 2, 2, 2,
2258 1, 2, 1, 2, 2, 2, 2, 2, 2, 1,
2259 2, 1, 1, 1, 1, 1, 0, 3, 6, 1,
2260 3, 1, 3, 1, 1, 1, 1, 1, 1, 3,
2261 1, 3, 0, 5, 1, 1, 1, 1, 2, 0,
2262 2, 0, 1, 0, 5, 4, 0, 5, 0, 0,
2263 5, 0, 1, 3, 2, 1, 1, 1, 4, 0,
2264 1, 3, 1, 0, 1, 3, 1, 1, 2, 0,
2265 1, 0, 1, 2, 0, 5, 4, 0, 4, 1,
2266 3, 1, 4, 1, 3, 1, 1, 1, 0, 2,
2267 1, 2, 1, 3, 1, 4, 6, 1, 1, 2,
2268 4, 1, 0, 0, 0, 15, 0, 0, 0, 15,
2269 0, 0, 0, 15, 1, 1, 2, 0, 5, 2,
2270 1, 0, 4, 0, 1, 3, 1, 1, 0, 1,
2271 2, 1, 1, 0, 5, 0, 8, 2, 0, 2,
2272 0, 1, 2, 2, 0, 0, 0, 0, 17, 1,
2273 0, 1, 2, 0, 8, 1, 3, 1, 2, 1,
2274 1, 0, 1, 2, 0, 0, 0, 0, 0, 14,
2275 2, 0, 1, 4, 0, 1, 3, 1
2278 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2279 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2280 means the default is an error. */
2281 static const yytype_uint16 yydefact[] =
2283 3, 52, 0, 2, 4, 6, 1, 5, 9, 338,
2284 0, 0, 0, 10, 11, 0, 8, 86, 85, 344,
2285 0, 342, 339, 340, 0, 0, 0, 341, 15, 0,
2286 343, 16, 13, 345, 0, 0, 19, 0, 12, 0,
2287 17, 26, 25, 43, 30, 44, 45, 46, 31, 50,
2288 32, 33, 34, 35, 47, 48, 36, 37, 38, 39,
2289 40, 41, 49, 42, 51, 0, 18, 20, 0, 23,
2290 27, 28, 29, 0, 86, 85, 82, 101, 103, 102,
2291 99, 104, 96, 81, 73, 80, 76, 79, 77, 74,
2292 98, 78, 97, 75, 100, 105, 0, 0, 55, 68,
2293 70, 87, 58, 57, 89, 92, 94, 95, 93, 59,
2294 60, 61, 62, 63, 65, 66, 64, 67, 346, 14,
2295 21, 0, 0, 69, 0, 0, 0, 0, 0, 0,
2296 0, 0, 7, 56, 0, 0, 0, 0, 22, 24,
2297 127, 131, 176, 180, 353, 357, 361, 396, 71, 0,
2298 136, 0, 0, 0, 327, 189, 0, 0, 0, 0,
2299 0, 0, 0, 112, 0, 83, 266, 266, 241, 206,
2300 211, 250, 266, 0, 0, 246, 0, 107, 266, 243,
2301 252, 0, 0, 110, 90, 197, 198, 199, 106, 117,
2302 0, 195, 200, 0, 0, 0, 0, 0, 181, 0,
2303 0, 0, 0, 0, 0, 72, 0, 338, 0, 0,
2304 217, 222, 0, 0, 0, 239, 240, 264, 265, 248,
2305 249, 0, 242, 0, 0, 0, 251, 238, 263, 266,
2306 219, 0, 247, 0, 0, 289, 245, 244, 253, 0,
2307 0, 0, 52, 196, 286, 0, 291, 338, 0, 0,
2308 0, 338, 0, 338, 0, 0, 336, 0, 338, 139,
2309 274, 273, 276, 275, 278, 277, 0, 0, 269, 271,
2310 215, 124, 0, 122, 84, 282, 0, 280, 208, 210,
2311 213, 224, 0, 112, 111, 0, 0, 114, 0, 0,
2312 0, 0, 0, 0, 0, 147, 331, 0, 329, 316,
2313 0, 193, 0, 190, 191, 0, 0, 0, 335, 0,
2314 333, 317, 0, 0, 0, 0, 0, 144, 0, 267,
2315 0, 0, 0, 118, 0, 0, 279, 0, 221, 266,
2316 120, 266, 266, 266, 266, 266, 261, 266, 0, 0,
2317 259, 266, 266, 262, 116, 119, 203, 204, 113, 0,
2318 288, 0, 0, 0, 218, 223, 216, 128, 290, 173,
2319 171, 150, 149, 153, 146, 0, 145, 326, 338, 0,
2320 0, 188, 0, 337, 182, 328, 0, 332, 338, 0,
2321 362, 287, 0, 88, 338, 0, 319, 0, 270, 272,
2322 0, 123, 0, 281, 121, 255, 260, 256, 234, 235,
2323 254, 266, 266, 258, 257, 115, 0, 201, 202, 319,
2324 0, 0, 151, 156, 292, 148, 330, 177, 0, 192,
2325 0, 354, 334, 358, 319, 0, 0, 140, 142, 143,
2326 0, 0, 0, 0, 284, 285, 0, 237, 236, 0,
2327 0, 174, 172, 0, 154, 0, 319, 194, 0, 319,
2328 319, 0, 397, 138, 338, 318, 0, 268, 125, 283,
2329 108, 0, 338, 0, 0, 0, 183, 0, 0, 371,
2330 0, 364, 365, 319, 141, 137, 319, 338, 0, 307,
2331 338, 133, 0, 0, 0, 0, 370, 367, 0, 366,
2332 400, 0, 0, 152, 0, 0, 167, 338, 0, 338,
2333 338, 369, 373, 338, 0, 0, 399, 401, 0, 129,
2334 155, 134, 165, 319, 0, 184, 0, 0, 0, 378,
2335 0, 338, 403, 0, 402, 109, 0, 298, 178, 0,
2336 355, 359, 338, 383, 385, 368, 377, 379, 381, 382,
2337 363, 408, 0, 338, 0, 0, 296, 293, 301, 0,
2338 376, 0, 374, 338, 338, 380, 0, 0, 0, 0,
2339 168, 338, 0, 0, 299, 159, 185, 372, 338, 0,
2340 388, 338, 398, 0, 166, 0, 0, 338, 338, 0,
2341 157, 309, 321, 375, 0, 0, 390, 407, 0, 405,
2342 0, 169, 295, 0, 0, 338, 0, 0, 0, 0,
2343 186, 320, 322, 384, 387, 0, 394, 411, 338, 170,
2344 297, 294, 338, 0, 302, 305, 306, 338, 0, 0,
2345 324, 0, 323, 391, 389, 0, 0, 0, 338, 404,
2346 410, 412, 406, 304, 300, 338, 0, 160, 162, 164,
2347 231, 225, 226, 227, 228, 229, 230, 232, 313, 310,
2348 205, 0, 338, 0, 0, 392, 393, 0, 414, 413,
2349 303, 158, 338, 314, 351, 0, 312, 0, 347, 348,
2350 308, 0, 0, 338, 386, 388, 163, 0, 311, 0,
2351 233, 0, 349, 132, 325, 0, 415, 0, 315, 187,
2352 390, 350, 416, 421, 0, 424, 422, 420, 0, 417,
2353 338, 309, 427, 0, 425, 418, 423, 338, 0, 426,
2357 /* YYDEFGOTO[NTERM-NUM]. */
2358 static const yytype_int16 yydefgoto[] =
2360 -1, 2, 3, 4, 8, 10, 15, 37, 38, 32,
2361 35, 65, 66, 67, 68, 69, 70, 71, 72, 182,
2362 96, 97, 98, 99, 134, 160, 100, 183, 213, 21,
2363 102, 135, 103, 137, 104, 105, 106, 107, 108, 184,
2364 235, 476, 185, 186, 187, 286, 287, 188, 344, 272,
2365 273, 322, 109, 124, 152, 409, 110, 125, 153, 496,
2366 111, 136, 162, 317, 426, 427, 386, 363, 364, 365,
2367 413, 443, 445, 463, 581, 596, 636, 637, 638, 513,
2368 526, 559, 560, 366, 411, 410, 112, 126, 154, 446,
2369 113, 127, 155, 250, 420, 483, 529, 582, 621, 198,
2370 302, 303, 304, 189, 190, 345, 649, 191, 223, 224,
2371 225, 209, 282, 650, 346, 192, 347, 215, 228, 217,
2372 267, 268, 269, 218, 276, 277, 325, 436, 245, 382,
2373 289, 295, 415, 548, 563, 562, 565, 579, 613, 614,
2374 615, 478, 598, 651, 665, 666, 479, 308, 431, 600,
2375 601, 602, 653, 196, 200, 297, 298, 202, 309, 310,
2376 257, 374, 299, 12, 22, 23, 667, 668, 669, 114,
2377 128, 156, 449, 115, 129, 157, 450, 116, 130, 158,
2378 424, 470, 471, 472, 502, 487, 519, 551, 552, 535,
2379 536, 537, 538, 553, 539, 554, 586, 606, 624, 627,
2380 117, 131, 159, 473, 505, 506, 507, 542, 588, 589,
2381 522, 629, 630, 631, 675, 690, 693, 701, 708, 695,
2385 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2387 #define YYPACT_NINF -461
2388 static const yytype_int16 yypact[] =
2390 19, -461, 36, 19, -461, -461, -461, -461, -58, -461,
2391 -5, -31, 54, -461, -461, 78, -461, -1, 9, -461,
2392 38, -461, 54, -461, 107, 154, 160, -461, 138, 88,
2393 90, -461, 153, -461, 186, 95, 561, 350, -461, 93,
2394 -461, -461, -461, -461, -461, -461, -461, -461, -461, -461,
2395 -461, -461, -461, -461, -461, -461, -461, -461, -461, -461,
2396 -461, -461, -461, -461, -461, 97, 561, -461, -23, -461,
2397 -461, -461, -461, 99, 195, 70, -461, -461, -461, -461,
2398 -461, -461, -461, -461, -461, -461, -461, -461, -461, -461,
2399 -461, -461, -461, -461, -461, -461, 171, 496, -461, -461,
2400 -461, 115, -461, -461, -461, -461, -461, -461, -461, -461,
2401 -461, -461, -461, -461, -461, -461, -461, -461, -461, -461,
2402 -461, 19, 561, -461, 140, 141, 146, 151, 149, 155,
2403 158, 191, -461, -461, 166, 156, 129, 213, -461, -461,
2404 -461, -461, -461, -461, -461, -461, -461, -461, -461, 183,
2405 -461, 202, 143, 134, 157, 142, 167, 173, 152, 161,
2406 204, 227, 205, 2, 145, -461, -47, -47, 150, -18,
2407 159, 150, -47, 203, 162, 169, -49, -461, -47, 150,
2408 150, -2, 148, -461, -461, -461, -461, -461, -461, -461,
2409 52, -461, -461, 244, 233, 165, 174, 170, -461, 176,
2410 178, 177, 179, 244, 242, -461, 184, -461, 35, 185,
2411 -461, -461, 257, 187, 265, -461, -461, -461, -461, -461,
2412 -461, 175, -461, 150, 185, 150, -461, -461, -461, -47,
2413 188, 193, -461, 270, 277, 256, -461, -461, -461, 279,
2414 283, 286, 5, -461, -461, 268, 207, -461, 244, 292,
2415 254, -461, 244, -461, 244, 275, -461, 223, -461, 210,
2416 -461, -461, -461, -461, -461, -461, 206, 3, -461, 303,
2417 -461, -461, 15, -461, -461, -461, 37, -461, -461, -461,
2418 -461, -461, 169, -461, -461, 441, 41, -461, 242, 229,
2419 208, 209, -47, 242, 242, 13, -461, 44, -461, -461,
2420 287, 214, 212, 217, -461, 305, 48, 293, -461, 51,
2421 -461, -461, 294, 242, 316, 225, 230, 299, 175, -461,
2422 175, 175, 228, -461, 257, 231, -461, 265, -461, -47,
2423 -461, -47, -47, -47, -47, -47, -461, -47, 295, 247,
2424 -461, -47, -47, -461, -461, -461, -461, -461, -461, 277,
2425 -461, 244, 296, 297, -461, -461, -461, -461, -461, -461,
2426 -461, -461, -461, 258, -461, 329, -461, -461, -461, 242,
2427 330, -461, 292, -461, -461, -461, 242, -461, -461, 242,
2428 -461, -461, 311, -461, -461, 242, 263, 6, -461, -461,
2429 333, -461, 126, -461, -461, -461, -461, -461, -461, -461,
2430 -461, -47, -47, -461, -461, -461, 314, -461, -461, 263,
2431 329, 329, -461, 269, -461, -461, -461, -461, 241, -461,
2432 278, -461, -461, -461, 263, 242, 55, -461, -461, -461,
2433 242, 341, 245, 246, -461, -461, 248, -461, -461, 242,
2434 342, -461, -461, 255, -461, 273, 263, -461, 242, 263,
2435 263, 302, -461, -461, -461, -461, 351, -461, -461, -461,
2436 -461, 260, -461, 262, 244, 356, -461, 357, 358, 359,
2437 363, 302, -461, 263, -461, -461, 263, -461, 272, -461,
2438 -461, 336, 271, 354, 280, 281, 114, -461, 284, -461,
2439 300, 304, 282, -461, 288, 242, 334, -461, 242, -461,
2440 -461, -461, 335, -461, 385, 387, 300, -461, 233, -461,
2441 -461, -461, -461, 263, 301, -461, 307, 317, 312, -3,
2442 320, 352, -461, 322, -461, -461, 323, 20, -461, 370,
2443 -461, -461, -461, -461, -461, -461, -3, -461, -461, -461,
2444 -461, -461, 360, -461, 392, 324, -461, -461, 361, 242,
2445 -461, 58, -461, -461, -461, -461, 325, 326, 313, 59,
2446 -461, -461, 331, 332, -461, 338, -461, -461, -461, 374,
2447 339, -461, -461, 420, -461, 392, 340, -461, -461, 337,
2448 -461, 404, 355, -461, 242, 233, 343, -461, 64, -461,
2449 345, -461, -461, 346, 347, 393, 353, 362, 429, 305,
2450 -461, 355, -461, -461, -461, 233, -13, 348, -461, -461,
2451 -461, -461, -461, 67, -461, -461, -461, 364, 63, 366,
2452 -461, 436, -461, -461, -461, 329, 329, 421, -461, -461,
2453 348, -461, -461, -461, -461, 393, 368, 349, -461, -461,
2454 -461, -461, -461, -461, -461, -461, -461, -461, 172, -461,
2455 -461, 369, -461, 424, 372, -461, -461, 242, -461, -461,
2456 -461, -461, -461, 371, -461, 373, 375, 376, 182, -461,
2457 -461, 380, 242, -461, -461, 339, -461, 445, -461, 447,
2458 -461, 371, -461, -461, -461, 381, -461, 378, -461, -461,
2459 343, -461, -461, 442, 449, 435, -461, -461, 384, -461,
2460 -461, 404, -461, 77, -461, -461, -461, -461, 431, -461,
2464 /* YYPGOTO[NTERM-NUM]. */
2465 static const yytype_int16 yypgoto[] =
2467 -461, -461, -461, 467, -461, -461, -461, -461, -461, -461,
2468 -461, -461, -461, 407, -461, 367, -461, -461, -461, 29,
2469 -461, -461, 386, -461, -461, -461, -461, -461, -461, -4,
2470 -461, -461, -461, -461, -461, -461, -461, -461, -461, -461,
2471 -461, -461, -461, 249, -461, -461, 144, -192, -461, -461,
2472 168, -461, -461, -461, -461, -461, -461, -461, -461, -461,
2473 -461, -461, -461, -461, -461, 42, -461, -461, -461, -461,
2474 -461, -461, -461, -461, -461, -461, -461, -461, -167, -461,
2475 -461, -461, -77, -461, -461, -461, -461, -461, -461, -461,
2476 -461, -461, -461, -461, -461, -461, -461, -461, -461, -461,
2477 -461, -461, 127, -461, -461, -461, -461, 319, -461, -461,
2478 -461, -461, -461, -461, -461, -461, -461, -161, -145, -156,
2479 189, 190, 192, -194, -461, 194, -461, -461, -199, -461,
2480 -461, -461, -398, -461, -461, -461, -461, -461, -461, -132,
2481 -108, -460, -195, -461, -461, -461, -246, 17, -384, -461,
2482 -461, -86, -461, -461, -461, 266, 180, -461, -461, 196,
2483 -285, -83, -9, -461, -461, 500, -461, -461, -150, -461,
2484 -461, -461, -461, -461, -461, -461, -461, -461, -461, -461,
2485 -461, -461, -461, 53, -461, -461, -461, -461, -42, -461,
2486 -461, -8, -461, -461, -461, -461, -146, -160, -461, -461,
2487 -461, -461, -461, -461, -461, -461, 30, -461, -461, -73,
2488 -461, -461, -461, -93, -461, -461, -461, -461, -461, -461,
2489 -461, -461, -461, -169
2492 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2493 positive, shift that token. If negative, reduce the rule which
2494 number is the opposite. If zero, do what YYDEFACT says.
2495 If YYTABLE_NINF, syntax error. */
2496 #define YYTABLE_NINF -410
2497 static const yytype_int16 yytable[] =
2499 11, 296, 246, 350, 255, 296, 219, 211, 357, 358,
2500 121, 227, 441, 442, 239, 270, 233, 236, 210, 232,
2501 13, 216, 220, 222, 1, 440, 226, 359, 380, 5,
2502 279, 533, 5, 101, 237, 238, 6, 545, 625, 9,
2503 451, 20, 260, 261, 262, 263, 264, 265, 234, 300,
2504 214, 20, 546, 307, 208, 312, 534, 242, 626, 17,
2505 18, 19, 465, 360, 14, 467, 468, 16, 281, 640,
2506 641, 642, 643, 644, 645, 646, 647, 122, 278, -209,
2507 280, 361, 24, -207, 417, -395, 211, 362, 240, 490,
2508 547, 421, 491, 101, 423, 169, 170, 210, 356, -214,
2509 429, 576, -214, 208, -52, 319, 208, -52, 432, 320,
2510 25, 173, 320, 323, 266, 324, 174, 593, 594, -338,
2511 -338, -338, 296, -360, -179, 28, 328, -356, -175, 527,
2512 -352, -126, -130, 434, 435, 326, 355, 327, 428, 348,
2513 452, 349, 367, 26, 368, 455, 375, 354, 368, 377,
2514 138, 378, 406, 453, 460, 454, 567, 574, 568, 575,
2515 648, 29, 607, 466, 608, 634, 30, 635, 394, 31,
2516 395, 396, 397, 398, 399, 706, 400, 707, 663, 664,
2517 403, 404, 260, 261, 262, 263, 264, 265, 681, 664,
2518 33, 34, 36, 39, 40, 118, 119, 123, 259, -91,
2519 132, 140, -135, 141, 142, 143, 147, 163, 428, 144,
2520 511, 146, 145, 515, 148, 149, 150, 151, 194, 161,
2521 195, 164, 165, 193, 197, 166, 167, 655, 656, 201,
2522 199, 206, 203, 205, 494, 207, 204, 168, 163, 229,
2523 437, 438, 212, 230, 311, 169, 170, 171, 172, 315,
2524 244, 221, 164, 241, 248, 256, 166, 167, 252, 254,
2525 -212, 173, 247, 271, 566, 481, 174, 249, 168, 175,
2526 231, 275, 266, 251, 253, 283, 169, 170, 171, 172,
2527 176, 258, 214, 285, 288, 274, 290, 177, 178, -220,
2528 291, 292, 173, 179, 180, 293, 294, 174, 301, 603,
2529 175, 305, 313, 314, 316, 181, 321, 318, 570, 351,
2530 371, 176, 352, 353, 369, 370, 525, 372, 373, 178,
2531 376, 379, 381, 383, 179, 180, 385, 384, 402, 390,
2532 412, 401, 392, 407, 408, 414, 181, 418, 425, 430,
2533 433, 439, 444, 447, 448, 456, 461, 457, 458, 616,
2534 459, 73, 462, 464, 469, 74, 75, 477, 475, 480,
2535 482, 484, 485, 495, 486, 76, 616, 488, 497, 311,
2536 493, 639, 674, 77, 78, 498, 512, 499, 500, -54,
2537 509, 503, 658, 504, 518, 79, 510, 684, 508, 616,
2538 521, 523, -409, 604, 80, 81, 82, 549, 558, 528,
2539 556, 584, 564, 83, 84, 530, 671, 85, 86, 532,
2540 87, 88, 89, 623, 573, 531, 639, 90, 540, 543,
2541 544, 561, 571, 585, 572, 711, 580, 590, 577, 578,
2542 597, 612, 599, 619, 595, 91, 92, 93, 592, 605,
2543 654, 94, 95, 628, 610, 611, 329, 609, 657, 662,
2544 617, 672, 687, 688, 702, 696, 694, 698, 710, 618,
2545 330, 702, -161, 652, 331, 332, 661, 670, 492, 673,
2546 7, 678, 677, 120, 680, 679, 333, 501, 683, 689,
2547 691, 700, 284, 133, 334, 335, 336, 337, 311, 139,
2548 516, 517, 391, 405, 520, 676, 474, 73, 591, 419,
2549 338, 74, 75, 660, 633, 339, 705, 387, 340, 243,
2550 388, 76, 541, 389, 514, 622, 620, 306, 682, 77,
2551 78, 393, 27, 550, 489, -53, 583, 341, 555, 686,
2552 692, 79, 342, 343, 557, 632, 524, 659, 709, 0,
2553 80, 81, 82, 0, 569, 0, 0, 0, 416, 83,
2554 84, 0, 0, 85, 86, 0, 87, 88, 89, 550,
2555 0, 0, 587, 90, 0, 0, 41, 42, 0, 0,
2556 0, 0, 0, 0, 422, 0, 43, 0, 0, 0,
2557 44, 91, 92, 93, 45, 46, 0, 94, 95, 0,
2558 0, 0, 0, 0, 0, 0, 47, 0, 0, 587,
2559 0, 0, 0, 0, 0, 48, 49, 50, 0, 0,
2560 51, 0, 0, 0, 52, 53, 0, 0, 54, 55,
2561 0, 56, 57, 58, 0, 0, 0, 0, 59, 0,
2562 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2563 0, 0, 0, 0, 0, 0, 60, 61, 62, 0,
2564 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
2568 static const yytype_int16 yycheck[] =
2570 9, 247, 194, 288, 203, 251, 167, 163, 293, 294,
2571 33, 172, 410, 411, 16, 209, 65, 178, 163, 175,
2572 25, 166, 167, 168, 5, 409, 171, 14, 313, 0,
2573 224, 34, 3, 37, 179, 180, 0, 17, 51, 97,
2574 424, 12, 7, 8, 9, 10, 11, 12, 97, 248,
2575 97, 22, 32, 252, 101, 254, 59, 5, 71, 5,
2576 6, 7, 446, 50, 69, 449, 450, 98, 229, 6,
2577 7, 8, 9, 10, 11, 12, 13, 100, 223, 97,
2578 225, 68, 4, 101, 369, 15, 242, 74, 90, 473,
2579 70, 376, 476, 97, 379, 43, 44, 242, 292, 97,
2580 385, 561, 97, 101, 105, 102, 101, 105, 102, 106,
2581 101, 59, 106, 98, 79, 100, 64, 577, 578, 5,
2582 6, 7, 368, 53, 54, 18, 282, 57, 58, 513,
2583 60, 61, 62, 7, 8, 98, 292, 100, 384, 98,
2584 425, 100, 98, 105, 100, 430, 98, 292, 100, 98,
2585 121, 100, 351, 98, 439, 100, 98, 98, 100, 100,
2586 97, 7, 98, 448, 100, 98, 6, 100, 329, 31,
2587 331, 332, 333, 334, 335, 98, 337, 100, 6, 7,
2588 341, 342, 7, 8, 9, 10, 11, 12, 6, 7,
2589 102, 101, 39, 7, 99, 102, 99, 98, 207, 4,
2590 29, 61, 87, 62, 58, 54, 15, 5, 454, 60,
2591 495, 53, 57, 498, 48, 59, 87, 4, 84, 36,
2592 63, 19, 20, 80, 82, 23, 24, 625, 626, 56,
2593 63, 4, 80, 29, 480, 30, 75, 35, 5, 36,
2594 401, 402, 97, 81, 253, 43, 44, 45, 46, 258,
2595 6, 101, 19, 105, 80, 13, 23, 24, 80, 80,
2596 101, 59, 97, 6, 549, 464, 64, 97, 35, 67,
2597 101, 6, 79, 97, 97, 5, 43, 44, 45, 46,
2598 78, 97, 97, 6, 28, 98, 7, 85, 86, 101,
2599 7, 5, 59, 91, 92, 27, 89, 64, 6, 584,
2600 67, 47, 27, 80, 94, 103, 3, 101, 554, 80,
2601 98, 78, 104, 104, 27, 101, 508, 100, 13, 86,
2602 27, 27, 6, 98, 91, 92, 27, 97, 81, 101,
2603 72, 36, 101, 37, 37, 6, 103, 7, 27, 76,
2604 7, 27, 73, 102, 66, 4, 4, 102, 102, 595,
2605 102, 1, 97, 80, 52, 5, 6, 97, 7, 97,
2606 4, 4, 4, 27, 5, 15, 612, 4, 97, 378,
2607 98, 617, 657, 23, 24, 21, 42, 97, 97, 29,
2608 98, 97, 628, 83, 49, 35, 98, 672, 84, 635,
2609 5, 4, 40, 585, 44, 45, 46, 27, 6, 98,
2610 40, 27, 41, 53, 54, 98, 652, 57, 58, 97,
2611 60, 61, 62, 605, 101, 98, 662, 67, 98, 97,
2612 97, 97, 97, 84, 98, 710, 88, 7, 97, 97,
2613 26, 38, 77, 4, 97, 85, 86, 87, 98, 96,
2614 4, 91, 92, 95, 98, 98, 5, 102, 27, 100,
2615 97, 27, 7, 6, 700, 6, 14, 22, 27, 97,
2616 19, 707, 98, 97, 23, 24, 98, 98, 477, 97,
2617 3, 98, 101, 66, 98, 100, 35, 486, 98, 98,
2618 102, 97, 233, 97, 43, 44, 45, 46, 497, 122,
2619 499, 500, 324, 349, 503, 662, 454, 1, 575, 372,
2620 59, 5, 6, 635, 612, 64, 701, 318, 67, 190,
2621 320, 15, 521, 321, 497, 601, 599, 251, 668, 23,
2622 24, 327, 22, 532, 471, 29, 568, 86, 536, 675,
2623 690, 35, 91, 92, 543, 608, 506, 630, 707, -1,
2624 44, 45, 46, -1, 553, -1, -1, -1, 368, 53,
2625 54, -1, -1, 57, 58, -1, 60, 61, 62, 568,
2626 -1, -1, 571, 67, -1, -1, 5, 6, -1, -1,
2627 -1, -1, -1, -1, 378, -1, 15, -1, -1, -1,
2628 19, 85, 86, 87, 23, 24, -1, 91, 92, -1,
2629 -1, -1, -1, -1, -1, -1, 35, -1, -1, 608,
2630 -1, -1, -1, -1, -1, 44, 45, 46, -1, -1,
2631 49, -1, -1, -1, 53, 54, -1, -1, 57, 58,
2632 -1, 60, 61, 62, -1, -1, -1, -1, 67, -1,
2633 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2634 -1, -1, -1, -1, -1, -1, 85, 86, 87, -1,
2635 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
2639 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2640 symbol of state STATE-NUM. */
2641 static const yytype_uint16 yystos[] =
2643 0, 5, 108, 109, 110, 126, 0, 110, 111, 97,
2644 112, 269, 270, 25, 69, 113, 98, 5, 6, 7,
2645 126, 136, 271, 272, 4, 101, 105, 272, 18, 7,
2646 6, 31, 116, 102, 101, 117, 39, 114, 115, 7,
2647 99, 5, 6, 15, 19, 23, 24, 35, 44, 45,
2648 46, 49, 53, 54, 57, 58, 60, 61, 62, 67,
2649 85, 86, 87, 91, 92, 118, 119, 120, 121, 122,
2650 123, 124, 125, 1, 5, 6, 15, 23, 24, 35,
2651 44, 45, 46, 53, 54, 57, 58, 60, 61, 62,
2652 67, 85, 86, 87, 91, 92, 127, 128, 129, 130,
2653 133, 136, 137, 139, 141, 142, 143, 144, 145, 159,
2654 163, 167, 193, 197, 276, 280, 284, 307, 102, 99,
2655 120, 33, 100, 98, 160, 164, 194, 198, 277, 281,
2656 285, 308, 29, 129, 131, 138, 168, 140, 126, 122,
2657 61, 62, 58, 54, 60, 57, 53, 15, 48, 59,
2658 87, 4, 161, 165, 195, 199, 278, 282, 286, 309,
2659 132, 36, 169, 5, 19, 20, 23, 24, 35, 43,
2660 44, 45, 46, 59, 64, 67, 78, 85, 86, 91,
2661 92, 103, 126, 134, 146, 149, 150, 151, 154, 210,
2662 211, 214, 222, 80, 84, 63, 260, 82, 206, 63,
2663 261, 56, 264, 80, 75, 29, 4, 30, 101, 218,
2664 225, 226, 97, 135, 97, 224, 225, 226, 230, 224,
2665 225, 101, 225, 215, 216, 217, 225, 224, 225, 36,
2666 81, 101, 226, 65, 97, 147, 224, 225, 225, 16,
2667 90, 105, 5, 214, 6, 235, 154, 97, 80, 97,
2668 200, 97, 80, 97, 80, 235, 13, 267, 97, 269,
2669 7, 8, 9, 10, 11, 12, 79, 227, 228, 229,
2670 230, 6, 156, 157, 98, 6, 231, 232, 225, 230,
2671 225, 224, 219, 5, 150, 6, 152, 153, 28, 237,
2672 7, 7, 5, 27, 89, 238, 253, 262, 263, 269,
2673 235, 6, 207, 208, 209, 47, 262, 235, 254, 265,
2674 266, 269, 235, 27, 80, 269, 94, 170, 101, 102,
2675 106, 3, 158, 98, 100, 233, 98, 100, 226, 5,
2676 19, 23, 24, 35, 43, 44, 45, 46, 59, 64,
2677 67, 86, 91, 92, 155, 212, 221, 223, 98, 100,
2678 267, 80, 104, 104, 225, 226, 230, 267, 267, 14,
2679 50, 68, 74, 174, 175, 176, 190, 98, 100, 27,
2680 101, 98, 100, 13, 268, 98, 27, 98, 100, 27,
2681 267, 6, 236, 98, 97, 27, 173, 227, 228, 229,
2682 101, 157, 101, 232, 224, 224, 224, 224, 224, 224,
2683 224, 36, 81, 224, 224, 153, 235, 37, 37, 162,
2684 192, 191, 72, 177, 6, 239, 263, 267, 7, 209,
2685 201, 267, 266, 267, 287, 27, 171, 172, 253, 267,
2686 76, 255, 102, 7, 7, 8, 234, 224, 224, 27,
2687 255, 239, 239, 178, 73, 179, 196, 102, 66, 279,
2688 283, 255, 267, 98, 100, 267, 4, 102, 102, 102,
2689 267, 4, 97, 180, 80, 255, 267, 255, 255, 52,
2690 288, 289, 290, 310, 172, 7, 148, 97, 248, 253,
2691 97, 235, 4, 202, 4, 4, 5, 292, 4, 290,
2692 255, 255, 269, 98, 253, 27, 166, 97, 21, 97,
2693 97, 269, 291, 97, 83, 311, 312, 313, 84, 98,
2694 98, 267, 42, 186, 254, 267, 269, 269, 49, 293,
2695 269, 5, 317, 4, 313, 154, 187, 255, 98, 203,
2696 98, 98, 97, 34, 59, 296, 297, 298, 299, 301,
2697 98, 269, 314, 97, 97, 17, 32, 70, 240, 27,
2698 269, 294, 295, 300, 302, 298, 40, 269, 6, 188,
2699 189, 97, 242, 241, 41, 243, 267, 98, 100, 269,
2700 253, 97, 98, 101, 98, 100, 248, 97, 97, 244,
2701 88, 181, 204, 295, 27, 84, 303, 269, 315, 316,
2702 7, 189, 98, 248, 248, 97, 182, 26, 249, 77,
2703 256, 257, 258, 267, 154, 96, 304, 98, 100, 102,
2704 98, 98, 38, 245, 246, 247, 253, 97, 97, 4,
2705 268, 205, 258, 154, 305, 51, 71, 306, 95, 318,
2706 319, 320, 316, 247, 98, 100, 183, 184, 185, 253,
2707 6, 7, 8, 9, 10, 11, 12, 13, 97, 213,
2708 220, 250, 97, 259, 4, 239, 239, 27, 253, 320,
2709 246, 98, 100, 6, 7, 251, 252, 273, 274, 275,
2710 98, 253, 27, 97, 267, 321, 185, 101, 98, 100,
2711 98, 6, 275, 98, 267, 269, 303, 7, 6, 98,
2712 322, 102, 304, 323, 14, 326, 6, 327, 22, 328,
2713 97, 324, 253, 329, 330, 249, 98, 100, 325, 330,
2717 #define yyerrok (yyerrstatus = 0)
2718 #define yyclearin (yychar = YYEMPTY)
2719 #define YYEMPTY (-2)
2722 #define YYACCEPT goto yyacceptlab
2723 #define YYABORT goto yyabortlab
2724 #define YYERROR goto yyerrorlab
2727 /* Like YYERROR except do call yyerror. This remains here temporarily
2728 to ease the transition to the new meaning of YYERROR, for GCC.
2729 Once GCC version 2 has supplanted version 1, this can go. */
2731 #define YYFAIL goto yyerrlab
2733 #define YYRECOVERING() (!!yyerrstatus)
2735 #define YYBACKUP(Token, Value) \
2737 if (yychar == YYEMPTY && yylen == 1) \
2741 yytoken = YYTRANSLATE (yychar); \
2747 yyerror (YY_("syntax error: cannot back up")); \
2754 #define YYERRCODE 256
2757 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2758 If N is 0, then set CURRENT to the empty location which ends
2759 the previous symbol: RHS[0] (always defined). */
2761 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2762 #ifndef YYLLOC_DEFAULT
2763 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2767 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2768 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2769 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2770 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2774 (Current).first_line = (Current).last_line = \
2775 YYRHSLOC (Rhs, 0).last_line; \
2776 (Current).first_column = (Current).last_column = \
2777 YYRHSLOC (Rhs, 0).last_column; \
2783 /* YY_LOCATION_PRINT -- Print the location on the stream.
2784 This macro was not mandated originally: define only if we know
2785 we won't break user code: when these are the locations we know. */
2787 #ifndef YY_LOCATION_PRINT
2788 # if YYLTYPE_IS_TRIVIAL
2789 # define YY_LOCATION_PRINT(File, Loc) \
2790 fprintf (File, "%d.%d-%d.%d", \
2791 (Loc).first_line, (Loc).first_column, \
2792 (Loc).last_line, (Loc).last_column)
2794 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2799 /* YYLEX -- calling `yylex' with the right arguments. */
2802 # define YYLEX yylex (&yylval, YYLEX_PARAM)
2804 # define YYLEX yylex (&yylval)
2807 /* Enable debugging if requested. */
2811 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2812 # define YYFPRINTF fprintf
2815 # define YYDPRINTF(Args) \
2821 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2825 YYFPRINTF (stderr, "%s ", Title); \
2826 yy_symbol_print (stderr, \
2828 YYFPRINTF (stderr, "\n"); \
2833 /*--------------------------------.
2834 | Print this symbol on YYOUTPUT. |
2835 `--------------------------------*/
2838 #if (defined __STDC__ || defined __C99__FUNC__ \
2839 || defined __cplusplus || defined _MSC_VER)
2841 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2844 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2847 YYSTYPE const * const yyvaluep;
2853 if (yytype < YYNTOKENS)
2854 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2866 /*--------------------------------.
2867 | Print this symbol on YYOUTPUT. |
2868 `--------------------------------*/
2870 #if (defined __STDC__ || defined __C99__FUNC__ \
2871 || defined __cplusplus || defined _MSC_VER)
2873 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2876 yy_symbol_print (yyoutput, yytype, yyvaluep)
2879 YYSTYPE const * const yyvaluep;
2882 if (yytype < YYNTOKENS)
2883 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2885 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2887 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
2888 YYFPRINTF (yyoutput, ")");
2891 /*------------------------------------------------------------------.
2892 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2894 `------------------------------------------------------------------*/
2896 #if (defined __STDC__ || defined __C99__FUNC__ \
2897 || defined __cplusplus || defined _MSC_VER)
2899 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
2902 yy_stack_print (bottom, top)
2903 yytype_int16 *bottom;
2907 YYFPRINTF (stderr, "Stack now");
2908 for (; bottom <= top; ++bottom)
2909 YYFPRINTF (stderr, " %d", *bottom);
2910 YYFPRINTF (stderr, "\n");
2913 # define YY_STACK_PRINT(Bottom, Top) \
2916 yy_stack_print ((Bottom), (Top)); \
2920 /*------------------------------------------------.
2921 | Report that the YYRULE is going to be reduced. |
2922 `------------------------------------------------*/
2924 #if (defined __STDC__ || defined __C99__FUNC__ \
2925 || defined __cplusplus || defined _MSC_VER)
2927 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
2930 yy_reduce_print (yyvsp, yyrule)
2935 int yynrhs = yyr2[yyrule];
2937 unsigned long int yylno = yyrline[yyrule];
2938 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
2940 /* The symbols being reduced. */
2941 for (yyi = 0; yyi < yynrhs; yyi++)
2943 fprintf (stderr, " $%d = ", yyi + 1);
2944 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
2945 &(yyvsp[(yyi + 1) - (yynrhs)])
2947 fprintf (stderr, "\n");
2951 # define YY_REDUCE_PRINT(Rule) \
2954 yy_reduce_print (yyvsp, Rule); \
2957 /* Nonzero means print parse trace. It is left uninitialized so that
2958 multiple parsers can coexist. */
2960 #else /* !YYDEBUG */
2961 # define YYDPRINTF(Args)
2962 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2963 # define YY_STACK_PRINT(Bottom, Top)
2964 # define YY_REDUCE_PRINT(Rule)
2965 #endif /* !YYDEBUG */
2968 /* YYINITDEPTH -- initial size of the parser's stacks. */
2970 # define YYINITDEPTH 200
2973 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2974 if the built-in stack extension method is used).
2976 Do not make this value too large; the results are undefined if
2977 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2978 evaluated with infinite-precision integer arithmetic. */
2981 # define YYMAXDEPTH 10000
2989 # if defined __GLIBC__ && defined _STRING_H
2990 # define yystrlen strlen
2992 /* Return the length of YYSTR. */
2993 #if (defined __STDC__ || defined __C99__FUNC__ \
2994 || defined __cplusplus || defined _MSC_VER)
2996 yystrlen (const char *yystr)
3004 for (yylen = 0; yystr[yylen]; yylen++)
3012 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3013 # define yystpcpy stpcpy
3015 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3017 #if (defined __STDC__ || defined __C99__FUNC__ \
3018 || defined __cplusplus || defined _MSC_VER)
3020 yystpcpy (char *yydest, const char *yysrc)
3023 yystpcpy (yydest, yysrc)
3029 const char *yys = yysrc;
3031 while ((*yyd++ = *yys++) != '\0')
3040 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3041 quotes and backslashes, so that it's suitable for yyerror. The
3042 heuristic is that double-quoting is unnecessary unless the string
3043 contains an apostrophe, a comma, or backslash (other than
3044 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3045 null, do not copy; instead, return the length of what the result
3048 yytnamerr (char *yyres, const char *yystr)
3053 char const *yyp = yystr;
3060 goto do_not_strip_quotes;
3064 goto do_not_strip_quotes;
3077 do_not_strip_quotes: ;
3081 return yystrlen (yystr);
3083 return yystpcpy (yyres, yystr) - yyres;
3087 /* Copy into YYRESULT an error message about the unexpected token
3088 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3089 including the terminating null byte. If YYRESULT is null, do not
3090 copy anything; just return the number of bytes that would be
3091 copied. As a special case, return 0 if an ordinary "syntax error"
3092 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3093 size calculation. */
3095 yysyntax_error (char *yyresult, int yystate, int yychar)
3097 int yyn = yypact[yystate];
3099 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3103 int yytype = YYTRANSLATE (yychar);
3104 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3105 YYSIZE_T yysize = yysize0;
3107 int yysize_overflow = 0;
3108 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3109 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3113 /* This is so xgettext sees the translatable formats that are
3114 constructed on the fly. */
3115 YY_("syntax error, unexpected %s");
3116 YY_("syntax error, unexpected %s, expecting %s");
3117 YY_("syntax error, unexpected %s, expecting %s or %s");
3118 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3119 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3123 static char const yyunexpected[] = "syntax error, unexpected %s";
3124 static char const yyexpecting[] = ", expecting %s";
3125 static char const yyor[] = " or %s";
3126 char yyformat[sizeof yyunexpected
3127 + sizeof yyexpecting - 1
3128 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3129 * (sizeof yyor - 1))];
3130 char const *yyprefix = yyexpecting;
3132 /* Start YYX at -YYN if negative to avoid negative indexes in
3134 int yyxbegin = yyn < 0 ? -yyn : 0;
3136 /* Stay within bounds of both yycheck and yytname. */
3137 int yychecklim = YYLAST - yyn + 1;
3138 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3141 yyarg[0] = yytname[yytype];
3142 yyfmt = yystpcpy (yyformat, yyunexpected);
3144 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3145 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3147 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3151 yyformat[sizeof yyunexpected - 1] = '\0';
3154 yyarg[yycount++] = yytname[yyx];
3155 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3156 yysize_overflow |= (yysize1 < yysize);
3158 yyfmt = yystpcpy (yyfmt, yyprefix);
3162 yyf = YY_(yyformat);
3163 yysize1 = yysize + yystrlen (yyf);
3164 yysize_overflow |= (yysize1 < yysize);
3167 if (yysize_overflow)
3168 return YYSIZE_MAXIMUM;
3172 /* Avoid sprintf, as that infringes on the user's name space.
3173 Don't have undefined behavior even if the translation
3174 produced a string with the wrong number of "%s"s. */
3175 char *yyp = yyresult;
3177 while ((*yyp = *yyf) != '\0')
3179 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3181 yyp += yytnamerr (yyp, yyarg[yyi++]);
3194 #endif /* YYERROR_VERBOSE */
3197 /*-----------------------------------------------.
3198 | Release the memory associated to this symbol. |
3199 `-----------------------------------------------*/
3202 #if (defined __STDC__ || defined __C99__FUNC__ \
3203 || defined __cplusplus || defined _MSC_VER)
3205 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3208 yydestruct (yymsg, yytype, yyvaluep)
3218 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3229 /* Prevent warnings from -Wmissing-prototypes. */
3231 #ifdef YYPARSE_PARAM
3232 #if defined __STDC__ || defined __cplusplus
3233 int yyparse (void *YYPARSE_PARAM);
3237 #else /* ! YYPARSE_PARAM */
3238 #if defined __STDC__ || defined __cplusplus
3243 #endif /* ! YYPARSE_PARAM */
3254 #ifdef YYPARSE_PARAM
3255 #if (defined __STDC__ || defined __C99__FUNC__ \
3256 || defined __cplusplus || defined _MSC_VER)
3258 yyparse (void *YYPARSE_PARAM)
3261 yyparse (YYPARSE_PARAM)
3262 void *YYPARSE_PARAM;
3264 #else /* ! YYPARSE_PARAM */
3265 #if (defined __STDC__ || defined __C99__FUNC__ \
3266 || defined __cplusplus || defined _MSC_VER)
3276 /* The look-ahead symbol. */
3279 /* The semantic value of the look-ahead symbol. */
3282 /* Number of syntax errors so far. */
3288 /* Number of tokens to shift before error messages enabled. */
3290 /* Look-ahead token as an internal (translated) token number. */
3293 /* Buffer for error messages, and its allocated size. */
3295 char *yymsg = yymsgbuf;
3296 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3299 /* Three stacks and their tools:
3300 `yyss': related to states,
3301 `yyvs': related to semantic values,
3302 `yyls': related to locations.
3304 Refer to the stacks thru separate pointers, to allow yyoverflow
3305 to reallocate them elsewhere. */
3307 /* The state stack. */
3308 yytype_int16 yyssa[YYINITDEPTH];
3309 yytype_int16 *yyss = yyssa;
3310 yytype_int16 *yyssp;
3312 /* The semantic value stack. */
3313 YYSTYPE yyvsa[YYINITDEPTH];
3314 YYSTYPE *yyvs = yyvsa;
3319 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3321 YYSIZE_T yystacksize = YYINITDEPTH;
3323 /* The variables used to return semantic value and location from the
3328 /* The number of symbols on the RHS of the reduced rule.
3329 Keep to zero when no symbol should be popped. */
3332 YYDPRINTF ((stderr, "Starting parse\n"));
3337 yychar = YYEMPTY; /* Cause a token to be read. */
3339 /* Initialize stack pointers.
3340 Waste one element of value and location stack
3341 so that they stay on the same level as the state stack.
3342 The wasted elements are never initialized. */
3349 /*------------------------------------------------------------.
3350 | yynewstate -- Push a new state, which is found in yystate. |
3351 `------------------------------------------------------------*/
3353 /* In all cases, when you get here, the value and location stacks
3354 have just been pushed. So pushing a state here evens the stacks. */
3360 if (yyss + yystacksize - 1 <= yyssp)
3362 /* Get the current used size of the three stacks, in elements. */
3363 YYSIZE_T yysize = yyssp - yyss + 1;
3367 /* Give user a chance to reallocate the stack. Use copies of
3368 these so that the &'s don't force the real ones into
3370 YYSTYPE *yyvs1 = yyvs;
3371 yytype_int16 *yyss1 = yyss;
3374 /* Each stack pointer address is followed by the size of the
3375 data in use in that stack, in bytes. This used to be a
3376 conditional around just the two extra args, but that might
3377 be undefined if yyoverflow is a macro. */
3378 yyoverflow (YY_("memory exhausted"),
3379 &yyss1, yysize * sizeof (*yyssp),
3380 &yyvs1, yysize * sizeof (*yyvsp),
3387 #else /* no yyoverflow */
3388 # ifndef YYSTACK_RELOCATE
3389 goto yyexhaustedlab;
3391 /* Extend the stack our own way. */
3392 if (YYMAXDEPTH <= yystacksize)
3393 goto yyexhaustedlab;
3395 if (YYMAXDEPTH < yystacksize)
3396 yystacksize = YYMAXDEPTH;
3399 yytype_int16 *yyss1 = yyss;
3400 union yyalloc *yyptr =
3401 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3403 goto yyexhaustedlab;
3404 YYSTACK_RELOCATE (yyss);
3405 YYSTACK_RELOCATE (yyvs);
3407 # undef YYSTACK_RELOCATE
3409 YYSTACK_FREE (yyss1);
3412 #endif /* no yyoverflow */
3414 yyssp = yyss + yysize - 1;
3415 yyvsp = yyvs + yysize - 1;
3418 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3419 (unsigned long int) yystacksize));
3421 if (yyss + yystacksize - 1 <= yyssp)
3425 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3434 /* Do appropriate processing given the current state. Read a
3435 look-ahead token if we need one and don't already have one. */
3437 /* First try to decide what to do without reference to look-ahead token. */
3438 yyn = yypact[yystate];
3439 if (yyn == YYPACT_NINF)
3442 /* Not known => get a look-ahead token if don't already have one. */
3444 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3445 if (yychar == YYEMPTY)
3447 YYDPRINTF ((stderr, "Reading a token: "));
3451 if (yychar <= YYEOF)
3453 yychar = yytoken = YYEOF;
3454 YYDPRINTF ((stderr, "Now at end of input.\n"));
3458 yytoken = YYTRANSLATE (yychar);
3459 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3462 /* If the proper action on seeing token YYTOKEN is to reduce or to
3463 detect an error, take that action. */
3465 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3470 if (yyn == 0 || yyn == YYTABLE_NINF)
3479 /* Count tokens shifted since error; after three, turn off error
3484 /* Shift the look-ahead token. */
3485 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3487 /* Discard the shifted token unless it is eof. */
3488 if (yychar != YYEOF)
3497 /*-----------------------------------------------------------.
3498 | yydefault -- do the default action for the current state. |
3499 `-----------------------------------------------------------*/
3501 yyn = yydefact[yystate];
3507 /*-----------------------------.
3508 | yyreduce -- Do a reduction. |
3509 `-----------------------------*/
3511 /* yyn is the number of a rule to reduce with. */
3514 /* If YYLEN is nonzero, implement the default value of the action:
3517 Otherwise, the following line sets YYVAL to garbage.
3518 This behavior is undocumented and Bison
3519 users should not rely upon it. Assigning to YYVAL
3520 unconditionally makes the parser a bit smaller, and it avoids a
3521 GCC warning that YYVAL may be used uninitialized. */
3522 yyval = yyvsp[1-yylen];
3525 YY_REDUCE_PRINT (yyn);
3529 #line 1587 "parser-smi.y"
3536 #line 1591 "parser-smi.y"
3543 #line 1597 "parser-smi.y"
3544 { (yyval.err) = 0; ;}
3548 #line 1599 "parser-smi.y"
3549 { (yyval.err) = 0; ;}
3553 #line 1607 "parser-smi.y"
3555 thisParserPtr->firstStatementLine = thisParserPtr->line;
3556 thisParserPtr->currentDecl = SMI_DECL_MODULE;
3558 thisParserPtr->modulePtr = findModuleByName((yyvsp[(1) - (1)].id));
3559 if (!thisParserPtr->modulePtr) {
3560 thisParserPtr->modulePtr =
3561 addModule((yyvsp[(1) - (1)].id),
3562 smiStrdup(thisParserPtr->path),
3565 thisParserPtr->modulePtr->
3566 numImportedIdentifiers = 0;
3567 thisParserPtr->modulePtr->
3569 thisParserPtr->modulePtr->
3570 numModuleIdentities = 0;
3571 if (!strcmp((yyvsp[(1) - (1)].id), "SNMPv2-SMI")) {
3573 * SNMPv2-SMI is an SMIv2 module
3574 * that cannot be identified by
3575 * importing from SNMPv2-SMI.
3577 thisModulePtr->export.language =
3581 smiPrintError(thisParserPtr,
3582 ERR_MODULE_ALREADY_LOADED,
3583 (yyvsp[(1) - (1)].id));
3585 * this aborts parsing the whole file,
3586 * not only the current module.
3594 #line 1651 "parser-smi.y"
3596 if (thisModulePtr->export.language == SMI_LANGUAGE_UNKNOWN)
3597 thisModulePtr->export.language = SMI_LANGUAGE_SMIV1;
3598 checkModuleName(thisParserPtr, thisModulePtr);
3599 checkModuleIdentity(thisParserPtr, thisModulePtr);
3600 checkObjects(thisParserPtr, thisModulePtr);
3601 checkTypes(thisParserPtr, thisModulePtr);
3602 checkDefvals(thisParserPtr, thisModulePtr);
3603 checkImportsUsage(thisParserPtr, thisModulePtr);
3604 smiCheckTypeUsage(thisParserPtr, thisModulePtr);
3606 thisParserPtr->capabilitiesModulePtr = NULL;
3613 #line 1669 "parser-smi.y"
3614 { (yyval.err) = 0; ;}
3618 #line 1671 "parser-smi.y"
3619 { (yyval.err) = 0; ;}
3623 #line 1675 "parser-smi.y"
3628 #line 1677 "parser-smi.y"
3630 thisModulePtr->export.language = SMI_LANGUAGE_SPPI;
3635 #line 1686 "parser-smi.y"
3636 { (yyval.err) = 0; ;}
3640 #line 1688 "parser-smi.y"
3641 { (yyval.err) = 0; ;}
3645 #line 1692 "parser-smi.y"
3647 thisParserPtr->firstStatementLine = thisParserPtr->line;
3648 thisParserPtr->currentDecl = SMI_DECL_MODULE;
3650 if ((thisModulePtr->export.language != SMI_LANGUAGE_SMIV2) &&
3651 (thisModulePtr->export.language != SMI_LANGUAGE_SPPI))
3652 thisModulePtr->export.language = SMI_LANGUAGE_SMIV1;
3659 #line 1706 "parser-smi.y"
3660 { (yyval.err) = 0; ;}
3664 #line 1708 "parser-smi.y"
3666 if (thisParserPtr->modulePtr->export.language ==
3668 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "EXPORTS");
3670 thisParserPtr->firstStatementLine = thisParserPtr->line;
3671 thisParserPtr->currentDecl = SMI_DECL_MODULE;
3673 if (strcmp(thisParserPtr->modulePtr->export.name,
3675 strcmp(thisParserPtr->modulePtr->export.name,
3677 smiPrintError(thisParserPtr, ERR_EXPORTS);
3683 #line 1725 "parser-smi.y"
3684 { (yyval.err) = 0; ;}
3688 #line 1729 "parser-smi.y"
3689 { (yyval.err) = 0; ;}
3693 #line 1731 "parser-smi.y"
3694 { (yyval.err) = 0; ;}
3698 #line 1736 "parser-smi.y"
3699 { (yyval.err) = 0; ;}
3703 #line 1738 "parser-smi.y"
3704 { (yyval.err) = 0; ;}
3708 #line 1744 "parser-smi.y"
3714 * Recursively call the parser to suffer
3715 * the IMPORTS, if the module is not yet
3718 modulePtr = findModuleByName((yyvsp[(3) - (3)].id));
3720 modulePtr = loadModule((yyvsp[(3) - (3)].id), thisParserPtr);
3722 checkImports(modulePtr, thisParserPtr);
3724 if (modulePtr && !strcmp((yyvsp[(3) - (3)].id), "SNMPv2-SMI")) {
3726 * A module that imports a macro or
3727 * type definition from SNMPv2-SMI
3728 * seems to be SMIv2 style - but only if
3729 * it is not SPPI yet.
3731 if (thisModulePtr->export.language != SMI_LANGUAGE_SPPI) {
3733 thisModulePtr->firstImportPtr;
3735 importPtr = importPtr->nextPtr) {
3736 if ((!strcmp(importPtr->export.module,
3737 (yyvsp[(3) - (3)].id))) &&
3738 ((importPtr->kind == KIND_MACRO) ||
3739 (importPtr->kind == KIND_TYPE))) {
3740 thisModulePtr->export.language =
3747 smiFree((yyvsp[(3) - (3)].id));
3752 #line 1787 "parser-smi.y"
3753 { (yyval.err) = 0; ;}
3757 #line 1790 "parser-smi.y"
3758 { (yyval.err) = 0; ;}
3762 #line 1797 "parser-smi.y"
3764 addImport((yyvsp[(1) - (1)].id), thisParserPtr);
3765 thisParserPtr->modulePtr->numImportedIdentifiers++;
3771 #line 1803 "parser-smi.y"
3773 addImport((yyvsp[(1) - (1)].id), thisParserPtr);
3774 thisParserPtr->modulePtr->numImportedIdentifiers++;
3780 #line 1809 "parser-smi.y"
3782 addImport(smiStrdup((yyvsp[(1) - (1)].id)), thisParserPtr);
3783 thisParserPtr->modulePtr->numImportedIdentifiers++;
3789 #line 1825 "parser-smi.y"
3792 * There are PIBs that import e.g. Counter64 - so
3793 * don't complain here about SMI keywords.
3795 /* if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI)
3796 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, $1);*/
3797 (yyval.id) = (yyvsp[(1) - (1)].id);
3802 #line 1835 "parser-smi.y"
3804 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)
3805 smiPrintError(thisParserPtr, ERR_SPPI_TYPE_IN_MIB, (yyvsp[(1) - (1)].id));
3806 (yyval.id) = (yyvsp[(1) - (1)].id);
3811 #line 1869 "parser-smi.y"
3813 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
3814 ERR_MODULENAME_32, ERR_MODULENAME_64);
3815 (yyval.id) = (yyvsp[(1) - (1)].id);
3820 #line 1881 "parser-smi.y"
3821 { (yyval.err) = 0; ;}
3825 #line 1883 "parser-smi.y"
3826 { (yyval.err) = 0; ;}
3830 #line 1888 "parser-smi.y"
3831 { (yyval.err) = 0; ;}
3835 #line 1890 "parser-smi.y"
3836 { (yyval.err) = 0; ;}
3840 #line 1894 "parser-smi.y"
3842 thisParserPtr->modulePtr->numStatements++;
3848 #line 1899 "parser-smi.y"
3850 thisParserPtr->modulePtr->numStatements++;
3856 #line 1904 "parser-smi.y"
3858 thisParserPtr->modulePtr->numStatements++;
3864 #line 1909 "parser-smi.y"
3866 thisParserPtr->modulePtr->numStatements++;
3872 #line 1914 "parser-smi.y"
3874 thisParserPtr->modulePtr->numStatements++;
3880 #line 1919 "parser-smi.y"
3882 thisParserPtr->modulePtr->numStatements++;
3888 #line 1924 "parser-smi.y"
3890 thisParserPtr->modulePtr->numStatements++;
3896 #line 1929 "parser-smi.y"
3898 thisParserPtr->modulePtr->numStatements++;
3904 #line 1934 "parser-smi.y"
3906 thisParserPtr->modulePtr->numStatements++;
3912 #line 1939 "parser-smi.y"
3914 thisParserPtr->modulePtr->numStatements++;
3920 #line 1944 "parser-smi.y"
3922 thisParserPtr->modulePtr->numStatements++;
3928 #line 1949 "parser-smi.y"
3930 thisParserPtr->modulePtr->numStatements++;
3936 #line 1954 "parser-smi.y"
3938 smiPrintError(thisParserPtr,
3939 ERR_FLUSH_DECLARATION);
3946 #line 1968 "parser-smi.y"
3950 thisParserPtr->firstStatementLine = thisParserPtr->line;
3951 thisParserPtr->currentDecl = SMI_DECL_MACRO;
3953 macroPtr = addMacro(smiStrdup((yyvsp[(1) - (1)].id)),
3955 setMacroLine(macroPtr, thisParserPtr->firstStatementLine,
3961 #line 1980 "parser-smi.y"
3964 * ASN.1 macros are known to be in these
3967 if (strcmp(thisParserPtr->modulePtr->export.name,
3969 strcmp(thisParserPtr->modulePtr->export.name,
3971 strcmp(thisParserPtr->modulePtr->export.name,
3973 strcmp(thisParserPtr->modulePtr->export.name,
3975 strcmp(thisParserPtr->modulePtr->export.name,
3977 strcmp(thisParserPtr->modulePtr->export.name,
3979 strcmp(thisParserPtr->modulePtr->export.name,
3981 strcmp(thisParserPtr->modulePtr->export.name,
3983 strcmp(thisParserPtr->modulePtr->export.name,
3984 "COPS-PR-SPPI-TC")) {
3985 smiPrintError(thisParserPtr, ERR_MACRO);
3991 #line 2008 "parser-smi.y"
3998 #line 2013 "parser-smi.y"
3999 { (yyval.id) = (yyvsp[(1) - (1)].id); ;}
4003 #line 2014 "parser-smi.y"
4004 { (yyval.id) = (yyvsp[(1) - (1)].id); ;}
4008 #line 2015 "parser-smi.y"
4009 { (yyval.id) = (yyvsp[(1) - (1)].id); ;}
4013 #line 2016 "parser-smi.y"
4014 { (yyval.id) = (yyvsp[(1) - (1)].id); ;}
4018 #line 2017 "parser-smi.y"
4019 { (yyval.id) = (yyvsp[(1) - (1)].id); ;}
4023 #line 2018 "parser-smi.y"
4024 { (yyval.id) = (yyvsp[(1) - (1)].id); ;}
4028 #line 2019 "parser-smi.y"
4029 { (yyval.id) = (yyvsp[(1) - (1)].id); ;}
4033 #line 2020 "parser-smi.y"
4034 { (yyval.id) = (yyvsp[(1) - (1)].id); ;}
4038 #line 2021 "parser-smi.y"
4039 { (yyval.id) = (yyvsp[(1) - (1)].id); ;}
4043 #line 2022 "parser-smi.y"
4044 { (yyval.id) = (yyvsp[(1) - (1)].id); ;}
4048 #line 2026 "parser-smi.y"
4050 if (strcmp(thisParserPtr->modulePtr->export.name,
4052 strcmp(thisParserPtr->modulePtr->export.name,
4054 strcmp(thisParserPtr->modulePtr->export.name,
4056 strcmp(thisParserPtr->modulePtr->export.name,
4058 strcmp(thisParserPtr->modulePtr->export.name,
4060 strcmp(thisParserPtr->modulePtr->export.name,
4062 strcmp(thisParserPtr->modulePtr->export.name,
4064 smiPrintError(thisParserPtr, ERR_CHOICE);
4070 #line 2046 "parser-smi.y"
4072 (yyval.typePtr) = addType(NULL, SMI_BASETYPE_UNKNOWN, 0,
4078 #line 2056 "parser-smi.y"
4080 (yyval.id) = (yyvsp[(1) - (1)].id);
4085 #line 2061 "parser-smi.y"
4087 smiPrintError (thisParserPtr,
4088 ERR_BAD_LOWER_IDENTIFIER_CASE,
4089 (yyvsp[(1) - (1)].id));
4091 if ((thisParserPtr->flags & SMI_FLAG_BE_LAX) == 0) {
4095 (yyval.id) = (yyvsp[(1) - (1)].id);
4100 #line 2076 "parser-smi.y"
4102 thisParserPtr->firstStatementLine = thisParserPtr->line;
4103 thisParserPtr->currentDecl = SMI_DECL_VALUEASSIGNMENT;
4105 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
4106 ERR_OIDNAME_32, ERR_OIDNAME_64);
4107 smiCheckObjectName(thisParserPtr,
4108 thisModulePtr, (yyvsp[(1) - (1)].id));
4109 if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2)
4111 if (strchr((yyvsp[(1) - (1)].id), '-') &&
4112 (strcmp((yyvsp[(1) - (1)].id), "mib-2") ||
4113 strcmp(thisModulePtr->export.name, "SNMPv2-SMI"))) {
4114 smiPrintError(thisParserPtr,
4115 ERR_OIDNAME_INCLUDES_HYPHEN,
4116 (yyvsp[(1) - (1)].id));
4123 #line 2097 "parser-smi.y"
4127 objectPtr = (yyvsp[(7) - (8)].objectPtr);
4128 smiCheckObjectReuse(thisParserPtr, (yyvsp[(1) - (8)].id), &objectPtr);
4129 objectPtr = setObjectName(objectPtr, (yyvsp[(1) - (8)].id), thisParserPtr);
4130 deleteObjectFlags(objectPtr, FLAG_INCOMPLETE);
4131 setObjectLine(objectPtr, thisParserPtr->firstStatementLine,
4133 setObjectDecl(objectPtr,
4134 SMI_DECL_VALUEASSIGNMENT);
4140 #line 2116 "parser-smi.y"
4142 thisParserPtr->firstStatementLine = thisParserPtr->line;
4143 thisParserPtr->currentDecl = SMI_DECL_TYPEASSIGNMENT;
4145 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
4146 ERR_TYPENAME_32, ERR_TYPENAME_64);
4151 #line 2124 "parser-smi.y"
4155 if (strlen((yyvsp[(1) - (4)].id))) {
4156 if ((yyvsp[(4) - (4)].typePtr)->export.basetype != SMI_BASETYPE_UNKNOWN) {
4157 smiCheckTypeName(thisParserPtr,
4158 thisModulePtr, (yyvsp[(1) - (4)].id),
4159 thisParserPtr->firstStatementLine);
4161 setTypeLine((yyvsp[(4) - (4)].typePtr), thisParserPtr->firstStatementLine,
4163 setTypeName((yyvsp[(4) - (4)].typePtr), (yyvsp[(1) - (4)].id));
4170 * If we are in an SMI module, some type
4171 * definitions derived from ASN.1 `INTEGER'
4172 * must be modified to libsmi basetypes.
4174 if (thisModulePtr &&
4175 (!strcmp(thisModulePtr->export.name, "SNMPv2-SMI"))) {
4176 if (!strcmp((yyvsp[(1) - (4)].id), "Counter32")) {
4177 (yyvsp[(4) - (4)].typePtr)->export.basetype = SMI_BASETYPE_UNSIGNED32;
4178 setTypeParent((yyvsp[(4) - (4)].typePtr), smiHandle->typeUnsigned32Ptr);
4179 if ((yyvsp[(4) - (4)].typePtr)->listPtr) {
4180 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32;
4181 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.value.unsigned32 = 0;
4182 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32;
4183 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U;
4185 } else if (!strcmp((yyvsp[(1) - (4)].id), "Gauge32")) {
4186 (yyvsp[(4) - (4)].typePtr)->export.basetype = SMI_BASETYPE_UNSIGNED32;
4187 setTypeParent((yyvsp[(4) - (4)].typePtr), smiHandle->typeUnsigned32Ptr);
4188 if ((yyvsp[(4) - (4)].typePtr)->listPtr) {
4189 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32;
4190 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.value.unsigned32 = 0;
4191 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32;
4192 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U;
4194 } else if (!strcmp((yyvsp[(1) - (4)].id), "Unsigned32")) {
4195 (yyvsp[(4) - (4)].typePtr)->export.basetype = SMI_BASETYPE_UNSIGNED32;
4196 setTypeParent((yyvsp[(4) - (4)].typePtr), smiHandle->typeUnsigned32Ptr);
4197 if ((yyvsp[(4) - (4)].typePtr)->listPtr) {
4198 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32;
4199 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.value.unsigned32 = 0;
4200 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32;
4201 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U;
4203 } else if (!strcmp((yyvsp[(1) - (4)].id), "TimeTicks")) {
4204 (yyvsp[(4) - (4)].typePtr)->export.basetype = SMI_BASETYPE_UNSIGNED32;
4205 setTypeParent((yyvsp[(4) - (4)].typePtr), smiHandle->typeUnsigned32Ptr);
4206 if ((yyvsp[(4) - (4)].typePtr)->listPtr) {
4207 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32;
4208 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.value.unsigned32 = 0;
4209 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32;
4210 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U;
4212 } else if (!strcmp((yyvsp[(1) - (4)].id), "Counter64")) {
4213 (yyvsp[(4) - (4)].typePtr)->export.basetype = SMI_BASETYPE_UNSIGNED64;
4214 if ((yyvsp[(4) - (4)].typePtr)->listPtr) {
4215 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED64;
4216 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.value.unsigned64 = 0;
4217 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED64;
4218 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.value.unsigned64 = SMI_BASETYPE_UNSIGNED64_MAX;
4220 setTypeParent((yyvsp[(4) - (4)].typePtr), smiHandle->typeUnsigned64Ptr);
4223 if (thisModulePtr &&
4224 (!strcmp(thisModulePtr->export.name, "RFC1155-SMI") ||
4225 !strcmp(thisModulePtr->export.name, "RFC1065-SMI"))) {
4226 if (!strcmp((yyvsp[(1) - (4)].id), "Counter")) {
4227 (yyvsp[(4) - (4)].typePtr)->export.basetype = SMI_BASETYPE_UNSIGNED32;
4228 setTypeParent((yyvsp[(4) - (4)].typePtr), smiHandle->typeUnsigned32Ptr);
4229 if ((yyvsp[(4) - (4)].typePtr)->listPtr) {
4230 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32;
4231 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.value.unsigned32 = 0;
4232 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32;
4233 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U;
4235 } else if (!strcmp((yyvsp[(1) - (4)].id), "Gauge")) {
4236 (yyvsp[(4) - (4)].typePtr)->export.basetype = SMI_BASETYPE_UNSIGNED32;
4237 setTypeParent((yyvsp[(4) - (4)].typePtr), smiHandle->typeUnsigned32Ptr);
4238 if ((yyvsp[(4) - (4)].typePtr)->listPtr) {
4239 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32;
4240 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.value.unsigned32 = 0;
4241 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32;
4242 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U;
4244 } else if (!strcmp((yyvsp[(1) - (4)].id), "TimeTicks")) {
4245 (yyvsp[(4) - (4)].typePtr)->export.basetype = SMI_BASETYPE_UNSIGNED32;
4246 setTypeParent((yyvsp[(4) - (4)].typePtr), smiHandle->typeUnsigned32Ptr);
4247 if ((yyvsp[(4) - (4)].typePtr)->listPtr) {
4248 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32;
4249 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.value.unsigned32 = 0;
4250 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32;
4251 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U;
4253 } else if (!strcmp((yyvsp[(1) - (4)].id), "NetworkAddress")) {
4254 setTypeName((yyvsp[(4) - (4)].typePtr), smiStrdup("NetworkAddress"));
4255 (yyvsp[(4) - (4)].typePtr)->export.basetype = SMI_BASETYPE_OCTETSTRING;
4256 setTypeParent((yyvsp[(4) - (4)].typePtr), findTypeByModuleAndName(
4259 } else if (!strcmp((yyvsp[(1) - (4)].id), "IpAddress")) {
4260 typePtr = findTypeByModuleAndName(
4261 thisModulePtr, "NetworkAddress");
4263 setTypeParent(typePtr, (yyvsp[(4) - (4)].typePtr));
4266 if (thisModulePtr &&
4267 (!strcmp(thisModulePtr->export.name, "COPS-PR-SPPI"))) {
4268 if (!strcmp((yyvsp[(1) - (4)].id), "Unsigned32")) {
4269 (yyvsp[(4) - (4)].typePtr)->export.basetype = SMI_BASETYPE_UNSIGNED32;
4270 setTypeParent((yyvsp[(4) - (4)].typePtr), smiHandle->typeUnsigned32Ptr);
4271 if ((yyvsp[(4) - (4)].typePtr)->listPtr) {
4272 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32;
4273 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.value.unsigned32 = 0;
4274 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32;
4275 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U;
4277 } else if (!strcmp((yyvsp[(1) - (4)].id), "TimeTicks")) {
4278 (yyvsp[(4) - (4)].typePtr)->export.basetype = SMI_BASETYPE_UNSIGNED32;
4279 setTypeParent((yyvsp[(4) - (4)].typePtr), smiHandle->typeUnsigned32Ptr);
4280 if ((yyvsp[(4) - (4)].typePtr)->listPtr) {
4281 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED32;
4282 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.value.unsigned32 = 0;
4283 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED32;
4284 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.value.unsigned32 = 4294967295U;
4286 } else if (!strcmp((yyvsp[(1) - (4)].id), "Unsigned64")) {
4287 (yyvsp[(4) - (4)].typePtr)->export.basetype = SMI_BASETYPE_UNSIGNED64;
4288 if ((yyvsp[(4) - (4)].typePtr)->listPtr) {
4289 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_UNSIGNED64;
4290 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.value.unsigned64 = 0;
4291 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_UNSIGNED64;
4292 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.value.unsigned64 = SMI_BASETYPE_UNSIGNED64_MAX;
4294 setTypeParent((yyvsp[(4) - (4)].typePtr), smiHandle->typeUnsigned64Ptr);
4295 } else if (!strcmp((yyvsp[(1) - (4)].id), "Integer64")) {
4296 (yyvsp[(4) - (4)].typePtr)->export.basetype = SMI_BASETYPE_INTEGER64;
4297 if ((yyvsp[(4) - (4)].typePtr)->listPtr) {
4298 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.basetype = SMI_BASETYPE_INTEGER64;
4299 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.minValue.value.integer64 = SMI_BASETYPE_INTEGER64_MIN;
4300 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.basetype = SMI_BASETYPE_INTEGER64;
4301 ((Range *)(yyvsp[(4) - (4)].typePtr)->listPtr->ptr)->export.maxValue.value.integer64 = SMI_BASETYPE_INTEGER64_MAX;
4303 setTypeParent((yyvsp[(4) - (4)].typePtr), smiHandle->typeInteger64Ptr);
4310 #line 2282 "parser-smi.y"
4312 (yyval.id) = (yyvsp[(1) - (1)].id);
4317 #line 2286 "parser-smi.y"
4319 (yyval.id) = smiStrdup((yyvsp[(1) - (1)].id));
4321 * well known types (keywords in this grammar)
4322 * are known to be defined in these modules.
4324 if (strcmp(thisParserPtr->modulePtr->export.name,
4326 strcmp(thisParserPtr->modulePtr->export.name,
4328 strcmp(thisParserPtr->modulePtr->export.name,
4330 strcmp(thisParserPtr->modulePtr->export.name,
4332 strcmp(thisParserPtr->modulePtr->export.name,
4334 strcmp(thisParserPtr->modulePtr->export.name,
4336 strcmp(thisParserPtr->modulePtr->export.name,
4338 smiPrintError(thisParserPtr, ERR_TYPE_SMI_OR_SPPI, (yyvsp[(1) - (1)].id));
4344 #line 2310 "parser-smi.y"
4346 (yyval.id) = smiStrdup((yyvsp[(1) - (1)].id));
4348 * well known types (keywords in this grammar)
4349 * are known to be defined in these modules.
4351 if ((strcmp(thisParserPtr->modulePtr->export.name,
4353 (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI))
4354 smiPrintError(thisParserPtr, ERR_TYPE_SPPI, (yyvsp[(1) - (1)].id));
4359 #line 2325 "parser-smi.y"
4361 if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) &&
4362 !findImportByName((yyvsp[(1) - (1)].id), thisParserPtr->modulePtr))
4363 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, (yyvsp[(1) - (1)].id));
4364 (yyval.id) = (yyvsp[(1) - (1)].id);
4369 #line 2350 "parser-smi.y"
4371 if ((yyvsp[(1) - (1)].typePtr)->export.name) {
4373 * If we found an already defined type,
4374 * we have to inherit a new type structure.
4375 * (Otherwise the `Syntax' rule created
4376 * a new type for us.)
4378 (yyval.typePtr) = duplicateType((yyvsp[(1) - (1)].typePtr), 0, thisParserPtr);
4379 setTypeDecl((yyval.typePtr), SMI_DECL_TYPEASSIGNMENT);
4381 (yyval.typePtr) = (yyvsp[(1) - (1)].typePtr);
4382 setTypeDecl((yyval.typePtr), SMI_DECL_TYPEASSIGNMENT);
4388 #line 2366 "parser-smi.y"
4392 thisParserPtr->currentDecl = SMI_DECL_TEXTUALCONVENTION;
4394 if (thisModulePtr->export.language == SMI_LANGUAGE_UNKNOWN)
4395 thisModulePtr->export.language = SMI_LANGUAGE_SMIV2;
4397 if (strcmp(thisModulePtr->export.name, "SNMPv2-TC")) {
4399 findImportByName("TEXTUAL-CONVENTION",
4404 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)
4405 smiPrintError(thisParserPtr,
4406 ERR_MACRO_NOT_IMPORTED,
4407 "TEXTUAL-CONVENTION",
4410 smiPrintError(thisParserPtr,
4411 ERR_MACRO_NOT_IMPORTED,
4412 "TEXTUAL-CONVENTION",
4420 #line 2397 "parser-smi.y"
4422 checkDescr(thisParserPtr, (yyvsp[(7) - (7)].text));
4427 #line 2402 "parser-smi.y"
4429 if (((yyvsp[(11) - (11)].typePtr)) && !((yyvsp[(11) - (11)].typePtr)->export.name)) {
4431 * If the Type we found has just been
4432 * defined, we don't have to allocate
4435 (yyval.typePtr) = (yyvsp[(11) - (11)].typePtr);
4437 if (!((yyvsp[(11) - (11)].typePtr)))
4438 smiPrintError(thisParserPtr, ERR_INTERNAL);
4440 * Otherwise, we have to allocate a
4441 * new Type struct, inherited from $10.
4443 (yyval.typePtr) = duplicateType((yyvsp[(11) - (11)].typePtr), 0, thisParserPtr);
4445 setTypeDescription((yyval.typePtr), (yyvsp[(7) - (11)].text), thisParserPtr);
4446 if ((yyvsp[(9) - (11)].text)) {
4447 setTypeReference((yyval.typePtr), (yyvsp[(9) - (11)].text), thisParserPtr);
4449 setTypeStatus((yyval.typePtr), (yyvsp[(5) - (11)].status));
4450 if ((yyvsp[(3) - (11)].text)) {
4451 if (smiCheckFormat(thisParserPtr,
4452 (yyval.typePtr)->export.basetype, (yyvsp[(3) - (11)].text),
4453 thisParserPtr->firstStatementLine)) {
4454 setTypeFormat((yyval.typePtr), (yyvsp[(3) - (11)].text));
4457 setTypeDecl((yyval.typePtr), SMI_DECL_TEXTUALCONVENTION);
4462 #line 2434 "parser-smi.y"
4464 (yyval.typePtr) = (yyvsp[(1) - (1)].typePtr);
4465 setTypeDecl((yyval.typePtr), SMI_DECL_TYPEASSIGNMENT);
4470 #line 2442 "parser-smi.y"
4472 if ((yyvsp[(3) - (3)].typePtr)) {
4473 (yyval.typePtr) = addType(NULL,
4474 SMI_BASETYPE_UNKNOWN, 0,
4476 setTypeDecl((yyval.typePtr), SMI_DECL_IMPL_SEQUENCEOF);
4477 setTypeParent((yyval.typePtr), (yyvsp[(3) - (3)].typePtr));
4479 (yyval.typePtr) = NULL;
4485 #line 2461 "parser-smi.y"
4490 (yyval.typePtr) = findTypeByModulenameAndName(
4491 thisParserPtr->modulePtr->export.name, (yyvsp[(1) - (1)].id));
4492 if (! (yyval.typePtr)) {
4493 importPtr = findImportByName((yyvsp[(1) - (1)].id),
4496 (importPtr->kind == KIND_NOTFOUND)) {
4498 * forward referenced type. create it,
4499 * marked with FLAG_INCOMPLETE.
4501 typePtr = addType((yyvsp[(1) - (1)].id),
4502 SMI_BASETYPE_UNKNOWN,
4505 (yyval.typePtr) = typePtr;
4509 * TODO: is this allowed in a SEQUENCE?
4512 (yyval.typePtr) = findTypeByModulenameAndName(
4513 importPtr->export.module,
4514 importPtr->export.name);
4515 smiFree((yyvsp[(1) - (1)].id));
4518 smiFree((yyvsp[(1) - (1)].id));
4524 #line 2501 "parser-smi.y"
4526 (yyval.typePtr) = addType(NULL, SMI_BASETYPE_UNKNOWN, 0,
4528 setTypeList((yyval.typePtr), (yyvsp[(3) - (4)].listPtr));
4533 #line 2509 "parser-smi.y"
4535 (yyval.listPtr) = smiMalloc(sizeof(List));
4536 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].objectPtr);
4537 (yyval.listPtr)->nextPtr = NULL;
4542 #line 2516 "parser-smi.y"
4546 p = smiMalloc(sizeof(List));
4547 p->ptr = (void *)(yyvsp[(3) - (3)].objectPtr);
4549 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr; pp = pp->nextPtr);
4551 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
4556 #line 2535 "parser-smi.y"
4563 findObjectByModuleAndName(thisParserPtr->modulePtr,
4564 (yyvsp[(1) - (2)].id));
4567 importPtr = findImportByName((yyvsp[(1) - (2)].id),
4570 (importPtr->kind == KIND_NOTFOUND)) {
4571 objectPtr = addObject((yyvsp[(1) - (2)].id), thisParserPtr->pendingNodePtr,
4576 setObjectType(objectPtr, (yyvsp[(2) - (2)].typePtr));
4582 objectPtr = findObjectByModulenameAndName(
4583 importPtr->export.module, (yyvsp[(1) - (2)].id));
4584 smiFree((yyvsp[(1) - (2)].id));
4586 if (objectPtr->typePtr->export.name) {
4587 typePtr = objectPtr->typePtr;
4589 typePtr = objectPtr->typePtr->parentPtr;
4591 if (((yyvsp[(2) - (2)].typePtr) != typePtr) &&
4592 (((yyvsp[(2) - (2)].typePtr)->export.basetype !=
4593 SMI_BASETYPE_INTEGER32) ||
4594 (typePtr->export.basetype !=
4595 SMI_BASETYPE_ENUM)) &&
4596 (((yyvsp[(2) - (2)].typePtr)->export.basetype !=
4597 SMI_BASETYPE_OCTETSTRING) ||
4598 (typePtr->export.basetype !=
4599 SMI_BASETYPE_BITS))) {
4600 smiPrintError(thisParserPtr,
4601 ERR_SEQUENCE_TYPE_MISMATCH,
4602 objectPtr->export.name);
4606 smiFree((yyvsp[(1) - (2)].id));
4607 if (objectPtr->typePtr) {
4609 if (objectPtr->typePtr->export.name) {
4610 typePtr = objectPtr->typePtr;
4612 typePtr = objectPtr->typePtr->parentPtr;
4614 if (((yyvsp[(2) - (2)].typePtr) != typePtr) &&
4615 (((yyvsp[(2) - (2)].typePtr)->export.basetype !=
4616 SMI_BASETYPE_INTEGER32) ||
4617 (typePtr->export.basetype !=
4618 SMI_BASETYPE_ENUM)) &&
4619 (((yyvsp[(2) - (2)].typePtr)->export.basetype !=
4620 SMI_BASETYPE_OCTETSTRING) ||
4621 (typePtr->export.basetype !=
4622 SMI_BASETYPE_BITS))) {
4623 smiPrintError(thisParserPtr,
4624 ERR_SEQUENCE_TYPE_MISMATCH,
4625 objectPtr->export.name);
4629 setObjectType(objectPtr, (yyvsp[(2) - (2)].typePtr));
4630 addObjectFlags(objectPtr,
4635 (yyval.objectPtr) = objectPtr;
4640 #line 2618 "parser-smi.y"
4642 (yyval.typePtr) = (yyvsp[(1) - (1)].typePtr);
4643 if ((yyval.typePtr))
4644 defaultBasetype = (yyval.typePtr)->export.basetype;
4649 #line 2626 "parser-smi.y"
4654 defaultBasetype = SMI_BASETYPE_BITS;
4655 typePtr = addType(NULL, SMI_BASETYPE_BITS,
4658 setTypeDecl(typePtr, SMI_DECL_IMPLICIT_TYPE);
4659 setTypeParent(typePtr, smiHandle->typeBitsPtr);
4660 setTypeList(typePtr, (yyvsp[(3) - (4)].listPtr));
4661 for (p = (yyvsp[(3) - (4)].listPtr); p; p = p->nextPtr)
4662 ((NamedNumber *)p->ptr)->typePtr = typePtr;
4663 smiCheckNamedNumbersOrder(parserPtr, typePtr);
4664 (yyval.typePtr) = typePtr;
4669 #line 2646 "parser-smi.y"
4671 (yyval.typePtr) = (yyvsp[(1) - (1)].typePtr);
4676 #line 2650 "parser-smi.y"
4679 (yyval.typePtr) = smiHandle->typeOctetStringPtr;
4684 #line 2655 "parser-smi.y"
4689 (yyval.typePtr) = findTypeByModulenameAndName(
4690 thisParserPtr->modulePtr->export.name, (yyvsp[(1) - (2)].id));
4691 if (! (yyval.typePtr)) {
4692 importPtr = findImportByName((yyvsp[(1) - (2)].id),
4695 (importPtr->kind == KIND_NOTFOUND)) {
4697 * forward referenced type. create it,
4698 * marked with FLAG_INCOMPLETE.
4700 typePtr = addType((yyvsp[(1) - (2)].id), SMI_BASETYPE_UNKNOWN,
4703 (yyval.typePtr) = typePtr;
4706 (yyval.typePtr) = findTypeByModulenameAndName(
4707 importPtr->export.module,
4708 importPtr->export.name);
4709 smiFree((yyvsp[(1) - (2)].id));
4712 smiFree((yyvsp[(1) - (2)].id));
4718 #line 2688 "parser-smi.y"
4720 (yyval.listPtr) = smiMalloc(sizeof(List));
4721 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].namedNumberPtr);
4722 (yyval.listPtr)->nextPtr = NULL;
4727 #line 2694 "parser-smi.y"
4731 p = smiMalloc(sizeof(List));
4732 p->ptr = (void *)(yyvsp[(3) - (3)].namedNumberPtr);
4734 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr; pp = pp->nextPtr);
4736 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
4741 #line 2707 "parser-smi.y"
4743 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
4744 ERR_BITNAME_32, ERR_BITNAME_64);
4745 if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2)
4747 if (strchr((yyvsp[(1) - (1)].id), '-')) {
4748 smiPrintError(thisParserPtr,
4749 ERR_NAMEDBIT_INCLUDES_HYPHEN,
4750 (yyvsp[(1) - (1)].id));
4757 #line 2720 "parser-smi.y"
4759 (yyval.namedNumberPtr) = smiMalloc(sizeof(NamedNumber));
4760 (yyval.namedNumberPtr)->export.name = (yyvsp[(1) - (5)].id);
4761 (yyval.namedNumberPtr)->export.value.basetype =
4762 SMI_BASETYPE_UNSIGNED32;
4763 (yyval.namedNumberPtr)->export.value.value.unsigned32 = (yyvsp[(4) - (5)].unsigned32);
4764 /* RFC 2578 7.1.4 */
4765 if ((yyvsp[(4) - (5)].unsigned32) >= 65535*8) {
4766 smiPrintError(thisParserPtr,
4767 ERR_BITS_NUMBER_TOO_LARGE,
4768 (yyvsp[(1) - (5)].id), (yyvsp[(4) - (5)].unsigned32));
4770 if ((yyvsp[(4) - (5)].unsigned32) >= 128) {
4771 smiPrintError(thisParserPtr,
4772 ERR_BITS_NUMBER_LARGE,
4773 (yyvsp[(1) - (5)].id), (yyvsp[(4) - (5)].unsigned32));
4780 #line 2742 "parser-smi.y"
4782 thisParserPtr->firstStatementLine = thisParserPtr->line;
4783 thisParserPtr->currentDecl = SMI_DECL_OBJECTIDENTITY;
4785 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
4786 ERR_OIDNAME_32, ERR_OIDNAME_64);
4787 smiCheckObjectName(thisParserPtr,
4788 thisModulePtr, (yyvsp[(1) - (1)].id));
4793 #line 2752 "parser-smi.y"
4797 if (strcmp(thisModulePtr->export.name, "SNMPv2-SMI") &&
4798 strcmp(thisModulePtr->export.name, "COPS-PR-SPPI")) {
4799 importPtr = findImportByName("OBJECT-IDENTITY",
4804 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)
4805 smiPrintError(thisParserPtr,
4806 ERR_MACRO_NOT_IMPORTED,
4810 smiPrintError(thisParserPtr,
4811 ERR_MACRO_NOT_IMPORTED,
4820 #line 2777 "parser-smi.y"
4822 checkDescr(thisParserPtr, (yyvsp[(8) - (8)].text));
4827 #line 2783 "parser-smi.y"
4831 objectPtr = (yyvsp[(13) - (14)].objectPtr);
4832 smiCheckObjectReuse(thisParserPtr, (yyvsp[(1) - (14)].id), &objectPtr);
4834 objectPtr = setObjectName(objectPtr, (yyvsp[(1) - (14)].id), thisParserPtr);
4835 setObjectDecl(objectPtr, SMI_DECL_OBJECTIDENTITY);
4836 setObjectLine(objectPtr, thisParserPtr->firstStatementLine,
4838 setObjectStatus(objectPtr, (yyvsp[(6) - (14)].status));
4839 setObjectDescription(objectPtr, (yyvsp[(8) - (14)].text), thisParserPtr);
4840 if ((yyvsp[(10) - (14)].text)) {
4841 setObjectReference(objectPtr, (yyvsp[(10) - (14)].text), thisParserPtr);
4843 addObjectFlags(objectPtr, FLAG_REGISTERED);
4844 deleteObjectFlags(objectPtr, FLAG_INCOMPLETE);
4850 #line 2805 "parser-smi.y"
4852 thisParserPtr->firstStatementLine = thisParserPtr->line;
4853 thisParserPtr->currentDecl = SMI_DECL_OBJECTTYPE;
4855 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
4856 ERR_OIDNAME_32, ERR_OIDNAME_64);
4857 smiCheckObjectName(thisParserPtr,
4858 thisModulePtr, (yyvsp[(1) - (1)].id));
4863 #line 2815 "parser-smi.y"
4867 importPtr = findImportByName("OBJECT-TYPE",
4872 if (thisModulePtr->export.language ==
4873 SMI_LANGUAGE_SMIV2) {
4874 smiPrintError(thisParserPtr,
4875 ERR_MACRO_NOT_IMPORTED,
4876 "OBJECT-TYPE", "SNMPv2-SMI");
4877 } else if (thisModulePtr->export.language ==
4878 SMI_LANGUAGE_SPPI) {
4879 smiPrintError(thisParserPtr,
4880 ERR_MACRO_NOT_IMPORTED,
4881 "OBJECT-TYPE", "COPS-PR-SPPI");
4883 smiPrintError(thisParserPtr,
4884 ERR_MACRO_NOT_IMPORTED,
4885 "OBJECT-TYPE", "RFC-1212");
4893 #line 2855 "parser-smi.y"
4895 Object *objectPtr, *parentPtr;
4896 Type *typePtr = NULL;
4898 objectPtr = (yyvsp[(22) - (23)].objectPtr);
4900 smiCheckObjectReuse(thisParserPtr, (yyvsp[(1) - (23)].id), &objectPtr);
4902 objectPtr = setObjectName(objectPtr, (yyvsp[(1) - (23)].id), thisParserPtr);
4903 setObjectDecl(objectPtr, SMI_DECL_OBJECTTYPE);
4904 setObjectLine(objectPtr, thisParserPtr->firstStatementLine,
4906 if (checkObjectFlags(objectPtr, FLAG_SEQTYPE)) {
4907 deleteObjectFlags(objectPtr, FLAG_SEQTYPE);
4908 if ((yyvsp[(6) - (23)].typePtr)) {
4909 if ((yyvsp[(6) - (23)].typePtr)->export.name) {
4910 typePtr = (yyvsp[(6) - (23)].typePtr);
4912 * According to RFC 3159 7.1.3. Opaque must not be used
4913 * in a SYNTAX clause.
4915 if ((thisModulePtr->export.language == SMI_LANGUAGE_SPPI) &&
4916 !strcmp(typePtr->export.name, "Opaque"))
4917 smiPrintError(thisParserPtr, ERR_OPAQUE_IN_SYNTAX);
4919 * According to RFC 3159 7.1.4. IpAddress must not be used
4920 * in a SYNTAX clause.
4922 if ((thisModulePtr->export.language == SMI_LANGUAGE_SPPI) &&
4923 !strcmp(typePtr->export.name, "IpAddress"))
4924 smiPrintError(thisParserPtr, ERR_IPADDRESS_IN_SYNTAX);
4926 typePtr = (yyvsp[(6) - (23)].typePtr)->parentPtr;
4928 if ((objectPtr->typePtr != typePtr) &&
4929 ((objectPtr->typePtr->export.basetype !=
4930 SMI_BASETYPE_INTEGER32) ||
4931 (typePtr->export.basetype !=
4932 SMI_BASETYPE_ENUM)) &&
4933 ((objectPtr->typePtr->export.basetype !=
4934 SMI_BASETYPE_OCTETSTRING) ||
4935 (typePtr->export.basetype !=
4936 SMI_BASETYPE_BITS))) {
4937 smiPrintError(thisParserPtr,
4938 ERR_SEQUENCE_TYPE_MISMATCH,
4939 objectPtr->export.name);
4943 setObjectType(objectPtr, (yyvsp[(6) - (23)].typePtr));
4944 if (!((yyvsp[(6) - (23)].typePtr)->export.name)) {
4948 #if 0 /* export implicitly defined types by the node's lowercase name */
4949 setTypeName((yyvsp[(6) - (23)].typePtr), (yyvsp[(1) - (23)].id));
4952 setObjectUnits(objectPtr, (yyvsp[(7) - (23)].text));
4953 setObjectAccess(objectPtr, (yyvsp[(8) - (23)].access));
4954 if (thisParserPtr->flags & FLAG_CREATABLE) {
4955 thisParserPtr->flags &= ~FLAG_CREATABLE;
4957 objectPtr->nodePtr->parentPtr->lastObjectPtr;
4959 parentPtr->export.indexkind !=
4960 SMI_INDEX_UNKNOWN) {
4962 * add objectPtr to the parent object's
4963 * listPtr, which is the list of columns
4964 * needed for row creation.
4966 * Note, that this would clash, if the
4967 * parent row object-type is not yet
4971 newlistPtr = smiMalloc(sizeof(List));
4972 newlistPtr->nextPtr = NULL;
4973 newlistPtr->ptr = objectPtr;
4976 * Look up the parent object-type.
4979 if (parentPtr->listPtr) {
4980 for(listPtr = parentPtr->listPtr;
4982 listPtr = listPtr->nextPtr);
4983 listPtr->nextPtr = newlistPtr;
4985 parentPtr->listPtr = newlistPtr;
4988 addObjectFlags(parentPtr, FLAG_CREATABLE);
4989 setObjectCreate(parentPtr, 1);
4991 smiPrintError(thisParserPtr,
4992 ERR_SCALAR_READCREATE);
4995 setObjectStatus(objectPtr, (yyvsp[(12) - (23)].status));
4996 addObjectFlags(objectPtr, FLAG_REGISTERED);
4997 deleteObjectFlags(objectPtr, FLAG_INCOMPLETE);
4998 if ((yyvsp[(13) - (23)].text)) {
4999 setObjectDescription(objectPtr, (yyvsp[(13) - (23)].text), thisParserPtr);
5001 if ((yyvsp[(15) - (23)].text)) {
5002 setObjectReference(objectPtr, (yyvsp[(15) - (23)].text), thisParserPtr);
5004 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) {
5006 * For SMI documents either $16 (IndexPart) or $17 (MibIndex)
5007 * are used, but not both. This is signalled via the indexFlag
5008 * which is 1 if IndexPart has been used.
5010 if (indexFlag == INDEXFLAG_AUGMENTS) { /* IndexPart was used */
5011 if ((yyvsp[(16) - (23)].index).indexkind != SMI_INDEX_UNKNOWN) {
5012 setObjectList(objectPtr, (yyvsp[(16) - (23)].index).listPtr);
5013 setObjectImplied(objectPtr, (yyvsp[(16) - (23)].index).implied);
5014 setObjectIndexkind(objectPtr, (yyvsp[(16) - (23)].index).indexkind);
5015 setObjectRelated(objectPtr, (yyvsp[(16) - (23)].index).rowPtr);
5018 if ((yyvsp[(17) - (23)].index).indexkind != SMI_INDEX_UNKNOWN) {
5019 setObjectList(objectPtr, (yyvsp[(17) - (23)].index).listPtr);
5020 setObjectImplied(objectPtr, (yyvsp[(17) - (23)].index).implied);
5021 setObjectIndexkind(objectPtr, (yyvsp[(17) - (23)].index).indexkind);
5022 setObjectRelated(objectPtr, (yyvsp[(17) - (23)].index).rowPtr);
5027 * PIBs contain either PIB-INDEX or AUGMENTS or EXTENDS -
5028 * but only with one Index entry. A PIB-INDEX may be
5029 * followed by a full INDEX. We get the indexkind
5031 * Note that PIB-INDEX/AUGMENTS/EXTENS is always
5032 * the first element in objectPtr->listPtr.
5033 * If an optional INDEX exists then it is
5034 * appended to this list.
5036 if ((yyvsp[(16) - (23)].index).indexkind != SMI_INDEX_UNKNOWN) {
5037 setObjectList(objectPtr, (yyvsp[(16) - (23)].index).listPtr);
5038 setObjectIndexkind(objectPtr, (yyvsp[(16) - (23)].index).indexkind);
5039 setObjectRelated(objectPtr, (yyvsp[(16) - (23)].index).rowPtr);
5041 if ((yyvsp[(17) - (23)].index).indexkind != SMI_INDEX_UNKNOWN) {
5042 if (objectPtr->listPtr) {
5044 for (p = objectPtr->listPtr; p->nextPtr;
5046 p->nextPtr = (yyvsp[(17) - (23)].index).listPtr;
5048 setObjectImplied(objectPtr, (yyvsp[(17) - (23)].index).implied);
5051 if ((yyvsp[(18) - (23)].listPtr)) {
5052 setObjectUniqueness(objectPtr, (yyvsp[(18) - (23)].listPtr));
5054 if ((yyvsp[(19) - (23)].valuePtr)) {
5055 if (objectPtr->typePtr
5056 && (((objectPtr->typePtr->export.basetype == SMI_BASETYPE_OCTETSTRING) &&
5057 ((yyvsp[(19) - (23)].valuePtr)->basetype != SMI_BASETYPE_OCTETSTRING))
5058 || ((objectPtr->typePtr->export.basetype == SMI_BASETYPE_OBJECTIDENTIFIER) &&
5059 ((yyvsp[(19) - (23)].valuePtr)->basetype != SMI_BASETYPE_OBJECTIDENTIFIER)))) {
5060 smiPrintError(thisParserPtr,
5062 if ((yyvsp[(19) - (23)].valuePtr)->basetype == SMI_BASETYPE_OBJECTIDENTIFIER) {
5063 smiFree((yyvsp[(19) - (23)].valuePtr)->value.oid);
5065 if (((yyvsp[(19) - (23)].valuePtr)->basetype == SMI_BASETYPE_BITS) ||
5066 ((yyvsp[(19) - (23)].valuePtr)->basetype == SMI_BASETYPE_OCTETSTRING)) {
5067 smiFree((yyvsp[(19) - (23)].valuePtr)->value.ptr);
5069 smiFree((yyvsp[(19) - (23)].valuePtr));
5071 setObjectValue(objectPtr, (yyvsp[(19) - (23)].valuePtr));
5074 if ((yyvsp[(9) - (23)].objectPtr)) {
5075 if (objectPtr->relatedPtr)
5076 smiPrintError(thisParserPtr, ERR_OBJECTPTR_ELEMENT_IN_USE,
5077 "relatedPtr", "PIB-REFERENCES");
5079 * PIB-REFERENCES clauses are only allowed for
5080 * objects with a SYNTAX of 'ReferenceId'.
5083 if (objectPtr->typePtr && objectPtr->typePtr->export.name &&
5084 strcmp(objectPtr->typePtr->export.name, "ReferenceId"))
5085 smiPrintErrorAtLine(parserPtr, ERR_PIB_REFERENCES_WRONG_TYPE,
5088 setObjectRelated(objectPtr, (yyvsp[(9) - (23)].objectPtr));
5091 * Does this object have a SYNTAX of 'ReferenceId'
5092 * and a PIB-REFERENCES clause?
5095 if ((thisModulePtr->export.language == SMI_LANGUAGE_SPPI) &&
5096 objectPtr->typePtr && objectPtr->typePtr->export.name &&
5097 !strcmp(objectPtr->typePtr->export.name, "ReferenceId"))
5098 smiPrintErrorAtLine(parserPtr, ERR_LACKING_PIB_REFERENCES,
5101 if ((yyvsp[(10) - (23)].objectPtr)) {
5102 if (objectPtr->relatedPtr)
5103 smiPrintError(thisParserPtr, ERR_OBJECTPTR_ELEMENT_IN_USE,
5104 "relatedPtr", "PIB-TAG");
5106 * PIB-TAG clauses are only allowed for
5107 * objects with a SYNTAX of 'TagReferenceId'.
5110 if (objectPtr->typePtr && objectPtr->typePtr->export.name &&
5111 strcmp(objectPtr->typePtr->export.name, "TagReferenceId"))
5112 smiPrintErrorAtLine(parserPtr, ERR_PIB_TAG_WRONG_TYPE,
5115 setObjectRelated(objectPtr, (yyvsp[(10) - (23)].objectPtr));
5118 * Does this object have a SYNTAX of 'TagReferenceId'
5119 * and a PIB-TAG clause?
5122 if ((thisModulePtr->export.language == SMI_LANGUAGE_SPPI) &&
5123 objectPtr->typePtr && objectPtr->typePtr->export.name &&
5124 !strcmp(objectPtr->typePtr->export.name, "TagReferenceId"))
5125 smiPrintErrorAtLine(parserPtr, ERR_LACKING_PIB_TAG,
5129 if ((yyvsp[(14) - (23)].listPtr)) {
5130 if (objectPtr->listPtr)
5131 smiPrintError(thisParserPtr, ERR_OBJECTPTR_ELEMENT_IN_USE,
5132 "listPtr", "INSTALL-ERRORS");
5134 * Are INSTALL-ERRORS only used with tables?
5137 if (!((objectPtr->export.decl == SMI_DECL_OBJECTTYPE) &&
5138 (objectPtr->typePtr) &&
5139 (objectPtr->typePtr->export.decl == SMI_DECL_IMPL_SEQUENCEOF)))
5140 smiPrintErrorAtLine(parserPtr, ERR_INSTALL_ERRORS_FOR_NON_TABLE,
5143 setObjectList(objectPtr, (yyvsp[(14) - (23)].listPtr));
5150 #line 3111 "parser-smi.y"
5152 if ((thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) ||
5153 (thisModulePtr->export.language == SMI_LANGUAGE_SPPI))
5155 smiPrintError(thisParserPtr,
5156 ERR_MISSING_DESCRIPTION);
5158 (yyval.text) = NULL;
5163 #line 3121 "parser-smi.y"
5165 (yyval.text) = (yyvsp[(2) - (2)].text);
5166 checkDescr(thisParserPtr, (yyvsp[(2) - (2)].text));
5171 #line 3128 "parser-smi.y"
5173 thisParserPtr->firstStatementLine = thisParserPtr->line;
5174 thisParserPtr->currentDecl = SMI_DECL_TRAPTYPE;
5176 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
5177 ERR_OIDNAME_32, ERR_OIDNAME_64);
5178 smiCheckObjectName(thisParserPtr,
5179 thisModulePtr, (yyvsp[(1) - (1)].id));
5184 #line 3138 "parser-smi.y"
5187 if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI)
5188 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "TRAP-TYPE");
5190 if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2)
5192 smiPrintError(thisParserPtr, ERR_TRAP_TYPE);
5195 importPtr = findImportByName("TRAP-TYPE",
5200 smiPrintError(thisParserPtr,
5201 ERR_MACRO_NOT_IMPORTED,
5202 "TRAP-TYPE", "RFC-1215");
5208 #line 3164 "parser-smi.y"
5213 objectPtr = (yyvsp[(6) - (11)].objectPtr);
5214 nodePtr = findNodeByParentAndSubid(
5215 objectPtr->nodePtr, 0);
5216 if (nodePtr && nodePtr->lastObjectPtr &&
5217 (nodePtr->lastObjectPtr->modulePtr == thisModulePtr)) {
5219 * hopefully, the last defined Object for
5220 * this Node is the one we expect.
5222 objectPtr = nodePtr->lastObjectPtr;
5224 objectPtr = addObject(NULL,
5230 objectPtr = addObject(NULL,
5232 (yyvsp[(11) - (11)].unsigned32),
5236 smiCheckObjectReuse(thisParserPtr, (yyvsp[(1) - (11)].id), &objectPtr);
5238 objectPtr = setObjectName(objectPtr, (yyvsp[(1) - (11)].id), thisParserPtr);
5239 setObjectDecl(objectPtr,
5241 setObjectLine(objectPtr, thisParserPtr->firstStatementLine,
5243 addObjectFlags(objectPtr, FLAG_REGISTERED);
5244 deleteObjectFlags(objectPtr, FLAG_INCOMPLETE);
5245 setObjectList(objectPtr, (yyvsp[(7) - (11)].listPtr));
5246 setObjectStatus(objectPtr, SMI_STATUS_CURRENT);
5247 setObjectDescription(objectPtr, (yyvsp[(8) - (11)].text), thisParserPtr);
5248 if ((yyvsp[(9) - (11)].text)) {
5249 setObjectReference(objectPtr, (yyvsp[(9) - (11)].text), thisParserPtr);
5256 #line 3211 "parser-smi.y"
5258 (yyval.listPtr) = (yyvsp[(3) - (4)].listPtr);
5263 #line 3215 "parser-smi.y"
5265 (yyval.listPtr) = NULL;
5270 #line 3221 "parser-smi.y"
5272 if ((yyvsp[(1) - (1)].objectPtr)) {
5273 (yyval.listPtr) = smiMalloc(sizeof(List));
5274 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].objectPtr);
5275 (yyval.listPtr)->nextPtr = NULL;
5277 (yyval.listPtr) = NULL;
5283 #line 3231 "parser-smi.y"
5287 if ((yyvsp[(3) - (3)].objectPtr)) {
5288 p = smiMalloc(sizeof(List));
5289 p->ptr = (yyvsp[(3) - (3)].objectPtr);
5291 if ((yyvsp[(1) - (3)].listPtr)) {
5292 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr;
5295 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
5297 (yyval.listPtr) = p;
5300 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
5306 #line 3253 "parser-smi.y"
5308 (yyval.objectPtr) = (yyvsp[(1) - (1)].objectPtr);
5313 #line 3259 "parser-smi.y"
5315 (yyval.text) = (yyvsp[(2) - (2)].text);
5316 checkDescr(thisParserPtr, (yyvsp[(2) - (2)].text));
5321 #line 3264 "parser-smi.y"
5322 { (yyval.text) = NULL; ;}
5326 #line 3268 "parser-smi.y"
5328 (yyval.access) = (yyvsp[(1) - (1)].access);
5333 #line 3272 "parser-smi.y"
5335 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)
5336 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "MAX-ACCESS");
5337 if ((yyvsp[(1) - (1)].access) == SMI_ACCESS_NOT_ACCESSIBLE)
5338 smiPrintError(thisParserPtr, ERR_NOT_ACCESSIBLE_IN_PIB_ACCESS);
5339 (yyval.access) = (yyvsp[(1) - (1)].access);
5344 #line 3280 "parser-smi.y"
5345 { (yyval.access) = 0; ;}
5349 #line 3284 "parser-smi.y"
5350 { (yyval.access) = (yyvsp[(2) - (2)].access); ;}
5354 #line 3288 "parser-smi.y"
5356 smiPrintError(thisParserPtr, ERR_POLICY_ACCESS_IN_PIB);
5361 #line 3292 "parser-smi.y"
5366 #line 3296 "parser-smi.y"
5368 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)
5369 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "PIB-REFERENCES");
5374 #line 3301 "parser-smi.y"
5375 { (yyval.objectPtr) = (yyvsp[(4) - (5)].objectPtr); ;}
5379 #line 3303 "parser-smi.y"
5380 { (yyval.objectPtr) = 0; ;}
5384 #line 3307 "parser-smi.y"
5386 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)
5387 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "PIB-TAG");
5392 #line 3312 "parser-smi.y"
5393 { (yyval.objectPtr) = (yyvsp[(4) - (5)].objectPtr); ;}
5397 #line 3314 "parser-smi.y"
5398 { (yyval.objectPtr) = 0; ;}
5402 #line 3319 "parser-smi.y"
5404 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)
5405 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "UNIQUENESS");
5410 #line 3324 "parser-smi.y"
5411 { (yyval.listPtr) = (yyvsp[(4) - (5)].listPtr); ;}
5415 #line 3326 "parser-smi.y"
5416 { (yyval.listPtr) = NULL; ;}
5420 #line 3330 "parser-smi.y"
5421 { (yyval.listPtr) = (yyvsp[(1) - (1)].listPtr); ;}
5425 #line 3332 "parser-smi.y"
5426 { (yyval.listPtr) = NULL; ;}
5430 #line 3336 "parser-smi.y"
5432 (yyval.listPtr) = smiMalloc(sizeof(List));
5433 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].objectPtr);
5434 (yyval.listPtr)->nextPtr = NULL;
5439 #line 3343 "parser-smi.y"
5443 p = smiMalloc(sizeof(List));
5444 p->ptr = (yyvsp[(3) - (3)].objectPtr);
5446 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr; pp = pp->nextPtr);
5448 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
5453 #line 3356 "parser-smi.y"
5454 { (yyval.objectPtr) = (yyvsp[(1) - (1)].objectPtr); ;}
5458 #line 3360 "parser-smi.y"
5460 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)
5461 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "INSTALL-ERRORS");
5466 #line 3365 "parser-smi.y"
5467 { (yyval.listPtr) = (yyvsp[(4) - (5)].listPtr); ;}
5471 #line 3367 "parser-smi.y"
5472 { (yyval.listPtr) = NULL; ;}
5476 #line 3371 "parser-smi.y"
5478 (yyval.listPtr) = smiMalloc(sizeof(List));
5479 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].objectPtr);
5480 (yyval.listPtr)->nextPtr = NULL;
5485 #line 3378 "parser-smi.y"
5489 p = smiMalloc(sizeof(List));
5490 p->ptr = (yyvsp[(3) - (3)].objectPtr);
5492 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr; pp = pp->nextPtr);
5494 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
5499 #line 3391 "parser-smi.y"
5503 if (((yyvsp[(3) - (4)].unsigned32) < 1) || ((yyvsp[(3) - (4)].unsigned32) > 65536))
5504 smiPrintError(thisParserPtr, ERR_ERROR_NUMBER_RANGE, (yyvsp[(3) - (4)].unsigned32));
5506 * This is not a regular object that will be added vid
5507 * 'addObject' as error identifier have no other
5508 * meaning in PIBs. They are just used for
5509 * a direct mapping to the actual protocol fields.
5511 objectPtr = smiMalloc(sizeof(Object));
5512 objectPtr->export.name = (yyvsp[(1) - (4)].id);
5513 objectPtr->export.oidlen = 1;
5514 objectPtr->export.oid = (void *)(yyvsp[(3) - (4)].unsigned32);
5515 (yyval.objectPtr) = objectPtr;
5520 #line 3412 "parser-smi.y"
5522 if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV1)
5524 smiPrintError(thisParserPtr,
5525 ERR_MAX_ACCESS_IN_SMIV1);
5526 } else if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI)
5527 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "MAX-ACCESS");
5532 #line 3421 "parser-smi.y"
5533 { (yyval.access) = (yyvsp[(3) - (3)].access); ;}
5537 #line 3423 "parser-smi.y"
5539 if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2)
5541 smiPrintError(thisParserPtr, ERR_ACCESS_IN_SMIV2);
5542 } else if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI)
5543 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "ACCESS");
5548 #line 3432 "parser-smi.y"
5549 { (yyval.access) = (yyvsp[(3) - (3)].access); ;}
5553 #line 3436 "parser-smi.y"
5555 thisParserPtr->firstStatementLine = thisParserPtr->line;
5556 thisParserPtr->currentDecl = SMI_DECL_NOTIFICATIONTYPE;
5558 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
5559 ERR_OIDNAME_32, ERR_OIDNAME_64);
5560 smiCheckObjectName(thisParserPtr,
5561 thisModulePtr, (yyvsp[(1) - (1)].id));
5566 #line 3446 "parser-smi.y"
5570 if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI)
5571 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "NOTIFICATION-TYPE");
5573 importPtr = findImportByName("NOTIFICATION-TYPE",
5578 smiPrintError(thisParserPtr,
5579 ERR_MACRO_NOT_IMPORTED,
5580 "NOTIFICATION-TYPE",
5587 #line 3466 "parser-smi.y"
5589 checkDescr(thisParserPtr, (yyvsp[(9) - (9)].text));
5594 #line 3472 "parser-smi.y"
5598 objectPtr = (yyvsp[(14) - (15)].objectPtr);
5600 smiCheckObjectReuse(thisParserPtr, (yyvsp[(1) - (15)].id), &objectPtr);
5602 objectPtr = setObjectName(objectPtr, (yyvsp[(1) - (15)].id), thisParserPtr);
5603 setObjectDecl(objectPtr,
5604 SMI_DECL_NOTIFICATIONTYPE);
5605 setObjectLine(objectPtr, thisParserPtr->firstStatementLine,
5607 addObjectFlags(objectPtr, FLAG_REGISTERED);
5608 deleteObjectFlags(objectPtr, FLAG_INCOMPLETE);
5609 setObjectList(objectPtr, (yyvsp[(5) - (15)].listPtr));
5610 setObjectStatus(objectPtr, (yyvsp[(7) - (15)].status));
5611 setObjectDescription(objectPtr, (yyvsp[(9) - (15)].text), thisParserPtr);
5612 if ((yyvsp[(11) - (15)].text)) {
5613 setObjectReference(objectPtr, (yyvsp[(11) - (15)].text), thisParserPtr);
5620 #line 3497 "parser-smi.y"
5622 thisParserPtr->firstStatementLine = thisParserPtr->line;
5623 thisParserPtr->currentDecl = SMI_DECL_MODULEIDENTITY;
5625 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
5626 ERR_OIDNAME_32, ERR_OIDNAME_64);
5627 smiCheckObjectName(thisParserPtr,
5628 thisModulePtr, (yyvsp[(1) - (1)].id));
5633 #line 3507 "parser-smi.y"
5637 importPtr = findImportByName("MODULE-IDENTITY",
5642 smiPrintError(thisParserPtr,
5643 ERR_MACRO_NOT_IMPORTED,
5648 if (thisParserPtr->modulePtr->numModuleIdentities > 0)
5650 smiPrintError(thisParserPtr,
5651 ERR_TOO_MANY_MODULE_IDENTITIES);
5653 if (thisParserPtr->modulePtr->numStatements > 0) {
5654 smiPrintError(thisParserPtr,
5655 ERR_MODULE_IDENTITY_NOT_FIRST);
5661 #line 3532 "parser-smi.y"
5663 /* do nothing at the moment */
5668 #line 3536 "parser-smi.y"
5670 setModuleLastUpdated(thisParserPtr->modulePtr, (yyvsp[(8) - (8)].date));
5675 #line 3540 "parser-smi.y"
5677 if ((yyvsp[(11) - (11)].text) && !strlen((yyvsp[(11) - (11)].text))) {
5678 smiPrintError(thisParserPtr,
5679 ERR_EMPTY_ORGANIZATION);
5685 #line 3547 "parser-smi.y"
5687 if ((yyvsp[(14) - (14)].text) && !strlen((yyvsp[(14) - (14)].text))) {
5688 smiPrintError(thisParserPtr,
5695 #line 3554 "parser-smi.y"
5697 checkDescr(thisParserPtr, (yyvsp[(17) - (17)].text));
5702 #line 3558 "parser-smi.y"
5704 if ((!thisModulePtr->firstRevisionPtr) ||
5705 (thisModulePtr->firstRevisionPtr->export.date !=
5706 thisModulePtr->lastUpdated)) {
5707 smiPrintError(thisParserPtr,
5708 ERR_REVISION_MISSING);
5709 addRevision(thisModulePtr->lastUpdated,
5711 "[Revision added by libsmi due to a LAST-UPDATED clause.]"),
5718 #line 3572 "parser-smi.y"
5722 objectPtr = (yyvsp[(23) - (24)].objectPtr);
5723 smiCheckObjectReuse(thisParserPtr, (yyvsp[(1) - (24)].id), &objectPtr);
5725 thisParserPtr->modulePtr->numModuleIdentities++;
5727 objectPtr = setObjectName(objectPtr, (yyvsp[(1) - (24)].id), thisParserPtr);
5728 setObjectDecl(objectPtr, SMI_DECL_MODULEIDENTITY);
5729 setObjectLine(objectPtr, thisParserPtr->firstStatementLine,
5731 setObjectStatus(objectPtr, SMI_STATUS_CURRENT);
5732 addObjectFlags(objectPtr, FLAG_REGISTERED);
5733 deleteObjectFlags(objectPtr, FLAG_INCOMPLETE);
5734 setModuleIdentityObject(thisParserPtr->modulePtr,
5736 setModuleOrganization(thisParserPtr->modulePtr,
5737 (yyvsp[(11) - (24)].text));
5738 setModuleContactInfo(thisParserPtr->modulePtr,
5739 (yyvsp[(14) - (24)].text));
5740 setModuleDescription(thisParserPtr->modulePtr,
5741 (yyvsp[(17) - (24)].text), thisParserPtr);
5742 if ((yyvsp[(5) - (24)].subjectCategoriesPtr) != NULL) {
5743 setObjectList(objectPtr, (yyvsp[(5) - (24)].subjectCategoriesPtr)->categories);
5744 smiFree((yyvsp[(5) - (24)].subjectCategoriesPtr));
5746 /* setObjectDescription(objectPtr, $15); */
5752 #line 3605 "parser-smi.y"
5754 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)
5755 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "SUBJECT-CATEGORIES");
5756 (yyval.subjectCategoriesPtr) = (yyvsp[(3) - (4)].subjectCategoriesPtr);
5761 #line 3611 "parser-smi.y"
5763 if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI)
5764 smiPrintError(thisParserPtr, ERR_SUBJECT_CATEGORIES_MISSING);
5765 (yyval.subjectCategoriesPtr) = NULL;
5770 #line 3619 "parser-smi.y"
5772 (yyval.subjectCategoriesPtr) = smiMalloc(sizeof(SubjectCategories));
5773 (yyval.subjectCategoriesPtr)->categories = (yyvsp[(1) - (1)].listPtr);
5778 #line 3626 "parser-smi.y"
5780 (yyval.listPtr) = smiMalloc(sizeof(List));
5781 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].objectPtr);
5782 (yyval.listPtr)->nextPtr = NULL;
5787 #line 3632 "parser-smi.y"
5791 if ((yyvsp[(1) - (3)].listPtr)->ptr == NULL)
5792 smiPrintError(thisParserPtr, ERR_SUBJECT_CATEGORIES_ALL);
5793 p = smiMalloc(sizeof(List));
5794 p->ptr = (void *)(yyvsp[(3) - (3)].objectPtr);
5796 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr; pp = pp->nextPtr);
5798 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
5803 #line 3647 "parser-smi.y"
5807 if (strcmp((yyvsp[(1) - (1)].id), "all"))
5808 smiPrintError(thisParserPtr, ERR_SUBJECT_CATEGORIES_MISSING_SUBID);
5811 * This is not a regular object that will be added via
5812 * 'addObject' as subject category dentifier have no
5813 * other meaning in PIBs. They are just used for
5814 * a direct mapping to the actual protocol fields.
5816 objectPtr = smiMalloc(sizeof(Object));
5817 objectPtr->export.name = "all";
5818 objectPtr->export.oidlen = 0;
5819 objectPtr->export.oid = 0;
5820 (yyval.objectPtr) = objectPtr;
5822 smiFree((yyvsp[(1) - (1)].id));
5827 #line 3668 "parser-smi.y"
5831 if (!strcmp((yyvsp[(1) - (4)].id), "all")) {
5832 smiPrintError(thisParserPtr, ERR_SUBJECT_CATEGORIES_ALL_WITH_SUBID);
5833 (yyval.objectPtr) = NULL;
5836 * This is not a regular object that will be added via
5837 * 'addObject' as subject category dentifier have no
5838 * other meaning in PIBs. They are just used for
5839 * a direct mapping to the actual protocol fields.
5841 objectPtr = smiMalloc(sizeof(Object));
5842 objectPtr->export.name = (yyvsp[(1) - (4)].id);
5843 objectPtr->export.oidlen = 1;
5844 objectPtr->export.oid = (void *)(yyvsp[(3) - (4)].unsigned32);
5845 (yyval.objectPtr) = objectPtr;
5851 #line 3691 "parser-smi.y"
5853 (yyval.typePtr) = (yyvsp[(1) - (1)].typePtr);
5858 #line 3695 "parser-smi.y"
5860 if (strcmp(thisParserPtr->modulePtr->export.name,
5862 strcmp(thisParserPtr->modulePtr->export.name,
5864 strcmp(thisParserPtr->modulePtr->export.name,
5866 strcmp(thisParserPtr->modulePtr->export.name,
5868 strcmp(thisParserPtr->modulePtr->export.name,
5870 strcmp(thisParserPtr->modulePtr->export.name,
5872 strcmp(thisParserPtr->modulePtr->export.name,
5874 smiPrintError(thisParserPtr, ERR_TYPE_TAG, (yyvsp[(1) - (2)].err));
5876 (yyval.typePtr) = (yyvsp[(2) - (2)].typePtr);
5881 #line 3715 "parser-smi.y"
5884 (yyval.typePtr) = (yyvsp[(1) - (1)].typePtr);
5889 #line 3720 "parser-smi.y"
5892 (yyval.typePtr) = (yyvsp[(1) - (1)].typePtr);
5897 #line 3725 "parser-smi.y"
5900 (yyval.typePtr) = (yyvsp[(1) - (1)].typePtr);
5905 #line 3730 "parser-smi.y"
5909 if ((yyvsp[(1) - (1)].typePtr) && (yyvsp[(1) - (1)].typePtr)->export.name) {
5910 importPtr = findImportByName((yyvsp[(1) - (1)].typePtr)->export.name,
5918 (yyval.typePtr) = (yyvsp[(1) - (1)].typePtr);
5923 #line 3747 "parser-smi.y"
5924 { (yyval.err) = 0; /* TODO: check range */ ;}
5928 #line 3749 "parser-smi.y"
5929 { (yyval.err) = 0; /* TODO: check range */ ;}
5933 #line 3757 "parser-smi.y"
5934 { (yyval.typePtr) = (yyvsp[(1) - (1)].typePtr); ;}
5938 #line 3762 "parser-smi.y"
5942 if ((yyvsp[(1) - (1)].typePtr) && (yyvsp[(1) - (1)].typePtr)->export.name) {
5943 importPtr = findImportByName((yyvsp[(1) - (1)].typePtr)->export.name,
5951 (yyval.typePtr) = (yyvsp[(1) - (1)].typePtr);
5956 #line 3779 "parser-smi.y"
5957 { (yyval.valuePtr) = (yyvsp[(1) - (1)].valuePtr); ;}
5961 #line 3788 "parser-smi.y"
5963 if ((thisModulePtr->export.language == SMI_LANGUAGE_SMIV2)
5965 (strcmp(thisModulePtr->export.name, "SNMPv2-SMI") &&
5966 strcmp(thisModulePtr->export.name, "SNMPv2-TC") &&
5967 strcmp(thisModulePtr->export.name, "COPS-PR-SPPI")))
5968 smiPrintError(thisParserPtr,
5969 ERR_INTEGER_IN_SMIV2);
5971 defaultBasetype = SMI_BASETYPE_INTEGER32;
5972 (yyval.typePtr) = smiHandle->typeInteger32Ptr;
5977 #line 3801 "parser-smi.y"
5979 defaultBasetype = SMI_BASETYPE_INTEGER32;
5984 #line 3805 "parser-smi.y"
5986 if ((thisModulePtr->export.language == SMI_LANGUAGE_SMIV2)
5988 (strcmp(thisModulePtr->export.name, "SNMPv2-SMI") &&
5989 strcmp(thisModulePtr->export.name, "SNMPv2-TC") &&
5990 strcmp(thisModulePtr->export.name, "COPS-PR-SPPI")))
5991 smiPrintError(thisParserPtr,
5992 ERR_INTEGER_IN_SMIV2);
5994 (yyval.typePtr) = duplicateType(smiHandle->typeInteger32Ptr, 0,
5996 setTypeList((yyval.typePtr), (yyvsp[(3) - (3)].listPtr));
5997 smiCheckTypeRanges(thisParserPtr, (yyval.typePtr));
6002 #line 3820 "parser-smi.y"
6004 defaultBasetype = SMI_BASETYPE_ENUM;
6009 #line 3824 "parser-smi.y"
6013 (yyval.typePtr) = duplicateType(smiHandle->typeEnumPtr, 0,
6015 setTypeList((yyval.typePtr), (yyvsp[(3) - (3)].listPtr));
6016 for (p = (yyvsp[(3) - (3)].listPtr); p; p = p->nextPtr)
6017 ((NamedNumber *)p->ptr)->typePtr = (yyval.typePtr);
6018 smiCheckNamedNumbersOrder(parserPtr, (yyval.typePtr));
6023 #line 3835 "parser-smi.y"
6027 defaultBasetype = SMI_BASETYPE_INTEGER32;
6028 importPtr = findImportByName("Integer32",
6033 if (thisModulePtr->export.language ==
6034 SMI_LANGUAGE_SMIV2) {
6035 smiPrintError(thisParserPtr,
6036 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
6038 } else if (thisModulePtr->export.language ==
6039 SMI_LANGUAGE_SPPI) {
6040 smiPrintError(thisParserPtr,
6041 ERR_SPPI_BASETYPE_NOT_IMPORTED,
6046 /* TODO: any need to distinguish from INTEGER? */
6047 (yyval.typePtr) = smiHandle->typeInteger32Ptr;
6052 #line 3861 "parser-smi.y"
6054 defaultBasetype = SMI_BASETYPE_INTEGER32;
6059 #line 3865 "parser-smi.y"
6063 importPtr = findImportByName("Integer32",
6068 if (thisModulePtr->export.language ==
6069 SMI_LANGUAGE_SMIV2) {
6070 smiPrintError(thisParserPtr,
6071 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
6073 } else if (thisModulePtr->export.language ==
6074 SMI_LANGUAGE_SPPI) {
6075 smiPrintError(thisParserPtr,
6076 ERR_SPPI_BASETYPE_NOT_IMPORTED,
6081 (yyval.typePtr) = duplicateType(smiHandle->typeInteger32Ptr, 0,
6083 setTypeList((yyval.typePtr), (yyvsp[(3) - (3)].listPtr));
6084 smiCheckTypeRanges(thisParserPtr, (yyval.typePtr));
6089 #line 3892 "parser-smi.y"
6091 defaultBasetype = SMI_BASETYPE_ENUM;
6096 #line 3896 "parser-smi.y"
6102 parentPtr = findTypeByModuleAndName(
6103 thisParserPtr->modulePtr, (yyvsp[(1) - (3)].id));
6105 importPtr = findImportByName((yyvsp[(1) - (3)].id),
6108 importPtr->kind == KIND_TYPE) {
6110 parentPtr = findTypeByModulenameAndName(
6111 importPtr->export.module, (yyvsp[(1) - (3)].id));
6115 if ((parentPtr->export.basetype !=
6116 SMI_BASETYPE_ENUM) &&
6117 (parentPtr->export.basetype !=
6118 SMI_BASETYPE_BITS)) {
6119 smiPrintError(thisParserPtr,
6120 ERR_ILLEGAL_ENUM_FOR_PARENT_TYPE,
6121 (yyvsp[(1) - (3)].id));
6122 (yyval.typePtr) = duplicateType(smiHandle->typeEnumPtr, 0,
6125 (yyval.typePtr) = duplicateType(parentPtr, 0,
6128 smiFree((yyvsp[(1) - (3)].id));
6131 * forward referenced type. create it,
6132 * marked with FLAG_INCOMPLETE.
6134 parentPtr = addType((yyvsp[(1) - (3)].id),
6135 SMI_BASETYPE_UNKNOWN,
6138 (yyval.typePtr) = duplicateType(parentPtr, 0,
6141 setTypeList((yyval.typePtr), (yyvsp[(3) - (3)].listPtr));
6142 for (p = (yyvsp[(3) - (3)].listPtr); p; p = p->nextPtr)
6143 ((NamedNumber *)p->ptr)->typePtr = (yyval.typePtr);
6144 smiCheckNamedNumbersOrder(parserPtr, (yyval.typePtr));
6149 #line 3947 "parser-smi.y"
6155 defaultBasetype = SMI_BASETYPE_ENUM;
6156 parentPtr = findTypeByModulenameAndName((yyvsp[(1) - (4)].id), (yyvsp[(3) - (4)].id));
6159 findImportByModulenameAndName((yyvsp[(1) - (4)].id),
6160 (yyvsp[(3) - (4)].id), thisModulePtr);
6162 importPtr->kind == KIND_TYPE) {
6165 findTypeByModulenameAndName((yyvsp[(1) - (4)].id), (yyvsp[(3) - (4)].id));
6169 if ((parentPtr->export.basetype !=
6170 SMI_BASETYPE_ENUM) &&
6171 (parentPtr->export.basetype !=
6172 SMI_BASETYPE_BITS)) {
6173 smiPrintError(thisParserPtr,
6174 ERR_ILLEGAL_ENUM_FOR_PARENT_TYPE,
6175 (yyvsp[(3) - (4)].id));
6176 (yyval.typePtr) = duplicateType(smiHandle->typeEnumPtr, 0,
6179 (yyval.typePtr) = duplicateType(parentPtr, 0,
6183 smiPrintError(thisParserPtr,
6184 ERR_UNKNOWN_TYPE, (yyvsp[(3) - (4)].id));
6185 (yyval.typePtr) = duplicateType(smiHandle->typeEnumPtr, 0,
6188 setTypeList((yyval.typePtr), (yyvsp[(4) - (4)].listPtr));
6189 for (p = (yyvsp[(4) - (4)].listPtr); p; p = p->nextPtr)
6190 ((NamedNumber *)p->ptr)->typePtr = (yyval.typePtr);
6191 smiCheckNamedNumbersOrder(parserPtr, (yyval.typePtr));
6192 smiFree((yyvsp[(1) - (4)].id));
6193 smiFree((yyvsp[(3) - (4)].id));
6198 #line 3993 "parser-smi.y"
6203 parentPtr = findTypeByModuleAndName(
6204 thisParserPtr->modulePtr, (yyvsp[(1) - (2)].id));
6206 importPtr = findImportByName((yyvsp[(1) - (2)].id),
6209 importPtr->kind == KIND_TYPE) {
6211 parentPtr = findTypeByModulenameAndName(
6212 importPtr->export.module, (yyvsp[(1) - (2)].id));
6216 if ((parentPtr->export.basetype !=
6217 SMI_BASETYPE_INTEGER32) &&
6218 (parentPtr->export.basetype !=
6219 SMI_BASETYPE_INTEGER64) &&
6220 (parentPtr->export.basetype !=
6221 SMI_BASETYPE_UNSIGNED32) &&
6222 (parentPtr->export.basetype !=
6223 SMI_BASETYPE_UNSIGNED64)) {
6224 smiPrintError(thisParserPtr,
6225 ERR_ILLEGAL_RANGE_FOR_PARENT_TYPE,
6226 (yyvsp[(1) - (2)].id));
6227 (yyval.typePtr) = duplicateType(smiHandle->typeInteger32Ptr, 0,
6229 defaultBasetype = SMI_BASETYPE_INTEGER32;
6232 parentPtr->export.basetype;
6233 (yyval.typePtr) = duplicateType(parentPtr, 0,
6236 smiFree((yyvsp[(1) - (2)].id));
6239 * forward referenced type. create it,
6240 * marked with FLAG_INCOMPLETE.
6242 parentPtr = addType((yyvsp[(1) - (2)].id),
6243 SMI_BASETYPE_UNKNOWN,
6246 (yyval.typePtr) = duplicateType(parentPtr, 0,
6248 defaultBasetype = SMI_BASETYPE_INTEGER32;
6250 setTypeList((yyval.typePtr), (yyvsp[(2) - (2)].listPtr));
6251 smiCheckTypeRanges(thisParserPtr, (yyval.typePtr));
6256 #line 4049 "parser-smi.y"
6261 parentPtr = findTypeByModulenameAndName((yyvsp[(1) - (4)].id), (yyvsp[(3) - (4)].id));
6263 importPtr = findImportByModulenameAndName((yyvsp[(1) - (4)].id),
6264 (yyvsp[(3) - (4)].id), thisModulePtr);
6266 importPtr->kind == KIND_TYPE) {
6268 parentPtr = findTypeByModulenameAndName(
6269 (yyvsp[(1) - (4)].id), (yyvsp[(3) - (4)].id));
6273 if ((parentPtr->export.basetype !=
6274 SMI_BASETYPE_INTEGER32) &&
6275 (parentPtr->export.basetype !=
6276 SMI_BASETYPE_INTEGER64) &&
6277 (parentPtr->export.basetype !=
6278 SMI_BASETYPE_UNSIGNED32) &&
6279 (parentPtr->export.basetype !=
6280 SMI_BASETYPE_UNSIGNED64)) {
6281 smiPrintError(thisParserPtr,
6282 ERR_ILLEGAL_RANGE_FOR_PARENT_TYPE,
6283 (yyvsp[(3) - (4)].id));
6284 (yyval.typePtr) = duplicateType(smiHandle->typeInteger32Ptr, 0,
6286 defaultBasetype = SMI_BASETYPE_INTEGER32;
6289 parentPtr->export.basetype;
6290 (yyval.typePtr) = duplicateType(parentPtr, 0,
6294 smiPrintError(thisParserPtr,
6295 ERR_UNKNOWN_TYPE, (yyvsp[(3) - (4)].id));
6296 (yyval.typePtr) = duplicateType(smiHandle->typeInteger32Ptr, 0,
6298 defaultBasetype = SMI_BASETYPE_INTEGER32;
6300 setTypeList((yyval.typePtr), (yyvsp[(4) - (4)].listPtr));
6301 smiCheckTypeRanges(thisParserPtr, (yyval.typePtr));
6302 smiFree((yyvsp[(1) - (4)].id));
6303 smiFree((yyvsp[(3) - (4)].id));
6308 #line 4098 "parser-smi.y"
6310 defaultBasetype = SMI_BASETYPE_OCTETSTRING;
6311 (yyval.typePtr) = smiHandle->typeOctetStringPtr;
6316 #line 4103 "parser-smi.y"
6318 defaultBasetype = SMI_BASETYPE_OCTETSTRING;
6323 #line 4107 "parser-smi.y"
6326 (yyval.typePtr) = duplicateType(smiHandle->typeOctetStringPtr, 0,
6328 setTypeList((yyval.typePtr), (yyvsp[(4) - (4)].listPtr));
6329 smiCheckTypeRanges(thisParserPtr, (yyval.typePtr));
6334 #line 4115 "parser-smi.y"
6339 defaultBasetype = SMI_BASETYPE_OCTETSTRING;
6340 parentPtr = findTypeByModuleAndName(
6341 thisParserPtr->modulePtr, (yyvsp[(1) - (2)].id));
6343 importPtr = findImportByName((yyvsp[(1) - (2)].id),
6346 importPtr->kind == KIND_TYPE) {
6348 parentPtr = findTypeByModulenameAndName(
6349 importPtr->export.module, (yyvsp[(1) - (2)].id));
6353 if (parentPtr->export.basetype !=
6354 SMI_BASETYPE_OCTETSTRING) {
6355 smiPrintError(thisParserPtr,
6356 ERR_ILLEGAL_SIZE_FOR_PARENT_TYPE,
6357 (yyvsp[(1) - (2)].id));
6358 (yyval.typePtr) = duplicateType(smiHandle->typeOctetStringPtr, 0,
6361 (yyval.typePtr) = duplicateType(parentPtr, 0,
6364 smiFree((yyvsp[(1) - (2)].id));
6367 * forward referenced type. create it,
6368 * marked with FLAG_INCOMPLETE.
6370 parentPtr = addType((yyvsp[(1) - (2)].id),
6371 SMI_BASETYPE_UNKNOWN,
6374 (yyval.typePtr) = duplicateType(parentPtr, 0,
6377 setTypeList((yyval.typePtr), (yyvsp[(2) - (2)].listPtr));
6378 smiCheckTypeRanges(thisParserPtr, (yyval.typePtr));
6383 #line 4162 "parser-smi.y"
6388 defaultBasetype = SMI_BASETYPE_OCTETSTRING;
6389 parentPtr = findTypeByModulenameAndName((yyvsp[(1) - (4)].id), (yyvsp[(3) - (4)].id));
6391 importPtr = findImportByModulenameAndName((yyvsp[(1) - (4)].id),
6392 (yyvsp[(3) - (4)].id), thisModulePtr);
6394 importPtr->kind == KIND_TYPE) {
6396 parentPtr = findTypeByModulenameAndName(
6397 (yyvsp[(1) - (4)].id), (yyvsp[(3) - (4)].id));
6401 if (parentPtr->export.basetype !=
6402 SMI_BASETYPE_OCTETSTRING) {
6403 smiPrintError(thisParserPtr,
6404 ERR_ILLEGAL_SIZE_FOR_PARENT_TYPE,
6405 (yyvsp[(3) - (4)].id));
6406 (yyval.typePtr) = duplicateType(smiHandle->typeOctetStringPtr, 0,
6409 (yyval.typePtr) = duplicateType(parentPtr, 0,
6413 smiPrintError(thisParserPtr,
6414 ERR_UNKNOWN_TYPE, (yyvsp[(3) - (4)].id));
6415 (yyval.typePtr) = duplicateType(smiHandle->typeOctetStringPtr, 0,
6418 setTypeList((yyval.typePtr), (yyvsp[(4) - (4)].listPtr));
6419 smiCheckTypeRanges(thisParserPtr, (yyval.typePtr));
6420 smiFree((yyvsp[(1) - (4)].id));
6421 smiFree((yyvsp[(3) - (4)].id));
6426 #line 4202 "parser-smi.y"
6428 defaultBasetype = SMI_BASETYPE_OBJECTIDENTIFIER;
6429 (yyval.typePtr) = smiHandle->typeObjectIdentifierPtr;
6434 #line 4210 "parser-smi.y"
6436 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
6437 (yyval.valuePtr)->basetype = SMI_BASETYPE_UNSIGNED32;
6438 (yyval.valuePtr)->value.unsigned32 = (yyvsp[(1) - (1)].unsigned32);
6443 #line 4216 "parser-smi.y"
6445 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
6446 (yyval.valuePtr)->basetype = SMI_BASETYPE_INTEGER32;
6447 (yyval.valuePtr)->value.integer32 = (yyvsp[(1) - (1)].integer32);
6452 #line 4222 "parser-smi.y"
6454 /* The scanner already checks for the language */
6455 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
6456 (yyval.valuePtr)->basetype = SMI_BASETYPE_UNSIGNED64;
6457 (yyval.valuePtr)->value.unsigned64 = (yyvsp[(1) - (1)].unsigned64);
6462 #line 4229 "parser-smi.y"
6464 /* The scanner already checks for the language */
6465 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
6466 (yyval.valuePtr)->basetype = SMI_BASETYPE_INTEGER64;
6467 (yyval.valuePtr)->value.integer64 = (yyvsp[(1) - (1)].integer64);
6472 #line 4236 "parser-smi.y"
6477 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
6478 if (defaultBasetype == SMI_BASETYPE_OCTETSTRING) {
6479 (yyval.valuePtr)->basetype = SMI_BASETYPE_OCTETSTRING;
6480 len = strlen((yyvsp[(1) - (1)].text));
6481 (yyval.valuePtr)->value.ptr =
6482 smiMalloc((len+7)/8+1);
6483 for (i = 0; i < len; i += 8) {
6484 strncpy(s, &(yyvsp[(1) - (1)].text)[i], 8);
6485 for (j = 1; j < 8; j++) {
6486 if (!s[j]) s[j] = '0';
6489 (yyval.valuePtr)->value.ptr[i/8] =
6490 (unsigned char)strtol(s, 0, 2);
6492 (yyval.valuePtr)->len = (len+7)/8;
6494 (yyval.valuePtr)->basetype = SMI_BASETYPE_UNSIGNED32;
6495 (yyval.valuePtr)->value.unsigned32 = strtoul((yyvsp[(1) - (1)].text), NULL, 2);
6501 #line 4262 "parser-smi.y"
6506 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
6507 if (defaultBasetype == SMI_BASETYPE_OCTETSTRING) {
6508 (yyval.valuePtr)->basetype = SMI_BASETYPE_OCTETSTRING;
6509 len = strlen((yyvsp[(1) - (1)].text));
6510 (yyval.valuePtr)->value.ptr = smiMalloc((len+1)/2+1);
6511 for (i = 0; i < len; i += 2) {
6512 strncpy(s, &(yyvsp[(1) - (1)].text)[i], 2);
6513 if (!s[1]) s[1] = '0';
6515 (yyval.valuePtr)->value.ptr[i/2] =
6516 (unsigned char)strtol(s, 0, 16);
6518 (yyval.valuePtr)->len = (len+1)/2;
6520 (yyval.valuePtr)->basetype = SMI_BASETYPE_UNSIGNED32;
6521 (yyval.valuePtr)->value.unsigned32 = strtoul((yyvsp[(1) - (1)].text), NULL, 16);
6527 #line 4285 "parser-smi.y"
6529 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
6530 if ((defaultBasetype != SMI_BASETYPE_ENUM) &&
6531 (defaultBasetype != SMI_BASETYPE_OBJECTIDENTIFIER)) {
6532 smiPrintError(thisParserPtr, ERR_DEFVAL_SYNTAX);
6533 (yyval.valuePtr)->basetype = defaultBasetype;
6534 if (defaultBasetype == SMI_BASETYPE_ENUM) {
6535 (yyval.valuePtr)->len = 1;
6536 (yyval.valuePtr)->value.unsigned32 = 0;
6538 (yyval.valuePtr)->len = 0;
6539 (yyval.valuePtr)->value.ptr = NULL;
6542 (yyval.valuePtr)->basetype = defaultBasetype;
6543 (yyval.valuePtr)->len = -1; /* indicates unresolved ptr */
6544 (yyval.valuePtr)->value.ptr = (yyvsp[(1) - (1)].id); /* JS: needs strdup? */
6550 #line 4305 "parser-smi.y"
6552 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
6553 (yyval.valuePtr)->basetype = SMI_BASETYPE_OCTETSTRING;
6554 (yyval.valuePtr)->value.ptr = smiStrdup((yyvsp[(1) - (1)].text));
6555 (yyval.valuePtr)->len = strlen((yyvsp[(1) - (1)].text));
6560 #line 4328 "parser-smi.y"
6563 * SMIv1 allows something like { 0 0 } !
6566 /* TODO: make it work correctly for SMIv1 */
6567 if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2) {
6568 smiPrintError(thisParserPtr,
6569 ERR_OID_DEFVAL_TOO_LONG_SMIV2);
6571 smiPrintError(thisParserPtr,
6572 ERR_OID_DEFVAL_TOO_LONG_SMIV1);
6574 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
6575 (yyval.valuePtr)->basetype = SMI_BASETYPE_OBJECTIDENTIFIER;
6576 (yyval.valuePtr)->len = 2;
6577 (yyval.valuePtr)->value.oid = smiMalloc(2 * sizeof(SmiSubid));
6578 (yyval.valuePtr)->value.oid[0] = 0;
6579 (yyval.valuePtr)->value.oid[1] = 0;
6584 #line 4355 "parser-smi.y"
6586 (yyval.typePtr) = smiHandle->typeInteger32Ptr;
6591 #line 4359 "parser-smi.y"
6595 /* TODO: any need to distinguish from INTEGER? */
6596 (yyval.typePtr) = smiHandle->typeInteger32Ptr;
6598 importPtr = findImportByName("Integer32",
6603 if (thisModulePtr->export.language ==
6604 SMI_LANGUAGE_SMIV2) {
6605 smiPrintError(thisParserPtr,
6606 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
6608 } else if (thisModulePtr->export.language ==
6609 SMI_LANGUAGE_SPPI) {
6610 smiPrintError(thisParserPtr,
6611 ERR_SPPI_BASETYPE_NOT_IMPORTED,
6619 #line 4384 "parser-smi.y"
6621 (yyval.typePtr) = smiHandle->typeOctetStringPtr;
6626 #line 4388 "parser-smi.y"
6628 (yyval.typePtr) = smiHandle->typeObjectIdentifierPtr;
6633 #line 4394 "parser-smi.y"
6637 (yyval.typePtr) = findTypeByName("IpAddress");
6638 if (! (yyval.typePtr)) {
6639 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
6643 importPtr = findImportByName("IpAddress",
6648 if (thisModulePtr->export.language ==
6649 SMI_LANGUAGE_SMIV2) {
6650 smiPrintError(thisParserPtr,
6651 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
6653 } else if (thisModulePtr->export.language ==
6654 SMI_LANGUAGE_SPPI) {
6655 smiPrintError(thisParserPtr,
6656 ERR_SPPI_BASETYPE_NOT_IMPORTED,
6664 #line 4422 "parser-smi.y"
6668 if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) &&
6669 !findImportByName("Counter32", thisParserPtr->modulePtr))
6670 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "COUNTER32");
6671 (yyval.typePtr) = findTypeByName("Counter32");
6672 if (! (yyval.typePtr)) {
6673 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
6677 importPtr = findImportByName("Counter32",
6682 if (thisModulePtr->export.language ==
6683 SMI_LANGUAGE_SMIV2) {
6684 smiPrintError(thisParserPtr,
6685 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
6693 #line 4448 "parser-smi.y"
6696 List *listPtr, *nextListPtr;
6698 smiPrintError(thisParserPtr,
6699 ERR_ILLEGAL_RANGE_FOR_COUNTER,
6701 for (listPtr = (yyvsp[(2) - (2)].listPtr); listPtr;
6702 listPtr = nextListPtr) {
6703 nextListPtr = listPtr->nextPtr;
6704 smiFree((Range *)listPtr->ptr);
6708 if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) &&
6709 !findImportByName("Counter32", thisParserPtr->modulePtr))
6710 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Counter32");
6711 (yyval.typePtr) = findTypeByName("Counter32");
6712 if (! (yyval.typePtr)) {
6713 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
6717 importPtr = findImportByName("Counter32",
6722 if (thisModulePtr->export.language ==
6723 SMI_LANGUAGE_SMIV2) {
6724 smiPrintError(thisParserPtr,
6725 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
6733 #line 4485 "parser-smi.y"
6737 if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) &&
6738 !findImportByName("Gauge32", thisParserPtr->modulePtr))
6739 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Gauge32");
6740 (yyval.typePtr) = findTypeByName("Gauge32");
6741 if (! (yyval.typePtr)) {
6742 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
6746 importPtr = findImportByName("Gauge32",
6751 if (thisModulePtr->export.language ==
6752 SMI_LANGUAGE_SMIV2) {
6753 smiPrintError(thisParserPtr,
6754 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
6762 #line 4511 "parser-smi.y"
6767 if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) &&
6768 !findImportByName("Gauge32", thisParserPtr->modulePtr))
6769 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Gauge32");
6770 parentPtr = findTypeByName("Gauge32");
6772 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
6774 (yyval.typePtr) = NULL;
6776 (yyval.typePtr) = duplicateType(parentPtr, 0,
6778 setTypeList((yyval.typePtr), (yyvsp[(2) - (2)].listPtr));
6779 smiCheckTypeRanges(thisParserPtr, (yyval.typePtr));
6782 importPtr = findImportByName("Gauge32",
6787 if (thisModulePtr->export.language ==
6788 SMI_LANGUAGE_SMIV2) {
6789 smiPrintError(thisParserPtr,
6790 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
6798 #line 4544 "parser-smi.y"
6802 (yyval.typePtr) = smiHandle->typeUnsigned32Ptr;
6804 importPtr = findImportByName("Unsigned32",
6809 if (thisModulePtr->export.language ==
6810 SMI_LANGUAGE_SMIV2) {
6811 smiPrintError(thisParserPtr,
6812 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
6814 } else if (thisModulePtr->export.language ==
6815 SMI_LANGUAGE_SPPI) {
6816 smiPrintError(thisParserPtr,
6817 ERR_SPPI_BASETYPE_NOT_IMPORTED,
6825 #line 4568 "parser-smi.y"
6829 (yyval.typePtr) = duplicateType(smiHandle->typeUnsigned32Ptr, 0,
6831 setTypeList((yyval.typePtr), (yyvsp[(2) - (2)].listPtr));
6832 smiCheckTypeRanges(thisParserPtr, (yyval.typePtr));
6834 importPtr = findImportByName("Unsigned32",
6839 if (thisModulePtr->export.language ==
6840 SMI_LANGUAGE_SMIV2) {
6841 smiPrintError(thisParserPtr,
6842 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
6844 } else if (thisModulePtr->export.language ==
6845 SMI_LANGUAGE_SPPI) {
6846 smiPrintError(thisParserPtr,
6847 ERR_SPPI_BASETYPE_NOT_IMPORTED,
6855 #line 4595 "parser-smi.y"
6859 (yyval.typePtr) = findTypeByName("TimeTicks");
6860 if (! (yyval.typePtr)) {
6861 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
6865 importPtr = findImportByName("TimeTicks",
6870 if (thisModulePtr->export.language ==
6871 SMI_LANGUAGE_SMIV2) {
6872 smiPrintError(thisParserPtr,
6873 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
6875 } else if (thisModulePtr->export.language ==
6876 SMI_LANGUAGE_SPPI) {
6877 smiPrintError(thisParserPtr,
6878 ERR_SPPI_BASETYPE_NOT_IMPORTED,
6886 #line 4623 "parser-smi.y"
6890 (yyval.typePtr) = findTypeByName("Opaque");
6891 if (! (yyval.typePtr)) {
6892 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
6895 if (thisModulePtr->export.language ==
6896 SMI_LANGUAGE_SMIV2) {
6897 smiPrintError(thisParserPtr,
6898 ERR_SMIV2_OPAQUE_OBSOLETE);
6899 } else if (thisModulePtr->export.language ==
6900 SMI_LANGUAGE_SPPI) {
6901 smiPrintError(thisParserPtr,
6902 ERR_SPPI_OPAQUE_OBSOLETE);
6906 importPtr = findImportByName("Opaque",
6911 if (thisModulePtr->export.language ==
6912 SMI_LANGUAGE_SMIV2) {
6913 smiPrintError(thisParserPtr,
6914 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
6916 } else if (thisModulePtr->export.language ==
6917 SMI_LANGUAGE_SPPI) {
6918 smiPrintError(thisParserPtr,
6919 ERR_SPPI_BASETYPE_NOT_IMPORTED,
6927 #line 4661 "parser-smi.y"
6932 parentPtr = findTypeByName("Opaque");
6934 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
6936 (yyval.typePtr) = NULL;
6938 if (thisModulePtr->export.language ==
6939 SMI_LANGUAGE_SMIV2) {
6940 smiPrintError(thisParserPtr,
6941 ERR_SMIV2_OPAQUE_OBSOLETE,
6943 } else if (thisModulePtr->export.language ==
6944 SMI_LANGUAGE_SPPI) {
6945 smiPrintError(thisParserPtr,
6946 ERR_SPPI_OPAQUE_OBSOLETE,
6949 (yyval.typePtr) = duplicateType(parentPtr, 0,
6951 setTypeList((yyval.typePtr), (yyvsp[(2) - (2)].listPtr));
6952 smiCheckTypeRanges(thisParserPtr, (yyval.typePtr));
6955 importPtr = findImportByName("Opaque",
6960 if (thisModulePtr->export.language ==
6961 SMI_LANGUAGE_SMIV2) {
6962 smiPrintError(thisParserPtr,
6963 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
6965 } else if (thisModulePtr->export.language ==
6966 SMI_LANGUAGE_SPPI) {
6967 smiPrintError(thisParserPtr,
6968 ERR_SPPI_BASETYPE_NOT_IMPORTED,
6976 #line 4707 "parser-smi.y"
6980 if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) &&
6981 !findImportByName("Counter64", thisParserPtr->modulePtr))
6982 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Counter64");
6983 (yyval.typePtr) = findTypeByName("Counter64");
6984 if (! (yyval.typePtr)) {
6985 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
6989 importPtr = findImportByName("Counter64",
6994 if (thisModulePtr->export.language ==
6995 SMI_LANGUAGE_SMIV2) {
6996 smiPrintError(thisParserPtr,
6997 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
7005 #line 4733 "parser-smi.y"
7008 List *listPtr, *nextListPtr;
7010 smiPrintError(thisParserPtr,
7011 ERR_ILLEGAL_RANGE_FOR_COUNTER,
7013 for (listPtr = (yyvsp[(2) - (2)].listPtr); listPtr;
7014 listPtr = nextListPtr) {
7015 nextListPtr = listPtr->nextPtr;
7016 smiFree((Range *)listPtr->ptr);
7020 if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) &&
7021 !findImportByName("Counter64", thisParserPtr->modulePtr))
7022 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Counter64");
7023 (yyval.typePtr) = findTypeByName("Counter64");
7024 if (! (yyval.typePtr)) {
7025 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
7029 importPtr = findImportByName("Counter64",
7034 if (thisModulePtr->export.language ==
7035 SMI_LANGUAGE_SMIV2) {
7036 smiPrintError(thisParserPtr,
7037 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
7045 #line 4770 "parser-smi.y"
7049 (yyval.typePtr) = findTypeByModulenameAndName(
7050 thisParserPtr->modulePtr->export.name, "Integer64");
7051 if (! (yyval.typePtr)) {
7052 importPtr = findImportByName("Integer64",
7055 (yyval.typePtr) = findTypeByName("Integer64");
7056 if ((thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)) {
7057 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "Integer64");
7059 smiPrintError(thisParserPtr,
7060 ERR_SPPI_BASETYPE_NOT_IMPORTED,
7065 (yyval.typePtr) = findTypeByModulenameAndName(
7066 importPtr->export.module,
7067 importPtr->export.name);
7074 #line 4796 "parser-smi.y"
7079 parentPtr = findTypeByModulenameAndName(
7080 thisParserPtr->modulePtr->export.name, "Integer64");
7082 importPtr = findImportByName("Integer64",
7085 parentPtr = findTypeByName("Integer64");
7086 if ((thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)) {
7087 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "Integer64");
7089 smiPrintError(thisParserPtr,
7090 ERR_SPPI_BASETYPE_NOT_IMPORTED,
7095 parentPtr = findTypeByModulenameAndName(
7096 importPtr->export.module,
7097 importPtr->export.name);
7101 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
7103 (yyval.typePtr) = NULL;
7105 (yyval.typePtr) = duplicateType(parentPtr, 0,
7107 setTypeList((yyval.typePtr), (yyvsp[(2) - (2)].listPtr));
7108 smiCheckTypeRanges(thisParserPtr, (yyval.typePtr));
7114 #line 4833 "parser-smi.y"
7118 (yyval.typePtr) = findTypeByModulenameAndName(
7119 thisParserPtr->modulePtr->export.name, "Unsigned64");
7120 if (! (yyval.typePtr)) {
7121 importPtr = findImportByName("Unsigned64",
7124 (yyval.typePtr) = findTypeByName("Unsigned64");
7125 if ((thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)) {
7126 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "Unsigned64");
7128 smiPrintError(thisParserPtr,
7129 ERR_SPPI_BASETYPE_NOT_IMPORTED,
7134 (yyval.typePtr) = findTypeByModulenameAndName(
7135 importPtr->export.module,
7136 importPtr->export.name);
7143 #line 4859 "parser-smi.y"
7148 parentPtr = findTypeByModulenameAndName(
7149 thisParserPtr->modulePtr->export.name, "Unsigned64");
7151 importPtr = findImportByName("Unsigned64",
7154 parentPtr = findTypeByName("Unsigned64");
7155 if ((thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)) {
7156 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "Unsigned64");
7158 smiPrintError(thisParserPtr,
7159 ERR_SPPI_BASETYPE_NOT_IMPORTED,
7164 parentPtr = findTypeByModulenameAndName(
7165 importPtr->export.module,
7166 importPtr->export.name);
7170 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
7172 (yyval.typePtr) = NULL;
7174 (yyval.typePtr) = duplicateType(parentPtr, 0,
7176 setTypeList((yyval.typePtr), (yyvsp[(2) - (2)].listPtr));
7177 smiCheckTypeRanges(thisParserPtr, (yyval.typePtr));
7183 #line 4902 "parser-smi.y"
7187 (yyval.typePtr) = findTypeByName("IpAddress");
7188 if (! (yyval.typePtr)) {
7189 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
7193 importPtr = findImportByName("IpAddress",
7198 if (thisModulePtr->export.language ==
7199 SMI_LANGUAGE_SMIV2) {
7200 smiPrintError(thisParserPtr,
7201 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
7203 } else if (thisModulePtr->export.language ==
7204 SMI_LANGUAGE_SPPI) {
7205 smiPrintError(thisParserPtr,
7206 ERR_SPPI_BASETYPE_NOT_IMPORTED,
7214 #line 4930 "parser-smi.y"
7218 if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) &&
7219 !findImportByName("Counter32", thisParserPtr->modulePtr))
7220 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Counter32");
7221 (yyval.typePtr) = findTypeByName("Counter32");
7222 if (! (yyval.typePtr)) {
7223 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
7227 importPtr = findImportByName("Counter32",
7232 if (thisModulePtr->export.language ==
7233 SMI_LANGUAGE_SMIV2) {
7234 smiPrintError(thisParserPtr,
7235 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
7243 #line 4956 "parser-smi.y"
7247 if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) &&
7248 !findImportByName("Gauge32", thisParserPtr->modulePtr))
7249 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Gauge32");
7250 (yyval.typePtr) = findTypeByName("Gauge32");
7251 if (! (yyval.typePtr)) {
7252 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
7256 importPtr = findImportByName("Gauge32",
7261 if (thisModulePtr->export.language ==
7262 SMI_LANGUAGE_SMIV2) {
7263 smiPrintError(thisParserPtr,
7264 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
7272 #line 4982 "parser-smi.y"
7276 (yyval.typePtr) = smiHandle->typeUnsigned32Ptr;
7278 importPtr = findImportByName("Unsigned32",
7283 if (thisModulePtr->export.language ==
7284 SMI_LANGUAGE_SMIV2) {
7285 smiPrintError(thisParserPtr,
7286 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
7288 } else if (thisModulePtr->export.language ==
7289 SMI_LANGUAGE_SPPI) {
7290 smiPrintError(thisParserPtr,
7291 ERR_SPPI_BASETYPE_NOT_IMPORTED,
7299 #line 5006 "parser-smi.y"
7303 (yyval.typePtr) = findTypeByName("TimeTicks");
7304 if (! (yyval.typePtr)) {
7305 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
7309 importPtr = findImportByName("TimeTicks",
7314 if (thisModulePtr->export.language ==
7315 SMI_LANGUAGE_SMIV2) {
7316 smiPrintError(thisParserPtr,
7317 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
7319 } else if (thisModulePtr->export.language ==
7320 SMI_LANGUAGE_SPPI) {
7321 smiPrintError(thisParserPtr,
7322 ERR_SPPI_BASETYPE_NOT_IMPORTED,
7330 #line 5034 "parser-smi.y"
7334 (yyval.typePtr) = findTypeByName("Opaque");
7335 if (! (yyval.typePtr)) {
7336 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
7339 if (thisModulePtr->export.language ==
7340 SMI_LANGUAGE_SMIV2) {
7341 smiPrintError(thisParserPtr,
7342 ERR_SMIV2_OPAQUE_OBSOLETE,
7344 } else if (thisModulePtr->export.language ==
7345 SMI_LANGUAGE_SPPI) {
7346 smiPrintError(thisParserPtr,
7347 ERR_SPPI_OPAQUE_OBSOLETE,
7352 importPtr = findImportByName("Opaque",
7357 if (thisModulePtr->export.language ==
7358 SMI_LANGUAGE_SMIV2) {
7359 smiPrintError(thisParserPtr,
7360 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
7362 } else if (thisModulePtr->export.language ==
7363 SMI_LANGUAGE_SPPI) {
7364 smiPrintError(thisParserPtr,
7365 ERR_SPPI_BASETYPE_NOT_IMPORTED,
7373 #line 5074 "parser-smi.y"
7377 if ((thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI) &&
7378 !findImportByName("Counter64", thisModulePtr))
7379 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "Counter64");
7380 (yyval.typePtr) = findTypeByName("Counter64");
7381 if (! (yyval.typePtr)) {
7382 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
7386 importPtr = findImportByName("Counter64",
7391 if (thisModulePtr->export.language ==
7392 SMI_LANGUAGE_SMIV2) {
7393 smiPrintError(thisParserPtr,
7394 ERR_SMIV2_BASETYPE_NOT_IMPORTED,
7402 #line 5100 "parser-smi.y"
7406 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)
7407 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "Integer64");
7408 (yyval.typePtr) = findTypeByName("Integer64");
7409 if (! (yyval.typePtr)) {
7410 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
7414 importPtr = findImportByName("Integer64",
7419 if (thisModulePtr->export.language ==
7420 SMI_LANGUAGE_SPPI) {
7421 smiPrintError(thisParserPtr,
7422 ERR_SPPI_BASETYPE_NOT_IMPORTED,
7430 #line 5125 "parser-smi.y"
7434 importPtr = findImportByName("Unsigned64",
7436 if ((thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) && (!importPtr))
7437 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "Unsigned64");
7438 (yyval.typePtr) = findTypeByName("Unsigned64");
7439 if (! (yyval.typePtr)) {
7440 smiPrintError(thisParserPtr, ERR_UNKNOWN_TYPE,
7447 if (thisModulePtr->export.language ==
7448 SMI_LANGUAGE_SPPI) {
7449 smiPrintError(thisParserPtr,
7450 ERR_SPPI_BASETYPE_NOT_IMPORTED,
7458 #line 5152 "parser-smi.y"
7460 List *listPtr, *nextListPtr;
7462 if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2)
7463 smiPrintError(thisParserPtr,
7464 ERR_UNEXPECTED_TYPE_RESTRICTION);
7466 for (listPtr = (yyvsp[(1) - (1)].listPtr); listPtr;
7467 listPtr = nextListPtr) {
7468 nextListPtr = listPtr->nextPtr;
7469 smiFree((Range *)(listPtr->ptr));
7473 (yyval.listPtr) = NULL;
7478 #line 5169 "parser-smi.y"
7480 List *listPtr, *nextListPtr;
7482 if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2)
7483 smiPrintError(thisParserPtr,
7484 ERR_UNEXPECTED_TYPE_RESTRICTION);
7486 for (listPtr = (yyvsp[(1) - (1)].listPtr); listPtr;
7487 listPtr = nextListPtr) {
7488 nextListPtr = listPtr->nextPtr;
7489 smiFree((Range *)(listPtr->ptr));
7493 (yyval.listPtr) = NULL;
7498 #line 5186 "parser-smi.y"
7500 List *listPtr, *nextListPtr;
7502 if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2)
7503 smiPrintError(thisParserPtr,
7504 ERR_UNEXPECTED_TYPE_RESTRICTION);
7506 for (listPtr = (yyvsp[(1) - (1)].listPtr); listPtr;
7507 listPtr = nextListPtr) {
7508 nextListPtr = listPtr->nextPtr;
7509 smiFree(((NamedNumber *)(listPtr->ptr))->export.name);
7510 smiFree((NamedNumber *)(listPtr->ptr));
7514 (yyval.listPtr) = NULL;
7519 #line 5204 "parser-smi.y"
7521 (yyval.listPtr) = NULL;
7526 #line 5218 "parser-smi.y"
7527 { (yyval.listPtr) = (yyvsp[(2) - (3)].listPtr); ;}
7531 #line 5228 "parser-smi.y"
7533 (yyval.listPtr) = (yyvsp[(4) - (6)].listPtr);
7538 #line 5234 "parser-smi.y"
7540 (yyval.listPtr) = smiMalloc(sizeof(List));
7541 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].rangePtr);
7542 (yyval.listPtr)->nextPtr = NULL;
7547 #line 5240 "parser-smi.y"
7551 p = smiMalloc(sizeof(List));
7552 p->ptr = (void *)(yyvsp[(3) - (3)].rangePtr);
7554 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr; pp = pp->nextPtr);
7557 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
7562 #line 5254 "parser-smi.y"
7564 (yyval.rangePtr) = smiMalloc(sizeof(Range));
7565 (yyval.rangePtr)->export.minValue = *(yyvsp[(1) - (1)].valuePtr);
7566 (yyval.rangePtr)->export.maxValue = *(yyvsp[(1) - (1)].valuePtr);
7567 smiFree((yyvsp[(1) - (1)].valuePtr));
7572 #line 5261 "parser-smi.y"
7574 (yyval.rangePtr) = smiMalloc(sizeof(Range));
7575 (yyval.rangePtr)->export.minValue = *(yyvsp[(1) - (3)].valuePtr);
7576 (yyval.rangePtr)->export.maxValue = *(yyvsp[(3) - (3)].valuePtr);
7577 smiFree((yyvsp[(1) - (3)].valuePtr));
7578 smiFree((yyvsp[(3) - (3)].valuePtr));
7583 #line 5271 "parser-smi.y"
7585 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
7586 (yyval.valuePtr)->basetype = SMI_BASETYPE_INTEGER32;
7587 (yyval.valuePtr)->value.integer32 = (yyvsp[(1) - (1)].integer32);
7592 #line 5277 "parser-smi.y"
7594 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
7595 (yyval.valuePtr)->basetype = SMI_BASETYPE_UNSIGNED32;
7596 (yyval.valuePtr)->value.unsigned32 = (yyvsp[(1) - (1)].unsigned32);
7601 #line 5283 "parser-smi.y"
7603 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
7604 (yyval.valuePtr)->basetype = SMI_BASETYPE_INTEGER64;
7605 (yyval.valuePtr)->value.integer64 = (yyvsp[(1) - (1)].integer64);
7610 #line 5289 "parser-smi.y"
7612 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
7613 (yyval.valuePtr)->basetype = SMI_BASETYPE_UNSIGNED64;
7614 (yyval.valuePtr)->value.unsigned64 = (yyvsp[(1) - (1)].unsigned64);
7619 #line 5295 "parser-smi.y"
7624 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
7625 if (defaultBasetype == SMI_BASETYPE_OCTETSTRING) {
7626 (yyval.valuePtr)->basetype = SMI_BASETYPE_OCTETSTRING;
7627 len = strlen((yyvsp[(1) - (1)].text));
7628 (yyval.valuePtr)->value.ptr = smiMalloc((len+1)/2+1);
7629 for (i = 0; i < len; i += 2) {
7630 strncpy(s, &(yyvsp[(1) - (1)].text)[i], 2);
7631 if (!s[1]) s[1] = '0';
7633 (yyval.valuePtr)->value.ptr[i/2] =
7634 (unsigned char)strtol(s, 0, 16);
7636 (yyval.valuePtr)->len = (len+1)/2;
7638 (yyval.valuePtr)->basetype = SMI_BASETYPE_UNSIGNED32;
7639 (yyval.valuePtr)->value.unsigned32 = strtoul((yyvsp[(1) - (1)].text), NULL, 16);
7645 #line 5318 "parser-smi.y"
7650 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
7651 if (defaultBasetype == SMI_BASETYPE_OCTETSTRING) {
7652 (yyval.valuePtr)->basetype = SMI_BASETYPE_OCTETSTRING;
7653 len = strlen((yyvsp[(1) - (1)].text));
7654 (yyval.valuePtr)->value.ptr = smiMalloc((len+7)/8+1);
7655 for (i = 0; i < len; i += 8) {
7656 strncpy(s, &(yyvsp[(1) - (1)].text)[i], 8);
7657 for (j = 1; j < 8; j++) {
7658 if (!s[j]) s[j] = '0';
7661 (yyval.valuePtr)->value.ptr[i/8] =
7662 (unsigned char)strtol(s, 0, 2);
7664 (yyval.valuePtr)->len = (len+7)/8;
7666 (yyval.valuePtr)->basetype = SMI_BASETYPE_UNSIGNED32;
7667 (yyval.valuePtr)->value.unsigned32 = strtoul((yyvsp[(1) - (1)].text), NULL, 2);
7673 #line 5345 "parser-smi.y"
7675 (yyval.listPtr) = (yyvsp[(2) - (3)].listPtr);
7680 #line 5351 "parser-smi.y"
7682 (yyval.listPtr) = smiMalloc(sizeof(List));
7683 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].namedNumberPtr);
7684 (yyval.listPtr)->nextPtr = NULL;
7689 #line 5357 "parser-smi.y"
7693 p = smiMalloc(sizeof(List));
7694 p->ptr = (void *)(yyvsp[(3) - (3)].namedNumberPtr);
7696 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr; pp = pp->nextPtr);
7698 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
7703 #line 5370 "parser-smi.y"
7705 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
7706 ERR_ENUMNAME_32, ERR_ENUMNAME_64);
7707 if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2)
7709 if (strchr((yyvsp[(1) - (1)].id), '-')) {
7710 smiPrintError(thisParserPtr,
7711 ERR_NAMEDNUMBER_INCLUDES_HYPHEN,
7712 (yyvsp[(1) - (1)].id));
7719 #line 5383 "parser-smi.y"
7721 (yyval.namedNumberPtr) = smiMalloc(sizeof(NamedNumber));
7722 (yyval.namedNumberPtr)->export.name = (yyvsp[(1) - (5)].id);
7723 (yyval.namedNumberPtr)->export.value = *(yyvsp[(4) - (5)].valuePtr);
7724 smiFree((yyvsp[(4) - (5)].valuePtr));
7729 #line 5392 "parser-smi.y"
7731 if ((yyvsp[(1) - (1)].unsigned32) > SMI_BASETYPE_INTEGER32_MAX) {
7732 smiPrintError(thisParserPtr,
7733 ERR_INTEGER32_TOO_LARGE, (yyvsp[(1) - (1)].unsigned32));
7735 if ((thisModulePtr->export.language == SMI_LANGUAGE_SMIV1) &&
7736 ((yyvsp[(1) - (1)].unsigned32) == 0)) {
7737 smiPrintError(thisParserPtr,
7740 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
7741 (yyval.valuePtr)->basetype = SMI_BASETYPE_INTEGER32;
7742 (yyval.valuePtr)->value.integer32 = (yyvsp[(1) - (1)].unsigned32);
7747 #line 5407 "parser-smi.y"
7749 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
7750 (yyval.valuePtr)->basetype = SMI_BASETYPE_INTEGER32;
7751 (yyval.valuePtr)->value.integer32 = (yyvsp[(1) - (1)].integer32);
7752 /* TODO: non-negative is suggested */
7757 #line 5416 "parser-smi.y"
7759 if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2)
7761 if (!strcmp((yyvsp[(1) - (1)].id), "current")) {
7762 (yyval.status) = SMI_STATUS_CURRENT;
7763 } else if (!strcmp((yyvsp[(1) - (1)].id), "deprecated")) {
7764 (yyval.status) = SMI_STATUS_DEPRECATED;
7765 } else if (!strcmp((yyvsp[(1) - (1)].id), "obsolete")) {
7766 (yyval.status) = SMI_STATUS_OBSOLETE;
7768 smiPrintError(thisParserPtr,
7769 ERR_INVALID_SMIV2_STATUS,
7770 (yyvsp[(1) - (1)].id));
7771 if (!strcmp((yyvsp[(1) - (1)].id), "mandatory")
7772 || !strcmp((yyvsp[(1) - (1)].id), "optional")) {
7774 (yyval.status) = SMI_STATUS_CURRENT;
7776 (yyval.status) = SMI_STATUS_UNKNOWN;
7779 } else if (thisModulePtr->export.language != SMI_LANGUAGE_SPPI) {
7780 if (!strcmp((yyvsp[(1) - (1)].id), "mandatory")) {
7781 (yyval.status) = SMI_STATUS_MANDATORY;
7782 } else if (!strcmp((yyvsp[(1) - (1)].id), "optional")) {
7783 (yyval.status) = SMI_STATUS_OPTIONAL;
7784 } else if (!strcmp((yyvsp[(1) - (1)].id), "obsolete")) {
7785 (yyval.status) = SMI_STATUS_OBSOLETE;
7786 } else if (!strcmp((yyvsp[(1) - (1)].id), "deprecated")) {
7787 (yyval.status) = SMI_STATUS_OBSOLETE;
7789 smiPrintError(thisParserPtr,
7790 ERR_INVALID_SMIV1_STATUS,
7791 (yyvsp[(1) - (1)].id));
7792 if (!strcmp((yyvsp[(1) - (1)].id), "current")) {
7794 (yyval.status) = SMI_STATUS_MANDATORY;
7796 (yyval.status) = SMI_STATUS_UNKNOWN;
7799 } else { /* it is SPPI */
7800 if (!strcmp((yyvsp[(1) - (1)].id), "current")) {
7801 (yyval.status) = SMI_STATUS_CURRENT;
7802 } else if (!strcmp((yyvsp[(1) - (1)].id), "obsolete")) {
7803 (yyval.status) = SMI_STATUS_OBSOLETE;
7804 } else if (!strcmp((yyvsp[(1) - (1)].id), "deprecated")) {
7805 (yyval.status) = SMI_STATUS_OBSOLETE;
7807 smiPrintError(thisParserPtr,
7808 ERR_INVALID_SPPI_STATUS, (yyvsp[(1) - (1)].id));
7809 (yyval.status) = SMI_STATUS_UNKNOWN;
7812 smiFree((yyvsp[(1) - (1)].id));
7817 #line 5475 "parser-smi.y"
7819 if (!strcmp((yyvsp[(1) - (1)].id), "current")) {
7820 (yyval.status) = SMI_STATUS_CURRENT;
7821 } else if (!strcmp((yyvsp[(1) - (1)].id), "obsolete")) {
7822 (yyval.status) = SMI_STATUS_OBSOLETE;
7824 smiPrintError(thisParserPtr,
7825 ERR_INVALID_CAPABILITIES_STATUS,
7826 (yyvsp[(1) - (1)].id));
7827 (yyval.status) = SMI_STATUS_UNKNOWN;
7829 smiFree((yyvsp[(1) - (1)].id));
7834 #line 5491 "parser-smi.y"
7836 (yyval.text) = (yyvsp[(2) - (2)].text);
7838 if ((yyvsp[(2) - (2)].text) && !strlen((yyvsp[(2) - (2)].text))) {
7839 smiPrintError(thisParserPtr,
7846 #line 5500 "parser-smi.y"
7848 (yyval.text) = NULL;
7853 #line 5506 "parser-smi.y"
7855 (yyval.text) = (yyvsp[(2) - (2)].text);
7857 if ((yyvsp[(2) - (2)].text) && !strlen((yyvsp[(2) - (2)].text))) {
7858 smiPrintError(thisParserPtr,
7865 #line 5515 "parser-smi.y"
7867 (yyval.text) = NULL;
7872 #line 5521 "parser-smi.y"
7874 if (thisModulePtr->export.language == SMI_LANGUAGE_SMIV2)
7876 if (!strcmp((yyvsp[(1) - (1)].id), "not-accessible")) {
7877 (yyval.access) = SMI_ACCESS_NOT_ACCESSIBLE;
7878 } else if (!strcmp((yyvsp[(1) - (1)].id),
7879 "accessible-for-notify")) {
7880 (yyval.access) = SMI_ACCESS_NOTIFY;
7881 } else if (!strcmp((yyvsp[(1) - (1)].id), "read-only")) {
7882 (yyval.access) = SMI_ACCESS_READ_ONLY;
7883 } else if (!strcmp((yyvsp[(1) - (1)].id), "read-write")) {
7884 (yyval.access) = SMI_ACCESS_READ_WRITE;
7885 } else if (!strcmp((yyvsp[(1) - (1)].id), "read-create")) {
7886 (yyval.access) = SMI_ACCESS_READ_WRITE;
7887 thisParserPtr->flags |= FLAG_CREATABLE;
7888 /* TODO:remember it's really read-create */
7889 } else if (!strcmp((yyvsp[(1) - (1)].id), "write-only")) {
7890 smiPrintError(thisParserPtr,
7891 ERR_SMIV2_WRITE_ONLY);
7892 (yyval.access) = SMI_ACCESS_READ_WRITE;
7894 smiPrintError(thisParserPtr,
7895 ERR_INVALID_SMIV2_ACCESS,
7896 (yyvsp[(1) - (1)].id));
7897 (yyval.access) = SMI_ACCESS_UNKNOWN;
7899 } else if (thisModulePtr->export.language != SMI_LANGUAGE_SPPI) {
7900 if (!strcmp((yyvsp[(1) - (1)].id), "not-accessible")) {
7901 (yyval.access) = SMI_ACCESS_NOT_ACCESSIBLE;
7902 } else if (!strcmp((yyvsp[(1) - (1)].id), "read-only")) {
7903 (yyval.access) = SMI_ACCESS_READ_ONLY;
7904 } else if (!strcmp((yyvsp[(1) - (1)].id), "read-write")) {
7905 (yyval.access) = SMI_ACCESS_READ_WRITE;
7906 } else if (!strcmp((yyvsp[(1) - (1)].id), "write-only")) {
7907 smiPrintError(thisParserPtr,
7908 ERR_SMIV1_WRITE_ONLY);
7909 (yyval.access) = SMI_ACCESS_READ_WRITE;
7911 smiPrintError(thisParserPtr,
7912 ERR_INVALID_SMIV1_ACCESS,
7913 (yyvsp[(1) - (1)].id));
7914 (yyval.access) = SMI_ACCESS_UNKNOWN;
7917 if (!strcmp((yyvsp[(1) - (1)].id), "install")) {
7918 (yyval.access) = SMI_ACCESS_INSTALL;
7919 } else if (!strcmp((yyvsp[(1) - (1)].id), "install-notify")) {
7920 (yyval.access) = SMI_ACCESS_INSTALL_NOTIFY;
7921 } else if (!strcmp((yyvsp[(1) - (1)].id), "notify")) {
7922 (yyval.access) = SMI_ACCESS_NOTIFY;
7923 } else if (!strcmp((yyvsp[(1) - (1)].id), "report-only")) {
7924 (yyval.access) = SMI_ACCESS_REPORT_ONLY;
7925 } else if (!strcmp((yyvsp[(1) - (1)].id), "not-accessible")) {
7926 (yyval.access) = SMI_ACCESS_NOT_ACCESSIBLE;
7928 smiPrintError(thisParserPtr,
7929 ERR_INVALID_SPPI_ACCESS,
7930 (yyvsp[(1) - (1)].id));
7931 (yyval.access) = SMI_ACCESS_UNKNOWN;
7934 smiFree((yyvsp[(1) - (1)].id));
7939 #line 5587 "parser-smi.y"
7941 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)
7942 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "PIB-INDEX");
7947 #line 5592 "parser-smi.y"
7949 List *p = smiMalloc(sizeof(List));
7951 p->ptr = (yyvsp[(4) - (5)].objectPtr);
7954 (yyval.index).indexkind = SMI_INDEX_INDEX;
7955 (yyval.index).implied = impliedFlag;
7956 (yyval.index).listPtr = p;
7957 (yyval.index).rowPtr = NULL;
7958 indexFlag = INDEXFLAG_PIBINDEX;
7963 #line 5607 "parser-smi.y"
7965 (yyval.index).indexkind = SMI_INDEX_AUGMENT;
7966 (yyval.index).implied = 0;
7967 (yyval.index).listPtr = NULL;
7968 (yyval.index).rowPtr = (yyvsp[(3) - (4)].objectPtr);
7969 indexFlag = INDEXFLAG_AUGMENTS;
7974 #line 5615 "parser-smi.y"
7976 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)
7977 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "EXTENDS");
7982 #line 5620 "parser-smi.y"
7984 (yyval.index).indexkind = SMI_INDEX_SPARSE;
7985 (yyval.index).implied = 0;
7986 (yyval.index).listPtr = NULL;
7987 (yyval.index).rowPtr = (yyvsp[(4) - (5)].objectPtr);
7988 indexFlag = INDEXFLAG_EXTENDS;
7993 #line 5628 "parser-smi.y"
7995 (yyval.index).indexkind = SMI_INDEX_UNKNOWN;
8000 #line 5634 "parser-smi.y"
8003 * To avoid ambiguity caused by merging
8004 * the SMI and SPPI parser we use a flag.
8006 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI) {
8008 * Only INDEX or AUGMENTS are allowed for SMI
8010 if (indexFlag != INDEXFLAG_NONE)
8011 smiPrintError(thisParserPtr, ERR_INDEX_AND_AUGMENTS_USED);
8014 * INDEX may only be used if PIB_INDEX was used
8016 if (indexFlag != INDEXFLAG_PIBINDEX)
8017 smiPrintError(thisParserPtr, ERR_INDEX_WITHOUT_PIB_INDEX);
8021 * Use a global variable to fetch and remember
8022 * whether we have seen an IMPLIED keyword.
8029 #line 5660 "parser-smi.y"
8031 (yyval.index).indexkind = SMI_INDEX_INDEX;
8032 (yyval.index).implied = impliedFlag;
8033 (yyval.index).listPtr = (yyvsp[(4) - (5)].listPtr);
8034 (yyval.index).rowPtr = NULL;
8039 #line 5667 "parser-smi.y"
8041 (yyval.index).indexkind = SMI_INDEX_UNKNOWN;
8046 #line 5673 "parser-smi.y"
8048 (yyval.listPtr) = smiMalloc(sizeof(List));
8049 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].objectPtr);
8050 (yyval.listPtr)->nextPtr = NULL;
8055 #line 5680 "parser-smi.y"
8059 p = smiMalloc(sizeof(List));
8060 p->ptr = (yyvsp[(3) - (3)].objectPtr);
8062 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr; pp = pp->nextPtr);
8064 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
8069 #line 5693 "parser-smi.y"
8072 (yyval.objectPtr) = (yyvsp[(2) - (2)].objectPtr);
8077 #line 5698 "parser-smi.y"
8079 (yyval.objectPtr) = (yyvsp[(1) - (1)].objectPtr);
8084 #line 5708 "parser-smi.y"
8086 (yyval.objectPtr) = (yyvsp[(1) - (1)].objectPtr);
8091 #line 5714 "parser-smi.y"
8093 (yyval.objectPtr) = (yyvsp[(1) - (1)].objectPtr);
8098 #line 5720 "parser-smi.y"
8100 (yyval.valuePtr) = (yyvsp[(3) - (4)].valuePtr);
8101 if ((defaultBasetype == SMI_BASETYPE_BITS) &&
8102 ((yyval.valuePtr)->basetype != SMI_BASETYPE_BITS)) {
8103 smiPrintError(thisParserPtr,
8105 if ((yyval.valuePtr)->basetype == SMI_BASETYPE_OCTETSTRING) {
8106 smiFree((yyval.valuePtr)->value.ptr);
8108 smiFree((yyval.valuePtr));
8109 (yyval.valuePtr) = NULL;
8115 #line 5734 "parser-smi.y"
8116 { (yyval.valuePtr) = NULL; ;}
8120 #line 5739 "parser-smi.y"
8121 { (yyval.valuePtr) = (yyvsp[(1) - (1)].valuePtr); ;}
8125 #line 5741 "parser-smi.y"
8127 (yyval.valuePtr) = smiMalloc(sizeof(SmiValue));
8128 (yyval.valuePtr)->basetype = SMI_BASETYPE_BITS;
8129 (yyval.valuePtr)->value.ptr = (void *)(yyvsp[(2) - (3)].listPtr);
8134 #line 5749 "parser-smi.y"
8135 { (yyval.listPtr) = (yyvsp[(1) - (1)].listPtr); ;}
8139 #line 5751 "parser-smi.y"
8140 { (yyval.listPtr) = NULL; ;}
8144 #line 5755 "parser-smi.y"
8146 (yyval.listPtr) = smiMalloc(sizeof(List));
8147 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].id);
8148 (yyval.listPtr)->nextPtr = NULL;
8153 #line 5761 "parser-smi.y"
8157 p = smiMalloc(sizeof(List));
8158 p->ptr = (yyvsp[(3) - (3)].id);
8160 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr; pp = pp->nextPtr);
8162 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
8167 #line 5774 "parser-smi.y"
8169 (yyval.objectPtr) = (yyvsp[(1) - (1)].objectPtr);
8174 #line 5780 "parser-smi.y"
8176 (yyval.objectPtr) = (yyvsp[(1) - (1)].objectPtr);
8181 #line 5786 "parser-smi.y"
8183 (yyval.text) = (yyvsp[(2) - (2)].text);
8185 if ((yyvsp[(2) - (2)].text) && !strlen((yyvsp[(2) - (2)].text))) {
8186 smiPrintError(thisParserPtr,
8187 ERR_EMPTY_REFERENCE);
8193 #line 5795 "parser-smi.y"
8194 { (yyval.text) = NULL; ;}
8198 #line 5799 "parser-smi.y"
8199 { (yyval.err) = 0; ;}
8203 #line 5801 "parser-smi.y"
8204 { (yyval.err) = 0; ;}
8208 #line 5805 "parser-smi.y"
8209 { (yyval.err) = 0; ;}
8213 #line 5807 "parser-smi.y"
8214 { (yyval.err) = 0; ;}
8218 #line 5811 "parser-smi.y"
8220 thisParserPtr->firstRevisionLine = thisParserPtr->line;
8222 if (thisParserPtr->modulePtr->lastRevisionPtr &&
8223 ((yyvsp[(2) - (2)].date) >= thisParserPtr->modulePtr->lastRevisionPtr->export.date)) {
8224 smiPrintError(thisParserPtr,
8225 ERR_REVISION_NOT_DESCENDING);
8228 if ((yyvsp[(2) - (2)].date) > thisParserPtr->modulePtr->lastUpdated) {
8229 smiPrintError(thisParserPtr,
8230 ERR_REVISION_AFTER_LAST_UPDATE);
8236 #line 5826 "parser-smi.y"
8238 Revision *revisionPtr;
8240 checkDescr(thisParserPtr, (yyvsp[(5) - (5)].text));
8242 revisionPtr = addRevision((yyvsp[(2) - (5)].date), (yyvsp[(5) - (5)].text), thisParserPtr);
8244 setRevisionLine(revisionPtr,
8245 thisParserPtr->firstRevisionLine,
8248 (yyval.err) = revisionPtr ? 0 : -1;
8253 #line 5842 "parser-smi.y"
8255 (yyval.listPtr) = (yyvsp[(3) - (4)].listPtr);
8260 #line 5846 "parser-smi.y"
8262 (yyval.listPtr) = NULL;
8267 #line 5852 "parser-smi.y"
8269 (yyval.listPtr) = (yyvsp[(3) - (4)].listPtr);
8274 #line 5858 "parser-smi.y"
8276 (yyval.listPtr) = smiMalloc(sizeof(List));
8277 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].objectPtr);
8278 (yyval.listPtr)->nextPtr = NULL;
8283 #line 5864 "parser-smi.y"
8287 p = smiMalloc(sizeof(List));
8288 p->ptr = (yyvsp[(3) - (3)].objectPtr);
8290 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr; pp = pp->nextPtr);
8292 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
8297 #line 5877 "parser-smi.y"
8299 (yyval.objectPtr) = (yyvsp[(1) - (1)].objectPtr);
8300 if ((thisParserPtr->currentDecl == SMI_DECL_OBJECTGROUP) &&
8301 (yyval.objectPtr)->modulePtr != thisParserPtr->modulePtr) {
8302 smiPrintError(thisParserPtr,
8303 ERR_COMPLIANCE_MEMBER_NOT_LOCAL,
8304 (yyval.objectPtr)->export.name);
8310 #line 5889 "parser-smi.y"
8312 (yyval.listPtr) = (yyvsp[(3) - (4)].listPtr);
8317 #line 5895 "parser-smi.y"
8319 (yyval.listPtr) = smiMalloc(sizeof(List));
8320 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].objectPtr);
8321 (yyval.listPtr)->nextPtr = NULL;
8326 #line 5901 "parser-smi.y"
8330 p = smiMalloc(sizeof(List));
8331 p->ptr = (yyvsp[(3) - (3)].objectPtr);
8333 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr; pp = pp->nextPtr);
8335 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
8340 #line 5914 "parser-smi.y"
8342 (yyval.objectPtr) = (yyvsp[(1) - (1)].objectPtr);
8343 if ((yyval.objectPtr)->modulePtr != thisParserPtr->modulePtr) {
8344 smiPrintError(thisParserPtr,
8345 ERR_COMPLIANCE_MEMBER_NOT_LOCAL,
8346 (yyval.objectPtr)->export.name);
8352 #line 5925 "parser-smi.y"
8355 (yyval.text) = smiStrdup((yyvsp[(1) - (1)].text));
8356 len = strlen((yyval.text));
8357 while (len > 0 && (yyval.text)[len-1] == '\n') {
8358 (yyval.text)[--len] = 0;
8364 #line 5936 "parser-smi.y"
8366 (yyval.date) = checkDate(thisParserPtr, (yyvsp[(1) - (1)].text));
8371 #line 5941 "parser-smi.y"
8373 thisParserPtr->parentNodePtr = smiHandle->rootNodePtr;
8378 #line 5945 "parser-smi.y"
8380 (yyval.objectPtr) = (yyvsp[(2) - (2)].objectPtr);
8381 if ((yyval.objectPtr)) {
8382 thisParserPtr->parentNodePtr = (yyvsp[(2) - (2)].objectPtr)->nodePtr;
8384 thisParserPtr->parentNodePtr = NULL;
8390 #line 5957 "parser-smi.y"
8392 (yyval.objectPtr) = (yyvsp[(1) - (1)].objectPtr);
8397 #line 5962 "parser-smi.y"
8399 (yyval.objectPtr) = (yyvsp[(2) - (2)].objectPtr);
8404 #line 5970 "parser-smi.y"
8409 if (thisParserPtr->parentNodePtr != smiHandle->rootNodePtr) {
8410 smiPrintError(thisParserPtr,
8411 ERR_OIDLABEL_NOT_FIRST, (yyvsp[(1) - (1)].id));
8413 objectPtr = findObjectByModuleAndName(
8414 thisParserPtr->modulePtr, (yyvsp[(1) - (1)].id));
8416 (yyval.objectPtr) = objectPtr;
8417 smiFree((yyvsp[(1) - (1)].id));
8419 importPtr = findImportByName((yyvsp[(1) - (1)].id),
8422 (importPtr->kind == KIND_NOTFOUND)) {
8424 * If we are in a MODULE-COMPLIANCE
8425 * statement with a given MODULE...
8427 if (thisParserPtr->complianceModulePtr) {
8429 findObjectByModuleAndName(
8430 thisParserPtr->complianceModulePtr, (yyvsp[(1) - (1)].id));
8432 importPtr = addImport(
8433 (yyvsp[(1) - (1)].id),
8435 setImportModulename(importPtr,
8436 thisParserPtr->complianceModulePtr->export.name);
8437 addImportFlags(importPtr,
8441 objectPtr = addObject((yyvsp[(1) - (1)].id),
8442 thisParserPtr->pendingNodePtr, 0,
8445 smiPrintError(thisParserPtr,
8446 ERR_IDENTIFIER_NOT_IN_MODULE, (yyvsp[(1) - (1)].id),
8447 thisParserPtr->complianceModulePtr->export.name);
8449 } else if (thisParserPtr->capabilitiesModulePtr) {
8451 findObjectByModuleAndName(
8452 thisParserPtr->capabilitiesModulePtr, (yyvsp[(1) - (1)].id));
8454 importPtr = addImport(
8455 (yyvsp[(1) - (1)].id),
8457 setImportModulename(importPtr,
8458 thisParserPtr->capabilitiesModulePtr->
8460 addImportFlags(importPtr,
8464 objectPtr = addObject((yyvsp[(1) - (1)].id),
8465 thisParserPtr->pendingNodePtr, 0,
8468 smiPrintError(thisParserPtr,
8469 ERR_IDENTIFIER_NOT_IN_MODULE, (yyvsp[(1) - (1)].id),
8470 thisParserPtr->capabilitiesModulePtr->export.name);
8474 * forward referenced node.
8476 * marked with FLAG_INCOMPLETE.
8478 objectPtr = addObject((yyvsp[(1) - (1)].id),
8479 thisParserPtr->pendingNodePtr,
8484 (yyval.objectPtr) = objectPtr;
8490 (yyval.objectPtr) = findObjectByModulenameAndName(
8491 importPtr->export.module, (yyvsp[(1) - (1)].id));
8492 smiFree((yyvsp[(1) - (1)].id));
8495 if ((yyval.objectPtr))
8496 thisParserPtr->parentNodePtr = (yyval.objectPtr)->nodePtr;
8501 #line 6064 "parser-smi.y"
8507 if (thisParserPtr->parentNodePtr != smiHandle->rootNodePtr) {
8508 md = smiMalloc(sizeof(char) *
8509 (strlen((yyvsp[(1) - (3)].id)) + strlen((yyvsp[(3) - (3)].id)) + 2));
8510 sprintf(md, "%s.%s", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
8511 smiPrintError(thisParserPtr,
8512 ERR_OIDLABEL_NOT_FIRST, md);
8515 objectPtr = findObjectByModulenameAndName(
8516 (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
8518 (yyval.objectPtr) = objectPtr;
8519 smiFree((yyvsp[(1) - (3)].id));
8520 smiFree((yyvsp[(3) - (3)].id));
8522 importPtr = findImportByModulenameAndName(
8523 (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id), thisModulePtr);
8525 (importPtr->kind == KIND_NOTFOUND)) {
8526 /* TODO: check: $1 == thisModule ? */
8528 * If we are in a MODULE-COMPLIANCE
8529 * statement with a given MODULE...
8531 if (thisParserPtr->complianceModulePtr) {
8533 findObjectByModuleAndName(
8534 thisParserPtr->complianceModulePtr, (yyvsp[(1) - (3)].id));
8536 importPtr = addImport(
8537 (yyvsp[(1) - (3)].id),
8539 setImportModulename(importPtr,
8540 thisParserPtr->complianceModulePtr->export.name);
8541 addImportFlags(importPtr,
8545 objectPtr = addObject((yyvsp[(1) - (3)].id),
8546 thisParserPtr->pendingNodePtr, 0,
8549 smiPrintError(thisParserPtr,
8550 ERR_IDENTIFIER_NOT_IN_MODULE, (yyvsp[(1) - (3)].id),
8551 thisParserPtr->complianceModulePtr->export.name);
8553 } else if (thisParserPtr->capabilitiesModulePtr) {
8555 findObjectByModuleAndName(
8556 thisParserPtr->capabilitiesModulePtr, (yyvsp[(1) - (3)].id));
8558 importPtr = addImport(
8559 (yyvsp[(1) - (3)].id),
8561 setImportModulename(importPtr,
8562 thisParserPtr->capabilitiesModulePtr->
8564 addImportFlags(importPtr,
8568 objectPtr = addObject((yyvsp[(1) - (3)].id),
8569 thisParserPtr->pendingNodePtr, 0,
8572 smiPrintError(thisParserPtr,
8573 ERR_IDENTIFIER_NOT_IN_MODULE, (yyvsp[(1) - (3)].id),
8574 thisParserPtr->capabilitiesModulePtr->export.name);
8578 * forward referenced node.
8580 * marked with FLAG_INCOMPLETE.
8582 objectPtr = addObject((yyvsp[(3) - (3)].id),
8583 thisParserPtr->pendingNodePtr,
8587 smiFree((yyvsp[(1) - (3)].id));
8589 (yyval.objectPtr) = objectPtr;
8595 (yyval.objectPtr) = findObjectByModulenameAndName(
8596 importPtr->export.module, (yyvsp[(3) - (3)].id));
8597 smiFree((yyvsp[(1) - (3)].id));
8598 smiFree((yyvsp[(3) - (3)].id));
8601 if ((yyval.objectPtr))
8602 thisParserPtr->parentNodePtr = (yyval.objectPtr)->nodePtr;
8608 #line 6168 "parser-smi.y"
8613 nodePtr = findNodeByParentAndSubid(thisParserPtr->parentNodePtr,
8614 (yyvsp[(1) - (1)].unsigned32));
8615 if (nodePtr && nodePtr->lastObjectPtr &&
8616 (nodePtr->lastObjectPtr->modulePtr == thisModulePtr)) {
8618 * hopefully, the last defined Object for
8619 * this Node is the one we expect.
8621 (yyval.objectPtr) = nodePtr->lastObjectPtr;
8623 objectPtr = addObject(NULL,
8624 thisParserPtr->parentNodePtr,
8625 (yyvsp[(1) - (1)].unsigned32),
8628 (yyval.objectPtr) = objectPtr;
8630 thisParserPtr->parentNodePtr = (yyval.objectPtr)->nodePtr;
8635 #line 6192 "parser-smi.y"
8637 Object *objectPtr = NULL;
8638 Object *oldObjectPtr = NULL;
8639 Node *oldNodePtr = NULL;
8641 /* TODO: search in local module and
8642 * in imported modules
8645 oldNodePtr = findNodeByParentAndSubid(
8646 thisParserPtr->parentNodePtr, (yyvsp[(3) - (4)].unsigned32));
8647 oldObjectPtr = findObjectByModuleAndName(
8648 thisParserPtr->modulePtr, (yyvsp[(1) - (4)].id));
8651 ((oldObjectPtr->nodePtr->subid != (yyvsp[(3) - (4)].unsigned32)) ||
8652 (oldObjectPtr->nodePtr->parentPtr != thisParserPtr->parentNodePtr))) {
8653 smiPrintError(thisParserPtr,
8654 ERR_IDENTIFIER_OID_CHANGED,
8655 (yyvsp[(1) - (4)].id));
8656 smiPrintErrorAtLine(thisParserPtr,
8657 ERR_PREVIOUS_DEFINITION,
8659 oldObjectPtr->export.name);
8660 objectPtr = addObject((yyvsp[(1) - (4)].id),
8661 thisParserPtr->parentNodePtr,
8662 (yyvsp[(3) - (4)].unsigned32), 0, thisParserPtr);
8663 setObjectDecl(objectPtr,
8664 SMI_DECL_IMPL_OBJECT);
8665 (yyval.objectPtr) = objectPtr;
8666 thisParserPtr->parentNodePtr = (yyval.objectPtr)->nodePtr;
8667 } else if (oldNodePtr &&
8668 oldNodePtr->lastObjectPtr &&
8669 oldNodePtr->lastObjectPtr->export.name &&
8670 strcmp(oldNodePtr->lastObjectPtr->export.name, (yyvsp[(1) - (4)].id))) {
8671 smiPrintError(thisParserPtr,
8672 ERR_OIDLABEL_CHANGED,
8673 (yyvsp[(1) - (4)].id), oldNodePtr->lastObjectPtr->export.name);
8674 smiPrintErrorAtLine(thisParserPtr,
8675 ERR_PREVIOUS_DEFINITION,
8676 oldNodePtr->lastObjectPtr->line,
8677 oldNodePtr->lastObjectPtr->export.name);
8678 objectPtr = addObject((yyvsp[(1) - (4)].id),
8679 thisParserPtr->parentNodePtr,
8680 (yyvsp[(3) - (4)].unsigned32), 0, thisParserPtr);
8681 setObjectDecl(objectPtr,
8682 SMI_DECL_IMPL_OBJECT);
8683 (yyval.objectPtr) = objectPtr;
8684 thisParserPtr->parentNodePtr = (yyval.objectPtr)->nodePtr;
8686 objectPtr = addObject((yyvsp[(1) - (4)].id), thisParserPtr->parentNodePtr,
8687 (yyvsp[(3) - (4)].unsigned32), 0,
8689 setObjectDecl(objectPtr,
8690 SMI_DECL_IMPL_OBJECT);
8691 (yyval.objectPtr) = objectPtr;
8692 thisParserPtr->parentNodePtr = (yyval.objectPtr)->nodePtr;
8698 #line 6252 "parser-smi.y"
8700 Object *objectPtr = NULL;
8701 Object *oldObjectPtr = NULL;
8702 Node *oldNodePtr = NULL;
8705 md = smiMalloc(sizeof(char) *
8706 (strlen((yyvsp[(1) - (6)].id)) + strlen((yyvsp[(3) - (6)].id)) + 2));
8707 sprintf(md, "%s.%s", (yyvsp[(1) - (6)].id), (yyvsp[(3) - (6)].id));
8709 oldNodePtr = findNodeByParentAndSubid(
8710 thisParserPtr->parentNodePtr, (yyvsp[(5) - (6)].unsigned32));
8711 oldObjectPtr = findObjectByModulenameAndName(
8712 (yyvsp[(1) - (6)].id), (yyvsp[(3) - (6)].id));
8715 ((oldObjectPtr->nodePtr->subid != (yyvsp[(5) - (6)].unsigned32)) ||
8716 (oldObjectPtr->nodePtr->parentPtr != thisParserPtr->parentNodePtr))) {
8717 smiPrintError(thisParserPtr,
8718 ERR_ILLEGALLY_QUALIFIED, md);
8719 smiPrintError(thisParserPtr,
8720 ERR_IDENTIFIER_OID_CHANGED,
8721 (yyvsp[(3) - (6)].id));
8722 smiPrintErrorAtLine(thisParserPtr,
8723 ERR_PREVIOUS_DEFINITION,
8725 oldObjectPtr->export.name);
8726 objectPtr = addObject((yyvsp[(3) - (6)].id),
8727 thisParserPtr->parentNodePtr,
8728 (yyvsp[(5) - (6)].unsigned32), 0, thisParserPtr);
8729 setObjectDecl(objectPtr,
8730 SMI_DECL_IMPL_OBJECT);
8731 (yyval.objectPtr) = objectPtr;
8732 thisParserPtr->parentNodePtr = (yyval.objectPtr)->nodePtr;
8733 } else if (oldNodePtr &&
8734 oldNodePtr->lastObjectPtr &&
8735 strcmp(oldNodePtr->lastObjectPtr->export.name, (yyvsp[(3) - (6)].id))) {
8736 smiPrintError(thisParserPtr,
8737 ERR_ILLEGALLY_QUALIFIED, md);
8738 smiPrintError(thisParserPtr,
8739 ERR_OIDLABEL_CHANGED,
8740 (yyvsp[(3) - (6)].id), oldNodePtr->lastObjectPtr->export.name);
8741 smiPrintErrorAtLine(thisParserPtr,
8742 ERR_PREVIOUS_DEFINITION,
8743 oldNodePtr->lastObjectPtr->line,
8744 oldNodePtr->lastObjectPtr->export.name);
8745 objectPtr = addObject((yyvsp[(3) - (6)].id),
8746 thisParserPtr->parentNodePtr,
8747 (yyvsp[(5) - (6)].unsigned32), 0, thisParserPtr);
8748 setObjectDecl(objectPtr,
8749 SMI_DECL_IMPL_OBJECT);
8750 (yyval.objectPtr) = objectPtr;
8751 thisParserPtr->parentNodePtr = (yyval.objectPtr)->nodePtr;
8753 smiPrintError(thisParserPtr,
8754 ERR_ILLEGALLY_QUALIFIED, md);
8755 objectPtr = addObject((yyvsp[(3) - (6)].id), thisParserPtr->parentNodePtr,
8756 (yyvsp[(5) - (6)].unsigned32), 0,
8758 setObjectDecl(objectPtr,
8759 SMI_DECL_IMPL_OBJECT);
8760 (yyval.objectPtr) = objectPtr;
8761 thisParserPtr->parentNodePtr = (yyval.objectPtr)->nodePtr;
8768 #line 6321 "parser-smi.y"
8769 { (yyval.text) = NULL; ;}
8773 #line 6325 "parser-smi.y"
8774 { (yyval.err) = 0; ;}
8778 #line 6327 "parser-smi.y"
8779 { (yyval.err) = 0; ;}
8783 #line 6331 "parser-smi.y"
8784 { (yyval.err) = 0; ;}
8788 #line 6333 "parser-smi.y"
8789 { (yyval.err) = 0; ;}
8793 #line 6337 "parser-smi.y"
8795 thisParserPtr->firstStatementLine = thisParserPtr->line;
8796 thisParserPtr->currentDecl = SMI_DECL_OBJECTGROUP;
8798 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
8799 ERR_OIDNAME_32, ERR_OIDNAME_64);
8800 smiCheckObjectName(thisParserPtr,
8801 thisModulePtr, (yyvsp[(1) - (1)].id));
8806 #line 6347 "parser-smi.y"
8810 if (thisModulePtr->export.language == SMI_LANGUAGE_UNKNOWN)
8811 thisModulePtr->export.language = SMI_LANGUAGE_SMIV2;
8813 importPtr = findImportByName("OBJECT-GROUP",
8818 smiPrintError(thisParserPtr,
8819 ERR_MACRO_NOT_IMPORTED,
8820 "OBJECT-GROUP", "SNMPv2-CONF");
8826 #line 6366 "parser-smi.y"
8828 checkDescr(thisParserPtr, (yyvsp[(9) - (9)].text));
8833 #line 6371 "parser-smi.y"
8837 objectPtr = (yyvsp[(14) - (15)].objectPtr);
8839 smiCheckObjectReuse(thisParserPtr, (yyvsp[(1) - (15)].id), &objectPtr);
8841 objectPtr = setObjectName(objectPtr, (yyvsp[(1) - (15)].id), thisParserPtr);
8842 setObjectDecl(objectPtr, SMI_DECL_OBJECTGROUP);
8843 setObjectLine(objectPtr, thisParserPtr->firstStatementLine,
8845 addObjectFlags(objectPtr, FLAG_REGISTERED);
8846 deleteObjectFlags(objectPtr, FLAG_INCOMPLETE);
8847 setObjectStatus(objectPtr, (yyvsp[(7) - (15)].status));
8848 setObjectDescription(objectPtr, (yyvsp[(9) - (15)].text), thisParserPtr);
8849 if ((yyvsp[(11) - (15)].text)) {
8850 setObjectReference(objectPtr, (yyvsp[(11) - (15)].text), thisParserPtr);
8852 setObjectAccess(objectPtr,
8853 SMI_ACCESS_NOT_ACCESSIBLE);
8854 setObjectList(objectPtr, (yyvsp[(5) - (15)].listPtr));
8860 #line 6397 "parser-smi.y"
8862 thisParserPtr->firstStatementLine = thisParserPtr->line;
8863 thisParserPtr->currentDecl = SMI_DECL_NOTIFICATIONGROUP;
8865 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
8866 ERR_OIDNAME_32, ERR_OIDNAME_64);
8867 smiCheckObjectName(thisParserPtr,
8868 thisModulePtr, (yyvsp[(1) - (1)].id));
8873 #line 6407 "parser-smi.y"
8876 if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI)
8877 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "NOTIFICATION-GROUP");
8879 if (thisModulePtr->export.language == SMI_LANGUAGE_UNKNOWN)
8880 thisModulePtr->export.language = SMI_LANGUAGE_SMIV2;
8882 importPtr = findImportByName("NOTIFICATION-GROUP",
8887 smiPrintError(thisParserPtr,
8888 ERR_MACRO_NOT_IMPORTED,
8889 "NOTIFICATION-GROUP",
8896 #line 6429 "parser-smi.y"
8898 checkDescr(thisParserPtr, (yyvsp[(9) - (9)].text));
8903 #line 6434 "parser-smi.y"
8907 objectPtr = (yyvsp[(14) - (15)].objectPtr);
8909 smiCheckObjectReuse(thisParserPtr, (yyvsp[(1) - (15)].id), &objectPtr);
8911 objectPtr = setObjectName(objectPtr, (yyvsp[(1) - (15)].id), thisParserPtr);
8912 setObjectDecl(objectPtr,
8913 SMI_DECL_NOTIFICATIONGROUP);
8914 setObjectLine(objectPtr, thisParserPtr->firstStatementLine,
8916 addObjectFlags(objectPtr, FLAG_REGISTERED);
8917 deleteObjectFlags(objectPtr, FLAG_INCOMPLETE);
8918 setObjectStatus(objectPtr, (yyvsp[(7) - (15)].status));
8919 setObjectDescription(objectPtr, (yyvsp[(9) - (15)].text), thisParserPtr);
8920 if ((yyvsp[(11) - (15)].text)) {
8921 setObjectReference(objectPtr, (yyvsp[(11) - (15)].text), thisParserPtr);
8923 setObjectAccess(objectPtr,
8924 SMI_ACCESS_NOT_ACCESSIBLE);
8925 setObjectList(objectPtr, (yyvsp[(5) - (15)].listPtr));
8931 #line 6461 "parser-smi.y"
8933 thisParserPtr->firstStatementLine = thisParserPtr->line;
8934 thisParserPtr->currentDecl = SMI_DECL_MODULECOMPLIANCE;
8936 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
8937 ERR_OIDNAME_32, ERR_OIDNAME_64);
8938 smiCheckObjectName(thisParserPtr,
8939 thisModulePtr, (yyvsp[(1) - (1)].id));
8944 #line 6471 "parser-smi.y"
8948 if (thisModulePtr->export.language == SMI_LANGUAGE_UNKNOWN)
8949 thisModulePtr->export.language = SMI_LANGUAGE_SMIV2;
8950 importPtr = findImportByName("MODULE-COMPLIANCE",
8955 smiPrintError(thisParserPtr,
8956 ERR_MACRO_NOT_IMPORTED,
8957 "MODULE-COMPLIANCE",
8964 #line 6489 "parser-smi.y"
8966 checkDescr(thisParserPtr, (yyvsp[(8) - (8)].text));
8971 #line 6495 "parser-smi.y"
8975 Refinement *refinementPtr;
8978 objectPtr = (yyvsp[(14) - (15)].objectPtr);
8980 smiCheckObjectReuse(thisParserPtr, (yyvsp[(1) - (15)].id), &objectPtr);
8982 setObjectName(objectPtr, (yyvsp[(1) - (15)].id), thisParserPtr);
8983 setObjectDecl(objectPtr,
8984 SMI_DECL_MODULECOMPLIANCE);
8985 setObjectLine(objectPtr, thisParserPtr->firstStatementLine,
8987 addObjectFlags(objectPtr, FLAG_REGISTERED);
8988 deleteObjectFlags(objectPtr, FLAG_INCOMPLETE);
8989 setObjectStatus(objectPtr, (yyvsp[(6) - (15)].status));
8990 setObjectDescription(objectPtr, (yyvsp[(8) - (15)].text), thisParserPtr);
8991 if ((yyvsp[(10) - (15)].text)) {
8992 setObjectReference(objectPtr, (yyvsp[(10) - (15)].text), thisParserPtr);
8994 setObjectAccess(objectPtr,
8995 SMI_ACCESS_NOT_ACCESSIBLE);
8996 setObjectList(objectPtr, (yyvsp[(11) - (15)].compl).mandatorylistPtr);
8997 objectPtr->optionlistPtr = (yyvsp[(11) - (15)].compl).optionlistPtr;
8998 objectPtr->refinementlistPtr =
8999 (yyvsp[(11) - (15)].compl).refinementlistPtr;
9001 if ((yyvsp[(11) - (15)].compl).optionlistPtr) {
9002 for (listPtr = (yyvsp[(11) - (15)].compl).optionlistPtr;
9004 listPtr = listPtr->nextPtr) {
9005 optionPtr = ((Option *)(listPtr->ptr));
9006 optionPtr->compliancePtr = objectPtr;
9011 * Dirty: Fake the types' names in the
9013 * ``<compliancename>+<objecttypename>+type''
9014 * ``<compliancename>+<objecttypename>+writetype''
9016 if ((yyvsp[(11) - (15)].compl).refinementlistPtr) {
9017 for (listPtr = (yyvsp[(11) - (15)].compl).refinementlistPtr;
9019 listPtr = listPtr->nextPtr) {
9021 ((Refinement *)(listPtr->ptr));
9022 refinementPtr->compliancePtr = objectPtr;
9031 #line 6554 "parser-smi.y"
9033 (yyval.compl) = (yyvsp[(1) - (1)].compl);
9038 #line 6560 "parser-smi.y"
9040 (yyval.compl) = (yyvsp[(1) - (1)].compl);
9045 #line 6564 "parser-smi.y"
9049 /* concatenate lists in $1 and $2 */
9050 if ((yyvsp[(1) - (2)].compl).mandatorylistPtr) {
9051 for (listPtr = (yyvsp[(1) - (2)].compl).mandatorylistPtr;
9053 listPtr = listPtr->nextPtr);
9054 listPtr->nextPtr = (yyvsp[(2) - (2)].compl).mandatorylistPtr;
9055 (yyval.compl).mandatorylistPtr = (yyvsp[(1) - (2)].compl).mandatorylistPtr;
9057 (yyval.compl).mandatorylistPtr = (yyvsp[(2) - (2)].compl).mandatorylistPtr;
9059 if ((yyvsp[(1) - (2)].compl).optionlistPtr) {
9060 for (listPtr = (yyvsp[(1) - (2)].compl).optionlistPtr;
9062 listPtr = listPtr->nextPtr);
9063 listPtr->nextPtr = (yyvsp[(2) - (2)].compl).optionlistPtr;
9064 (yyval.compl).optionlistPtr = (yyvsp[(1) - (2)].compl).optionlistPtr;
9066 (yyval.compl).optionlistPtr = (yyvsp[(2) - (2)].compl).optionlistPtr;
9068 if ((yyvsp[(1) - (2)].compl).refinementlistPtr) {
9069 for (listPtr = (yyvsp[(1) - (2)].compl).refinementlistPtr;
9071 listPtr = listPtr->nextPtr);
9072 listPtr->nextPtr = (yyvsp[(2) - (2)].compl).refinementlistPtr;
9073 (yyval.compl).refinementlistPtr = (yyvsp[(1) - (2)].compl).refinementlistPtr;
9075 (yyval.compl).refinementlistPtr = (yyvsp[(2) - (2)].compl).refinementlistPtr;
9081 #line 6599 "parser-smi.y"
9084 * Remember the module. SMIv2 is broken by
9085 * design to allow subsequent clauses to
9086 * refer identifiers that are not
9087 * imported. Although, SMIv2 does not
9088 * require, we will fake it by inserting
9089 * appropriate imports.
9091 if ((yyvsp[(2) - (2)].modulePtr) == thisModulePtr)
9092 thisParserPtr->complianceModulePtr = NULL;
9094 thisParserPtr->complianceModulePtr = (yyvsp[(2) - (2)].modulePtr);
9099 #line 6615 "parser-smi.y"
9101 (yyval.compl).mandatorylistPtr = (yyvsp[(4) - (5)].listPtr);
9102 (yyval.compl).optionlistPtr = (yyvsp[(5) - (5)].compl).optionlistPtr;
9103 (yyval.compl).refinementlistPtr = (yyvsp[(5) - (5)].compl).refinementlistPtr;
9104 if (thisParserPtr->complianceModulePtr) {
9105 checkImports(thisParserPtr->complianceModulePtr,
9107 thisParserPtr->complianceModulePtr = NULL;
9113 #line 6628 "parser-smi.y"
9115 (yyval.modulePtr) = findModuleByName((yyvsp[(1) - (2)].id));
9116 /* TODO: handle objectIdentifier */
9117 if (!(yyval.modulePtr)) {
9118 (yyval.modulePtr) = loadModule((yyvsp[(1) - (2)].id), thisParserPtr);
9120 smiFree((yyvsp[(1) - (2)].id));
9125 #line 6637 "parser-smi.y"
9127 (yyval.modulePtr) = findModuleByName((yyvsp[(1) - (1)].id));
9128 if (!(yyval.modulePtr)) {
9129 (yyval.modulePtr) = loadModule((yyvsp[(1) - (1)].id), thisParserPtr);
9131 smiFree((yyvsp[(1) - (1)].id));
9136 #line 6646 "parser-smi.y"
9138 (yyval.modulePtr) = thisModulePtr;
9143 #line 6652 "parser-smi.y"
9145 (yyval.listPtr) = (yyvsp[(3) - (4)].listPtr);
9150 #line 6656 "parser-smi.y"
9152 (yyval.listPtr) = NULL;
9157 #line 6662 "parser-smi.y"
9159 (yyval.listPtr) = smiMalloc(sizeof(List));
9160 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].objectPtr);
9161 (yyval.listPtr)->nextPtr = NULL;
9166 #line 6668 "parser-smi.y"
9170 p = smiMalloc(sizeof(List));
9171 p->ptr = (yyvsp[(3) - (3)].objectPtr);
9173 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr; pp = pp->nextPtr);
9175 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
9180 #line 6681 "parser-smi.y"
9182 /* TODO: check that objectIdentifier is
9183 found, is defined in thisParserPtr->complianceModulePtr,
9184 and is a group node. */
9187 (yyval.objectPtr) = (yyvsp[(1) - (1)].objectPtr);
9188 if (thisParserPtr->complianceModulePtr) {
9189 (yyval.objectPtr) = findObjectByModuleAndName(
9190 thisParserPtr->complianceModulePtr,
9191 (yyvsp[(1) - (1)].objectPtr)->export.name);
9193 if (thisParserPtr->complianceModulePtr && (yyvsp[(1) - (1)].objectPtr)->export.name) {
9194 importPtr = findImportByModulenameAndName(
9195 thisParserPtr->complianceModulePtr->export.name,
9196 (yyvsp[(1) - (1)].objectPtr)->export.name, thisModulePtr);
9204 #line 6704 "parser-smi.y"
9206 (yyval.compl).mandatorylistPtr = NULL;
9207 (yyval.compl).optionlistPtr = (yyvsp[(1) - (1)].compl).optionlistPtr;
9208 (yyval.compl).refinementlistPtr = (yyvsp[(1) - (1)].compl).refinementlistPtr;
9213 #line 6710 "parser-smi.y"
9215 (yyval.compl).mandatorylistPtr = NULL;
9216 (yyval.compl).optionlistPtr = NULL;
9217 (yyval.compl).refinementlistPtr = NULL;
9222 #line 6718 "parser-smi.y"
9224 (yyval.compl) = (yyvsp[(1) - (1)].compl);
9229 #line 6722 "parser-smi.y"
9234 (yyval.compl).mandatorylistPtr = NULL;
9236 /* check for duplicates in optionlist */
9238 if ((yyvsp[(2) - (2)].compl).optionlistPtr) {
9239 for (listPtr = (yyvsp[(1) - (2)].compl).optionlistPtr; listPtr;
9240 listPtr = listPtr->nextPtr) {
9241 if (((Option *)listPtr->ptr)->objectPtr ==
9242 ((Option *)(yyvsp[(2) - (2)].compl).optionlistPtr->ptr)->objectPtr) {
9243 smiPrintError(thisParserPtr,
9244 ERR_OPTIONALGROUP_ALREADY_EXISTS,
9245 ((Option *)(yyvsp[(2) - (2)].compl).optionlistPtr->ptr)->objectPtr->export.name);
9247 (yyval.compl).optionlistPtr = (yyvsp[(1) - (2)].compl).optionlistPtr;
9252 /* concatenate optionlists */
9253 if ((yyvsp[(1) - (2)].compl).optionlistPtr) {
9254 for (listPtr = (yyvsp[(1) - (2)].compl).optionlistPtr;
9256 listPtr = listPtr->nextPtr);
9258 listPtr->nextPtr = (yyvsp[(2) - (2)].compl).optionlistPtr;
9260 (yyval.compl).optionlistPtr = (yyvsp[(1) - (2)].compl).optionlistPtr;
9262 (yyval.compl).optionlistPtr = (yyvsp[(2) - (2)].compl).optionlistPtr;
9265 /* check for duplicates in refinementlist */
9267 if ((yyvsp[(2) - (2)].compl).refinementlistPtr) {
9268 for (listPtr = (yyvsp[(1) - (2)].compl).refinementlistPtr; listPtr;
9269 listPtr = listPtr->nextPtr) {
9270 if (((Refinement *)listPtr->ptr)->objectPtr ==
9271 ((Refinement *)(yyvsp[(2) - (2)].compl).refinementlistPtr->ptr)->objectPtr) {
9272 smiPrintError(thisParserPtr,
9273 ERR_REFINEMENT_ALREADY_EXISTS,
9274 ((Refinement *)(yyvsp[(2) - (2)].compl).refinementlistPtr->ptr)->objectPtr->export.name);
9276 (yyval.compl).refinementlistPtr = (yyvsp[(1) - (2)].compl).refinementlistPtr;
9281 /* concatenate refinementlists */
9282 if ((yyvsp[(1) - (2)].compl).refinementlistPtr) {
9283 for (listPtr = (yyvsp[(1) - (2)].compl).refinementlistPtr;
9285 listPtr = listPtr->nextPtr);
9287 listPtr->nextPtr = (yyvsp[(2) - (2)].compl).refinementlistPtr;
9289 (yyval.compl).refinementlistPtr = (yyvsp[(1) - (2)].compl).refinementlistPtr;
9291 (yyval.compl).refinementlistPtr = (yyvsp[(2) - (2)].compl).refinementlistPtr;
9297 #line 6789 "parser-smi.y"
9299 (yyval.compl).mandatorylistPtr = NULL;
9300 (yyval.compl).optionlistPtr = (yyvsp[(1) - (1)].listPtr);
9301 (yyval.compl).refinementlistPtr = NULL;
9306 #line 6795 "parser-smi.y"
9308 (yyval.compl).mandatorylistPtr = NULL;
9309 (yyval.compl).optionlistPtr = NULL;
9310 (yyval.compl).refinementlistPtr = (yyvsp[(1) - (1)].listPtr);
9315 #line 6803 "parser-smi.y"
9317 thisParserPtr->firstNestedStatementLine = thisParserPtr->line;
9322 #line 6808 "parser-smi.y"
9326 if (thisParserPtr->complianceModulePtr && (yyvsp[(3) - (5)].objectPtr)->export.name) {
9327 importPtr = findImportByModulenameAndName(
9328 thisParserPtr->complianceModulePtr->export.name,
9329 (yyvsp[(3) - (5)].objectPtr)->export.name,
9335 checkDescr(thisParserPtr, (yyvsp[(5) - (5)].text));
9337 (yyval.listPtr) = smiMalloc(sizeof(List));
9338 (yyval.listPtr)->nextPtr = NULL;
9339 (yyval.listPtr)->ptr = smiMalloc(sizeof(Option));
9340 ((Option *)((yyval.listPtr)->ptr))->line = thisParserPtr->firstNestedStatementLine;
9341 ((Option *)((yyval.listPtr)->ptr))->objectPtr = (yyvsp[(3) - (5)].objectPtr);
9342 if (! (thisModulePtr->flags & SMI_FLAG_NODESCR)) {
9343 ((Option *)((yyval.listPtr)->ptr))->export.description = (yyvsp[(5) - (5)].text);
9345 smiFree((yyvsp[(5) - (5)].text));
9351 #line 6836 "parser-smi.y"
9353 thisParserPtr->firstNestedStatementLine = thisParserPtr->line;
9358 #line 6844 "parser-smi.y"
9362 if (thisParserPtr->complianceModulePtr && (yyvsp[(3) - (8)].objectPtr)->export.name) {
9363 importPtr = findImportByModulenameAndName(
9364 thisParserPtr->complianceModulePtr->export.name,
9365 (yyvsp[(3) - (8)].objectPtr)->export.name,
9371 checkDescr(thisParserPtr, (yyvsp[(8) - (8)].text));
9373 thisParserPtr->flags &= ~FLAG_CREATABLE;
9374 (yyval.listPtr) = smiMalloc(sizeof(List));
9375 (yyval.listPtr)->nextPtr = NULL;
9376 (yyval.listPtr)->ptr = smiMalloc(sizeof(Refinement));
9377 ((Refinement *)((yyval.listPtr)->ptr))->line =
9378 thisParserPtr->firstNestedStatementLine;
9379 ((Refinement *)((yyval.listPtr)->ptr))->objectPtr = (yyvsp[(3) - (8)].objectPtr);
9380 ((Refinement *)((yyval.listPtr)->ptr))->typePtr = (yyvsp[(4) - (8)].typePtr);
9381 if ((yyvsp[(4) - (8)].typePtr)) {
9382 (yyvsp[(4) - (8)].typePtr)->parentPtr = (yyvsp[(3) - (8)].objectPtr)->typePtr;
9384 ((Refinement *)((yyval.listPtr)->ptr))->writetypePtr = (yyvsp[(5) - (8)].typePtr);
9385 if ((yyvsp[(5) - (8)].typePtr)) {
9386 (yyvsp[(5) - (8)].typePtr)->parentPtr = (yyvsp[(3) - (8)].objectPtr)->typePtr;
9388 ((Refinement *)((yyval.listPtr)->ptr))->export.access = (yyvsp[(6) - (8)].access);
9389 if (! (thisParserPtr->flags & SMI_FLAG_NODESCR)) {
9390 ((Refinement *)((yyval.listPtr)->ptr))->export.description = (yyvsp[(8) - (8)].text);
9392 smiFree((yyvsp[(8) - (8)].text));
9398 #line 6883 "parser-smi.y"
9400 if ((yyvsp[(2) - (2)].typePtr)->export.name) {
9401 (yyval.typePtr) = duplicateType((yyvsp[(2) - (2)].typePtr), 0, thisParserPtr);
9403 (yyval.typePtr) = (yyvsp[(2) - (2)].typePtr);
9409 #line 6891 "parser-smi.y"
9411 (yyval.typePtr) = NULL;
9416 #line 6897 "parser-smi.y"
9418 /* must not be present in PIBs */
9419 if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI)
9420 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "WRITE-SYNTAX");
9421 if ((yyvsp[(2) - (2)].typePtr)->export.name) {
9422 (yyval.typePtr) = duplicateType((yyvsp[(2) - (2)].typePtr), 0, thisParserPtr);
9424 (yyval.typePtr) = (yyvsp[(2) - (2)].typePtr);
9430 #line 6908 "parser-smi.y"
9432 (yyval.typePtr) = NULL;
9437 #line 6914 "parser-smi.y"
9439 (yyval.typePtr) = (yyvsp[(1) - (1)].typePtr);
9444 #line 6920 "parser-smi.y"
9446 if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI)
9447 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "MIN-ACCESS");
9448 (yyval.access) = (yyvsp[(2) - (2)].access);
9453 #line 6926 "parser-smi.y"
9455 if (thisParserPtr->modulePtr->export.language != SMI_LANGUAGE_SPPI)
9456 smiPrintError(thisParserPtr, ERR_SPPI_CONSTRUCT_IN_MIB, "PIB-MIN-ACCESS");
9457 if ((yyvsp[(2) - (2)].access) == SMI_ACCESS_REPORT_ONLY)
9458 smiPrintError(thisParserPtr, ERR_REPORT_ONLY_IN_PIB_MIN_ACCESS);
9459 (yyval.access) = (yyvsp[(2) - (2)].access);
9464 #line 6934 "parser-smi.y"
9466 (yyval.access) = SMI_ACCESS_UNKNOWN;
9471 #line 6940 "parser-smi.y"
9473 thisParserPtr->firstStatementLine = thisParserPtr->line;
9474 thisParserPtr->currentDecl = SMI_DECL_AGENTCAPABILITIES;
9476 checkNameLen(thisParserPtr, (yyvsp[(1) - (1)].id),
9477 ERR_OIDNAME_32, ERR_OIDNAME_64);
9478 smiCheckObjectName(thisParserPtr,
9479 thisModulePtr, (yyvsp[(1) - (1)].id));
9484 #line 6950 "parser-smi.y"
9487 if (thisParserPtr->modulePtr->export.language == SMI_LANGUAGE_SPPI)
9488 smiPrintError(thisParserPtr, ERR_SMI_CONSTRUCT_IN_PIB, "AGENT-CAAPABILITIES");
9490 if (thisModulePtr->export.language == SMI_LANGUAGE_UNKNOWN)
9491 thisModulePtr->export.language = SMI_LANGUAGE_SMIV2;
9493 importPtr = findImportByName("AGENT-CAPABILITIES",
9498 smiPrintError(thisParserPtr,
9499 ERR_MACRO_NOT_IMPORTED,
9500 "AGENT-CAPABILITIES",
9507 #line 6972 "parser-smi.y"
9509 checkDescr(thisParserPtr, (yyvsp[(10) - (10)].text));
9514 #line 6978 "parser-smi.y"
9518 objectPtr = (yyvsp[(16) - (17)].objectPtr);
9520 smiCheckObjectReuse(thisParserPtr, (yyvsp[(1) - (17)].id), &objectPtr);
9522 setObjectName(objectPtr, (yyvsp[(1) - (17)].id), thisParserPtr);
9523 setObjectDecl(objectPtr,
9524 SMI_DECL_AGENTCAPABILITIES);
9525 setObjectLine(objectPtr, thisParserPtr->firstStatementLine,
9527 addObjectFlags(objectPtr, FLAG_REGISTERED);
9528 deleteObjectFlags(objectPtr, FLAG_INCOMPLETE);
9529 setObjectStatus(objectPtr, (yyvsp[(8) - (17)].status));
9530 setObjectDescription(objectPtr, (yyvsp[(10) - (17)].text), thisParserPtr);
9531 if ((yyvsp[(12) - (17)].text)) {
9532 setObjectReference(objectPtr, (yyvsp[(12) - (17)].text), thisParserPtr);
9534 setObjectAccess(objectPtr,
9535 SMI_ACCESS_NOT_ACCESSIBLE);
9537 * TODO: PRODUCT_RELEASE Text
9538 * TODO: ModulePart_Capabilities
9545 #line 7008 "parser-smi.y"
9546 { (yyval.err) = 0; ;}
9550 #line 7010 "parser-smi.y"
9551 { (yyval.err) = 0; ;}
9555 #line 7014 "parser-smi.y"
9556 { (yyval.err) = 0; ;}
9560 #line 7016 "parser-smi.y"
9561 { (yyval.err) = 0; ;}
9565 #line 7020 "parser-smi.y"
9568 * Remember the module. SMIv2 is broken by
9569 * design to allow subsequent clauses to
9570 * refer identifiers that are not
9571 * imported. Although, SMIv2 does not
9572 * require, we will fake it by inserting
9573 * appropriate imports.
9575 if ((yyvsp[(2) - (2)].modulePtr) == thisModulePtr)
9576 thisParserPtr->capabilitiesModulePtr = NULL;
9578 thisParserPtr->capabilitiesModulePtr = (yyvsp[(2) - (2)].modulePtr);
9583 #line 7036 "parser-smi.y"
9585 if (thisParserPtr->capabilitiesModulePtr) {
9586 checkImports(thisParserPtr->capabilitiesModulePtr,
9588 thisParserPtr->capabilitiesModulePtr = NULL;
9595 #line 7047 "parser-smi.y"
9598 (yyval.listPtr) = smiMalloc(sizeof(List));
9599 (yyval.listPtr)->ptr = (yyvsp[(1) - (1)].listPtr);
9600 (yyval.listPtr)->nextPtr = NULL;
9602 (yyval.listPtr) = NULL;
9608 #line 7057 "parser-smi.y"
9613 p = smiMalloc(sizeof(List));
9614 p->ptr = (yyvsp[(3) - (3)].listPtr);
9616 for (pp = (yyvsp[(1) - (3)].listPtr); pp->nextPtr; pp = pp->nextPtr);
9618 (yyval.listPtr) = (yyvsp[(1) - (3)].listPtr);
9620 (yyval.listPtr) = NULL;
9626 #line 7074 "parser-smi.y"
9628 (yyval.listPtr) = NULL;
9633 #line 7080 "parser-smi.y"
9635 (yyval.modulePtr) = findModuleByName((yyvsp[(1) - (2)].id));
9636 /* TODO: handle objectIdentifier */
9637 if (!(yyval.modulePtr)) {
9638 (yyval.modulePtr) = loadModule((yyvsp[(1) - (2)].id), thisParserPtr);
9640 smiFree((yyvsp[(1) - (2)].id));
9645 #line 7089 "parser-smi.y"
9647 (yyval.modulePtr) = findModuleByName((yyvsp[(1) - (1)].id));
9648 if (!(yyval.modulePtr)) {
9649 (yyval.modulePtr) = loadModule((yyvsp[(1) - (1)].id), thisParserPtr);
9651 smiFree((yyvsp[(1) - (1)].id));
9656 #line 7099 "parser-smi.y"
9657 { (yyval.err) = 0; ;}
9661 #line 7101 "parser-smi.y"
9662 { (yyval.err) = 0; ;}
9666 #line 7105 "parser-smi.y"
9667 { (yyval.err) = 0; ;}
9671 #line 7107 "parser-smi.y"
9672 { (yyval.err) = 0; ;}
9676 #line 7111 "parser-smi.y"
9678 if ((yyvsp[(2) - (2)].objectPtr)) {
9679 variationkind = (yyvsp[(2) - (2)].objectPtr)->export.nodekind;
9681 variationkind = SMI_NODEKIND_UNKNOWN;
9687 #line 7119 "parser-smi.y"
9689 if (variationkind == SMI_NODEKIND_NOTIFICATION) {
9690 smiPrintError(thisParserPtr,
9691 ERR_NOTIFICATION_VARIATION_SYNTAX);
9697 #line 7126 "parser-smi.y"
9699 if (variationkind == SMI_NODEKIND_NOTIFICATION) {
9700 smiPrintError(thisParserPtr,
9701 ERR_NOTIFICATION_VARIATION_WRITESYNTAX);
9707 #line 7134 "parser-smi.y"
9709 if (variationkind == SMI_NODEKIND_NOTIFICATION) {
9710 smiPrintError(thisParserPtr,
9711 ERR_NOTIFICATION_VARIATION_CREATION);
9717 #line 7141 "parser-smi.y"
9719 if (variationkind == SMI_NODEKIND_NOTIFICATION) {
9720 smiPrintError(thisParserPtr,
9721 ERR_NOTIFICATION_VARIATION_DEFVAL);
9722 } else if ((yyvsp[(11) - (11)].valuePtr)) {
9723 adjustDefval(thisParserPtr,
9724 (yyvsp[(11) - (11)].valuePtr), (yyvsp[(2) - (11)].objectPtr)->typePtr,
9725 thisParserPtr->line);
9726 smiCheckValueType(thisParserPtr,
9727 (yyvsp[(11) - (11)].valuePtr), (yyvsp[(2) - (11)].objectPtr)->typePtr,
9728 thisParserPtr->line);
9734 #line 7155 "parser-smi.y"
9736 thisParserPtr->flags &= ~FLAG_CREATABLE;
9738 variationkind = SMI_NODEKIND_UNKNOWN;
9740 checkDescr(thisParserPtr, (yyvsp[(14) - (14)].text));
9745 #line 7165 "parser-smi.y"
9746 { (yyval.access) = (yyvsp[(2) - (2)].access); ;}
9750 #line 7167 "parser-smi.y"
9751 { (yyval.access) = 0; ;}
9755 #line 7171 "parser-smi.y"
9757 if (!strcmp((yyvsp[(1) - (1)].id), "not-implemented")) {
9758 (yyval.access) = SMI_ACCESS_NOT_IMPLEMENTED;
9759 } else if (!strcmp((yyvsp[(1) - (1)].id), "accessible-for-notify")) {
9760 if (variationkind ==
9761 SMI_NODEKIND_NOTIFICATION) {
9762 smiPrintError(thisParserPtr,
9763 ERR_INVALID_NOTIFICATION_VARIATION_ACCESS,
9764 (yyvsp[(1) - (1)].id));
9765 (yyval.access) = SMI_ACCESS_UNKNOWN;
9767 (yyval.access) = SMI_ACCESS_NOTIFY;
9769 } else if (!strcmp((yyvsp[(1) - (1)].id), "read-only")) {
9770 if (variationkind ==
9771 SMI_NODEKIND_NOTIFICATION) {
9772 smiPrintError(thisParserPtr,
9773 ERR_INVALID_NOTIFICATION_VARIATION_ACCESS,
9774 (yyvsp[(1) - (1)].id));
9775 (yyval.access) = SMI_ACCESS_UNKNOWN;
9777 (yyval.access) = SMI_ACCESS_READ_ONLY;
9779 } else if (!strcmp((yyvsp[(1) - (1)].id), "read-write")) {
9780 if (variationkind ==
9781 SMI_NODEKIND_NOTIFICATION) {
9782 smiPrintError(thisParserPtr,
9783 ERR_INVALID_NOTIFICATION_VARIATION_ACCESS,
9784 (yyvsp[(1) - (1)].id));
9785 (yyval.access) = SMI_ACCESS_UNKNOWN;
9787 (yyval.access) = SMI_ACCESS_READ_WRITE;
9789 } else if (!strcmp((yyvsp[(1) - (1)].id), "read-create")) {
9790 if (variationkind ==
9791 SMI_NODEKIND_NOTIFICATION) {
9792 smiPrintError(thisParserPtr,
9793 ERR_INVALID_NOTIFICATION_VARIATION_ACCESS,
9794 (yyvsp[(1) - (1)].id));
9795 (yyval.access) = SMI_ACCESS_UNKNOWN;
9797 (yyval.access) = SMI_ACCESS_READ_WRITE;
9799 } else if (!strcmp((yyvsp[(1) - (1)].id), "write-only")) {
9800 if (variationkind ==
9801 SMI_NODEKIND_NOTIFICATION) {
9802 smiPrintError(thisParserPtr,
9803 ERR_INVALID_NOTIFICATION_VARIATION_ACCESS,
9804 (yyvsp[(1) - (1)].id));
9805 (yyval.access) = SMI_ACCESS_UNKNOWN;
9807 (yyval.access) = SMI_ACCESS_READ_WRITE; /* TODO */
9808 smiPrintError(thisParserPtr,
9809 ERR_SMIV2_WRITE_ONLY);
9812 smiPrintError(thisParserPtr,
9813 ERR_INVALID_VARIATION_ACCESS,
9814 (yyvsp[(1) - (1)].id));
9815 (yyval.access) = SMI_ACCESS_UNKNOWN;
9821 #line 7236 "parser-smi.y"
9822 { (yyval.err) = 0; ;}
9826 #line 7238 "parser-smi.y"
9827 { (yyval.err) = 0; ;}
9831 #line 7242 "parser-smi.y"
9832 { (yyval.err) = 0; ;}
9836 #line 7244 "parser-smi.y"
9837 { (yyval.err) = 0; ;}
9841 #line 7248 "parser-smi.y"
9842 { (yyval.err) = 0; ;}
9846 /* Line 1267 of yacc.c. */
9847 #line 9848 "parser-smi.c"
9850 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
9854 YY_STACK_PRINT (yyss, yyssp);
9859 /* Now `shift' the result of the reduction. Determine what state
9860 that goes to, based on the state we popped back to and the rule
9861 number reduced by. */
9865 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
9866 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
9867 yystate = yytable[yystate];
9869 yystate = yydefgoto[yyn - YYNTOKENS];
9874 /*------------------------------------.
9875 | yyerrlab -- here on detecting error |
9876 `------------------------------------*/
9878 /* If not already recovering from an error, report this error. */
9882 #if ! YYERROR_VERBOSE
9883 yyerror (YY_("syntax error"));
9886 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
9887 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
9889 YYSIZE_T yyalloc = 2 * yysize;
9890 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
9891 yyalloc = YYSTACK_ALLOC_MAXIMUM;
9892 if (yymsg != yymsgbuf)
9893 YYSTACK_FREE (yymsg);
9894 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
9896 yymsg_alloc = yyalloc;
9900 yymsg_alloc = sizeof yymsgbuf;
9904 if (0 < yysize && yysize <= yymsg_alloc)
9906 (void) yysyntax_error (yymsg, yystate, yychar);
9911 yyerror (YY_("syntax error"));
9913 goto yyexhaustedlab;
9921 if (yyerrstatus == 3)
9923 /* If just tried and failed to reuse look-ahead token after an
9924 error, discard it. */
9926 if (yychar <= YYEOF)
9928 /* Return failure if at end of input. */
9929 if (yychar == YYEOF)
9934 yydestruct ("Error: discarding",
9940 /* Else will try to reuse look-ahead token after shifting the error
9945 /*---------------------------------------------------.
9946 | yyerrorlab -- error raised explicitly by YYERROR. |
9947 `---------------------------------------------------*/
9950 /* Pacify compilers like GCC when the user code never invokes
9951 YYERROR and the label yyerrorlab therefore never appears in user
9953 if (/*CONSTCOND*/ 0)
9956 /* Do not reclaim the symbols of the rule which action triggered
9960 YY_STACK_PRINT (yyss, yyssp);
9965 /*-------------------------------------------------------------.
9966 | yyerrlab1 -- common code for both syntax error and YYERROR. |
9967 `-------------------------------------------------------------*/
9969 yyerrstatus = 3; /* Each real token shifted decrements this. */
9973 yyn = yypact[yystate];
9974 if (yyn != YYPACT_NINF)
9977 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
9985 /* Pop the current state because it cannot handle the error token. */
9990 yydestruct ("Error: popping",
9991 yystos[yystate], yyvsp);
9994 YY_STACK_PRINT (yyss, yyssp);
10003 /* Shift the error token. */
10004 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
10010 /*-------------------------------------.
10011 | yyacceptlab -- YYACCEPT comes here. |
10012 `-------------------------------------*/
10017 /*-----------------------------------.
10018 | yyabortlab -- YYABORT comes here. |
10019 `-----------------------------------*/
10025 /*-------------------------------------------------.
10026 | yyexhaustedlab -- memory exhaustion comes here. |
10027 `-------------------------------------------------*/
10029 yyerror (YY_("memory exhausted"));
10031 /* Fall through. */
10035 if (yychar != YYEOF && yychar != YYEMPTY)
10036 yydestruct ("Cleanup: discarding lookahead",
10038 /* Do not reclaim the symbols of the rule which action triggered
10039 this YYABORT or YYACCEPT. */
10040 YYPOPSTACK (yylen);
10041 YY_STACK_PRINT (yyss, yyssp);
10042 while (yyssp != yyss)
10044 yydestruct ("Cleanup: popping",
10045 yystos[*yyssp], yyvsp);
10050 YYSTACK_FREE (yyss);
10052 #if YYERROR_VERBOSE
10053 if (yymsg != yymsgbuf)
10054 YYSTACK_FREE (yymsg);
10056 /* Make sure YYID is used. */
10057 return YYID (yyresult);
10061 #line 7251 "parser-smi.y"