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

gnubol: COBOL Grammar Nucleus Level 2



I have uploaded my updated grammar, which includes support for all of
Nucleus level 2 plus a few bits and pieces. I will be adding some
support for Cobol 4 addressing (set address etc).

It is available from my web page timjosling.homapage.com. The grammar is
available as a separate file and also as part of the zip and tgz files.

There are also various bug fixes and improvements to the preprocessor.

The main point of interest is the grammar. I have succeeded in producing
a complete grammar, however:

- there are no error productions yet. Real Soon Now. I think I will have
to add some extra fake tokens to delimit end of condition and end of
statement.

- there are a lot of magic token (do a find on magic in the
cobgoprs.y[.txt] file to find them. I have documented all the issues I
found and the solutions I invented.

- it is undoubtedly full of bugs, as it has not been tested.

- I have not yet proved it is possible to create the magic tokens by a
fairly simple pre-scan. I believe I can and this is the next step after
the error productions.

My next step is to add in the error productions. The approach here is:

1. Outside the procedure division, panic mode recovery to end of
sentence. ( error tk_fullstop )

2. In the procedure division:

- panic mode recovery to
* end of condition if I can work out how. (if error
fake_token_end_condition)
* next verb
* full stop

I have about 800 rules and 1300 states at the moment.

I found new problems all the time as I went along, that were a surprise
eg the problem in inspect. Are there any verbs outside the nucleus that
anyone thinks will create novel problems?

On the nested conditionals I am assuming (and hoping) Bob is correct.

I hope to get a running compiler going on a subset of this grammar,
which is capable of linking into the C environment, thus able to access
all the C functions (except probably those that include function
pointers). Thus we can then write parts of the runtime in this subset of
COBOL. I've worked out how I can manage this.

Comments welcome.

Tim Josling





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