From 3fb5430080199a6d92a63f8259fe4a88df9b83ba Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 1 Feb 2022 12:22:34 +0800 Subject: need to stop abusing hash tables Hash tables take too much space! If I use hash tables, the length of the input will be severely limited, to an unacceptable extent. So we have to use arrays instead. --- src/bsr.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/bsr.h') diff --git a/src/bsr.h b/src/bsr.h index 6c5e17c..64e428a 100644 --- a/src/bsr.h +++ b/src/bsr.h @@ -25,6 +25,8 @@ hash-table's almost constant-time look-up feature to implement this. */ +/* FIXME: Don't use hash-tables, as that uses too much space! */ + /* A BSR set has two types. The first type is of the form @@ -99,6 +101,10 @@ BOOL bsr_find(CCR_MOD(bsr *) b, CCR_MOD(Grammar *) g, BOOL * const restrict errorp, NUM X, NUM a, NUM c, NUM i, NUM k, NUM j); +/* if not found return NULL */ +ht *bsr_lookup(CCR_MOD(bsr *) b, BOOL * const restrict errorp, + NUM X, NUM i, NUM j); + /* Change to new line after LINE_LEN many elements. */ void bsr_print(CCR_MOD(bsr *) b, CCR_MOD(Grammar *) g, NUM line_len); -- cgit v1.2.3-18-g5258