The SyntaxToken class.
More...
#include <SyntaxToken.h>
|
| enum | Category {
Keywords,
Identifiers,
Constants,
StringLiterals,
Punctuators,
Unrecognized
} |
| | The existing SyntaxToken categories. More...
|
| |
The SyntaxToken class.
- Note
- This API is inspired by that of
Microsoft.CodeAnalysis.SyntaxToken from Roslyn, the .NET Compiler Platform.
-
Influence by the API of Clang/LLVM is present as well; specifically:
clang::Token and clang::Preprocessor.
◆ Category
◆ category() [1/2]
◆ category() [2/2]
The Category of SyntaxKind k.
◆ hasLeadingTrivia()
| bool psy::C::SyntaxToken::hasLeadingTrivia |
( |
| ) |
const |
|
inline |
Whether this SyntaxToken has any leading trivia (e.g., a whitespace).
◆ invalid()
◆ isAtStartOfLine()
| bool psy::C::SyntaxToken::isAtStartOfLine |
( |
| ) |
const |
|
inline |
◆ isComment()
| bool SyntaxToken::isComment |
( |
| ) |
const |
◆ isJoined()
| bool psy::C::SyntaxToken::isJoined |
( |
| ) |
const |
|
inline |
Whether this SyntaxToken is joined with the previous one.
◆ isKind()
| bool psy::C::SyntaxToken::isKind |
( |
SyntaxKind |
k | ) |
|
|
inline |
◆ isMissing()
| bool psy::C::SyntaxToken::isMissing |
( |
| ) |
const |
|
inline |
◆ isPPExpanded()
| bool psy::C::SyntaxToken::isPPExpanded |
( |
| ) |
const |
|
inline |
◆ isPPGenerated()
| bool psy::C::SyntaxToken::isPPGenerated |
( |
| ) |
const |
|
inline |
Whether this SyntaxToken is the result of a preprocessor expansion and generated. Consider:
#define FOO(a, b) a + b;
FOO(1, 2)
After preprocessing, we have:
Tokens 1, +, 2, and ; are all preprocessor-expanded; but only + and ; are both expanded and generated.
- See also
- SyntaxToken::isPPExpanded
◆ isValid()
| bool SyntaxToken::isValid |
( |
| ) |
const |
◆ kind()
| SyntaxKind psy::C::SyntaxToken::kind |
( |
| ) |
const |
|
inline |
◆ lexeme()
| Lexeme * SyntaxToken::lexeme |
( |
| ) |
const |
◆ location()
| Location SyntaxToken::location |
( |
| ) |
const |
◆ span()
◆ valueText()
| std::string SyntaxToken::valueText |
( |
| ) |
const |
◆ valueText_c_str()
| const char * SyntaxToken::valueText_c_str |
( |
| ) |
const |
The documentation for this class was generated from the following files: