Having Grammar be a simple list of productions is elegant enough, but it doesn't really model the structure of a BNF grammar properly since there's nothing in it's structure explicitly connecting the nonterminals on the right to the nonterminals on the left, making Grammar a hashmap<Term, Vec<Expression>> would allow users to traverse grammars out of the box and be a good middle-ground between the current flat grammars and a fully connected approach.
i'm still uncertain about this idea and it's relatively low priority for now, in the meantime any feedback would be appreciated.
Having
Grammarbe a simple list of productions is elegant enough, but it doesn't really model the structure of a BNF grammar properly since there's nothing in it's structure explicitly connecting the nonterminals on the right to the nonterminals on the left, makingGrammarahashmap<Term, Vec<Expression>>would allow users to traverse grammars out of the box and be a good middle-ground between the current flat grammars and a fully connected approach.i'm still uncertain about this idea and it's relatively low priority for now, in the meantime any feedback would be appreciated.