Code Comments
Programming Forum and web based access to our favorite programming groups.Hi all, because it's very hard to find a complete grammar definition for Cobol AS/400, I wonder if there is a way for describing a grammar (BNF, EBNF,...) that tokenize only some specific rules and ignore all the rest. Many Thanks Matteo.
Post Follow-up to this message"matteo" <matteom@avanade.com> wrote in message news:3d89db82.0407230340.45d8eb09@posting.google.com... > because it's very hard to find a complete grammar definition for Cobol > AS/400, I wonder if there is a way for describing a grammar (BNF, > EBNF,...) that tokenize only some specific rules and ignore all the > rest. This is called "Island Parsing" Check out comp.compilers. The down side to island parsing is a) you still have to define much of the complete languages (e.g., mostly you have to lex everything, you still have to worry about COPYLIBs and COPY REPLACING, etc.), b) often you discover after you get the "islands" of interest to parse, that to do the job you want done, you have to go back and expand the islands. Eventually you end up with most of the full grammar anway. c) If you need to know what a name means, then you pretty much have to do the full grammar, and you have to have the symbol table. Most interesting analyses require C anyway. So we don't see this as really a big win. However, we've found it pretty effective to take a clean base grammar (e.g., ANSI COBOL 85), and add the differences as defined by reference manuals. Also in the not-for-free category, too, is our tool, the DMS Software Reengineering Toolkit. It has very strong parsers for many languages, including ANSI and VS II COBOL, with full symbol table construction. Lastly, there's lots of tool work needed beyond parsing. DMS provides means to define analyzers and source-to-source transformers of the code. -- Ira D. Baxter, Ph.D., CTO 512-250-1018 Semantic Designs, Inc. www.semdesigns.com
Post Follow-up to this messageCheck www.corporola.com. There is a BNF definition for COBOL 74/85 for COBOL to Java translation. I think It will cover AS/400. Thomas "matteo" <matteom@avanade.com> wrote in message news:3d89db82.0407230340.45d8eb09@posting.google.com... > Hi all, > because it's very hard to find a complete grammar definition for Cobol > AS/400, I wonder if there is a way for describing a grammar (BNF, > EBNF,...) that tokenize only some specific rules and ignore all the > rest. > Many Thanks > Matteo.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.