PREFIX = @prefix@
# Rules.
-all: ragel-guide.pdf ragel.1 rlcodegen.1
+all: ragel-guide.pdf ragel.1 rlgen-cd.1 rlgen-java.1 rlgen-ruby.1 rlgen-dot.1
ragel-guide.pdf: $(PDFFIGS) $(INPUT)
echo '\def\version{$(VERSION)}' > version.tex
echo '\def\pubdate{$(PUBDATE)}' >> version.tex
-ragel.1: ragel.1.in ../version.mk
- cat ragel.1.in | sed 's/@PUBDATE@/$(PUBDATE)/' \
- | sed 's/@VERSION@/$(VERSION)/' > ragel.1
+%.1: %.1.in ../version.mk
+ cat $< | sed 's/@PUBDATE@/$(PUBDATE)/' \
+ | sed 's/@VERSION@/$(VERSION)/' > $@
-rlcodegen.1: rlcodegen.1.in ../version.mk
- cat rlcodegen.1.in | sed 's/@PUBDATE@/$(PUBDATE)/' \
- | sed 's/@VERSION@/$(VERSION)/' > rlcodegen.1
+#rlcodegen.1: rlcodegen.1.in ../version.mk
+# cat rlcodegen.1.in | sed 's/@PUBDATE@/$(PUBDATE)/' \
+# | sed 's/@VERSION@/$(VERSION)/' > rlcodegen.1
clean:
rm -f ragel.1 rlcodegen.1 \
.\"
-.\" Copyright 2001-2005 Adrian Thurston <thurston@cs.queensu.ca>
+.\" Copyright 2001-2007 Adrian Thurston <thurston@cs.queensu.ca>
.\"
.\" This file is part of Ragel.
.\"
-.\" Copyright 2001 Adrian Thurston <thurston@cs.queensu.ca>
+.\" Copyright 2001-2007 Adrian Thurston <thurston@cs.queensu.ca>
.\"
.\" This file is part of Ragel.
.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
.\" Process this file with
-.\" groff -man -Tascii rlcodegen.1
+.\" groff -man -Tascii rlgen-cd.1
.\"
-.TH RAGEL 1 "@PUBDATE@" "Ragel @VERSION@" "Ragel State Machine Compiler"
+.TH RLGEN-CD 1 "@PUBDATE@" "Ragel @VERSION@" "Ragel State Machine Compiler"
.SH NAME
-rlcodegen \- code generator for Ragel State Machine Compiler
+rlgen-cd \- code generator for Ragel State Machine Compiler
.SH SYNOPSIS
-.B rlcodegen
+.B rlgen-cd
.RI [ options ]
.I file
.SH DESCRIPTION
-.B Note:
-this is the backend component of Ragel. This program accepts a machine
-compiled by the frontend program ragel(1) and generates either code or a
-graphviz dot file.
+This is a backend component of Ragel. This program accepts a machine compiled
+by the frontend program ragel(1) and generates either C (compatible
+with C++ and Objective-C) or D code.
+Use it with the frontend options -C or -D.
.SH OPTIONS
.TP
.BR \-h ", " \-H ", " \-? ", " \-\-help
Display help and exit.
.TP
+.BR \-v
+Display version information and exit.
+.TP
.B \-o " file"
Write output to file. If -o is not given, a default file name is chosen by
replacing the suffix of the input. For source files ending in .rh the suffix .h
is used. For all other source files a suffix based on the output language
is used (.c, .cpp, .m, .dot)
.TP
-.B \-V
-Generate a Graphviz dotfile instead of code. By default this option writes the
-dotfile to standard output. The frontend options -M and -S can be used
-to specify a subset of the grammar to write.
-.TP
-.B \-p
-Print printable characters in Graphviz output.
-.TP
.B \-T0
Generate a table driven FSM. This is the default code style. The table driven
FSM represents the state machine as static data. There are tables of states,
output contributed by Erich Ocean. D output contributed by Alan West.
.SH "SEE ALSO"
.BR ragel (1),
+.BR rlgen-java (1),
+.BR rlgen-ruby (1),
+.BR rlgen-dot (1),
.BR re2c (1),
.BR flex (1)
--- /dev/null
+.\"
+.\" Copyright 2001-2007 Adrian Thurston <thurston@cs.queensu.ca>
+.\"
+
+.\" This file is part of Ragel.
+.\"
+.\" Ragel is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or
+.\" (at your option) any later version.
+.\"
+.\" Ragel is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with Ragel; if not, write to the Free Software
+.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+.\" Process this file with
+.\" groff -man -Tascii rlgen-dot.1
+.\"
+.TH RLGEN-DOT 1 "@PUBDATE@" "Ragel @VERSION@" "Ragel State Machine Compiler"
+.SH NAME
+rlgen-dot \- Dotfile generator for Ragel State Machine Compiler
+.SH SYNOPSIS
+.B rlgen-dot
+.RI [ options ]
+.I file
+.SH DESCRIPTION
+This is a backend component of Ragel. This program accepts a machine
+compiled by the frontend program ragel(1) and generates a Graphviz dot file.
+
+.SH OPTIONS
+.TP
+.BR \-h ", " \-H ", " \-? ", " \-\-help
+Display help and exit.
+.TP
+.BR \-v
+Display version information and exit.
+.TP
+.B \-o " file"
+Write output to file. If -o is not given, the output is written to the standard out.
+.TP
+.B \-p
+Display printable characters in transition labels.
+.SH BUGS
+Ragel is still under development and has not yet matured. There are probably
+many bugs.
+.SH CREDITS
+Ragel was written by Adrian Thurston <thurston@cs.queensu.ca>. Objective-C
+output contributed by Erich Ocean. D output contributed by Alan West.
+.SH "SEE ALSO"
+.BR ragel (1),
+.BR rlgen-cd (1),
+.BR rlgen-java (1),
+.BR rlgen-ruby (1),
+.BR re2c (1),
+.BR flex (1)
+
+Homepage: http://www.cs.queensu.ca/~thurston/ragel/
--- /dev/null
+.\"
+.\" Copyright 2001-2007 Adrian Thurston <thurston@cs.queensu.ca>
+.\"
+
+.\" This file is part of Ragel.
+.\"
+.\" Ragel is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or
+.\" (at your option) any later version.
+.\"
+.\" Ragel is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with Ragel; if not, write to the Free Software
+.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+.\" Process this file with
+.\" groff -man -Tascii rlgen-java.1
+.\"
+.TH RLGEN-JAVA 1 "@PUBDATE@" "Ragel @VERSION@" "Ragel State Machine Compiler"
+.SH NAME
+rlgen-java \- code generator for Ragel State Machine Compiler
+.SH SYNOPSIS
+.B rlgen-java
+.RI [ options ]
+.I file
+.SH DESCRIPTION
+This is a backend component of Ragel. This program accepts a machine
+compiled by the frontend program ragel(1) and generates Java code.
+
+Use it with the frontend option -J.
+.SH OPTIONS
+.TP
+.BR \-h ", " \-H ", " \-? ", " \-\-help
+Display help and exit.
+.TP
+.BR \-v
+Display version information and exit.
+.TP
+.B \-o " file"
+Write output to file. If -o is not given, a default file name is chosen by
+replacing the suffix of the input. For source files ending in .rh the suffix .h
+is used. For all other source files a suffix based on the output language
+is used (.c, .cpp, .m, .dot)
+.TP
+.B \-T0
+Generate a table driven FSM. This is the default code style. The table driven
+FSM represents the state machine as static data. There are tables of states,
+transitions, indicies and actions. The current state is stored in a variable.
+The execution is a loop that looks that given the current state and current
+character to process looks up the transition to take using a binary search,
+executes any actions and moves to the target state. In general, the table
+driven FSM produces a smaller binary and requires a less expensive host language
+compile but results in slower running code. The table driven FSM is suitable
+for any FSM.
+.SH CREDITS
+Ragel was written by Adrian Thurston <thurston@cs.queensu.ca>. Contributions
+to Java code generation by Colin Fleming.
+.SH "SEE ALSO"
+.BR ragel (1),
+.BR rlgen-cd (1),
+.BR rlgen-ruby (1),
+.BR rlgen-dot (1),
+.BR re2c (1),
+.BR flex (1)
+
+Homepage: http://www.cs.queensu.ca/~thurston/ragel/
--- /dev/null
+.\"
+.\" Copyright 2001-2007 Adrian Thurston <thurston@cs.queensu.ca>
+.\"
+
+.\" This file is part of Ragel.
+.\"
+.\" Ragel is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or
+.\" (at your option) any later version.
+.\"
+.\" Ragel is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with Ragel; if not, write to the Free Software
+.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+.\" Process this file with
+.\" groff -man -Tascii rlgen-ruby.1
+.\"
+.TH RLGEN-RUBY 1 "@PUBDATE@" "Ragel @VERSION@" "Ragel State Machine Compiler"
+.SH NAME
+rlgen-ruby \- code generator for Ragel State Machine Compiler
+.SH SYNOPSIS
+.B rlgen-ruby
+.RI [ options ]
+.I file
+.SH DESCRIPTION
+This is a backend component of Ragel. This program accepts a machine
+compiled by the frontend program ragel(1) and generates Ruby code.
+
+Use it with the frontend option -R.
+.SH OPTIONS
+.TP
+.BR \-h ", " \-H ", " \-? ", " \-\-help
+Display help and exit.
+.TP
+.BR \-v
+Display version information and exit.
+.TP
+.B \-o " file"
+Write output to file. If -o is not given, a default file name is chosen by
+replacing the suffix of the input. For source files ending in .rh the suffix .h
+is used. For all other source files a suffix based on the output language
+is used (.c, .cpp, .m, .dot)
+.TP
+.B \-T0
+Generate a table driven FSM. This is the default code style. The table driven
+FSM represents the state machine as static data. There are tables of states,
+transitions, indicies and actions. The current state is stored in a variable.
+The execution is a loop that looks that given the current state and current
+character to process looks up the transition to take using a binary search,
+executes any actions and moves to the target state. In general, the table
+driven FSM produces a smaller binary and requires a less expensive host language
+compile but results in slower running code. The table driven FSM is suitable
+for any FSM.
+.SH BUGS
+Ragel is still under development and has not yet matured. There are probably
+many bugs.
+.SH CREDITS
+Ragel was written by Adrian Thurston <thurston@cs.queensu.ca>. Objective-C
+output contributed by Erich Ocean. D output contributed by Alan West.
+.SH "SEE ALSO"
+.BR ragel (1),
+.BR rlgen-cd (1),
+.BR rlgen-java (1),
+.BR rlgen-dot (1),
+.BR re2c (1),
+.BR flex (1)
+
+Homepage: http://www.cs.queensu.ca/~thurston/ragel/
/* Print version information. */
void version()
{
- cout << "Ragel Code Generator for C, C++, Objective-C, D" << endl <<
+ cout << "Ragel Code Generator for C, C++, Objective-C and D" << endl <<
"Version " VERSION << ", " PUBDATE << endl <<
"Copyright (c) 2001-2007 by Adrian Thurston" << endl;
}
/* Main, process args and call yyparse to start scanning input. */
int main(int argc, char **argv)
{
- ParamCheck pc("o:VpT:F:G:vHh?-:P:", argc, argv);
+ ParamCheck pc("o:T:F:G:P:vHh?-:", argc, argv);
char *xmlInputFileName = 0;
while ( pc.check() ) {
/* Print version information. */
void version()
{
- cout << "Ragel interface to Graphviz Dotfiles" << endl <<
+ cout << "Ragel Code Generator for Graphviz" << endl <<
"Version " VERSION << ", " PUBDATE << endl <<
"Copyright (c) 2001-2007 by Adrian Thurston" << endl;
}
/* Main, process args and call yyparse to start scanning input. */
int main(int argc, char **argv)
{
- ParamCheck pc("o:VpT:F:G:vHh?-:P:", argc, argv);
+ ParamCheck pc("o:vHh?-:", argc, argv);
char *xmlInputFileName = 0;
while ( pc.check() ) {
/* Main, process args and call yyparse to start scanning input. */
int main(int argc, char **argv)
{
- ParamCheck pc("o:VpT:F:G:vHh?-:P:", argc, argv);
+ ParamCheck pc("o:vHh?-:", argc, argv);
char *xmlInputFileName = 0;
while ( pc.check() ) {
fi
echo "$allow_genflags" | grep -e $grep_gen_opt >/dev/null || continue
- echo "$ragel $min_opt $lang_opt $test_case | $codegen $gen_opt -o $code_src"
- if ! $ragel $min_opt $lang_opt $test_case | $codegen $gen_opt -o $code_src; then
+ if [ $lang == "java" ] || [ $lang == "ruby" ]; then
+ be_gen_opt=""
+ else
+ be_gen_opt=$gen_opt
+ fi
+
+ echo "$ragel $min_opt $lang_opt $test_case | $codegen $be_gen_opt -o $code_src"
+ if ! $ragel $min_opt $lang_opt $test_case | $codegen $be_gen_opt -o $code_src; then
test_error;
fi
split_objs=""
- if test $split_iters != $gen_opt; then
+ if test $split_iters != "$gen_opt"; then
n=0;
while test $n -lt $split_iters; do
part_root=${root}_`awk 'BEGIN {