Activity for Koopa (COBOL) Parser Generator

  • KrisDS KrisDS posted a comment on discussion Help

    Hi Shiva, Yes, of course that's possible. Look at the classes under the “examples" folder to see how you can access the ASTs and start processing them. Cheers, Kris

  • Shiva Sharma Shiva Sharma posted a comment on discussion Help

    Hi Kris, I have started with Koopa parser and i was succesfully able to get XML dump and convert it into XSD schema and generate java classes from it. Now am looking for a way where i can directly read AST into Java objects without converting it into XML or XSD. Is there any way to do that. I did a lot of research but couldn't find a appropriate way. Please suggest if there is any way. Shiva

  • KrisDS KrisDS posted a comment on discussion Open Discussion

    I contacted you via LinkedIn. I hope I picked the right Guy. :-)

  • Guy Smallwood Guy Smallwood posted a comment on discussion Open Discussion

    Hi Chris No worries on the code to process the XML, I'm gaining confidence in the solution I'm putting together now. As regards LGTM, I took a look and it sufficiently piqued my interest enough to continue the conversation. Probably not here though as leaving my e-mail address could have "unforeseen" consequences and noth ethically correct. Any chance you can contact me on LinkedIn? (my name plus Suncorp should be enough) Cheers Guy

  • KrisDS KrisDS posted a comment on discussion Open Discussion

    Hi Guy, Sorry, no. I process the data coming from the parser directly, without an intermediate transformation to XML. If you want more insight into the XML, I definitely recommend using the GUI. As the XML is pretty much a dump of the AST, anything you learn in one should be directly applicable in the other. The GUI lets you click on any token in the text and it will show you the path in the tree. There is also an option to visualize the AST in the UI. Even better, when you show the AST, clicking...

  • Guy Smallwood Guy Smallwood posted a comment on discussion Open Discussion

    Hi Kris We are on IBM Enterprise COBOL for z/OS 4.2.0 (about to upgrade to COBOL 6). Thanks for the detailed response. As I am pre-processing the code anyway, I can easily insert a "nothing" statement into the search as you suggested so no need for you to do anything. I am running this all as a batch process it hadn't occurred to me to run the individual problem cases through the GUI to get more information regarding the error. I'll do that before I apply the fix that gets me around this one and...

  • KrisDS KrisDS posted a comment on discussion Open Discussion

    So the error says that it could not classify the "END-SEARCH", but everything up to that point seems to have gone allright. In particular it looks like it handled the search statement's condition (note the "condition < searchStatement" in the path). Looking at the grammar it expects to find something after the condition: WHEN condition ( nestedStatements | NEXT SENTENCE ) Your example does not have a nested statement, nor a NEXT SENTENCE, and so the parse fails. Adding a statement after line 044300...

  • Guy Smallwood Guy Smallwood posted a comment on discussion Open Discussion

    Is there a way to get verbose error messaging out of the parser? So far I have managed to figure out the errors that have been thrown by examining the Cobol code for anomalies, but the latest one has me stumped. Processing D:\work\source-xref\parse\cobol-cpp-batch\EBB520.CBL Writing XML to D:\work\source-xref\cobol-xml-batch\EBB520.xml Error: [EBB520.CBL:2001:12|END-SEARCH|EBB520.CBL:2001:21] @FIXED @WORD @PROGRAM_TEXT_AREA Incomplete parse. Last success ful match: identifier_format6 < identifier...

  • Adam Britt Adam Britt posted a comment on discussion Open Discussion

    With the project on github I'm not sure where the best place to communicate is, but we started here. I've create a small example of the problem in a private repo on github where I've added you as a collaborator. (my workplace is still figuring out how they approach open source but I have been given permission to contribute to existing projects). I hope that it is straight forward to use but let me know if anything is confusing. See the readme for more details. I've also made a pull request. You can...

  • KrisDS KrisDS posted a comment on discussion Open Discussion

    I decided to move the project to GitHub. It is much easier for people to contribute changes there. So if you have something to share, you can now base it off the version found at https://github.com/krisds/koopa/issues . I'm happy to keep the discussion here though.

  • KrisDS KrisDS posted a comment on discussion Help

    I decided to move the project to GitHub to make it easier for people to contribute. You can now find it here: https://github.com/krisds/koopa/issues The SourceForge version will remain for historic purposes. I'll keep an eye on the forums here for a while longer.

  • KrisDS KrisDS posted a comment on discussion Open Discussion

    I decided to move the project to GitHub to make it easier for people to contribute. You can now find it here: https://github.com/krisds/koopa/issues The SourceForge version will remain for historic purposes. I'll keep an eye on the forums here for a while longer.

  • KrisDS KrisDS posted a comment on discussion Open Discussion

    Hey Adam, Koopa uses SVN right now, so the easiest way to share your changes is to make a diff between your code and the latest commit here, and share that. (I see that SF supports git now, so maybe I'll take some time to migrate the repo over to that. I'm not sure what the best option is.) But before that, do you have an example of dummy operands which Koopa fails to handle ? That way I can inspect what goes wrong, and give you a better answer. I would actually expect Koopa to be able to handle...

  • Adam Britt Adam Britt posted a comment on discussion Open Discussion

    I have some changes to handle working with a dummy operand. A dummy operand is explained here: IBM COBOL Language Reference. In short: The COPY statement with REPLACING phrase can be used to replace parts of words. By inserting a dummy operand delimited by colons into the program text, the compiler will replace the dummy operand with the desired text. Example 3 shows how this is used with the dummy operand :TAG:. The colons serve as separators and make TAG a stand-alone operand. I am unsure what...

  • KrisDS KrisDS committed [r417]

    Simplify grammar for some CICS options

  • KrisDS KrisDS committed [r416]

    Easy conversion of Start to matching End

  • KrisDS KrisDS committed [r415]

    TRUE and FALSE in common nodes

  • KrisDS KrisDS committed [r414]

    Adding a common type for all statement END markers.

  • KrisDS KrisDS committed [r413]

    Fix double closing of Targets by Flow when there's a WaterTagger.

  • KrisDS KrisDS posted a comment on discussion Open Discussion

    The XML has the same info as the AST. It's just a way to store it. You can analyze the AST in code, or analyze the XML, in whatever way you want. Calculating a flow graph will mean understanding how a Cobol program flows, and then querying the AST to give you the information you need to calculate it. You'll need to look at sections, paragraphs, specific statements. It's not impossible, or especially hard, but it does take work to do.

  • KrisDS KrisDS posted a comment on discussion Open Discussion

    The XML has the same info as the AST. It's just a way to store it. You can analyze the AST in code, or analyze the XML, in whatever way you want. Calculating a flow graph will mean understanding how a Cobol program flows, and then querying the AST to give you the information you need to calculate it. You'll need to look at sections, paragraphs, specific statements. It's not impossible, or especially hard, but it does take work to do.

  • Bharani Bharani posted a comment on discussion Open Discussion

    Thanks Kris.. My intend was to create a flowgraph for Cobol program using AST just for my future understanding. Would XML help to builld the flow graph? Pls help me to undestand.

  • Bharani Bharani posted a comment on discussion Open Discussion

    Great! I'll try Kris.. thank you.

  • KrisDS KrisDS posted a comment on discussion Open Discussion

    I'm not sure what you mean by "variables with hierarchy". Right now only XML export of the full AST is built-in. If you need something custom you will have to code it yourself. The easiest way is to grab the AST and process it how you want. If you look at "JaxenSample" you can see how to do the first part.

  • Bharani Bharani posted a comment on discussion Open Discussion

    Thanks Kris. I found that and it was much helpful. I was wondering If there is anyway I can get the AST in the text format which has only variables with hierachy.. :)

  • KrisDS KrisDS posted a comment on discussion Open Discussion

    Hi Bharani, Koopa includes a tool which lets you export the AST to XML. You can invoke it with "java -cp koopa.jar koopa.app.cli.ToXml", or use the "Export to XML" action under "Syntax Tree" in the GUI. Hope that helps, Kris

  • Bharani Bharani posted a comment on discussion Open Discussion

    Hi, Please help me on this. I would like to write the AST file into TXT file. Could you please help me on this? It will be helpful If it can be found in the hierarchy model. thanks in advance. Bharani J 11 years with Mainframe new to Java

  • KrisDS KrisDS committed [r412]

    Start and End are flyweights, so equality can be simplified.

  • KrisDS KrisDS committed [r411]

    Applying the improved optimizer logic to permutations too.

  • KrisDS KrisDS committed [r410]

    Performance tweaks

  • KrisDS KrisDS committed [r409]

    Position-spec test.

  • KrisDS KrisDS committed [r408]

    Partial expressions in selection objects in EVALUATE statements

  • KrisDS KrisDS committed [r407]

    Adding position-spec anyway.

  • KrisDS KrisDS committed [r406]

    Note and test on position-spec in DISPLAY/ACCEPT.

  • KrisDS KrisDS committed [r405]

    Fix a test file.

  • KrisDS KrisDS committed [r404]

    FUNCTION name+ INTRINSIC

  • KrisDS KrisDS committed [r403]

    ACCEPT: WITH is optional

  • KrisDS KrisDS committed [r402]

    DISPLAY ERASE SCREEN

  • KrisDS KrisDS committed [r401]

    ENTRY USING BY CONTENT

  • KrisDS KrisDS committed [r400]

    ACCEPT FROM ENVIRONMENT identifier

  • KrisDS KrisDS committed [r399]

    COPYs in comments don't count. Obviously.

  • KrisDS KrisDS committed [r398]

    Guarding against an NPE.

  • KrisDS KrisDS committed [r397]

    Introducing the CobolProject interface.

  • KrisDS KrisDS committed [r396]

    Keyword test: refactored from recursion to a loop

  • KrisDS KrisDS committed [r395]

    Fix grammar for parameters in MF directives.

  • KrisDS KrisDS modified ticket #67

    Cash not find class koopa.core.parsers.combinators.MatchTree

  • KrisDS KrisDS posted a comment on ticket #67

    Sorry about that. It's been a while since I used svn and I forgot to add those classes in. Should be fixed now.

  • KrisDS KrisDS committed [r394]

    Add missing classes.

  • Frank Becker Frank Becker created ticket #67

    Cash not find class koopa.core.parsers.combinators.MatchTree

  • KrisDS KrisDS committed [r393]

    Extended grammar and parser to allow matching against trees (just the root, or in more detail).

  • mahesh mahesh posted a comment on discussion Open Discussion

    Hi Frank / Kris, I would like to generate Tree Listeners for the Koopa AST. Howvere thr utility you have built requires Tokens.list file as input.I could not find the Tokens.list file in the current version of Koopa (or the Build r356 which is the current download file version). Do you have any suggestions on 1. How to generate Tokens.list file for the current Koopa version OR 2. How to genearte Tree Listener without Tokens.list file? Thanks, Mahesh

  • Koopa Cobol Parser Koopa Cobol Parser released /koopa-r392.jar

  • Frank Becker Frank Becker created ticket #66

    COPY REPLACING LEADING produces wrong ast

  • KrisDS KrisDS committed [r392]

    Refactoring Source.

  • KrisDS KrisDS committed [r391]

    Syntactic sugar for %noskip.

  • KrisDS KrisDS committed [r390]

    Replaced compiler directives regexes with actua...

  • KrisDS KrisDS committed [r389]

    Tweaking the loggers.

  • KrisDS KrisDS committed [r388]

    Rewrite/Refactoring of the sources.

  • KrisDS KrisDS committed [r387]

    Optimizer

  • KrisDS KrisDS committed [r386]

    First pass at an omniscient debugger.

  • KrisDS KrisDS committed [r385]

    Added a GUI option to set some log levels inter...

  • KrisDS KrisDS modified ticket #33

    MF compiler directives

  • KrisDS KrisDS modified ticket #41

    Move support for embedded languages into dedicated grammars

  • KrisDS KrisDS posted a comment on ticket #41

    Added syntax in [r384]. E.g. sql::statement

  • KrisDS KrisDS committed [r384]

    Issue #41: added syntactic sugar for referencin...

  • KrisDS KrisDS posted a comment on ticket #65

    It should really just be "Koopa Parser Generator" now, as you can use it for plenty...

  • Simon Sobisch Simon Sobisch created ticket #65

    Spelling of COBOL compilers

  • KrisDS KrisDS posted a comment on ticket #41

    No, there are some hand-written forwarding methods in CobolBaseGrammar to make up...

  • Simon Sobisch Simon Sobisch posted a comment on ticket #41

    All missing syntactic sugar was added, wasn't it?

  • KrisDS KrisDS committed [r383]

    Missing %notempty's. Tweaking CALL statement SI...

  • KrisDS KrisDS committed [r382]

    Handling optional headers in Micro Focus Cobol.

  • KrisDS KrisDS committed [r381]

    Compiler directives: refactoring and more tests

  • KrisDS KrisDS committed [r380]

    Java 5 oops.

  • KrisDS KrisDS committed [r379]

    Support for tabs.

  • KrisDS KrisDS committed [r378]

    Support MF VARIABLE format

  • KrisDS KrisDS committed [r377]

    SQL: ALTER SESSION

  • KrisDS KrisDS committed [r376]

    XML PARSE WITH ENCODING, and related tweaks

  • KrisDS KrisDS committed [r375]

    Tweak possible branch orderings

  • KrisDS KrisDS committed [r374]

    Tweaking OCCURS clause.

  • KrisDS KrisDS committed [r373]

    Tweaking SIGN clauses

  • KrisDS KrisDS committed [r372]

    SQL: SELECT COUNT(*)

  • KrisDS KrisDS committed [r371]

    SELECT INTO host parameters

  • KrisDS KrisDS committed [r370]

    Separated CICS and SQL from the Cobol source code.

  • KrisDS KrisDS committed [r369]

    Updated the example project to match the latest...

  • KrisDS KrisDS committed [r368]

    DELETE statement improvements

  • KrisDS KrisDS committed [r367]

    Removed support for native code in grammars

  • KrisDS KrisDS committed [r366]

    Support for some bottom-up parsing. Big update.

  • KrisDS KrisDS committed [r365]

    LimitedStream.peek was forcing delayed markers,...

  • KrisDS KrisDS committed [r364]

    Handling comments in COPY REPLACE and pseudo li...

  • KrisDS KrisDS committed [r363]

    Refactoring BaseStream, reworking its 'seen' li...

  • KrisDS KrisDS committed [r362]

    Added tests for LimitedStream; some cleanup

  • KrisDS KrisDS committed [r361]

    Deleted these files as well.

  • KrisDS KrisDS committed [r360]

    Summer cleaning

  • KrisDS KrisDS committed [r359]

    Support floating point numbers.

  • KrisDS KrisDS posted a comment on ticket #22

    Yes, CONSTANT AS is covered by the constantEntry_level01 rule. RETRY and DYNAMIC...

  • Simon Sobisch Simon Sobisch posted a comment on ticket #22

    You've added CONSTANT AS in the meanwhile, did you? Likely something for a new ticket...

  • KrisDS KrisDS modified ticket #14

    "not all input was consumed": parsing of (optional) comma

  • KrisDS KrisDS modified ticket #20

    Bugs in "Export batch results to CSV"

  • KrisDS KrisDS modified ticket #22

    Parsing: Missing data types

  • KrisDS KrisDS posted a comment on ticket #22

    Given the nature and goals of Koopa I'm not going to add "not allowed" checks. I...

1 >