Updates to TODO and error message.
[external/ragel.git] / TODO
1 Ragel 6.0 Changes
2 =================
3
4 Remove old action embedding and condition setting syntax.
5
6 Expressions of the form: ( expr1 <: expr2 . expr3 ) sometimes don't behave as
7 expected. If expr2 contains the empty string then it's possible for the machine
8 to escape to expr3. This is somewhat unexpected.  The empty string does count
9 as moving through the right machine so there should not be an exception for
10 this case. Using the stronger implementation: ( expr1 $1 %0 . expr2 ) will
11 solve the problem.
12
13 Also, there is potential for nondeterminism to persist via the empty string
14 with the :> and :>> operators. Should also guard against this using leaving
15 priorities.
16
17 fbreak should advance the current char. Depreciate fbreak and add
18     fctl_break;
19     fctl_return <expr>;
20     fctl_goto <label>;
21
22 fbreak should execute the to-state actions of the target state. The semantics
23 of fbreak should be identical to reaching the end of a buffer block.
24
25 Introduce a new variable "eof" which is a pointer like pe. It gets set to pe
26 when the input has ended. This would enable eof actions to go into the main
27 loop, granting them the ability to manipulate p and cs. This would free us from
28 requiring some eof character to be sent to scanners to 'flush out' the last
29 token.  Instead an eof action can now execute scanner pattern actions and
30 backtrack if necessary.
31
32 The tokstart/tokend variable should be shortened to ts/te.
33
34 Eliminate tokend, replace it with the marker variable and add ftokend/ftoklen.
35
36 Add the accept action embedding operator: like eof but only for states that end
37 up final. Add the combined pending/accept action. This becomes a good idea when
38 eof action execution is moved into the main loop.
39
40 ================
41 END 6.0 Features
42
43 Check initts on calls to scanners, may be necessary to stuff the initts into
44 the call.
45
46 Add a prefix operator which sets every state final.
47
48 Minimization should remove a condition when the character allows both
49 the positive and negative sense of the condition. This happens in:
50 test_every_10_chars = ( ( c when test_len ) c{0,9} )**;
51 In this example there is non-determinsm that is killed by the priorities, but
52 since conditions are expanded before priorities are tested, many transitions
53 end up with test_len || !test_len.
54
55 Should be possible to include scanner definitions in another scanner.
56
57 Need an "entry name;" feature, causing name to get written out with the other
58 entry points in the data.
59
60 Possibly bring back the old semantics of > in a new operator, or allow it to be
61 defined somehow.
62
63 When priorities are embedded without a name, the name of the current machine is
64 used. Perhaps a unique name for each instance of the current machine should be
65 used instead. This idea could work well if applied to user-defined embeddings. 
66
67 User defined embeddings <-name(a1,a2,...).
68 User defined operators expr1 <name> expr2.
69
70 Doesn't make make sense for [] to be the lambda (zero-length) machine. This
71 should be the empty set (the empty machine). But then would it be invalid in a
72 regular expression?
73
74 The |> guarded operator and the <| guarded operator need to be added.
75
76 The fixed size stack is a problem for manual recursion of unlimited depth.
77
78 An option to turn off the removal of duplicate actions might be useful for
79 analyzing unintentional nondeterminism.
80
81 Might be a good idea to add in some protection against using up all of a
82 system's memory. This protection could then be removed by people when someone
83 is sure they want to use a lot of memory.
84
85
86 If a scanner can be optimized into a pure state machine, maybe permit it to be
87 referenced as a machine definition. Alternately: inline scanners with an
88 explicit exit pattern.
89
90 The split codegen needs a profiler connected to a graph partitioning algorithm.
91
92 Die a graceful death when rlcodegen -F receives large alphabets.
93
94 It's not currently possible to have more than one machine in a single function
95 because of label conflicts. Labels should have a unique prefix.
96
97 Emit a warning when a subtraction has no effect.
98
99 Emit a warning when unnamed priorities are used in longest match machines.
100 These priorities may unexpectedly interact across longest-match items. Changing
101 the language such that unwated interaction cannot happen would require naming
102 longest-match items.
103
104 Testing facilities: Quick easy way to query which strings are accepted.
105 Enumerate all accepted strings. From Nicholas Maxwell Lester.
106
107 Add more examples, add more tests and write more documentation.
108
109 A debugger would be nice. Ragel could emit a special debug version that
110 prompted for debug commands that allowed the user to step through the machine
111 and get details about where they are in their RL.
112
113 A quick and easy alternative would be a trace code generation option. This
114 would open a trace file and list all the active machines at each step of the
115 input.
116
117 Frontend should allow the redefinition of fsm section delimiters.
118
119 Do more to obscure ragel's private variables. Just a leading underscore is not
120 enough. Maybe something more like __ri__.
121
122 Some talk about capturing data:
123
124 Separate tokstart/tokend from the backtracking.  One var for preservation,
125 called preserve.  Write delcarations;  produces the necessary variables used by
126 ragel.  Move pattern start pattern end concepts into the general?  The
127 variables which may need to influence the preserve is dependent on the state.
128 States have a concept of which variables are in use.  Can be used for length
129 restrictions.  If there is an exit pattern, it is the explicit way out,
130 otherwise the start state and all final states are a way out.