From fb6e15fddbfa6a5258c963c881d3aee539c1b1b5 Mon Sep 17 00:00:00 2001 From: John Millaway Date: Thu, 23 Mar 2006 23:34:16 +0000 Subject: [PATCH] . --- doc/flex.texi | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/doc/flex.texi b/doc/flex.texi index f73e995..0a9be3e 100644 --- a/doc/flex.texi +++ b/doc/flex.texi @@ -265,6 +265,7 @@ Appendices * Makefiles and Flex:: * Bison Bridge:: * M4 Dependency:: +* Common Patterns:: Indices @@ -8088,6 +8089,7 @@ See @ref{Top, , , bison, the GNU Bison Manual}. * Makefiles and Flex:: * Bison Bridge:: * M4 Dependency:: +* Common Patterns:: @end menu @node Makefiles and Flex, Bison Bridge, Appendices, Appendices @@ -8301,7 +8303,7 @@ As you can see, there really is no magic here. We just use @end verbatim @end example -@node M4 Dependency, , Bison Bridge, Appendices +@node M4 Dependency, Common Patterns, Bison Bridge, Appendices @section M4 Dependency @cindex m4 The macro processor @code{m4}@footnote{The use of m4 is subject to change in @@ -8330,6 +8332,38 @@ use @code{x[y[z] ]}. @code{m4} is only required at the time you run @code{flex}. The generated scanner is ordinary C or C++, and does @emph{not} require @code{m4}. +@node Common Patterns, ,M4 Dependency, Appendices +@section Common Patterns +@cindex patterns, common + +This appendix provides examples of common regular expressions you might use +in your scanner. + +Numbers + +@table @asis + +@item an signed integer +@code{[+-]?([[:digit:]]@{-@}[0])[[:digit:]]*} + +@item a hexadecimal constant +@code{0x[[:xdigit:]]+} + +@item an octal constant +@code{0[0123456]+} + +@item a decimal constant +@code{[+-]([[:digit:]]@{-@}[0])[[:digit:]]*("."[[:digit:]]+)?} + +@c TODO +@item a C99 floating point constant +@code{[+-] ([[:digit:]]*"."[[:digit:]]+|[[:digit:]]+\.) ([E]?[[:digit:]]+) [FL]? |INF|INFINITY|(NAN("("")")?)} + +(See C99 section 6.4.4.2.) + + +@end table + @node Indices, , Appendices, Top @unnumbered Indices -- 2.40.0