FE 0.9.0
Header-only C++ frontend library
Loading...
Searching...
No Matches
fe Namespace Reference

Namespaces

namespace  term
 Lightweight stream-based terminal colors for diagnostics and CLI output.
namespace  utf8
 UTF-8 helpers for decoding byte streams, encoding char32_t values, and running ASCII-style character classification on char32_t.

Classes

class  Arena
 An arena pre-allocates so-called pages of size Arena::page_size_. More...
class  RuntimeCast
 Inherit from this class using CRTP, for some nice dynamic_cast-style wrappers. More...
struct  Driver
 Use/derive from this class for "global" variables that you need all over the place. More...
struct  is_bit_enum
class  StreamFn
 Wrap a callable f(std::ostream&) -> std::ostream& so it streams via operator<< and std::format. More...
struct  basic_ostream_formatter
 Make types that support ostream operators available for std::format. More...
class  Tab
 Keeps track of indentation level during output. More...
class  Join
 Join elements of range with sep. More...
class  Lexer
 The blueprint for a lexer with a buffer of K tokens to peek into the future (Lexer::ahead). More...
struct  Pos
 Position in a source file; pass around as value. More...
struct  Loc
 Location in a File. More...
class  Parser
 The blueprint for a recursive descent/ ascent parser using a K lookahead of Tokens. More...
class  Ring
 A ring buffer with N elements. More...
class  Ring< T, 1 >
 Specialization if N == 1 - doesn't need a ring. More...
class  Ring< T, 2 >
 Specialization if N == 2; doesn't need a ring, we just copy. More...
class  Sym
 A Symbol just wraps a pointer to Sym::String, so pass Sym itself around as value. More...
class  SymPool
 Hash set where all strings - wrapped in Symbol - live in. More...

Concepts

concept  Nodeable
concept  BitEnum
concept  Formattable

Typedefs

using ostream_formatter = basic_ostream_formatter<char>
SymMap/SymSet

Set/Map is keyed by pointer - which is hashed in SymPool.

template<class V>
using SymMap = std::unordered_map<Sym, V, Sym::Hash, Sym::Eq>
using SymSet = std::unordered_set<Sym, Sym::Hash, Sym::Eq>

Functions

void unreachable ()
void breakpoint ()
 Raise a breakpoint in the debugger.
template<fe::BitEnum E>
constexpr bool has_flag (E value, E flag) noexcept
template<class F>
 StreamFn (F) -> StreamFn< F >
template<class R>
 Join (R &&, std::string_view=", ") -> Join< R >
std::ostream & operator<< (std::ostream &os, Pos pos)
std::ostream & operator<< (std::ostream &os, Loc loc)
Bit operations for enum classs

Provides all kind of bit and comparison operators for an enum class E.

Use like this:

enum class MyEnum : unsigned {
A = 1 << 0,
B = 1 << 1,
C = 1 << 2,
};
template<> struct fe::is_bit_enum<MyEnum> : std::true_type {};
template<fe::BitEnum E>
constexpr auto to_underlying (E e) noexcept

Typedef Documentation

◆ ostream_formatter

Definition at line 64 of file format.h.

◆ SymMap

template<class V>
using fe::SymMap = std::unordered_map<Sym, V, Sym::Hash, Sym::Eq>

Definition at line 242 of file sym.h.

◆ SymSet

using fe::SymSet = std::unordered_set<Sym, Sym::Hash, Sym::Eq>

Definition at line 243 of file sym.h.

Function Documentation

◆ breakpoint()

void fe::breakpoint ( )
inline

Raise a breakpoint in the debugger.

Definition at line 26 of file assert.h.

◆ has_flag()

template<fe::BitEnum E>
bool fe::has_flag ( E value,
E flag )
constexprnoexcept

Definition at line 39 of file enum.h.

◆ Join()

template<class R>
fe::Join ( R && ,
std::string_view = ", " ) -> Join< R >

◆ operator<<() [1/2]

std::ostream & fe::operator<< ( std::ostream & os,
Loc loc )

Include fe/loc.cpp.h in exactly one translation unit for the default implementation, or provide your own definitions instead.

Definition at line 18 of file loc.cpp.h.

◆ operator<<() [2/2]

std::ostream & fe::operator<< ( std::ostream & os,
Pos pos )

Include fe/loc.cpp.h in exactly one translation unit for the default implementation, or provide your own definitions instead.

Definition at line 10 of file loc.cpp.h.

◆ StreamFn()

template<class F>
fe::StreamFn ( F ) -> StreamFn< F >

◆ to_underlying()

template<fe::BitEnum E>
auto fe::to_underlying ( E e)
constexprnoexcept

Definition at line 25 of file enum.h.

Referenced by operator&(), operator^(), and operator|().

◆ unreachable()

void fe::unreachable ( )
inline
See also
https://stackoverflow.com/a/65258501

Definition at line 19 of file assert.h.