home *** CD-ROM | disk | FTP | other *** search
- /* AREXX:Make.DME PUBLIC DOMAIN SOFTWARE
-
- Program to interface Aztec C 5.0 with the DME editor,
- a roll-your-own integrated environment.
-
- By Robert W. Albrecht
- 1457 Zion Way
- Ventura CA 93003
-
- How you run the program...
- From within the DME editor type Make from the command line or
- attach it to a menu or keyboard command.
-
- Here is what this program does....
- First CCOPTS is set to "-qfq" and the make program is executed.
-
- The the file AztecC.Err is read, parsed, and sent to a file called
- t:aztecerr.tmp, which contains the real line numbers of all of the
- errors. On the first error DME is instructed to open a new window
- with the file that has the error. For every error DME is instructed
- to go to the line where the error occurs and insert a comment of the
- form /* Oops!!! Line: 1 #4 argument type mismatch */. If there is
- more than one error for a line only the first one will be called out
- in a comment. Finally DME is instructed to go to the first error in
- the file.
-
- When the program is finished it closes t:aztecerr.tmp, deletes
- AztecC.Err and sets CCOPTS back to nothing. If you use some
- CCOPTS you may want to change the program.
-
- Notes...
- You can use the Bug.DME program to go to the next occurance of
- "Oops!!!" in the file you are editing.
-
- After fixing all of the errors in your program you may want to
- use the Clean.DME program to get rid of all of the "Oops" comments.
-
- */
-
- options failat 6
- rc=0
- openFlag=0
- lineNoOld=-1
- linesOut=0
- CfileOld=""
- Handle.inFile="InputFile"
- Handle.outFile="OutputFile"
- Name.inFile="AztecC.Err"
- Name.outFile="t:aztecerr.tmp"
-
- /* run make and look for the error file */
- call startup
- if ~exists(Name.inFile)
- then call cleanup(rc)
-
- openFlag.inFile=open(Handle.inFile,Name.inFile,'R')
- if openFlag.inFile=0
- then call cleanup(rc)
- openFlag.outFile=open(Handle.outFile,Name.outFile,'W')
- if openFlag.outFile=0
- then call cleanup(rc)
-
- /* Read all of the strings in the file */
- do until eof(Handle.inFile)
- str=readln(Handle.inFile)
- if eof(Handle.inFile)
- then leave
- else do
- parse var str Cfile '>' lineNo ':' colNo ':' Type ':' ErrorNo ':' Message
- if Cfile ~= CfileOld
- then do
- 'newwindow newfile ' || Cfile
- CfileOld=Cfile
- call writeln(Handle.outFile,"/* File: " || Cfile || " */")
- end
-
- if lineNo ~= lineNoOld
- then do
- msgLine="/* Oops!!! Line:" lineNo " #" || ErrorNo || " " || Message || " */"
- call writeln(Handle.outFile,msgLine)
- lineNoOld = lineNo
- 'goto' LineNo+linesOut
- 'insline'
- 'first'
- "(/* Oops!!! Line:" lineNo+linesOut || " #" || ErrorNo || " " || Message || " */)"
- linesOut=linesOut+1
- lineNoOld = lineNo
- end
- end
- end
- call cleanup(rc)
-
- /* CLEANUP
- * This procedure just cleans things up, closes files etc.
- */
- cleanup: procedure EXPOSE openFlag.inFile Name.inFile Handle.inFile,
- openFlag.outFile Name.outFile Handle.outFile
- arg i
- address COMMAND 'set CCOPTS='
- if openFlag.inFile == 1
- then do
- call close(Handle.inFile)
- address COMMAND 'delete' Name.inFile
- 'top'
- 'find (Oops!!!)'
- end
- if openFlag.outFile == 1
- then call close(Handle.outFile)
- exit i
-
- /* STARTUP
- * This procedure sets the QuickFix option for Aztec C and then runs make.
- */
- startup: procedure
- address COMMAND 'set CCOPTS=-qfq'
- address COMMAND 'make'
- return 1
-