If the token was produced by expanding a macro, we will get an TEXT token which can contain a whole expression; in this case we will call GetExpression to parse it. Otherwise we just call the token's GetValue() method.

Parse the input string and return a token containing the whole output.

Parameters

iSource

The source text enclosed in a token

Returns

The output text enclosed in a token

char* Ogre::GLSL::CPreprocessor::Parse

(

const char *

iSource,

size_t

iLength,

size_t &

oLength

)

Parse the input string and return a newly-allocated output string.

Note

The returned preprocessed string is NOT zero-terminated (just like the input string).

Parameters

iSource

The source text

iLength

The length of the source text in characters

oLength

The length of the output string.

Returns

The output from preprocessor, allocated with malloc(). The parser can actually allocate more than needed for performance reasons, but this should not be a problem unless you will want to store the returned pointer for long time in which case you might want to realloc() it. If an error has been encountered, the function returns NULL. In some cases the function may return an unallocated address that's inside the source buffer. You must free() the result string only if the returned address is not inside the source text.