add test case for reduction node sharing
[sbp.git] / TODO
1 _____________________________________________________________________________
2 Immediately
3
4   - clean up util package
5
6   - currently we GC the doomed stack when the parent dies... but
7     [ideally] we should also GC the parent when the doomed stack dies
8     if it was a positive conjunct.
9
10   - single-tree-return assumption
11      - have a way to let question marks not be tagged?
12      - "flat" sequences (no subtrees contain "::"s?) -- stringifiable
13      - make it so that we can have multi-result nonterminals
14        so long as they always appear under double-colons?
15        auto-insert the unwrap?
16
17   - get rid of Sequence.Singleton if possible
18
19   - use 'a'-'z' or 'a-z' instead of [a-z]?
20   - de-genericize?
21   - foo.add(x)
22     foo.add(y.andnot(x)) ==> this is broken
23       - distinguish Conjunct from Sequence?
24             => !(Conjunct instanceof Reducible)
25   - avoid building the parts of the tree that end up getting dropped
26       - is it worth adding an additional class of states for these?
27          - or perhaps just a runtime node marker (hasNonDroppedParent)
28       - "ambiguity modulo dropped fragments"?
29          - this may conceal highly inefficient grammars...
30   - double-check all the region logic
31   - automatically collect time statistics and display
32
33 ______________________________________________________________________________
34 v1.1
35
36   - MUST HAVE BETTER ERROR MESSAGES
37      - use for developing java15.g
38      - better ambiguity reporting
39         - colorized tree-diffs?
40         - graphviz?
41      - better toString() methods all around...
42
43   - Treewalker code compiler?
44   - detect and reject circular gramars
45   - skeleton generator?
46   - precedes restrictions ("<-")
47   - More topology untangling [later]
48   - grammar highlighting?
49   - Forest needs a "manual access" API (lifting makes this hard)
50   - rewriting language? multiple passes?
51   - write some grammars
52       - Java grammar (java15.g)
53       - TeX (math?)
54       - RFC2822 (email message/headers)
55       - Wikipedia grammar (needs to be both lexerless and boolean)
56
57
58 ______________________________________________________________________________
59 Features
60
61   - try harder to "fuse" states together along two dimensions:
62      - identical (equivalent) states, or states that subsume each other
63      - unnecessary intermediate states ("short cut" GLR)
64
65   - substring parsing 
66       - better error messages
67       - Rekers & Koorn note that this can do really elegant and generalized "autocompletion".
68   - Parameterized LR
69   - "Regular Right Part" grammars (NP Chapman, etc)
70   - Attribute unification
71       - Partly-Linear-PATR? (O(n^6) unification grammar)
72
73   - optional "prefer whitespace higher up" disambiguation heuristic
74
75   - Incremental parse table construction
76
77   - "lazy GLR" and "lazy trees" -> language with first-class CF matching
78       - perhaps linear boolean grammars instead? (linear time, quad space)
79
80   - Followed-by and not-followed-by predicates of arbitrary length
81       - expands the grammar beyond Boolean LR...
82       - requires *very* smart garbage collection
83
84 ______________________________________________________________________________
85 Optimizations
86
87   - understand and implement the RNGLR "kernel state" optimization.
88     The _Practical Early Parsing_ paper may help.
89
90   - implement Johnstone's algorithm for "reduced, resolved LR
91     tables" to eliminate superfluous reductions on
92     epsilon-transitions.
93
94   - Implement a k-token peek buffer (for each state, see if it "dead
95     ends" during the next k Phases based solely on state -- ignoring
96     result SPPF)
97
98   - Is there any way we can avoid creating a GSS.Node instance for
99     nodes which are transient in the sense that they have only one
100     eligible reduction?
101
102   - Re-read Rekers, particularly the stuff on optimal sharing
103
104   - bring back in parse-table phase resolution of precedence (just
105     like associativity).  This can be inferred from the use of ">"
106     when the rules are in one of these special forms:
107
108        E ::=  E     _
109            >  _     E
110
111        E ::=  _     E
112            >  E  _  E
113
114        E ::=  E  _  E
115            >  E  _  E
116
117     where "_" is anything and "E" is the defining nonterminal.
118     Essentially what we're looking for is the situation where the
119     leftmost portion of one rule produces another rule, and the
120     rightmost portion of the latter produces the former.
121
122     I'm not 100% certain that this is as "strong" as the prefer/avoid
123     form (try to prove this, you probably can), but it's "what people
124     intend" most of the time.
125