[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Message-String



Hi,

According to the helpfile (see below for the relevant part), XWPE can be
instructed to jump to the column of an error, but even with the GNU-fortran
compiler I cannot get it to work. When I compile my sample-program, which
deliberately contains an error on line 9:


      PROGRAM Test
      INTEGER i,j
      DO i=1,20
        IF (i.EQ.10) THEN
          j = 3000
          WRITE(*,*) j,' attention!'
	ELSE
	  j = i
          WRITE*,*) j
	ENDIF
      ENDDO
      END



with g77, then I get the following text on the messages-window:

##################################################################
test.f: In program `test':
test.f:9:
             WRITE*,*) j
                  ^
Invalid form for WRITE statement at (^)
##################################################################

I had selected compiler-type "other" and with the following message-string:

${?*:warning:}${FILE}:${LINE}:

With this string the editor-screen is activated and the cursor is set to
the first column of the correct line. This works. Now I tried to tell XWPE
that it can expect that the error-message is continued on a new line by
setting the message-string to:

${?*:warning:}${FILE}:${LINE}: ^M

(where I entered ctrl-M by just entering a "^"-character and an
"M"-character). With this message-string XWPE does not activate the
editor-screen anymore nor does the cursor move. I would have thought that
the final message-string would be something like:

${?*:warning:}${FILE}:${LINE}: ^M ${CMPSTR} ^M ${COLUMN=PREVIOUS?^}

!!!!!! Who can help me fix this problem? It's just the
GNU-fortran-compiler, so it can't be a problem... !!!!!!!!!


As a challenge for seasoned programmers, here is the error-message from our
'real' FORTRAN-compiler:

##################################################################
f90: Error: test.f, line 9: Syntax error, found '*' when expecting one of:
( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM>
<CHARACTER_CONSTANT> <INTEGER_CONSTANT> ...
          WRITE*,*) j
-----------------^
##################################################################

This consists of just three lines: one with the file-name, linenumber and
the nature of the error, on the second line the line of code containing the
error is given, the third line shows with a "^"-symbol where to find the
column of the error. --What would the message-string be for this
compiler?-- This one does not work:

${?*:warning:}${FILE}, line ${LINE}: ${CMPSTR} ^M ${CMPSTR} ^M
${COLUMN=PREVIOUS?^}

Thanks for any contribution,

Arjan







In the helpfile it says:

##################################################################
     The Message-String:

     The Message-String defines how warnings  and  error-messages
     produced  by  a  compilation  should  be  interpreted if the
     Compiler-Style 'Other' was selected. It has  to  be  changed
     for each compiler and work like this.

     character, '[a-z]' matches one character  in  the  range  of
     "a..z". (This was described in the section File-Manager.)

     ${FILE}
          is like '*' but the characters are stored  as  name  of
          the file containing the error.

     ${LINE[+-N]}
          is like '*' but the  characters  are  stored  as  line-
          number  containing  the  error.  An  integer  N  can be
          added/subtracted to the line-number.

     The message-string has to contain both ${FILE} and  ${LINE}.
     If a line of output can be interpreted so that it contains a
     valid filename and a valid line number it is used as  error-
     output.

     Also the column number can be used to  interpret  an  error-
     containing line.

     ${COLUMN[+-N]}
          With ${COLUMN} being used as number.

     ${COLUMN=BEFORE[+-N]}
          The string ${COLUMN} is the expression  to  search  for
          and the column is Before the string found.

     ${COLUMN=AFTER[+-N]}
          The string ${COLUMN} is the expression  to  search  for
          and the column is after the string found.

     An integer N can be added/subtracted to the column-number.

     If a message is written in more than one row (e.g. Sun- Pas-
     cal:  pc) the message-string must contain CRs (^M) to divide
     the string into different rows.  ${COLUMN=PREVIOUS?STR[+-N]}
     is compared against the ${CMPSTR}-string containing a string
     to compare with.

     Warnings:
          A warning is detected by comparison with a  string  STR
          like  this:  ${?N:STR}  -  N  can be a number or a '*'-
          character. If N is a number then N is  then  number  of
          the  column where the warning begins. Otherwise if N is
          '*' then STR can begin at every position in  the  text.
          More than one warning-message can be defined.

     Some examples:

          gcc: ${?*:warning:}${FILE}:${LINE}:* before \
                                         `${COLUMN=BEFORE}'

          cc(Sun): ${?*:warning:}"${FILE}", line ${LINE}:* \
                                  at or near * "${COLUMN=AFTER}"

          cc(HP): ${?*:warning:}cc: "${FILE}", line ${LINE}:* \
                                   at or near * "${COLUMN=AFTER}"

          pc(Sun): ${?0:e}${?0:w}${?0:s}*:*:* * ${FILE}:^M^M* \
                ${LINE}  ${CMPTXT}^M*-------${COLUMN=PREVIOUS?^}
##################################################################




Arjan van Dijk
Institute for Marine and Atmospheric Research Utrecht
Faculty of Physics and Astronomy
Utrecht University
Princetonplein 5
NL - 3584 CC  Utrecht
The Netherlands

phone: +31 30 2532815
fax:   +31 30 2543163
e-mail: mailto:A.vanDijk@phys.uu.nl
homepage: http://www.phys.uu.nl/~vndijk