slang::syntax::ConstTokenOrSyntax struct

A token or a constant syntax node.

Derived classes

struct TokenOrSyntax
A token or a syntax node.

Public functions

bool isToken() const
bool isNode() const
parsing::Token token() const
Gets access to the object as a token (throwing an exception if it's not actually a token).
const SyntaxNode* node() const
Gets access to the object as a syntax node (throwing an exception if it's not actually a syntax node).
SourceRange range() const
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.