bux API Reference 1.9.0
Static library of whatever are seen required in general purpose but not directly supported from Modern C++. Or whatever reusable originated from my side projects.
|
#include <LR1.h>
Classes | |
struct | C_ReduceInfo |
Public Types | |
typedef std::function< void(C_Parser &parser, const F_GetProduced &args, C_LexPtr &ret)> | FH_Reduce |
Public Member Functions | |
constexpr | I_ParserPolicy (T_LexID idError) |
virtual | ~I_ParserPolicy ()=default |
virtual size_t | action (T_StateID state, T_LexID token) const =0 |
Return action kind. | |
virtual bool | changeToken (T_LexID &token, C_LexPtr &attr) const |
A chance to save action error. | |
virtual size_t | getAcceptId () const =0 |
Return id which will be passed as the 1st arg of getReduceInfo() | |
virtual bool | getTokenName (T_LexID token, std::string &name) const |
Return true if token has a name. | |
virtual T_StateID | nextState (T_StateID state, T_LexID lex) const =0 |
Goto table. | |
virtual void | getReduceInfo (size_t id, C_ReduceInfo &info) const =0 |
Get reduction if available. | |
virtual void | onError (C_Parser &parser, const C_SourcePos &pos, std::string_view message) const =0 |
Report error (to log or to throw) | |
std::string | printToken (T_LexID token) const |
Public Attributes | |
const T_LexID | m_IdError |
std::function<void(C_Parser &parser, const F_GetProduced &args, C_LexPtr &ret)> bux::LR1::I_ParserPolicy::FH_Reduce |
|
inlineconstexpr |
|
virtualdefault |
|
pure virtual |
Return action kind.
|
pure virtual |
Return id which will be passed as the 1st arg of getReduceInfo()
|
pure virtual |
Get reduction if available.
Return true if token has a name.
Definition at line 17 of file LR1.cpp.
Referenced by printToken().
|
pure virtual |
Goto table.
|
pure virtual |
Report error (to log or to throw)
Referenced by bux::LR1::C_Parser::onError().
std::string bux::LR1::I_ParserPolicy::printToken | ( | T_LexID | token | ) | const |
Definition at line 22 of file LR1.cpp.
References bux::asciiLiteral(), getTokenName(), bux::ROOT_NID, bux::TID_EOF, and bux::TOKENGEN_LB.