summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorWill Estes <wlestes@users.sourceforge.net>2009-03-31 14:01:22 +0000
committerWill Estes <wlestes@users.sourceforge.net>2009-03-31 14:01:22 +0000
commitd5c24bbc2fb2eb48ac4087ae1c76c8aacce27618 (patch)
treec1cd444d6e96ccecf05fdc1d405827d8baba8d7b /doc
parent606586db7531ce5198bcc66a6be27646e4e60f23 (diff)
Include version.texi after @setfilename,
so that @set values are correctly evaluated. (Start Conditions, Performance, Lex and Posix): Fix some markup errors. (Cxx): Likewise. Also, fix C++ example to actually be compilable. Patch from Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Diffstat (limited to 'doc')
-rw-r--r--doc/flex.texi28
1 files changed, 16 insertions, 12 deletions
diff --git a/doc/flex.texi b/doc/flex.texi
index 7b64f33..2adb726 100644
--- a/doc/flex.texi
+++ b/doc/flex.texi
@@ -1,7 +1,7 @@
\input texinfo.tex @c -*-texinfo-*-
@c %**start of header
-@include version.texi
@setfilename flex.info
+@include version.texi
@settitle Lexical Analysis With Flex, for Flex @value{@version}
@set authors Vern Paxson, Will Estes and John Millaway
@c "Macro Hooks" index
@@ -1756,7 +1756,7 @@ treat it as a single token, the floating-point number @samp{123.456}:
%%
expect-floats BEGIN(expect);
- <expect>[0-9]+@samp{.}[0-9]+ {
+ <expect>[0-9]+.[0-9]+ {
printf( "found a float, = %f\n",
atof( yytext ) );
}
@@ -3401,7 +3401,7 @@ which degrade performance. These are, from most expensive to least:
%option interactive
%option always-interactive
- @samp{^} beginning-of-line operator
+ ^ beginning-of-line operator
yymore()
@end verbatim
@end example
@@ -3886,12 +3886,16 @@ Here is an example of a simple C++ scanner:
@cindex C++ scanners, use of
@example
@verbatim
- // An example of using the flex C++ scanner class.
+ // An example of using the flex C++ scanner class.
%{
+ #include <iostream>
+ using namespace std;
int mylineno = 0;
%}
+ %option noyywrap
+
string \"[^\n"]+\"
ws [ \t]+
@@ -3915,7 +3919,7 @@ Here is an example of a simple C++ scanner:
if(c == '\n')
++mylineno;
- else if(c == @samp{*})
+ else if(c == '*')
{
if((c = yyinput()) == '/')
break;
@@ -3925,23 +3929,23 @@ Here is an example of a simple C++ scanner:
}
}
- {number} cout "number " YYText() '\n';
+ {number} cout << "number " << YYText() << '\n';
\n mylineno++;
- {name} cout "name " YYText() '\n';
+ {name} cout << "name " << YYText() << '\n';
- {string} cout "string " YYText() '\n';
+ {string} cout << "string " << YYText() << '\n';
%%
int main( int /* argc */, char** /* argv */ )
- {
- @code{flex}Lexer* lexer = new yyFlexLexer;
+ {
+ FlexLexer* lexer = new yyFlexLexer;
while(lexer->yylex() != 0)
;
return 0;
- }
+ }
@end verbatim
@end example
@@ -4564,7 +4568,7 @@ called again, you may get the following message:
@cindex error messages, end of buffer missed
@example
@verbatim
- fatal @code{flex} scanner internal error--end of buffer missed
+ fatal flex scanner internal error--end of buffer missed
@end verbatim
@end example