MAN page from RedHat EL 8 fpc-3.2.0-1.el8.x86_64.rpm
plex
Section: Pascal lexical analyzer generator (1)
Updated: 10 Jan 2000
Index NAME
plex - The Pascal Lex lexical analyzer generator.
USAGE
lex [options] lex-file[.l] [output-file[.pas]]
OPTIONS
- -v
- Verbose:plexgenerates a readable description of the generatedlexical analyzer, written to lex-file with new extension .lst
- -o
- Optimize:plexoptimizes DFA tables to produce a minimal DFA.
DESCRIPTION
plexis a program generator that is used to generate the Turbo Pascal sourcecode for a lexical analyzer subroutine from the specification of an inputlanguage by a regular expression grammar.
plexparses the source grammar contained in lex-file (with default suffix .l)and writes the constructed lexical analyzer subroutine to the specifiedoutput-file (with default suffix .pas); if no output file is specified, outputgoes to lex-file with new suffix .pas. If any errors are found duringcompilation, error messages are written to the list file (lex-file with newsuffix .lst).
The generated output file contains a lexical analyzer routine, yylex,implemented as:
function yylex : Integer;
This routine has to be called by your main program to execute the lexicalanalyzer. The return value of the yylex routine usually denotes the numberof a token recognized by the lexical analyzer (see the return routine in theLexLib unit). At end-of-file the yylex routine normally returns 0.
The code template for the yylex routine may be found in the yylex.codfile. This file is needed by TP Lex when it constructs the output file. Itmust be present either in the current directory or in the directory from whichTP Lex was executed (TP Lex searches these directories in the indicatedorder). (NB: For the Linux/Free Pascal version, the code template is searchedin some directory defined at compile-time instead of the execution path,usually /usr/lib/fpc/lexyacc.)
The TP Lex library (LexLib) unit is required by programs using Lex-generatedlexical analyzers; you will therefore have to put an appropriate uses clauseinto your program or unit that contains the lexical analyzer routine. TheLexLib unit also provides various useful utility routines; see the filelexlib.pas for further information.
MORE INFORMATION
For more information, see the documentation that comes with plex and yacc.
AUTHOR
Albert Graeff (<
ag@muwiinfa.geschichte.uni-mainz.de>, <Dr.GraefAATTt-online.de>)
SEE ALSO
ppc386(1)
pyacc(1)
Index
- NAME
- USAGE
- OPTIONS
- DESCRIPTION
- MORE INFORMATION
- AUTHOR
- SEE ALSO
This document was created byman2html,using the manual pages.