summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJohn Millaway <john43@users.sourceforge.net>2006-03-23 23:34:16 +0000
committerJohn Millaway <john43@users.sourceforge.net>2006-03-23 23:34:16 +0000
commitfb6e15fddbfa6a5258c963c881d3aee539c1b1b5 (patch)
treeb3479b3a84b6354fc55a8764164ebb76bb59277b /doc
parented02c2fe68e0e1bf0fc0aaa69470fe6e5fd58ec4 (diff)
.
Diffstat (limited to 'doc')
-rw-r--r--doc/flex.texi36
1 files changed, 35 insertions, 1 deletions
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