comparison anagram/agcore/q1glbl.h @ 0:13d2b8934445

Import AnaGram (near-)release tree into Mercurial.
author David A. Holland
date Sat, 22 Dec 2007 17:52:45 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:13d2b8934445
1 /*
2 * AnaGram, A System for Syntax Directed Programming
3 * Copyright 1993-1999 Parsifal Software. All Rights Reserved.
4 * See the file COPYING for license and usage terms.
5 *
6 * q1glbl.h
7 */
8
9 #ifndef Q1GLBL_H
10 #define Q1GLBL_H
11
12 struct tsd;
13 struct tuple_dict;
14 struct list_dict;
15
16 //#define WIDTH short
17
18 struct state_number_map {
19 unsigned previous_states_index;
20 unsigned completions_index;
21 unsigned completed_forms_index;
22 unsigned gotos_index;
23 unsigned reductions_index;
24 unsigned actions_index;
25 unsigned chain_completions_index;
26 unsigned chain_gotos_index;
27 unsigned engine_index;
28 unsigned char_token;
29 unsigned key_list;
30 unsigned key_index;
31 unsigned n_reductions;
32 unsigned
33 n_previous_states,
34 n_gotos,
35 n_chain_gotos,
36 n_actions,
37 n_terminals;
38 unsigned
39 n_completions,
40 n_chain_completions,
41 n_completed_forms;
42 unsigned sticky : 1;
43 //unsigned subgrammar: 1;
44 };
45
46 #define a_actions_index actions_index
47 #define t_actions_index actions_index
48 #define p_actions_index actions_index
49
50 struct item_map {
51 int form_number;
52 int form_index;
53 int chain_item;
54 };
55
56 struct completed_form_map {
57 unsigned reduction_states_index;
58 unsigned n_reduction_states;
59 int external_reduction : 1;
60 };
61
62 extern item_map *map_item;
63 extern state_number_map *map_state_number;
64
65 extern completed_form_map *map_completed_form;
66 extern tuple_dict *completed_form_dict;
67
68 extern tsd *bnf_table; /* {tkn#,form#} backus normal form */
69 extern tsd *ibnf_table; /* {form#, token#} inverse bnf */
70
71 extern int parse_table_length;
72
73 extern int *ibnfs;
74 extern int *ibnfb;
75 extern int *ibnfn;
76
77 extern int *tut;
78 //extern tsd *gtt; /* {itemset#, token#, itemset#} goto table */
79 extern int *token_perm; /* token sort permutation base */
80 extern unsigned perm_index; /* length of sorted token list */
81 extern tsd *srt; /* summary return table for current is */
82 extern tsd *sgt; /* summary goto table for current is */
83 extern unsigned *items; /* {itemset#, item#, index} itemset table */
84 extern int lits; /* length of item set */
85 extern int ncssa;
86 extern list_dict *isht_dict;
87 extern unsigned kits; /* itemset under investigation */
88 extern unsigned nits; /* number of item sets */
89 extern unsigned nforms; /* number of forms */
90 extern unsigned nforms_base;
91 extern unsigned nitems; /* number of items */
92 extern unsigned ntkns; /* number of tokens */
93 extern unsigned frs; /* forms to reduce */
94 extern unsigned kfrs; /* count of forms to reduce */
95 //extern tsd *cft; /* complete form table */
96
97
98 #endif /* Q1GLBL_H */