If you would like to work on improving COBOL for GCC, please contact me at tej@melbpc.org.au.
You can help by doing testing, by writing tests, by fixing bugs, or by writing code.
Contributions to the documentation are also very welcome, particularly for the chapter on the GCC internals.
We are working on a subset which will allow most of the runtime and parts of the compiler itself to be written in COBOL. So even if you don't know C you will be able to write work on most of the compiler and the runtime routines, using COBOL.
A list of tasks is available on the web site at http://sourceforge.net/projects/CobolForGCC/.
Note that the GNU coding standards are used. These are available at http://www.fsf.org. They include naming and documentation standards as well as layout standards for C code.
Extreme programming is used. See section 12.3 Programming Standards and Methodology. In particular this means every feature or fixed bug must have a test, and we only add code we need for the features we are implementing now.
The core compiler will be released under the GNU General Public Licence, but the runtime routines will be released under the GNU Libray General Public Licence. This means that in the library, software licenced under the standard GPL cannot be used without a release from the author.
For programming tasks, it is a good idea to define the interface to the program you are writing first and post that to the development mailing list. Once we have that agreed, write the tests and then the code.
Some of the types of tasks are:
The original author was Tim Josling. The COBOL for GCC program actually consists for the most part of the main GCC compiler, so all the contributers to GCC have indirectly also contributed to COBOL for GCC.
Others have contributed in various ways.
The subset of the language that can be used in the runtime of the compiler and in compiling the rest of the language will be a limited subset. This will allow much fo the compiler and runtime to be written in COBOL.
The compiler will be built in two phases. One, build a compiler that can handle the limited subset. Then build the full compiler. The code within the full compiler including the full compiler's runtime library can use the limited subset of COBOL.
The subset will have access to all the C runtime (including memory allocation, file IO, formatting, string, date and time) via the function call facility.
What should be in the subset?
I am thinking: Only parts of the Nucleus, plus support for functions (required to interface to C), plus some new data types (pointers, binary-*) from the new draft standard, and parts of interprogram communication, and ability to create and call functions. Excluding lots of things... IDENTIFICATION DIVISION: Unsupported: AUTHOR - comments can do this Unsupported: INSTALLATION - comments Unsupported: DATE-WRITTEN - comments Unsupported: DATE-COMPILED - comments Unsupported: SECURITY - comments You get program-id/function-id and the repository paragraph from COBOL 2000. ENVIRONMENT DIVISION: Unsupported: SOURCE-COMPUTER - obsolete (no debugging mode) Unsupported: OBJECT-COMPUTER - obsolete Unsupported: SPECIAL-NAMES - luxury So get basically nothing here. DATA DIVISION: A limited subset of PIC only - only pic x(nnn) or pic x. All numerics are via binary-xxx A limited subset of USAGE only - only display plus binary-char/short/long/double plus pointer (data pointers, program pointers and function-pointers (an extension beyond COBOL 2002). Unsupported: SIGN IS Unsupported: SYNCHRONIZED Unsupported: JUSTIFIED Unsupported: BLANK WHEN ZERO Unsupported: RENAMES (66 level) Unsupported: condition names (88 level) - syntactic sugar only. OCCURS is allowed but not ascending/descending key. Occurs depending on can have occurs from n to 0 where the zero means 'no limit'. So you get linkage and working storage, structures, redefines, pointers, binary numbers and alphanumeric data (pic x), and occurs. The only values that are allowed are integers and alphanumerics (character strings). Strings can be joined by the "&" operator. Thus "AB" & "CB" is the same as "ABCD". Hex strings are allowed too: X"C1". From COBOL 2000 you also get local-storage (automatic variables). Procedure division: Limited support for: ACCEPT - "from" phrase not allowed. Unsupported: ADD, DIVIDE, SUBTRACT, MULTIPLY - use compute Unsupported: ALTER - obsolete Limited support for: COMPUTE - only one receiving item allowed, no rounding, no size error. CONTINUE - allowed Limited support for: DISPLAY - "upon" phrase not allowed Unsupported: ENTER - obsolete - maybe later for embedding assembler Unsupported: EVALUATE - not allowed Unsupported: EXIT - has no effect, not allowed Limited support for: GO TO - go to without procedure name not allowed. Go to depending on supported. Limited support for: IF - OK but next sentence not allowed Unsupported: INITIALIZE - not allowed Unsupported: INSPECT - not allowed Limited support for: MOVE - corresponding phrase not allowed. PERFORM - allowed Unsupported: SEARCH - not allowed Limited support for: SET - pointer arithmetic only. Limited support for: STOP - OK but stop literal not allowed Unsupported: STRING - not allowed Unsupported: UNSTRING - not allowed Unsupported: USE - not allowed FUNCTION - ability to define and call functions per COBOL 2002, but the COBOL instrinsic functions will not be there. So you have limited forms of accept, compute, display, go to, if, move, set, stop. Also from inter-program communication you would have Limited support for: Procedure division using/returning but no by reference/content Limited support for: CALL - no on overflow or on exception. No dynamic calls, only call "literal". Unsupported: CANCEL - not allowed Unsupported: GLOBAL/EXTERNAL phrases - not allowed EXIT PROGRAM - allowed (no 'goback') linkage section.
I use the ExtremeProgramming methodology. (See c2.com/cgi/wiki?ExtremeProgrammingRoadmap)
In particular:
Development languages: GNU C, Flex, Bison, configure, dejagnu, COBOL subset, autogen.
Coding standards: Free Software Foundation standards and ExtremeProgramming standards.
Go to the first, previous, next, last section, table of contents.