📄 snaplex.c
字号:
YY_BREAKcase 57:YY_RULE_SETUP#line 158 "snaplex.l"return(T_FORWTO); YY_BREAKcase 58:YY_RULE_SETUP#line 159 "snaplex.l"return(T_DEMUXI); YY_BREAKcase 59:YY_RULE_SETUP#line 160 "snaplex.l"return(T_DEMUX); YY_BREAKcase 60:YY_RULE_SETUP#line 161 "snaplex.l"return(T_PRINT); YY_BREAKcase 61:YY_RULE_SETUP#line 162 "snaplex.l"return(T_PC); YY_BREAKcase 62:YY_RULE_SETUP#line 163 "snaplex.l"return(T_MKTUP); YY_BREAKcase 63:YY_RULE_SETUP#line 164 "snaplex.l"return(T_NTH); YY_BREAKcase 64:YY_RULE_SETUP#line 165 "snaplex.l"return(T_LEN); YY_BREAKcase 65:YY_RULE_SETUP#line 166 "snaplex.l"return(T_ISTUP); YY_BREAKcase 66:YY_RULE_SETUP#line 167 "snaplex.l"return(T_SVCV); YY_BREAKcase 67:YY_RULE_SETUP#line 168 "snaplex.l"return(T_CALLS); YY_BREAKcase 68:YY_RULE_SETUP#line 169 "snaplex.l"return(T_GEQ); YY_BREAKcase 69:YY_RULE_SETUP#line 170 "snaplex.l"return(T_GT); YY_BREAKcase 70:YY_RULE_SETUP#line 171 "snaplex.l"return(T_LEQ); YY_BREAKcase 71:YY_RULE_SETUP#line 172 "snaplex.l"return(T_LT); YY_BREAKcase 72:YY_RULE_SETUP#line 173 "snaplex.l"return(T_GEQI); YY_BREAKcase 73:YY_RULE_SETUP#line 174 "snaplex.l"return(T_GTI); YY_BREAKcase 74:YY_RULE_SETUP#line 175 "snaplex.l"return(T_LEQI); YY_BREAKcase 75:YY_RULE_SETUP#line 176 "snaplex.l"return(T_LTI); YY_BREAKcase 76:YY_RULE_SETUP#line 177 "snaplex.l"return(T_GETLD); YY_BREAKcase 77:YY_RULE_SETUP#line 178 "snaplex.l"return(T_SETXH); YY_BREAKcase 78:YY_RULE_SETUP#line 179 "snaplex.l"return(T_RAISEX); YY_BREAKcase 79:YY_RULE_SETUP#line 180 "snaplex.l"return(T_DATA); YY_BREAKcase 80:YY_RULE_SETUP#line 182 "snaplex.l"return(T_DSEND); YY_BREAKcase 81:YY_RULE_SETUP#line 183 "snaplex.l"return(T_DFORW); YY_BREAKcase 82:YY_RULE_SETUP#line 184 "snaplex.l"return(T_DFORWTO); YY_BREAKcase 83:YY_RULE_SETUP#line 186 "snaplex.l"return(T_STACKEMPTY); YY_BREAKcase 84:YY_RULE_SETUP#line 187 "snaplex.l"return(T_STACKCOUNT); YY_BREAKcase 85:YY_RULE_SETUP#line 189 "snaplex.l"return (T_PULLSTACK); YY_BREAKcase 86:YY_RULE_SETUP#line 191 "snaplex.l"return(T_MAIN); YY_BREAKcase 87:YY_RULE_SETUP#line 192 "snaplex.l"return(T_PLUS); YY_BREAKcase 88:YY_RULE_SETUP#line 193 "snaplex.l"return(T_MINUS); YY_BREAKcase 89:YY_RULE_SETUP#line 194 "snaplex.l"return(T_LPAREN); YY_BREAKcase 90:YY_RULE_SETUP#line 195 "snaplex.l"return(T_RPAREN); YY_BREAKcase 91:YY_RULE_SETUP#line 196 "snaplex.l"return(T_COMMA); YY_BREAKcase 92:YY_RULE_SETUP#line 198 "snaplex.l"{ char *s = yytext; char *s1; char *s2; char *s3; char *s4; uint32 value_addr_h; s1 = strsep(&s,"."); value_addr_h = (uint32)(atoi(s1) << 24); s2 = strsep(&s,"."); value_addr_h |= (uint32)(atoi(s2) << 16); s3 = strsep(&s,"."); value_addr_h |= (uint32)(atoi(s3) << 8); s4 = s; value_addr_h |= (uint32)(atoi(s4));#ifdef LARGE_ADDR value_addr = MAKE_UDP_ADDR(htonl(value_addr_h),0);#else value_addr = htonl(value_addr_h);#endif return(T_ADDRV); } YY_BREAKcase 93:YY_RULE_SETUP#line 219 "snaplex.l"{ char *s = yytext; char *s1; char *s2; char *s3; char *s4; char *s5; uint32 value_addr_h; s1 = strsep(&s,"."); value_addr_h = (uint32)(atoi(s1) << 24); s2 = strsep(&s,"."); value_addr_h |= (uint32)(atoi(s2) << 16); s3 = strsep(&s,"."); value_addr_h |= (uint32)(atoi(s3) << 8); s4 = strsep(&s,":"); value_addr_h |= (uint32)(atoi(s4));#ifndef LARGE_ADDR fprintf(stderr,"Warning: truncating port of large addr\n"); value_addr = htonl(value_addr_h);#else s5 = s; value_addr = MAKE_UDP_ADDR(htonl(value_addr_h), htons((short)atoi(s)));#endif return(T_ADDRV); } YY_BREAKcase 94:YY_RULE_SETUP#line 244 "snaplex.l"{ int sizeb; sscanf(yytext,"|%d|",&sizeb); memalloc(value_str.s,char *,sizeb); value_str.lenb = sizeb; value_str.s[sizeb-1] = (char)0xff; return(T_STRV); } YY_BREAKcase 95:YY_RULE_SETUP#line 251 "snaplex.l"{ value_int = atoi(yytext); return(T_INTV); } YY_BREAKcase 96:YY_RULE_SETUP#line 254 "snaplex.l"{ int ntok; ntok = sscanf(yytext,"%f",&value_float); if (ntok != 1) { fprintf(stderr, "%s:%d: failure to parse float literal %s\n", __FILE__,__LINE__,yytext); exit(1); } return(T_FLOATV); } YY_BREAKcase 97:YY_RULE_SETUP#line 264 "snaplex.l"{ int len = strlen(yytext); char c = yytext[len-1]; yytext[len-1] = '\0';#ifdef LARGE_ADDR value_addr = MAKE_UDP_ADDR(atoi(yytext),0);#else value_addr = atoi(yytext);#endif yytext[len-1] = c; return(T_ADDRV); } YY_BREAKcase 98:YY_RULE_SETUP#line 275 "snaplex.l"{ conv_string(yytext,&value_str); return(T_STRV); } YY_BREAKcase 99:YY_RULE_SETUP#line 278 "snaplex.l"{ value_exc = atoi(&yytext[2]); return(T_EXCV); } YY_BREAKcase 100:YY_RULE_SETUP#line 281 "snaplex.l"{ memalloc(value_str.s, char *, strlen(yytext)+1); strcpy(value_str.s,yytext); value_str.lenb = strlen(yytext) + 1; return(T_LABELV); } YY_BREAKcase 101:YY_RULE_SETUP#line 286 "snaplex.l"{ memalloc(value_str.s, char *, strlen(yytext)); strncpy(value_str.s,yytext,strlen(yytext)-1); value_str.lenb = strlen(yytext); return(T_LABEL); } YY_BREAKcase 102:YY_RULE_SETUP#line 291 "snaplex.l"ECHO; YY_BREAK#line 1668 "lex.yy.c"case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex *//* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH -
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -