diff options
Diffstat (limited to 'src/grammar.h')
-rw-r--r-- | src/grammar.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/grammar.h b/src/grammar.h index 8d6cb06..cbda887 100644 --- a/src/grammar.h +++ b/src/grammar.h @@ -213,7 +213,7 @@ BOOL nt_first(CC_MOD(Grammar *) g, CCR_MOD(BOOL *) nts, On error return non-zero. */ BOOL tnt_first(CC_MOD(ht *) terminal_hts, CC_MOD(ht *) predicate_hts, - CCR_MOD(BOOL *) nts, NUM len, List *tnts, + CCR_MOD(BOOL *) nts, NUM len, CCR_MOD(List *) tnts, ht * const restrict result_terminals, ht * const restrict result_predicates); @@ -231,6 +231,27 @@ BOOL nt_follow(CC_MOD(Grammar *) g, CCR_MOD(BOOL *) nts, ht * const result_terminals, ht * const result_predicates); +/* struct that holds information about grammars */ + +typedef struct grammar_info_s grammar_info; + +struct grammar_info_s { + /* the grammar itself */ + Grammar *g; + /* the array about epsilon non-terminals */ + BOOL *nts; + /* the array of hash tables of first (premier) terminals */ + ht *pts; + /* the array of hash tables of first (premier) predicate + terminals */ + ht *pps; + /* the array of hash tables of follow (suivant) terminals */ + ht *sts; + /* the array of hash tables of follow (suivant) predicate + terminals */ + ht *sps; +}; + /* convenient macro */ #define NEW_CPA(X, ARRAY, SIZE) do { \ |