public override classifyIdentifier( token as String, line as String, endIndex as Long, previousWord as String, inQueryBlock as Boolean ) as TokenKind
Classifies C and C++ identifiers, recognizing POSIX/standard *_t typedefs, typename parameters, and std:: / template type references.
| Parameter | Description |
|---|---|
token | Identifier text. |
line | Full source line. |
endIndex | Exclusive end index of token in line. |
previousWord | Immediately preceding word on the line. |
inQueryBlock | Unused in C/C++ (false). |
Resolved TokenKind.
import klyn.code
import klyn.code.cpp
t = CppTokenizer()
assert t.classifyIdentifier("vector", "std::vector<int> v;", 11, "std", false) == TokenKind.TYPE
assert t.classifyIdentifier("pid_t", "pid_t id = 0;", 5, "", false) == TokenKind.TYPE