diff options
author | JSDurand <mmemmew@gmail.com> | 2022-02-05 17:30:11 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2022-02-05 17:30:11 +0800 |
commit | 510b10b96b546fcc6c6b6be85050305ddd192a41 (patch) | |
tree | 997d6c3f2c0a1ad6e27127d54a94655527e57864 /src/grammar.h | |
parent | 3fb5430080199a6d92a63f8259fe4a88df9b83ba (diff) |
replace some hash table usage by tuples
Previously I used hash tables, which consume too much memory. Now the
critical parts are replaced by a new hand-written library called
"tuple.h". Now we can easily parse larger inputs. I haven't tested
its limits, though.
Diffstat (limited to 'src/grammar.h')
-rw-r--r-- | src/grammar.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/grammar.h b/src/grammar.h index fd8d5c9..e18ad0e 100644 --- a/src/grammar.h +++ b/src/grammar.h @@ -231,6 +231,13 @@ BOOL nt_follow(CC_MOD(Grammar *) g, CCR_MOD(BOOL *) nts, ht * const result_terminals, ht * const result_predicates); +/* TODO: Compute which non-terminals are "LL(1)" non-terminals. With + this information, we can save the time to insert a process + descriptor and pop that descriptor, if we know the non-terminal in + question is "LL(1)". A non-terminal A is defined as "LL(1)" if its + different rules have disjoint FIRST sets, and if FIRST(A) is + disjoint from FOLLOW(A), when A is nullable. */ + /* struct that holds information about grammars */ typedef struct grammar_info_s grammar_info; |