Newbie code review of parsing program Please
len
lsumnler at gmail.com
Mon Nov 17 10:58:37 EST 2008
On Nov 16, 9:57 pm, Lawrence D'Oliveiro <l... at geek-
central.gen.new_zealand> wrote:
> len wrote:
> > if fieldline.count('COMP.') > 0:
>
> I take it you're only handling a particular subset of COBOL constructs: thus, "COMP" is never "COMPUTATIONAL" or "USAGE IS COMPUTATIONAL", and it always occurs just before the full-stop (can't remember enough COBOL syntax to be sure if anything else can go afterwards).
>
> > elif newline[0].isdigit() and 'PIC' in newline:
>
> Similarly, "PIC" is never "PICTURE" or "PICTURE IS".
>
> Aargh, I think I have to stop. I'm remembering more than I ever wanted to about COBOL. Must ... rip ... brain ... out ...
Most of the cobol code originally comes from packages and is
relatively consistant.
Thanks
Len
More information about the Python-list
mailing list