Re: Getting the output of compiler and filtering it



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?
.



Relevant Pages

  • Getting the output of compiler and filtering it
    ... If by any chance you are in some raining country, ... into a new splitted buffer and filter the results a little. ... 2.for: Error: Syntax error, found ',' when expecting one ...
    (comp.editors)
  • Re: usb camera filter driver
    ... I am newbie, i am learning to write driver, sorry you if i have any ... I want write filter driver because i want modify webcam stream, ... // Output buffer length ...
    (microsoft.public.development.device.drivers)
  • Re: Got them allocator blues...
    ... What I do here is copy the input pin allocator requirements, ... If I set the buffer to accept ... >ARGB it puts a colour space convertor before AND after the filter! ... This is the ONLY media type I ever see in my ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: MATLAB Compiler 4.6 Problems
    ... When I try to compile a file from MATLAB into a stand alone C++ ... 146 syntax error; found `void' expecting `;' ... Error libmatrix.cpp: 147 illegal statement termination ...
    (comp.soft-sys.matlab)
  • cant compile *.f with mex function
    ... I have chosen compaq 6.6 and visual studio 6.0 with mex command.I didn't see any problem with them.I have integrated my fortran into visual studio by manual setting. ... Error iricira.f: 1 syntax error; found `cira' expecting `;' Error iricira.f: 1 syntax error; found `.' ... Error iricira.f: 1 syntax error; found `number' expecting `;' Error iricira.f: 1 syntax error; found `can' expecting `;' Error iricira.f: 1 syntax error; found `be' expecting `;' Error iricira.f: 1 syntax error; found `found' expecting `;' Error iricira.f: 1 syntax error; found `at' expecting `;' Error iricira.f: 1 syntax error; found `the' expecting `;' Error iricira.f: 1 syntax error; found `end' expecting `;' Error iricira.f: 1 syntax error; found `of' expecting `;' Error iricira.f: 1 syntax error; found `this' expecting `;' Error iricira.f: 1 syntax error; found `comment' expecting `;' Error iricira.f: 2 syntax error; found `c' expecting `;' Error iricira.f: 2 syntax error; found `--' expecting `;' Error iricira.f: 2 unrecognized declaration Error iricira.f: 2 unrecognized declaration Error iricira.f: 2 unrecognized declaration Error iricira.f: 2 unrecognized declaration Error iricira.f: 2 unrecognized declaration Error iricira.f: 2 too many errors ...
    (comp.soft-sys.matlab)