plex.1 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. .TH plex 1 "10 Jan 2000" "Free Pascal" "Pascal lexical analyzer generator"
  2. .SH NAME
  3. plex \- The Pascal Lex lexical analyzer generator.
  4. .SH USAGE
  5. .B lex [options] lex-file[.l] [output-file[.pas]]
  6. .SH OPTIONS
  7. .TP
  8. .B \-v
  9. .I Verbose:
  10. Lex generates a readable description of the generated
  11. lexical analyzer, written to lex-file with new extension
  12. .I .lst
  13. .TP
  14. .B \-o
  15. .I Optimize:
  16. Lex optimizes DFA tables to produce a minimal DFA.
  17. .SH DESCRIPTION
  18. TP Lex is a program generator that is used to generate the Turbo Pascal source
  19. code for a lexical analyzer subroutine from the specification of an input
  20. language by a regular expression grammar.
  21. TP Lex parses the source grammar contained in lex-file (with default suffix
  22. .l) and writes the constructed lexical analyzer subroutine to the specified
  23. output-file (with default suffix .pas); if no output file is specified, output
  24. goes to lex-file with new suffix .pas. If any errors are found during
  25. compilation, error messages are written to the list file (lex-file with new
  26. suffix .lst).
  27. The generated output file contains a lexical analyzer routine, yylex,
  28. implemented as:
  29. .RS
  30. function yylex : Integer;
  31. .RE
  32. This routine has to be called by your main program to execute the lexical
  33. analyzer. The return value of the yylex routine usually denotes the number
  34. of a token recognized by the lexical analyzer (see the return routine in the
  35. LexLib unit). At end-of-file the yylex routine normally returns 0.
  36. The code template for the yylex routine may be found in the yylex.cod
  37. file. This file is needed by TP Lex when it constructs the output file. It
  38. must be present either in the current directory or in the directory from which
  39. TP Lex was executed (TP Lex searches these directories in the indicated
  40. order). (NB: For the Linux/Free Pascal version, the code template is searched
  41. in some directory defined at compile-time instead of the execution path,
  42. usually /usr/lib/fpc/lexyacc.)
  43. The TP Lex library (LexLib) unit is required by programs using Lex-generated
  44. lexical analyzers; you will therefore have to put an appropriate uses clause
  45. into your program or unit that contains the lexical analyzer routine. The
  46. LexLib unit also provides various useful utility routines; see the file
  47. lexlib.pas for further information.
  48. .SH MORE INFORMATION
  49. For more information, see the documentation that comes with TP lex and yacc.
  50. .SH AUTHOR
  51. Albert Graeff (<[email protected]>, <[email protected]>)
  52. .SH SEE ALSO
  53. .BR ppc386 (1)
  54. .BR pyacc (1)