home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / man / catl / flex.0 next >
Text File  |  1993-12-07  |  30KB  |  727 lines

  1.  
  2.  
  3.  
  4. FLEX(1)                                                   FLEX(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        flex - fast lexical analyzer generator
  9.  
  10. SSYYNNOOPPSSIISS
  11.        fflleexx [[--bbccddffiinnppssttvvFFIILLTT88 --CC[[eeffmmFF]] --SSsskkeelleettoonn]] _[_f_i_l_e_n_a_m_e _._._._]
  12.  
  13. DDEESSCCRRIIPPTTIIOONN
  14.        _f_l_e_x is a tool for  generating  _s_c_a_n_n_e_r_s_:  programs  which
  15.        recognized lexical patterns in text.  _f_l_e_x 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  _r_u_l_e_s_. _f_l_e_x generates as output a C
  20.        source file, lleexx..yyyy..cc,, which defines  a  routine  yyyylleexx(())..
  21.        This  file is compiled and linked with the --llffll 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 fflleexxddoocc((11))..  This manual entry
  28.        is intended for use as a quick reference.
  29.  
  30. OOPPTTIIOONNSS
  31.        _f_l_e_x has the following options:
  32.  
  33.        --bb     Generate backtracking information to _l_e_x_._b_a_c_k_t_r_a_c_k_.
  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  --ff  or  --FF is used, the generated scanner will
  39.               run faster.
  40.  
  41.        --cc     is a do-nothing,  deprecated  option  included  for
  42.               POSIX compliance.
  43.  
  44.               NNOOTTEE::  in  previous  releases  of _f_l_e_x --cc specified
  45.               table-compression options.  This  functionality  is
  46.               now  given  by the --CC flag.  To ease the the impact
  47.               of this change, when _f_l_e_x encounters  --cc,,  it  cur-
  48.               rently issues a warning message and assumes that --CC
  49.               was desired instead.  In the  future  this  "promo-
  50.               tion"  of --cc to --CC will go away in the name of full
  51.               POSIX  compliance  (unless  the  POSIX  meaning  is
  52.               removed first).
  53.  
  54.        --dd     makes  the  generated  scanner  run  in _d_e_b_u_g mode.
  55.               Whenever a pattern is  recognized  and  the  global
  56.               yyyy__fflleexx__ddeebbuugg  is  non-zero (which is the default),
  57.               the scanner will write to  _s_t_d_e_r_r  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.        --ff     specifies (take your pick) _f_u_l_l _t_a_b_l_e or _f_a_s_t _s_c_a_n_-
  83.               _n_e_r_.   No table compression is done.  The result is
  84.               large but fast.  This option is equivalent  to  --CCff
  85.               (see below).
  86.  
  87.        --ii     instructs _f_l_e_x to generate a _c_a_s_e_-_i_n_s_e_n_s_i_t_i_v_e scan-
  88.               ner.  The case of letters given in the  _f_l_e_x  input
  89.               patterns  will  be ignored, and tokens in the input
  90.               will be matched regardless of  case.   The  matched
  91.               text  given  in _y_y_t_e_x_t will have the preserved case
  92.               (i.e., it will not be folded).
  93.  
  94.        --nn     is another do-nothing, deprecated  option  included
  95.               only for POSIX compliance.
  96.  
  97.        --pp     generates  a  performance  report  to  stderr.  The
  98.               report consists of comments regarding  features  of
  99.               the _f_l_e_x input file which will cause a loss of per-
  100.               formance in the resulting scanner.
  101.  
  102.        --ss     causes the _d_e_f_a_u_l_t  _r_u_l_e  (that  unmatched  scanner
  103.               input  is  echoed  to _s_t_d_o_u_t_) 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.        --tt     instructs _f_l_e_x to write the scanner it generates to
  108.               standard output instead of lleexx..yyyy..cc..
  109.  
  110.        --vv     specifies that _f_l_e_x should write to _s_t_d_e_r_r  a  sum-
  111.               mary  of statistics regarding the scanner it gener-
  112.               ates.
  113.  
  114.        --FF     specifies that the _f_a_s_t 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  fflleexxddoocc((11))
  119.               for details.
  120.  
  121.               This option is equivalent to --CCFF (see below).
  122.  
  123.        --II     instructs  _f_l_e_x to generate an _i_n_t_e_r_a_c_t_i_v_e 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 fflleexxddoocc((11)) for details.
  140.  
  141.               Note, --II cannot be used in conjunction with _f_u_l_l or
  142.               _f_a_s_t _t_a_b_l_e_s_, i.e., the --ff,, --FF,, --CCff,, or --CCFF flags.
  143.  
  144.        --LL     instructs _f_l_e_x not to generate ##lliinnee directives  in
  145.               lleexx..yyyy..cc..   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 _f_l_e_x
  148.               input file, and not to the fairly meaningless  line
  149.               numbers of lleexx..yyyy..cc..
  150.  
  151.        --TT     makes  _f_l_e_x  run in _t_r_a_c_e mode.  It will generate a
  152.               lot of messages to _s_t_d_o_u_t 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 _f_l_e_x_.
  156.  
  157.        --88     instructs  _f_l_e_x  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 ((--vv))  output  for  "equiva-
  161.               lence  classes created".  If the denominator of the
  162.               number shown is 128, then by default _f_l_e_x is gener-
  163.               ating  7-bit  characters.   If  it is 256, then the
  164.               default is 8-bit characters.
  165.  
  166.        --CC[[eeffmmFF]]
  167.               controls the degree of table compression.
  168.  
  169.               --CCee 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_,
  170.               i.e., sets of characters which have identical lexi-
  171.               cal properties.  Equivalence classes  usually  give
  172.               dramat