Columns


CUG New Releases

Bison++, Flex++, ATOC, and DISKED

Victor R. Volkman


Victor R. Volkman received a BS in Computer Science from Michigan Technological University. He has been a frequent contributor to The C Users Journal since 1987. He is currently employed as Senior Analyst at H.C.I.A. of Ann Arbor, Michigan. He can be reached by dial-in at the HAL 9000 BBS (313) 663-4173 or by Usenet mail to sysop@hal9k.com.

New Library Acquisitions

Bison++: CUG #404

Bison++ and Flex++, developed by Alain Cotmeur of Informatique-CDC (Arcueil, France) are two new packages that bring a pair of traditional UNIX tools into the 90s. Bison++ is derived directly from GNU Bison, the popular replacement for the UNIX utility yacc ("Yet Another Compiler Compiler"). Two decades after its creation, the yacc software interface remains the most popular tool for developing compilers, assemblers, and other text processing applications.

Bison++ injects C++ classes into the established yacc software interface while retaining downward compatability with programs that use the older C interface. This makes the yacc software interface much more attractive for new C++ applications and gives a definite migration path for older C applications. Bison++ version 1.21-7 (released 11/18/93) is immediately available as CUG #404. The version number decodes to revision 7 of Bison++, which is a superset of GNU Bison 1.21.

Bison++ compiles on most UNIX workstations and includes the ubiquitous GNU configure utility, which generates the appropriate makefiles for your workstation. Additionally, Bison++ claims compatibility with Microsoft C++ (makefile included) and Borland Turbo C++ (makefile not included).

Since Bison++ is a superset of Bison, the archive includes complete Bison documentation. The documentation for Bison++ is in both GNU Texinfo format and PostScript. For information on Bison, on which Bison++ is based, see "Bison: A GNU Breed of yacc," by Victor Volkman, CUJ, August 1989, p. 117.

Flex++: CUG #405

Cotmeur's other contribution to the CUG Library is the Flex++ package. Like Bison++, Flex++ offers the benefits of C++ classes while retaining downward compatibility with existing C programs.

Coetmeur's Flex++ is derived directly from GNU Flex ("Fast LEX"), the popular replacement for the UNIX utility lex. The lex software interface remains very popular for developing stand-alone text processing applications and creating front-end lexical analyzers for utilities such as yacc. lex is ideal for matching both simple and complex patterns of characters.

FLEX++ injects C++ classes into the established lex software interface. This both makes the lex software interface much more attractive for new C++ applications and gives a definite migration path for older C applications. FLEX++ version 2.3.8-6 (released 11/18/93) is immediately available as CUG #405. The version number decodes to revision 6 of FLEX++, which is a superset of GNU FLEX 2.3.8.

FLEX++ compiles on most UNIX workstations and includes the GNU configure utility to generate the appropriate makefiles. FLEX++ is also compatabile with Microsoft C++ (makefile included) and Borland Turbo C++ (makefile not included).

The archive includes complete FLEX documentation in both GNU Texinfo format and PostScript. For information on FLEX see "Public Domain Lex is Fast and FLEX-ible," by Victor Volkman, CUJ, October 1989, p. 129.

ATOC and DISKED: CUG #406

This volume provides two small and powerful archives on a single diskette. Mike Rejsa (Brooklyn Park, MN) submits his translator for converting ANSI-style C code to older Kernighan and Ritchie (K&R) syntax. ATOC version 1.08 (released 11/15/93) is designated CUG 406A. Also, Greg Jennings (Falmouth, MA) presents his MS-DOS DISK EDitor for low-level debugging and maintenance of floppy disks and hard disks. DISKED version 2.5 (released 01/14/94) is designated CUG #406B.

ATOC: CUG #406A

Most C programmers have switched to ANSI-style coding techniques sometime in the last two or three years. The ANSI syntax allows for more comfortably readable code. The C compilers for many older UNIX systems, however, still require K&R syntax, and the business of removing all ANSI-C-specific constructs from the source code can be both inelegant and tedious. ATOC translates ANSI programs to a K&R compiling source stream. The CUG distribution includes an MS-DOS executable (14K), but the ATOC source should compile easily on other platforms. (ATOC itself is written in K&R C.)

Usage

Usage: ATOC [-e] [-i] [-il]
      [-t] [-v] infile [ outfile ]
Examples of usage:

ATOC file. c
   (convert and output to display)

ATOC file.c out.c
   (convert and save)

ATOC -v file.c out.c
   (convert and save with -v option)
The -e option causes ATOC to ignore enumerations. Some K&R compilers support enumerations, but others don't. If you turn off the -e option, ATOC will transform all enumerations into something more K&R friendly.

The -i option causes #include files to be included, converted, and placed in the output stream. Use ATOC without -i for a simple one-time conversion, such as when you have an ANSI program that you want to permanently convert to K&R style. Use ATOC with -i when you are maintaining ANSI code and wish to convert an included header "on-the-fly" each time you recompile using your K&R compiler.

The -il option is just like -i except only the local #include files (those with names enclosed in double quotes) are included. If the #include file name is in < > characters, it is left as a normal #include statement. (These are often header files that come with the compiler, and would already be in K&R C.)

The -t option causes ATOC to ignore ANSI-standard trigraphs. (Note: the trigraphs supported by older compilers may not be ANSI-standard. These non-standard trigraphs will pass thru ATOC unchanged even without the -t option.)

The -v option causes ATOC to ignore voids. (Some K&R compilers support the void data type). A void used to indicate an empty function parameter list (e.g. int func(void)) is always removed, even when the -v option is specified.)

DISKED: CUG #406B

DISKED is an easy-to-use disk editor and data recovery program for IBM-PC/XT/AT and compatible computers. It allows you to edit any sector and save any sectors to a file. DISKED will recover data from a disk with a damaged boot sector, a damaged FAT, or a damaged directory area. Jennings intended DISKED to be very easy to learn and use. He has abbreviated commands to as little as one letter.

Although DISKED can recover an erased file's data, DISKED cannot unerase a file. DISKED also does not format or change any format parameters of a disk. It does not fix bad sectors or move files around.

DISKED starts at the root directory sector in a combined command and edit mode. You can navigate with arrow keys as if you were simply paging through a word processing document. As you move, DISKED displays what it sees on the disk.

DISKED maintains two available areas for data: a sector buffer (that holds the selected sector's data) and a file buffer (that allows you to save sector data into a disk file). You can edit the sector buffer byte-wise with debugger type commands and then write the results back to the disk. DISKED provides a spare sector buffer to which a sector can be stored and retrieved for copying to another sector.

You can save data by appending single or multiple sectors into the file buffer. You can then edit the file buffer, write the buffer to a disk file, empty the buffer and start again. Any number of absolute sectors can also be written to a file.

DISKED is written 100% in C and can be built in any Microsoft or Borland C compiler environment. Please note that DISKED is protected by the GNU Public License with additional amendments by Jennings.