| 1 |
|
| 2 |
|
| 3 |
#ifndef RXSPENCERH |
| 4 |
#define RXSPENCERH |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
#include "rxproto.h" |
| 26 |
#include "rxnode.h" |
| 27 |
#include "rxunfa.h" |
| 28 |
#include "rxanal.h" |
| 29 |
#include "inst-rxposix.h" |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
#define RX_MANY_CASES 30 |
| 34 |
|
| 35 |
|
| 36 |
typedef enum rx_answers (*rx_vmfn) |
| 37 |
P((void * closure, |
| 38 |
unsigned const char ** burst, int * len, int * offset, |
| 39 |
int start, int end, int need)); |
| 40 |
|
| 41 |
typedef enum rx_answers (*rx_contextfn) |
| 42 |
P((void * closure, |
| 43 |
struct rexp_node * node, |
| 44 |
int start, int end, |
| 45 |
struct rx_registers * regs)); |
| 46 |
|
| 47 |
|
| 48 |
struct rx_solutions |
| 49 |
{ |
| 50 |
int step; |
| 51 |
|
| 52 |
int cset_size; |
| 53 |
struct rexp_node * exp; |
| 54 |
struct rexp_node ** subexps; |
| 55 |
struct rx_registers * regs; |
| 56 |
|
| 57 |
int start; |
| 58 |
int end; |
| 59 |
|
| 60 |
rx_vmfn vmfn; |
| 61 |
rx_contextfn contextfn; |
| 62 |
void * closure; |
| 63 |
|
| 64 |
struct rx_unfaniverse * verse; |
| 65 |
struct rx_unfa * dfa; |
| 66 |
struct rx_classical_system match_engine; |
| 67 |
struct rx_unfa * left_dfa; |
| 68 |
struct rx_classical_system left_match_engine; |
| 69 |
|
| 70 |
int split_guess; |
| 71 |
struct rx_solutions * left; |
| 72 |
struct rx_solutions * right; |
| 73 |
|
| 74 |
int interval_x; |
| 75 |
|
| 76 |
int saved_rm_so; |
| 77 |
int saved_rm_eo; |
| 78 |
|
| 79 |
int final_tag; |
| 80 |
}; |
| 81 |
|
| 82 |
extern struct rx_solutions rx_no_solutions; |
| 83 |
|
| 84 |
|
| 85 |
#ifdef __STDC__ |
| 86 |
extern struct rx_solutions * rx_make_solutions (struct rx_registers * regs, struct rx_unfaniverse * verse, struct rexp_node * expression, struct rexp_node ** subexps, int cset_size, int start, int end, rx_vmfn vmfn, rx_contextfn contextfn, void * closure); |
| 87 |
extern void rx_free_solutions (struct rx_solutions * solns); |
| 88 |
extern int rx_best_end_guess (struct rx_solutions * solns, struct rexp_node * exp, int bound); |
| 89 |
extern enum rx_answers rx_next_solution (struct rx_solutions * solns); |
| 90 |
|
| 91 |
#else |
| 92 |
extern struct rx_solutions * rx_make_solutions (); |
| 93 |
extern void rx_free_solutions (); |
| 94 |
extern int rx_best_end_guess (); |
| 95 |
extern enum rx_answers rx_next_solution (); |
| 96 |
|
| 97 |
#endif |
| 98 |
|
| 99 |
#endif |