checkpoint
[sbp.git] / TODO
1 // priorities are all messy and dont get serialized
2 // 1. Error messages
3 // 2. Java MetaGrammar (proof of concept)
4 // 3. Ivan's MetaGrammar
5 // 4. Documentation format
6 //       - TIB
7
8 // TODO: better API for interfacing with Java
9 // TODO: error messages
10 // TODO: integrate with TIB
11
12 // Element
13 // Walk
14 // ParseTable / GSS
15 // MetaGrammar (necessary/relevant?)
16 // Tree<String> (cleanup?)
17 // Union.SubUnion
18 // Repeat
19
20 // FEATURE: serialization of ParseTable's, generation of Java code
21 // FEATURE: infer reject elements for literals
22 // FEATURE: prefer whitespace higher up
23 // FEATURE: full conjunctive and boolean grammars
24 // FEATURE: "ambiguity modulo dropped fragments"?  can this be checked for statically?  eliminated statically?
25 //            - drop stuff during the parsing process (drop nodes)
26
27 // LATER: Element<A> -- parameterize over the input token type?  Makes a huge mess...
28 // LATER: Go back to where Sequence is not an Element?
29 //            - The original motivation for making Sequence "first class" was the fact that 
30 //              in order to do associativity right you need to have per-Sequence follow sets
31
32 ______________________________________________________________________________
33 Immediately
34
35   - switch maximal to not-followed-by (~/~)
36
37   - should Union.add() be there?
38   - should Atom.top() be there?
39
40   - fix the location stuff, it's broken
41   - decent/better error messages
42
43   - write some grammars
44       - Java grammar
45       - TeX (math?)
46       - URL (RFC)
47       - RFC2822 (email message/headers)
48       - Wiki grammar
49
50 ______________________________________________________________________________
51 Soon
52
53   - clean up the whole Walk situation
54
55   - cleaner solution to "maximal"?
56
57   - "lift" cases:
58       - right now I can only lift the last child in a forest...  begs
59         the question of what the right representation for Forests is
60         if we need to be able to do lift operations on it.
61
62   - Parameterized LR
63   - "Regular Right Part" grammars (NP Chapman, etc)
64   - Attribute unification
65
66 ______________________________________________________________________________
67 Later
68
69   - Implement a k-token peek buffer (for each state, see if it "dead
70     ends" during the next k Phases based solely on state -- ignoring
71     result SPPF)
72
73   - Arrange for the SPPF corresponding to dropped subtrees to never be
74     generated (or merged, etc)
75
76   - Is there any way we can avoid creating a GSS.Node instance for
77     nodes which are transient in the sense that they have only one
78     eligible reduction?
79
80   - Implement "GLR syntactic predicates" -- the ability to do
81     arbitrary lookahead (ie "followed-by" and "not-followed-by" for
82     arbitrary patterns).  This enables generalized longest-match and
83     lets us drop the Maximal hack.
84
85   - Re-read Rekers, particularly the stuff on optimal sharing
86
87   - Isolate the Element objects from Parse.Table/GSS so we can move
88     towards compilation.
89
90   - consider allowing a Forest.Body to represent some other Tree whose
91     Body's should be [recursively] considered part of this Forest.
92
93       - perhaps not: right now we have a nice situation where
94         Forest.Ref instances become immutable once iterator()ed.  This
95         also gives us a strong place to to culling with the certainty
96         that we won't throw out a Body which would later be salvaged
97         by some yet-to-be-added dependency.
98
99   - Figure out if there is a way to:
100
101       - allow unwrapping of children other than the very last one.
102
103       - fold repetitions into an array form in Forest, before
104         conversion to Tree.  The major problem here is that multiple
105         tree-arrays are possible, all of different lengths.  Worse,
106         even if they're all the same length, not all elements belong
107         in the same "possibility vector" as all others.  You
108         essentially need a GSS to represent the array, which perhaps
109         is what the unfolded form was in the first place.
110
111   - Wikipedia grammar (needs to be both lexerless and boolean)
112
113   - Boolean Parsing
114       => Ordered Choice (";" operator)
115
116   - bring back in parse-table phase resolution of precedence (just
117     like associativity).  This can be inferred from the use of ">"
118     when the rules are in one of these special forms:
119
120        E ::=  E     _
121            >  _     E
122
123        E ::=  _     E
124            >  E  _  E
125
126        E ::=  E  _  E
127            >  E  _  E
128
129     where "_" is anything and "E" is the defining nonterminal.
130     Essentially what we're looking for is the situation where the
131     leftmost portion of one rule produces another rule, and the
132     rightmost portion of the latter produces the former.
133
134     I'm not 100% certain that this is as "strong" as the prefer/avoid
135     form (try to prove this, you probably can), but it's "what people
136     intend" most of the time.
137
138   - implement Johnstone's algorithm for "reduced, resolved LR
139     tables" to eliminate superfluous reductions on
140     epsilon-transitions.