|
|
1.1 root 1: /*
2: * The machine is laid out as a sequence of integers in the walker.
3: * The form described above is only used inside the preprocessor.
4: * Each machine state is one of the following sequence:
5: *
6: * TABLE <value_1><index_1>...<value_n><index_n> -1 [FAIL <fail_index>] -1
7: * or
8: * TABLE2 <value_1><index_1>...<value_n><index_n> -1 [FAIL <fail_index>] -1
9: * or
10: * ACCEPT <accept table index> -1
11: *
12: * The accept table is in the form:
13: *
14: * <tree index_1> ...<tree_index_m> -1
15: *
16: */
17:
18: #define FASTLIM 0
19: #define TABLE 1
20: #define FAIL 2
21: #define ACCEPT 3
22: #define TABLE2 4
23: #define EOT -1
24:
25: /* special machine state */
26: #define HANG -1
27:
28: /* used by the evaluator to interpret path table */
29: #define eSTOP 0
30: #define ePOP -1
31: #define eEVAL -2
32: #define eNEXT -3
33: #define ePUSH -4
34:
35: /* Tags that indicate the type of a value */
36: #define M_BRANCH 010000
37: #define M_NODE 0
38: #define M_LABEL 01000
39: #define MAX_NODE_VALUE 00777
40: #define MTAG_SHIFT 9
41: #define M_DETAG(x) ((x)&~(M_BRANCH|M_LABEL|M_NODE))
42:
43: /* predicates to tell whether a value x is of type NODE, BRANCH, or LABEL */
44: #define MI_NODE(x) (((x)&(M_BRANCH|M_LABEL))==0)
45: #define MI_DEFINED(x) ((x)!=-1)
46: #define MI_LABEL(x) (((x)&M_LABEL)!=0)
47: #define MI_BRANCH(x) (((x)&M_BRANCH)!=0)
48:
49: /* build a tagged value */
50: #define MV_NODE(x) (x)
51: #define MV_BRANCH(x) ((x)|M_BRANCH)
52: #define MV_LABEL(x) ((x)|M_LABEL)
53:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.