Bug 88976 - Need a handle to the code that parses the compiled output and feeds the output window
Need a handle to the code that parses the compiled output and feeds the outp...
Status: NEW
Product: cnd
Classification: Unclassified
Component: Project
5.x
Sun All
: P2 (vote)
: 6.x
Assigned To: issues@cnd
issues@cnd
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-08 22:21 UTC by Chihin Ko
Modified: 2014-04-14 14:35 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chihin Ko 2006-11-08 22:21:00 UTC
The build output of fix&cont needs a handle to the code that parses the output
and feeds the output window for laborating hyperlink for errors.


email exchange between Jean and Thomas

I think what you really need is a handle not the io window but to the 
code that parses the output and feeds the output window. That would 
solve your problem. You can file an IZ against CND and we can see when 
it can get fixed but I cannot promise you a fix anytime soon. I think 
you should reconsider getting the information out of dbx and have 
NativeExecutor do all the work.

--thomas

Thomas Preisler wrote:

>>
>>
>> CHIHIN KO wrote:
>
>>>> Thomas Preisler wrote On 06?11?01? 09:05 ??,:
>>>>  
>>
>>>>>> OK, I see now from the source that if you pass in a stream of 
>>>>>> characters in to the IO windows, they will not get parsed for 
>>>>>> errors. I think your best bet is to use NativeExecutor to do the 
>>>>>> compilation . Or you can
>>>>>> handle the error parsing parsing and creating the hyperlinks your self.
>>>>>>     
>>
>>>>
>>>> I can not have NativeExecutor to do the compilation, you did the
>>>> fix&cont and dbx, remember ?
>>>>   
>
>> Couldn't you ask dbx for the command and just have NativEexecutor do it?
>
>>>> Where is the  mechnism of parsing compilation error and create 
>>>> hyperlinks ?
>>>>   
>
>> It's embedded in org.netbeans.modules.cnd.execution.OutputWindowWriter.
>>
>> --thomas
>
>>>>  
>>
>>>>>> --thomas
>>>>>> CHIHIN KO wrote:
>>>>>>
>>>>>>    
>>>
>>>>>>>> I managed dbx to generate a plain compile output and
>>>>>>>> feed it into output view that provided by cnd, as you
>>>>>>>> suggested, but the output view does not do hyperlinks,
>>>>>>>> do I need to do anything special ? or is the format of
>>>>>>>> data can't be recognized ?
>>>>>>>>
>>>>>>>> The data that feed into output view look like these :
>>>>>>>>
>>>>>>>> Fix and Continue: 0 out of 1 succeeded.
>>>>>>>> (/home/jeanko/SunStudioProjects/Welcome)welcome.cc:
>>>>>>>> "welcome.cc", line 24: Error: Can only use this within a non-static
>>>>>>>> member function.
>>>>>>>> "welcome.cc", line 24: Error: is is not defined.
>>>>>>>> "welcome.cc", line 24: Error: compile is not defined.
>>>>>>>> "welcome.cc", line 24: Error: error is not defined.
>>>>>>>> "welcome.cc", line 24: Error: Badly formed expression.
>>>>>>>> 5 Error(s) detected.
>>>>>>>> :(/home/jeanko/SunStudioProjects/Welcome)welcome.cc
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Thx,
>>>>>>>>
>>>>>>>> - Jean
>>>>>>>>
>>>>>>>> Thomas Preisler wrote On 06?11?01? 03:44 ??,:
>>>>>>>>  
>>>>>>>>
>>>>>>>>      
>>>>
>>>>>>>>>> I think you should set up NativeExecutor to do the compilation for 
>>>>>>>>>> you. Then hyperlinks and everything else would work. If you have 
>>>>>>>>>> dbx do the compilation, you could probably just feed the raw 
>>>>>>>>>> output (not html) into the io window and it will probably parse 
>>>>>>>>>> the output for errors and setup hyperlinks.
>>>>>>>>>>
>>>>>>>>>> --thomas
>>>>>>>>>>
>>>>>>>>>> CHIHIN KO wrote:
>>>>>>>>>>
>>>>>>>>>>   
>>>>>>>>>>        
>>>>>
>>>>>>>>>>>> Thomas Preisler wrote On 06?10?31? 07:30 ??,:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     
>>>>>>>>>>>>          
>>>>>>
>>>>>>>>>>>>>> It is long gone. You should use 
>>>>>>>>>>>>>> org.netbeans.modules.cnd.api.execution.NativeExecutor and 
>>>>>>>>>>>>>> org.netbeans.modules.cnd.api.execution.ExecutionListener 
>>>>>>>>>>>>>> instead. It will parse the output for compilation errors and set 
>>>>>>>>>>>>>> up hyperlinks to                      
>>>>>>
>>>>>>>>>>>> Does it take HTML format for compilation errors ? because that's 
>>>>>>>>>>>> what
>>>>>>>>>>>> dbx passover to dbxgui.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     
>>>>>>>>>>>>          
>>>>>>
>>>>>>>>>>>>>> source files, if that is what you want. I can point you to some 
>>>>>>>>>>>>>> code so you can see how to use it. Look at for instance
>>>>>>>>>>>>>> DefaultProjectActionHandler.java:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>                      
>>>>>>
>>>>>>>>>>>>                
>>>>
>>>>>>>>  
>>>>>>>>       
>>
>>>>
>>>>
Comment 1 Vladimir Kvashin 2007-10-26 11:16:44 UTC
I need similar, though a bit different thing.
It is connected with Syntax Error Highlighting (the feature that is planned for 6.1 and is now prototyped).
It launches compiler in background, parses its output and creates annotations.
Now, in prototype, it does its own, very primitive, parsing.
This is obviously; code that parses compiler should be shared.

Comment 2 Thomas Preisler 2009-10-23 03:45:10 UTC
Reassigning to Andrew. He is working on thisnow.
Comment 3 Alexander Simon 2009-11-17 02:06:33 UTC
NB 6.8 extends tool collection description.
Now it is possible to write own output parser.
To do this you should
- define service org.netbeans.modules.cnd.execution.ErrorParserProvider
- use service in tool collection scanner
For example see SunStudio tool collection description (SunStudio.xml).
It contains scanner description:
    <scanner id="SunStudio">
Scanner points on predefined service ErrorParserProvider implementation with id "SunStudio" (org.netbeans.modules.cnd.execution.impl.SUNErrorParserProvider).
So you can create own module with own tool collection and define own service.

Does it fix issue?


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo