示例#1
0
文件: lex_c.c 项目: Chaduke/bah.mod
int TCOD_lex_parse_until_token_type(TCOD_lex_t *lex,int tokenType)
{
	int token;
    token = TCOD_lex_parse(lex);
    if ( token == TCOD_LEX_ERROR ) return token;
    while ( token != TCOD_LEX_EOF )
    {
        if ( token == tokenType )
            return token;
	    token = TCOD_lex_parse(lex);
	    if ( token == TCOD_LEX_ERROR ) return token;
    }
    return token;
}
示例#2
0
文件: lex_c.c 项目: Chaduke/bah.mod
int TCOD_lex_parse_until_token_value(TCOD_lex_t *lex, const char *tokenValue)
{
	int token;
    token = TCOD_lex_parse(lex);
    if ( token == TCOD_LEX_ERROR ) return token;
    while ( token != TCOD_LEX_EOF )
    {
        if ( strcmp( lex->tok, tokenValue ) == 0
			|| ( ( lex->flags & TCOD_LEX_FLAG_NOCASE ) && strcasecmp(lex->tok, tokenValue ) == 0 ) )
            return token;
	    token = TCOD_lex_parse(lex);
	    if ( token == TCOD_LEX_ERROR ) return token;
    }
    return token;
}
示例#3
0
文件: lex.cpp 项目: AMouri/Rouge
int TCODLex::parse()
{
	return TCOD_lex_parse((TCOD_lex_t *)data);
}
示例#4
0
文件: lex_c.c 项目: Chaduke/bah.mod
bool TCOD_lex_expect_token_value(TCOD_lex_t *lex,int token_type, const char *token_value)
{
	TCOD_lex_parse(lex);
	return (token_type == lex->token_type && strcmp(lex->tok, token_value) == 0 );
}
示例#5
0
文件: lex_c.c 项目: Chaduke/bah.mod
bool TCOD_lex_expect_token_type(TCOD_lex_t *lex,int token_type)
{
	return (TCOD_lex_parse(lex) == token_type);
}