sammine-lang
Loading...
Searching...
No Matches
sammine_lang::Lexer Class Reference

A Lexer class with holds the core functionality Tokens and Token streams. More...

#include <Lexer.h>

Inheritance diagram for sammine_lang::Lexer:
Collaboration diagram for sammine_lang::Lexer:

Public Member Functions

 Lexer (const std::string &input)
 
std::shared_ptr< Tokenpeek ()
 
std::shared_ptr< Tokenconsume ()
 
std::shared_ptr< TokenStreamgetTokenStream ()
 
size_t advance (size_t i)
 
size_t devance (size_t i)
 
- Public Member Functions inherited from sammine_util::Reportee
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
virtual void abort (const std::string &msg="<NO MESSAGE>")
 
template<explicitly_bool_like T>
void abort_on (const T &condition, const std::string &message="<NO MESSAGE>")
 
template<explicitly_bool_like T>
void abort_if_not (const T &condition, const std::string &message="<NO MESSAGE>")
 
void add_error (Location loc, std::string msg)
 
void add_warn (Location loc, std::string msg)
 
void add_diagnostics (Location loc, std::string msg)
 
virtual bool has_errors () const
 
bool has_warn () const
 
bool has_message () const
 
bool has_diagnostics () const
 
int64_t get_error_count () const
 
int64_t get_warn_count () const
 
int64_t get_diagnostic_count () const
 

Additional Inherited Members

- Public Types inherited from sammine_util::Reportee
enum  ReportKind { error , warn , diag }
 
using Report = std::tuple<Location, std::string, ReportKind>
 
using iterator = std::vector<Report>::iterator
 
using const_iterator = std::vector<Report>::const_iterator
 
- Protected Attributes inherited from sammine_util::Reportee
std::vector< Report > reports
 
int64_t error_count = 0
 
int64_t warn_count = 0
 
int64_t diag_count = 0
 

Detailed Description

A Lexer class with holds the core functionality Tokens and Token streams.


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