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