Compiler Errors
Posted: Thu Jul 19, 2012 5:58 pm
I'm working with a COBOL compiler on an AS/400, and would like to integrate it with Zeus. There are a number of tasks that need to be accomplished for this, but one key one is to be able to take the error list from the compiler and integrate it with Zeus's normal compile error handling, i.e. show the errors, be able to go to the source file, step through the errors while in the source file, etc.
As a first step, I've prepared a file that I think should work. It looks kind of like tool output - a file name, line # in file name (parenthesized), then error text. To test, I created the error file by hand, then used the command "type error.file" as the compile command, thus producing standard output that contains the error messages. This command is in a CMD file. I see the file in a compiler window as a result. A sample line from the error file is:
The error text begins with the *, with the number after that being a statement number in the listing file produced by the compiler, which I've used to translate to source file name and line number.
My problem is that when I move to the first "error" and press Enter, Zeus displays the message "The current document does not have any associated compiler errors." I've configured both a Lines regex and an Errors regex which should identify the line # and a line containing an error message, respectively. These are the 2 that the documentation implies are necessary. I've also configured a filename regex.
where the single quotes are NOT included, just there to show spacing.
The other, minor, issue, is probably related to the way I'm just handing over this file as the errors. When I compile, Zeus shows me a message that says "Compilation completed successfully." I tried putting "exit /b 1" in my CMD file, but the result is the same. What does Zeus use to determine whether the compile succeeded or failed? I thought it was the exit code, but perhaps that exit statement isn't doing what I thought it did.
So my questions are:
1) What do I have to do to let Zeus know that the compile failed?
2) What does the error message file need to look like in order to support the full range of Zeus's compiler output handling?
3) Is there something else I need to do to associate the stdout results with the document I tried to compile?
As a first step, I've prepared a file that I think should work. It looks kind of like tool output - a file name, line # in file name (parenthesized), then error text. To test, I created the error file by hand, then used the command "type error.file" as the compile command, thus producing standard output that contains the error messages. This command is in a CMD file. I see the file in a compiler window as a result. A sample line from the error file is:
Code: Select all
"C:\<directory structure>\PTWOC0400A.CBL" (483) * 1672 MSGID: LNC1326 SEVERITY: 30 SEQNBR: 048300 '2320-HEADERS' not defined name. Statement or clause ignored.
My problem is that when I move to the first "error" and press Enter, Zeus displays the message "The current document does not have any associated compiler errors." I've configured both a Lines regex and an Errors regex which should identify the line # and a line containing an error message, respectively. These are the 2 that the documentation implies are necessary. I've also configured a filename regex.
Code: Select all
Lines Regex: '\([0-9]+\)'
Errors Regex: ' MSGID: '
Filename Regex: '^"([^"]+)"'
The other, minor, issue, is probably related to the way I'm just handing over this file as the errors. When I compile, Zeus shows me a message that says "Compilation completed successfully." I tried putting "exit /b 1" in my CMD file, but the result is the same. What does Zeus use to determine whether the compile succeeded or failed? I thought it was the exit code, but perhaps that exit statement isn't doing what I thought it did.
So my questions are:
1) What do I have to do to let Zeus know that the compile failed?
2) What does the error message file need to look like in order to support the full range of Zeus's compiler output handling?
3) Is there something else I need to do to associate the stdout results with the document I tried to compile?