Seth Woolley's Man Viewer

plex(1) - plex - The Pascal Lex lexical analyzer generator - man 1 plex

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

plex(1)                Pascal lexical analyzer generator               plex(1)



NAME
       plex - The Pascal Lex lexical analyzer generator.



USAGE
       lex [options] lex-file[.l] [output-file[.pas]]



OPTIONS
       -v     Verbose:  Lex  generates a readable description of the generated
              lexical analyzer, written to lex-file with new extension .lst

       -o     Optimize: Lex optimizes DFA tables to produce a minimal DFA.


DESCRIPTION
       TP Lex is a program generator that is used to generate the Turbo Pascal
       source code for a lexical analyzer subroutine from the specification of
       an input language by a regular expression grammar.

       TP Lex parses the source grammar contained in(1,8)  lex-file  (with  default
       suffix  output-file  (with  default  suffix .pas); if(3,n) no output file(1,n) is
       specified, output goes to lex-file with new suffix .pas. If any  errors
       are  found  during  compilation, error(8,n) messages are written to the list
       file(1,n) (lex-file with new suffix .lst).

       The generated output file(1,n) contains a lexical analyzer  routine,  yylex,
       implemented as:

                function yylex : Integer;

       This routine has to be called by your main program to execute the lexi-
       cal analyzer. The return value of the yylex routine usually denotes the
       number  of  a  token recognized by the lexical analyzer (see the return
       routine in(1,8) the LexLib unit). At end-of-file the yylex routine  normally
       returns 0.

       The  code  template for the yylex routine may be found in(1,8) the yylex.cod
       file. This file(1,n) is needed by TP Lex when it constructs the output file.
       It  must be present either in(1,8) the current directory or in(1,8) the directory
       from which TP Lex was executed (TP Lex searches  these  directories  in(1,8)
       the  indicated order). (NB: For the Linux/Free Pascal version(1,3,5), the code
       template is searched in(1,8) some directory defined at compile-time  instead
       of the execution path, usually /usr/lib/fpc(1,5)/lexyacc.)

       The TP Lex library (LexLib) unit is required by programs using Lex-gen-
       erated lexical analyzers; you will therefore have to put an appropriate
       uses  clause  into  your program or unit that contains the lexical ana-
       lyzer routine. The LexLib unit also  provides  various  useful  utility
       routines; see the file(1,n) lexlib.pas for further information.



MORE INFORMATION
       For  more information, see the documentation that comes with TP lex and
       yacc.


AUTHOR
       Albert  Graeff   (<ag@muwiinfa.geschichte.uni-mainz.de>,   <Dr.Graef@t-
       online.de>)


SEE ALSO
       ppc386(1) pyacc(1)



Free Pascal                       10 Jan 2000                          plex(1)

References for this manual (incoming links)