flex.1 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. .TH FLEX 1 "26 May 1990" "Version 2.3"
  2. .SH NAME
  3. flex - fast lexical analyzer generator
  4. .SH SYNOPSIS
  5. .B flex
  6. .B [-bcdfinpstvFILT8 -C[efmF] -Sskeleton]
  7. .I [filename ...]
  8. .SH DESCRIPTION
  9. .I flex
  10. is a tool for generating
  11. .I scanners:
  12. programs which recognized lexical patterns in text.
  13. .I flex
  14. reads
  15. the given input files, or its standard input if no file names are given,
  16. for a description of a scanner to generate. The description is in
  17. the form of pairs
  18. of regular expressions and C code, called
  19. .I rules. flex
  20. generates as output a C source file,
  21. .B lex.yy.c,
  22. which defines a routine
  23. .B yylex().
  24. This file is compiled and linked with the
  25. .B -lfl
  26. library to produce an executable. When the executable is run,
  27. it analyzes its input for occurrences
  28. of the regular expressions. Whenever it finds one, it executes
  29. the corresponding C code.
  30. .LP
  31. For full documentation, see
  32. .B flexdoc(1).
  33. This manual entry is intended for use as a quick reference.
  34. .SH OPTIONS
  35. .I flex
  36. has the following options:
  37. .TP
  38. .B -b
  39. Generate backtracking information to
  40. .I lex.backtrack.
  41. This is a list of scanner states which require backtracking
  42. and the input characters on which they do so. By adding rules one
  43. can remove backtracking states. If all backtracking states
  44. are eliminated and
  45. .B -f
  46. or
  47. .B -F
  48. is used, the generated scanner will run faster.
  49. .TP
  50. .B -c
  51. is a do-nothing, deprecated option included for POSIX compliance.
  52. .IP
  53. .B NOTE:
  54. in previous releases of
  55. .I flex
  56. .B -c
  57. specified table-compression options. This functionality is
  58. now given by the
  59. .B -C
  60. flag. To ease the the impact of this change, when
  61. .I flex
  62. encounters
  63. .B -c,
  64. it currently issues a warning message and assumes that
  65. .B -C
  66. was desired instead. In the future this "promotion" of
  67. .B -c
  68. to
  69. .B -C
  70. will go away in the name of full POSIX compliance (unless
  71. the POSIX meaning is removed first).
  72. .TP
  73. .B -d
  74. makes the generated scanner run in
  75. .I debug
  76. mode. Whenever a pattern is recognized and the global
  77. .B yy_flex_debug
  78. is non-zero (which is the default), the scanner will
  79. write to
  80. .I stderr
  81. a line of the form:
  82. .nf
  83. --accepting rule at line 53 ("the matched text")
  84. .fi
  85. The line number refers to the location of the rule in the file
  86. defining the scanner (i.e., the file that was fed to flex). Messages
  87. are also generated when the scanner backtracks, accepts the
  88. default rule, reaches the end of its input buffer (or encounters
  89. a NUL; the two look the same as far as the scanner's concerned),
  90. or reaches an end-of-file.
  91. .TP
  92. .B -f
  93. specifies (take your pick)
  94. .I full table
  95. or
  96. .I fast scanner.
  97. No table compression is done. The result is large but fast.
  98. This option is equivalent to
  99. .B -Cf
  100. (see below).
  101. .TP
  102. .B -i
  103. instructs
  104. .I flex
  105. to generate a
  106. .I case-insensitive
  107. scanner. The case of letters given in the
  108. .I flex
  109. input patterns will
  110. be ignored, and tokens in the input will be matched regardless of case. The
  111. matched text given in
  112. .I yytext
  113. will have the preserved case (i.e., it will not be folded).
  114. .TP
  115. .B -n
  116. is another do-nothing, deprecated option included only for
  117. POSIX compliance.
  118. .TP
  119. .B -p
  120. generates a performance report to stderr. The report
  121. consists of comments regarding features of the
  122. .I flex
  123. input file which will cause a loss of performance in the resulting scanner.
  124. .TP
  125. .B -s
  126. causes the
  127. .I default rule
  128. (that unmatched scanner input is echoed to
  129. .I stdout)
  130. to be suppressed. If the scanner encounters input that does not
  131. match any of its rules, it aborts with an error.
  132. .TP
  133. .B -t
  134. instructs
  135. .I flex
  136. to write the scanner it generates to standard output instead
  137. of
  138. .B lex.yy.c.
  139. .TP
  140. .B -v
  141. specifies that
  142. .I flex
  143. should write to
  144. .I stderr
  145. a summary of statistics regarding the scanner it generates.
  146. .TP
  147. .B -F
  148. specifies that the
  149. .ul
  150. fast
  151. scanner table representation should be used. This representation is
  152. about as fast as the full table representation
  153. .ul
  154. (-f),
  155. and for some sets of patterns will be considerably smaller (and for
  156. others, larger). See
  157. .B flexdoc(1)
  158. for details.
  159. .IP
  160. This option is equivalent to
  161. .B -CF
  162. (see below).
  163. .TP
  164. .B -I
  165. instructs
  166. .I flex
  167. to generate an
  168. .I interactive
  169. scanner, that is, a scanner which stops immediately rather than
  170. looking ahead if it knows
  171. that the currently scanned text cannot be part of a longer rule's match.
  172. Again, see
  173. .B flexdoc(1)
  174. for details.
  175. .IP
  176. Note,
  177. .B -I
  178. cannot be used in conjunction with
  179. .I full
  180. or
  181. .I fast tables,
  182. i.e., the
  183. .B -f, -F, -Cf,
  184. or
  185. .B -CF
  186. flags.
  187. .TP
  188. .B -L
  189. instructs
  190. .I flex
  191. not to generate
  192. .B #line
  193. directives in
  194. .B lex.yy.c.
  195. The default is to generate such directives so error
  196. messages in the actions will be correctly
  197. located with respect to the original
  198. .I flex
  199. input file, and not to
  200. the fairly meaningless line numbers of
  201. .B lex.yy.c.
  202. .TP
  203. .B -T
  204. makes
  205. .I flex
  206. run in
  207. .I trace
  208. mode. It will generate a lot of messages to
  209. .I stdout
  210. concerning
  211. the form of the input and the resultant non-deterministic and deterministic
  212. finite automata. This option is mostly for use in maintaining
  213. .I flex.
  214. .TP
  215. .B -8
  216. instructs
  217. .I flex
  218. to generate an 8-bit scanner.
  219. On some sites, this is the default. On others, the default
  220. is 7-bit characters. To see which is the case, check the verbose
  221. .B (-v)
  222. output for "equivalence classes created". If the denominator of
  223. the number shown is 128, then by default
  224. .I flex
  225. is generating 7-bit characters. If it is 256, then the default is
  226. 8-bit characters.
  227. .TP
  228. .B -C[efmF]
  229. controls the degree of table compression.
  230. .IP
  231. .B -Ce
  232. directs
  233. .I flex
  234. to construct
  235. .I equivalence classes,
  236. i.e., sets of characters
  237. which have identical lexical properties.
  238. Equivalence classes usually give
  239. dramatic reductions in the final table/object file sizes (typically
  240. a factor of 2-5) and are pretty cheap performance-wise (one array
  241. look-up per character scanned).
  242. .IP
  243. .B -Cf
  244. specifies that the
  245. .I full
  246. scanner tables should be generated -
  247. .I flex
  248. should not compress the
  249. tables by taking advantages of similar transition functions for
  250. different states.
  251. .IP
  252. .B -CF
  253. specifies that the alternate fast scanner representation (described in
  254. .B flexdoc(1))
  255. should be used.
  256. .IP
  257. .B -Cm
  258. directs
  259. .I flex
  260. to construct
  261. .I meta-equivalence classes,
  262. which are sets of equivalence classes (or characters, if equivalence
  263. classes are not being used) that are commonly used together. Meta-equivalence
  264. classes are often a big win when using compressed tables, but they
  265. have a moderate performance impact (one or two "if" tests and one
  266. array look-up per character scanned).
  267. .IP
  268. A lone
  269. .B -C
  270. specifies that the scanner tables should be compressed but neither
  271. equivalence classes nor meta-equivalence classes should be used.
  272. .IP
  273. The options
  274. .B -Cf
  275. or
  276. .B -CF
  277. and
  278. .B -Cm
  279. do not make sense together - there is no opportunity for meta-equivalence
  280. classes if the table is not being compressed. Otherwise the options
  281. may be freely mixed.
  282. .IP
  283. The default setting is
  284. .B -Cem,
  285. which specifies that
  286. .I flex
  287. should generate equivalence classes
  288. and meta-equivalence classes. This setting provides the highest
  289. degree of table compression. You can trade off
  290. faster-executing scanners at the cost of larger tables with
  291. the following generally being true:
  292. .nf
  293. slowest & smallest
  294. -Cem
  295. -Cm
  296. -Ce
  297. -C
  298. -C{f,F}e
  299. -C{f,F}
  300. fastest & largest
  301. .fi
  302. .IP
  303. .B -C
  304. options are not cumulative; whenever the flag is encountered, the
  305. previous -C settings are forgotten.
  306. .TP
  307. .B -Sskeleton_file
  308. overrides the default skeleton file from which
  309. .I flex
  310. constructs its scanners. You'll never need this option unless you are doing
  311. .I flex
  312. maintenance or development.
  313. .SH SUMMARY OF FLEX REGULAR EXPRESSIONS
  314. The patterns in the input are written using an extended set of regular
  315. expressions. These are:
  316. .nf
  317. x match the character 'x'
  318. . any character except newline
  319. [xyz] a "character class"; in this case, the pattern
  320. matches either an 'x', a 'y', or a 'z'
  321. [abj-oZ] a "character class" with a range in it; matches
  322. an 'a', a 'b', any letter from 'j' through 'o',
  323. or a 'Z'
  324. [^A-Z] a "negated character class", i.e., any character
  325. but those in the class. In this case, any
  326. character EXCEPT an uppercase letter.
  327. [^A-Z\\n] any character EXCEPT an uppercase letter or
  328. a newline
  329. r* zero or more r's, where r is any regular expression
  330. r+ one or more r's
  331. r? zero or one r's (that is, "an optional r")
  332. r{2,5} anywhere from two to five r's
  333. r{2,} two or more r's
  334. r{4} exactly 4 r's
  335. {name} the expansion of the "name" definition
  336. (see above)
  337. "[xyz]\\"foo"
  338. the literal string: [xyz]"foo
  339. \\X if X is an 'a', 'b', 'f', 'n', 'r', 't', or 'v',
  340. then the ANSI-C interpretation of \\x.
  341. Otherwise, a literal 'X' (used to escape
  342. operators such as '*')
  343. \\123 the character with octal value 123
  344. \\x2a the character with hexadecimal value 2a
  345. (r) match an r; parentheses are used to override
  346. precedence (see below)
  347. rs the regular expression r followed by the
  348. regular expression s; called "concatenation"
  349. r|s either an r or an s
  350. r/s an r but only if it is followed by an s. The
  351. s is not part of the matched text. This type
  352. of pattern is called as "trailing context".
  353. ^r an r, but only at the beginning of a line
  354. r$ an r, but only at the end of a line. Equivalent
  355. to "r/\\n".
  356. <s>r an r, but only in start condition s (see
  357. below for discussion of start conditions)
  358. <s1,s2,s3>r
  359. same, but in any of start conditions s1,
  360. s2, or s3
  361. <<EOF>> an end-of-file
  362. <s1,s2><<EOF>>
  363. an end-of-file when in start condition s1 or s2
  364. .fi
  365. The regular expressions listed above are grouped according to
  366. precedence, from highest precedence at the top to lowest at the bottom.
  367. Those grouped together have equal precedence.
  368. .LP
  369. Some notes on patterns:
  370. .IP -
  371. Negated character classes
  372. .I match newlines
  373. unless "\\n" (or an equivalent escape sequence) is one of the
  374. characters explicitly present in the negated character class
  375. (e.g., "[^A-Z\\n]").
  376. .IP -
  377. A rule can have at most one instance of trailing context (the '/' operator
  378. or the '$' operator). The start condition, '^', and "<<EOF>>" patterns
  379. can only occur at the beginning of a pattern, and, as well as with '/' and '$',
  380. cannot be grouped inside parentheses. The following are all illegal:
  381. .nf
  382. foo/bar$
  383. foo|(bar$)
  384. foo|^bar
  385. <sc1>foo<sc2>bar
  386. .fi
  387. .SH SUMMARY OF SPECIAL ACTIONS
  388. In addition to arbitrary C code, the following can appear in actions:
  389. .IP -
  390. .B ECHO
  391. copies yytext to the scanner's output.
  392. .IP -
  393. .B BEGIN
  394. followed by the name of a start condition places the scanner in the
  395. corresponding start condition.
  396. .IP -
  397. .B REJECT
  398. directs the scanner to proceed on to the "second best" rule which matched the
  399. input (or a prefix of the input).
  400. .B yytext
  401. and
  402. .B yyleng
  403. are set up appropriately. Note that
  404. .B REJECT
  405. is a particularly expensive feature in terms scanner performance;
  406. if it is used in
  407. .I any
  408. of the scanner's actions it will slow down
  409. .I all
  410. of the scanner's matching. Furthermore,
  411. .B REJECT
  412. cannot be used with the
  413. .I -f
  414. or
  415. .I -F
  416. options.
  417. .IP
  418. Note also that unlike the other special actions,
  419. .B REJECT
  420. is a
  421. .I branch;
  422. code immediately following it in the action will
  423. .I not
  424. be executed.
  425. .IP -
  426. .B yymore()
  427. tells the scanner that the next time it matches a rule, the corresponding
  428. token should be
  429. .I appended
  430. onto the current value of
  431. .B yytext
  432. rather than replacing it.
  433. .IP -
  434. .B yyless(n)
  435. returns all but the first
  436. .I n
  437. characters of the current token back to the input stream, where they
  438. will be rescanned when the scanner looks for the next match.
  439. .B yytext
  440. and
  441. .B yyleng
  442. are adjusted appropriately (e.g.,
  443. .B yyleng
  444. will now be equal to
  445. .I n
  446. ).
  447. .IP -
  448. .B unput(c)
  449. puts the character
  450. .I c
  451. back onto the input stream. It will be the next character scanned.
  452. .IP -
  453. .B input()
  454. reads the next character from the input stream (this routine is called
  455. .B yyinput()
  456. if the scanner is compiled using
  457. .B C++).
  458. .IP -
  459. .B yyterminate()
  460. can be used in lieu of a return statement in an action. It terminates
  461. the scanner and returns a 0 to the scanner's caller, indicating "all done".
  462. .IP
  463. By default,
  464. .B yyterminate()
  465. is also called when an end-of-file is encountered. It is a macro and
  466. may be redefined.
  467. .IP -
  468. .B YY_NEW_FILE
  469. is an action available only in <<EOF>> rules. It means "Okay, I've
  470. set up a new input file, continue scanning".
  471. .IP -
  472. .B yy_create_buffer( file, size )
  473. takes a
  474. .I FILE
  475. pointer and an integer
  476. .I size.
  477. It returns a YY_BUFFER_STATE
  478. handle to a new input buffer large enough to accomodate
  479. .I size
  480. characters and associated with the given file. When in doubt, use
  481. .B YY_BUF_SIZE
  482. for the size.
  483. .IP -
  484. .B yy_switch_to_buffer( new_buffer )
  485. switches the scanner's processing to scan for tokens from
  486. the given buffer, which must be a YY_BUFFER_STATE.
  487. .IP -
  488. .B yy_delete_buffer( buffer )
  489. deletes the given buffer.
  490. .SH VALUES AVAILABLE TO THE USER
  491. .IP -
  492. .B char *yytext
  493. holds the text of the current token. It may not be modified.
  494. .IP -
  495. .B int yyleng
  496. holds the length of the current token. It may not be modified.
  497. .IP -
  498. .B FILE *yyin
  499. is the file which by default
  500. .I flex
  501. reads from. It may be redefined but doing so only makes sense before
  502. scanning begins. Changing it in the middle of scanning will have
  503. unexpected results since
  504. .I flex
  505. buffers its input. Once scanning terminates because an end-of-file
  506. has been seen,
  507. .B
  508. void yyrestart( FILE *new_file )
  509. may be called to point
  510. .I yyin
  511. at the new input file.
  512. .IP -
  513. .B FILE *yyout
  514. is the file to which
  515. .B ECHO
  516. actions are done. It can be reassigned by the user.
  517. .IP -
  518. .B YY_CURRENT_BUFFER
  519. returns a
  520. .B YY_BUFFER_STATE
  521. handle to the current buffer.
  522. .SH MACROS THE USER CAN REDEFINE
  523. .IP -
  524. .B YY_DECL
  525. controls how the scanning routine is declared.
  526. By default, it is "int yylex()", or, if prototypes are being
  527. used, "int yylex(void)". This definition may be changed by redefining
  528. the "YY_DECL" macro. Note that
  529. if you give arguments to the scanning routine using a
  530. K&R-style/non-prototyped function declaration, you must terminate
  531. the definition with a semi-colon (;).
  532. .IP -
  533. The nature of how the scanner
  534. gets its input can be controlled by redefining the
  535. .B YY_INPUT
  536. macro.
  537. YY_INPUT's calling sequence is "YY_INPUT(buf,result,max_size)". Its
  538. action is to place up to
  539. .I max_size
  540. characters in the character array
  541. .I buf
  542. and return in the integer variable
  543. .I result
  544. either the
  545. number of characters read or the constant YY_NULL (0 on Unix systems)
  546. to indicate EOF. The default YY_INPUT reads from the
  547. global file-pointer "yyin".
  548. A sample redefinition of YY_INPUT (in the definitions
  549. section of the input file):
  550. .nf
  551. %{
  552. #undef YY_INPUT
  553. #define YY_INPUT(buf,result,max_size) \\
  554. { \\
  555. int c = getchar(); \\
  556. result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \\
  557. }
  558. %}
  559. .fi
  560. .IP -
  561. When the scanner receives an end-of-file indication from YY_INPUT,
  562. it then checks the
  563. .B yywrap()
  564. function. If
  565. .B yywrap()
  566. returns false (zero), then it is assumed that the
  567. function has gone ahead and set up
  568. .I yyin
  569. to point to another input file, and scanning continues. If it returns
  570. true (non-zero), then the scanner terminates, returning 0 to its
  571. caller.
  572. .IP
  573. The default
  574. .B yywrap()
  575. always returns 1. Presently, to redefine it you must first
  576. "#undef yywrap", as it is currently implemented as a macro. It is
  577. likely that
  578. .B yywrap()
  579. will soon be defined to be a function rather than a macro.
  580. .IP -
  581. YY_USER_ACTION
  582. can be redefined to provide an action
  583. which is always executed prior to the matched rule's action.
  584. .IP -
  585. The macro
  586. .B YY_USER_INIT
  587. may be redefined to provide an action which is always executed before
  588. the first scan.
  589. .IP -
  590. In the generated scanner, the actions are all gathered in one large
  591. switch statement and separated using
  592. .B YY_BREAK,
  593. which may be redefined. By default, it is simply a "break", to separate
  594. each rule's action from the following rule's.
  595. .SH FILES
  596. .TP
  597. .I flex.skel
  598. skeleton scanner.
  599. .TP
  600. .I lex.yy.c
  601. generated scanner (called
  602. .I lexyy.c
  603. on some systems).
  604. .TP
  605. .I lex.backtrack
  606. backtracking information for
  607. .B -b
  608. flag (called
  609. .I lex.bck
  610. on some systems).
  611. .TP
  612. .B -lfl
  613. library with which to link the scanners.
  614. .SH "SEE ALSO"
  615. .LP
  616. flexdoc(1), lex(1), yacc(1), sed(1), awk(1).
  617. .LP
  618. M. E. Lesk and E. Schmidt,
  619. .I LEX - Lexical Analyzer Generator
  620. .SH DIAGNOSTICS
  621. .I reject_used_but_not_detected undefined
  622. or
  623. .LP
  624. .I yymore_used_but_not_detected undefined -
  625. These errors can occur at compile time. They indicate that the
  626. scanner uses
  627. .B REJECT
  628. or
  629. .B yymore()
  630. but that
  631. .I flex
  632. failed to notice the fact, meaning that
  633. .I flex
  634. scanned the first two sections looking for occurrences of these actions
  635. and failed to find any, but somehow you snuck some in (via a #include
  636. file, for example). Make an explicit reference to the action in your
  637. .I flex
  638. input file. (Note that previously
  639. .I flex
  640. supported a
  641. .B %used/%unused
  642. mechanism for dealing with this problem; this feature is still supported
  643. but now deprecated, and will go away soon unless the author hears from
  644. people who can argue compellingly that they need it.)
  645. .LP
  646. .I flex scanner jammed -
  647. a scanner compiled with
  648. .B -s
  649. has encountered an input string which wasn't matched by
  650. any of its rules.
  651. .LP
  652. .I flex input buffer overflowed -
  653. a scanner rule matched a string long enough to overflow the
  654. scanner's internal input buffer (16K bytes - controlled by
  655. .B YY_BUF_MAX
  656. in "flex.skel").
  657. .LP
  658. .I scanner requires -8 flag -
  659. Your scanner specification includes recognizing 8-bit characters and
  660. you did not specify the -8 flag (and your site has not installed flex
  661. with -8 as the default).
  662. .LP
  663. .I
  664. fatal flex scanner internal error--end of buffer missed -
  665. This can occur in an scanner which is reentered after a long-jump
  666. has jumped out (or over) the scanner's activation frame. Before
  667. reentering the scanner, use:
  668. .nf
  669. yyrestart( yyin );
  670. .fi
  671. .LP
  672. .I too many %t classes! -
  673. You managed to put every single character into its own %t class.
  674. .I flex
  675. requires that at least one of the classes share characters.
  676. .SH AUTHOR
  677. Vern Paxson, with the help of many ideas and much inspiration from
  678. Van Jacobson. Original version by Jef Poskanzer.
  679. .LP
  680. See flexdoc(1) for additional credits and the address to send comments to.
  681. .SH DEFICIENCIES / BUGS
  682. .LP
  683. Some trailing context
  684. patterns cannot be properly matched and generate
  685. warning messages ("Dangerous trailing context"). These are
  686. patterns where the ending of the
  687. first part of the rule matches the beginning of the second
  688. part, such as "zx*/xy*", where the 'x*' matches the 'x' at
  689. the beginning of the trailing context. (Note that the POSIX draft
  690. states that the text matched by such patterns is undefined.)
  691. .LP
  692. For some trailing context rules, parts which are actually fixed-length are
  693. not recognized as such, leading to the abovementioned performance loss.
  694. In particular, parts using '|' or {n} (such as "foo{3}") are always
  695. considered variable-length.
  696. .LP
  697. Combining trailing context with the special '|' action can result in
  698. .I fixed
  699. trailing context being turned into the more expensive
  700. .I variable
  701. trailing context. For example, this happens in the following example:
  702. .nf
  703. %%
  704. abc |
  705. xyz/def
  706. .fi
  707. .LP
  708. Use of unput() invalidates yytext and yyleng.
  709. .LP
  710. Use of unput() to push back more text than was matched can
  711. result in the pushed-back text matching a beginning-of-line ('^')
  712. rule even though it didn't come at the beginning of the line
  713. (though this is rare!).
  714. .LP
  715. Pattern-matching of NUL's is substantially slower than matching other
  716. characters.
  717. .LP
  718. .I flex
  719. does not generate correct #line directives for code internal
  720. to the scanner; thus, bugs in
  721. .I flex.skel
  722. yield bogus line numbers.
  723. .LP
  724. Due to both buffering of input and read-ahead, you cannot intermix
  725. calls to <stdio.h> routines, such as, for example,
  726. .B getchar(),
  727. with
  728. .I flex
  729. rules and expect it to work. Call
  730. .B input()
  731. instead.
  732. .LP
  733. The total table entries listed by the
  734. .B -v
  735. flag excludes the number of table entries needed to determine
  736. what rule has been matched. The number of entries is equal
  737. to the number of DFA states if the scanner does not use
  738. .B REJECT,
  739. and somewhat greater than the number of states if it does.
  740. .LP
  741. .B REJECT
  742. cannot be used with the
  743. .I -f
  744. or
  745. .I -F
  746. options.
  747. .LP
  748. Some of the macros, such as
  749. .B yywrap(),
  750. may in the future become functions which live in the
  751. .B -lfl
  752. library. This will doubtless break a lot of code, but may be
  753. required for POSIX-compliance.
  754. .LP
  755. The
  756. .I flex
  757. internal algorithms need documentation.