📄 smpar.c
字号:
}
/*
** current state has no shift on
** "error", pop stack
*/
#ifdef YYDEBUG
# define _POP_ "Error recovery pops state %d, uncovers state %d\n"
if ( yydebug )
(void)printf( _POP_, *yy_ps,
yy_ps[-1] );
# undef _POP_
#endif
yy_ps--;
yy_pv--;
}
/*
** there is no state on stack with "error" as
** a valid shift. give up.
*/
YYABORT;
case 3: /* no shift yet; eat a token */
#ifdef YYDEBUG
/*
** if debugging, look up token in list of
** pairs. 0 and negative shouldn't occur,
** but since timing doesn't matter when
** debugging, it doesn't hurt to leave the
** tests here.
*/
if ( yydebug )
{
register int yy_i;
(void)printf( "Error recovery discards " );
if ( yychar == 0 )
(void)printf( "token end-of-file\n" );
else if ( yychar < 0 )
(void)printf( "token -none-\n" );
else
{
for ( yy_i = 0;
yytoks[yy_i].t_val >= 0;
yy_i++ )
{
if ( yytoks[yy_i].t_val
== yychar )
{
break;
}
}
(void)printf( "token %s\n",
yytoks[yy_i].t_name );
}
}
#endif /* YYDEBUG */
if ( yychar == 0 ) /* reached EOF. quit */
YYABORT;
yychar = -1;
goto yy_newstate;
}
}/* end if ( yy_n == 0 ) */
/*
** reduction by production yy_n
** put stack tops, etc. so things right after switch
*/
#ifdef YYDEBUG
/*
** if debugging, print the string that is the user's
** specification of the reduction which is just about
** to be done.
*/
if ( yydebug )
(void)printf( "Reduce by (%d) \"%s\"\n",
yy_n, yyreds[ yy_n ] );
#endif
yytmp = yy_n; /* value to switch over */
yypvt = yy_pv; /* $vars top of value stack */
/*
** Look in goto table for next state
** Sorry about using yy_state here as temporary
** register variable, but why not, if it works...
** If yyr2[ yy_n ] doesn't have the low order bit
** set, then there is no action to be done for
** this reduction. So, no saving & unsaving of
** registers done. The only difference between the
** code just after the if and the body of the if is
** the goto yy_stack in the body. This way the test
** can be made before the choice of what to do is needed.
*/
{
/* length of production doubled with extra bit */
register int yy_len = yyr2[ yy_n ];
if ( !( yy_len & 01 ) )
{
yy_len >>= 1;
yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
*( yy_ps -= yy_len ) + 1;
if ( yy_state >= YYLAST ||
yychk[ yy_state =
yyact[ yy_state ] ] != -yy_n )
{
yy_state = yyact[ yypgo[ yy_n ] ];
}
goto yy_stack;
}
yy_len >>= 1;
yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
*( yy_ps -= yy_len ) + 1;
if ( yy_state >= YYLAST ||
yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
{
yy_state = yyact[ yypgo[ yy_n ] ];
}
}
/* save until reenter driver code */
yystate = yy_state;
yyps = yy_ps;
yypv = yy_pv;
}
/*
** code supplied by user is placed in this switch
*/
switch( yytmp )
{
case 1:
{
/* check to see if any modules defined - one should be */
if (cModUsed == 0)
yyerror("One or more MIB modules must be defined"); } break;
case 6:
{
yyerror("Start of MIB module or Compiler directives expected - item skipped"); } break;
case 68:
{
fNoStrSav = fNoStr;
fNoStr = FALSE; } break;
case 69:
{
fNoStr = fNoStrSav; } break;
case 70:
{
openInclude(yypvt[-0].strval.pStr); } break;
case 71:
{
yyerror("quoted file name expected for \"#include\" directive");
/* yyerrok; */} break;
case 72:
{
dirHelp(); } break;
case 73:
{
addMODalias(yypvt[-1].strval.pStr, yypvt[-0].strval.pStr); } break;
case 74:
{
yyerror("Module name and alias name expected for \"#aliasModule\" directive");
/* yyerrok; */} break;
case 75:
{
addSYMalias(yypvt[-2].strval.pStr, yypvt[-1].strval.pStr, yypvt[-0].strval.pStr); } break;
case 76:
{
yyerror("Module name, object name, and its alias name expected for \"#aliasSymbol\" directive");
/* yyerrok; */} break;
case 77:
{
pushOpt(); } break;
case 78:
{
popOpt(); } break;
case 79:
{
addOpt(yypvt[-0].strval.pStr); } break;
case 80:
{
yyerror("Quoted option string expected for \"#addOpt\" directive");
/* yyerrok;*/} break;
case 81:
{
removeOpt(yypvt[-0].strval.pStr); } break;
case 82:
{
yyerror("Quoted option string expected for \"#removeOpt\" directive");
/* yyerrok; */} break;
case 83:
{
printOpt(); } break;
case 84:
{
fixupImport(pMod); } break;
case 85:
{
moduleEnd:
/* check that IMPORTED items are referenced */
checkIMPs(pMod);
/* check that all OID items have forward reference removed */
checkOIDs(pMod);
/* check that all Sequence items have forward ref removed */
checkSEQs(pMod);
/* check that all textual conventions referenced */
checkTCs(pMod);
/* check that all vars in traps are defined */
checkTRs(pMod);
/* make all keywords undefined */
makeKWundef();
pMod = NULL; } break;
case 86:
{
fixupImport(pMod); } break;
case 87:
{
yyerror("Module must contain definitions - terminating");
YYABORT; } break;
case 88:
{
yyerror("Unrecognizable item in module - skipping to end");
yyerrok;
goto moduleEnd; } break;
case 89:
{
pMod = addMODname(yypvt[-4].strval.pStr); } break;
case 90:
{
yyerrok;
modHeaderErr:
yyerror("Syntax for module header is\n <moduleName> [<oidValue>] \"DEFINITIONS\" \"::=\" \"BEGIN\"");
pMod = addMODname(yypvt[-2].strval.pStr); } break;
case 91:
{
goto modHeaderErr; } break;
case 92:
{
goto modHeaderErr; } break;
case 93:
{
goto modHeaderErr; } break;
case 95:
{
yyerror("Must use \"::=\""); } break;
case 97:
{
finishMODid(); } break;
case 98:
{
yyerror("Syntax for <oidValue> is\n \"{\" { {<name>[\"(\"<number>\")\"]} | <number> }...\"}\"");
yyerrok; } break;
case 106:
{
yyerrok;
importsErr:
yyerror("Syntax for IMPORTS is\n \"IMPORTS\" {<itemList> \"FROM\" <moduleName>}... \";\""); } break;
case 107:
{
goto importsErr; } break;
case 110:
{
finishImport(pMod, yypvt[-0].strval.pStr); } break;
case 111:
{
yyerror("Missing semicolon at end of IMPORTs - terminating");
YYABORT; } break;
case 112:
{
yyerror("Problem with IMPORT item list, syntax is\n <item>[\",\" <item>]... \"FROM\" <moduleName>");
yyerrok;
finishImport(pMod, yypvt[-0].strval.pStr); } break;
case 113:
{
yyerror("Extra comma after module name");
finishImport(pMod, yypvt[-1].strval.pStr); } break;
case 125:
{
yyerror("Missing comma between imported items"); } break;
case 126:
{
newIMPI(pMod->ut.mod.pImodTL, yypvt[-0].strval.pStr); } break;
case 131:
{
yyerror("IMPORTS must be at the very start of a module - terminating");
YYABORT; } break;
case 138:
{
yyerror("Compiler directives not allowed in module definition - terminating");
YYABORT; } break;
case 139:
{
yyerror("Unrecognized definition type - item skipped"); } break;
case 202:
{
addSMIname(yypvt[-0].strval.pStr, pMod); } break;
case 203:
{
yyerror("Name of SMI item expected");
/* yyerrok; */ } break;
case 204:
{
addOIDname(yypvt[-7].strval.pStr, yypvt[-2].strval.pStr, yypvt[-1].numval.ul, pMod); } break;
case 205:
{
addOIDname(yypvt[-6].strval.pStr, NULL, yypvt[-1].numval.ul, pMod); } break;
case 206:
{
OIDerr:
yyerror("Syntax for OID is\n <oidName> \"OBJECT\" \"IDENTIFIER\" \"::=\" <oidValid>");
yyerrok; } break;
case 207:
{
goto OIDerr; } break;
case 208:
{
yyerror("Syntax for <oidValue> is\n { <OIDname> <number> } | <number>");
yyerrok; } break;
case 210:
{
yyerror("Must use \"::=\""); } break;
case 211:
{
if (yypvt[-13].symval.pSym != NULL)
finishOT(yypvt[-13].symval.pSym, &syn, (USHORT)(yypvt[-10].numval.ul), (USHORT)(yypvt[-9].numval.ul),
yypvt[-8].strval.pStr, yypvt[-7].strval.pStr, yypvt[-2].strval.pStr, yypvt[-1].numval.ul); } break;
case 212:
{
yyerror("Syntax for <oidValue> is <oidName> <number>");
yyerrok; } break;
case 213:
{
yyerror(
"Syntax is\n <objName> \"OBJECT-TYPE\" <syntax> <access> <status> <optDesc> <optRefer> <optIndex> <optDefval> \"::=\" <oidVal>");
yyerrok; } break;
case 215:
{
yyerror("Missing SYNTAX clause"); } break;
case 216:
{
yyerror("Problem with SYNTAX clause");
/* yyerrok
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -