Gyoji Compiler
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Gyoji::frontend::tree::FileStatement Class Reference

#include <tree.hpp>

Inheritance diagram for Gyoji::frontend::tree::FileStatement:
Inheritance graph
[legend]
Collaboration diagram for Gyoji::frontend::tree::FileStatement:
Collaboration graph
[legend]

Public Member Functions

const FileStatementType & get_statement () const
 
- Public Member Functions inherited from Gyoji::frontend::ast::SyntaxNode
 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 SyntaxNodeget_syntax_node () const
 
const Gyoji::context::SourceReferenceget_source_ref () const
 

Detailed Description

A statement at the file level consists of one of the following types of statement.

Member Function Documentation

◆ get_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);
  }

The documentation for this class was generated from the following files: