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