1
2
3RLGEN-CD(1) Ragel State Machine Compiler RLGEN-CD(1)
4
5
6
8 rlgen-cd - code generator for Ragel State Machine Compiler
9
11 rlgen-cd [options] file
12
14 This is a backend component of Ragel. This program accepts a machine
15 compiled by the frontend program ragel(1) and generates either C (com‐
16 patible with C++ and Objective-C) or D code.
17
18 Use it with the frontend options -C or -D.
19
21 -h, -H, -?, --help
22 Display help and exit.
23
24 -v Display version information and exit.
25
26 -l Inhibit the writing of #line directives in generated code.
27
28 -o file
29 Write output to file. If -o is not given, a default file name is
30 chosen by replacing the suffix of the input. For source files
31 ending in .rh the suffix .h is used. For all other source files
32 a suffix based on the output language is used (.c, .cpp, .m,
33 .dot)
34
35 -T0 Generate a table driven FSM. This is the default code style.
36 The table driven FSM represents the state machine as static
37 data. There are tables of states, transitions, indicies and
38 actions. The current state is stored in a variable. The execu‐
39 tion is a loop that looks that given the current state and cur‐
40 rent character to process looks up the transition to take using
41 a binary search, executes any actions and moves to the target
42 state. In general, the table driven FSM produces a smaller
43 binary and requires a less expensive host language compile but
44 results in slower running code. The table driven FSM is suitable
45 for any FSM.
46
47 -T1 Generate a faster table driven FSM by expanding action lists in
48 the action execute code.
49
50 -F0 Generate a flat table driven FSM. Transitions are represented as
51 an array indexed by the current alphabet character. This elimi‐
52 nates the need for a binary search to locate transitions and
53 produces faster code, however it is only suitable for small
54 alphabets.
55
56 -F1 Generate a faster flat table driven FSM by expanding action
57 lists in the action execute code.
58
59 -G0 Generate a goto driven FSM. The goto driven FSM represents the
60 state machine as a series of goto statements. While in the
61 machine, the current state is stored by the processor's instruc‐
62 tion pointer. The execution is a flat function where control is
63 passed from state to state using gotos. In general, the goto FSM
64 produces faster code but results in a larger binary and a more
65 expensive host language compile.
66
67 -G1 Generate a faster goto driven FSM by expanding action lists in
68 the action execute code.
69
70 -G2 Generate a really fast goto driven FSM by embedding action lists
71 in the state machine control code.
72
74 Ragel is still under development and has not yet matured. There are
75 probably many bugs.
76
78 Ragel was written by Adrian Thurston <thurston@cs.queensu.ca>. Objec‐
79 tive-C output contributed by Erich Ocean. D output contributed by Alan
80 West.
81
83 ragel(1), rlgen-java(1), rlgen-ruby(1), rlgen-dot(1), re2c(1), flex(1)
84
85 Homepage: http://www.cs.queensu.ca/~thurston/ragel/
86
87
88
89Ragel 6.2 March 2008 RLGEN-CD(1)