Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Macro thoughts
Macro thoughts [message #19208] Thu, 20 November 2008 11:16 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I am getting ready about adding support of macros to C++ parser.

There is one hard issue there:

When any macro changes, it is often required to reparse a lot of files (all that use it).

As we parse files quite often (at least, at each file switch), this would be slow.

I am therefore trying to find some other, less complex way how to do that.

The simple way is to do it at compile time (if any macros have changed) and at user request. The downside is that sometimes the code database would be 'out-of-sync' (contain wrong information w.r.t. macros).

Is that acceptable? Any better ideas?

Mirek
Re: Macro thoughts [message #19209 is a reply to message #19208] Thu, 20 November 2008 12:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
luzr wrote on Thu, 20 November 2008 05:16


The simple way is to do it at compile time



Well, that is confusing term, I meant when you hit "Build"...

Mirek
Re: Macro thoughts [message #19213 is a reply to message #19209] Thu, 20 November 2008 15:57 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

If you collect information about which file is affected by particular macro I think this scenario could be applied - for macros used by one or two files assist should work imediatelly, for rest before build process. Some kind of simple heuristics.
Re: Macro thoughts [message #19214 is a reply to message #19213] Thu, 20 November 2008 18:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
unodgs wrote on Thu, 20 November 2008 09:57

If you collect information about which file is affected by particular macro I think this scenario could be applied - for macros used by one or two files assist should work imediatelly, for rest before build process. Some kind of simple heuristics.



Uhm, is it worth the trouble? Smile

OTOH, not a bad idea.

Mirek
Re: Macro thoughts [message #19215 is a reply to message #19214] Thu, 20 November 2008 18:53 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

luzr wrote on Thu, 20 November 2008 12:29

unodgs wrote on Thu, 20 November 2008 09:57

If you collect information about which file is affected by particular macro I think this scenario could be applied - for macros used by one or two files assist should work imediatelly, for rest before build process. Some kind of simple heuristics.



Uhm, is it worth the trouble? Smile

OTOH, not a bad idea.

Mirek

The only rason it's worth the trouble is a case when you edit macro used only in current file and you use this macro in this file so you can have correct intelisense.
I think for now you could parse files only before build. It should be enough. I didn't write any macro since one/two years..
I just gave you an idea because you were asking Smile
Re: Macro thoughts [message #19216 is a reply to message #19215] Thu, 20 November 2008 19:20 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
unodgs wrote on Thu, 20 November 2008 12:53

luzr wrote on Thu, 20 November 2008 12:29

unodgs wrote on Thu, 20 November 2008 09:57

If you collect information about which file is affected by particular macro I think this scenario could be applied - for macros used by one or two files assist should work imediatelly, for rest before build process. Some kind of simple heuristics.



Uhm, is it worth the trouble? Smile

OTOH, not a bad idea.

Mirek

The only rason it's worth the trouble is a case when you edit macro used only in current file and you use this macro in this file so you can have correct intelisense.
I think for now you could parse files only before build. It should be enough. I didn't write any macro since one/two years..
I just gave you an idea because you were asking Smile



The file edited would be reparsed anyway, it always is.

Well, I guess this should work Smile

Mirek
Re: Macro thoughts [message #19241 is a reply to message #19216] Sat, 22 November 2008 19:17 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Is there a backgrounf file reparsing?
The best IMO would be unodgs proposal as "quick try", the background processing to acquire more exact results.
Re: Macro thoughts [message #19242 is a reply to message #19241] Sat, 22 November 2008 19:41 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Sat, 22 November 2008 13:17

Is there a backgrounf file reparsing?
The best IMO would be unodgs proposal as "quick try", the background processing to acquire more exact results.


Background reparsing is though job.

Mirek
Re: Macro thoughts [message #19451 is a reply to message #19208] Thu, 04 December 2008 13:44 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
Hello, Mirek.

I think, you can see "mcpp - a portable C preprocessor" code, released under BSD-style-license.
I'm already use it before Doxygen.
Re: Macro thoughts [message #19452 is a reply to message #19451] Thu, 04 December 2008 14:02 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Sender Ghost wrote on Thu, 04 December 2008 13:44

Hello, Mirek.

I think, you can see "mcpp - a portable C preprocessor" code, released under BSD-style-license.
I'm already use it before Doxygen.


How fast it is? Can it improve compilation time of UPP, if it will be used for preprocessing and let gcc/MSC just to compile?
Anybody with enough free time on hands to try? Smile
Re: Macro thoughts [message #19454 is a reply to message #19451] Thu, 04 December 2008 15:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Sender Ghost wrote on Thu, 04 December 2008 07:44

Hello, Mirek.

I think, you can see "mcpp - a portable C preprocessor" code, released under BSD-style-license.
I'm already use it before Doxygen.


It would be interesting if I would plan to do C++ compiler.

For our purpose, we need something different.

In fact, parsing is not a problem with macros. The problem is the whole structure. We cannot preprocess files the same way as C++ compiler does - that would be too slow for A++.

Mirek
Re: Macro thoughts [message #19458 is a reply to message #19208] Thu, 04 December 2008 17:58 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
luzr


It would be interesting if I would plan to do C++ compiler.

For our purpose, we need something different.

In fact, parsing is not a problem with macros. The problem is the whole structure. We cannot preprocess files the same way as C++ compiler does - that would be too slow for A++.

Mirek


Ok, no problem here. Just to note.
I suggest you some modes for preprocessor part of A++:
- Current mode: Current OS, compiler and configuration.
- Free mode: All OS'es, compilers (and configuration).
mr_ped


How fast it is? Can it improve compilation time of UPP, if it will be used for preprocessing and let gcc/MSC just to compile?
Anybody with enough free time on hands to try?


Would be slow. It's not my point. I thinking Mirek have some troubles with preprocessing. He haven't.
Re: Macro thoughts [message #19459 is a reply to message #19458] Thu, 04 December 2008 18:34 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Sender Ghost wrote on Thu, 04 December 2008 11:58

luzr


It would be interesting if I would plan to do C++ compiler.

For our purpose, we need something different.

In fact, parsing is not a problem with macros. The problem is the whole structure. We cannot preprocess files the same way as C++ compiler does - that would be too slow for A++.

Mirek


Ok, no problem here. Just to note.
I suggest you some modes for preprocessor part of A++:
- Current mode: Current OS, compiler and configuration.
- Free mode: All OS'es, compilers (and configuration).



Actually, it will be the second one:)

Mirek
Previous Topic: Has "file index" any fans?
Next Topic: Releases thoughts....
Goto Forum:
  


Current Time: Thu Apr 18 18:21:19 CEST 2024

Total time taken to generate the page: 0.02885 seconds