engine/source/preprocessorlib/pp_lexer.c
/******************************************************************************
*  StringLiteral -- This method extracts a string literal from the character
*  stream.
*  Parameters: theNextToken -- address of the next CToken found in the stream
*  Returns: S_OK
*           E_FAIL
******************************************************************************/
- This method extracts a string literal from the character
stream.
Parameters: theNextToken -- address of the next CToken found in the stream
Returns: S_OK
E_FAIL
- This method extracts a string literal from the character stream . Parameters : theNextToken -- address of the next CToken found in the stream Returns : S_OK E_FAIL
HRESULT pp_lexer_GetTokenStringLiteral(pp_lexer *plexer, pp_token *theNextToken)
{
    int esc = 0;
    CONSUMECHARACTER;
    while ( strncmp( plexer->pcurChar, "\"", 1))
    {
        if(!strncmp( plexer->pcurChar, "\\", 1))
        {
            esc = 1;
        }
        CONSUMECHARACTER;
        if(esc)
        {
            CONSUMECHARACTER;
            esc = 0;
        }
    }
    CONSUMECHARACTER;
    MAKETOKEN( PP_TOKEN_STRING_LITERAL );
    return S_OK;
}
HRESULT pp_lexer_GetTokenStringLiteral ( pp_lexer * plexer , pp_token * theNextToken ) { int esc = 0 ; CONSUMECHARACTER ; while ( strncmp ( plexer -> pcurChar , " \" " , 1 ) ) { if ( ! strncmp ( plexer -> pcurChar , " \\ " , 1 ) ) { esc = 1 ; } CONSUMECHARACTER ; if ( esc ) { CONSUMECHARACTER ; esc = 0 ; } } CONSUMECHARACTER ; MAKETOKEN ( PP_TOKEN_STRING_LITERAL ) ; return S_OK ; }
StringLiteral -- This method extracts a string literal from the character
stream.
StringLiteral -- This method extracts a string literal from the character stream .
//copy the source that makes up this token //an identifier is a string of letters, digits and/or underscores //consume that first quote mark //consume that last quote mark