|
A regular expression would be simple to do the "// TODO:" searches and output the results to wherever. But I think VS.NET already does this for you in their tasklist addin. And also just doing a strstr would be faster and less involved then using a regex set. As for parsing C++ templates you'd have to incorporate into your regex parser the grammer for C++ templates which most people would probably just pull out of gcc and use flexx/bison (lex/yacc) to build up what they needed to parse the c++ templates which would do the regular expressions for you. Then you just plug into the grammer where needed to generate what you wanted at the times you wanted it.
As for printing your voice mail. Hook your VMail system up to a Speech to Text(S2T) system and then connect your S2T sytem to a parrellel port that connects to your printer. Then push your VMail into the S2T the output of the S2T into the printer to get your vmail to paper and thus printed.
Cheers,
-Erik
|
|
|
|
|
Erik Thompson wrote:
But I think VS.NET already does this for you in their tasklist addin
It's actually not for C++ it's for PHP and the editor I use doesn't support VS addins i'm afraid
The TODO I already have figured out
Erik Thompson wrote:
As for parsing C++ templates you'd have to incorporate into your regex parser the grammer for C++ templates which most people would probably just pull out of gcc and use flexx/bison (lex/yacc) to build up what they needed to parse the c++ templates which would do the regular expressions for you. Then you just plug into the grammer where needed to generate what you wanted at the times you wanted it.
I'm looking for simplicity in development and I have a helluva time understanding parsing grammers...i've already looked into Spirit and i'm not exactly blown away by it's ease of use...I need just a simple doc gen so i care not if it's inefficient...
I want to use regex because I figured it would be easier to do something like:
1) Find any TODO: which folows directly after // or /* and continues until end of line or corresponding */ is found (if applicable)
2) Find all characters after TODO: and before EOL or */
Thats my TODO list
As for finding classes (im thinking):
1) find class cls_name{}
2) Extract the class name and store in vector
3) Get any comments preceeding class declaration which have a \brief switch directly after // or /*
4) Extract each of classes member functions and variables
5) Pull comments about each member as well
Once i've complied a couple vectors with this information I figure I could easily generate HTML docs
And i'd be happy
Erik Thompson wrote:
As for printing your voice mail. Hook your VMail system up to a Speech to Text(S2T) system and then connect your S2T sytem to a parrellel port that connects to your printer. Then push your VMail into the S2T the output of the S2T into the printer to get your vmail to paper and thus printed.
That was actually a .... IT pet peeves list??? of the ten most annoying questions asked by complete idiots or something along those lines...when I read it...I laughed, thought it was funny so I use it as my sig
To bad I didn't keep that link I could send them your answer so they can finally answer their clients
Cheers
How do I print my voice mail?
|
|
|
|
|
Hockey wrote:
It's actually not for C++ it's for PHP
I'm a bit confused - so If I've got it wrong and you actually want to parse PHP please forgive me .
If it is C++ that you want to parse my suggestion is that you don't even try. It's far too hard - use something else someone has already done. Even doxygen, which is brilliant at what it does, clearly states that there are problems with the parser (I've never seen them, but I'm sure that the Doxygen team would know). Doxygen does however ship with source, and with some (rather large) tweaks i'm sure you could get it to output what you needed.
If you've looked at spirit it might be worth looking at boost::regex which contains at least a partial scan of a C++ file for keywords and classes, but I doubt that's what you're looking for.
If you need to get more information than doxygen (especially the XML output of doxygen) can provide, I strongly suggest you at least check out GCC-XML[^] which outputs the GCC compiler database to XML - everything except for method bodies (which you didn't ask for) and comments (which you seem to have sorted anyway) are included in the output.
GCCXML was a pain to set it up to work inside VS.NET but it works quite well unless you use huge numbers of templates (eg/ the boost libraries) and then the problem comes down to the (albeit small) differences in the way Microsoft and GCC compilers parse code. The output files from GCCXML are enormous, so finding good ways to filter out the data that you don't want is critical.
Good Luck!
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Andrew Walker wrote:
If you've looked at spirit it might be worth looking at boost::regex which contains at least a partial scan of a C++ file for keywords and classes, but I doubt that's what you're looking for.
I'm using boost actually but I couldn't find the C++ scan example??? I'll have to look again...i'm not actually parsing C++ just extracting some details like
DOxygen...
probably a little less
How do I print my voice mail?
|
|
|
|
|
Have a look at:
boost_1_31_0\libs\regex\example\snippets\regex_grep_example_1.cpp
but all the examples are pretty good, I think one is even a pretty printer for C++ code
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Well you probably would have to make a parser yourself, probably search a specified file(s)/folder(s) and then search through them for '//TODO:' and then use getline or copy the contents until you come up to a \n
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
|
Hello,
I am an experienced C++ programmer especially on the Win32 platform (MFC, Win32 API, etc.). I am limited experience on intensive graphics programming including OpenGL and DirectX. I have some general questions about graphics programming.
1) I often read about how DirectX does not work well with MFC. Is that accurate?
2) Is DirectX platform independent?
3) Is OpenGL platform independent?
4) What do graphics programmers including gamers use: DirectX or OpenGL?
5) What is more extensible, and essentially, better graphics API on the Win32 platform? What are some good books for learning this graphics programming tool?
6) What is the future of graphics programming especially on the Windows platform?
As you can see, my experience and knowledge in graphics programming is quite limited. I'd appreciate any insight.
Thanks,
Kuphryn
|
|
|
|
|
1) I often read about how DirectX does not work well with MFC. Is that accurate?
Sounds like a complaint from someone who didn't understnad how to use MFC very well, but then again I could be wrong.
2) Is DirectX platform independent?
No it's only for the Win32/x86 platform.
3) Is OpenGL platform independent?
Yes it is, OpenGL runs on linux, unix, irix, OSX, Win32, Solaris, and several other platforms.
4) What do graphics programmers including gamers use: DirectX or OpenGL?
My understanding is that if you're going to write games, particularly for Win32, DirectX is slightly better as it has a number of features that are specifically targetted at game programmers. However if you are going to write CAD/3D modeling, etc kind of applications, especially if they require high precision, then OpenGL is much better.
5) What is more extensible, and essentially, better graphics API on the Win32 platform?
I personally dislike COM intensely, and DirectX is all COM, unless you want to start using the new managed DirectX libs. I personally would prefer OpenGL.
6) What is the future of graphics programming especially on the Windows platform?
Well, aparently it is all gonna be Avalon, and managed API's. GDI's days are numbered, supposedly. I take all of this with a grain of salt though.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
|
A couple of OpenGL references
1. Try the Red Book[^]. Very extensive.
2. Try Gamedev's OpenGL tutorials[^] for OpenGL
and
3. Gamedev's DirectX tutorials[^] for DirectX
i hope this helps
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
This is a great question, and, I know too little about it.
However, I would recommend Feng Yuan's book,
"Windows Graphics Programming", published 2000, written for the Windows 2000 platform; it is all about a non-MFC, C++ class approach to high quality graphics. It includes a section on DirectX, but, no OpenGl.
Everything I know about graphics I learned from this book.
The author includes a CD with a huge library of professional quality Windows graphics classes source code and dozens of really useful demo programs.
www.fengyuan.com[^]
|
|
|
|
|
I saw this a few years ago in a bookstore and almost bought it. Is it as good as it looks - I glanced through it and it seemed really good.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
It's an awesome book, even if GDI+ makes much of it now redundant.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
kuphryn wrote:
I often read about how DirectX does not work well with MFC. Is that accurate?
That's the most stupid thing I ever heard. I spent two years working on a project that mixed DX with MFC and never once heard a complaint. We only ditched MFC to start on a version that used our own windowing library, written in Python.
kuphryn wrote:
Is DirectX platform independent?
Nope
kuphryn wrote:
Is OpenGL platform independent?
I believe so, that is, there are GL implimentations for multiple platforms.
kuphryn wrote:
What do graphics programmers including gamers use: DirectX or OpenGL?
My understanding is that a lot of games get written for both, as some cards work better with DX, some with GL. I reckon DX will win in the end.
kuphryn wrote:
What is more extensible, and essentially, better graphics API on the Win32 platform? What are some good books for learning this graphics programming tool?
There are two Open GL books, the red and blue books ( forget the names, but the covers are red and blue ). One is a 3D programming reference, the other a GL libray reference. The trouble with DX is it changes so often, most books written are obsolete as they hit print. Better off to buy the GL books for 3D concepts, and use the DX SDK docs.
kuphryn wrote:
What is the future of graphics programming especially on the Windows platform?
In my experience:
Most gaming companies do not make a profit, meaning that games programmers often are people who change jobs a lot. General graphics coding is the sort of thing that can make you a lot of money, as it's specialised. I get a bit of contract work in graphics even nowadays, and I've been doing web stuff for my day job for a couple of years now. However, demand has got to be low, how many paint packages does the world need ? Scientific/medical work may be a whole different ball game. It's lots of fun and really interesting though, that's why I keep doing it.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I'd never done any DirectX before January, and only enough MFC to get me by in some smallish tools, but I found that these papers made getting going much easier:
Integrating Direct3D9.0 With MFC[^] helped me to get going with the basic concepts. One thing that I found made it much easier to work with was to write my own AppWizard to generate the basic code discussed in the article.
Creating 3D Tools with MFC[^] was another article which helped alot, even though it discusses OpenGL the splitter window design pattern and MFC code to get it going has made writing and extending application much easier.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
One reason I am asking so many questions about graphics programming is because I've found that there are very few graphics programming books. For example, if you were to search Amazon, say, database programming, you'd see many more results than graphics programming. My point is there are very few books on graphics programming.
I read that the one drawback to graphics programming using OpenGL on the Win32 platform is the fact that MS does not update the to the latest OpenGL library, which is 1.4. MS only port up to version 1.1 or 1.2. Secondly, version 2.0 is already in the works. However, there is no plan to port it to the Windows platform.
Right now I am seriously considering these two books. One is on OpenGL. The other book is on graphics programming in C++. Both are very expensive and I do not want to buy the wrong book.
OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 1.4, Fourth Edition
http://www.amazon.com/exec/obidos/tg/detail/-/0321173481/qid=1084372965/sr=8-1/ref=pd_ka_1/002-9611673-6764029?v=glance&s=books&n=507846
Computer Graphics with OpenGL (3rd Edition) by Donald Hearn and M. Pauline Baker
http://www.amazon.com/exec/obidos/tg/detail/-/0130153907/ref=pd_sim_books_3/002-9611673-6764029?v=glance&s=books
Please give inputs if you have read them. Also, other recommendations and good online tutorials would be greatly appreciated.
Kuphryn
|
|
|
|
|
I just learn windows programming, so maybe this question has somewhat of ridiculous.
typedef struct {
HWND hwnd;
UINT message;
WPARAM wParam;
LPARAM lParam;
DWORD time;
POINT pt;
} MSG, *PMSG;
What is the usage of the last two parameter?
|
|
|
|
|
the time is probably system time, or perhaps ticks - allowing you to, at the very least, determine the time delta's between events.
The pt field is a point of where the cursor was for this event. I don't know if it's always valid, or if it is in screen coords or in client coords. Check MSDN to be sure.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
In window procedure, we use the switch-case to choose a message which we want to deal with. However, this window procedure doesn't get the last two parameters. How can I get the last two parameters?
|
|
|
|
|
use GetMessagePos and GetMessageTime
|
|
|
|
|
windows program's running depends on the driving of the event .the program continually wait (using the "while "loop below)
winMain(.....)
{Msg msg;
....
while(GetMessage(&msg))//get the messge from the message queue
{TranslateMessage(....);//judge where is the message from
DispatchMessage(......);//dispath the message
}
...}
os capture any possible input ,then they go into the program by the form of message.the leading role to receive and treat with message is window,every window should have a function(window function)to be responsible for treating with message.
by the help of USER MODULE of os ,the message is dispatched the corresponding window function
that is:WndProc(hwnd,msg,wParam,LParam)
{
switch(msg)
{case wm_create:..
case wm_xxx:..
.....
}
}
that is all,;P
|
|
|
|
|
I mean that WndProc(&MSG) may be a better choice, but the win system use WndProc(hwnd,msg,wParam,LParam), why?
|
|
|
|
|
Is there anyone make a catalog of the essential APIs which a beginner should know?
|
|
|
|
|
I need to write two programs for my algo class...
1) I have to compare the insertionSort, MergeSort and QuickSort on an array of million chars using rand() and clock()...
2) Compare the number of leaves of a binary tree (I have to think recursively)
If anyone can help please do...it has to be done in C...Please anyone help...
TS
|
|
|
|
|
"Help me" is not the same as "do it for me." Show us the code that is giving you trouble, and you're bound to get help.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|