gnucobol-users
[Top][All Lists]
Advanced

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

[open-cobol-list] How does Cobol parse the Procedure Division ?


From: Patrick
Subject: [open-cobol-list] How does Cobol parse the Procedure Division ?
Date: Tue, 24 Sep 2013 11:07:27 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130917 Thunderbird/17.0.9

Hi Everyone

It's easy to see how Cobol can be parsed in all of the parts outside of the PROCEDURE DIVISION, statements end with periods.

I can't see how the compiler could understand what is going on in PROCEDURE though. Every language I know of has some sort of character to end a statement. It might be a non printable character but it's there.

PROCEDURE ends in a period and paragraphs end in periods but if we have a statement like this:

MOVE foo TO moo

I could see how the compiler would implicitly know that it ends one token after TO but we can also have:

 MOVE foo TO moo koo boo

Does the next reserved word that is not a part of the current sentence signify an end to the current statement and the final period indicate that there are no further statements coming ?

If this is true, was it always this way. From what I understand it was not.

If this is true did it dramatically increase the complexity of the compiler?

Thanks




reply via email to

[Prev in Thread] Current Thread [Next in Thread]