Initialize Tizen 2.3
[external/ragel.git] / doc / RELEASE_NOTES_V2
1                      Porting Ragel Programs to Version 2
2                      ===================================
3
4
5 1. Move all ?, +, and * operators to the right hand side of the operand.
6
7     float = *digit ?('.' +digit);
8
9     float = digit* ('.' digit+)?;
10
11 2. Change all assignments to main from a definition using the = operator to an
12 instantiation using the := operator.
13
14     main = 'hello';
15
16     main := 'hello';
17
18 3. Remove $0 %! operations for clearing priorities.
19
20 4. Anywhere implicit default priorities of zero are used to interact with
21 explicitly set non-zero transitions, set the priorities to zero explicitly.
22
23     main := any* 'FIN' :1;
24
25     main := ( any $0 )* 'FIN' :1;
26
27 5. If priorities need to interact across different machines, use a common name.
28 Note that priority names default to the name of the machine they are assigned
29 to.
30
31     wild = any*;
32     main := wild 'FIN' :1;
33
34     wild = ( any $0 )*;
35     main := wild 'FIN' :wild,1;
36
37 6. If using clear keyword or operators modified with ^, duplicate the operand
38 machines and rewrite them such that the cleared actions and suppressed out
39 transitions and out priorities are removed.
40
41 7. Change func keyword to action.
42
43 8. Escape any - symbols and initial ^ symbol in or literals ([] outside of
44 regular expressions).
45
46     main := [^#$-+*];
47
48     main := [\^#$\-+*];
49
50 9. In C output, lowercase init, execute and finish routines and put an
51 underscore in between the fsm name and the function name. Also qualify
52 references to the fsm structure with the struct keyword.
53
54     fsm f;
55     fsmInit( &f );
56     fsmExecute( &f, buf, len );
57     fsmFinish( &f );
58
59     struct fsm f;
60     fsm_init( &f );
61     fsm_execute( &f, buf, len );
62     fsm_finish( &f );
63
64 10. In C++ output, lowercase the init, execute and finish routines. Also make
65 sure that the init routine is explicitly called.
66
67     fsm f;
68     f.Init();
69     f.Execute( buf, len );
70     f.Finish();
71
72     fsm f;
73     f.init();
74     f.execute( buf, len );
75     f.finish();
76
77 11. Remove calls to the accept routine, instead examine the return value of the
78 finish routine. If the machine does not accept then finish returns -1 or 0, if
79 the machine accepts then finish returns 1.
80
81     f.finish();
82     if ( f.accept() )
83         cout << "ACCEPT" << endl;
84
85     if ( f.finish() > 0 )
86         cout << "ACCEPT" << endl;