Updated the help and version information in the backend programs. Also updated
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Tue, 13 Feb 2007 18:30:10 +0000 (18:30 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Tue, 13 Feb 2007 18:30:10 +0000 (18:30 +0000)
the option processing. Renamed and updated the man page for the backend. Added
man pages for the new backend programs.

Removed unused options from the list of options which are accepted in the
backend programs.

git-svn-id: http://svn.complang.org/ragel/trunk@106 052ea7fc-9027-0410-9066-f65837a77df0

doc/Makefile.in
doc/ragel.1.in
doc/rlgen-cd.1.in [moved from doc/rlcodegen.1.in with 83% similarity]
doc/rlgen-dot.1.in [new file with mode: 0644]
doc/rlgen-java.1.in [new file with mode: 0644]
doc/rlgen-ruby.1.in [new file with mode: 0644]
rlgen-cd/main.cpp
rlgen-dot/main.cpp
rlgen-java/main.cpp
rlgen-ruby/main.cpp
test/runtests

index fcdaca6..4448958 100644 (file)
@@ -31,7 +31,7 @@ include ../version.mk
 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)
 
@@ -47,13 +47,13 @@ version.tex: ../version.mk
        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 \
index 61822b4..26104c5 100644 (file)
@@ -1,5 +1,5 @@
 .\"
-.\"   Copyright 2001-2005 Adrian Thurston <thurston@cs.queensu.ca>
+.\"   Copyright 2001-2007 Adrian Thurston <thurston@cs.queensu.ca>
 .\"
 
 .\"   This file is part of Ragel.
similarity index 83%
rename from doc/rlcodegen.1.in
rename to doc/rlgen-cd.1.in
index ff2242c..c312158 100644 (file)
@@ -1,5 +1,5 @@
 .\"
-.\"   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,
@@ -101,6 +96,9 @@ 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-java (1),
+.BR rlgen-ruby (1),
+.BR rlgen-dot (1),
 .BR re2c (1),
 .BR flex (1)
 
diff --git a/doc/rlgen-dot.1.in b/doc/rlgen-dot.1.in
new file mode 100644 (file)
index 0000000..5c24091
--- /dev/null
@@ -0,0 +1,62 @@
+.\"
+.\"   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/
diff --git a/doc/rlgen-java.1.in b/doc/rlgen-java.1.in
new file mode 100644 (file)
index 0000000..c143d15
--- /dev/null
@@ -0,0 +1,71 @@
+.\"
+.\"   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/
diff --git a/doc/rlgen-ruby.1.in b/doc/rlgen-ruby.1.in
new file mode 100644 (file)
index 0000000..9aecfe2
--- /dev/null
@@ -0,0 +1,74 @@
+.\"
+.\"   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/
index 77309cd..fdb2fbe 100644 (file)
@@ -91,7 +91,7 @@ void usage()
 /* 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;
 }
@@ -237,7 +237,7 @@ CodeGenData *makeCodeGen( char *sourceFileName, char *fsmName,
 /* 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() ) {
index 5f816ae..0b97201 100644 (file)
@@ -72,7 +72,7 @@ void usage()
 /* 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;
 }
index e15ef06..c3c7cef 100644 (file)
@@ -146,7 +146,7 @@ CodeGenData *makeCodeGen( char *sourceFileName, char *fsmName,
 /* 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() ) {
index bb7d15c..a37b0b8 100644 (file)
@@ -146,7 +146,7 @@ CodeGenData *makeCodeGen( char *sourceFileName, char *fsmName,
 /* 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() ) {
index 3bf955c..9dd7acf 100755 (executable)
@@ -200,13 +200,19 @@ for test_case; do
                        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 {