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
auto node() const -> const SyntaxNode*

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.

parsing::Token slang::syntax::ConstTokenOrSyntax::token() const

Gets access to the object as a token (throwing an exception if it's not actually a token).

const SyntaxNode* slang::syntax::ConstTokenOrSyntax::node() const

Gets access to the object as a syntax node (throwing an exception if it's not actually a syntax node).