## XbMachine XbMachine |

## Functions

gboolean | (*XbMachineOpcodeFixupFunc) ()
gboolean | (*XbMachineTextHandlerFunc) ()
gboolean | (*XbMachineMethodFunc) ()
XbMachine * | xb_machine_new ()
void | xb_machine_set_debug_flags ()
XbStack * | xb_machine_parse ()
XbStack * | xb_machine_parse_full ()
gboolean | xb_machine_run ()
gboolean | xb_machine_run_with_bindings ()
void | xb_machine_add_opcode_fixup ()
void | xb_machine_add_text_handler ()
void | xb_machine_add_method ()
void | xb_machine_add_operator ()
gboolean | xb_machine_opcode_func_init ()
gboolean | xb_machine_stack_pop ()
gboolean | xb_machine_stack_push ()
gboolean | xb_machine_stack_push_text ()
gboolean | xb_machine_stack_push_text_static ()
gboolean | xb_machine_stack_push_text_steal ()
gboolean | xb_machine_stack_push_integer ()
void | xb_machine_set_stack_size ()
guint | xb_machine_get_stack_size ()

## Types and Values

#define | XB_TYPE_MACHINE
struct | XbMachineClass
enum | XbMachineDebugFlags
enum | XbMachineParseFlags
| XbMachine

## Description

## Functions

### XbMachineOpcodeFixupFunc ()

    gboolean
    (*XbMachineOpcodeFixupFunc) (XbMachine *self,
                                 XbStack *opcodes,
                                 gpointer user_data,
                                 GError **error);

### XbMachineTextHandlerFunc ()

    gboolean
    (*XbMachineTextHandlerFunc) (XbMachine *self,
                                 XbStack *opcodes,
                                 const gchar *text,
                                 gboolean *handled,
                                 gpointer user_data,
                                 GError **error);

### XbMachineMethodFunc ()

    gboolean
    (*XbMachineMethodFunc) (XbMachine *self,
                            XbStack *stack,
                            gboolean *result_unused,
                            gpointer exec_data,
                            gpointer user_data,
                            GError **error);

### xb_machine_new ()

    XbMachine *
    xb_machine_new (void);

### xb_machine_set_debug_flags ()

    void
    xb_machine_set_debug_flags (XbMachine *self,
                                XbMachineDebugFlags flags);

### xb_machine_parse ()

    XbStack *
    xb_machine_parse (XbMachine *self,
                      const gchar *text,
                      gssize text_len,
                      GError **error);

`xb_machine_parse` is deprecated and should not be used in newly-written code.

### xb_machine_parse_full ()

    XbStack *
    xb_machine_parse_full (XbMachine *self,
                           const gchar *text,
                           gssize text_len,
                           XbMachineParseFlags flags,
                           GError **error);

### xb_machine_run ()

    gboolean
    xb_machine_run (XbMachine *self,
                    XbStack *opcodes,
                    gboolean *result,
                    gpointer exec_data,
                    GError **error);

`xb_machine_run` is deprecated and should not be used in newly-written code.

### xb_machine_run_with_bindings ()

    gboolean
    xb_machine_run_with_bindings (XbMachine *self,
                                  XbStack *opcodes,
                                  XbValueBindings *bindings,
                                  gboolean *result,
                                  gpointer exec_data,
                                  GError **error);

### xb_machine_add_opcode_fixup ()

    void
    xb_machine_add_opcode_fixup (XbMachine *self,
                                 const gchar *opcodes_sig,
                                 XbMachineOpcodeFixupFunc fixup_cb,
                                 gpointer user_data,
                                 GDestroyNotify user_data_free);

### xb_machine_add_text_handler ()

    void
    xb_machine_add_text_handler (XbMachine *self,
                                 XbMachineTextHandlerFunc handler_cb,
                                 gpointer user_data,
                                 GDestroyNotify user_data_free);

### xb_machine_add_method ()

    void
    xb_machine_add_method (XbMachine *self,
                           const gchar *name,
                           guint n_opcodes,
                           XbMachineMethodFunc method_cb,
                           gpointer user_data,
                           GDestroyNotify user_data_free);

### xb_machine_add_operator ()

    void
    xb_machine_add_operator (XbMachine *self,
                             const gchar *str,
                             const gchar *name);

### xb_machine_opcode_func_init ()

    gboolean
    xb_machine_opcode_func_init (XbMachine *self,
                                 XbOpcode *opcode,
                                 const gchar *func_name);

### xb_machine_stack_pop ()

    gboolean
    xb_machine_stack_pop (XbMachine *self,
                          XbStack *stack,
                          XbOpcode *opcode_out,
                          GError **error);

### xb_machine_stack_push ()

    gboolean
    xb_machine_stack_push (XbMachine *self,
                           XbStack *stack,
                           XbOpcode **opcode_out,
                           GError **error);

### xb_machine_stack_push_text ()

    gboolean
    xb_machine_stack_push_text (XbMachine *self,
                                XbStack *stack,
                                const gchar *str,
                                GError **error);

### xb_machine_stack_push_text_static ()

    gboolean
    xb_machine_stack_push_text_static (XbMachine *self,
                                       XbStack *stack,
                                       const gchar *str,
                                       GError **error);

### xb_machine_stack_push_text_steal ()

    gboolean
    xb_machine_stack_push_text_steal (XbMachine *self,
                                      XbStack *stack,
                                      gchar *str,
                                      GError **error);

### xb_machine_stack_push_integer ()

    gboolean
    xb_machine_stack_push_integer (XbMachine *self,
                                   XbStack *stack,
                                   guint32 val,
                                   GError **error);

### xb_machine_set_stack_size ()

    void
    xb_machine_set_stack_size (XbMachine *self,
                               guint stack_size);

### xb_machine_get_stack_size ()

    guint
    xb_machine_get_stack_size (XbMachine *self);

## Types and Values

### XB_TYPE_MACHINE

    #define XB_TYPE_MACHINE (xb_machine_get_type ())

### struct XbMachineClass

    struct XbMachineClass {
    	GObjectClass			 parent_class;
    };

### enum XbMachineDebugFlags

The flags to control the amount of debugging is generated.

#### Members

XB_MACHINE_DEBUG_FLAG_NONE | No debug flags to use |
XB_MACHINE_DEBUG_FLAG_SHOW_STACK | Show the stack addition and removal |
XB_MACHINE_DEBUG_FLAG_SHOW_PARSING | Show the XPath predicate parsing |
XB_MACHINE_DEBUG_FLAG_SHOW_OPTIMIZER | Show the optimizer operation |

### enum XbMachineParseFlags

The flags to control the parsing behaviour.

#### Members

XB_MACHINE_PARSE_FLAG_NONE | No flags set |
XB_MACHINE_PARSE_FLAG_OPTIMIZE | Run an optimization pass on the predicate |

### XbMachine

    typedef struct _XbMachine XbMachine;