uwol / proleap-cobol-parser

ProLeap ANTLR4-based parser for COBOL
MIT License
136 stars 74 forks source link

Latest API changes #7

Closed albertolovato closed 7 years ago

albertolovato commented 7 years ago

Latest snapshot of cobol85parser broke my code, since the method io.proleap.cobol.asg.metamodel.procedure.Statement#getChildren() is missing. In particular, I need to find linear sequences of statements in Cobol code - or equivalently the statement following a given other statement - and I used the following recursive code:

    // outer sequence is the list statements
    for (Statement s : statements) {
        for (ASGElement c : s.getChildren()) {
            if (c instanceof Scope) {
                Scope scope = (Scope) c;
                // recurse on scope.getStatements()
            }
        }
    }

Is there a way now to do this?

By the way, is there a more stable JAR online, or should I freeze a local copy of the repository and include the JAR in my project?

Thank you

uwol commented 7 years ago

Ah, sorry for that. I'll take a look at that API change and make it available again. In between, you can freeze the JAR by putting the commit hash in the version field.

<dependency>
  <groupId>com.github.uwol</groupId>
  <artifactId>cobol85parser</artifactId>
  <version>0654e9729b4410932acdfbf4c32a54ddd25b7306</version>
</dependency>

The repo will be under work for the next two weeks, then things should settle.

uwol commented 7 years ago

io.proleap.cobol.asg.metamodel.procedure.Statement#getChildren() should be available again. I have added a unit test ASGElementTest.java, so that it doesn't get lost in the future.

albertolovato commented 7 years ago

I freezed the JAR on the latest commit, and it works. Thank you very much!