-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in walking through AST due to comment statements #98
Comments
https://github.com/aws-samples/aws-mainframe-modernization-carddemo/blob/main/app/cbl/CBACT02C.cbl#L1 is not line format TANDEM (which would start with line indicator in column 1), but seems to be line format FIXED. Please consult proleap-cobol-parser/src/main/java/io/proleap/cobol/preprocessor/CobolPreprocessor.java Line 19 in a43c8c4
Best |
Thanks this helped! To get the PERFORM and CALL statements (which change the control flow of the program), I was trying to use the below code:
But it prints the below as output:
I need to get which PERFORM statements call which and which PROGRAMs CALL which other PROGRAMs (kind of like a dictionary with key being the caller and value being the called). How can I do this using Proleap COBOL parser? I tried different functions of |
Hello @sundar-sarvam , so in my understanding you want to navigate in the ASG (1) from a called Paragraph to all ProcedureCalls calling the Paragraph, and then (2) from each ProcedureCall to the containing PerformStatement. (1) already works in your example. (2) probably should work by calling ASGElement.getParent() on each ProcedureCall, which might give you a PerformProcedureStatement, and a second getParent() might give you the PerformStatement. You could write a helper function which calls getParent recursively until a certain condition is met or certain ancestor class has been found. I did not implement this to try it out, but I am quite sure this should work. Else you can paste your code and I can take a look. Best |
Thanks @uwol . I will implement whatever you have mentioned. Also can you point to some examples where |
Hi,
Best |
I am trying to run the parser with this COBOL file (with the full repo downloaded): https://github.com/aws-samples/aws-mainframe-modernization-carddemo/blob/main/app/cbl/CBACT02C.cbl ( I think this is IBM dialect only). But I get the below error due to a comment line:
* You may obtain a copy of the License at
):Full error:
This isn't expected right?
My Java app:
Any clue why this might happen and workarounds for same? My aim is to find line range in a code file for different constructs like if-else, perform end-perform, etc.
The text was updated successfully, but these errors were encountered: