GCC COBOL
GCC COBOL Development
Technical information for developers working with the GCC COBOL compiler and the GCC compilation pipeline.
COBOLworx developed a COBOL front end for the GNU Compiler Collection (GCC). GCC COBOL, invoked with gcobol, brings COBOL into the same compiler architecture used by GCC's other supported languages.
Using GCC COBOL
Because it is part of the GCC family, gcobol works much like the gcc compiler.
Compile a COBOL program like this:
gcobol -o hello hello.cbl
Then run the resulting executable:
./hello
Building GCC COBOL
GCC is a large and complex compiler system, so building GCC COBOL from source is more involved than building a stand-alone application.
The development tree includes scripts intended to configure and build the compiler:
<repo>/gcc-cobol/gcc/cobol/scripts/release-configure-build
<repo>/gcc-cobol/gcc/cobol/scripts/debug-configure-build
The release script is intended for a normal build. The debug script builds GCC with debugging information and without optimization, making it possible to use a debugger such as GDB while tracing a compilation.
Build prerequisites and supported development environments change over time, so current source-tree documentation should be used for prerequisite and platform-specific instructions.
What Are We Developing?
The GCC architecture has a front end for each supported language. Each front end parses source code and converts the programmer's intent into GCC's intermediate representation, known as GIMPLE. That intermediate representation then passes through the GCC optimizer and on to the target-specific code-generation stages.
GCC COBOL provides the COBOL front end. It accepts COBOL source code, parses it, and generates the GIMPLE representation used by the rest of GCC. The COBOL front end is incorporated into GCC as the gcobol compiler.
Because gcobol is part of GCC, it can produce object files, shared objects, or executable binaries using the GCC toolchain.
Original Development Team
The archived COBOLworx development documentation identified the following members of the original GCC COBOL development team:
Marty Heyman
Team leader and COBOL subject-matter expert, responsible for coordinating the project and its business direction.
James K. Lowden
Responsible for the parsing of COBOL source code. COBOL's English-like syntax and long history make parsing it a particularly interesting compiler-design problem.
Robert Dubner
Responsible for code generation, including the work of translating parsed COBOL into GIMPLE for the GCC compilation pipeline.
More About GCC COBOL
For an overview of the compiler, supported dialects, portability, and standards goals, see the GCC COBOL overview.
Ready for a tune-up?