checkpoint
[sbp.git] / TODO
1 _____________________________________________________________________________
2 Immediately
3
4 - If a top-level rule has labels but no head-tag, like this
5     Foo = a:Bar b:Baz
6   then infer the name of the rule it belongs to
7
8 create( $c:{...}, class ) =
9   return create($c:{...})
10
11 create( h:{...}, class ) = 
12
13 create( , String)
14
15 create( _:{...}, String) = treat as char[]
16 create( _:{...}, c[] )   = { create(.,c), create(.,c), ... }
17
18 create( $c:{...} ) =
19
20
21   - clean up the visualization (?)
22
23   - I still don't like Atom.Infer and Atom.Invert...
24
25   - better ambiguity debugging tools
26
27   - ParseFailed, GSS, Walk, Parser, Sequence, Forest
28
29   - Fix the metagrammar (really?)
30       - evil problems with      (x y? z /ws)
31
32   - copyright notices
33   - documentation
34
35 ______________________________________________________________________________
36 v1.1
37
38   - finalize metagrammar and rdp-op's
39   - write some grammars
40       - Java grammar
41       - TeX (math?)
42       - URL (RFC)
43       - RFC2822 (email message/headers)
44   - clean up the whole Walk situation (?)
45
46   - what if Tree<> could unwrap itself?
47
48
49 ______________________________________________________________________________
50 Soon
51
52   - serialization of parse tables
53
54   - "ambiguity modulo dropped fragments"?
55        - can this be checked statically?
56        - eliminated statically?
57
58   - substring parsing for better error messages
59   - "lift" cases:
60       - right now I can only lift the last child in a forest...  begs
61         the question of what the right representation for Forests is
62         if we need to be able to do lift operations on it.
63
64   - Parameterized LR
65   - "Regular Right Part" grammars (NP Chapman, etc)
66   - Attribute unification
67
68   - inference of rejections for literals
69   - "prefer whitespace higher up" (?)
70
71   - Labeled edges on trees (associate a label with each slot in the
72     child array in Forest.Body?  might make equality tough) --
73     equivalent to Feature Structures.  Colon-labeling.
74
75 ______________________________________________________________________________
76 Later
77
78   - Partly-Linear-PATR? (O(n^6) unification grammar)
79
80   - Implement a k-token peek buffer (for each state, see if it "dead
81     ends" during the next k Phases based solely on state -- ignoring
82     result SPPF)
83
84   - Arrange for the SPPF corresponding to dropped subtrees to never be
85     generated (or merged, etc)
86
87   - Is there any way we can avoid creating a GSS.Node instance for
88     nodes which are transient in the sense that they have only one
89     eligible reduction?
90
91   - Re-read Rekers, particularly the stuff on optimal sharing
92
93   - Isolate the Element objects from Parse.Table/GSS so we can move
94     towards compilation.
95
96   - consider allowing a Forest.Body to represent some other Tree whose
97     Body's should be [recursively] considered part of this Forest.
98
99       - perhaps not: right now we have a nice situation where
100         Forest.Ref instances become immutable once iterator()ed.  This
101         also gives us a strong place to to culling with the certainty
102         that we won't throw out a Body which would later be salvaged
103         by some yet-to-be-added dependency.
104
105   - Figure out if there is a way to:
106
107       - allow unwrapping of children other than the very last one.
108
109       - fold repetitions into an array form in Forest, before
110         conversion to Tree.  The major problem here is that multiple
111         tree-arrays are possible, all of different lengths.  Worse,
112         even if they're all the same length, not all elements belong
113         in the same "possibility vector" as all others.  You
114         essentially need a GSS to represent the array, which perhaps
115         is what the unfolded form was in the first place.
116
117   - Wikipedia grammar (needs to be both lexerless and boolean)
118
119   - Boolean Parsing
120       => Ordered Choice (";" operator)
121
122   - bring back in parse-table phase resolution of precedence (just
123     like associativity).  This can be inferred from the use of ">"
124     when the rules are in one of these special forms:
125
126        E ::=  E     _
127            >  _     E
128
129        E ::=  _     E
130            >  E  _  E
131
132        E ::=  E  _  E
133            >  E  _  E
134
135     where "_" is anything and "E" is the defining nonterminal.
136     Essentially what we're looking for is the situation where the
137     leftmost portion of one rule produces another rule, and the
138     rightmost portion of the latter produces the former.
139
140     I'm not 100% certain that this is as "strong" as the prefer/avoid
141     form (try to prove this, you probably can), but it's "what people
142     intend" most of the time.
143
144   - implement Johnstone's algorithm for "reduced, resolved LR
145     tables" to eliminate superfluous reductions on
146     epsilon-transitions.
147
148 ______________________________________________________________________________
149 Neat Ideas
150
151   - Rekers & Koorn note that GLR Substring Parsing can be used to do
152     really elegant and generalized "autocompletion".
153
154
155 ______________________________________________________________________________
156 Ideas for the Future
157
158 - Incremental parse table construction
159 - "lazy GLR" and "lazy trees" -> language with first-class CF matching
160     - perhaps linear boolean grammars instead? (linear time, quad space)
161 - Forest parsing => chained parsers
162 - unification parsing, attributes, etc
163 - RRP grammars?
164 - Take another stab at maximal-match?  Nonterminal not-followed-by is
165   too strong.
166 - Error recovery based on substring parsing