Gyoji Compiler
|
#include <tree.hpp>
Public Member Functions | |
const FileStatementType & | get_statement () const |
![]() | |
SyntaxNode (Gyoji::context::TokenID _type, specific_type_t _data, const Gyoji::context::SourceReference &_source_ref) | |
const std::vector< std::reference_wrapper< const SyntaxNode > > & | get_children () const |
const Gyoji::context::TokenID & | get_type () const |
template<class T > | |
bool | has_data () const |
template<class T > | |
const T & | get_data () const |
const SyntaxNode & | get_syntax_node () const |
const Gyoji::context::SourceReference & | get_source_ref () const |
A statement at the file level consists of one of the following types of statement.
const FileStatement::FileStatementType & FileStatement::get_statement | ( | ) | const |
Returns the details of a specific statement. The specific type of statement can be interrogated by determining if the variant "holds" the given type of data and then accessing the held statement.
Example usage:
const auto & stmt = fs.get_statement(); if (std::holds_alternative<FileStatementFunctionDefinition>(stmt)) { const auto & function_def = std::get<Gyoji::owned<FileStatementFunctionDefinition>>(stmt); }