Spicy
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
hilti::Meta Class Reference

#include <meta.h>

Public Types

using Comments = std::vector< std::string >
 

Public Member Functions

 Meta (Location location, Comments comments={})
 
 Meta (Comments comments={})
 
 Meta (const Meta &)=default
 
 Meta (Meta &&)=default
 
const Commentscomments () const
 
const Locationlocation () const
 
void setLocation (Location l)
 
void setComments (Comments c)
 
Meta mergeLocation (const Location &l) const
 
 operator bool () const
 
Metaoperator= (const Meta &)=default
 
Metaoperator= (Meta &&)=default
 

Static Public Member Functions

static const Metaget (Meta m)
 

Friends

bool operator== (const Meta &a, const Meta &b)
 
bool operator!= (const Meta &a, const Meta &b)
 

Detailed Description

Meta information associated with AST nodes. The meta data can include a source code location, source code comments, and an error message.

Member Typedef Documentation

◆ Comments

using hilti::Meta::Comments = std::vector<std::string>

List of comments.

Constructor & Destructor Documentation

◆ Meta()

hilti::Meta::Meta ( Comments  comments = {})
inline

Constructor that leaves location unset.

Member Function Documentation

◆ get()

static const Meta* hilti::Meta::get ( Meta  m)
inlinestatic

Returns pointer to a globally shared/cached version of a meta instance. The returned pointer can be used instead of the Meta instance passed in, and it guaranteed to remain valid for the entire lifetime of the program.

◆ operator bool()

hilti::Meta::operator bool ( ) const
inlineexplicit

Returns true if the location does not equal a default constructed instance.


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