home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Developer / flex-2.4.6 / MISC / VMS / VMS.more-stuff < prev    next >
Encoding:
Text File  |  1994-07-23  |  76.0 KB  |  2,186 lines  |  [TEXT/KAHL]

  1. (Message inbox:129)
  2. Date:  Sun, 25 Nov 90 18:33 EDT
  3. From:  Stu McGraw <SYSMAN%hilbert@gte.com>
  4. Subject:  Re: Flex bug and fix
  5. To:  vern@helios.ee.lbl.gov
  6. X-Vms-To:  IN%"vern@helios.ee.lbl.gov"
  7.  
  8. Hi Vern,
  9.  
  10.     Here is the stuff for VMS I wrote to you about last
  11. week.  The context diff for main.c is in main.dif.  README.VMS
  12. is a list of files and what they are for.  changes.vms is
  13. a description of exactly what I did.  All three of these files
  14. are for you and can be removed if you want.  The rest can just
  15. go into a ./VMS subdirectory -- there is an install.vms file
  16. that gives pretty thorough instructions (I hope so after the 
  17. hours I spent on it!) for installing the stuff on VMS.  If any-
  18. one has any problems with the VMS parts I'll be happy to help 
  19. them with it if you refer them to me (or feel free to edit any
  20. of the files to say that).  If you do include this stuff with
  21. the flex distribution, I'll try and keep it uptodate with new
  22. versions (circumstances permitting of course).  Or if there's 
  23. anything you'd rather see done differently let me know.  And 
  24. thanks again for a terrific tool!
  25.                         -- Stu
  26. --
  27. Stuart McGraw,         sjm0@gte.com
  28. GTE Labs, Waltham MA    {hsuc6,harvard}!bunny!hilbert.gte.com!mcgraw 
  29. (617) 466-2525        mcgraw@hilbert.gte.com
  30.  
  31. #! /bin/sh
  32. # This is a shell archive.  Remove anything before this line, then unpack
  33. # it by saving it into a file and typing "sh file".  To overwrite existing
  34. # files, type "sh file -c".  You can also feed this as standard input via
  35. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  36. # will see the following message at the end:
  37. #        "End of shell archive."
  38. # Contents:  README.VMS changes.vms cli.c dclmake.com flex.cld_template
  39. #   flex.hlp install.vms main.dif makefile.vms vmscmdln.c
  40. # Wrapped by sjm0@bunny.gte.com on Sun Nov 25 16:07:31 1990
  41. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  42. if test -f 'README.VMS' -a "${1}" != "-c" ; then 
  43.   echo shar: Will not clobber existing file \"'README.VMS'\"
  44. else
  45. echo shar: Extracting \"'README.VMS'\" \(730 characters\)
  46. sed "s/^X//" >'README.VMS' <<'END_OF_FILE'
  47. X
  48. X-----------------------------
  49. XFlex version 2.3.6 (11/17/90)
  50. X-----------------------------
  51. X
  52. The vms subdirectory contains support for making flex
  53. on VMS with either a unix-style or VMS-style command 
  54. line interface. 
  55. X
  56. Read install.vms for installation instuctions.
  57. X
  58. XFiles:
  59. X------
  60. README.VMS -- this file
  61. changes.vms -- description of changes to flex for VMS
  62. cli.c -- c interface routines to vms system cli routines
  63. dclmake.com -- command file to build flex
  64. flex.cld_template -- base command definition file for flex
  65. flex.hlp -- help file entry for flex
  66. install.vms -- installation instructions for VMS
  67. main.dif -- context diff for main.c (v2.3.6)
  68. makefile.vms -- makefile for VMS
  69. vaxcmdln.c -- source for vms command line support
  70. END_OF_FILE
  71. if test 730 -ne `wc -c <'README.VMS'`; then
  72.     echo shar: \"'README.VMS'\" unpacked with wrong size!
  73. fi
  74. # end of 'README.VMS'
  75. fi
  76. if test -f 'changes.vms' -a "${1}" != "-c" ; then 
  77.   echo shar: Will not clobber existing file \"'changes.vms'\"
  78. else
  79. echo shar: Extracting \"'changes.vms'\" \(3637 characters\)
  80. sed "s/^X//" >'changes.vms' <<'END_OF_FILE'
  81. Changes to flex 2.3.6 to improve life on VMS
  82. X11/17/90 - Stuart McGraw, GTE Labs (sjm0@gte.com)
  83. X
  84. modified files:
  85. X---------------
  86. main.c
  87. X    -- If foo doesn't exist, "flex -vpb foo" trys to dereference a
  88. X    NULL pointer (causes access violation on VMS) because the error
  89. X    calls flexend() which tries to print statistics (-v flag) before
  90. X    the pointers it uses have been initialized.  Fixed by setting a
  91. X    new variable 'initialized' just before flexinit() returns (after
  92. X    everything's been initialized) and suppressing the statistics
  93. X    report in flexend() if it isn't set.
  94. X
  95. X    -- Use VMSCMDLN define to select original unix command line
  96. X    parsing or alternate VMS command line parsing (done by including
  97. X    vaxcmdln.c which contains the code).  This also required moving
  98. X    a few snippets of code around to keep the unix-only and vms-only
  99. X    sections contiguous.
  100. X
  101. X    -- The VMS conditional for the exit status value in flexend()
  102. X    was deleted since it better done by redefining exit() (done as
  103. X    a CC command line macro though it could also be done in flexdef.h.)
  104. X        This applies to all exits (error exits in scan.c and parse.c 
  105. X    previously exited with VMS success status) and gets rid of the
  106. X        annoying NONAME-W-NOMESSAGE message from VMS when an error occurs
  107. X    in flex.
  108. X
  109. X    -- VAXC generates a truly grotesque string for argv[0].  Added a
  110. X    few lines of code if flexinit() to turn it into something reasonable.
  111. X
  112. X    -- Made the name of the backtracking info file parameterizable.
  113. X    This also lets flex print the actual name of the file out in error
  114. X    messages (it would always print "lex.backtrack" before, even when
  115. X    the name was lex.bck).
  116. X
  117. new files:
  118. X----------
  119. makefile.vms
  120. X    Rewrote the previous makefile (Makefile.VMS).  Changes include:
  121. X
  122. X    -- Allows building and installing either the unix-style command
  123. X    line version of flex, or the VMS-style command line version.
  124. X
  125. X    -- Use flex_exe, flex_library, and flex_manual for default names
  126. X    rather than tools$$exe, tools$$library, and tools$$manual since
  127. X    the latter violate DEC logical name recommendations ($ reserved
  128. X    for DEC).
  129. X
  130. X    -- Compile everything with /def="exit(s)=_exit((s)?0x1000002A:0)".
  131. X    This will result in a VMS error status for all error exits 
  132. X    (including those in the lexer and parser subroutines) with-
  133. X    out requiring any source code changes.  It also gets rid of
  134. X    those annoying NONAME-W-NOMESSAGE messages that occurred before
  135. X    and changes the exit status from warning to error.
  136. X
  137. X    -- Testing can be done using the local version of flex, or the
  138. X    publicly installed version for flex's built with either command
  139. X    line option.
  140. X
  141. X    -- Reordered operations to make it easier to convert it to the
  142. X    dclmake.com file.
  143. X
  144. dclmake.com
  145. X    -- A dcl procedure to do the compiling/linking/testing/installing
  146. X    done by makefile.vms for those without MAKE or MMS.
  147. X
  148. vaxcmdln.c
  149. X    -- Contains code that is conditionally #included in flexinit()
  150. X    (main.c) to handle VMS command line parsing.  In a separate file
  151. X    so as not to clutter up the main code with alot of vms dependent 
  152. X    junk.
  153. X
  154. cli.c
  155. X    -- A couple of general purpose support routines for VMS command 
  156. X    line parsing and called from the code in vmscmdln.c.  These are
  157. X    just C language interfaces to two VMS system calls.
  158. X
  159. flex.cld_template
  160. X    -- Command definition file for the VMS command line interface
  161. X    sans the define verb and image lines.  Used to generate the local 
  162. X    and public flex.cld files.
  163. X
  164. flex.hlp
  165. X    -- VMS help file edited from the version 2.3.6 version flex.man
  166. X    file for use with the VMS-style command line interface.
  167. X
  168. changes.vms
  169. X    -- This file.
  170. X
  171. install.vms
  172. X    -- Installation instructions for VMS.
  173. X
  174. README.VMS
  175. X    -- A short pointer to the other files.
  176. END_OF_FILE
  177. if test 3637 -ne `wc -c <'changes.vms'`; then
  178.     echo shar: \"'changes.vms'\" unpacked with wrong size!
  179. fi
  180. # end of 'changes.vms'
  181. fi
  182. if test -f 'cli.c' -a "${1}" != "-c" ; then 
  183.   echo shar: Will not clobber existing file \"'cli.c'\"
  184. else
  185. echo shar: Extracting \"'cli.c'\" \(7593 characters\)
  186. sed "s/^X//" >'cli.c' <<'END_OF_FILE'
  187. X/*============================================================================
  188. =
  189. X
  190. X    CLI.C -- Simple C interfaces to VMS CLI$ utilities.
  191. X
  192. X-----------------------------------------------------------------------------*
  193. /
  194. X
  195. X#include descrip
  196. X#include climsgdef
  197. X#define STS$M_SUCCESS 1
  198. X
  199. X/*============================================================================
  200. =
  201. X
  202. X    cli_value -- Get the value of a CLI parameter or qualifier.
  203. X
  204. X    This is an interface to the VMS utility routine CLI$VALUE that
  205. X    is easy to call in a C language program.  It does the grunge
  206. X    work of creating string descriptors from C style NUL terminated
  207. X    strings etc.  cli_value returns the value associated with the
  208. X    specified command line entity in the character array pointed to
  209. X    by 'value'.
  210. X
  211. X    If the requested entity was present in the command line (even in
  212. X    negated form), cli_value's function return value is a non-zero
  213. X    (TRUE) value.  If the entity was absent, a zero value (FALSE) is
  214. X    returned by cli_value.  The actual value returned depends on whether
  215. X    'value' was NULL or not.  If it wasn't, cli_value returns a TRUE
  216. X    value that is the status returned by CLI$VALUE.  If 'value' was
  217. X    NULL, cli_value returns the status returned by CLI$PRESENT.  (This
  218. X    to provide access to the return values from CLI$PRESENT since CLI_-
  219. X    KEYWORD returns only 0 or 1).
  220. X
  221. X
  222. X    Calling sequence:
  223. X    n = cli_value (name, value, value_size);
  224. X
  225. X    Parameters:
  226. X    char *name;
  227. X      Pointer to a NUL terminated character string that contains
  228. X      the name of the parameter, qualifier or keyword path whose
  229. X      value is wanted.
  230. X    char *value;
  231. X      NULL or a pointer to a character buffer of 'value_size' bytes
  232. X      that will receive the entity's value.  If not NULL, the entity's
  233. X      value is copied into 'value' in the form of a NUL terminated
  234. X      text string.  If the entity was absent, 'value' is set to a
  235. X      null string ("").
  236. X    int value_size;
  237. X      The size of the buffer 'value' in bytes.  No more than this many
  238. X      byte will be written to 'value'.
  239. X
  240. X    Returns:  int n;
  241. X    cli_value returns 0 (FALSE) if the requested parameter,
  242. X    qualifier, or keyword path, was absent from the command
  243. X    line.  If it was present (even in negated form), cli_value
  244. X    returns a non-zero (TRUE) value that depends on whether or
  245. X    not 'value' is non-NULL.  
  246. X
  247. X    If 'value' was non-NULL, the value returned is the status
  248. X    from the CLI$VALUE routine (CLI$_COMMA, CLI$_CONCAT,
  249. X    CLI$_NORMAL).
  250. X
  251. X    If 'value' was NULL, then cli_value returns the status from
  252. X    the CLI$PRESENT routine (CLI$_PRESENT, CLI$NEGATED, CLI$_LOCPRES,
  253. X    CLI$LOCNEG, CLI$_DEFAULTED).
  254. X
  255. X    Examples:
  256. X    The most common way of using cli_value is to get the value of
  257. X    a parameter or qualifier.  If a .CLD file contained:
  258. X
  259. X        PARAMETER P1, LABEL=INFILE,
  260. X            VALUE (REQUIRED, TYPE=$INFILE)
  261. X
  262. X    then the call below would read the value of the parameter and put
  263. X    it in 'input_fn'.
  264. X
  265. X        char input_fn[256];
  266. X         ....
  267. X        cli_value ("INFILE", input_fn, sizeof (input_fn));
  268. X
  269. X    Reading a list of values is just as easy:
  270. X
  271. X        PARAMETER P1, LABEL=INFILE, 
  272. X            VALUE (REQUIRED, LIST, TYPE=$INFILE)
  273. X
  274. X        char input_fn[256];
  275. X         ....
  276. X        while (cli_value ("INFILE", input_fn, sizeof (input_fn)))
  277. X            {
  278. X            ....process 'input_fn'....
  279. X            }
  280. X
  281. X
  282. X-----------------------------------------------------------------------------
  283. X
  284. X    4/12/88 - Stuart McGraw.
  285. X    Put a trailing NUL in 'value' regardless of the return code
  286. X    since CLI$GET_VALUE will blank fill it even if the requested
  287. X    qualifier is absent.
  288. X    3/2/86 - Stuart McGraw, GTE Labs (sjm0@gte.com)
  289. X
  290. X-----------------------------------------------------------------------------*
  291. /
  292. X
  293. int
  294. cli_value (name, value, vsize)
  295. X    char *name;
  296. X    char *value;
  297. X    int vsize;
  298. X    {
  299. X    int status;
  300. X    short ret_length = 0;
  301. X    struct dsc$descriptor qul;
  302. X    struct dsc$descriptor qvl;
  303. X
  304. X    qul.dsc$b_class = DSC$K_CLASS_S;
  305. X    qul.dsc$b_dtype = DSC$K_DTYPE_T;
  306. X    qul.dsc$w_length = strlen (name);
  307. X    qul.dsc$a_pointer = name;
  308. X
  309. X    if (value) {
  310. X        qvl.dsc$b_class = DSC$K_CLASS_S;
  311. X        qvl.dsc$b_dtype = DSC$K_DTYPE_T;
  312. X        qvl.dsc$w_length = vsize - 1;
  313. X        qvl.dsc$a_pointer = value;
  314. X
  315. X        status = CLI$GET_VALUE (&qul, &qvl, &ret_length);
  316. X        value[ret_length] = 0;
  317. X        if (status == CLI$_ABSENT)
  318. X        return (0);
  319. X        return (status);
  320. X        }
  321. X    status = CLI$PRESENT (&qul);
  322. X    return (status == CLI$_ABSENT ? 0 : status);
  323. X    }
  324. X
  325. X/*============================================================================
  326. =
  327. X
  328. X    cli_qualifier -- Return TRUE or FALSE depending on presence of entity.
  329. X
  330. X    Will return a 1 (TRUE) if the entity 'name' was specified or
  331. X    present by default in the DCL command line or 0 (FALSE) if it was
  332. X    specified and negated.  If it wasn't specified at all (and no default
  333. X    was specified in the CLD tables), the value 'deflt' is returned.
  334. X
  335. X    Calling sequence:
  336. X    n = cli_qualifier (name, deflt);
  337. X
  338. X    Parameters:
  339. X    char *name;
  340. X      Pointer to a NUL terminated string that contains the name
  341. X      of the command line parameter, qualifier, or keyword path.
  342. X    int deflt;
  343. X      A value that will be returned if the entity was not present
  344. X      in the command line (either explicitly or by default).
  345. X
  346. X    Returns:
  347. X    int n;
  348. X      1 if the entity was present and not negated.  0 if the
  349. X      entity was present and negated.  The value of 'deflt'
  350. X      if the entity wasn't present.
  351. X
  352. X    Examples:
  353. X    This simplest use is to set the value of a variable depending
  354. X    on whether or not a qualifier was specified in the command line.
  355. X    Assuming a .CLD file like:
  356. X
  357. X        QUALIFIER DEBUG
  358. X
  359. X    we could use the this code to set the variable 'dbg':
  360. X
  361. X        dbg = cli_qualifier ("DEBUG", 0);
  362. X
  363. X    For this use, you generally don't want to make use  of the
  364. X        'deflt' parameter.   To make /DEBUG the default it is better
  365. X    to modify the .CLD file to:
  366. X
  367. X        QUALIFIER FLAG, DEFAULT
  368. X
  369. X    since this lets you change defaults without recompiling the
  370. X    program.
  371. X
  372. X    The next example illustrate where the 'deflt' parameter is 
  373. X    useful.  Assume a command definition file that looks like:
  374. X
  375. X        DEFINE TYPE DEBUG_TYPES
  376. X            keyword ALL
  377. X            keyword RANGE
  378. X            keyword AUDIO
  379. X            keyword INITIAL
  380. X            keyword CLEANUP
  381. X        QUALIFIER DEBUG, VALUE (TYPE=DEBUG_TYPES)
  382. X
  383. X    where we want to be able to use the qualifier like:
  384. X
  385. X        /DEBUG=(RANGE,AUDIO)
  386. X        /DBUG=ALL
  387. X        /DEBUG=(ALL,NOCLEANUP)
  388. X
  389. X    Here is how that can easily be done by using the ALL value as a
  390. X    default for the remainder:
  391. X
  392. X        all       = cli_qualifier ("DEBUG.ALL", 0);
  393. X        dbg_rng   = cli_qualifier ("DEBUG.RANGE", all);
  394. X        dbg_audio = cli_qualifier ("DEBUG.AUDIO", all);
  395. X        dbg_init  = cli_qualifier ("DEBUG.INITIAL", all);
  396. X        dbg_clnup = cli_qualifier ("DEBUG.CLEANUP", all);
  397. X
  398. X
  399. X------------------------------------------------------------------------------
  400. X
  401. X    3/2/86 - Stuart McGraw, GTE Labs. (sjm0@gte.com)
  402. X
  403. X-----------------------------------------------------------------------------*
  404. /
  405. X
  406. int
  407. cli_qualifier (name, deflt)
  408. X    char *name;
  409. X    int deflt;
  410. X    {
  411. X    int status;
  412. X    struct dsc$descriptor qul;
  413. X
  414. X    qul.dsc$b_class = DSC$K_CLASS_S;
  415. X    qul.dsc$b_dtype = DSC$K_DTYPE_T;
  416. X    qul.dsc$w_length = strlen (name);
  417. X    qul.dsc$a_pointer = name;
  418. X
  419. X    status = CLI$PRESENT (&qul);
  420. X    if (status == CLI$_PRESENT  ||
  421. X      status == CLI$_DEFAULTED ||
  422. X      status == CLI$_LOCPRES) {
  423. X        return (1);
  424. X        }
  425. X    if (status == CLI$_NEGATED ||
  426. X      status == CLI$_LOCNEG) {
  427. X        return (0);
  428. X        }
  429. X    /* else (status == CLI$_ABSENT) */
  430. X    return (deflt);
  431. X    }
  432. X
  433. X/*
  434. X    cli_qualifier used to be called cli_keyword.  The routine below is
  435. X    so that old programs that call the former will still link and run
  436. X    without any source code changes.
  437. X*/
  438. int
  439. cli_keyword (name, deflt)
  440. X    char *name;
  441. X    int deflt;
  442. X    {
  443. X    return cli_qualifier (name, deflt);
  444. X    }
  445. END_OF_FILE
  446. if test 7593 -ne `wc -c <'cli.c'`; then
  447.     echo shar: \"'cli.c'\" unpacked with wrong size!
  448. fi
  449. # end of 'cli.c'
  450. fi
  451. if test -f 'dclmake.com' -a "${1}" != "-c" ; then 
  452.   echo shar: Will not clobber existing file \"'dclmake.com'\"
  453. else
  454. echo shar: Extracting \"'dclmake.com'\" \(9758 characters\)
  455. sed "s/^X//" >'dclmake.com' <<'END_OF_FILE'
  456. X$    v = f$verify (0)
  457. X$! IMPORTANT:  Before you use this procedure, read INSTALL.VMS and the
  458. X$! comments below.  You will need an alloca object module and GNU bison.
  459. X$! Define the logical names flex_exe, flex_library, and flex_manual.
  460. X$!
  461. X$! For flex version 2.3.6 (11/17/90)
  462. X$!
  463. X$! You use this procedure to compile, link and test flex by doing:
  464. X$!
  465. X$!        @ DCLMAKE BUILD
  466. X$!
  467. X$! To install flex in the public directory, be sure that the logical
  468. X$! names "flex_exe", "flex_library", and "flex_manual" are correctly
  469. X$! defined and do:
  470. X$!
  471. X$!        @ DCLMAKE INSTALL_TEST
  472. X$!
  473. X$! You can also use this procedure to compile individual source files
  474. X$! by saying:
  475. X$!
  476. X$!        @ DCLMAKE COMPILE name
  477. X$!
  478. X$! where "name" is the source file's name without the file type, e.g.
  479. X$! "@DCLMAKE COMPILE CCL".  With no filename, DCLMAKE will compile all
  480. X$! the source files.  Link by doing: "@DCLMAKE LINK", test the local
  481. X$! flex with "@DCLMAKE TEST", install the public files with "@DCLMAKE
  482. X$! INSTALL", and test the installed files with "@DCLMAKE TEST_FLEX".
  483. X$!
  484. X$! When "test" or "test_flex" is executed you shoud see the message
  485. X$! "Test successful".  A make abort after the diff command is a failure.
  486. X$! To get some idea of what went wrong, do a diff between lexyy.c (the file
  487. X$! just generated by flex) and initscan.c (what it should have generated).
  488. X$!
  489. X$!
  490. X$!
  491. X$! The flex parser generated by bison requires an alloca routine which
  492. X$! you must supply.  Change the line below if your alloca.obj is some-
  493. X$! where other than the current directory.
  494. X$ALLOCA = "alloca.obj"
  495. X$!ALLOCA = "gnu_bison:[000000]vmshlp.obj"
  496. X$
  497. X$! Use one of the following two defines.  The first will build flex with
  498. X$! a VMS-style command line interface, the second builds flex with a unix-
  499. X$! style command line interface.
  500. X$!
  501. X$! For a VMS-style interface...
  502. X$VERSION = "vms"
  503. X$! For a unix-style interface...
  504. X$!VERSION = ""
  505. X$
  506. X$
  507. X$! BIN, LIB, MAN, CLD, HLP are set to reflect the locations where you
  508. X$! would like to store the executables, library (flex.skel), the manual
  509. X$! pages, the command definition file, and the help library module. 
  510. X$! You can leave these unchanged if you define the VMS logical names:
  511. X$!
  512. X$!    flex_exe      -- disk/dir of the executable image    
  513. X$!    flex_manual   -- disk/dir of the *.man files 
  514. X$!    flex_library  -- disk/dir of flex.skel and the .cld file
  515. X$!
  516. X$! These logical names ***MUST*** be defined before installing or
  517. X$! running flex.  They don't have to be defined to build flex.  You
  518. X$! may want to define these, either system wide in the system startup
  519. X$! procedure, or in your login.com file.  Alternatively, you can change
  520. X$! the definitions of BIN, LIB, CLD, MAN and HLP in here to refer to pre-
  521. X$! defined locations.  
  522. X$!
  523. X$! ...the installed location of the flex executable...
  524. X$BIN = "flex_exe:"
  525. X$
  526. X$! ...the installed location of the flex skeleton file...
  527. X$LIB = "flex_library:"
  528. X$
  529. X$! ...the installed location of the flex vms command definition file
  530. X$! (only matters when installing the VMS command line version)...
  531. X$CLD = "flex_library:"
  532. X$
  533. X$! ...the installed location of the flex man pages.
  534. X$MAN = "flex_manual:"
  535. X$
  536. X$! ...the help library to put the bison help module into. 
  537. X$! (only matters when installing the VMS command line version)...
  538. X$HLP = "sys$common:[syshlp]helplib.hlb"
  539. X$
  540. X$! The default skeleton file that flex will use.
  541. X$DEFAULT_SKEL = "''LIB'flex.skel"
  542. X$
  543. X$! Flags that initscan.c was created with.  The tests will use the same
  544. X$! ones so that they should produce an output identical to initscan.c.
  545. X$VMS_FLEX_FLAGS = "/NOCASE/NOECHO/EIGHT"
  546. X$UNIX_FLEX_FLAGS = "-is8"
  547. X$
  548. X$! Qualifiers for the link and cc commands.  Values here should be
  549. X$! fine.  You may want to modify these to build a debuggable version
  550. X$! of the executable.
  551. X$LFLAGS = ""
  552. X$!LFLAGS = "/debug"
  553. X$CFLAGS = ""
  554. X$!CFLAGS = "/nolist/debug/noopt"
  555. X$
  556. X$! CC command line defines that are used for (almost) all compilations.
  557. X$! The redefinition of exit will cause any error exits to returns a VMS 
  558. X$! error status (SYS-E-ABORT) but one that won't result in a system 
  559. X$! message (presumably flex printed an error message first). 
  560. X$CDEFS = "VMS,USG,""exit(s)=_exit((s)?0x1000002A:0)"""
  561. X$
  562. X$! CC command define for the default skeleton file.
  563. X$SKELDEF = """DEFAULT_SKELETON_FILE=""""''DEFAULT_SKEL'"""""""
  564. X$
  565. X$OBJ =     "ccl.obj,dfa.obj,ecs.obj,gen.obj,misc.obj,nfa.obj," + -
  566. X       "parse.obj,scan.obj,sym.obj,tblcmp.obj,yylex.obj"
  567. X$
  568. X$
  569. X$    on warning then stop
  570. X$    continue = "FALSE"
  571. X$    if "''VERSION'" .eqs. "" .and. f$env ("DEPTH") .eq. 1 then -
  572. X        write sys$output "***** DCLMAKE for UNIX command line interface ***
  573. **"
  574. X$    if "''VERSION'" .nes. "" .and. f$env ("DEPTH") .eq. 1 then -
  575. X        write sys$output "***** DCLMAKE for VMS command line interface ****
  576. *"
  577. X$    set verify
  578. X$    if p1 .eqs. "COMPILE" .and. p2 .nes. "" then goto 'p2'
  579. X$    goto 'p1'
  580. X$
  581. X$done :
  582. X$    v = f$verify (v)
  583. X$    exit
  584. X$
  585. X$build : 
  586. X$    @'f$env ("procedure")' compile
  587. X$    @'f$env ("procedure")' test
  588. X$    goto done
  589. X$
  590. X$install_test :
  591. X$    @'f$env ("procedure")' install
  592. X$    @'f$env ("procedure")' test_flex
  593. X$    goto done
  594. X$
  595. X$link :
  596. X$    goto 'VERSION'_link
  597. X$
  598. X$test_flex :
  599. X$    goto 'VERSION'_test_flex
  600. X$
  601. X$test :
  602. X$    goto 'VERSION'_test
  603. X$
  604. X$
  605. X$install :
  606. X$    copy/log flex.skel 'LIB'flex.skel/prot=(g:r,w:r)
  607. X$
  608. X$    copy/log flex'VERSION'.exe 'BIN'flex'VERSION'.exe/prot=(g:re,w:re)
  609. X$
  610. X$    if f$search("flex.man") .nes. "" then -
  611. X        copy/log flex.man 'MAN'flex.man/prot=(g:r,w:r)
  612. X$
  613. X$    if f$search("flexdoc.man") .nes. "" then -
  614. X        copy/log flex.man 'MAN'flexdoc.man/prot=(g:r,w:r)
  615. X$
  616. X$if "''VERSION'" .eqs. "" then goto done
  617. X$
  618. X$    libr/log 'HLP' flex.hlp/replace
  619. X$
  620. X$    open/write tempfl 'CLD'flex.cld
  621. X$    write tempfl "define verb FLEX"
  622. X$    write tempfl "    image ''BIN'FLEXVMS.EXE"
  623. X$    copy/log flex.cld_template tempfl/prot=(g:r,w:r)
  624. X$    close tempfl
  625. X$    goto done
  626. X$
  627. X$! Local cld file is named xflex so that 'CLD' can be defined as the flex
  628. X$! directory and the flex.cld file will be updated correctly.
  629. X$xflex.cld : flex.cld_template
  630. X$    open/write tempfl xflex.cld
  631. X$    write tempfl "define verb XFLEX"
  632. X$    write tempfl "    image ''f$env ("default")'FLEXVMS.EXE"
  633. X$    copy flex.cld_template tempfl
  634. X$    close tempfl
  635. X$    goto done
  636. X$
  637. X$compile:
  638. X$    continue = "TRUE"
  639. X$
  640. X$ccl : 
  641. X$    cc 'CFLAGS' /define=('CDEFS') ccl.c
  642. X$    if .not. continue then goto done
  643. X$
  644. X$dfa : 
  645. X$    cc 'CFLAGS' /define=('CDEFS') dfa.c
  646. X$    if .not. continue then goto done
  647. X$
  648. X$ecs : 
  649. X$    cc 'CFLAGS' /define=('CDEFS') ecs.c
  650. X$    if .not. continue then goto done
  651. X$
  652. X$gen : 
  653. X$    cc 'CFLAGS' /define=('CDEFS') gen.c
  654. X$    if .not. continue then goto done
  655. X$
  656. X$main : 
  657. X$    cc 'CFLAGS' /define=('CDEFS','SKELDEF') main.c
  658. X$    if .not. continue then goto done
  659. X$
  660. X$mainvms : 
  661. X$    cc 'CFLAGS' /define=('CDEFS','SKELDEF',VMSCMDLN) main.c /obj=mainvms.ob
  662. j
  663. X$    if .not. continue then goto done
  664. X$
  665. X$misc : 
  666. X$    cc 'CFLAGS' /define=('CDEFS') misc.c
  667. X$    if .not. continue then goto done
  668. X$
  669. X$nfa : 
  670. X$    cc 'CFLAGS' /define=('CDEFS') nfa.c
  671. X$    if .not. continue then goto done
  672. X$
  673. X$parse : 
  674. X$! You may need a "set command dev:[dir]bison here if the bison
  675. X$! command is not in the system DCL tables.
  676. X$!    set com gnu_bison:[000000]:bison
  677. X$    bison/defines/fixed_outfiles parse.y
  678. X$    copy y_tab.c parse.c
  679. X$    dele/noconf y_tab.c;*
  680. X$
  681. X$    copy y_tab.h parse.h
  682. X$    dele/noconf y_tab.h;*
  683. X$
  684. X$    cc 'CFLAGS' /define=('CDEFS',"void=int",-
  685. X      "bcopy(b1,b2,n)=memcpy(b2,b1,n)") parse.c
  686. X$    if .not. continue then goto done
  687. X$
  688. X$scan : 
  689. X$    copy initscan.c scan.c
  690. X$    cc 'CFLAGS' /define=('CDEFS') scan.c
  691. X$    if .not. continue then goto done
  692. X$
  693. X$sym : 
  694. X$    cc 'CFLAGS' /define=('CDEFS') sym.c
  695. X$    if .not. continue then goto done
  696. X$
  697. X$tblcmp : 
  698. X$    cc 'CFLAGS' /define=('CDEFS') tblcmp.c
  699. X$    if .not. continue then goto done
  700. X$
  701. X$yylex : 
  702. X$    cc 'CFLAGS' /define=('CDEFS') yylex.c
  703. X$    if .not. continue then goto done
  704. X$
  705. X$cli : 
  706. X$    cc 'CFLAGS' cli.c
  707. X$    if .not. continue then goto done
  708. X$
  709. X$_link : 
  710. X$    link 'LFLAGS' /exe=flex.exe main.obj, -
  711. X        'OBJ', -
  712. X        'ALLOCA', sys$input/opt
  713. X        SYS$SHARE:VAXCRTL.EXE/SHARE
  714. X$    goto done
  715. X$
  716. X$vms_link :
  717. X$    link 'LFLAGS' /exe=flexvms.exe mainvms.obj, cli.obj, -
  718. X        'OBJ', -
  719. X        'ALLOCA', sys$input/opt
  720. X        SYS$SHARE:VAXCRTL.EXE/SHARE
  721. X$    goto done
  722. X$
  723. X$clean_all : 
  724. X$    continue = "TRUE"
  725. X$clean :
  726. X$    ! Cleanup by deleting unnecessary object files etc.
  727. X$    if f$search ("scan.c") .nes. "" then dele/log/noconf scan.c;*
  728. X$    if f$search ("parse.c") .nes. "" then dele/log/noconf parse.c;*
  729. X$    if f$search ("parse.h") .nes. "" then dele/log/noconf parse.h;*
  730. X$    if f$search ("lexyy.c") .nes. "" then dele/log/noconf lexyy.c;*
  731. X$    if f$search ("*.obj") .nes. "" then dele/log/noconf *.obj;*/exclu=(allo
  732. ca.obj,bcopy.obj)
  733. X$    if f$search ("y_tab.*") .nes. "" then dele/log/noconf y_tab.*;*
  734. X$    if .not. continue then goto done
  735. X$
  736. X$    if f$search ("flex.exe") .nes. "" then dele/log/noconf flex.exe;*
  737. X$    if f$search ("flexvms.exe") .nes. "" then dele/log/noconf flexvms.exe;*
  738. X$    if f$search ("xflex.cld") .nes. "" then dele/log/noconf xflex.cld;*
  739. X$    if f$search ("vaxcrtl.opt") .nes. "" then dele/log/noconf vaxcrtl.opt;*
  740. X$    purge/log
  741. X$    goto done
  742. X$
  743. X$! The weird name used for the VMS flex commands below is to prevent the
  744. X$! DCL command from being shadowed by a DCL symbol named flex.  
  745. X$
  746. X$vms_test_flex : 
  747. X$    set com 'LIB'flex.cld
  748. X$    flex_$make$ 'VMS_FLEX_FLAGS' scan.l
  749. X$    diff/max=1/out=NL: initscan.c lexyy.c
  750. X$    write sys$output "!!!! Test successful !!!!"
  751. X$    dele/noconf lexyy.c;*
  752. X$    goto done
  753. X$
  754. X$_test_flex : 
  755. X$    flex := $'BIN'flex
  756. X$    flex 'UNIX_FLEX_FLAGS' scan.l 
  757. X$    diff/max=1/out=NL: initscan.c lexyy.c
  758. X$    write sys$output "!!!! Test successful !!!!"
  759. X$    dele/noconf lexyy.c;*
  760. X$    goto done
  761. X$
  762. X$vms_test : 
  763. X$    set com xflex.cld
  764. X$    xflex 'VMS_FLEX_FLAGS' /SKEL=flex.skel scan.l
  765. X$    diff/max=1/out=NL: initscan.c lexyy.c
  766. X$    write sys$output "!!!! Test successful !!!!"
  767. X$    dele/noconf lexyy.c;*
  768. X$    goto done
  769. X$
  770. X$_test : 
  771. X$    flex := $sys$disk:[]flex
  772. X$    flex 'UNIX_FLEX_FLAGS' "-Sflex.skel" scan.l 
  773. X$    diff/max=1/out=NL: initscan.c lexyy.c
  774. X$    write sys$output "!!!! Test successful !!!!"
  775. X$    dele/noconf lexyy.c;*
  776. X$    goto done
  777. END_OF_FILE
  778. if test 9758 -ne `wc -c <'dclmake.com'`; then
  779.     echo shar: \"'dclmake.com'\" unpacked with wrong size!
  780. fi
  781. # end of 'dclmake.com'
  782. fi
  783. if test -f 'flex.cld_template' -a "${1}" != "-c" ; then 
  784.   echo shar: Will not clobber existing file \"'flex.cld_template'\"
  785. else
  786. echo shar: Extracting \"'flex.cld_template'\" \(969 characters\)
  787. sed "s/^X//" >'flex.cld_template' <<'END_OF_FILE'
  788. parameter p1, label=FILENAME, prompt="Filename"
  789. X    value( required, type=$file )
  790. qualifier output, nonnegatable, 
  791. X    default, value( type=$file, default=LEXYY.C )
  792. qualifier backtrack_report,
  793. X    value( type=$file, default=LEX.BACKTRACK )
  794. qualifier skeleton, nonnegatable, 
  795. X    value( type=$file )
  796. qualifier tables, nonnegatable,
  797. X    default, value( list, type=table_types )
  798. qualifier statistics,
  799. X    value( list, type=stat_types )
  800. qualifier debug
  801. qualifier echo
  802. qualifier eightbit
  803. qualifier trace
  804. qualifier case_sensitive, default
  805. qualifier line, default
  806. qualifier interactive
  807. X
  808. disallow tables.fast and tables.full
  809. disallow (tables.full or tables.fast) and tables.meta_equivalence
  810. disallow (tables.full or tables.fast) and tables.normal
  811. disallow (tables.full or tables.fast) and interactive
  812. X
  813. define type table_types
  814. X    keyword fast
  815. X    keyword full
  816. X    keyword normal
  817. X    keyword equivalence,default
  818. X    keyword meta_equivalence,default
  819. X
  820. define type stat_types
  821. X    keyword performance
  822. X    keyword summary
  823. END_OF_FILE
  824. if test 969 -ne `wc -c <'flex.cld_template'`; then
  825.     echo shar: \"'flex.cld_template'\" unpacked with wrong size!
  826. fi
  827. # end of 'flex.cld_template'
  828. fi
  829. if test -f 'flex.hlp' -a "${1}" != "-c" ; then 
  830.   echo shar: Will not clobber existing file \"'flex.hlp'\"
  831. else
  832. echo shar: Extracting \"'flex.hlp'\" \(23464 characters\)
  833. sed "s/^X//" >'flex.hlp' <<'END_OF_FILE'
  834. X1 FLEX
  835. X     Flex - a fast lexical analyzer generator
  836. X
  837. X Syntax:
  838. X     FLEX [qualifiers] filespec[,...]
  839. X
  840. X Flex is a tool for generating scanners: programs which
  841. X recognize lexical patterns in text.  Flex reads the given
  842. X input files, or SYS$INPUT if no file names are given, for
  843. X a description of a scanner to generate.  The description
  844. X is in the form of pairs of regular expressions and C code,
  845. X called rules.  Flex generates as output a C source file,
  846. X lexyy.c, which defines a routine yylex(). This file is
  847. X compiled and linked with your program, which calls yylex().
  848. X When the executable is run, it analyzes its input for
  849. X occurrences of the regular expressions.  Whenever it finds
  850. X one, it executes the corresponding C code.
  851. X
  852. X For full documentation, see flex_manual:flexdoc.man.  (This
  853. X manual describes command line options in their unix-style
  854. X form.  See the "Unix" topic for the VMS equivalents.)
  855. X This information is based on flex version 2.3.6
  856. X2 Parameters
  857. X filespec
  858. X     The input file contains flex source code from which a
  859. X     lexer C subroutine is generated.  There is no default
  860. X     for the filetype, you must enter both the file name and
  861. X     type (e.g. foo.lex).  Wildcards are not allowed.
  862. X2 Qualifiers
  863. X/OUTPUT=filespec
  864. X    /OUTPUT=filespec
  865. X    /OUTPUT=LEXYY.C (D)
  866. X
  867. X The name of the output file that flex will create and write
  868. X the lexer code to.  You must specify both the file name and
  869. X type in "filespec"; there is no default type.  If /OUTPUT
  870. X is not supplied, the filename lexyy.c is used by default.  
  871. X/BACKTRACK_REPORT
  872. X    /BACKTRACK_REPORT
  873. X    /NOBACKTRACK_REPORT (D)
  874. X
  875. X Generate  backtracking  information  to  the  file
  876. X lex.backtrack.  This is a list of scanner states which
  877. X require backtracking and the input characters on which
  878. X they do so.  By adding rules one can remove backtracking
  879. X states.  If all backtracking states are eliminated and
  880. X /TABLES=FAST or /TABLES=FULL is used, the generated scanner
  881. X will run faster.
  882. X
  883. X /BACKTRACK_REPORT is equivalent to -b in the unix version.
  884. X/DEBUG
  885. X     /DEBUG 
  886. X     /NODEBUG (D)
  887. X
  888. X Makes the generated scanner run in debug mode.  When-
  889. X ever a pattern is recognized and the global vatiable
  890. X yy_flex_debug is non-zero (which is the default), the
  891. X scanner will write to SYS$ERROR a line of the form:
  892. X
  893. X        --accepting rule at line 53 ("the matched text")
  894. X
  895. X The line number refers to the location of the rule in
  896. X the file defining the scanner (i.e., the file that was
  897. X fed to flex).  Messages are also generated when the
  898. X scanner backtracks, accepts the default rule, reaches
  899. X the end of its input buffer (or encounters a NUL; the
  900. X two look the same as far as the scanner's concerned),
  901. X or reaches an end-of-file.
  902. X
  903. X /DEBUG is equivalent to -d in the unix version.
  904. X/CASE_SENSITIVE
  905. X     /CASE_SENSITIVE (D)
  906. X     /NOCASE_SENSITIVE
  907. X
  908. X Instructs flex to generate a case-insensitive scanner.
  909. X The case of letters given in the flex input patterns
  910. X will be ignored, and tokens in the input will be
  911. X matched regardless of case.  The matched text given in
  912. X yytext will have the preserved case (i.e., it will not
  913. X be folded).
  914. X
  915. X /CASE_SENSITIVE is equivalent to -i in the unix version.
  916. X/STATISTICS=([PERFORMANCE],[SUMMARY])
  917. X
  918. X     /STATISTICS=([PERFORMANCE],[SUMMARY])
  919. X     /NOSTATISTICS (D)
  920. X
  921. X If the keyword PERFORMANCE is specified, flex generates
  922. X a performance report to SYS$ERROR.  The report consists
  923. X of comments regarding features of the flex input file
  924. X which will cause a loss of performance in the resulting
  925. X scanner.
  926. X
  927. X The keyword SUMMARY specifies that flex should write to
  928. X SYS$ERROR a summary of statistics regarding the scanner
  929. X it generates.
  930. X
  931. X You can specify either or both keywords.
  932. X
  933. X /STATISTICS=PERFORMANCE is equivalent to -p in the unix
  934. X version.  /STATISTICS=SUMMARY is equivalent to -v in the
  935. X unix version.
  936. X/ECHO
  937. X     /ECHO (D)
  938. X     /NOECHO 
  939. X
  940. X /NOECHO causes the default rule (that unmatched scanner
  941. X input is echoed to SYS$OUTPUT) to be suppressed.  If the
  942. X scanner encounters input that does not match any of its
  943. X rules, it aborts with an error.
  944. X
  945. X /ECHO is equivalent to -s in the unix version.
  946. X/INTERACTIVE
  947. X     /INTERACTIVE
  948. X     /NOINTERACTIVE (D)
  949. X
  950. X Instructs flex to generate an interactive scanner, that
  951. X is, a scanner which stops immediately rather than look-
  952. X ing ahead if it knows that the currently scanned text
  953. X cannot be part of a longer rule's match.  Again, see
  954. X flexdoc(1) for details.
  955. X /INTERACTIVE cannot be used in conjunction with full or
  956. X fast tables, i.e., /TABLES=FULL or /TABLES=FAST.
  957. X
  958. X /INTERACTIVE is equivalent to -I in the unix version.
  959. X/LINE
  960. X     /LINE (D)
  961. X     /NOLINE
  962. X
  963. X Instructs flex not to generate #line directives in
  964. X output file. The default is to generate such directives
  965. X so error messages in the actions will be correctly located
  966. X with respect to the original flex input file, and not
  967. X to the fairly meaningless line numbers of lex.yy.c.
  968. X
  969. X /NOLINE is equivalent to -L in the unix version.
  970. X/TRACE
  971. X     /TRACE
  972. X     /NOTRACE (D)
  973. X
  974. X Makes flex run in trace mode.  It will generate a lot
  975. X of messages concerning the form of the input and the
  976. X resultant non-deterministic and deterministic finite
  977. X automata.  This option is mostly for use in maintaining
  978. X flex.
  979. X
  980. X Because of the large amount of output that can be 
  981. X generated, you may want to redefine SYS$OUTPUT to a
  982. X file when using this option.
  983. X
  984. X /TRACE is equivalent to -t in the unix version.
  985. X/EIGHTBIT
  986. X     /EIGHTBIT
  987. X     /NOEIGHTBIT (D)
  988. X
  989. X Instructs flex to generate an 8-bit scanner.  At some
  990. X sites, this is the default.  On others, the default is
  991. X 7-bit characters.  To see which is the case, check the
  992. X /STATISTICS=SUMARY output for "equivalence classes created".
  993. X If the denominator of the number shown is 128, then by
  994. X default flex is generating 7-bit characters.  If it is
  995. X 256, then the default is 8-bit characters.
  996. X
  997. X /EIGHTBIT is equivalent to -8 in the unix version.
  998. X/TABLES=[type,...]
  999. X    /TABLES
  1000. X    /TABLES=(EQUIVALENCE,FAST,FULL,META_EQUIVALENCE,NORMAL)
  1001. X    /TABLES=(EQUIVALENCE,META_EQUIVALENCE) (D)
  1002. X
  1003. X Controls the degree of table compression.
  1004. X
  1005. X /TABLES=EQUIVALENCE directs flex to construct equivalence
  1006. X classes, i.e., sets of characters which have identical lexical
  1007. X properties.  Equivalence classes usually give dramatic reductions
  1008. X in the final table/object file sizes (typically a factor of 2-5)
  1009. X and are pretty cheap performance-wise (one array look-up per char-
  1010. X acter scanned).
  1011. X
  1012. X /TABLES=FULL specifies that the full scanner tables should be
  1013. X generated - flex should not compress the tables by taking advan-
  1014. X tages of similar transition functions for different states.
  1015. X
  1016. X /TABLES=FAST specifies that the alternate fast scanner represen-
  1017. X tation (described in flexdoc(1)) should be used.
  1018. X
  1019. X /TABLES=META_EQUIVALENCE directs flex to construct meta-
  1020. X equivalence classes, which are sets of equivalence classes (or
  1021. X characters, if equivalence classes are not being used) that are
  1022. X commonly used together.  Meta-equivalence classes are often a big
  1023. X win when using compressed tables, but they have a moderate per-
  1024. X formance impact (one or two "if" tests and one array look-up per
  1025. X character scanned).
  1026. X
  1027. X /TABLES=NORMAL (or just /TABLES) specifies that the scanner
  1028. X tables should be compressed but neither equivalence classes nor
  1029. X meta-equivalence classes should be used.
  1030. X
  1031. X The options FULL or FAST and META_EQUIVALENCE do not make sense
  1032. X together - there is no opportunity for meta-equivalence classes
  1033. X if the table is not being compressed.  Otherwise the options may
  1034. X be freely mixed.  FAST or FULL are also incompatible with
  1035. X /INTERACTIVE.
  1036. X
  1037. X The default setting is /TABLES=(EQUIVALENCE,META_EQUIVALENCE),
  1038. X which specifies that flex should generate equivalence classes
  1039. X and meta-equivalence classes.  This setting provides the highest
  1040. X degree of table compression.  You can trade off faster-executing
  1041. X scanners at the cost of larger tables with the following generally
  1042. X being true:
  1043. X
  1044. X    slowest                 smallest
  1045. X      /TABLES=(EQUIVALENCE,META_EQUIVALENCE) (default)
  1046. X      /TABLES=META_EQUIVALENCE
  1047. X      /TABLES=EQUIVALENCE
  1048. X      /TABLES=NORMAL or /TABLES
  1049. X      /TABLES=(FULL or FAST, EQUIVALENCE)
  1050. X      /TABLES=FULL or FAST
  1051. X    fastest                  largest
  1052. X
  1053. X /TABLES is equivalent to -C in the unix version.  
  1054. X /TABLES=EQUIV is equivalent to -Ce in the unix version.  
  1055. X /TABLES=META is equivalent to -Cm in the unix version.  
  1056. X /TABLES=FULL is equivalent to -Cf or -f in the unix version.  
  1057. X /TABLES=FAST is equivalent to -CF or -F in the unix version.  
  1058. X
  1059. X/SKELETON=filespec
  1060. X     /SKELETON=filespec
  1061. X
  1062. X Overrides the default skeleton file from which flex
  1063. X constructs its scanners.  The default is flex.skel in
  1064. X a site dependent publicly accessible directory.  You'll
  1065. X never need this option unless you are doing flex maint-
  1066. X enance or development.
  1067. X
  1068. X /SKELETON is equivalent to -Sfile in the unix version.  
  1069. X2 Regular_expressions
  1070. X     The patterns in the input are written using an extended set
  1071. X     of regular expressions.  These are:
  1072. X
  1073. X         x          match the character 'x'
  1074. X         .          any character except newline
  1075. X         [xyz]      a "character class"; in this case, the pattern
  1076. X                      matches either an 'x', a 'y', or a 'z'
  1077. X         [abj-oZ]   a "character class" with a range in it; matches
  1078. X                      an 'a', a 'b', any letter from 'j' through 'o',
  1079. X                      or a 'Z'
  1080. X         [^A-Z]     a "negated character class", i.e., any character
  1081. X                      but those in the class.  In this case, any
  1082. X                      character EXCEPT an uppercase letter.
  1083. X         [^A-Z\n]   any character EXCEPT an uppercase letter or
  1084. X                      a newline
  1085. X         r*         zero or more r's, where r is any regular expression
  1086. X         r+         one or more r's
  1087. X         r?         zero or one r's (that is, "an optional r")
  1088. X         r{2,5}     anywhere from two to five r's
  1089. X         r{2,}      two or more r's
  1090. X         r{4}       exactly 4 r's
  1091. X         {name}     the expansion of the "name" definition (see above)
  1092. X         "[xyz]\"foo"
  1093. X                    the literal string: [xyz]"foo
  1094. X         \X         if X is an 'a', 'b', 'f', 'n', 'r', 't', or 'v',
  1095. X                      then the ANSI-C interpretation of \x.
  1096. X                      Otherwise, a literal 'X' (used to escape
  1097. X                      operators such as '*')
  1098. X         \123       the character with octal value 123
  1099. X         \x2a       the character with hexadecimal value 2a
  1100. X         (r)        match an r; parentheses are used to override
  1101. X                      precedence (see below)
  1102. X
  1103. X
  1104. X         rs         the regular expression r followed by the
  1105. X                      regular expression s; called "concatenation"
  1106. X
  1107. X
  1108. X         r|s        either an r or an s
  1109. X
  1110. X
  1111. X         r/s        an r but only if it is followed by an s.  The
  1112. X                      s is not part of the matched text.  This type
  1113. X                      of pattern is called as "trailing context".
  1114. X         ^r         an r, but only at the beginning of a line
  1115. X         r$         an r, but only at the end of a line.  Equivalent
  1116. X                      to "r/\n".
  1117. X
  1118. X
  1119. X         <s>r       an r, but only in start condition s (see
  1120. X                      below for discussion of start conditions)
  1121. X         <s1,s2,s3>r
  1122. X                    same, but in any of start conditions s1,
  1123. X                      s2, or s3
  1124. X
  1125. X
  1126. X         <<EOF>>    an end-of-file
  1127. X         <s1,s2><<EOF>>
  1128. X                    an end-of-file when in start condition s1 or s2
  1129. X
  1130. X     The regular expressions listed above are grouped according
  1131. X     to precedence, from highest precedence at the top to lowest
  1132. X     at the bottom.  Those grouped together have equal precedence.
  1133. X
  1134. X     Some notes on patterns:
  1135. X
  1136. X     -    Negated character classes match newlines unless "\n"
  1137. X          (or an equivalent escape sequence) is one of the char-
  1138. X          acters explicitly present in the negated character
  1139. X          class (e.g., "[^A-Z\n]").
  1140. X
  1141. X     -    A rule can have at most one instance of trailing con-
  1142. X          text (the '/' operator or the '$' operator).  The start
  1143. X          condition, '^', and "<<EOF>>" patterns can only occur
  1144. X          at the beginning of a pattern, and, as well as with '/'
  1145. X          and '$', cannot be grouped inside parentheses.  The
  1146. X          following are all illegal:
  1147. X
  1148. X              foo/bar$
  1149. X              foo|(bar$)
  1150. X              foo|^bar
  1151. X              <sc1>foo<sc2>bar
  1152. X
  1153. X
  1154. X2 Special_actions
  1155. X     In addition to arbitrary C code, the following can appear in
  1156. X     actions:
  1157. X
  1158. X     -    ECHO copies yytext to the scanner's output.
  1159. X
  1160. X     -    BEGIN followed by the name of a start condition places
  1161. X          the scanner in the corresponding start condition.
  1162. X
  1163. X     -    REJECT directs the scanner to proceed on to the "second
  1164. X          best" rule which matched the input (or a prefix of the
  1165. X          input).  yytext and yyleng are set up appropriately.
  1166. X          Note that REJECT is a particularly expensive feature in
  1167. X          terms scanner performance; if it is used in any of the
  1168. X          scanner's actions it will slow down all of the
  1169. X          scanner's matching.  Furthermore, REJECT cannot be used
  1170. X          with the /TABLES=FULL or /TABLES=FAST options.
  1171. X
  1172. X          Note also that unlike the other special actions, REJECT
  1173. X          is a branch; code immediately following it in the
  1174. X          action will not be executed.
  1175. X
  1176. X     -    yymore() tells the scanner that the next time it
  1177. X          matches a rule, the corresponding token should be
  1178. X          appended onto the current value of yytext rather than
  1179. X          replacing it.
  1180. X
  1181. X     -    yyless(n) returns all but the first n characters of the
  1182. X          current token back to the input stream, where they will
  1183. X          be rescanned when the scanner looks for the next match.
  1184. X          yytext and yyleng are adjusted appropriately (e.g.,
  1185. X          yyleng will now be equal to n ).
  1186. X
  1187. X     -    unput(c) puts the character c back onto the input
  1188. X          stream.  It will be the next character scanned.
  1189. X
  1190. X     -    input() reads the next character from the input stream
  1191. X          (this routine is called yyinput() if the scanner is
  1192. X          compiled using C++).
  1193. X
  1194. X     -    yyterminate() can be used in lieu of a return statement
  1195. X          in an action.  It terminates the scanner and returns a
  1196. X          0 to the scanner's caller, indicating "all done".
  1197. X
  1198. X          By default, yyterminate() is also called when an end-
  1199. X          of-file is encountered.  It is a macro and may be rede-
  1200. X          fined.
  1201. X
  1202. X     -    YY_NEW_FILE is an action available only in <<EOF>>
  1203. X          rules.  It means "Okay, I've set up a new input file,
  1204. X          continue scanning".
  1205. X
  1206. X     -    yy_create_buffer( file, size ) takes a FILE pointer and
  1207. X          an integer size. It returns a YY_BUFFER_STATE handle to
  1208. X          a new input buffer large enough to accomodate size
  1209. X          characters and associated with the given file.  When in
  1210. X          doubt, use YY_BUF_SIZE for the size.
  1211. X
  1212. X     -    yy_switch_to_buffer( new_buffer ) switches the
  1213. X          scanner's processing to scan for tokens from the given
  1214. X          buffer, which must be a YY_BUFFER_STATE.
  1215. X
  1216. X     -    yy_delete_buffer( buffer ) deletes the given buffer.
  1217. X
  1218. X2 Variables
  1219. X     -    char *yytext holds the text of the current token.  It
  1220. X          may not be modified.
  1221. X
  1222. X     -    int yyleng holds the length of the current token.  It
  1223. X          may not be modified.
  1224. X
  1225. X     -    FILE *yyin is the file which by default flex reads
  1226. X          from.  It may be redefined but doing so only makes
  1227. X          sense before scanning begins.  Changing it in the mid-
  1228. X          dle of scanning will have unexpected results since flex
  1229. X          buffers its input.  Once scanning terminates because an
  1230. X          end-of-file has been seen, void yyrestart( FILE
  1231. X          *new_file ) may be called to point yyin at the new
  1232. X          input file.
  1233. X
  1234. X     -    FILE *yyout is the file to which ECHO actions are done.
  1235. X          It can be reassigned by the user.
  1236. X
  1237. X     -    YY_CURRENT_BUFFER returns a YY_BUFFER_STATE handle to
  1238. X          the current buffer.
  1239. X
  1240. X2 Macros
  1241. X     -    YY_DECL controls how the scanning routine is declared.
  1242. X          By default, it is "int yylex()", or, if prototypes are
  1243. X          being used, "int yylex(void)".  This definition may be
  1244. X          changed by redefining the "YY_DECL" macro.  Note that
  1245. X          if you give arguments to the scanning routine using a
  1246. X          K&R-style/non-prototyped function declaration, you must
  1247. X          terminate the definition with a semi-colon (;).
  1248. X
  1249. X     -    The nature of how the scanner gets its input can be
  1250. X          controlled by redefining the YY_INPUT macro.
  1251. X          YY_INPUT's calling sequence is
  1252. X          "YY_INPUT(buf,result,max_size)".  Its action is to
  1253. X          place up to max_size characters in the character array
  1254. X          buf and return in the integer variable result either
  1255. X          the number of characters read or the constant YY_NULL
  1256. X          (0 on Unix systems) to indicate EOF.  The default
  1257. X          YY_INPUT reads from the global file-pointer "yyin".  A
  1258. X          sample redefinition of YY_INPUT (in the definitions
  1259. X          section of the input file):
  1260. X
  1261. X              %{
  1262. X              #undef YY_INPUT
  1263. X              #define YY_INPUT(buf,result,max_size) \
  1264. X                  { \
  1265. X                  int c = getchar(); \
  1266. X                  result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \
  1267. X                  }
  1268. X              %}
  1269. X
  1270. X
  1271. X     -    When the scanner receives an end-of-file indication
  1272. X          from YY_INPUT, it then checks the yywrap() function.
  1273. X          If yywrap() returns false (zero), then it is assumed
  1274. X          that the function has gone ahead and set up yyin to
  1275. X          point to another input file, and scanning continues.
  1276. X          If it returns true (non-zero), then the scanner ter-
  1277. X          minates, returning 0 to its caller.
  1278. X
  1279. X          The default yywrap() always returns 1.  Presently, to
  1280. X          redefine it you must first "#undef yywrap", as it is
  1281. X          currently implemented as a macro.  It is likely that
  1282. X          yywrap() will soon be defined to be a function rather
  1283. X          than a macro.
  1284. X
  1285. X     -    YY_USER_ACTION can be redefined to provide an action
  1286. X          which is always executed prior to the matched rule's
  1287. X          action.
  1288. X
  1289. X     -    The macro YY_USER_INIT may be redefined to provide an
  1290. X          action which is always executed before the first scan.
  1291. X
  1292. X     -    In the generated scanner, the actions are all gathered
  1293. X          in one large switch statement and separated using
  1294. X          YY_BREAK, which may be redefined.  By default, it is
  1295. X          simply a "break", to separate each rule's action from
  1296. X          the following rule's.
  1297. X
  1298. X2 Diagnostics
  1299. X     reject_used_but_not_detected undefined or
  1300. X
  1301. X     yymore_used_but_not_detected undefined - These errors can
  1302. X     occur at compile time.  They indicate that the scanner uses
  1303. X     REJECT or yymore() but that flex failed to notice the fact,
  1304. X     meaning that flex scanned the first two sections looking for
  1305. X     occurrences of these actions and failed to find any, but
  1306. X     somehow you snuck some in (via a #include file, for exam-
  1307. X     ple).  Make an explicit reference to the action in your flex
  1308. X     input file.  (Note that previously flex supported a
  1309. X     %used/%unused mechanism for dealing with this problem; this
  1310. X     feature is still supported but now deprecated, and will go
  1311. X     away soon unless the author hears from people who can argue
  1312. X     compellingly that they need it.)
  1313. X
  1314. X     flex scanner jammed - a scanner compiled with /NOECHO has
  1315. X     encountered an input string which wasn't matched by any of
  1316. X     its rules.
  1317. X
  1318. X     flex input buffer overflowed - a scanner rule matched a
  1319. X     string long enough to overflow the scanner's internal input
  1320. X     buffer (16K bytes - controlled by YY_BUF_MAX in
  1321. X     "flex.skel").
  1322. X
  1323. X     scanner requires -8 flag - Your scanner specification
  1324. X     includes recognizing 8-bit characters and you did not
  1325. X     specify the /EIGHTBIT qualifier (and your site has not
  1326. X     installed flex with /EIGHTBIT as the default).
  1327. X
  1328. X     fatal flex scanner internal error--end of buffer missed -
  1329. X     This can occur in an scanner which is reentered after a
  1330. X     long-jump has jumped out (or over) the scanner's activation
  1331. X     frame.  Before reentering the scanner, use:
  1332. X
  1333. X         yyrestart( yyin );
  1334. X
  1335. X
  1336. X     too many %t classes! - You managed to put every single char-
  1337. X     acter into its own %t class.  flex requires that at least
  1338. X     one of the classes share characters.
  1339. X
  1340. X2 Author
  1341. X     Vern Paxson, with the help of many ideas and much inspira-
  1342. X     tion from Van Jacobson.  Original version by Jef Poskanzer.
  1343. X
  1344. X     See flexdoc.man for additional credits and the address to
  1345. X     send comments to.
  1346. X
  1347. X2 Problems
  1348. X     Some trailing context patterns cannot be properly matched
  1349. X     and generate warning messages ("Dangerous trailing con-
  1350. X     text").  These are patterns where the ending of the first
  1351. X     part of the rule matches the beginning of the second part,
  1352. X     such as "zx*/xy*", where the 'x*' matches the 'x' at the
  1353. X     beginning of the trailing context.  (Note that the POSIX
  1354. X     draft states that the text matched by such patterns is unde-
  1355. X     fined.)
  1356. X
  1357. X     For some trailing context rules, parts which are actually
  1358. X     fixed-length are not recognized as such, leading to the
  1359. X     abovementioned performance loss.  In particular, parts using
  1360. X     '|' or {n} (such as "foo{3}") are always considered
  1361. X     variable-length.
  1362. X
  1363. X     Combining trailing context with the special '|' action can
  1364. X     result in fixed trailing context being turned into the more
  1365. X     expensive variable trailing context.  For example, this hap-
  1366. X     pens in the following example:
  1367. X
  1368. X         %%
  1369. X         abc      |
  1370. X         xyz/def
  1371. X
  1372. X
  1373. X     Use of unput() invalidates yytext and yyleng.
  1374. X
  1375. X     Use of unput() to push back more text than was matched can
  1376. X     result in the pushed-back text matching a beginning-of-line
  1377. X     ('^') rule even though it didn't come at the beginning of
  1378. X     the line (though this is rare!).
  1379. X
  1380. X     Pattern-matching of NUL's is substantially slower than
  1381. X     matching other characters.
  1382. X
  1383. X     flex does not generate correct #line directives for code
  1384. X     internal to the scanner; thus, bugs in flex.skel yield bogus
  1385. X     line numbers.
  1386. X
  1387. X     Due to both buffering of input and read-ahead, you cannot
  1388. X     intermix calls to <stdio.h> routines, such as, for example,
  1389. X     getchar(), with flex rules and expect it to work.  Call
  1390. X     input() instead.
  1391. X
  1392. X     The total table entries listed by the /STATISTICS=SUMMARY
  1393. X     flag excludes the number of table entries needed to determine
  1394. X     what rule has been matched.  The number of entries is equal
  1395. X     to the number of DFA states if the scanner does not use REJECT,
  1396. X     and somewhat greater than the number of states if it does.
  1397. X
  1398. X     REJECT cannot be used with the /TABLES=FAST or /TABLES=FULL
  1399. X     options.
  1400. X
  1401. X     Some of the macros, such as yywrap(), may in the future
  1402. X     become functions which live in the flex library.  This will
  1403. X     doubtless break a lot of code, but may be required for
  1404. X     POSIX-compliance.
  1405. X
  1406. X     The flex internal algorithms need documentation.
  1407. X2 Unix
  1408. X The unix command line options and their VMS equivalents are:
  1409. X
  1410. X    -b     /BACKTRACK_REPORT
  1411. X    -C[efFm] /TABLES=[([EQUIV],[FULL],[FAST],[META])]
  1412. X    -f     /TABLES=FULL
  1413. X    -F     /TABLES=FAST
  1414. X    -i     /NOCASE_SENSITIVE
  1415. X    -I     /INTERACTIVE
  1416. X    -L     /NOLINE
  1417. X    -p     /STATISTICS=PERFORMANCE
  1418. X    -s     /NOECHO
  1419. X    -Sfile     /SKELETON=file
  1420. X    -t     /OUTPUT=SYS$OUTPUT
  1421. X    -T     /TRACE
  1422. X    -v     /STATISTICS=SUMMARY
  1423. X    -8     /EIGHTBIT
  1424. X
  1425. END_OF_FILE
  1426. if test 23464 -ne `wc -c <'flex.hlp'`; then
  1427.     echo shar: \"'flex.hlp'\" unpacked with wrong size!
  1428. fi
  1429. # end of 'flex.hlp'
  1430. fi
  1431. if test -f 'install.vms' -a "${1}" != "-c" ; then 
  1432.   echo shar: Will not clobber existing file \"'install.vms'\"
  1433. else
  1434. echo shar: Extracting \"'install.vms'\" \(8010 characters\)
  1435. sed "s/^X//" >'install.vms' <<'END_OF_FILE'
  1436. X
  1437. X----------------------
  1438. Installing flex on VMS   (flex version 2.3.6)
  1439. X----------------------
  1440. X
  1441. X1.  Get the flex distribution and unpack it into a directory.  
  1442. X
  1443. X2.  The [.vms] subdirectory contains all the files for VMS.  Copy (or 
  1444. X    rename) them to the main flex directory [-].  (Actually, if you
  1445. X    want the unix command line interface (see below), you don't need
  1446. X    any of these files other than makefile.vms or dclmake.com.  The
  1447. X    rest are documentation or for the VMS command line interface.)
  1448. X
  1449. X3.  To build flex you need bison (the GNU project's yacc replacement)
  1450. X    to generate parse.y and parse.h.  If you don't have bison you may be
  1451. X    able to get these two files from someone else.  Rename them to
  1452. X    initparse.y and initparse.h since the makefile clean procedure will
  1453. X    delete them if you leave the names unchanged.  Otherwise, you'll just
  1454. X    have to get bison.  (But if you need flex, you probably need bison
  1455. X    as well!)
  1456. X
  1457. X4.  To build flex you need access to an alloca() routine.  There are
  1458. X    several available ones.  If you have the bison sources easily acces-
  1459. X    sible you may want to use the assembler alloca in vmshlp.c.  Please
  1460. X    note that this is a somewhat dangerous thing to do since the routine
  1461. X    diddles with the runtime stack and may break if the C compiler or C
  1462. X    source code changes.  If this happens try compiling without optimization
  1463. X    the routines that call alloca().  Slower but safer is the public-
  1464. X    domain "semi-portable" version (which works fine on VMS) written by
  1465. X    Doug Gwyn and distributed with GNU emacs (also available in the usenet
  1466. X    comp.sources archives and many other public-domain source code repos-
  1467. X    itories).  In any event you need to have an object module on your
  1468. X    system somewhere that contains a working alloca() routine. 
  1469. X
  1470. X5.  Flex documentation is in two files, flex.1 and flexdoc.1.  These are
  1471. X    unformatted nroff source for the unix man pages.  flex.1 describes
  1472. X    the flex command and a condensed version of the material in flexdoc.1.
  1473. X    flexdoc.1 contains a fuller description of flex input files and
  1474. X    flex use.  The VMS help file was derived from flex.1.  
  1475. X    If you have access to a unix system, you can format these two files
  1476. X    with the commands:
  1477. X
  1478. X        % nroff -man <flex.1 | col -b >flex.man
  1479. X        % nroff -man <flexdoc.1 | col -b >flexdoc.man 
  1480. X
  1481. X    Otherwise, you'll have to get them via ftp or some other way, or
  1482. X    rely on the information in flex.hlp.
  1483. X
  1484. X6.  You can build flex with either of two interfaces.  One (the default)
  1485. X    is a VMS-style interface and is run like other native VMS commands:
  1486. X
  1487. X        $ flex/tables=equiv/stat=(perf,sum) foo.lex
  1488. X
  1489. X    It includes a VMS help file entry.  The other is a unix-like interface.
  1490. X    Flex is defined as a foreign command and is run with a unix-style
  1491. X    command:
  1492. X
  1493. X    $ flex -vpCe foo.lex
  1494. X
  1495. X    Decide which interface you want.  If you change your mind later, just
  1496. X    recompile main.c and relink.
  1497. X
  1498. X7.  If you have DEC's MMS or one of the MAKE programs that aren't too
  1499. X    different from it, you can use makefile.vms to build flex.  You may
  1500. X    have to make some minor syntactical adjustments for your variant of
  1501. X    MAKE.  If you don't have a make program, you can use dclmake.com to
  1502. X    build flex.  It does the same things that the makefile does but you'll
  1503. X    have to tell it what you want.  The term makefile is used to refer to
  1504. X    either makefile.vms or dclmake.com from here on.
  1505. X
  1506. X    There are two steps involved: build a local copy of flex and test it,
  1507. X    and then, if you want to make it available for public use, the makefile
  1508. X    will install it by copying the needed files to a public directory.
  1509. X
  1510. X8.  Read whichever makefile you're going to use (makefile.vms or dclmake.com),
  1511. X    read it and make any changes you need to.  As distributed, they make
  1512. X    the following assumptions: 
  1513. X
  1514. X    The makefile is configured to build flex with a VMS-style command
  1515. X    line interface by default.  You can change this to the unix-style
  1516. X    interface.
  1517. X
  1518. X    That you have copied into the flex directory an alloc.obj object
  1519. X    module that contains a working alloca() routine.  If you want to
  1520. X    refer to an alloca module that lives elsewhere you can specify the
  1521. X    location in the makefile.
  1522. X
  1523. X    That the bison command is available in the system DCL tables.  If 
  1524. X    not, you'll have to put a "set command dev:[dir]bison" command in
  1525. X    the makefile just before the bison command.
  1526. X
  1527. X    If you'll be installing flex for public use, the makefile assumes
  1528. X    that the executable will go in directory pointed to by the logical
  1529. X    name "flex_exe", the flex skeleton template into the logical directory
  1530. X    "flex_library", and the flex documentation files into "flex_manual".
  1531. X    (The latter will only occur if you have the formatted documentation 
  1532. X    files flex.man and flexdoc.man in the flex directory.)
  1533. X    In addition, if you're building the VMS-style interface, the make-
  1534. X    file will put the flex help module into the system help library,
  1535. X    and the flex command definition file into the "flex_library".
  1536. X    You'll have to define these lolgical names before doing an install
  1537. X    or running the installed version, or change the definitions in the
  1538. X    makefile.
  1539. X
  1540. X9.  Compile, link and test the executable. If you're using MAKE or MMS,
  1541. X    rename makefile.vms to whatever your make program looks for and
  1542. X    do:
  1543. X        $ MAKE TEST 
  1544. X
  1545. X    (use MMS for MAKE if that's what you have).  If you are using
  1546. X    dclmake.com, do:
  1547. X
  1548. X        $ @DCLMAKE  BUILD
  1549. X
  1550. X    Both procedures will compile all the sources, link them, then test
  1551. X    them by using flex to generate what should by an exact copy of the
  1552. X    flex lexer routine.  They will then run DIFFERENCES to confirm that
  1553. X    the generated lexer source is identical to the distributed one and
  1554. X    and print a "Test successful" message.
  1555. X
  1556. X10. You can now run your new flex.  For the VMS version, do:
  1557. X
  1558. X        SET COMMAND disk:[dir]XFLEX.CLD
  1559. X
  1560. X    (note the X) where 'disk' and 'dir' is the full specification for the
  1561. X    flex directory if you are not in that directory.  For the unix inter-
  1562. X    face version define a foreign command with:
  1563. X
  1564. X        FLEX :== $disk:[dir]FLEX.EXE
  1565. X
  1566. X    'disk' and 'dir' are required in this case whatever your current direc-
  1567. X    tory.  Since flex was built with a default skeleton file name that points
  1568. X    to a possibly non-existant file (since it hasn't been installed yet), you
  1569. X    should explicitly specify a skeleton file with /SKELETON or -S options
  1570. X    each time you run this local version of flex.  Alternatively, if flex was
  1571. X    built with LIB=flex_library (the default), you can define the logical name
  1572. X    flex_library to point to the flex directory.
  1573. X
  1574. X11. When your satisfied it's working you're ready to install it.  Make
  1575. X    sure the logical names "flex_exe", flex_library", and "flex_manual"
  1576. X    are defined correctly.  Then do either:
  1577. X
  1578. X        MAKE ALL
  1579. X    or
  1580. X
  1581. X        @DCLMAKE INSTALL_TEST
  1582. X
  1583. X    The makefile will copy flex.exe to flex_exe:, flex.skel to flex_lib:,
  1584. X    flex.man and flexdoc.man to flex_manual: (if those two files are present),
  1585. X    and if you've selected the VMS version, flex.cld to flex_library: and
  1586. X    flex.hlp into the system help library, sys$common:[syshlp]helplib.hlb.
  1587. X    It will then run the same test that was done before but on the newly
  1588. X    installed flex.
  1589. X
  1590. X12. Finally, you want to make sure the flex logical names are available
  1591. X    to whoever is going to be using flex.  You can do this by having the
  1592. X    system startup procedure define them system wide at boot time, defining
  1593. X    them in sylogin.com, or making a command procedure available to define
  1594. X    them when needed.  For the unix-interface version you also want to
  1595. X    assign the flex foreign command symbol.  For the VMS-interface version,
  1596. X    you can install the flex command definition in the system DCL tables,
  1597. X    or do a "SET COMMAND FLEX_LIBRARY:FLEX.CLD" in sylogin.com or tell
  1598. X    users to do it in their login.com files.
  1599. X
  1600. X-------------------------------------------------
  1601. X11/17/90 - Stuart McGraw, GTE Labs (sjm0@gte.com)
  1602. END_OF_FILE
  1603. if test 8010 -ne `wc -c <'install.vms'`; then
  1604.     echo shar: \"'install.vms'\" unpacked with wrong size!
  1605. fi
  1606. # end of 'install.vms'
  1607. fi
  1608. if test -f 'main.dif' -a "${1}" != "-c" ; then 
  1609.   echo shar: Will not clobber existing file \"'main.dif'\"
  1610. else
  1611. echo shar: Extracting \"'main.dif'\" \(3045 characters\)
  1612. sed "s/^X//" >'main.dif' <<'END_OF_FILE'
  1613. X*** flex/main.c    Fri Oct 12 10:56:35 1990
  1614. X--- main.c    Fri Nov 23 13:39:07 1990
  1615. X***************
  1616. X*** 104,109 ****
  1617. X--- 104,110 ----
  1618. X  static int outfile_created = 0;
  1619. X  static int use_stdout;
  1620. X  static char *skelname = NULL;
  1621. X+ static int initialized = 0;
  1622. X  
  1623. X  
  1624. X  int main( argc, argv )
  1625. X***************
  1626. X*** 243,249 ****
  1627. X          flexfatal( "error occurred when closing backtracking file" );
  1628. X      }
  1629. X  
  1630. X!     if ( printstats )
  1631. X      {
  1632. X      endtime = flex_gettime();
  1633. X  
  1634. X--- 244,250 ----
  1635. X          flexfatal( "error occurred when closing backtracking file" );
  1636. X      }
  1637. X  
  1638. X!     if ( printstats && initialized )
  1639. X      {
  1640. X      endtime = flex_gettime();
  1641. X  
  1642. X***************
  1643. X*** 372,382 ****
  1644. X      fprintf( stderr, "  %d total table entries needed\n", tblsiz );
  1645. X      }
  1646. X  
  1647. X- #ifndef VMS
  1648. X      exit( status );
  1649. X- #else
  1650. X-     exit( status + 1 );
  1651. X- #endif
  1652. X      }
  1653. X  
  1654. X  
  1655. X--- 373,379 ----
  1656. X***************
  1657. X*** 395,400 ****
  1658. X--- 392,402 ----
  1659. X      {
  1660. X      int i, sawcmpflag;
  1661. X      char *arg, *flex_gettime(), *mktemp();
  1662. X+ #ifndef SHORT_FILE_NAMES
  1663. X+     char *backtrack_fn = "lex.backtrack";
  1664. X+ #else
  1665. X+     char *backtrack_fn = "lex.bck";
  1666. X+ #endif
  1667. X  
  1668. X      printstats = syntaxerror = trace = spprdflt = interactive = caseins = fa
  1669. lse;
  1670. X      backtrack_report = performance_report = ddebug = fulltbl = fullspd = fal
  1671. se;
  1672. X***************
  1673. X*** 407,414 ****
  1674. X--- 409,428 ----
  1675. X  
  1676. X      csize = DEFAULT_CSIZE;
  1677. X  
  1678. X+ #ifndef VMSCMDLN
  1679. X+ 
  1680. X      program_name = argv[0];
  1681. X  
  1682. X+ /* If GCC doesn't use the VAXCRTL cmdline parsing this should be #ifdef VAXC
  1683.  */
  1684. X+ #ifdef VMS
  1685. X+     {        /* Fixup the grotesque argv[0] */
  1686. X+     char *p;
  1687. X+     if (NULL != (p = strrchr (argv[0], '.'))) *p = '\0';
  1688. X+     if (NULL != (p = strrchr (argv[0], ']'))) program_name = p + 1;
  1689. X+     }
  1690. X+ #endif
  1691. X+     
  1692. X+ 
  1693. X      /* read flags */
  1694. X      for ( --argc, ++argv; argc ; --argc, ++argv )
  1695. X      {
  1696. X***************
  1697. X*** 540,545 ****
  1698. X--- 554,568 ----
  1699. X      ;
  1700. X      }
  1701. X  
  1702. X+     num_input_files = argc;
  1703. X+     input_files = argv;
  1704. X+ 
  1705. X+ #else /* VMSCMDLN */
  1706. X+ 
  1707. X+ #include "vmscmdln.c"
  1708. X+ 
  1709. X+ #endif /* VMSCMDLN */
  1710. X+ 
  1711. X      if ( (fulltbl || fullspd) && usemecs )
  1712. X      flexerror( "full table and -Cm don't make sense together" );
  1713. X  
  1714. X***************
  1715. X*** 567,586 ****
  1716. X      outfile_created = 1;
  1717. X      }
  1718. X  
  1719. X-     num_input_files = argc;
  1720. X-     input_files = argv;
  1721. X      set_input_file( num_input_files > 0 ? input_files[0] : NULL );
  1722. X  
  1723. X      if ( backtrack_report )
  1724. X      {
  1725. X! #ifndef SHORT_FILE_NAMES
  1726. X!     backtrack_file = fopen( "lex.backtrack", "w" );
  1727. X! #else
  1728. X!     backtrack_file = fopen( "lex.bck", "w" );
  1729. X! #endif
  1730. X  
  1731. X      if ( backtrack_file == NULL )
  1732. X!         flexerror( "could not create lex.backtrack" );
  1733. X      }
  1734. X  
  1735. X      else
  1736. X--- 590,603 ----
  1737. X      outfile_created = 1;
  1738. X      }
  1739. X  
  1740. X      set_input_file( num_input_files > 0 ? input_files[0] : NULL );
  1741. X  
  1742. X      if ( backtrack_report )
  1743. X      {
  1744. X!     backtrack_file = fopen( backtrack_fn, "w" );
  1745. X  
  1746. X      if ( backtrack_file == NULL )
  1747. X!         lerrsf( "could not create backtrack file %s", backtrack_fn );
  1748. X      }
  1749. X  
  1750. X      else
  1751. X***************
  1752. X*** 657,662 ****
  1753. X--- 674,681 ----
  1754. X      }
  1755. X  
  1756. X      set_up_initial_allocations();
  1757. X+ 
  1758. X+     initialized = TRUE;
  1759. X      }
  1760. X  
  1761. X  
  1762. END_OF_FILE
  1763. if test 3045 -ne `wc -c <'main.dif'`; then
  1764.     echo shar: \"'main.dif'\" unpacked with wrong size!
  1765. fi
  1766. # end of 'main.dif'
  1767. fi
  1768. if test -f 'makefile.vms' -a "${1}" != "-c" ; then 
  1769.   echo shar: Will not clobber existing file \"'makefile.vms'\"
  1770. else
  1771. echo shar: Extracting \"'makefile.vms'\" \(9933 characters\)
  1772. sed "s/^X//" >'makefile.vms' <<'END_OF_FILE'
  1773. X############################ VMS MAKEFILE ##############################
  1774. X# IMPORTANT:  Before you use this makefile, read INSTALL.VMS and the
  1775. X# comments below.  You will need an alloca object module and GNU bison.
  1776. X# Define the logical names flex_exe, flex_library, and flex_manual.
  1777. X#
  1778. X# For flex version 2.3.6 (11/17/90)
  1779. X#
  1780. X# If you do not have DEC's MMS or a MAKE program compatible with it you
  1781. X# may have to make some syntactical adjustments to suit your particular
  1782. X# MAKE program.  After you have made any changes required for your site,
  1783. X# rename this file to MAKEFILE. (or DESCRIP.MMS if using MMS) and you can
  1784. X# use any of these MAKE (or MMS) commands:
  1785. X#
  1786. X#   $ make             -- same as "mms flex" 
  1787. X#   $ make flex            -- compile and link the local flex.exe 
  1788. X#   $ make test            -- mms flex; then test the local flex.e
  1789. xe
  1790. X#   $ make clean        -- delete all unneeded files
  1791. X#   $ make clean_all        -- mms clean; delete flex.exe and purge
  1792. X#
  1793. X# To install the flex files in a public location do the following.
  1794. X# You need write access to the directories defined below by BIN, LIB, MAN,
  1795. X# and, if you're installing the VMS comand line version, CLD and the help
  1796. X# library defined by HLP.  Then you can:
  1797. X#
  1798. X#   $ make all            -- same as "mms install", "mms test_flex"
  1799. X#   $ make install        -- "mms flex" then move files to public dirs.
  1800. X#   $ make test_flex        -- test the installed public version
  1801. X#
  1802. X# When "mms test" or "mms test_flex" is executed you shoud see the message
  1803. X# "Test successful".  A make abort after the diff command is a failure.
  1804. X# To get some idea of what went wrong, do a diff between lexyy.c (the file
  1805. X# just generated by flex) and initscan.c (what it should have generated).
  1806. X#
  1807. X#
  1808. X#
  1809. X# The flex parser generated by bison requires an alloca routine which
  1810. X# you must supply.  Change the line below if your alloca.obj is some-
  1811. X# where other than the current directory.
  1812. ALLOCA = alloca.obj
  1813. X#ALLOCA = gnu_bison:[000000]vmshlp.obj
  1814. X
  1815. X# Use one of the following two defines.  The first will build flex with
  1816. X# a VMS-style command line interface, the second builds flex with a unix-
  1817. X# style command line interface.
  1818. X#
  1819. X# For a VMS-style interface...
  1820. VERSION = vms
  1821. X# For a unix-style interface...
  1822. X#VERSION =
  1823. X
  1824. X
  1825. X# BIN, LIB, MAN, CLD, HLP are set to reflect the locations where you
  1826. X# would like to store the executables, library (flex.skel), the manual
  1827. X# pages, the command definition file, and the help library module. 
  1828. X# You can leave these unchanged if you define the VMS logical names:
  1829. X#
  1830. X#    flex_exe      -- disk/dir of the executable image    
  1831. X#    flex_manual   -- disk/dir of the *.man files 
  1832. X#    flex_library  -- disk/dir of flex.skel and the .cld file
  1833. X#
  1834. X# These logical names ***MUST*** be defined before installing or
  1835. X# running flex.  They don't have to be defined to build flex.  You
  1836. X# may want to define these, either system wide in the system startup
  1837. X# procedure, or in your login.com file.  Alternatively, you can change
  1838. X# the definitions of BIN, LIB, CLD, MAN and HLP in here to refer to pre-
  1839. X# defined locations.  
  1840. X#
  1841. X# ...the installed location of the flex executable...
  1842. BIN = flex_exe:
  1843. X
  1844. X# ...the installed location of the flex skeleton file...
  1845. LIB = flex_library:
  1846. X
  1847. X# ...the installed location of the flex vms command definition file
  1848. X# (only matters when installing the VMS command line version)...
  1849. CLD = flex_library:
  1850. X
  1851. X# ...the installed location of the flex man pages.
  1852. MAN = flex_manual:
  1853. X
  1854. X# ...the help library to put the bison help module into. 
  1855. X# (only matters when installing the VMS command line version)...
  1856. HLP = sys$common:[syshlp]helplib.hlb
  1857. X
  1858. X# The default skeleton file that flex will use.
  1859. DEFAULT_SKEL = $(LIB)flex.skel
  1860. X
  1861. X# Flags that initscan.c was created with.  The tests will use the same
  1862. X# ones so that they should produce an output identical to initscan.c.
  1863. VMS_FLEX_FLAGS  = /NOCASE/NOECHO/EIGHT
  1864. UNIX_FLEX_FLAGS = -is8
  1865. X
  1866. X# Qualifiers for the link and cc commands.  Values here should be
  1867. X# fine.  You may want to modify these to build a debuggable version
  1868. X# of the executable.
  1869. LFLAGS = 
  1870. X#LFLAGS = /debug
  1871. CFLAGS = 
  1872. X#CFLAGS = /nolist/debug/noopt
  1873. X
  1874. X# CC command line defines that are used for (almost) all compilations.
  1875. X# The redefinition of exit will cause any error exits to returns a VMS 
  1876. X# error status (SYS-E-ABORT) but one that won't result in a system 
  1877. X# message (presumably flex printed an error message first). 
  1878. CDEFS = VMS,USG,"exit(s)=_exit((s)?0x1000002A:0)"
  1879. X
  1880. X# CC command define for the default skeleton file.
  1881. SKELDEF = "DEFAULT_SKELETON_FILE=""$(DEFAULT_SKEL)"""
  1882. X
  1883. XFLEXOBJS = ccl.obj dfa.obj ecs.obj gen.obj misc.obj nfa.obj \
  1884. X       parse.obj scan.obj sym.obj tblcmp.obj yylex.obj 
  1885. X
  1886. OBJ =      ccl.obj,dfa.obj,ecs.obj,gen.obj,misc.obj,nfa.obj, \
  1887. X       parse.obj,scan.obj,sym.obj,tblcmp.obj,yylex.obj
  1888. X
  1889. X
  1890. flex : flex$(VERSION).exe 
  1891. X    @ ! Flex.exe built
  1892. X
  1893. test : flex $(VERSION)_test
  1894. X    @ ! Flex.exe built and tested
  1895. X
  1896. all : $(VERSION)_install $(VERSION)_test_flex
  1897. X    @ ! Flex installed and tested
  1898. X
  1899. install : $(VERSION)_install
  1900. X    @ ! Flex installed
  1901. X
  1902. X_install : bin lib man
  1903. X    @ ! Flex installed
  1904. X
  1905. vms_install : bin lib cld man hlp
  1906. X    @ ! Flex installed
  1907. X
  1908. lib : $(LIB)flex.skel
  1909. X    @ ! Installed $(LIB)flex.skel
  1910. X
  1911. bin : $(BIN)flex$(VERSION).exe
  1912. X    @ ! Installed @(BIN)flex.exe
  1913. X
  1914. man : $(MAN)flex.man $(MAN)flexdoc.man
  1915. X    @ ! installed $(MAN)flex.man
  1916. X
  1917. cld : $(CLD)flex.cld
  1918. X    @ ! Installed @(CLD)flex.cld
  1919. X
  1920. hlp : $(HLP)(flex)
  1921. X    @ ! Installed $(HLP)(flex)
  1922. X
  1923. X$(LIB)flex.skel : flex.skel
  1924. X    copy/log flex.skel $(LIB)flex.skel/prot=(g:r,w:r)
  1925. X
  1926. X$(BIN)flex$(VERSION).exe : flex$(VERSION).exe
  1927. X    copy/log flex$(VERSION).exe $(BIN)flex$(VERSION).exe/prot=(g:re,w:re)
  1928. X
  1929. X$(MAN)flex.man : flex.man
  1930. X    if f$search("flex.man") .nes. "" then -
  1931. X        copy/log flex.man $(MAN)flex.man/prot=(g:r,w:r)
  1932. X
  1933. X$(MAN)flexdoc.man : flexdoc.man
  1934. X    if f$search("flexdoc.man") .nes. "" then -
  1935. X        copy/log flex.man $(MAN)flexdoc.man/prot=(g:r,w:r)
  1936. X
  1937. X$(HLP)(flex) : flex.hlp
  1938. X    libr/log $(HLP) flex.hlp/replace
  1939. X
  1940. X$(CLD)flex.cld : flex.cld_template 
  1941. X    open/write tempfl $(CLD)flex.cld
  1942. X    write tempfl "define verb FLEX"
  1943. X    write tempfl "    image $(BIN)FLEXVMS.EXE"
  1944. X    copy/log flex.cld_template tempfl/prot=(g:r,w:r)
  1945. X    close tempfl
  1946. X
  1947. X# Local cld file is named xflex so that $(CLD) can be defined as the flex
  1948. X# directory and the flex.cld file will be updated correctly.
  1949. xflex.cld : flex.cld_template
  1950. X    open/write tempfl xflex.cld
  1951. X    write tempfl "define verb XFLEX"
  1952. X    write tempfl "    image ''f$env ("default")'FLEXVMS.EXE"
  1953. X    copy flex.cld_template tempfl
  1954. X    close tempfl
  1955. X
  1956. ccl.obj : ccl.c flexdef.h
  1957. X    cc $(CFLAGS) /define=($(CDEFS)) ccl.c
  1958. X
  1959. dfa.obj : dfa.c flexdef.h
  1960. X    cc $(CFLAGS) /define=($(CDEFS)) dfa.c
  1961. X
  1962. ecs.obj : ecs.c flexdef.h
  1963. X    cc $(CFLAGS) /define=($(CDEFS)) ecs.c
  1964. X
  1965. gen.obj : gen.c flexdef.h
  1966. X    cc $(CFLAGS) /define=($(CDEFS)) gen.c
  1967. X
  1968. main.obj : main.c flexdef.h 
  1969. X    cc $(CFLAGS) /define=($(CDEFS),$(SKELDEF)) main.c
  1970. X
  1971. mainvms.obj : main.c flexdef.h vmscmdln.c
  1972. X    cc $(CFLAGS) /define=($(CDEFS),$(SKELDEF),VMSCMDLN) main.c /obj=mainvms
  1973. .obj
  1974. X
  1975. misc.obj : misc.c flexdef.h
  1976. X    cc $(CFLAGS) /define=($(CDEFS)) misc.c
  1977. X
  1978. nfa.obj : nfa.c flexdef.h
  1979. X    cc $(CFLAGS) /define=($(CDEFS)) nfa.c
  1980. X
  1981. parse.c : parse.y
  1982. X# You may need a "set command dev:[dir]bison here if the bison
  1983. X# command is not in the system DCL tables.
  1984. X#    set com gnu_bison:[000000]:bison
  1985. X    bison/defines/fixed_outfiles parse.y
  1986. X    copy y_tab.c parse.c
  1987. X    dele/noconf y_tab.c;*
  1988. X
  1989. parse.h : parse.c
  1990. X    copy y_tab.h parse.h
  1991. X    dele/noconf y_tab.h;*
  1992. X
  1993. parse.obj : parse.c flexdef.h parse.h
  1994. X    cc $(CFLAGS) /define=($(CDEFS),"void=int", -
  1995. X      "bcopy(b1,b2,n)=memcpy(b2,b1,n)") parse.c
  1996. X
  1997. scan.c : initscan.c
  1998. X    copy initscan.c scan.c
  1999. X
  2000. scan.obj : scan.c parse.h flexdef.h
  2001. X    cc $(CFLAGS) /define=($(CDEFS)) scan.c
  2002. X
  2003. sym.obj : sym.c flexdef.h
  2004. X    cc $(CFLAGS) /define=($(CDEFS)) sym.c
  2005. X
  2006. tblcmp.obj : tblcmp.c flexdef.h
  2007. X    cc $(CFLAGS) /define=($(CDEFS)) tblcmp.c
  2008. X
  2009. yylex.obj : yylex.c parse.h flexdef.h
  2010. X    cc $(CFLAGS) /define=($(CDEFS)) yylex.c
  2011. X
  2012. cli.obj : cli.c
  2013. X    cc $(CFLAGS) cli.c
  2014. X
  2015. flex.exe :  main.obj $(FLEXOBJS) $(ALLOCA) vaxcrtl.opt
  2016. X    link $(LFLAGS) /exe=flex.exe main.obj, -
  2017. X        $(OBJ), -
  2018. X        $(ALLOCA), sys$disk:[]vaxcrtl.opt/opt
  2019. X
  2020. flexvms.exe : mainvms.obj cli.obj $(FLEXOBJS) $(ALLOCA) vaxcrtl.opt
  2021. X    link $(LFLAGS) /exe=flexvms.exe mainvms.obj, cli.obj, -
  2022. X        $(OBJ), -
  2023. X        $(ALLOCA), sys$disk:[]vaxcrtl.opt/opt
  2024. X
  2025. vaxcrtl.opt :
  2026. X    open/write tempfl vaxcrtl.opt
  2027. X    write tempfl "SYS$SHARE:VAXCRTL.EXE/SHARE"
  2028. X    close tempfl
  2029. X
  2030. clean :
  2031. X    @ ! Cleanup by deleting unnecessary object files etc.
  2032. X    @ if f$search ("scan.c") .nes. "" then dele/log/noconf scan.c;*
  2033. X    @ if f$search ("parse.c") .nes. "" then dele/log/noconf parse.c;*
  2034. X    @ if f$search ("parse.h") .nes. "" then dele/log/noconf parse.h;*
  2035. X    @ if f$search ("lexyy.c") .nes. "" then dele/log/noconf lexyy.c;*
  2036. X    @ if f$search ("*.obj") .nes. "" then dele/log/noconf *.obj;*/exclu=(al
  2037. loca.obj,bcopy.obj)
  2038. X    @ if f$search ("y_tab.*") .nes. "" then dele/log/noconf y_tab.*;*
  2039. X
  2040. clean_all : clean
  2041. X    @ if f$search ("flex.exe") .nes. "" then dele/log/noconf flex.exe;*
  2042. X    @ if f$search ("flexvms.exe") .nes. "" then dele/log/noconf flexvms.exe
  2043. ;*
  2044. X    @ if f$search ("xflex.cld") .nes. "" then dele/log/noconf xflex.cld;*
  2045. X    @ if f$search ("vaxcrtl.opt") .nes. "" then dele/log/noconf vaxcrtl.opt
  2046. ;*
  2047. X    @ purge/log
  2048. X
  2049. X# The weird name used for the VMS flex commands below is to prevent the
  2050. X# DCL command from being shadowed by a DCL symbol named flex.  
  2051. X
  2052. vms_test_flex : 
  2053. X    set com $(LIB)flex.cld
  2054. X    flex_$make$ $(VMS_FLEX_FLAGS) scan.l
  2055. X    diff/max=1/out=NL: initscan.c lexyy.c
  2056. X    @ write sys$output "!!!! Test successful !!!!"
  2057. X    - dele/noconf lexyy.c;*
  2058. X
  2059. X_test_flex : 
  2060. X    flex := $$(BIN)flex
  2061. X    flex $(UNIX_FLEX_FLAGS) scan.l 
  2062. X    diff/max=1/out=NL: initscan.c lexyy.c
  2063. X    @ write sys$output "!!!! Test successful !!!!"
  2064. X    - dele/noconf lexyy.c;*
  2065. X
  2066. vms_test : xflex.cld
  2067. X    set com xflex.cld
  2068. X    xflex $(VMS_FLEX_FLAGS) /SKEL=flex.skel scan.l
  2069. X    diff/max=1/out=NL: initscan.c lexyy.c
  2070. X    @ write sys$output "!!!! Test successful !!!!"
  2071. X    - dele/noconf lexyy.c;*
  2072. X
  2073. X_test : 
  2074. X    flex := $sys$disk:[]flex
  2075. X    flex $(UNIX_FLEX_FLAGS) "-Sflex.skel" scan.l 
  2076. X    diff/max=1/out=NL: initscan.c lexyy.c
  2077. X    @ write sys$output "!!!! Test successful !!!!"
  2078. X    - dele/noconf lexyy.c;*
  2079. END_OF_FILE
  2080. if test 9933 -ne `wc -c <'makefile.vms'`; then
  2081.     echo shar: \"'makefile.vms'\" unpacked with wrong size!
  2082. fi
  2083. # end of 'makefile.vms'
  2084. fi
  2085. if test -f 'vmscmdln.c' -a "${1}" != "-c" ; then 
  2086.   echo shar: Will not clobber existing file \"'vmscmdln.c'\"
  2087. else
  2088. echo shar: Extracting \"'vmscmdln.c'\" \(3259 characters\)
  2089. sed "s/^X//" >'vmscmdln.c' <<'END_OF_FILE'
  2090. X/*
  2091. X *    This code is included by main.c when the macro VMSCMDLN is 
  2092. X *    defined to request a VMS-style command line interface.
  2093. X */
  2094. X{
  2095. X    int n;
  2096. X    char *p, *s, c;
  2097. X    static char outfnbuf[256];
  2098. X    static char skelfnbuf[256];
  2099. X    static char btfnbuf[256];
  2100. X    static char infnbuf[256];
  2101. X    static char **infnptr = NULL;
  2102. X    static int maxn = 0;
  2103. X    Char clower();
  2104. X
  2105. X    program_name    =  "flex";
  2106. X/*
  2107. X *  Default values for the various command line parameters and
  2108. X *  qualifiers should be set in the .CLD file using the DEFAULT
  2109. X *  and VALUE=(DEFAULT,...) keywords, not here.   This allows
  2110. X *  them to be changed without recompiling any code.
  2111. X */
  2112. X    ddebug         =  cli_qualifier( "DEBUG", 0 );
  2113. X    trace        =  cli_qualifier( "TRACE", 0 );
  2114. X    interactive     =  cli_qualifier( "INTERACTIVE", 0 );
  2115. X    caseins         = !cli_qualifier( "CASE_SENSITIVE", 0 );
  2116. X    gen_line_dirs     =  cli_qualifier( "LINE", 0);
  2117. X    performance_report     =  cli_qualifier( "STATISTICS.PERFORMANCE", 0 )
  2118. ;
  2119. X    backtrack_report    =  cli_qualifier( "BACKTRACK_REPORT", 0 );
  2120. X    spprdflt         = !cli_qualifier( "ECHO", 0 );
  2121. X    printstats         =  cli_qualifier( "STATISTICS.SUMMARY", 0 );
  2122. X    fulltbl        =  cli_qualifier( "TABLES.FAST", 0 );
  2123. X    fullspd        =  cli_qualifier( "TABLES.FULL", 0 );
  2124. X    useecs          =  cli_qualifier( "TABLES.EQUIVALENCE", 0 );
  2125. X    usemecs        =  cli_qualifier( "TABLES.META_EQUIVALENCE", 0 );
  2126. X    if ( cli_qualifier( "EIGHTBIT", 0 ) ) csize = CSIZE;
  2127. X/*
  2128. X *  In the code below, filenames are converted to lower case.  This is
  2129. X *  most important for the input filenames so that the .c files generated
  2130. X *  by this version of flex will be identical (including the input file-
  2131. X *  names that end up in the #line directives) with the .c files generated
  2132. X *  by the unix version.  For the other filenames it's just a matter of
  2133. X *  consistency of apperance in messages.
  2134. X */
  2135. X/*
  2136. X *  Get the names of all the input files, allocating space for them as
  2137. X *  needed.  Pointers to them are kept in an array 'infnptr' that is
  2138. X *  expanded as needed (though I doubt anybody will have more than 50
  2139. X *  input files on a command line!).
  2140. X */
  2141. X    for ( n=0; cli_value( "FILENAME", infnbuf, sizeof( infnbuf ) ); n++ ) {
  2142. X    if (n >= maxn) 
  2143. X        infnptr = (char **)realloc( infnptr,
  2144. X                    sizeof( *infnptr ) * ( maxn+=50 ) );
  2145. X    s = (char *)malloc( strlen( infnbuf ) + 1 );
  2146. X    infnptr[n] = s;
  2147. X    for ( p=infnbuf; c=(*p); p++ )
  2148. X        *s++ = clower( c ); 
  2149. X    }
  2150. X    num_input_files = n;
  2151. X    input_files = infnptr;
  2152. X/*
  2153. X *  Get the output file name.  This may always have a value
  2154. X *  if the .CLD file defines it with a default value.
  2155. X */
  2156. X    if ( cli_value( "OUTPUT", outfnbuf, sizeof( outfnbuf ) ) ) {
  2157. X    for ( p=outfnbuf; c=(*p); p++ ) *p = clower( c );  
  2158. X    outfile = outfnbuf;
  2159. X    }
  2160. X/*
  2161. X *  Get the skeleton file name.  This may always have a 
  2162. X *  value if the .CLD file defines it with a default value.
  2163. X */
  2164. X    if ( cli_value( "SKELETON", skelfnbuf, sizeof( skelfnbuf ) ) ) {
  2165. X    for ( p=skelfnbuf; c=(*p); p++ ) *p = clower( c ); 
  2166. X    skelname = skelfnbuf;
  2167. X    }
  2168. X/*
  2169. X *  Get the backtracking info file name.  This may always have a 
  2170. X *  value if the .CLD file defines it with a default value.
  2171. X */
  2172. X    if ( cli_value( "BACKTRACK_REPORT", btfnbuf, sizeof( btfnbuf ) ) ) {
  2173. X    for ( p=btfnbuf; c=(*p); p++ ) *p = clower( c ); 
  2174. X    backtrack_fn = btfnbuf;
  2175. X    }
  2176. X   }
  2177. END_OF_FILE
  2178. if test 3259 -ne `wc -c <'vmscmdln.c'`; then
  2179.     echo shar: \"'vmscmdln.c'\" unpacked with wrong size!
  2180. fi
  2181. # end of 'vmscmdln.c'
  2182. fi
  2183. echo shar: End of shell archive.
  2184. exit 0
  2185.