![]() |
Spicy
|
#include <parser.h>
Public Member Functions | |
| Parser (std::string_view name, bool is_public, Parse1Function parse1, hilti::rt::any parse2, Parse3Function parse3, ContextNewFunction context_new, const hilti::rt::TypeInfo *type, std::string description, hilti::rt::Vector< MIMEType > mime_types, hilti::rt::Vector< ParserPort > ports) | |
| Parser (std::string_view name, bool is_public, Parse1Function parse1, hilti::rt::any parse2, Parse3Function parse3, hilti::rt::Null, const hilti::rt::TypeInfo *type, std::string description, hilti::rt::Vector< MIMEType > mime_types, hilti::rt::Vector< ParserPort > ports) | |
| Parser (std::string_view name, bool is_public, hilti::rt::Null, hilti::rt::any parse2, hilti::rt::Null, hilti::rt::Null, const hilti::rt::TypeInfo *type, std::string description, hilti::rt::Vector< MIMEType > mime_types, hilti::rt::Vector< ParserPort > ports) | |
| Parser (std::string_view name, bool is_public, hilti::rt::Null, hilti::rt::any parse2, hilti::rt::Null, ContextNewFunction context_new, const hilti::rt::TypeInfo *type, std::string description, hilti::rt::Vector< MIMEType > mime_types, hilti::rt::Vector< ParserPort > ports) | |
| Parser (const Parser &)=default | |
| Parser (Parser &&) noexcept=default | |
| Parser & | operator= (const Parser &)=default |
| Parser & | operator= (Parser &&) noexcept=default |
| std::optional< UnitContext > | createContext () const |
Public Attributes | |
| std::string_view | name |
| bool | is_public = false |
| uint64_t | linker_scope = 0 |
| Parse1Function | parse1 {} |
| hilti::rt::any | parse2 |
| Parse3Function | parse3 {} |
| ContextNewFunction | context_new = nullptr |
| const hilti::rt::TypeInfo * | type_info = nullptr |
| struct { | |
| std::string prepare_block = "spicy/prepare/block/" | |
| std::string prepare_input = "spicy/prepare/input/" | |
| std::string prepare_stream = "spicy/prepare/stream/" | |
| } | profiler_tags |
| std::string | description |
| hilti::rt::Vector< MIMEType > | mime_types |
| hilti::rt::Vector< ParserPort > | ports |
| detail::ParseSinkFunction | __parse_sink = nullptr |
| void(* | __hook_gap )(const hilti::rt::StrongReferenceGeneric &, uint64_t, uint64_t) = nullptr |
| void(* | __hook_overlap )(const hilti::rt::StrongReferenceGeneric &, uint64_t, const hilti::rt::Bytes &, const hilti::rt::Bytes &) = nullptr |
| void(* | __hook_skipped )(const hilti::rt::StrongReferenceGeneric &, uint64_t) = nullptr |
| void(* | __hook_undelivered )(const hilti::rt::StrongReferenceGeneric &, uint64_t, const hilti::rt::Bytes &) = nullptr |
Runtime information about an available parser.
Note: When changing this struct, adapt the Spicy-side spicy_rt::Parser as well.
|
inline |
Create a new instance of the context type defined for the parser. If there's no context defined, returns an unset optional.
| void(* spicy::rt::Parser::__hook_gap) (const hilti::rt::StrongReferenceGeneric &, uint64_t, uint64_t) = nullptr |
For internal use only. Dispatcher for the corresponding unit hook.
| void(* spicy::rt::Parser::__hook_overlap) (const hilti::rt::StrongReferenceGeneric &, uint64_t, const hilti::rt::Bytes &, const hilti::rt::Bytes &) = nullptr |
For internal use only. Dispatcher for the corresponding unit hook.
| void(* spicy::rt::Parser::__hook_skipped) (const hilti::rt::StrongReferenceGeneric &, uint64_t) = nullptr |
For internal use only. Dispatcher for the corresponding unit hook.
| void(* spicy::rt::Parser::__hook_undelivered) (const hilti::rt::StrongReferenceGeneric &, uint64_t, const hilti::rt::Bytes &) = nullptr |
For internal use only. Dispatcher for the corresponding unit hook.
| detail::ParseSinkFunction spicy::rt::Parser::__parse_sink = nullptr |
For internal use only. Set by registerParser() for units that's don't receive arguments.
| ContextNewFunction spicy::rt::Parser::context_new = nullptr |
Function instantantiating a new instance of the context defined for the parse. Unset if no context is defined.
| std::string spicy::rt::Parser::description |
Human-readable description associated with this parser.
| bool spicy::rt::Parser::is_public = false |
Whether this parser is public.
| uint64_t spicy::rt::Parser::linker_scope = 0 |
Linker scope of the unit registering the parser. This can be used for disambiguation between linked units. Will be set/overidden by registerParser().
| hilti::rt::Vector<MIMEType> spicy::rt::Parser::mime_types |
MIME types this parer can handle.
| std::string_view spicy::rt::Parser::name |
Short descriptive name.
| Parse1Function spicy::rt::Parser::parse1 {} |
Function performing parsing of given input into a temporary instance. This will remain unset if the unit type cannot be used through a parse1-style function because it receives parameters.
| hilti::rt::any spicy::rt::Parser::parse2 |
Function performing parsing of given input into a provided instance. The actual type of this member is Parse2Function<T>.
| Parse3Function spicy::rt::Parser::parse3 {} |
Function performing parsing of given input into a ParsedUnited that will be returned. This will remain unset if the unit type cannot be used through a parse3-style function because it receives parameters.
| hilti::rt::Vector<ParserPort> spicy::rt::Parser::ports |
Well-known ports associated with this parser.
| struct { ... } spicy::rt::Parser::profiler_tags |
Pre-computed profiler tags used by the runtime driver.
| const hilti::rt::TypeInfo* spicy::rt::Parser::type_info = nullptr |
Type-information for puarser's unit.