Updates to "machine instantiation", "write init" and "write exports" sectons.
[external/ragel.git] / doc / rlgen-cd.1.in
1 .\"
2 .\"   Copyright 2001-2007 Adrian Thurston <thurston@cs.queensu.ca>
3 .\"
4
5 .\"   This file is part of Ragel.
6 .\"
7 .\"   Ragel is free software; you can redistribute it and/or modify
8 .\"   it under the terms of the GNU General Public License as published by
9 .\"   the Free Software Foundation; either version 2 of the License, or
10 .\"   (at your option) any later version.
11 .\"
12 .\"   Ragel is distributed in the hope that it will be useful,
13 .\"   but WITHOUT ANY WARRANTY; without even the implied warranty of
14 .\"   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 .\"   GNU General Public License for more details.
16 .\"
17 .\"   You should have received a copy of the GNU General Public License
18 .\"   along with Ragel; if not, write to the Free Software
19 .\"   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
20
21 .\"   Process this file with
22 .\"   groff -man -Tascii rlgen-cd.1
23 .\"
24 .TH RLGEN-CD 1 "@PUBDATE@" "Ragel @VERSION@" "Ragel State Machine Compiler"
25 .SH NAME
26 rlgen-cd \- code generator for Ragel State Machine Compiler
27 .SH SYNOPSIS
28 .B rlgen-cd 
29 .RI [ options ]
30 .I file
31 .SH DESCRIPTION
32 This is a backend component of Ragel. This program accepts a machine compiled
33 by the frontend program ragel(1) and generates either C (compatible
34 with C++ and Objective-C) or D code.
35
36 Use it with the frontend options -C or -D.
37 .SH OPTIONS
38 .TP
39 .BR \-h ", " \-H ", " \-? ", " \-\-help
40 Display help and exit.
41 .TP
42 .BR \-v
43 Display version information and exit.
44 .TP
45 .BR \-l
46 Inhibit the writing of #line directives in generated code.
47 .TP
48 .B \-o " file"
49 Write output to file. If -o is not given, a default file name is chosen by
50 replacing the suffix of the input. For source files ending in .rh the suffix .h
51 is used. For all other source files a suffix based on the output language
52 is used (.c, .cpp, .m, .dot)
53 .TP
54 .B \-T0
55 Generate a table driven FSM. This is the default code style.  The table driven
56 FSM represents the state machine as static data. There are tables of states,
57 transitions, indicies and actions. The current state is stored in a variable.
58 The execution is a loop that looks that given the current state and current
59 character to process looks up the transition to take using a binary search,
60 executes any actions and moves to the target state. In general, the table
61 driven FSM produces a smaller binary and requires a less expensive host language
62 compile but results in slower running code. The table driven FSM is suitable
63 for any FSM.
64 .TP
65 .B \-T1
66 Generate a faster table driven FSM by expanding action lists in the action
67 execute code.
68 .TP
69 .B \-F0
70 Generate a flat table driven FSM. Transitions are represented as an array
71 indexed by the current alphabet character. This eliminates the need for a
72 binary search to locate transitions and produces faster code, however it is
73 only suitable for small alphabets.
74 .TP
75 .B \-F1
76 Generate a faster flat table driven FSM by expanding action lists in the action
77 execute code.
78 .TP
79 .B \-G0
80 Generate a goto driven FSM. The goto driven FSM represents the state machine
81 as a series of goto statements. While in the machine, the current state is
82 stored by the processor's instruction pointer. The execution is a flat function
83 where control is passed from state to state using gotos. In general, the goto
84 FSM produces faster code but results in a larger binary and a more expensive
85 host language compile.
86 .TP
87 .B \-G1
88 Generate a faster goto driven FSM by expanding action lists in the action
89 execute code.
90 .TP
91 .B \-G2
92 Generate a really fast goto driven FSM by embedding action lists in the state
93 machine control code.
94 .SH BUGS
95 Ragel is still under development and has not yet matured. There are probably
96 many bugs.
97 .SH CREDITS
98 Ragel was written by Adrian Thurston <thurston@cs.queensu.ca>.  Objective-C
99 output contributed by Erich Ocean. D output contributed by Alan West. 
100 .SH "SEE ALSO"
101 .BR ragel (1),
102 .BR rlgen-java (1),
103 .BR rlgen-ruby (1),
104 .BR rlgen-dot (1),
105 .BR re2c (1),
106 .BR flex (1)
107
108 Homepage: http://www.cs.queensu.ca/~thurston/ragel/