Many API scripts and programs rely on the entities and references stored in the Understand database, but sometimes you need to descend into the text of the file itself. Understand lets you do that with the lexer function and the lexeme class.
Lexeme – a chunk of text that means something to the parser: a string, a comment, a variable, etc.
Lexer – a stream of lexemes.
With Understand, we can walk through that stream of lexemes and query each one about its text, what entity or reference is associated with it, what token it has (Punctuation, Comment, Preprocessor, etc), or what line is it on.
If you have a simple line like this:
Its lexemes would have the following information:
An Example
Return the text of a file removing all inactive code and comments, and expanding macros.