亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
91精品国产综合久久久久| 国产亚洲精品久| 亚洲成人精品一区二区| 91麻豆免费看| 一区二区在线观看免费 | 国产美女在线精品| 久久精品一区蜜桃臀影院| 国产91在线观看| 综合网在线视频| 欧美日韩日日摸| 久久电影国产免费久久电影| 国产亚洲欧美激情| 91精品国产美女浴室洗澡无遮挡| 欧美不卡一区二区三区| 成人一区在线看| 免费一级片91| 一本到三区不卡视频| 丝袜美腿一区二区三区| 久久久九九九九| 欧美最新大片在线看| 国产在线视频不卡二| 亚洲人成亚洲人成在线观看图片| 欧美一区二区三区思思人| 国产精品一区二区三区乱码| 精品国产乱子伦一区| 色妞www精品视频| 国产一区二区在线视频| 亚洲国产成人高清精品| 亚洲国产电影在线观看| 精品区一区二区| 91精品在线麻豆| 欧美影院精品一区| 99re66热这里只有精品3直播| 蜜桃91丨九色丨蝌蚪91桃色| 夜夜精品浪潮av一区二区三区 | 国产99一区视频免费| 久久电影网电视剧免费观看| 三级一区在线视频先锋| 亚洲图片欧美一区| 一区二区三区不卡视频在线观看| 国产欧美一区二区在线观看| 久久夜色精品国产欧美乱极品| 欧美日韩在线综合| 欧美区一区二区三区| 91黄色激情网站| 欧美日韩激情一区二区三区| 欧美日韩一二三| 91精品国产综合久久久久| 91精品国产色综合久久| 日韩一区二区在线观看| 欧美成人一级视频| 国产亚洲精久久久久久| 国产精品视频观看| 亚洲免费观看高清完整| 五月婷婷综合在线| 捆绑调教一区二区三区| 懂色中文一区二区在线播放| 不卡一区在线观看| 欧美日韩不卡视频| 精品欧美久久久| 欧美激情一区二区| 亚洲一二三专区| 狠狠色综合色综合网络| 91女人视频在线观看| 7799精品视频| 国产精品久久久久一区二区三区共| 亚洲欧美日韩国产综合| 免费一级片91| 色综合久久综合网欧美综合网| 91精品国产高清一区二区三区蜜臀| www国产精品av| 亚洲成人自拍偷拍| 99久久夜色精品国产网站| 日韩一二三区视频| 亚洲综合999| 成人av动漫网站| 日韩免费一区二区| 五月婷婷激情综合| 91麻豆国产在线观看| 国产欧美视频在线观看| 天天色天天操综合| 欧美日韩免费高清一区色橹橹| 日本一区二区成人| 国产成人三级在线观看| 日韩精品最新网址| 日韩福利电影在线| 欧美日韩午夜在线| 亚洲激情图片一区| 91视频你懂的| 亚洲视频小说图片| 91久久线看在观草草青青| 国产精品国产精品国产专区不片 | jlzzjlzz亚洲日本少妇| 久久一二三国产| 国产精品亚洲第一区在线暖暖韩国| 欧美一区二区三区在线视频| 麻豆精品一区二区三区| 精品乱码亚洲一区二区不卡| 激情综合色丁香一区二区| 欧美mv和日韩mv国产网站| 精东粉嫩av免费一区二区三区| 日韩欧美高清一区| 国产精品77777竹菊影视小说| 日本一区二区三区久久久久久久久不 | 亚洲午夜免费福利视频| 欧美色图在线观看| 久久99精品一区二区三区| 国产亚洲短视频| 色8久久人人97超碰香蕉987| 图片区小说区国产精品视频| 国产日韩欧美麻豆| 色综合天天综合网国产成人综合天 | 成人h动漫精品| 秋霞成人午夜伦在线观看| 国产日本欧洲亚洲| 色哟哟在线观看一区二区三区| 日韩免费视频一区| 日韩国产一区二| 日韩精品资源二区在线| 在线观看一区日韩| 欧美日韩国产综合一区二区| 欧洲精品在线观看| 欧美日韩小视频| 538prom精品视频线放| 欧美一区二区三区成人| 欧美一区二区久久| 精品三级av在线| 久久久夜色精品亚洲| 中文子幕无线码一区tr| 国产精品国产三级国产有无不卡 | 国产老女人精品毛片久久| 亚洲午夜久久久久| 亚洲自拍偷拍九九九| 一区二区三区中文字幕| 亚洲摸摸操操av| 一区二区三区四区不卡视频| 国产精品亲子伦对白| 国产精品国产自产拍高清av | 国产成人av电影免费在线观看| 国产麻豆日韩欧美久久| 久久成人免费网站| 精品一区二区成人精品| 久久av资源网| 成人av动漫网站| 在线观看亚洲a| 欧美另类z0zxhd电影| 日韩精品在线网站| 欧美国产精品一区二区| 一区二区免费看| 日韩精品午夜视频| 国产精品乡下勾搭老头1| 91亚洲大成网污www| 91精品国产高清一区二区三区蜜臀| 欧美精品一区二区不卡| 成人欧美一区二区三区在线播放| 一区二区欧美国产| 丁香一区二区三区| 欧美日韩夫妻久久| 国产调教视频一区| 日日夜夜一区二区| 不卡的av网站| 久久精品一区八戒影视| 日韩毛片高清在线播放| 久久国产精品72免费观看| 91蜜桃免费观看视频| 久久久久久一二三区| 日本欧美一区二区在线观看| 99久久精品费精品国产一区二区| 日韩欧美一级片| 久久精品免视看| 手机精品视频在线观看| 欧洲亚洲国产日韩| 国产精品嫩草影院com| 国模娜娜一区二区三区| 日韩一级二级三级| 日韩综合在线视频| 欧美一区二区三区视频在线| 午夜电影久久久| 欧美一级艳片视频免费观看| 亚洲成人手机在线| 欧美一级黄色片| 美女精品一区二区| 精品国产一区a| 国产成人av资源| 久久久99精品免费观看不卡| 国产麻豆精品视频| 久久看人人爽人人| 91一区二区三区在线观看| 亚洲精品乱码久久久久| 欧美乱妇23p| 国产成人午夜99999| 自拍偷拍国产亚洲| 欧美一级黄色大片| 国产v综合v亚洲欧| 一区二区三区精品视频| 欧美伦理视频网站| 成人美女视频在线观看| 一区二区三区国产精华| 欧美成人video| 91香蕉视频mp4|