コード例 #1
0
ファイル: db_scan.c プロジェクト: neutered/propgcc
/* Require - check for a required token */
void Require(ParseContext *c, Token token, Token requiredToken)
{
    char tknbuf[MAXTOKEN];
    if (token != requiredToken) {
        strcpy(tknbuf, TokenName(requiredToken));
        ParseError(c, "Expecting '%s', found '%s'", tknbuf, TokenName(token));
    }
}
コード例 #2
0
ファイル: sc_man.cpp プロジェクト: usernameak/gzdoom
void FScanner::TokenMustBe (int token)
{
	if (TokenType != token)
	{
		FString tok1 = TokenName(token);
		FString tok2 = TokenName(TokenType, String);
		ScriptError ("Expected %s but got %s instead.", tok1.GetChars(), tok2.GetChars());
	}
}
コード例 #3
0
ファイル: parser.c プロジェクト: chrisdiamand/wm
/* Try and continue by looking for the start of the next statement */
static void syntax_error(TokenType type)
{
    fprintf(stderr, "Error in config file line %lu: Expected %s\n",
            scan_input->line_number, TokenName(type));
    do
    {
        next_token();
        if (ct.type == TOK_EOF || ct.type == TOK_NAME)
            return;
    } while (1);
}
コード例 #4
0
ファイル: dbgscan.c プロジェクト: Ukusbobra/open-watcom-v2
void Recog( unsigned token )
{
    char        *start;
    unsigned    len;

    if( token != CurrToken ) {
        TokenName( token, &start, &len );
        Error( ERR_LOC, LIT( ERR_WANT_TOKEN ), start, len );
    }
    Scan();
}