Determine Cobol coding style <p>I'm developing an application that parses Cobol programs. In these programs some respect the traditional coding style (programm text from column 8 to 72), and some are newer and don't follow this style.</p> <p>In my application I need to determine the coding style in order to know if I should parse content after column 72.</p> <p>I've been able to determine if the program start at column 1 or 8, but prog that start at column 1 can also follow the rule of comments after column 72.</p> <p>So I'm trying to find rules that will allow me to determine if texts after column 72 are comments or valid code.</p> <p>I've find some but it's hard to tell if it will work everytime :</p> <ul> <li><p>dot after column 72, determine the end of sentence but I fear that dot can be in comments too</p></li> <li><p>find the close character of a statement after column 72 : <code>" ' ) }</code></p></li> <li><p>look for char at columns 71 - 72 - 73, if there is not space then find the whole word, and check if it's a key word or a var. Problem, it can be a var from a COPY or a replacement etc...</p></li> </ul> <p><strong>I'd like to know what do you think of these rules and if you have any ideas to help me determine the coding style of a Cobol program.</strong></p> <p><em>I don't need an API or something just solid rules that I will be able to rely on.</em></p>