[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnubol: Sequential File I/O plans
Matthew,
Looks good.I like your approach. A few things...
* the cobcprs.tpl ->.y->.c file should just build a parse tree,
nothing else. The cobcast.c does any cross checking etc using the
symbol table which does not yet really exist, and also simplifies
and optimizes etc. The error routines will sort the messages by
source line number so there is no need to do the checking as you
go. Checking as you go is not possible in Cobol in various
contexts eg
GO TO X. // cant check until I get to X
X.
display "hello".
So I prefer it simple and get the whole parse tree and then check
everything, rather than parts here and there.
* The using xxx is not necessarily the file name. I don't want
people to have to code environment things in programs if they do
not want to. Have a look at what I did in the preprocessor. I
allow the following:
- it can be in quotes => file name
- if not, convert to upper case and
-- check if there is a environment variable => the value of that
is the file name
-- else use the upper case one as the file name
* The parsing of the procedure division parts may be tricky and
you may need some hacks. See the doco for the details of how I
handled this in the past. I think the list iof hacks is in the
source in cobctok.def.
* I think it may be easier if I do the code generation as it is
complicated and a large learning curve (and not big in for the
file IO). See the doco on creating a new front end to GCC on my
web oage if you want to take this on. It took me four months to
get this going... What you do need to do is invent the runtime
interface to the file IO and implement the interface. It needs to
be pretty simple. For example the display interface is something
like:
void
cobr_display (enum display_where, enum variable_type, int
variable length, int variable_type_specific_stuff).
(note naming convention for the function)
This is only implemented on the code generation side right now
but this is what the code generation implies (cobcbei.c).
So a display of multiple things creates multiple but *simple*
calls. Nothing fancy.
* You probably need to provide a hook for stop run so it can
close all the files. Invent such a hook and implement your side
of it.
I will be a bit quiet on the coding front over the next month or
so as I have a short term contract that is going to use 100% of
my time.
I have started the process of setting things up in sourceforge
which should make life a lot easier for everyone.
Regards,
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.