home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / doc / flex.man < prev    next >
Text File  |  1993-06-13  |  28KB  |  727 lines

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