[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnubol: Cobol Compiler Suggested Tasks



My apologies in taking so long to respond to everyone who offered
to help with the compiler, and associated tasks. Anyway better
late than never...

I have included below an extract from my Web page
(www.geocities.com/timjosling/cobol/cobol_toc.html) - see Chapter
11 which has a list of tasks. It is much more readable there. 

If you feel the tasks are not detailed enough please email me
about it and I will provide more detail.

I have taken the liberty of suggesting some things that might
suit various people as follows:

David Chambers: PIC string clause analysis as described below.

Rich Sahlender: runtime routine for FILE IO for Random file.
Probably also needs a utility to create such a file. 

Juan Vazquez: Write a subroutine which does arithmetic on large
binary integers (> 32 bits, signed and unsigned). Add, divide,
multiply, subtract. Provide an overflow indicator. Provide the
remainder as well as the quotient for division. You can assume
the numbers are multiples of 32 bits. If my English is too
complicated, let me know and I will get Laura to translate it to
Spanish.

Ricardo Ramos: Runtime routine for SEARCH/SEARCH ALL

Matthew Vanecek: Runtime routine for FILE IO for sequential file.
Note that most of the compilers support 'line sequential' which
is not in the standard

Bill Klein: Bill would you like to have a look at the existing
tests of COPY & REPLACE and perhaps suggest some new ones (if you
expand the ZIP file and look in the test/cobol directory I
already have several as tests of "COBPRE" - some of which may be
wrong).

Noone mentioned YACC skills, but every part of Cobol outside the
Nucleus needs parsing if you have those skills. 

As mentioned below, you can pick another task if you prefer. The
three key points are 1) Agree the interface before coding 2) Use
gnu programming standards 3) provide test cases for your code;
may need a test driver.

If anyone does not have access to the standard, there are several
approaches. First IBM and Fujitsu have their manuals online
(www.software.ibm.com, www.adtools.com) and you can download
them. Second your local college probably has a copy. You can also
buy a copy and download it (ANSI web site I think - it costs
about $US150).

Once I have the garbage collection complete (1/2 done - I have
the back end running on GC but haven;t converted all my mallocs
gyet) and I have a contribution from someone else I wil put the
compiler onto a better environment eg CVS.

Tim Josling

***

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 (if you are a
GCC wizard). 

I am working on a subset which will allow most of the runtime to
be written in COBOL. So if you don't know C, don't lose heart, as
we will be able to write most of the compiler and the runtime
routines in Cobol. 

Here is current list of tasks that are needed, with skills
required for the tasks. These tasks are roughly in order of
increasing difficulty. The job of creating a Cobol compiler is
large and any quality contribution is welcome. If you need a more
specific definition of any task I can provide that. 

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 feature 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. 

11.1 Task List for Contributors

Take a task from this list or from the main list section 13.2
Major Phases.

For programming tasks, it is a good idea to define the interface
to the program you are writing first. Once we have that agreed,
write the code. 

1.Documentation. Documentation of features supported by other
compilers and the syntax they use, for example what the various
COMP usages mean for the various compilers. 

2.Cobol Test Code (not hard if you know Cobol). Provide Cobol
code that can be used to test various features of the compiler.
Provide the code plus details of the expected output and any
expected error messages or failure conditions, plus details of
the feature being tested. Things we need to test include: are bad
input programs detected; are non-standard programs detected; do
verbs work as expected; does the compiler support minima
prescribed by the standard (eg minimum number of nested ifs); are
useful error messages output in various situations; how well do
we recover from certain error conditions; how fast do certain
programs run.

Normally we divide tests into small focussed tests for testing
features, bugs or performance, and large torture tests for trying
to push th compiler to and past its lmits. At this stage tests of
function in the Cobol nucleus are most important and also the
COPY and REPLACE verbs. 

3.Runtime Routines. Some of the Cobol features will not be
compiled directly into compiled code; rather the compiled code
will call runtime routines which will perform complex functions,
such as sorting. In each of these cases, you need to define an
interface to the routine from the generated code and then write a
program that implements that interface. You can write this in C
or in Cobol. No special skills are needed other than command of
the language used and an understanding of the Cobol 85 standard.
If you use Cobol, then you need to confine yourself to the
compiler-use subset of Cobol. See section 12.2 Cobol Subset for
use within the compiler.

We need runtime routines for numerous things: 

1.Non-binary arithmetic. eg packed decimal, display format. 

2.Large binary support. Larger integers than 'long long' ie more
than 64 bits. 

3.Sort. 

4.Merge. 

5.Sequential file actions (open close read write). 

6.Relative File actions. 

7.Indexed File actions. 

8.Report Writer. 



4.Picture analysis. The Cobol data definition usually contains a
picture clause which contains a 'picture' of the format of the
data item. For example PIC X(10) means 10 alphanumeric
characters, PIC 9(5)v9(3) means 5 numeric digits then an implied
decimal point then three decimal digits. We need a routine which
analyses
validates and encodes a picture clause, and specified which USAGE
clauses it is consistent with. That is what usage classes is the
picture clause compatible with (numeric, numeric edited,
alphabetic, alphanumeric). 


5.Grammar. YACC grammars for any part of Cobol outside the
nucleus. We will need to parse the whole standard, even though we
will probably not actually implement some of the language
(segmentation, debug and communications will probably not be
supported but we need to be able to parse them and report that we
do not support them, to be standards compliant). Cobol is not
LALR(1) compliant and YACC requires LALR(1) compliance. Therefore
there is a need for some 'hacks' to help YACC along. See the file
`cobctok.def' for documentation on the existing hacks and to see
how they should be structured. 

6.Native Packed decimal support (very hard). Contribute patches
to GCC to provide native support for packed decimal arithmetic on
platforms that support it like S/390. Skills required: excellent
knowledge of GCC internals and the target machine codes involved,
excellent C coding skills. Should also be willing to provide
builtin routines for platforms without useful packed decimal
supprort. This is a hard task because the GCC internal structure
assumes oprtations are done with reigsters, which is usually not
the case for packed decimal instructions. An alternative approach
to this problem could be to provide builtin routines for packed
decimal which just happen to include some 'asm' assembler inline
code on certain platforms (you can check for the platform using
#ifdef type contructs) 

7.Fixes for any bugs. 

8.Any improvememts to the main GCC compiler.


--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.