FE 0.5.0
A header-only C++ library for writing frontends
Loading...
Searching...
No Matches
fe Namespace Reference

Namespaces

namespace  format
 
namespace  utf8
 

Classes

class  Arena
 An arena pre-allocates so-called pages of size Arena::page_size_. More...
 
struct  basic_ostream_formatter
 Make types that support ostream operators available for std::format. More...
 
struct  Driver
 Use/derive from this class for "global" variables that you need all over the place. More...
 
class  Lexer
 The blueprint for a lexer with a buffer of K tokens to peek into the future (Lexer::ahead). 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...
 
struct  Pos
 Position in a source file; pass around as value. 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  RuntimeCast
 Inherit from this class using CRTP, for some nice dynamic_cast-style wrappers. 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...
 
class  Tab
 Keeps track of indentation level during output. More...
 

Concepts

concept  Nodeable
 

Typedefs

using ostream_formatter = basic_ostream_formatter< char >
 
Sym

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

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

Functions

void unreachable ()
 
void breakpoint ()
 Raise breaokpoint in debugger.
 
std::ostream & operator<< (std::ostream &os, Pos pos)
 
std::ostream & operator<< (std::ostream &os, Loc loc)
 
out/outln/err/errln

Print to std::cout/std::cerr via std::format; the *ln variants conclude with std::endl.

template<class... Args>
void err (format::format_string< Args... > fmt, Args &&... args)
 
template<class... Args>
void out (format::format_string< Args... > fmt, Args &&... args)
 
template<class... Args>
void errln (format::format_string< Args... > fmt, Args &&... args)
 
template<class... Args>
void outln (format::format_string< Args... > fmt, Args &&... args)
 

Typedef Documentation

◆ ostream_formatter

Definition at line 40 of file format.h.

◆ SymMap

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

Definition at line 185 of file sym.h.

◆ SymSet

using fe::SymSet = typedef std::unordered_set<Sym>

Definition at line 186 of file sym.h.

Function Documentation

◆ breakpoint()

void fe::breakpoint ( )
inline

Raise breaokpoint in debugger.

Definition at line 26 of file assert.h.

◆ err()

template<class... Args>
void fe::err ( format::format_string< Args... >  fmt,
Args &&...  args 
)

Definition at line 46 of file format.h.

◆ errln()

template<class... Args>
void fe::errln ( format::format_string< Args... >  fmt,
Args &&...  args 
)

Definition at line 48 of file format.h.

◆ operator<<() [1/2]

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

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

◆ operator<<() [2/2]

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

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

◆ out()

template<class... Args>
void fe::out ( format::format_string< Args... >  fmt,
Args &&...  args 
)

Definition at line 47 of file format.h.

◆ outln()

template<class... Args>
void fe::outln ( format::format_string< Args... >  fmt,
Args &&...  args 
)

Definition at line 49 of file format.h.

◆ unreachable()

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

Definition at line 19 of file assert.h.