⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 snaplex.c

📁 一个学习SNMP项目:tmoerlan.
💻 C
📖 第 1 页 / 共 5 页
字号:
      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  470,  467,  470,  470,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  470,  470,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  470,  470,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  470,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  470,  470,      470,  470,  467,  470,  470,  470,  470,  470,  470,  470,      470,  470,  470,  470,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  470,  470,  470,      470,  470,  470,  470,  470,  470,  470,  470,  470,  467,      467,  467,  467,  467,  470,  470,  470,  470,  467,  467,      467,  467,  470,  470,  470,  467,  467,  467,  467,  470,      470,  470,  467,  467,  470,  470,    0,  467,  467,  467    } ;static yyconst short int yy_nxt[1175] =    {   0,        4,    5,    5,    6,    7,    8,    9,   10,   11,   12,       13,   14,    4,   15,   16,   17,   18,   19,   20,   21,       22,   23,   24,   25,    4,   26,   27,   28,   29,   30,        4,   31,   32,   33,    4,    4,    4,    4,    4,    4,        4,    4,   34,   35,   36,   37,   38,   39,   40,   41,       42,   43,   44,   45,   46,   47,   48,   49,   44,   50,       51,   52,   44,   44,   44,   44,   44,   44,   53,   54,       54,   56,   58,   59,   60,   62,   63,   67,   72,   69,      113,   70,   73,   74,   77,   80,   75,   68,   81,   85,       71,   78,   83,   86,   97,   79,   76,   54,   54,   64,       58,  161,   84,   82,  114,   67,   72,   69,   57,   70,       73,   74,   77,   80,   75,   68,   81,   85,   71,   78,       83,   86,   97,   87,   76,   91,   94,  112,  114,   92,       84,   82,   88,  114,  114,   93,   95,   89,   90,  115,      114,   96,   98,  114,   99,  120,   56,   59,   60,  116,      456,   87,  114,   91,   94,  112,  100,   92,  269,  101,       88,  103,  102,   93,   95,   89,   90,  115,  127,   96,       98,  246,   99,  120,  456,  104,  107,  116,  114,  105,      106,  114,  114,   57,  100,  108,  117,  101,  118,  103,      102,  109,  110,  111,  114,  114,  127,  119,  132,  125,      130,  121,  122,  104,  107,  123,  126,  105,  106,  114,      131,  114,  114,  108,  117,  124,  118,  128,  114,  109,      110,  111,  133,  114,  114,  119,  132,  125,  130,  121,      122,  114,  129,  123,  126,   62,   63,  134,  131,  114,      163,  114,  145,  124,  165,  128,  135,  114,  114,  166,      133,  136,  137,  138,  142,  114,  160,  139,  167,   64,      129,  168,  114,  140,  143,  134,  169,  170,  163,  144,      145,  141,  165,  171,  135,   55,  114,  166,  172,  136,      137,  138,  142,  162,  160,  139,  167,  114,  114,  168,      151,  140,  143,  173,  169,  170,  174,  144,  114,  114,      146,  171,  147,  114,  152,  339,  172,  175,  153,  154,      176,  178,   55,  179,  148,   55,  180,  149,  151,  181,      150,  173,  182,  183,  174,  189,  187,   55,  146,  188,      147,   55,  152,   55,  190,  175,  153,  154,  176,  178,      184,  179,  148,  440,  180,  149,  191,  181,  150,  114,      182,  183,  185,  189,  187,  155,  186,  188,  192,  193,      194,  197,  190,  195,  156,  198,  199,  200,  184,  201,      157,  158,  159,  196,  191,  202,  205,  206,  203,  207,      185,  208,  211,  155,  186,  204,  192,  193,  194,  197,      209,  195,  156,  198,  199,  200,  210,  201,  157,  158,      159,  196,  212,  202,  205,  206,  203,  207,  214,  208,      211,  215,  216,  204,  114,  114,  213,  114,  209,  217,      218,  114,  114,  219,  210,  114,  114,  114,  114,  114,      212,  221,  226,  224,  114,  114,  214,  114,  114,  215,      216,  222,  114,  223,  213,  227,  114,  217,  218,  220,      225,  219,  228,  229,  114,  230,  232,  233,  231,  221,      226,  224,  114,  114,  272,  164,  114,  114,  114,  222,      240,  223,  241,  227,  114,  235,  114,  220,  225,  234,      228,  229,  114,  230,  232,  233,  231,  236,  243,  238,      114,  237,  239,  114,  114,  244,  114,  249,  240,  114,      241,  114,  114,  235,  242,  250,  245,  234,  114,  251,      114,  114,  252,  114,  114,  236,  243,  238,  247,  237,      239,  254,  114,  244,  257,  249,  114,  114,  248,  114,      253,  114,  242,  250,  245,  255,  259,  251,  114,  114,      252,  271,  256,  260,  261,  263,  247,  273,  258,  254,      262,  114,  257,  264,  114,  114,  248,  266,  253,  267,      114,  274,  268,  255,  259,  275,  276,  265,  277,  271,      256,  260,  261,  263,  278,  273,  258,  279,  262,  280,      281,  264,  282,  283,  284,  266,  288,  267,  289,  274,      268,  290,  285,  275,  276,  265,  277,  291,  286,  287,      292,  293,  278,  294,  295,  279,  296,  280,  281,  297,      282,  283,  284,  298,  288,  299,  289,  300,  301,  290,      285,  302,  303,  306,  304,  291,  286,  287,  292,  293,      307,  294,  295,  308,  296,  305,  309,  297,  310,  311,      312,  298,  313,  299,  314,  300,  301,  114,  114,  302,      303,  306,  304,  114,  114,  114,  114,  315,  307,  114,      114,  308,  114,  305,  309,  316,  310,  311,  312,  318,      313,  114,  314,  317,  114,  322,  319,  114,  320,  114,      114,  321,  114,  323,  114,  315,  114,  325,  330,  333,      331,  114,  114,  316,  114,  415,  359,  318,  324,  326,      114,  317,  332,  322,  319,  335,  320,  327,  336,  321,      337,  323,  334,  328,  329,  325,  330,  333,  331,  114,      114,  114,  114,  114,  114,  114,  324,  326,  114,  340,      332,  341,  114,  335,  344,  327,  336,  114,  337,  342,      334,  328,  329,  338,  346,  343,  114,  114,  345,  347,      114,  114,  349,  114,  114,  350,  114,  340,  352,  341,      348,  114,  344,  114,  355,  353,  358,  342,  360,  361,      354,  338,  346,  343,  357,  362,  345,  347,  351,  356,      349,  363,  364,  350,  365,  366,  352,  367,  348,  368,      371,  372,  355,  353,  358,  373,  360,  361,  354,  369,      374,  370,  357,  362,  375,  376,  351,  356,  377,  363,      364,  378,  365,  366,  379,  367,  380,  368,  371,  372,      381,  382,  383,  373,  384,  385,  386,  369,  374,  370,      114,  114,  375,  376,  114,  114,  377,  114,  114,  378,      114,  114,  379,  391,  380,  114,  394,  114,  381,  382,      383,  387,  384,  385,  386,  388,  389,  393,  390,  114,      114,  392,  395,  114,  396,  114,  397,  114,  114,  114,      114,  391,  114,  114,  394,  400,  114,  399,  402,  387,      114,  114,  398,  388,  389,  393,  390,  401,  404,  392,      395,  114,  396,  405,  397,  114,  416,  406,  114,  114,      114,  407,  114,  400,  410,  399,  402,  114,  408,  409,      398,  411,  413,  114,  417,  401,  404,  412,  418,  414,      419,  405,  420,  421,  416,  406,  422,  423,  424,  407,      425,  426,  410,  427,  114,  114,  408,  409,  114,  411,      413,  114,  417,  114,  428,  412,  418,  414,  419,  114,      420,  421,  114,  429,  422,  423,  424,  114,  425,  426,      114,  427,  430,  114,  434,  431,  114,  114,  441,  435,      114,  114,  428,  432,  442,  438,  443,  439,  433,  444,      114,  429,  446,  445,  114,  114,  450,  436,  440,  449,      430,  451,  434,  431,  452,  437,  441,  435,  114,  448,      447,  432,  442,  438,  443,  439,  433,  444,  114,  114,      446,  445,  453,  457,  450,  436,  458,  459,  114,  451,      454,  114,  452,  437,  463,  114,  455,  448,  447,  464,      460,  114,  114,  114,  114,  114,  461,  114,  114,  114,      453,  457,  114,  114,  458,  459,  462,  114,  454,  403,      114,  114,  463,  465,  455,  114,  114,  464,  460,  466,      114,  114,  114,  114,  461,  114,  359,   55,  114,  114,      114,  114,  114,  114,  462,  114,  114,  114,  114,  114,      114,  465,  114,  177,  270,  114,  114,  466,   55,  114,       55,   65,   65,   65,  177,   66,  164,   61,   61,  161,      114,   66,   61,  467,    3,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467    } ;static yyconst short int yy_chk[1175] =    {   0,        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,        1,    1,    1,    1,    1,    1,    1,    1,    1,    5,        5,    6,    7,   12,   12,   14,   14,   16,   18,   17,      470,   17,   19,   19,   20,   21,   19,   16,   22,   24,       17,   20,   23,   25,   29,   20,   19,   54,   54,   14,        7,  161,   23,   22,  466,   16,   18,   17,    6,   17,       19,   19,   20,   21,   19,   16,   22,   24,   17,   20,       23,   25,   29,   26,   19,   27,   28,   33,  465,   27,       23,   22,   26,  141,   34,   27,   28,   26,   26,   34,      460,   28,   30,   36,   30,   36,   55,   60,   60,   34,      456,   26,   39,   27,   28,   33,   30,   27,  161,   30,       26,   31,   30,   27,   28,   26,   26,   34,   39,   28,       30,  141,   30,   36,  449,   31,   32,   34,   42,   31,       31,   38,   35,   55,   30,   32,   35,   30,   35,   31,       30,   32,   32,   32,   41,   37,   39,   35,   42,   38,       41,   37,   37,   31,   32,   37,   38,   31,   31,  445,       41,   40,   43,   32,   35,   37,   35,   40,  437,   32,       32,   32,   43,   48,  435,   35,   42,   38,   41,   37,       37,   45,   40,   37,   38,   63,   63,   45,   41,   52,       58,   46,   48,   37,   67,   40,   45,  434,   47,   68,       43,   45,   45,   46,   47,  433,   52,   46,   69,   63,       40,   70,  246,   46,   47,   45,   71,   72,   58,   47,       48,   46,   67,   73,   45,   57,  432,   68,   74,   45,       45,   46,   47,   57,   52,   46,   69,  431,   50,   70,       50,   46,   47,   75,   71,   72,   76,   47,   49,  429,       49,   73,   49,  428,   50,  246,   74,   77,   50,   50,       78,   80,   57,   81,   49,   57,   81,   49,   50,   82,       49,   75,   83,   84,   76,   88,   87,   57,   49,   87,       49,   57,   50,   57,   89,   77,   50,   50,   78,   80,       85,   81,   49,  415,   81,   49,   90,   82,   49,   51,       83,   84,   85,   88,   87,   51,   85,   87,   91,   92,       93,   95,   89,   94,   51,   96,   97,   98,   85,  100,       51,   51,   51,   94,   90,  101,  103,  104,  102,  105,       85,  106,  108,   51,   85,  102,   91,   92,   93,   95,      107,   94,   51,   96,   97,   98,  107,  100,   51,   51,       51,   94,  109,  101,  103,  104,  102,  105,  110,  106,      108,  111,  112,  102,  115,  116,  109,  122,  107,  115,      116,  117,  118,  117,  107,  119,  124,  123,  120,  121,      109,  119,  124,  122,  127,  125,  110,  128,  130,  111,      112,  120,  126,  121,  109,  125,  129,  115,  116,  118,      123,  117,  126,  127,  135,  128,  129,  130,  128,  119,      124,  122,  131,  136,  164,  164,  132,  138,  414,  120,      135,  121,  136,  125,  134,  132,  143,  118,  123,  131,      126,  127,  412,  128,  129,  130,  128,  132,  138,  134,      139,  132,  134,  140,  137,  139,  144,  143,  135,  145,      136,  146,  411,  132,  137,  144,  140,  131,  410,  145,      142,  149,  146,  148,  151,  132,  138,  134,  142,  132,      134,  149,  150,  139,  151,  143,  152,  153,  142,  155,      148,  409,  137,  144,  140,  150,  153,  145,  154,  156,      146,  163,  150,  154,  155,  156,  142,  165,  152,  149,      155,  157,  151,  157,  158,  159,  142,  158,  148,  159,      160,  166,  160,  150,  153,  167,  170,  157,  171,  163,      150,  154,  155,  156,  172,  165,  152,  173,  155,  174,      176,  157,  178,  179,  180,  158,  182,  159,  184,  166,      160,  185,  180,  167,  170,  157,  171,  188,  180,  180,      189,  190,  172,  192,  193,  173,  194,  174,  176,  196,      178,  179,  180,  201,  182,  202,  184,  203,  204,  185,      180,  205,  206,  208,  207,  188,  180,  180,  189,  190,      209,  192,  193,  210,  194,  207,  211,  196,  212,  213,      214,  201,  215,  202,  216,  203,  204,  217,  408,  205,      206,  208,  207,  219,  223,  218,  222,  217,  209,  224,      226,  210,  228,  207,  211,  218,  212,  213,  214,  222,      215,  225,  216,  219,  229,  226,  223,  230,  224,  239,      236,  225,  233,  228,  235,  217,  243,  230,  233,  239,      235,  240,  241,  218,  231,  359,  359,  222,  229,  231,      244,  219,  236,  226,  223,  241,  224,  231,  243,  225,      244,  228,  240,  231,  231,  230,  233,  239,  235,  248,      407,  253,  245,  258,  254,  256,  229,  231,  257,  248,      236,  253,  255,  241,  256,  231,  243,  263,  244,  254,      240,  231,  231,  245,  258,  255,  260,  259,  257,  259,      261,  265,  260,  262,  266,  261,  267,  248,  263,  253,      259,  264,  256,  268,  266,  264,  271,  254,  275,  276,      265,  245,  258,  255,  268,  277,  257,  259,  262,  267,      260,  278,  280,  261,  282,  284,  263,  285,  259,  286,      289,  290,  266,  264,  271,  293,  275,  276,  265,  287,      294,  287,  268,  277,  296,  299,  262,  267,  300,  278,      280,  302,  282,  284,  303,  285,  304,  286,  289,  290,      305,  306,  308,  293,  309,  310,  311,  287,  294,  287,      317,  319,  296,  299,  320,  318,  300,  326,  322,  302,      324,  327,  303,  322,  304,  404,  327,  329,  305,  306,      308,  317,  309,  310,  311,  318,  319,  326,  320,  328,      332,  324,  328,  331,  329,  335,  329,  342,  338,  402,      336,  322,  401,  343,  327,  335,  400,  332,  338,  317,      399,  349,  331,  318,  319,  326,  320,  336,  342,  324,      328,  345,  329,  343,  329,  346,  360,  345,  347,  348,      353,  346,  351,  335,  349,  332,  338,  352,  347,  348,      331,  351,  353,  354,  362,  336,  342,  352,  363,  354,      365,  343,  366,  369,  360,  345,  370,  371,  377,  346,      378,  385,  349,  385,  387,  395,  347,  348,  394,  351,      353,  390,  362,  389,  387,  352,  363,  354,  365,  392,      366,  369,  393,  389,  370,  371,  377,  396,  378,  385,      397,  385,  390,  398,  397,  392,  405,  430,  418,  398,      406,  413,  387,  393,  424,  413,  426,  413,  396,  427,      436,  389,  436,  430,  438,  439,  442,  405,  440,  440,      390,  443,  397,  392,  444,  406,  418,  398,  447,  439,      438,  393,  424,  413,  426,  413,  396,  427,  446,  448,      436,  430,  446,  450,  442,  405,  451,  452,  453,  443,      447,  454,  444,  406,  458,  455,  448,  439,  438,  459,      453,  391,  461,  462,  388,  357,  454,  356,  355,  350,      446,  450,  344,  341,  451,  452,  455,  340,  447,  339,      337,  334,  458,  461,  448,  333,  330,  459,  453,  462,      325,  323,  321,  316,  454,  315,  272,  270,  252,  251,      250,  249,  247,  242,  455,  238,  237,  234,  232,  227,      221,  461,  220,  177,  162,  147,  133,  462,  468,  113,      468,  469,  469,  469,   79,   65,   62,   61,   59,   53,       44,   15,   13,    3,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467,  467,  467,  467,  467,  467,  467,      467,  467,  467,  467    } ;static yy_state_type yy_last_accepting_state;static char *yy_last_accepting_cpos;/* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */#define REJECT reject_used_but_not_detected#define yymore() yymore_used_but_not_detected#define YY_MORE_ADJ 0#define YY_RESTORE_YY_MORE_OFFSETchar *yytext;#line 1 "snaplex.l"#define INITIAL 0/* snap-1.0. Copyright (C) 2000 by Jonathan T. Moore and Michael Hicks. * * snaplex.l : lexer for SNAP assembly language * * $Id: snaplex.c,v 1.2 2003/09/17 11:26:10 tmoerlan Exp $ */#line 9 "snaplex.l"#include <assert.h>#include <ctype.h>#include <netinet/in.h>#include <stdio.h>#include <string.h>#include "../lib/bytecode.h"#include "../lib/io.h"#include "../lib/memalloc.h"#include "snapparse.h"int value_int;uint32 value_addr;buffer_t value_str;int value_exc;float32 value_float;int read_from_file = 1;char *lexbuf = NULL;int lexbuf_len = 0;int lexbuf_pos = 0;void conv_string(char *s,buffer_t *buf);int snap_yy_input(char *buf, int max_size) {  int i;  if (read_from_file) {		/* get chars from yyin FILE */    for (i=0; i < max_size; i++) {      int c = getc(yyin);                    if (c == EOF) {                  	if (i == 0) {	  return(YY_NULL);	}	break;                                } else {                          	buf[i] = c;                         }                                     }                                       return(i);			/* return number of chars read */  } else {			/* reading input from lexbuf string */    if (lexbuf_pos == lexbuf_len) {           return(YY_NULL);    } else {      for (i=0; i < max_size && i < (lexbuf_len - lexbuf_pos); i++) {	buf[i] = lexbuf[lexbuf_pos];	lexbuf_pos++;      }      return(i);		/* return number of chars read */    }  }}#define YY_INPUT(buf,result,max_size) \  { (result) = snap_yy_input((buf),(max_size)); }#line 840 "lex.yy.c"/* Macros after this point can all be overridden by user definitions in * section 1. */#ifndef YY_SKIP_YYWRAP#ifdef __cplusplusextern "C" int yywrap YY_PROTO(( void ));#elseextern int yywrap YY_PROTO(( void ));#endif#endif#ifndef YY_NO_UNPUTstatic void yyunput YY_PROTO(( int c, char *buf_ptr ));#endif#ifndef yytext_ptrstatic void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));#endif#ifdef YY_NEED_STRLENstatic int yy_flex_strlen YY_PROTO(( yyconst char * ));#endif#ifndef YY_NO_INPUT#ifdef __cplusplusstatic int yyinput YY_PROTO(( void ));#elsestatic int input YY_PROTO(( void ));#endif#endif#if YY_STACK_USEDstatic int yy_start_stack_ptr = 0;static int yy_start_stack_depth = 0;static int *yy_start_stack = 0;#ifndef YY_NO_PUSH_STATEstatic void yy_push_state YY_PROTO(( int new_state ));#endif#ifndef YY_NO_POP_STATEstatic void yy_pop_state YY_PROTO(( void ));#endif#ifndef YY_NO_TOP_STATEstatic int yy_top_state YY_PROTO(( void ));#endif#else#define YY_NO_PUSH_STATE 1#define YY_NO_POP_STATE 1#define YY_NO_TOP_STATE 1#endif#ifdef YY_MALLOC_DECLYY_MALLOC_DECL#else#if __STDC__#ifndef __cplusplus#include <stdlib.h>#endif#else/* Just try to get by without declaring the routines.  This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -