Mercurial > ~dholland > hg > ag > index.cgi
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/anagram/agcore/q1glbl.h Sat Dec 22 17:52:45 2007 -0500 @@ -0,0 +1,98 @@ +/* + * AnaGram, A System for Syntax Directed Programming + * Copyright 1993-1999 Parsifal Software. All Rights Reserved. + * See the file COPYING for license and usage terms. + * + * q1glbl.h + */ + +#ifndef Q1GLBL_H +#define Q1GLBL_H + +struct tsd; +struct tuple_dict; +struct list_dict; + +//#define WIDTH short + +struct state_number_map { + unsigned previous_states_index; + unsigned completions_index; + unsigned completed_forms_index; + unsigned gotos_index; + unsigned reductions_index; + unsigned actions_index; + unsigned chain_completions_index; + unsigned chain_gotos_index; + unsigned engine_index; + unsigned char_token; + unsigned key_list; + unsigned key_index; + unsigned n_reductions; + unsigned + n_previous_states, + n_gotos, + n_chain_gotos, + n_actions, + n_terminals; + unsigned + n_completions, + n_chain_completions, + n_completed_forms; + unsigned sticky : 1; + //unsigned subgrammar: 1; +}; + +#define a_actions_index actions_index +#define t_actions_index actions_index +#define p_actions_index actions_index + +struct item_map { + int form_number; + int form_index; + int chain_item; +}; + +struct completed_form_map { + unsigned reduction_states_index; + unsigned n_reduction_states; + int external_reduction : 1; +}; + +extern item_map *map_item; +extern state_number_map *map_state_number; + +extern completed_form_map *map_completed_form; +extern tuple_dict *completed_form_dict; + +extern tsd *bnf_table; /* {tkn#,form#} backus normal form */ +extern tsd *ibnf_table; /* {form#, token#} inverse bnf */ + +extern int parse_table_length; + +extern int *ibnfs; +extern int *ibnfb; +extern int *ibnfn; + +extern int *tut; +//extern tsd *gtt; /* {itemset#, token#, itemset#} goto table */ +extern int *token_perm; /* token sort permutation base */ +extern unsigned perm_index; /* length of sorted token list */ +extern tsd *srt; /* summary return table for current is */ +extern tsd *sgt; /* summary goto table for current is */ +extern unsigned *items; /* {itemset#, item#, index} itemset table */ +extern int lits; /* length of item set */ +extern int ncssa; +extern list_dict *isht_dict; +extern unsigned kits; /* itemset under investigation */ +extern unsigned nits; /* number of item sets */ +extern unsigned nforms; /* number of forms */ +extern unsigned nforms_base; +extern unsigned nitems; /* number of items */ +extern unsigned ntkns; /* number of tokens */ +extern unsigned frs; /* forms to reduce */ +extern unsigned kfrs; /* count of forms to reduce */ +//extern tsd *cft; /* complete form table */ + + +#endif /* Q1GLBL_H */