Spicy
Public Member Functions | Protected Member Functions | List of all members
spicy::rt::driver::ParsingStateForDriver Class Reference

#include <driver.h>

Inheritance diagram for spicy::rt::driver::ParsingStateForDriver:
spicy::rt::driver::ParsingState

Public Member Functions

 ParsingStateForDriver (ParsingType type, const Parser *parser, std::string id, std::optional< std::string > cid, std::optional< UnitContext > context, Driver *driver)
 
const auto & id () const
 
- Public Member Functions inherited from spicy::rt::driver::ParsingState
 ParsingState (ParsingType type, const Parser *parser=nullptr, std::optional< UnitContext > context={})
 
bool hasParser () const
 
void setParser (const Parser *parser, std::optional< UnitContext > context={})
 
bool isFinished () const
 
void skipRemaining ()
 
bool isSkipping () const
 
State process (size_t size, const char *data)
 
std::optional< hilti::rt::stream::Offset > finish ()
 
void reset ()
 

Protected Member Functions

void debug (const std::string &msg) override
 
- Protected Member Functions inherited from spicy::rt::driver::ParsingState
void debug (const std::string &msg, size_t size, const char *data)
 

Additional Inherited Members

- Public Types inherited from spicy::rt::driver::ParsingState
enum  State { Done, Continue }
 

Detailed Description

Specialized parsing state for use by Driver.

Constructor & Destructor Documentation

◆ ParsingStateForDriver()

spicy::rt::driver::ParsingStateForDriver::ParsingStateForDriver ( ParsingType  type,
const Parser parser,
std::string  id,
std::optional< std::string >  cid,
std::optional< UnitContext context,
Driver driver 
)
inline

Constructor.

Parameters
typeof parsing; this determines how subsequent chunks of input data are handled (stream-wise vs independent blocks)
parserparser to use; can be left unset to either not perform any parsing at all, or set it later through setParser().
idtextual ID to associate with state for use in debug messages
cidif the state is associated with one side of a connection, a textual ID representing that connection.
driverdriver owning this state

Member Function Documentation

◆ debug()

void driver::ParsingStateForDriver::debug ( const std::string &  msg)
overrideprotectedvirtual

Virtual method to override by derived classed for recording debug output. Note that in a release mode compile the driver code will not actually call this (nor should user code probably).

Implements spicy::rt::driver::ParsingState.

◆ id()

const auto& spicy::rt::driver::ParsingStateForDriver::id ( ) const
inline

Returns the textual ID associated with the state.


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