home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d7xx / d704 / flex.lha / Flex / text-doc.lha / flex.text next >
Text File  |  1992-07-21  |  23KB  |  727 lines

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