home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / TEXT / UTILITY / FLEX237.ZIP / FLEX.MAN < prev    next >
Encoding:
Text File  |  1991-04-02  |  26.2 KB  |  705 lines

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