* Makefiles and Flex::
* Bison Bridge::
* M4 Dependency::
+* Common Patterns::
Indices
* Makefiles and Flex::
* Bison Bridge::
* M4 Dependency::
+* Common Patterns::
@end menu
@node Makefiles and Flex, Bison Bridge, Appendices, Appendices
@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
@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