Skip to content

ludus::tooling::shader_language::Token

Ludus Wiki · API overview · Browse API

Struct

One token; its spelling is borrowed from the request or the result.
When IsSynthesized is false, the spelling is SpellingSize bytes at SpellingOffset in the text of request file Location.FileIndex, which the caller keeps alive. When it is true, the spelling is in the result's synthesized text: configuration values, # and ## create such spellings. Use GetTokenSpelling rather than indexing either buffer directly.

Declared in modules/tooling/shader_language/include/ludus/tooling/shader_language/token.hpp

#include <ludus/tooling/shader_language/token.hpp>
struct ludus::tooling::shader_language::Token final

Fields

Kind

TokenKind ludus::tooling::shader_language::Token::Kind = TokenKind::Identifier
Lexical category.

Related types: TokenKind

Declared in modules/tooling/shader_language/include/ludus/tooling/shader_language/token.hpp

Symbol

Punctuator ludus::tooling::shader_language::Token::Symbol = Punctuator::None
Which punctuator, for TokenKind::Punctuator; Punctuator::None otherwise.

Related types: Punctuator

Declared in modules/tooling/shader_language/include/ludus/tooling/shader_language/token.hpp

IsAtLineStart

bool ludus::tooling::shader_language::Token::IsAtLineStart = false
True for the first token on its source line.

Declared in modules/tooling/shader_language/include/ludus/tooling/shader_language/token.hpp

HasLeadingSpace

bool ludus::tooling::shader_language::Token::HasLeadingSpace = false
True when whitespace or a comment precedes the token on its line.

Declared in modules/tooling/shader_language/include/ludus/tooling/shader_language/token.hpp

IsSynthesized

bool ludus::tooling::shader_language::Token::IsSynthesized = false
True when the spelling is stored in the result's synthesized text.

Declared in modules/tooling/shader_language/include/ludus/tooling/shader_language/token.hpp

SpellingOffset

foundation::uint32 ludus::tooling::shader_language::Token::SpellingOffset = 0
Byte offset of the spelling in its storage.

Related types: foundation::uint32

Declared in modules/tooling/shader_language/include/ludus/tooling/shader_language/token.hpp

SpellingSize

foundation::uint32 ludus::tooling::shader_language::Token::SpellingSize = 0
Byte size of the spelling.

Related types: foundation::uint32

Declared in modules/tooling/shader_language/include/ludus/tooling/shader_language/token.hpp

Location

SourceLocation ludus::tooling::shader_language::Token::Location
Where the token is spelled. For a token from a macro body this is inside the definition.

Related types: SourceLocation

Declared in modules/tooling/shader_language/include/ludus/tooling/shader_language/token.hpp

ExpansionIndex

foundation::uint32 ludus::tooling::shader_language::Token::ExpansionIndex = NO_EXPANSION
Index of the outermost macro use that produced the token, or NO_EXPANSION.

Related types: foundation::uint32

Declared in modules/tooling/shader_language/include/ludus/tooling/shader_language/token.hpp