Emacs regex to grok csc compilation errors
People have asked about this. This is the regular expression I use to allow emacs' next-error function to handle csc error messages. It is included in the emacs.el that I published previously. Here it is excerpted for convenience.
;; to allow next-error to work with csc.exe:
(setq compilation-scroll-output t)
(setq-default compilation-error-regexp-alist
; (append
'(
; Microsoft VJC:
;sample.java(6,1) : error J0020: Expected 'class' or 'interface'
("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)[,]\\([0-9]+\\)): \\(error\\|warning\\) VJS[0-9]+:" 1 3 4)
;; dinoch - Wed, 04 Aug 2004 09:29
;; handle whitespace at beginning of line (for nant output)
;;
;C# Compiler
;t.cs(6,18): error SC1006: Name of constructor must match name of class
;
("[ \t]*\\(\\([_a-zA-Z:\]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)[,]\\([0-9]+\\)): \\(error\\|warning\\) CS[0-9]+:" 1 3 4)
; Microsoft C/C++:
; keyboard.c(537) : warning C4005: 'min' : macro redefinition
; d:\tmp\test.c(23) : error C2143: syntax error : missing ';' before 'if'
;VC EEi
;e:\projects\myce40\tok.h(85) : error C2236: unexpected 'class' '$S1'
;myc.cpp(14) : error C3149: 'class System::String' : illegal use of managed type 'String'; did you forget a '*'?
("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \
: \\(error\\|warning\\) C[0-9]+:" 1 3)
)
;; compilation-error-regexp-alist)
)