For Next Release
================
+ -Added an option -l to rlgen-cd which inhibits the writing of #line
+ directives.
-Added a new syntax for verbose embeddings. This adds parentheses:
$from(action_name);
Verbose embeddings without parentheses can make code difficult to read
break code have crept into minor version number changes. Typically, the
documentation lags behind the development in the interest of documenting only
the lasting features. The latest changes are always documented in the ChangeLog
-file. As Ragel stabilizes, which is expected in the 5.x line, the version
-numbering rules will become more strict and the documentation will become more
-plentiful.
-
+file.
\chapter{Constructing State Machines}
.BR \-h ", " \-H ", " \-? ", " \-\-help
Display help and exit.
.TP
-.BR \-v
+.BR \-v
Display version information and exit.
.TP
+.BR \-l
+Inhibit the writing of #line directives in generated code.
+.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
void lineDirective( ostream &out, char *fileName, int line )
{
+ if ( noLineDirectives )
+ out << "/* ";
+
/* Write the preprocessor line info for to the input file. */
out << "#line " << line << " \"";
for ( char *pc = fileName; *pc != 0; pc++ ) {
else
out << *pc;
}
- out << "\"\n";
+ out << '"';
+
+ if ( noLineDirectives )
+ out << " */";
+
+ out << '\n';
}
void genLineDirective( ostream &out )
bool graphvizDone = false;
int numSplitPartitions = 0;
+bool noLineDirectives = false;
bool printPrintables = false;
/* Print a summary of the options. */
" -h, -H, -?, --help Print this usage and exit\n"
" -v, --version Print version information and exit\n"
" -o <file> Write output to <file>\n"
+"code generation options:\n"
+" -l Inhibit writing of #line directives\n"
"generated code style:\n"
" -T0 Table driven FSM (default)\n"
" -T1 Faster table driven FSM\n"
/* Main, process args and call yyparse to start scanning input. */
int main(int argc, char **argv)
{
- ParamCheck pc("o:T:F:G:P:vHh?-:", argc, argv);
+ ParamCheck pc("-:Hh?vlo:T:F:G:P:", argc, argv);
char *xmlInputFileName = 0;
while ( pc.check() ) {
}
break;
+ case 'l':
+ noLineDirectives = true;
+ break;
+
/* Code style. */
case 'T':
if ( pc.parameterArg[0] == '0' )
extern CodeStyleEnum codeStyle;
+
/* IO filenames and stream. */
-extern bool printPrintables;
extern bool graphvizDone;
extern int gblErrorCount;
+
+/* Options. */
extern int numSplitPartitions;
+extern bool noLineDirectives;
std::ostream &error();