MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::ast::Mods Struct Reference

Raw, unvalidated combination of priv/pub/extern/anx modifiers written before a declaration. More...

#include <mim/ast/ast.h>

Public Member Functions

Vis default_vis () const
 extern/anx nudge the default visibility to Pub unless priv is given explicitly.
Vis resolved_vis () const
bool any () const
Mods inherit (const Mods &group) const
 group's modifiers as defaults, so an explicit priv/pub here overrides the group's.

Public Attributes

std::optional< Vis > vis = {}
bool is_extern = false
bool is_anx = false

Detailed Description

Raw, unvalidated combination of priv/pub/extern/anx modifiers written before a declaration.

Parser::parse_modifiers only rejects a modifier being repeated (priv priv, extern extern, ...); whether a given combination makes sense for the decl that follows is up to that decl's own parser.

Definition at line 56 of file ast.h.

Member Function Documentation

◆ any()

bool mim::ast::Mods::any ( ) const
inline

Definition at line 64 of file ast.h.

References is_anx, is_extern, and vis.

◆ default_vis()

Vis mim::ast::Mods::default_vis ( ) const
inline

extern/anx nudge the default visibility to Pub unless priv is given explicitly.

Definition at line 62 of file ast.h.

References is_anx, is_extern, mim::ast::Priv, and mim::ast::Pub.

Referenced by mim::ast::operator<<(), and resolved_vis().

◆ inherit()

Mods mim::ast::Mods::inherit ( const Mods & group) const
inline

group's modifiers as defaults, so an explicit priv/pub here overrides the group's.

Definition at line 66 of file ast.h.

References is_anx, is_extern, and vis.

◆ resolved_vis()

Vis mim::ast::Mods::resolved_vis ( ) const
inline

Definition at line 63 of file ast.h.

References default_vis(), and vis.

Referenced by mim::ast::operator<<().

Member Data Documentation

◆ is_anx

bool mim::ast::Mods::is_anx = false

Definition at line 59 of file ast.h.

Referenced by any(), default_vis(), inherit(), and mim::ast::operator<<().

◆ is_extern

bool mim::ast::Mods::is_extern = false

Definition at line 58 of file ast.h.

Referenced by any(), default_vis(), inherit(), and mim::ast::operator<<().

◆ vis

std::optional<Vis> mim::ast::Mods::vis = {}

Definition at line 57 of file ast.h.

Referenced by any(), inherit(), and resolved_vis().


The documentation for this struct was generated from the following file: