📄 l_url.cpp
字号:
57, 17, 17, 58, 17, 55, 57, 124, 120, 58, 17, 17, 17, 17, 17, 17, 32, 32, 32, 59, 32, 60, 63, 60, 64, 59, 65, 66, 63, 60, 64, 67, 65, 66, 69, 70, 71, 67, 32, 72, 69, 70, 71, 75, 76, 72, 77, 78, 80, 75, 76, 81, 77, 78, 80, 82, 85, 81, 86, 87, 89, 82, 85, 90, 86, 87, 89, 91, 93, 90, 94, 95, 97, 91, 93, 98, 94, 95, 97, 101, 102, 98, 103, 105, 106, 101, 102, 107, 103, 105, 106, 109, 110, 107, 111, 113, 114, 109, 110, 115, 111, 113, 114, 117, 118, 115, 119, 121, 122, 117, 118, 123, 119, 121, 122, 125, 126, 123, 127, 129, 130, 125, 126, 131, 127, 129, 130, 133, 134, 131, 135, 137, 138, 133, 134, 139, 135, 137, 138, 141, 142, 139, 143, 145, 146, 141, 142, 147, 143, 145, 146, 149, 150, 147, 153, 154, 155, 149, 150, 157, 153, 154, 155, 158, 159, 157, 161, 162, 163, 158, 159, 165, 161, 162, 163, 166, 167, 165, 169, 170, 173, 166, 167, 174, 169, 170, 173, 175, 116, 174, 112, 108, 104, 175, 177, 177, 177, 177, 177, 177, 177, 178, 178, 178, 178, 178, 178, 178, 179, 179, 179, 100, 179, 180, 180, 180, 99, 180, 181, 96, 92, 181, 181, 182, 182, 183, 183, 183, 183, 183, 183, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 190, 191, 191, 192, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199, 199, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 206, 207, 207, 208, 208, 209, 209, 210, 210, 211, 211, 212, 212, 88, 84, 79, 74, 73, 68, 62, 61, 56, 52, 50, 47, 44, 43, 39, 35, 34, 26, 9, 8, 7, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176 } ;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 "url.l"#define INITIAL 0/***************************************************************************** * Description: encode/decode attribute urls * * Originated: February 25, 2000 * Original Author: Mike Day md@soft-hackle.net * mdd@us.ibm.com * * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_url.cpp,v 1.5 2005/02/26 05:41:02 david.dillard Exp $ * * Copyright (c) 2001 - 2003 IBM * Copyright (c) 2000 - 2003 Michael Day * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * *****************************************************************************/#line 37 "url.l"#undef YYLMAX#define YYLMAX 2048#define YY_NEVER_INTERACTIVE 1#undef YY_INPUT#define YY_INPUT(b, r, m) abort()#define exit(i) abort()#include "slp_client.h"#include "y_url.h"#include <stdarg.h>#define urlless yylessvoid urlerror(char *, ...);static int16 heapIndex;static char heap[2052];static char buf[2052];/* special counter to exit the appletalk state */char atalk_state = 0;static char *_lslp_strdup(const char *s);void url_close_lexer(uint32 handle);size_t url_init_lexer(const char *s);/* {} */#define IP_SITE 1#define AT_SITE 2#define ATTRIBUTE 3#line 610 "l_url.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) * or sizeof(void*) != sizeof(int). */#endif#endif/* Amount of stuff to slurp up with each read. */#ifndef YY_READ_BUF_SIZE#define YY_READ_BUF_SIZE 8192#endif/* Copy whatever the last rule matched to the standard output. */#ifndef ECHO/* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )#endif/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */#ifndef YY_INPUT#define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" );#endif/* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */#ifndef yyterminate#define yyterminate() return YY_NULL#endif/* Number of entries by which start-condition stack grows. */#ifndef YY_START_STACK_INCR#define YY_START_STACK_INCR 25#endif/* Report a fatal error. */#ifndef YY_FATAL_ERROR#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )#endif/* Default declaration of generated scanner - a define so the user can * easily add parameters. */#ifndef YY_DECL#define YY_DECL int yylex YY_PROTO(( void ))#endif/* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */#ifndef YY_USER_ACTION#define YY_USER_ACTION#endif/* Code executed at the end of each rule. */#ifndef YY_BREAK#define YY_BREAK break;#endif#define YY_RULE_SETUP \ YY_USER_ACTIONYY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act;#line 84 "url.l" /* the ip user @ host syntax is a special state because some reserved */ /* characters are valid - but user the string itself is optional so we can't */ /* build it into a full-time rule */#line 768 "l_url.c" if ( yy_init ) { yy_init = 0;#ifdef YY_USER_INIT YY_USER_INIT;#endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start;yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 177 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 421 );yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION;do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yy_hold_char; yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; goto yy_find_action;case 1:YY_RULE_SETUP#line 90 "url.l"{ BEGIN IP_SITE; urlless(0); } YY_BREAK/* return the slash as a token */case 2:YY_RULE_SETUP#line 95 "url.l"{urllval._i = *urltext; return(urllval._i);} YY_BREAK/* this next rule needs to kick in even if it matches a zero-length string *//* i.e., it needs to be guaranteed even if there is no user @ host production */case 3:YY_RULE_SETUP#line 99 "url.l"{ BEGIN INITIAL; if (urlleng > 0) { if(NULL != (urllval._s = _lslp_strdup(urltext))) return(_RESNAME); else return(0L); } } YY_BREAK/* appletalk syntax includes three reserved characters - give the lexer a chance *//* to match an appletalk production before it starts returning reserved *//* chars as tokens. */case 4:YY_RULE_SETUP#line 114 "url.l"{ BEGIN AT_SITE; if(NULL != (urllval._s = _lslp_strdup(urltext))) return(_AT); else return(0L); } YY_BREAKcase 5:YY_RULE_SETUP#line 122 "url.l"{ atalk_state++; if (atalk_state == 3) {BEGIN INITIAL;} if(NULL != (urllval._s = _lslp_strdup(urltext))) return(_ZONE); else return(0L); } YY_BREAKcase 6:YY_RULE_SETUP#line 132 "url.l"{urllval._i = *urltext; return(urllval._i);} YY_BREAKcase 7:YY_RULE_SETUP#line 133 "url.l"{BEGIN INITIAL; urlless(0);} YY_BREAK/* ipx syntax includes two reserved characters - give the lexer a chance *//* to match an ipx production before it starts returning reserved chars *//* as tokens */case 8:YY_RULE_SETUP#line 139 "url.l"{ if(NULL != (urllval._s = _lslp_strdup(urltext))) return(_IPX); else return(0L); } YY_BREAK/* reserved characters - always a token in normal state unless part of *//* one of the productions above */case 9:YY_RULE_SETUP#line 148 "url.l"{BEGIN ATTRIBUTE; urllval._i = *urltext; return(urllval._i);} YY_BREAKcase 10:YY_RULE_SETUP#line 149 "url.l"{urllval._i = *urltext; return(urllval._i);} YY_BREAKcase 11:YY_RULE_SETUP#line 150 "url.l"{urllval._i = *urltext; return(urllval._i);} YY_BREAKcase 12:YY_RULE_SETUP#line 151 "url.l"{urllval._i = *urltext; return(urllval._i);} YY_BREAKcase 13:YY_RULE_SETUP#line 152 "url.l"{urllval._i = *urltext; return(urllval._i);} YY_BREAKcase 14:YY_RULE_SETUP#line 153 "url.l"{urllval._i = *urltext; return(urllval._i);} YY_BREAKcase 15:YY_RULE_SETUP#line 154 "url.l"{urllval._i = *urltext; return(urllval._i);} YY_BREAKcase 16:YY_RULE_SETUP#line 155 "url.l"{urllval._i = *urltext; return(urllval._i);} YY_BREAKcase 17:YY_RULE_SETUP#line 156 "url.l"{urllval._i = *urltext; return(urllval._i);} YY_BREAKcase 18:YY_RULE_SETUP#line 157 "url.l"{urllval._i = *urltext; return(urllval._i);} YY_BREAK/* a string consisting of only hex digits */case 19:YY_RULE_SETUP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -