亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tkparse.c

?? fsmlabs的real time linux的內核
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * tkparse.c * * Eric Youngdale was the original author of xconfig. * Michael Elizabeth Chastain (mec@shout.net) is the current maintainer. * * Parse a config.in file and translate it to a wish script. * This task has three parts: * *   tkparse.c	tokenize the input *   tkcond.c   transform 'if ...' statements *   tkgen.c    generate output * * Change History * * 7 January 1999, Michael Elizabeth Chastain, <mec@shout.net> * - Teach dep_tristate about a few literals, such as: *     dep_tristate 'foo' CONFIG_FOO m *   Also have it print an error message and exit on some parse failures. * * 14 January 1999, Michael Elizabeth Chastain, <mec@shout.net> * - Don't fclose stdin.  Thanks to Tony Hoyle for nailing this one. * * 14 January 1999, Michael Elizabeth Chastain, <mec@shout.net> * - Steam-clean this file.  I tested this by generating kconfig.tk for *   every architecture and comparing it character-for-character against *   the output of the old tkparse. * * 23 January 1999, Michael Elizabeth Chastain, <mec@shout.net> * - Remove bug-compatible code. * * 07 July 1999, Andrzej M. Krzysztofowicz, <ankry@mif.pg.gda.pl> * - Submenus implemented, * - plenty of option updating/displaying fixes, * - dep_bool, define_hex, define_int, define_string, define_tristate and *   undef implemented, * - dep_tristate fixed to support multiple dependencies, * - handling of variables with an empty value implemented, * - value checking for int and hex fields, * - more checking during condition parsing; choice variables are treated as *   all others now, * * TO DO: * - xconfig is at the end of its life cycle.  Contact <mec@shout.net> if *   you are interested in working on the replacement. */#include <stdio.h>#include <stdlib.h>#include <string.h>#include "tkparse.h"static struct kconfig * config_list = NULL;static struct kconfig * config_last = NULL;static const char * current_file = "<unknown file>";static int lineno = 0;static void do_source( const char * );#undef strcmpint my_strcmp( const char * s1, const char * s2 ) { return strcmp( s1, s2 ); }#define strcmp my_strcmp/* * Report a syntax error. */static void syntax_error( const char * msg ){    fprintf( stderr, "%s: %d: %s\n", current_file, lineno, msg );    exit( 1 );}/* * Find index of a specyfic variable in the symbol table. * Create a new entry if it does not exist yet. */#define VARTABLE_SIZE 2048struct variable vartable[VARTABLE_SIZE];int max_varnum = 0;int get_varnum( char * name ){    int i;        for ( i = 1; i <= max_varnum; i++ )	if ( strcmp( vartable[i].name, name ) == 0 )	    return i;    if (max_varnum > VARTABLE_SIZE-1)	syntax_error( "Too many variables defined." );    vartable[++max_varnum].name = malloc( strlen( name )+1 );    strcpy( vartable[max_varnum].name, name );    return max_varnum;}/* * Get a string. */static const char * get_string( const char * pnt, char ** label ){    const char * word;    word = pnt;    for ( ; ; )    {	if ( *pnt == '\0' || *pnt == ' ' || *pnt == '\t' )	    break;	pnt++;    }    *label = malloc( pnt - word + 1 );    memcpy( *label, word, pnt - word );    (*label)[pnt - word] = '\0';    if ( *pnt != '\0' )	pnt++;    return pnt;}/* * Get a quoted string. * Insert a '\' before any characters that need quoting. */static const char * get_qstring( const char * pnt, char ** label ){    char quote_char;    char newlabel [1024];    char * pnt1;    /* advance to the open quote */    for ( ; ; )    {	if ( *pnt == '\0' )	    return pnt;	quote_char = *pnt++;	if ( quote_char == '"' || quote_char == '\'' )	    break;    }    /* copy into an intermediate buffer */    pnt1 = newlabel;    for ( ; ; )    {	if ( *pnt == '\0' )	    syntax_error( "unterminated quoted string" );	if ( *pnt == quote_char && pnt[-1] != '\\' )	    break;	/* copy the character, quoting if needed */	if ( *pnt == '"' || *pnt == '\'' || *pnt == '[' || *pnt == ']' )	    *pnt1++ = '\\';	*pnt1++ = *pnt++;    }    /* copy the label into a permanent location */    *pnt1++ = '\0';    *label = (char *) malloc( pnt1 - newlabel );    memcpy( *label, newlabel, pnt1 - newlabel );    /* skip over last quote and next whitespace */    pnt++;    while ( *pnt == ' ' || *pnt == '\t' )	pnt++;    return pnt;}/* * Tokenize an 'if' statement condition. */static struct condition * tokenize_if( const char * pnt ){    struct condition * list;    struct condition * last;    struct condition * prev;    /* eat the open bracket */    while ( *pnt == ' ' || *pnt == '\t' )	pnt++;    if ( *pnt != '[' )	syntax_error( "bad 'if' condition" );    pnt++;    list = last = NULL;    for ( ; ; )    {	struct condition * cond;	/* advance to the next token */	while ( *pnt == ' ' || *pnt == '\t' )	    pnt++;	if ( *pnt == '\0' )	    syntax_error( "unterminated 'if' condition" );	if ( *pnt == ']' )	    return list;	/* allocate a new token */	cond = malloc( sizeof(*cond) );	memset( cond, 0, sizeof(*cond) );	if ( last == NULL )	    { list = last = cond; prev = NULL; }	else	    { prev = last; last->next = cond; last = cond; }	/* determine the token value */	if ( *pnt == '-' && pnt[1] == 'a' )	{	    if ( ! prev || ( prev->op != op_variable && prev->op != op_constant ) )		syntax_error( "incorrect argument" );	    cond->op = op_and;  pnt += 2; continue;	}	if ( *pnt == '-' && pnt[1] == 'o' )	{	    if ( ! prev || ( prev->op != op_variable && prev->op != op_constant ) )		syntax_error( "incorrect argument" );	    cond->op = op_or;   pnt += 2; continue;	}	if ( *pnt == '!' && pnt[1] == '=' )	{	    if ( ! prev || ( prev->op != op_variable && prev->op != op_constant ) )		syntax_error( "incorrect argument" );	    cond->op = op_neq;  pnt += 2; continue;	}	if ( *pnt == '=' )	{	    if ( ! prev || ( prev->op != op_variable && prev->op != op_constant ) )		syntax_error( "incorrect argument" );	    cond->op = op_eq;   pnt += 1; continue;	}	if ( *pnt == '!' )	{	    if ( prev && ( prev->op != op_and && prev->op != op_or		      && prev->op != op_bang ) )		syntax_error( "incorrect argument" );	    cond->op = op_bang; pnt += 1; continue;	}	if ( *pnt == '"' )	{	    const char * word;	    if ( prev && ( prev->op == op_variable || prev->op == op_constant ) )		syntax_error( "incorrect argument" );	    /* advance to the word */	    pnt++;	    if ( *pnt == '$' )		{ cond->op = op_variable; pnt++; }	    else		{ cond->op = op_constant; }	    /* find the end of the word */	    word = pnt;	    for ( ; ; )	    {		if ( *pnt == '\0' )		    syntax_error( "unterminated double quote" );		if ( *pnt == '"' )		    break;		pnt++;	    }	    /* store a copy of this word */	    {		char * str = malloc( pnt - word + 1 );		memcpy( str, word, pnt - word );		str [pnt - word] = '\0';		if ( cond->op == op_variable )		{		    cond->nameindex = get_varnum( str );		    free( str );		}		else /* op_constant */		{		    cond->str = str;		}	    }	    pnt++;	    continue;	}	/* unknown token */	syntax_error( "bad if condition" );    }}/* * Tokenize a choice list.  Choices appear as pairs of strings; * note that I am parsing *inside* the double quotes.  Ugh. */static const char * tokenize_choices( struct kconfig * cfg_choose,    const char * pnt ){    for ( ; ; )    {	struct kconfig * cfg;	char * buffer = malloc( 64 );	/* skip whitespace */	while ( *pnt == ' ' || *pnt == '\t' )	    pnt++;	if ( *pnt == '\0' )	    return pnt;	/* allocate a new kconfig line */	cfg = malloc( sizeof(*cfg) );	memset( cfg, 0, sizeof(*cfg) );	if ( config_last == NULL )	    { config_last = config_list = cfg; }	else	    { config_last->next = cfg; config_last = cfg; }	/* fill out the line */	cfg->token      = token_choice_item;	cfg->cfg_parent = cfg_choose;	pnt = get_string( pnt, &cfg->label );	while ( *pnt == ' ' || *pnt == '\t' )	    pnt++;	pnt = get_string( pnt, &buffer );	cfg->nameindex = get_varnum( buffer );    }    return pnt;}/* * Tokenize one line. */static void tokenize_line( const char * pnt ){    static struct kconfig * last_menuoption = NULL;    enum e_token token;    struct kconfig * cfg;    struct dependency ** dep_ptr;    char * buffer = malloc( 64 );    /* skip white space */    while ( *pnt == ' ' || *pnt == '\t' )	pnt++;    /*     * categorize the next token     */#define match_token(t, s) \    if (strncmp(pnt, s, strlen(s)) == 0) { token = t; pnt += strlen(s); break; }    token = token_UNKNOWN;    switch ( *pnt )    {    default:	break;    case '#':    case '\0':	return;    case 'b':	match_token( token_bool, "bool" );	break;    case 'c':	match_token( token_choice_header, "choice"  );	match_token( token_comment, "comment" );	break;    case 'd':	match_token( token_define_bool, "define_bool" );	match_token( token_define_hex, "define_hex" );	match_token( token_define_int, "define_int" );	match_token( token_define_string, "define_string" );	match_token( token_define_tristate, "define_tristate" );	match_token( token_dep_bool, "dep_bool" );	match_token( token_dep_mbool, "dep_mbool" );	match_token( token_dep_tristate, "dep_tristate" );	break;    case 'e':	match_token( token_else, "else" );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品处破学生在线二十三| 狠狠久久亚洲欧美| 一区二区三区不卡在线观看| 国产精品久久777777| 国产精品你懂的| 亚洲欧洲制服丝袜| 亚洲一区在线免费观看| 日韩中文欧美在线| 久久国产夜色精品鲁鲁99| 国产老肥熟一区二区三区| 成人福利视频网站| 91免费视频网| 日韩精品一区二区在线| 久久久国产午夜精品| 亚洲视频香蕉人妖| 亚洲国产日产av| 国产精品亚洲视频| 色噜噜久久综合| 日韩美女视频在线| 亚洲欧洲三级电影| 久久精品av麻豆的观看方式| 粉嫩欧美一区二区三区高清影视| 色综合久久久久| 久久久久久电影| 强制捆绑调教一区二区| 一本一道波多野结衣一区二区| 日韩精品一区二区三区三区免费| 亚洲日本青草视频在线怡红院 | 日韩电影免费在线看| 粉嫩蜜臀av国产精品网站| 欧美裸体bbwbbwbbw| 亚洲人一二三区| 成人午夜私人影院| 久久精品夜夜夜夜久久| 日本最新不卡在线| 欧洲人成人精品| 亚洲综合在线免费观看| av亚洲精华国产精华精华| 久久久不卡网国产精品一区| 狂野欧美性猛交blacked| 欧美日韩国产乱码电影| 天天影视色香欲综合网老头| 在线中文字幕一区二区| 亚洲高清视频中文字幕| 欧美电影在线免费观看| 亚洲va欧美va人人爽| 91麻豆精品国产无毒不卡在线观看| 亚洲欧美另类图片小说| 色乱码一区二区三区88| 午夜精彩视频在线观看不卡| 欧美日本韩国一区| 久久精品国产精品青草| 欧美精品一区二区三区蜜桃| 国产在线精品一区二区夜色| 国产精品天天看| 91麻豆精品一区二区三区| 亚洲国产精品久久不卡毛片| 这里是久久伊人| 成人一区二区三区在线观看| 亚洲精品v日韩精品| 欧美一区二区福利在线| 粉嫩高潮美女一区二区三区| 一区二区三区精品在线观看| 欧美一区二区三区成人| 成人黄色软件下载| 奇米在线7777在线精品| 综合久久给合久久狠狠狠97色| 欧美在线免费观看亚洲| 国产69精品一区二区亚洲孕妇| 美女视频黄久久| 一区二区激情小说| 国产精品成人网| 国产亚洲精品bt天堂精选| 欧美日韩一区二区三区高清| 岛国一区二区三区| 蜜桃视频一区二区三区 | 成人综合激情网| 日本v片在线高清不卡在线观看| 国产精品久久久久久亚洲毛片 | 性做久久久久久免费观看欧美| 欧美国产亚洲另类动漫| 久久久久成人黄色影片| 91精品国产综合久久香蕉的特点| 91免费国产在线| 91影院在线观看| av资源网一区| 成人av在线影院| 成人免费毛片aaaaa**| 不卡一区二区中文字幕| 成人avav在线| 91成人免费电影| 欧美精品 日韩| 久久久精品黄色| 中文字幕人成不卡一区| 亚洲精品免费一二三区| 亚洲与欧洲av电影| 日韩成人精品在线观看| 久久99久国产精品黄毛片色诱| 久久99国产精品久久99| 韩国成人在线视频| 91麻豆福利精品推荐| 欧美精品免费视频| 国产欧美精品一区二区色综合| 国产精品久线观看视频| 亚洲成av人片在线| 精彩视频一区二区三区 | 日韩成人av影视| 成人动漫一区二区| 91精品国产91热久久久做人人| 国产欧美日本一区视频| 丝袜美腿成人在线| 看电视剧不卡顿的网站| 91精品一区二区三区久久久久久| 成人性视频网站| 国产成人精品免费| 69久久99精品久久久久婷婷| 国产日韩欧美在线一区| 婷婷久久综合九色综合绿巨人 | 91在线观看免费视频| 精品国精品国产| 丝袜亚洲另类欧美综合| 成人激情午夜影院| www激情久久| 蜜桃一区二区三区四区| 欧美二区在线观看| 性做久久久久久久免费看| 成人av中文字幕| 最新不卡av在线| 国产·精品毛片| 中文一区在线播放| 成人午夜视频在线观看| 久久久精品欧美丰满| 国产美女精品一区二区三区| 欧美精品日韩一区| 蜜桃av一区二区三区电影| 日韩免费观看高清完整版| 蜜臀av亚洲一区中文字幕| 日韩精品专区在线影院重磅| 精品影院一区二区久久久| 久久视频一区二区| 成人性色生活片免费看爆迷你毛片| 久久综合久久久久88| 国产酒店精品激情| 中文字幕视频一区| 欧美日韩国产a| 麻豆成人免费电影| 中文字幕成人在线观看| 欧美在线三级电影| 国模无码大尺度一区二区三区| 国产欧美日韩三级| 欧美视频在线观看一区二区| 九九九精品视频| 亚洲欧美一区二区三区国产精品| 欧美日产在线观看| 粉嫩在线一区二区三区视频| 亚洲精品久久久蜜桃| 日韩美一区二区三区| 91久久国产最好的精华液| 视频一区视频二区中文字幕| 亚洲国产精品成人综合| 91精品欧美综合在线观看最新| 99久久精品国产网站| 国产精品一二三四区| 日韩国产成人精品| 亚洲精品久久久蜜桃| 欧美精彩视频一区二区三区| 欧美va亚洲va香蕉在线| 欧美日韩精品专区| 91麻豆免费观看| 91一区二区在线| 不卡的av在线播放| 成人一区二区三区| 国产成人在线观看| 国产精品综合在线视频| 国产一区二区不卡在线| 青青草一区二区三区| 毛片基地黄久久久久久天堂| 日韩国产欧美三级| 青青草原综合久久大伊人精品| 午夜精品福利在线| 丝袜诱惑亚洲看片| 激情成人综合网| 成人的网站免费观看| 91同城在线观看| 在线观看91视频| 91麻豆精品国产无毒不卡在线观看| 91精品国产综合久久精品| 欧美男男青年gay1069videost| 日韩欧美专区在线| 久久久久国产成人精品亚洲午夜| 国产精品日产欧美久久久久| 亚洲人成伊人成综合网小说| 亚洲国产综合色| 国产盗摄精品一区二区三区在线| 成人av午夜电影| 欧美日本视频在线| 国产精品免费视频一区| 日韩成人免费在线| 91久久奴性调教| 久久这里都是精品|