Struct lib_ruby_parser_bindings::Options [−][src]
pub struct Options {Show 44 fields
pub ifndef_name: String,
pub pre_code: String,
pub post_code: String,
pub fn_attributes: String,
pub ptr_blob_name: String,
pub maybe_ptr_blob_name: String,
pub string_ptr_blob_name: String,
pub maybe_string_ptr_blob_name: String,
pub shared_byte_list_blob_name: String,
pub byte_blob_name: String,
pub token_blob_name: String,
pub node_blob_name: String,
pub diagnostic_blob_name: String,
pub comment_type_blob_name: String,
pub comment_blob_name: String,
pub magic_comment_kind_blob_name: String,
pub magic_comment_blob_name: String,
pub bytes_blob_name: String,
pub loc_blob_name: String,
pub maybe_loc_blob_name: String,
pub error_level_blob_name: String,
pub diagnostic_message_blob_name: String,
pub source_line_blob_name: String,
pub byte_list_blob_name: String,
pub token_list_blob_name: String,
pub node_list_blob_name: String,
pub diagnostic_list_blob_name: String,
pub comment_list_blob_name: String,
pub magic_comment_list_blob_name: String,
pub source_line_list_blob_name: String,
pub message_variant_blob_name_fn: Box<dyn Fn(&Message) -> String>,
pub node_variant_blob_name_fn: Box<dyn Fn(&Node) -> String>,
pub input_error_blob_name: String,
pub decoder_result_blob_name: String,
pub decoder_blob_name: String,
pub rewrite_action_blob_name: String,
pub lex_state_action_blob_name: String,
pub token_rewriter_result_blob_name: String,
pub token_rewriter_blob_name: String,
pub maybe_decoder_blob_name: String,
pub maybe_token_rewriter_blob_name: String,
pub parser_options_blob_name: String,
pub decoded_input_blob_name: String,
pub parser_result_blob_name: String,
}Expand description
A struct with codegen options
Fields
ifndef_name: StringIdentifier that is passed to wrapping #ifndef
Default: LIB_RUBY_PARSER_BINDINGS_H
pre_code: StringPre-code
You can put here things like #include or
#ifdef __cplusplus \n extern "C" ...
Default: "// pre-code"
post_code: StringPost-code
Can be used to close #ifdef __cplusplus
Default: "// post-code"
fn_attributes: StringAttributes that are attached to every generated function
can be __attribute__((always_inline)) if you want to perform inlining
ptr_blob_name: StringName of what you want to be used
as a blob of the Ptr<T> struct in lib-ruby-parser
maybe_ptr_blob_name: StringName of what you want to be used
as a blob of the MaybePtr<T> struct in lib-ruby-parser
string_ptr_blob_name: StringName of what you want to be used
as a blob of the StringPtr struct in lib-ruby-parser
maybe_string_ptr_blob_name: StringName of what you want to be used
as a blob of the MaybeStringPtr struct in lib-ruby-parser
Name of what you want to be used
as a blob of the SharedByteList struct in lib-ruby-parser
byte_blob_name: StringName of what you want to be used
as a blob of the u8 struct in lib-ruby-parser
In most cases if you build low-level bindings it will be u8 (without converting it to/from blob)
token_blob_name: StringName of what you want to be used
as a blob of the Token struct in lib-ruby-parser
node_blob_name: StringName of what you want to be used
as a blob of the Node struct in lib-ruby-parser
diagnostic_blob_name: StringName of what you want to be used
as a blob of the Diagnostic struct in lib-ruby-parser
comment_type_blob_name: StringName of what you want to be used
as a blob of the CommentType struct in lib-ruby-parser
comment_blob_name: StringName of what you want to be used
as a blob of the Comment struct in lib-ruby-parser
magic_comment_kind_blob_name: StringName of what you want to be used
as a blob of the MagicCommentKind struct in lib-ruby-parser
magic_comment_blob_name: StringName of what you want to be used
as a blob of the MagicComment struct in lib-ruby-parser
bytes_blob_name: StringName of what you want to be used
as a blob of the Bytes struct in lib-ruby-parser
loc_blob_name: StringName of what you want to be used
as a blob of the Loc struct in lib-ruby-parser
maybe_loc_blob_name: StringName of what you want to be used
as a blob of the MaybeLoc struct in lib-ruby-parser
error_level_blob_name: StringName of what you want to be used
as a blob of the ErrorLevel struct in lib-ruby-parser
diagnostic_message_blob_name: StringName of what you want to be used
as a blob of the Diagnostic struct in lib-ruby-parser
source_line_blob_name: StringName of what you want to be used
as a blob of the SourceLine struct in lib-ruby-parser
byte_list_blob_name: StringName of what you want to be used
as a blob of the List<Byte> struct in lib-ruby-parser
token_list_blob_name: StringName of what you want to be used
as a blob of the List<Token> struct in lib-ruby-parser
node_list_blob_name: StringName of what you want to be used
as a blob of the List<Node> struct in lib-ruby-parser
diagnostic_list_blob_name: StringName of what you want to be used
as a blob of the List<Diagnostic> struct in lib-ruby-parser
comment_list_blob_name: StringName of what you want to be used
as a blob of the List<Comment> struct in lib-ruby-parser
magic_comment_list_blob_name: StringName of what you want to be used
as a blob of the List<MagicComment> struct in lib-ruby-parser
source_line_list_blob_name: StringName of what you want to be used
as a blob of the List<SourceLine> struct in lib-ruby-parser
message_variant_blob_name_fn: Box<dyn Fn(&Message) -> String>Function that takes a Message from lib-ruby-parser-nodes
and returns a name of what you want to be used
as a blob of its representation
in in lib-ruby-parser
For example, for UnexpectedToken message you may want to
call your blob class/struct in C++ as UnexpectedToken_BLOB
Default: fn that returns <message.camelcase_name>_BLOB
node_variant_blob_name_fn: Box<dyn Fn(&Node) -> String>Function that takes a Node from lib-ruby-parser-nodes
and returns a name of what you want to be used
as a blob of its representation
in in lib-ruby-parser
For example, for Arg message you may want to
call your blob class/struct in C++ as Arg_BLOB
Default: fn that returns <node.camelcase_name>_BLOB
input_error_blob_name: StringName of what you want to be used
as a blob of the InputError struct in lib-ruby-parser
decoder_result_blob_name: StringName of what you want to be used
as a blob of the DecoderResult struct in lib-ruby-parser
decoder_blob_name: StringName of what you want to be used
as a blob of the Decoder struct in lib-ruby-parser
rewrite_action_blob_name: StringName of what you want to be used
as a blob of the RewriteAction struct in lib-ruby-parser
lex_state_action_blob_name: StringName of what you want to be used
as a blob of the LexStateAction struct in lib-ruby-parser
token_rewriter_result_blob_name: StringName of what you want to be used
as a blob of the TokenRewriterResult struct in lib-ruby-parser
token_rewriter_blob_name: StringName of what you want to be used
as a blob of the TokenRewriter struct in lib-ruby-parser
maybe_decoder_blob_name: StringName of what you want to be used
as a blob of the MaybeDecoder struct in lib-ruby-parser
maybe_token_rewriter_blob_name: StringName of what you want to be used
as a blob of the MaybeTokenRewriter struct in lib-ruby-parser
parser_options_blob_name: StringName of what you want to be used
as a blob of the ParserOptions struct in lib-ruby-parser
decoded_input_blob_name: StringName of what you want to be used
as a blob of the DecodedInput struct in lib-ruby-parser
parser_result_blob_name: StringName of what you want to be used
as a blob of the ParserResult struct in lib-ruby-parser
Implementations
Applies self.message_variant_blob_name_fn on a given message
Utility function
Applies self.node_variant_blob_name on a given node
Utility function