slang::syntax::ConstTokenOrSyntax struct

A token or a constant syntax node.

Derived classes

struct TokenOrSyntax
A token or a syntax node.

Public functions

auto isToken() const -> bool
auto isNode() const -> bool
auto token() const -> parsing::Token
Gets access to the object as a token (throwing an exception if it's not actually a token).
auto node() const -> const SyntaxNode*
Gets access to the object as a syntax node (throwing an exception if it's not actually a syntax node).
auto range() const -> SourceRange
Gets the source range for the token or syntax node.

Function documentation

bool slang::syntax::ConstTokenOrSyntax::isToken() const

Returns true if the object is a token.

bool slang::syntax::ConstTokenOrSyntax::isNode() const

Returns true if the object is a syntax node.