Re: Getting the output of compiler and filtering it
- From: Karthick <karthick.gururaj@xxxxxxxxx>
- Date: Wed, 6 May 2009 00:47:37 -0700 (PDT)
On May 4, 11:18 am, Matjaz Pecovnik <matjaz.pecov...@xxxxxxxxxx>
wrote:
Hello everyone,
hope you're ok, that the weather's fine, and that you're not stuck in
some office while it's raining, and trying to solve this out.
If by any chance you are in some raining country, and have nothing
better to do, then perhaps you could help me with this thing ... I'd
appreciate any tip you can spare.
Generally, what I'm trying to do is to get the output of a compiler
into a new splitted buffer and filter the results a little.
The output usually looks like (yanked from the cmd.exe, so it looks a
bit broken)
**********************************************************************
C:\WINDOWS\system32\cmd.exe /c fl32 2.for
Compaq Visual Fortran Optimizing Compiler Version 6.6 (Update C)
Copyright 2003 Compaq Computer Corp. All rights reserved.
2.for
2.for(5) : Error: Syntax error, found '=' when expecting one of: (*::,
<END-OF-STATEMENT> ; : ) + . - % (/ [ ] /) . ** / > ...
ewind(unit=2)
----------------^
2.for(6) : Error: Syntax error, found ',' when expecting one
of:<END-OF-STATEMENT> ;
o 10 l=1,3
-----------------^
2.for(7) : Error: Syntax error, found '=' when expecting one
of:<LABEL> <END-OF-STATEMENT> ; BLOCK BLOCKDATA PROGRAM TYPE COMPLEX
BYTE CHARACTER ...
= x + 1
----------^
shell returned 1
Hit any key to close this window...
**********************************************************************
Let me just be clear that I'm not trying to get you to solve this for
me, since I'll be doing this for several compilers. I'd more like to
learn how to do this myself.
The function I'm writing is to try to get this output into a new
buffer, and filter it so that only these lines remain:
2.for(5) : Error: Syntax error, found '=' when expecting one of: ( *::
, <END-OF-STATEMENT> ; : ) + . - % (/ [ ] /) . ** / > ...
2.for(6) : Error: Syntax error, found ',' when expecting one
of:<END-OF-STATEMENT> ;
**********************************************************************
I know I can read it with :r into the current buffer, but I'm not sure
how ho read it (scripting) into a new buffer. Also, and this is the
part that's bugging me the most, is how to filter out the rest of the
lines which I don't need.
What do you think ?
Been searching the wiki a little, but haven't found anything helpful.
If you know something, anything, I'd appreciate the link.
with regards
Matjaz
You can do a :enew followed by :r!command.. to get the contents to a
new buffer
On filtering the lines, what algorithm would you use? All lines
starting with 2.for(N) (where "N" is a number) followed by a line
below? If so, why is "2.for(7) : Error: Syntax error, found '=' when
expecting one" not in your filtered list?
.
- References:
- Getting the output of compiler and filtering it
- From: Matjaz Pecovnik
- Getting the output of compiler and filtering it
- Prev by Date: Re: Using mapping in VIM to add in HTML?
- Next by Date: Re: --remote-silent (BUG?)
- Previous by thread: Getting the output of compiler and filtering it
- Next by thread: --remote-silent
- Index(es):
Relevant Pages
|