2020-09-11 01:28:06 -07:00
|
|
|
/*
|
|
|
|
* vm.h - Header file for BPEG virtual machine.
|
|
|
|
*/
|
|
|
|
#ifndef VM__H
|
|
|
|
#define VM__H
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2020-12-12 16:31:53 -08:00
|
|
|
typedef enum {
|
|
|
|
PRINT_COLOR = 1<<0,
|
|
|
|
PRINT_LINE_NUMBERS = 1<<1,
|
|
|
|
} print_options_t;
|
|
|
|
|
2020-09-12 18:20:13 -07:00
|
|
|
const char *opcode_name(enum VMOpcode o);
|
2020-09-23 22:37:28 -07:00
|
|
|
__attribute__((hot, nonnull))
|
2020-09-16 19:35:43 -07:00
|
|
|
match_t *match(grammar_t *g, file_t *f, const char *str, vm_op_t *op, unsigned int flags);
|
2020-09-23 22:37:28 -07:00
|
|
|
__attribute__((nonnull))
|
2020-09-11 01:28:06 -07:00
|
|
|
void destroy_match(match_t **m);
|
2020-09-23 22:37:28 -07:00
|
|
|
__attribute__((nonnull))
|
2020-12-12 16:31:53 -08:00
|
|
|
void print_match(file_t *f, match_t *m, print_options_t options);
|
2020-09-11 01:28:06 -07:00
|
|
|
|
|
|
|
#endif
|
2020-09-11 01:38:44 -07:00
|
|
|
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
|