summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdoc/flex.texi17
-rw-r--r--src/flexint_shared.h9
2 files changed, 24 insertions, 2 deletions
diff --git a/doc/flex.texi b/doc/flex.texi
index a4b5897..a8b51eb 100755
--- a/doc/flex.texi
+++ b/doc/flex.texi
@@ -321,7 +321,7 @@ When your target language is C, the name of the generated scanner
normally use for source-code files to the prefix @file{lex.yy}.
The examples in this manual are in C, which is Flex's default target
-language and until release 4.6.2 its only one.
+language and until release 2.6.4 it is the only one.
@node Simple Examples, Format, Introduction, Top
@chapter Some Simple Examples
@@ -357,7 +357,7 @@ Here's another simple example:
@verbatiminclude example_r.lex
@end example
-If you have looked at older versions of the Flex nanual, you might
+If you have looked at older versions of the Flex manual, you might
have seen a version of the above example that looked more like this:
@cindex counting characters and lines; non-reentrant
@@ -1345,6 +1345,7 @@ Note also that unlike the other special actions, @code{yyreject()} is a
@emph{branch}. Code immediately following it in the action will
@emph{not} be executed.
+@anchor{action-yymore}
@item yymore()
@cindex yymore()
tells the scanner that the next time it matches a rule, the
@@ -3172,6 +3173,17 @@ also generates a @code{yyFlexLexer::yylex()} member function that emits
a run-time error (by invoking @code{yyFlexLexer::LexerError())} if
called. @xref{Cxx}.
+@anchor{option-yymore}
+@opindex ---yymore
+@opindex yymore
+@item --yymore, @code{%option yymore}
+tells flex to generate a scanner with logic to append the next token to the
+currently matched text. This option is enabled automatically if flex detects
+the use of @code{yymore()} in the scanner rules. However, this option must be
+set explicitly if @code{yymore()} is used more indirectly to avoid a compile
+time error.
+@xref{action-yymore}. @xref{yymore_used_but_not_detected-undefined}.
+
@end table
@node Options for Scanner Speed and Size, Debugging Options, Code-Level And API Options, Scanner Options
@@ -5442,6 +5454,7 @@ not intended.
@item
@code{reject_used_but_not_detected undefined} or
+@anchor{yymore_used_but_not_detected-undefined}
@code{yymore_used_but_not_detected undefined}. These errors can occur
at compile time. They indicate that the scanner uses @code{yyreject()} or
@code{yymore()} but that @code{flex} failed to notice the fact, meaning
diff --git a/src/flexint_shared.h b/src/flexint_shared.h
index b58eee6..50c0a0a 100644
--- a/src/flexint_shared.h
+++ b/src/flexint_shared.h
@@ -4,6 +4,11 @@
#define YYFLEX_INTTYPES_DEFINED
/* Prefer C99 integer types if available. */
+
+# if defined(__cplusplus) && __cplusplus >= 201103L
+#include <cstdint>
+# define YYFLEX_USE_STDINT
+# endif
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* Include <inttypes.h> and not <stdint.h> because Solaris 2.6 has the former
* and not the latter.
@@ -33,7 +38,11 @@ typedef unsigned short int flex_uint16_t;
# ifdef __STDC__
typedef signed char flex_int8_t;
/* ISO C only requires at least 16 bits for int. */
+# ifdef __cplusplus
+#include <climits>
+# else
#include <limits.h>
+# endif
# if UINT_MAX >= 4294967295
# define YYFLEX_INT32_DEFINED
typedef int flex_int32_t;