Updated the help and version information in the backend programs. Also updated
[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 .B \-o " file"
46 Write output to file. If -o is not given, a default file name is chosen by
47 replacing the suffix of the input. For source files ending in .rh the suffix .h
48 is used. For all other source files a suffix based on the output language
49 is used (.c, .cpp, .m, .dot)
50 .TP
51 .B \-T0
52 Generate a table driven FSM. This is the default code style.  The table driven
53 FSM represents the state machine as static data. There are tables of states,
54 transitions, indicies and actions. The current state is stored in a variable.
55 The execution is a loop that looks that given the current state and current
56 character to process looks up the transition to take using a binary search,
57 executes any actions and moves to the target state. In general, the table
58 driven FSM produces a smaller binary and requires a less expensive host language
59 compile but results in slower running code. The table driven FSM is suitable
60 for any FSM.
61 .TP
62 .B \-T1
63 Generate a faster table driven FSM by expanding action lists in the action
64 execute code.
65 .TP
66 .B \-F0
67 Generate a flat table driven FSM. Transitions are represented as an array
68 indexed by the current alphabet character. This eliminates the need for a
69 binary search to locate transitions and produces faster code, however it is
70 only suitable for small alphabets.
71 .TP
72 .B \-F1
73 Generate a faster flat table driven FSM by expanding action lists in the action
74 execute code.
75 .TP
76 .B \-G0
77 Generate a goto driven FSM. The goto driven FSM represents the state machine
78 as a series of goto statements. While in the machine, the current state is
79 stored by the processor's instruction pointer. The execution is a flat function
80 where control is passed from state to state using gotos. In general, the goto
81 FSM produces faster code but results in a larger binary and a more expensive
82 host language compile.
83 .TP
84 .B \-G1
85 Generate a faster goto driven FSM by expanding action lists in the action
86 execute code.
87 .TP
88 .B \-G2
89 Generate a really fast goto driven FSM by embedding action lists in the state
90 machine control code.
91 .SH BUGS
92 Ragel is still under development and has not yet matured. There are probably
93 many bugs.
94 .SH CREDITS
95 Ragel was written by Adrian Thurston <thurston@cs.queensu.ca>.  Objective-C
96 output contributed by Erich Ocean. D output contributed by Alan West. 
97 .SH "SEE ALSO"
98 .BR ragel (1),
99 .BR rlgen-java (1),
100 .BR rlgen-ruby (1),
101 .BR rlgen-dot (1),
102 .BR re2c (1),
103 .BR flex (1)
104
105 Homepage: http://www.cs.queensu.ca/~thurston/ragel/